@hiai-gg/hiai-opencode 0.1.4 → 0.1.6

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 (81) hide show
  1. package/.env.example +14 -8
  2. package/AGENTS.md +19 -8
  3. package/ARCHITECTURE.md +7 -6
  4. package/LICENSE.md +0 -1
  5. package/README.md +48 -17
  6. package/assets/cli/hiai-opencode.mjs +590 -7
  7. package/assets/mcp/mempalace.mjs +159 -25
  8. package/config/hiai-opencode.schema.json +82 -148
  9. package/dist/agents/dynamic-agent-core-sections.d.ts +4 -1
  10. package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -1
  11. package/dist/config/defaults.d.ts +1 -0
  12. package/dist/config/platform-schema.d.ts +275 -10
  13. package/dist/config/schema/categories.d.ts +2 -2
  14. package/dist/config/schema/commands.d.ts +1 -0
  15. package/dist/config/schema/oh-my-opencode-config.d.ts +1 -3
  16. package/dist/config/types.d.ts +22 -5
  17. package/dist/create-tools.d.ts +2 -0
  18. package/dist/features/builtin-commands/templates/doctor.d.ts +1 -0
  19. package/dist/features/builtin-commands/types.d.ts +1 -1
  20. package/dist/features/builtin-skills/skills/hiai-opencode-setup.d.ts +2 -0
  21. package/dist/features/builtin-skills/skills/index.d.ts +1 -0
  22. package/dist/index.js +870 -1711
  23. package/dist/mcp/types.d.ts +1 -1
  24. package/dist/plugin/tool-registry.d.ts +2 -0
  25. package/dist/shared/mcp-static-export.d.ts +22 -0
  26. package/dist/tools/ast-grep/constants.d.ts +1 -1
  27. package/dist/tools/ast-grep/environment-check.d.ts +1 -5
  28. package/dist/tools/ast-grep/language-support.d.ts +0 -1
  29. package/dist/tools/ast-grep/types.d.ts +1 -2
  30. package/dist/tools/skill-mcp/tools.d.ts +2 -0
  31. package/hiai-opencode.json +39 -171
  32. package/package.json +6 -4
  33. package/src/agents/bob/default.ts +6 -1
  34. package/src/agents/bob/gpt-pro.ts +1 -0
  35. package/src/agents/bob.ts +1 -0
  36. package/src/agents/coder/gpt-codex.ts +1 -0
  37. package/src/agents/coder/gpt-pro.ts +1 -0
  38. package/src/agents/coder/gpt.ts +1 -0
  39. package/src/agents/dynamic-agent-core-sections.ts +36 -0
  40. package/src/agents/dynamic-agent-prompt-builder.ts +1 -0
  41. package/src/config/defaults.ts +171 -28
  42. package/src/config/loader.test.ts +16 -1
  43. package/src/config/loader.ts +4 -2
  44. package/src/config/model-slots-and-export.test.ts +55 -0
  45. package/src/config/platform-schema.ts +37 -5
  46. package/src/config/schema/commands.ts +1 -0
  47. package/src/config/schema/oh-my-opencode-config.ts +0 -3
  48. package/src/config/types.ts +34 -5
  49. package/src/create-tools.ts +4 -1
  50. package/src/features/builtin-commands/commands.ts +7 -0
  51. package/src/features/builtin-commands/templates/doctor.ts +43 -0
  52. package/src/features/builtin-commands/types.ts +1 -1
  53. package/src/features/builtin-skills/skills/hiai-opencode-setup.ts +69 -0
  54. package/src/features/builtin-skills/skills/index.ts +1 -0
  55. package/src/features/builtin-skills/skills.ts +10 -1
  56. package/src/index.ts +4 -38
  57. package/src/lsp/index.ts +1 -0
  58. package/src/mcp/registry.ts +6 -1
  59. package/src/plugin/tool-registry.ts +4 -0
  60. package/src/shared/mcp-static-export.ts +121 -0
  61. package/src/tools/ast-grep/constants.ts +1 -1
  62. package/src/tools/ast-grep/environment-check.ts +2 -32
  63. package/src/tools/ast-grep/language-support.ts +0 -3
  64. package/src/tools/ast-grep/types.ts +1 -2
  65. package/src/tools/skill-mcp/tools.test.ts +44 -0
  66. package/src/tools/skill-mcp/tools.ts +45 -7
  67. package/dist/ast-grep-napi.win32-x64-msvc-67c0y8nc.node +0 -0
  68. package/dist/config/loader.test.d.ts +0 -1
  69. package/dist/config/models.d.ts +0 -13
  70. package/dist/internals/plugins/websearch-cited/google.d.ts +0 -38
  71. package/dist/internals/plugins/websearch-cited/index.d.ts +0 -11
  72. package/dist/internals/plugins/websearch-cited/openai.d.ts +0 -9
  73. package/dist/internals/plugins/websearch-cited/openrouter.d.ts +0 -2
  74. package/dist/internals/plugins/websearch-cited/types.d.ts +0 -5
  75. package/src/internals/plugins/websearch-cited/LICENSE +0 -214
  76. package/src/internals/plugins/websearch-cited/codex_prompt.txt +0 -79
  77. package/src/internals/plugins/websearch-cited/google.ts +0 -749
  78. package/src/internals/plugins/websearch-cited/index.ts +0 -301
  79. package/src/internals/plugins/websearch-cited/openai.ts +0 -407
  80. package/src/internals/plugins/websearch-cited/openrouter.ts +0 -190
  81. package/src/internals/plugins/websearch-cited/types.ts +0 -7
