@hiai-gg/hiai-opencode 0.1.5 → 0.1.7

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 (180) hide show
  1. package/.env.example +21 -8
  2. package/AGENTS.md +60 -6
  3. package/ARCHITECTURE.md +6 -3
  4. package/LICENSE.md +0 -1
  5. package/README.md +113 -33
  6. package/assets/cli/hiai-opencode.mjs +668 -7
  7. package/assets/mcp/mempalace.mjs +159 -25
  8. package/config/hiai-opencode.schema.json +29 -3
  9. package/dist/agents/agent-skills.d.ts +7 -0
  10. package/dist/agents/bob/default.d.ts +1 -0
  11. package/dist/agents/bob/gemini.d.ts +1 -0
  12. package/dist/agents/bob/gpt-pro.d.ts +1 -0
  13. package/dist/agents/brainstormer.d.ts +7 -0
  14. package/dist/agents/coder/gpt-codex.d.ts +1 -1
  15. package/dist/agents/coder/gpt-pro.d.ts +1 -0
  16. package/dist/agents/coder/gpt.d.ts +2 -1
  17. package/dist/agents/designer.d.ts +7 -0
  18. package/dist/agents/dynamic-agent-core-sections.d.ts +4 -1
  19. package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -1
  20. package/dist/agents/strategist/gemini.d.ts +1 -0
  21. package/dist/agents/strategist/gpt.d.ts +1 -0
  22. package/dist/agents/types.d.ts +3 -1
  23. package/dist/config/index.d.ts +0 -1
  24. package/dist/config/platform-schema.d.ts +34 -6
  25. package/dist/config/schema/commands.d.ts +1 -0
  26. package/dist/config/schema/hooks.d.ts +0 -2
  27. package/dist/config/schema/index.d.ts +0 -2
  28. package/dist/config/schema/oh-my-opencode-config.d.ts +1 -9
  29. package/dist/config/types.d.ts +4 -4
  30. package/dist/create-hooks.d.ts +0 -2
  31. package/dist/features/builtin-commands/templates/doctor.d.ts +1 -0
  32. package/dist/features/builtin-commands/types.d.ts +1 -1
  33. package/dist/features/builtin-skills/skills/hiai-opencode-setup.d.ts +2 -0
  34. package/dist/features/builtin-skills/skills/index.d.ts +2 -0
  35. package/dist/features/builtin-skills/skills/website-copywriting.d.ts +2 -0
  36. package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
  37. package/dist/hooks/index.d.ts +0 -2
  38. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
  39. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
  40. package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +1 -1
  41. package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +1 -1
  42. package/dist/index.js +7719 -153698
  43. package/dist/mcp/index.d.ts +0 -1
  44. package/dist/mcp/registry.d.ts +1 -1
  45. package/dist/plugin/hooks/create-core-hooks.d.ts +0 -2
  46. package/dist/plugin/hooks/create-session-hooks.d.ts +1 -3
  47. package/dist/plugin/startup-diagnostics.d.ts +1 -0
  48. package/dist/shared/logger.d.ts +2 -0
  49. package/dist/shared/mcp-static-export.d.ts +22 -0
  50. package/dist/shared/mode-routing.d.ts +6 -0
  51. package/dist/tools/ast-grep/constants.d.ts +1 -1
  52. package/dist/tools/ast-grep/environment-check.d.ts +1 -5
  53. package/dist/tools/ast-grep/language-support.d.ts +0 -1
  54. package/dist/tools/ast-grep/types.d.ts +1 -2
  55. package/dist/tools/delegate-task/git-categories.d.ts +2 -0
  56. package/dist/tools/delegate-task/sub-agent.d.ts +2 -0
  57. package/dist/tools/skill-mcp/constants.d.ts +1 -1
  58. package/hiai-opencode.json +50 -19
  59. package/package.json +10 -5
  60. package/src/agents/agent-skills.ts +70 -0
  61. package/src/agents/bob/default.ts +7 -1
  62. package/src/agents/bob/gemini.ts +1 -0
  63. package/src/agents/bob/gpt-pro.ts +3 -1
  64. package/src/agents/bob.ts +3 -0
  65. package/src/agents/brainstormer.ts +72 -0
  66. package/src/agents/builtin-agents.ts +59 -3
  67. package/src/agents/coder/gpt-codex.ts +5 -3
  68. package/src/agents/coder/gpt-pro.ts +4 -2
  69. package/src/agents/coder/gpt.ts +3 -1
  70. package/src/agents/critic/agent.ts +1 -0
  71. package/src/agents/designer.ts +70 -0
  72. package/src/agents/dynamic-agent-category-skills-guide.ts +6 -0
  73. package/src/agents/dynamic-agent-core-sections.ts +36 -0
  74. package/src/agents/dynamic-agent-prompt-builder.ts +1 -0
  75. package/src/agents/guard/default.ts +1 -0
  76. package/src/agents/guard/gemini.ts +1 -0
  77. package/src/agents/guard/gpt.ts +1 -0
  78. package/src/agents/platform-manager.ts +17 -1
  79. package/src/agents/prompt-library/platform.ts +34 -0
  80. package/src/agents/researcher.ts +1 -0
  81. package/src/agents/strategist/gemini.ts +1 -0
  82. package/src/agents/strategist/gpt.ts +1 -0
  83. package/src/agents/types.ts +4 -1
  84. package/src/agents/ui.ts +1 -0
  85. package/src/config/defaults.ts +45 -13
  86. package/src/config/index.ts +0 -1
  87. package/src/config/model-slots-and-export.test.ts +73 -0
  88. package/src/config/platform-schema.ts +3 -3
  89. package/src/config/schema/commands.ts +1 -0
  90. package/src/config/schema/hooks.ts +0 -2
  91. package/src/config/schema/index.ts +0 -2
  92. package/src/config/schema/oh-my-opencode-config.ts +0 -5
  93. package/src/config/types.ts +4 -4
  94. package/src/features/builtin-commands/commands.ts +7 -0
  95. package/src/features/builtin-commands/templates/doctor.ts +43 -0
  96. package/src/features/builtin-commands/types.ts +1 -1
  97. package/src/features/builtin-skills/skills/hiai-opencode-setup.ts +69 -0
  98. package/src/features/builtin-skills/skills/index.ts +2 -0
  99. package/src/features/builtin-skills/skills/website-copywriting.ts +41 -0
  100. package/src/features/builtin-skills/skills.test.ts +8 -0
  101. package/src/features/builtin-skills/skills.ts +12 -1
  102. package/src/features/skill-mcp-manager/AGENTS.md +1 -1
  103. package/src/hooks/agent-usage-reminder/constants.ts +4 -4
  104. package/src/hooks/index.ts +0 -2
  105. package/src/hooks/keyword-detector/ultrawork/default.ts +18 -18
  106. package/src/hooks/keyword-detector/ultrawork/gemini.ts +21 -21
  107. package/src/hooks/keyword-detector/ultrawork/gpt.ts +6 -8
  108. package/src/hooks/keyword-detector/ultrawork/planner.ts +5 -5
  109. package/src/index.ts +8 -78
  110. package/src/internals/plugins/subtask2/commands/manifest.ts +2 -6
  111. package/src/internals/plugins/subtask2/hooks/command-hooks.ts +2 -2
  112. package/src/internals/plugins/subtask2/hooks/message-hooks.ts +1 -1
  113. package/src/internals/plugins/subtask2/parsing/parallel.ts +13 -10
  114. package/src/mcp/index.ts +0 -1
  115. package/src/mcp/registry.ts +27 -0
  116. package/src/plugin/chat-message.ts +0 -2
  117. package/src/plugin/hooks/create-session-hooks.ts +0 -17
  118. package/src/plugin/startup-diagnostics.ts +27 -0
  119. package/src/plugin-handlers/agent-config-handler.ts +3 -2
  120. package/src/plugin-handlers/mcp-config-handler.test.ts +63 -0
  121. package/src/plugin-handlers/mcp-config-handler.ts +29 -14
  122. package/src/plugin-handlers/strategist-agent-config-builder.ts +1 -1
  123. package/src/shared/agent-display-names.test.ts +9 -0
  124. package/src/shared/agent-display-names.ts +5 -0
  125. package/src/shared/log-legacy-plugin-startup-warning.ts +6 -8
  126. package/src/shared/logger.ts +8 -0
  127. package/src/shared/mcp-static-export.ts +119 -0
  128. package/src/shared/migration/agent-names.ts +8 -0
  129. package/src/shared/migration/hook-names.ts +1 -1
  130. package/src/shared/mode-routing.test.ts +88 -0
  131. package/src/shared/mode-routing.ts +30 -0
  132. package/src/shared/startup-diagnostics.ts +6 -7
  133. package/src/tools/ast-grep/constants.ts +1 -1
  134. package/src/tools/ast-grep/environment-check.ts +2 -32
  135. package/src/tools/ast-grep/language-support.ts +0 -3
  136. package/src/tools/ast-grep/types.ts +1 -2
  137. package/src/tools/call-omo-agent/tools.ts +11 -4
  138. package/src/tools/delegate-task/anthropic-categories.ts +3 -3
  139. package/src/tools/delegate-task/builtin-categories.ts +2 -0
  140. package/src/tools/delegate-task/categories.test.ts +87 -0
  141. package/src/tools/delegate-task/category-resolver.ts +8 -9
  142. package/src/tools/delegate-task/git-categories.ts +30 -0
  143. package/src/tools/delegate-task/model-string-parser.test.ts +90 -0
  144. package/src/tools/delegate-task/openai-categories.ts +26 -22
  145. package/src/tools/delegate-task/sub-agent.ts +10 -0
  146. package/src/tools/delegate-task/subagent-discovery.test.ts +123 -0
  147. package/src/tools/delegate-task/subagent-resolver.ts +18 -1
  148. package/src/tools/skill-mcp/constants.ts +1 -1
  149. package/src/tools/skill-mcp/tools.test.ts +44 -0
  150. package/dist/ast-grep-napi.win32-x64-msvc-67c0y8nc.node +0 -0
  151. package/dist/config/loader.test.d.ts +0 -1
  152. package/dist/config/models.d.ts +0 -13
  153. package/dist/config/schema/websearch.d.ts +0 -13
  154. package/dist/hooks/no-bob-gpt/hook.d.ts +0 -16
  155. package/dist/hooks/no-bob-gpt/index.d.ts +0 -1
  156. package/dist/hooks/no-coder-non-gpt/hook.d.ts +0 -20
  157. package/dist/hooks/no-coder-non-gpt/index.d.ts +0 -1
  158. package/dist/internals/plugins/websearch-cited/google.d.ts +0 -38
  159. package/dist/internals/plugins/websearch-cited/index.d.ts +0 -17
  160. package/dist/internals/plugins/websearch-cited/openai.d.ts +0 -9
  161. package/dist/internals/plugins/websearch-cited/openrouter.d.ts +0 -2
  162. package/dist/internals/plugins/websearch-cited/types.d.ts +0 -5
  163. package/dist/mcp/grep-app.d.ts +0 -6
  164. package/dist/mcp/omo-mcp-index.d.ts +0 -10
  165. package/dist/mcp/websearch.d.ts +0 -11
  166. package/src/config/schema/websearch.ts +0 -15
  167. package/src/hooks/no-bob-gpt/hook.ts +0 -56
  168. package/src/hooks/no-bob-gpt/index.ts +0 -1
  169. package/src/hooks/no-coder-non-gpt/hook.ts +0 -67
  170. package/src/hooks/no-coder-non-gpt/index.ts +0 -1
  171. package/src/internals/plugins/websearch-cited/LICENSE +0 -214
  172. package/src/internals/plugins/websearch-cited/codex_prompt.txt +0 -79
  173. package/src/internals/plugins/websearch-cited/google.ts +0 -749
  174. package/src/internals/plugins/websearch-cited/index.ts +0 -306
  175. package/src/internals/plugins/websearch-cited/openai.ts +0 -407
  176. package/src/internals/plugins/websearch-cited/openrouter.ts +0 -190
  177. package/src/internals/plugins/websearch-cited/types.ts +0 -7
  178. package/src/mcp/grep-app.ts +0 -6
  179. package/src/mcp/omo-mcp-index.ts +0 -30
  180. package/src/mcp/websearch.ts +0 -44