@@ -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`",
@@ -1,131 +1,74 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "hiai-opencode Configuration",
4
- "description": "Unified configuration for hiai-opencode plugin",
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
- "agents": {
8
+ "models": {
9
9
  "type": "object",
10
- "additionalProperties": {
11
- "type": "object",
12
- "properties": {
13
- "model": { "type": "string" },
14
- "description": { "type": "string" }
15
- },
16
- "required": ["model"]
17
- }
18
- },
19
- "agentRequirements": {
20
- "type": "object",
21
- "additionalProperties": {
22
- "type": "object",
23
- "properties": {
24
- "fallbackChain": {
25
- "type": "array",
26
- "items": { "$ref": "#/definitions/fallbackEntry" }
27
- },
28
- "variant": { "type": "string" },
29
- "requiresModel": { "type": "string" },
30
- "requiresAnyModel": { "type": "boolean" },
31
- "requiresProvider": { "type": "array", "items": { "type": "string" } }
32
- },
33
- "required": ["fallbackChain"]
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
- "categoryRequirements": {
36
+ "auth": {
53
37
  "type": "object",
54
- "additionalProperties": {
55
- "type": "object",
56
- "properties": {
57
- "fallbackChain": {
58
- "type": "array",
59
- "items": { "$ref": "#/definitions/fallbackEntry" }
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
+ "stitch": { "type": "string" },
41
+ "firecrawl": { "type": "string" },
42
+ "context7": { "type": "string" }
82
43
  }
83
44
  },
84
45
  "mcp": {
85
46
  "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",
47
+ "additionalProperties": false,
114
48
  "properties": {
115
- "replace_generic": { "type": "boolean" },
116
- "generic_return": { "type": ["string", "null"] }
49
+ "playwright": { "$ref": "#/definitions/toggle" },
50
+ "stitch": { "$ref": "#/definitions/toggle" },
51
+ "sequential-thinking": { "$ref": "#/definitions/toggle" },
52
+ "firecrawl": { "$ref": "#/definitions/toggle" },
53
+ "rag": { "$ref": "#/definitions/toggle" },
54
+ "mempalace": { "$ref": "#/definitions/mempalaceToggle" },
55
+ "context7": { "$ref": "#/definitions/toggle" }
117
56
  }
118
57
  },
119
- "skills": {
58
+ "lsp": {
120
59
  "type": "object",
60
+ "additionalProperties": false,
121
61
  "properties": {
122
- "enabled": { "type": "boolean", "default": true },
123
- "disabled": { "type": "array", "items": { "type": "string" } }
62
+ "typescript": { "$ref": "#/definitions/toggle" },
63
+ "svelte": { "$ref": "#/definitions/toggle" },
64
+ "eslint": { "$ref": "#/definitions/toggle" },
65
+ "bash": { "$ref": "#/definitions/toggle" },
66
+ "pyright": { "$ref": "#/definitions/toggle" }
124
67
  }
125
68
  },
126
69
  "skill_discovery": {
127
70
  "type": "object",
128
- "description": "Controls which external skill directories are scanned. Defaults keep installs deterministic: hiai-opencode skills plus project .opencode/skills only.",
71
+ "description": "Controls external skill folder scanning. Defaults keep installs deterministic.",
129
72
  "properties": {
130
73
  "config_sources": { "type": "boolean", "default": true },
131
74
  "project_opencode": { "type": "boolean", "default": true },
@@ -136,59 +79,50 @@
136
79
  "global_agents": { "type": "boolean", "default": false }
137
80
  }
138
81
  },
139
- "permissions": {
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": {
82
+ "subtask2": {
162
83
  "type": "object",
163
84
  "properties": {
164
- "enabled": { "type": "boolean", "default": false },
165
- "ollama_url": { "type": "string" },
166
- "model": { "type": "string" },
167
- "timeout": { "type": "number" }
85
+ "replace_generic": { "type": "boolean" }
168
86
  }
169
87
  }
170
88
  },
89
+ "required": ["models"],
171
90
  "definitions": {
172
- "fallbackEntry": {
173
- "type": "object",
174
- "properties": {
175
- "providers": { "type": "array", "items": { "type": "string" } },
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": {
91
+ "modelSlot": {
92
+ "oneOf": [
93
+ { "type": "string" },
94
+ {
183
95
  "type": "object",
184
96
  "properties": {
185
- "type": { "enum": ["enabled", "disabled"] },
186
- "budgetTokens": { "type": "number" }
97
+ "model": { "type": "string" },
98
+ "recommended": {
99
+ "enum": ["xhigh", "high", "middle", "fast", "vision", "writing", "design"]
100
+ }
187
101
  },
188
- "required": ["type"]
102
+ "required": ["model"],
103
+ "additionalProperties": false
104
+ }
105
+ ]
106
+ },
107
+ "toggle": {
108
+ "type": "object",
109
+ "properties": {
110
+ "enabled": { "type": "boolean", "default": true }
111
+ },
112
+ "required": ["enabled"],
113
+ "additionalProperties": false
114
+ },
115
+ "mempalaceToggle": {
116
+ "type": "object",
117
+ "properties": {
118
+ "enabled": { "type": "boolean", "default": true },
119
+ "pythonPath": {
120
+ "type": "string",
121
+ "description": "Optional explicit Python executable for MemPalace (for example: ./.venv/bin/python)."
189
122
  }
190
123
  },
191
- "required": ["providers", "model"]
124
+ "required": ["enabled"],
125
+ "additionalProperties": false
192
126
  }
193
127
  }
194
128
  }
@@ -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,2 +1,3 @@
1
1
  import type { HiaiOpencodeConfig } from "./types.js";
2
+ export declare function applyModelSlots(config: HiaiOpencodeConfig): HiaiOpencodeConfig;
2
3
  export declare const defaultConfig: HiaiOpencodeConfig;