@@ -1,9 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { mkdirSync } from "node:fs";
3
+ import { existsSync, mkdirSync, readFileSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { spawn, spawnSync } from "node:child_process";
7
+ import { homedir } from "node:os";
8
+ import { parse as parseJsonc } from "jsonc-parser";
7
9
 
8
10
  function resolveCacheRoot() {
9
11
  const xdgCache = process.env.XDG_CACHE_HOME?.trim();
@@ -27,14 +29,103 @@ function parsePalacePath(argv) {
27
29
  || join(resolveCacheRoot(), "hiai-opencode", "mempalace-palace");
28
30
  }
29
31
 
32
+ function resolveEnvTemplate(value) {
33
+ if (typeof value !== "string") return "";
34
+ return value.replace(/\{env:([^}]+)\}/g, (_match, expression) => {
35
+ const [name, fallback] = String(expression).split(":-", 2);
36
+ return process.env[name] || fallback || "";
37
+ }).trim();
38
+ }
39
+
40
+ function candidateConfigPaths() {
41
+ const cwd = process.cwd();
42
+ const home = homedir();
43
+ const paths = [
44
+ join(cwd, "hiai-opencode.json"),
45
+ join(cwd, "hiai-opencode.jsonc"),
46
+ join(cwd, ".opencode", "hiai-opencode.json"),
47
+ join(cwd, ".opencode", "hiai-opencode.jsonc"),
48
+ join(home, ".config", "opencode", "hiai-opencode.json"),
49
+ join(home, ".config", "opencode", "hiai-opencode.jsonc"),
50
+ ];
51
+
52
+ if (process.platform === "win32" && process.env.APPDATA) {
53
+ paths.push(join(process.env.APPDATA, "opencode", "hiai-opencode.json"));
54
+ paths.push(join(process.env.APPDATA, "opencode", "hiai-opencode.jsonc"));
55
+ }
56
+
57
+ return paths;
58
+ }
59
+
60
+ function loadUserConfig() {
61
+ for (const path of candidateConfigPaths()) {
62
+ if (!existsSync(path)) continue;
63
+ try {
64
+ return parseJsonc(readFileSync(path, "utf-8")) ?? {};
65
+ } catch {
66
+ return {};
67
+ }
68
+ }
69
+ return {};
70
+ }
71
+
72
+ function getConfiguredPythonPath() {
73
+ const config = loadUserConfig();
74
+ const value = config?.mcp?.mempalace?.pythonPath;
75
+ return resolveEnvTemplate(typeof value === "string" ? value : "");
76
+ }
77
+
78
+ function resolveVenvPythonCandidates(basePath) {
79
+ if (!basePath) return [];
80
+
81
+ if (process.platform === "win32") {
82
+ return [
83
+ join(basePath, ".venv", "Scripts", "python.exe"),
84
+ join(basePath, "venv", "Scripts", "python.exe"),
85
+ ];
86
+ }
87
+
88
+ return [
89
+ join(basePath, ".venv", "bin", "python"),
90
+ join(basePath, ".venv", "bin", "python3"),
91
+ join(basePath, "venv", "bin", "python"),
92
+ join(basePath, "venv", "bin", "python3"),
93
+ ];
94
+ }
95
+
30
96
  function pythonCandidates() {
97
+ const configPython = getConfiguredPythonPath();
31
98
  const explicit = process.env.MEMPALACE_PYTHON?.trim();
99
+ const scriptDir = dirname(fileURLToPath(import.meta.url));
100
+ const pluginRoot = join(scriptDir, "..", "..");
32
101
  const candidates = [];
33
102
 
34
103
  if (explicit) {
35
104
  candidates.push({ command: explicit, args: [] });
36
105
  }
37
106
 
107
+ if (configPython) {
108
+ candidates.push({ command: configPython, args: [] });
109
+ }
110
+
111
+ for (const candidate of resolveVenvPythonCandidates(process.cwd())) {
112
+ if (existsSync(candidate)) {
113
+ candidates.push({ command: candidate, args: [] });
114
+ }
115
+ }
116
+
117
+ for (const candidate of resolveVenvPythonCandidates(pluginRoot)) {
118
+ if (existsSync(candidate)) {
119
+ candidates.push({ command: candidate, args: [] });
120
+ }
121
+ }
122
+
123
+ for (const candidate of resolveVenvPythonCandidates(join(homedir(), ".config", "opencode", "plugins", "hiai-opencode"))) {
124
+ if (existsSync(candidate)) {
125
+ candidates.push({ command: candidate, args: [] });
126
+ }
127
+ }
128
+
38
129
  if (process.platform === "win32") {
39
130
  candidates.push({ command: "py", args: ["-3"] });
40
131
  }
@@ -42,7 +133,13 @@ function pythonCandidates() {
42
133
  candidates.push({ command: "python3", args: [] });
43
134
  candidates.push({ command: "python", args: [] });
44
135
 
45
- return candidates;
136
+ const seen = new Set();
137
+ return candidates.filter((candidate) => {
138
+ const key = `${candidate.command}\0${candidate.args.join("\0")}`;
139
+ if (seen.has(key)) return false;
140
+ seen.add(key);
141
+ return true;
142
+ });
46
143
  }
47
144
 
48
145
  function hasUv() {
@@ -57,7 +154,7 @@ function hasUv() {
57
154
  function canRunModule(candidate, moduleName) {
58
155
  const probe = spawnSync(
59
156
  candidate.command,
60
- [...candidate.args, "-c", `import importlib.util, sys; sys.exit(0 if importlib.util.find_spec("${moduleName}") else 1)`],
157
+ [...candidate.args, "-c", `import importlib, sys; importlib.import_module("${moduleName}")`],
61
158
  { stdio: "ignore", timeout: 10000 },
62
159
  );
63
160
 
@@ -105,6 +202,31 @@ function installMempalaceWithPip(candidate) {
105
202
  return result.status === 0 && canRunModule(candidate, "mempalace.mcp_server");
106
203
  }
107
204
 
205
+ function spawnWithUv(uvBinary, palacePath) {
206
+ return spawn(
207
+ uvBinary,
208
+ [
209
+ "tool",
210
+ "run",
211
+ "--from",
212
+ "mempalace[all]>=3.3.0",
213
+ "python",
214
+ "-m",
215
+ "mempalace.mcp_server",
216
+ "--palace",
217
+ palacePath,
218
+ ],
219
+ {
220
+ stdio: "inherit",
221
+ env: {
222
+ ...process.env,
223
+ UV_CACHE_DIR: resolveUvCacheRoot(),
224
+ MEMPALACE_PALACE_PATH: palacePath,
225
+ },
226
+ },
227
+ );
228
+ }
229
+
108
230
  function resolveUvCacheRoot() {
109
231
  return process.env.UV_CACHE_DIR
110
232
  || join(resolveCacheRoot(), "hiai-opencode", "uv");
@@ -129,30 +251,30 @@ function main() {
129
251
  const palacePath = parsePalacePath(process.argv.slice(2));
130
252
  mkdirSync(palacePath, { recursive: true });
131
253
 
254
+ const configuredPython =
255
+ process.env.MEMPALACE_PYTHON?.trim() || getConfiguredPythonPath();
256
+ if (configuredPython) {
257
+ const configuredCandidate = { command: configuredPython, args: [] };
258
+ if (canRunModule(configuredCandidate, "mempalace.mcp_server")) {
259
+ const configuredChild = spawn(
260
+ configuredCandidate.command,
261
+ [...configuredCandidate.args, "-m", "mempalace.mcp_server", "--palace", palacePath],
262
+ {
263
+ stdio: "inherit",
264
+ env: {
265
+ ...process.env,
266
+ MEMPALACE_PALACE_PATH: palacePath,
267
+ },
268
+ },
269
+ );
270
+ forwardChildExit(configuredChild, "[hiai-opencode] mempalace launcher failed:");
271
+ return;
272
+ }
273
+ }
274
+
132
275
  const uvBinary = hasUv();
133
276
  if (uvBinary) {
134
- const child = spawn(
135
- uvBinary,
136
- [
137
- "tool",
138
- "run",
139
- "--from",
140
- "mempalace[all]>=3.3.0",
141
- "python",
142
- "-m",
143
- "mempalace.mcp_server",
144
- "--palace",
145
- palacePath,
146
- ],
147
- {
148
- stdio: "inherit",
149
- env: {
150
- ...process.env,
151
- UV_CACHE_DIR: resolveUvCacheRoot(),
152
- MEMPALACE_PALACE_PATH: palacePath,
153
- },
154
- },
155
- );
277
+ const child = spawnWithUv(uvBinary, palacePath);
156
278
 
157
279
  forwardChildExit(child, "[hiai-opencode] mempalace uv launcher failed:");
158
280
  return;
@@ -167,10 +289,22 @@ function main() {
167
289
  if (pipPython && installMempalaceWithPip(pipPython)) {
168
290
  return pipPython;
169
291
  }
292
+
293
+ const fallbackUv = hasUv();
294
+ if (fallbackUv) {
295
+ const uvChild = spawnWithUv(fallbackUv, palacePath);
296
+ forwardChildExit(uvChild, "[hiai-opencode] mempalace uv fallback failed:");
297
+ return "__uv_fallback_started__";
298
+ }
299
+
170
300
  return null;
171
301
  })()
172
302
  : null);
173
303
 
304
+ if (fallbackPython === "__uv_fallback_started__") {
305
+ return;
306
+ }
307
+
174
308
  if (!fallbackPython) {
175
309
  console.error(
176
310
  "[hiai-opencode] mempalace skipped: install uv or Python 3.9+ with `pip install --user mempalace`",
@@ -37,7 +37,6 @@
37
37
  "type": "object",
38
38
  "additionalProperties": { "type": "string" },
39
39
  "properties": {
40
- "googleSearch": { "type": "string" },
41
40
  "stitch": { "type": "string" },
42
41
  "firecrawl": { "type": "string" },
43
42
  "context7": { "type": "string" }
@@ -52,8 +51,10 @@
52
51
  "sequential-thinking": { "$ref": "#/definitions/toggle" },
53
52
  "firecrawl": { "$ref": "#/definitions/toggle" },
54
53
  "rag": { "$ref": "#/definitions/toggle" },
55
- "mempalace": { "$ref": "#/definitions/toggle" },
56
- "context7": { "$ref": "#/definitions/toggle" }
54
+ "mempalace": { "$ref": "#/definitions/mempalaceToggle" },
55
+ "context7": { "$ref": "#/definitions/toggle" },
56
+ "websearch": { "$ref": "#/definitions/websearchToggle" },
57
+ "grep_app": { "$ref": "#/definitions/toggle" }
57
58
  }
58
59
  },
59
60
  "lsp": {
@@ -112,6 +113,31 @@
112
113
  },
113
114
  "required": ["enabled"],
114
115
  "additionalProperties": false
116
+ },
117
+ "mempalaceToggle": {
118
+ "type": "object",
119
+ "properties": {
120
+ "enabled": { "type": "boolean", "default": true },
121
+ "pythonPath": {
122
+ "type": "string",
123
+ "description": "Optional explicit Python executable for MemPalace (for example: ./.venv/bin/python)."
124
+ }
125
+ },
126
+ "required": ["enabled"],
127
+ "additionalProperties": false
128
+ },
129
+ "websearchToggle": {
130
+ "type": "object",
131
+ "properties": {
132
+ "enabled": { "type": "boolean", "default": true },
133
+ "provider": {
134
+ "enum": ["exa", "tavily"],
135
+ "default": "exa",
136
+ "description": "Remote web search MCP provider. Exa works without an API key but can use EXA_API_KEY. Tavily requires TAVILY_API_KEY."
137
+ }
138
+ },
139
+ "required": ["enabled"],
140
+ "additionalProperties": false
115
141
  }
116
142
  }
117
143
  }
@@ -0,0 +1,7 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ import type { AgentPromptMetadata } from "./types";
3
+ export declare function createAgentSkillsAgent(model: string): AgentConfig;
4
+ export declare namespace createAgentSkillsAgent {
5
+ var mode: "subagent";
6
+ }
7
+ export declare const agentSkillsPromptMetadata: AgentPromptMetadata;
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * Default/base Bob prompt builder. Used for Claude and general models.
3
4
  * Lean router — delegates, routes, orchestrates. Does not implement.
4
5
  */
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * Gemini-specific overlay sections for Bob prompt.
3
4
  *
4
5
  * Gemini models are aggressively optimistic and tend to:
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * GPT-Pro-native Bob prompt - rewritten with 8-block architecture.
3
4
  *
4
5
  * Design principles (derived from OpenAI's GPT-Pro prompting guidance):
@@ -0,0 +1,7 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ import type { AgentPromptMetadata } from "./types";
3
+ export declare function createBrainstormerAgent(model: string): AgentConfig;
4
+ export declare namespace createBrainstormerAgent {
5
+ var mode: "subagent";
6
+ }
7
+ export declare const brainstormerPromptMetadata: AgentPromptMetadata;
@@ -10,7 +10,7 @@ import type { AvailableAgent, AvailableTool, AvailableSkill, AvailableCategory }
10
10
  * Optimized for:
11
11
  * - Goal-oriented autonomous execution (not step-by-step instructions)
12
12
  * - Deep exploration before decisive action
13
- * - Active use of explore/librarian agents for comprehensive context
13
+ * - Active use of researcher agents for comprehensive context
14
14
  * - End-to-end task completion without premature stopping
15
15
  */
16
16
  export declare function buildCoderPrompt(availableAgents?: AvailableAgent[], availableTools?: AvailableTool[], availableSkills?: AvailableSkill[], availableCategories?: AvailableCategory[], useTaskSystem?: boolean): string;
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * GPT-Pro optimized Coder prompt - entropy-reduced rewrite.
3
4
  *
4
5
  * Design principles (aligned with OpenAI GPT-Pro prompting guidance):
@@ -1,3 +1,4 @@
1
- /** Generic GPT Coder prompt - fallback for GPT models without a model-specific variant */
1
+ /** PROMPT_VERSION: 2026-04-26
2
+ * Generic GPT Coder prompt - fallback for GPT models without a model-specific variant */
2
3
  import type { AvailableAgent, AvailableTool, AvailableSkill, AvailableCategory } from "../dynamic-agent-prompt-builder";
3
4
  export declare function buildCoderPrompt(availableAgents?: AvailableAgent[], availableTools?: AvailableTool[], availableSkills?: AvailableSkill[], availableCategories?: AvailableCategory[], useTaskSystem?: boolean): string;
@@ -0,0 +1,7 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ import type { AgentPromptMetadata } from "./types";
3
+ export declare function createDesignerAgent(model: string): AgentConfig;
4
+ export declare namespace createDesignerAgent {
5
+ var mode: "subagent";
6
+ }
7
+ export declare const designerPromptMetadata: AgentPromptMetadata;
@@ -8,7 +8,10 @@ import type { AvailableTool } from "./dynamic-agent-prompt-types";
8
8
  */
9
9
  export declare function buildAgentIdentitySection(agentName: string, roleDescription: string): string;
10
10
  export declare function buildKeyTriggersSection(agents: AvailableAgent[], _skills?: AvailableSkill[]): string;
11
- export declare function buildToolSelectionTable(agents: AvailableAgent[], tools?: AvailableTool[], _skills?: AvailableSkill[]): string;
11
+ export declare function buildToolSelectionTable(agents: AvailableAgent[], tools?: AvailableTool[], _skills?: AvailableSkill[], options?: {
12
+ includeIntegrationPrimer?: boolean;
13
+ }): string;
14
+ export declare function buildHiaiIntegrationPrimerSection(): string;
12
15
  export declare function buildResearcherSection(agents: AvailableAgent[]): string;
13
16
  export declare function buildDelegationTable(agents: AvailableAgent[]): string;
14
17
  export declare function buildStrategistAndCriticSection(agents: AvailableAgent[]): string;
@@ -1,5 +1,5 @@
1
1
  export type { AvailableAgent, AvailableTool, AvailableSkill, AvailableCategory, } from "./dynamic-agent-prompt-types";
2
2
  export { categorizeTools } from "./dynamic-agent-tool-categorization";
3
- export { buildAgentIdentitySection, buildKeyTriggersSection, buildToolSelectionTable, buildResearcherSection, buildDelegationTable, buildStrategistAndCriticSection, buildNonClaudePlannerSection, buildParallelDelegationSection, } from "./dynamic-agent-core-sections";
3
+ export { buildAgentIdentitySection, buildKeyTriggersSection, buildToolSelectionTable, buildResearcherSection, buildDelegationTable, buildHiaiIntegrationPrimerSection, buildStrategistAndCriticSection, buildNonClaudePlannerSection, buildParallelDelegationSection, } from "./dynamic-agent-core-sections";
4
4
  export { buildCategorySkillsDelegationGuide } from "./dynamic-agent-category-skills-guide";
5
5
  export { buildHardBlocksSection, buildAntiPatternsSection, buildHardRulesSection, buildToolCallFormatSection, buildUltraworkSection, buildAntiDuplicationSection, buildToolUsageRulesSection, } from "./dynamic-agent-policy-sections";
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * Gemini-optimized Strategist System Prompt
3
4
  *
4
5
  * Key differences from Claude/GPT variants:
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * PROMPT_VERSION: 2026-04-26
2
3
  * GPT-5.4 Optimized Strategist System Prompt
3
4
  *
4
5
  * Tuned for GPT-5.4 system prompt design principles:
@@ -49,8 +49,10 @@ export interface AgentPromptMetadata {
49
49
  dedicatedSection?: string;
50
50
  /** Nickname/alias used in prompt (e.g., "Logician" instead of "logician") */
51
51
  promptAlias?: string;
52
- /** Key triggers that should appear in Phase 0 (e.g., "External library mentioned → fire librarian") */
52
+ /** Key triggers that should appear in Phase 0 (e.g., "External library mentioned → fire researcher") */
53
53
  keyTrigger?: string;
54
+ /** Prompt version for snapshot tracking (format: YYYY-MM-DD) */
55
+ promptVersion?: string;
54
56
  }
55
57
  export declare function isGptModel(model: string): boolean;
56
58
  export declare function isGptProModel(model: string): boolean;
@@ -33,5 +33,4 @@ export type { RalphLoopConfig } from "./schema/ralph-loop.js";
33
33
  export type { DynamicContextPruningConfig } from "./schema/dynamic-context-pruning.js";
34
34
  export type { GitMasterConfig } from "./schema/git-master.js";
35
35
  export type { ModelCapabilitiesConfig } from "./schema/model-capabilities.js";
36
- export type { WebsearchConfig, WebsearchProvider } from "./schema/websearch.js";
37
36
  export type { FastApplyConfig } from "./schema/fast-apply.js";
@@ -148,6 +148,18 @@ export declare const ModelSlotsConfigSchema: z.ZodObject<{
148
148
  design: "design";
149
149
  }>>;
150
150
  }, z.core.$strip>]>>;
151
+ sub: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
152
+ model: z.ZodString;
153
+ recommended: z.ZodOptional<z.ZodEnum<{
154
+ high: "high";
155
+ xhigh: "xhigh";
156
+ middle: "middle";
157
+ fast: "fast";
158
+ vision: "vision";
159
+ writing: "writing";
160
+ design: "design";
161
+ }>>;
162
+ }, z.core.$strip>]>>;
151
163
  }, z.core.$strip>;
152
164
  export declare const FallbackEntrySchema: z.ZodObject<{
153
165
  providers: z.ZodArray<z.ZodString>;
@@ -214,11 +226,16 @@ export declare const McpServerConfigSchema: z.ZodObject<{
214
226
  remote: "remote";
215
227
  local: "local";
216
228
  }>>;
229
+ provider: z.ZodOptional<z.ZodEnum<{
230
+ exa: "exa";
231
+ tavily: "tavily";
232
+ }>>;
217
233
  url: z.ZodOptional<z.ZodString>;
218
234
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
219
235
  command: z.ZodOptional<z.ZodArray<z.ZodString>>;
220
236
  timeout: z.ZodOptional<z.ZodNumber>;
221
237
  environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
238
+ pythonPath: z.ZodOptional<z.ZodString>;
222
239
  }, z.core.$strip>;
223
240
  export declare const LspServerConfigSchema: z.ZodObject<{
224
241
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -311,9 +328,6 @@ export declare const PermissionsConfigSchema: z.ZodObject<{
311
328
  }>>>;
312
329
  }, z.core.$strip>;
313
330
  export declare const AuthKeysSchema: z.ZodObject<{
314
- googleSearch: z.ZodOptional<z.ZodString>;
315
- openai: z.ZodOptional<z.ZodString>;
316
- openrouter: z.ZodOptional<z.ZodString>;
317
331
  stitch: z.ZodOptional<z.ZodString>;
318
332
  firecrawl: z.ZodOptional<z.ZodString>;
319
333
  context7: z.ZodOptional<z.ZodString>;
@@ -459,6 +473,18 @@ export declare const HiaiOpencodeConfigSchema: z.ZodObject<{
459
473
  design: "design";
460
474
  }>>;
461
475
  }, z.core.$strip>]>>;
476
+ sub: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
477
+ model: z.ZodString;
478
+ recommended: z.ZodOptional<z.ZodEnum<{
479
+ high: "high";
480
+ xhigh: "xhigh";
481
+ middle: "middle";
482
+ fast: "fast";
483
+ vision: "vision";
484
+ writing: "writing";
485
+ design: "design";
486
+ }>>;
487
+ }, z.core.$strip>]>>;
462
488
  }, z.core.$strip>>;
463
489
  agents: z.ZodOptional<z.ZodObject<{
464
490
  bob: z.ZodOptional<z.ZodObject<{
@@ -1299,11 +1325,16 @@ export declare const HiaiOpencodeConfigSchema: z.ZodObject<{
1299
1325
  remote: "remote";
1300
1326
  local: "local";
1301
1327
  }>>;
1328
+ provider: z.ZodOptional<z.ZodEnum<{
1329
+ exa: "exa";
1330
+ tavily: "tavily";
1331
+ }>>;
1302
1332
  url: z.ZodOptional<z.ZodString>;
1303
1333
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1304
1334
  command: z.ZodOptional<z.ZodArray<z.ZodString>>;
1305
1335
  timeout: z.ZodOptional<z.ZodNumber>;
1306
1336
  environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1337
+ pythonPath: z.ZodOptional<z.ZodString>;
1307
1338
  }, z.core.$strip>>>;
1308
1339
  lsp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1309
1340
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -1396,9 +1427,6 @@ export declare const HiaiOpencodeConfigSchema: z.ZodObject<{
1396
1427
  }>>>;
1397
1428
  }, z.core.$strip>>;
1398
1429
  auth: z.ZodOptional<z.ZodObject<{
1399
- googleSearch: z.ZodOptional<z.ZodString>;
1400
- openai: z.ZodOptional<z.ZodString>;
1401
- openrouter: z.ZodOptional<z.ZodString>;
1402
1430
  stitch: z.ZodOptional<z.ZodString>;
1403
1431
  firecrawl: z.ZodOptional<z.ZodString>;
1404
1432
  context7: z.ZodOptional<z.ZodString>;
@@ -9,5 +9,6 @@ export declare const BuiltinCommandNameSchema: z.ZodEnum<{
9
9
  "stop-continuation": "stop-continuation";
10
10
  "remove-ai-slops": "remove-ai-slops";
11
11
  "mcp-status": "mcp-status";
12
+ doctor: "doctor";
12
13
  }>;
13
14
  export type BuiltinCommandName = z.infer<typeof BuiltinCommandNameSchema>;
@@ -37,8 +37,6 @@ export declare const HookNameSchema: z.ZodEnum<{
37
37
  "delegate-task-retry": "delegate-task-retry";
38
38
  "strategist-md-only": "strategist-md-only";
39
39
  "sub-notepad": "sub-notepad";
40
- "no-bob-gpt": "no-bob-gpt";
41
- "no-coder-non-gpt": "no-coder-non-gpt";
42
40
  "unstable-agent-babysitter": "unstable-agent-babysitter";
43
41
  "task-resume-info": "task-resume-info";
44
42
  "stop-continuation-guard": "stop-continuation-guard";
@@ -50,5 +50,3 @@ export { StartWorkConfigSchema } from "./start-work";
50
50
  export type { StartWorkConfig } from "./start-work";
51
51
  export { TmuxConfigSchema, TmuxLayoutSchema, TmuxIsolationSchema } from "./tmux";
52
52
  export type { TmuxConfig, TmuxLayout, TmuxIsolation } from "./tmux";
53
- export { WebsearchConfigSchema } from "./websearch";
54
- export type { WebsearchConfig, WebsearchProvider } from "./websearch";
@@ -26,6 +26,7 @@ export declare const HiaiOpenCodeConfigSchema: z.ZodObject<{
26
26
  "stop-continuation": "stop-continuation";
27
27
  "remove-ai-slops": "remove-ai-slops";
28
28
  "mcp-status": "mcp-status";
29
+ doctor: "doctor";
29
30
  }>>>;
30
31
  disabled_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
31
32
  mcp_env_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -4216,9 +4217,6 @@ export declare const HiaiOpenCodeConfigSchema: z.ZodObject<{
4216
4217
  timeout_ms: z.ZodDefault<z.ZodNumber>;
4217
4218
  }, z.core.$strip>>;
4218
4219
  auth: z.ZodOptional<z.ZodObject<{
4219
- googleSearch: z.ZodOptional<z.ZodString>;
4220
- openai: z.ZodOptional<z.ZodString>;
4221
- openrouter: z.ZodOptional<z.ZodString>;
4222
4220
  stitch: z.ZodOptional<z.ZodString>;
4223
4221
  firecrawl: z.ZodOptional<z.ZodString>;
4224
4222
  context7: z.ZodOptional<z.ZodString>;
@@ -4236,12 +4234,6 @@ export declare const HiaiOpenCodeConfigSchema: z.ZodObject<{
4236
4234
  "playwright-cli": "playwright-cli";
4237
4235
  }>>;
4238
4236
  }, z.core.$strip>>;
4239
- websearch: z.ZodOptional<z.ZodObject<{
4240
- provider: z.ZodOptional<z.ZodEnum<{
4241
- exa: "exa";
4242
- tavily: "tavily";
4243
- }>>;
4244
- }, z.core.$strip>>;
4245
4237
  tmux: z.ZodOptional<z.ZodObject<{
4246
4238
  enabled: z.ZodDefault<z.ZodBoolean>;
4247
4239
  layout: z.ZodDefault<z.ZodEnum<{
@@ -21,6 +21,7 @@ export interface ModelSlotsConfig {
21
21
  manager?: ModelSlotConfig;
22
22
  brainstormer?: ModelSlotConfig;
23
23
  vision?: ModelSlotConfig;
24
+ sub?: ModelSlotConfig;
24
25
  }
25
26
  export declare const CANONICAL_AGENT_NAMES: readonly ["bob", "guard", "strategist", "critic", "coder", "designer", "sub", "researcher", "multimodal", "quality-guardian", "platform-manager", "brainstormer", "agent-skills"];
26
27
  export type CanonicalAgentName = (typeof CANONICAL_AGENT_NAMES)[number];
@@ -59,7 +60,7 @@ export interface HeuristicModelFamilyDefinition {
59
60
  supportsThinking?: boolean;
60
61
  }
61
62
  export interface CategoryConfig {
62
- model: string;
63
+ model?: string;
63
64
  variant?: string;
64
65
  description?: string;
65
66
  fallbackChain?: FallbackEntry[];
@@ -67,11 +68,13 @@ export interface CategoryConfig {
67
68
  export interface McpServerConfig {
68
69
  enabled: boolean;
69
70
  type?: "remote" | "local";
71
+ provider?: "exa" | "tavily";
70
72
  url?: string;
71
73
  headers?: Record<string, string>;
72
74
  command?: string[];
73
75
  timeout?: number;
74
76
  environment?: Record<string, string>;
77
+ pythonPath?: string;
75
78
  }
76
79
  export interface LspServerConfig {
77
80
  enabled?: boolean;
@@ -103,9 +106,6 @@ export interface PermissionsConfig {
103
106
  deny_paths?: string[];
104
107
  }
105
108
  export interface AuthKeys {
106
- googleSearch?: string;
107
- openai?: string;
108
- openrouter?: string;
109
109
  stitch?: string;
110
110
  firecrawl?: string;
111
111
  context7?: string;
@@ -73,8 +73,6 @@ export declare function createHooks(args: {
73
73
  startWork: ReturnType<typeof import("./hooks").createStartWorkHook> | null;
74
74
  strategistMdOnly: ReturnType<typeof import("./hooks").createStrategistMdOnlyHook> | null;
75
75
  bobJuniorNotepad: ReturnType<typeof import("./hooks").createBobJuniorNotepadHook> | null;
76
- noBobGpt: ReturnType<typeof import("./hooks").createNoBobGptHook> | null;
77
- noCoderNonGpt: ReturnType<typeof import("./hooks").createNoCoderNonGptHook> | null;
78
76
  questionLabelTruncator: ReturnType<typeof import("./hooks").createQuestionLabelTruncatorHook> | null;
79
77
  taskResumeInfo: ReturnType<typeof import("./hooks").createTaskResumeInfoHook> | null;
80
78
  anthropicEffort: ReturnType<typeof import("./hooks/anthropic-effort").createAnthropicEffortHook> | null;
@@ -0,0 +1 @@
1
+ export declare const DOCTOR_TEMPLATE = "# Hiai OpenCode Doctor Command\n\n## Purpose\n\nUse /doctor to run the hiai-opencode install/runtime diagnostic and report actionable setup issues.\n\n## Execute\n\nRun:\n\n```bash\nhiai-opencode doctor\n```\n\nIf the binary is not on PATH, try the package-local fallback:\n\n```bash\nnode ./node_modules/@hiai-gg/hiai-opencode/assets/cli/hiai-opencode.mjs doctor\n```\n\n## Report\n\nSummarize:\n\n- config path\n- enabled and disabled MCP servers\n- missing env vars by name only\n- static `.mcp.json` freshness and whether it is managed by hiai-opencode\n- OpenCode Connect visibility for configured model providers\n- OpenCode plugin registration sanity (including `plugin: [\"list\"]` misconfiguration warning)\n- skill materialization status from skill registry\n- agent count and naming summary\n- LSP runtime availability\n- MemPalace python source and selected interpreter (env/config/auto)\n- MCP tool probes (real connect + tools/list) for stdio and basic endpoint probes for remote MCP\n\nRules:\n\n- Do not print API key values.\n- Do not ask for model provider env vars such as OPENROUTER_API_KEY or OPENAI_API_KEY; normal model auth belongs to OpenCode Connect.\n- If `opencode mcp list` is empty but doctor/mcp-status sees servers, explain the runtime-vs-static config distinction and run `hiai-opencode export-mcp .mcp.json` if the user wants static visibility.\n- Do not run package installs unless the user explicitly asks.\n";
@@ -1,5 +1,5 @@
1
1
  import type { CommandDefinition } from "../claude-code-command-loader";
2
- export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "remove-ai-slops" | "mcp-status";
2
+ export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "remove-ai-slops" | "mcp-status" | "doctor";
3
3
  export interface BuiltinCommandConfig {
4
4
  disabled_commands?: BuiltinCommandName[];
5
5
  }
@@ -0,0 +1,2 @@
1
+ import type { BuiltinSkill } from "../types";
2
+ export declare const hiaiOpencodeSetupSkill: BuiltinSkill;
@@ -5,3 +5,5 @@ export { gitMasterSkill } from "./git-master";
5
5
  export { devBrowserSkill } from "./dev-browser";
6
6
  export { reviewWorkSkill } from "./review-work";
7
7
  export { aiSlopRemoverSkill } from "./ai-slop-remover";
8
+ export { hiaiOpencodeSetupSkill } from "./hiai-opencode-setup";
9
+ export { websiteCopywritingSkill } from "./website-copywriting";
@@ -0,0 +1,2 @@
1
+ import type { BuiltinSkill } from "../types";
2
+ export declare const websiteCopywritingSkill: BuiltinSkill;