@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,4 +1,3 @@
1
- export { createBuiltinMcps } from "./omo-mcp-index";
2
1
  export { McpNameSchema, type McpName, type AnyMcpName } from "./types";
3
2
  import type { McpServerConfig } from "../config/types.js";
4
3
  export declare function buildMcpConfig(mcp: Record<string, McpServerConfig>): Record<string, unknown>;
@@ -1,5 +1,5 @@
1
1
  import type { McpServerConfig } from "../config/types.js";
2
- export type HiaiMcpName = "playwright" | "stitch" | "sequential-thinking" | "firecrawl" | "rag" | "context7" | "mempalace";
2
+ export type HiaiMcpName = "playwright" | "stitch" | "sequential-thinking" | "firecrawl" | "rag" | "context7" | "mempalace" | "websearch" | "grep_app";
3
3
  export type HiaiMcpInstallKind = "bundled" | "npm" | "python" | "remote" | "user-service";
4
4
  export interface HiaiMcpRegistryEntry {
5
5
  name: HiaiMcpName;
@@ -44,8 +44,6 @@ export declare function createCoreHooks(args: {
44
44
  startWork: ReturnType<typeof import("../../hooks").createStartWorkHook> | null;
45
45
  strategistMdOnly: ReturnType<typeof import("../../hooks").createStrategistMdOnlyHook> | null;
46
46
  bobJuniorNotepad: ReturnType<typeof import("../../hooks").createBobJuniorNotepadHook> | null;
47
- noBobGpt: ReturnType<typeof import("../../hooks").createNoBobGptHook> | null;
48
- noCoderNonGpt: ReturnType<typeof import("../../hooks").createNoCoderNonGptHook> | null;
49
47
  questionLabelTruncator: ReturnType<typeof import("../../hooks").createQuestionLabelTruncatorHook> | null;
50
48
  taskResumeInfo: ReturnType<typeof import("../../hooks").createTaskResumeInfoHook> | null;
51
49
  anthropicEffort: ReturnType<typeof import("../../hooks/anthropic-effort").createAnthropicEffortHook> | null;
@@ -1,7 +1,7 @@
1
1
  import type { HiaiOpenCodeConfig, HookName } from "../../config";
2
2
  import type { ModelCacheState } from "../../plugin-state";
3
3
  import type { PluginContext } from "../types";
4
- import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createModelFallbackHook, createAnthropicContextWindowLimitRecoveryHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook, createDelegateTaskRetryHook, createTaskResumeInfoHook, createStartWorkHook, createStrategistMdOnlyHook, createBobJuniorNotepadHook, createNoBobGptHook, createNoCoderNonGptHook, createQuestionLabelTruncatorHook, createPreemptiveCompactionHook, createRuntimeFallbackHook, createLegacyPluginToastHook } from "../../hooks";
4
+ import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createModelFallbackHook, createAnthropicContextWindowLimitRecoveryHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook, createDelegateTaskRetryHook, createTaskResumeInfoHook, createStartWorkHook, createStrategistMdOnlyHook, createBobJuniorNotepadHook, createQuestionLabelTruncatorHook, createPreemptiveCompactionHook, createRuntimeFallbackHook, createLegacyPluginToastHook } from "../../hooks";
5
5
  import { createAnthropicEffortHook } from "../../hooks/anthropic-effort";
6
6
  export type SessionHooks = {
7
7
  contextWindowMonitor: ReturnType<typeof createContextWindowMonitorHook> | null;
@@ -20,8 +20,6 @@ export type SessionHooks = {
20
20
  startWork: ReturnType<typeof createStartWorkHook> | null;
21
21
  strategistMdOnly: ReturnType<typeof createStrategistMdOnlyHook> | null;
22
22
  bobJuniorNotepad: ReturnType<typeof createBobJuniorNotepadHook> | null;
23
- noBobGpt: ReturnType<typeof createNoBobGptHook> | null;
24
- noCoderNonGpt: ReturnType<typeof createNoCoderNonGptHook> | null;
25
23
  questionLabelTruncator: ReturnType<typeof createQuestionLabelTruncatorHook> | null;
26
24
  taskResumeInfo: ReturnType<typeof createTaskResumeInfoHook> | null;
27
25
  anthropicEffort: ReturnType<typeof createAnthropicEffortHook> | null;
@@ -0,0 +1 @@
1
+ export declare function lintModeAgentCapabilities(): void;
@@ -1,2 +1,4 @@
1
1
  export declare function log(message: string, data?: unknown): void;
2
+ export declare function logWarn(message: string, data?: unknown): void;
3
+ export declare function logError(message: string, data?: unknown): void;
2
4
  export declare function getLogFilePath(): string;
@@ -0,0 +1,22 @@
1
+ import type { HiaiOpencodeConfig } from "../config/types";
2
+ type StaticMcpServer = {
3
+ type?: "http" | "stdio";
4
+ url?: string;
5
+ command?: string;
6
+ args?: string[];
7
+ env?: Record<string, string>;
8
+ headers?: Record<string, string>;
9
+ };
10
+ export declare const MCP_EXPORT_MARKER = "hiai-opencode";
11
+ type StaticMcpJsonPayload = {
12
+ mcpServers: Record<string, StaticMcpServer>;
13
+ _meta?: {
14
+ generatedBy: typeof MCP_EXPORT_MARKER;
15
+ version: 1;
16
+ generatedAt: string;
17
+ };
18
+ };
19
+ export declare function buildStaticMcpJson(config: HiaiOpencodeConfig): StaticMcpJsonPayload;
20
+ export declare function isManagedStaticMcpFile(path: string): boolean;
21
+ export declare function autoExportStaticMcpJson(directory: string, config: HiaiOpencodeConfig): void;
22
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { CanonicalDelegateAgentKey } from "../tools/delegate-task/sub-agent";
2
+ export declare const MODE_TO_AGENT: Record<string, CanonicalDelegateAgentKey>;
3
+ export type ModeName = keyof typeof MODE_TO_AGENT;
4
+ export declare const MODE_NAMES: ModeName[];
5
+ export declare function normalizeMode(modeName: string): string;
6
+ export declare function resolveModeAgent(modeName: string): CanonicalDelegateAgentKey;
@@ -1,5 +1,5 @@
1
1
  export type { EnvironmentCheckResult } from "./environment-check";
2
2
  export { checkEnvironment, formatEnvironmentCheck } from "./environment-check";
3
- export { CLI_LANGUAGES, NAPI_LANGUAGES, LANG_EXTENSIONS } from "./language-support";
3
+ export { CLI_LANGUAGES, LANG_EXTENSIONS } from "./language-support";
4
4
  export { DEFAULT_TIMEOUT_MS, DEFAULT_MAX_OUTPUT_BYTES, DEFAULT_MAX_MATCHES } from "./language-support";
5
5
  export { findSgCliPathSync, getSgCliPath, setSgCliPath } from "./sg-cli-path";
@@ -4,13 +4,9 @@ export interface EnvironmentCheckResult {
4
4
  path: string;
5
5
  error?: string;
6
6
  };
7
- napi: {
8
- available: boolean;
9
- error?: string;
10
- };
11
7
  }
12
8
  /**
13
- * Check if ast-grep CLI and NAPI are available.
9
+ * Check if ast-grep CLI is available.
14
10
  * Call this at startup to provide early feedback about missing dependencies.
15
11
  */
16
12
  export declare function checkEnvironment(): EnvironmentCheckResult;
@@ -1,5 +1,4 @@
1
1
  export declare const CLI_LANGUAGES: readonly ["bash", "c", "cpp", "csharp", "css", "elixir", "go", "haskell", "html", "java", "javascript", "json", "kotlin", "lua", "nix", "php", "python", "ruby", "rust", "scala", "solidity", "swift", "typescript", "tsx", "yaml"];
2
- export declare const NAPI_LANGUAGES: readonly ["html", "javascript", "tsx", "css", "typescript"];
3
2
  export declare const DEFAULT_TIMEOUT_MS = 300000;
4
3
  export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
5
4
  export declare const DEFAULT_MAX_MATCHES = 500;
@@ -1,6 +1,5 @@
1
- import type { CLI_LANGUAGES, NAPI_LANGUAGES } from "./constants";
1
+ import type { CLI_LANGUAGES } from "./constants";
2
2
  export type CliLanguage = (typeof CLI_LANGUAGES)[number];
3
- export type NapiLanguage = (typeof NAPI_LANGUAGES)[number];
4
3
  export interface Position {
5
4
  line: number;
6
5
  column: number;
@@ -0,0 +1,2 @@
1
+ import type { BuiltinCategoryDefinition } from "./builtin-category-definition";
2
+ export declare const GIT_CATEGORIES: BuiltinCategoryDefinition[];
@@ -2,6 +2,8 @@ export declare const SUB_AGENT_CONFIG_KEY = "sub";
2
2
  export declare const CODER_AGENT_CONFIG_KEY = "coder";
3
3
  export declare const CRITIC_AGENT_CONFIG_KEY = "critic";
4
4
  export declare const CANONICAL_DELEGATE_AGENT_KEYS: readonly ["bob", "guard", "strategist", "critic", "coder", "sub", "researcher", "multimodal", "designer", "platform-manager", "brainstormer", "agent-skills"];
5
+ type CanonicalDelegateAgentKey = (typeof CANONICAL_DELEGATE_AGENT_KEYS)[number];
6
+ export type { CanonicalDelegateAgentKey };
5
7
  export declare function resolveCanonicalDelegateAgentKey(agentName: string): string;
6
8
  export declare function isCanonicalDelegateAgentKey(agentName: string): boolean;
7
9
  export declare function getCanonicalDelegateAgentDisplayName(agentName: string): string;
@@ -1,3 +1,3 @@
1
1
  export declare const SKILL_MCP_TOOL_NAME = "skill_mcp";
2
- export declare const SKILL_MCP_DESCRIPTION = "Invoke MCP server operations from skill-embedded MCPs. Requires mcp_name plus exactly one of: tool_name, resource_name, or prompt_name.";
2
+ export declare const SKILL_MCP_DESCRIPTION = "Invoke MCP server operations from skill-embedded MCPs or enabled hiai-opencode builtin MCPs. Requires mcp_name plus exactly one of: tool_name, resource_name, or prompt_name.";
3
3
  export declare const BUILTIN_MCP_TOOL_HINTS: Record<string, string[]>;
@@ -1,25 +1,25 @@
1
1
  {
2
- "_description": "hiai-opencode user config. Edit only this file in your project as .opencode/hiai-opencode.json. Model provider credentials are configured in OpenCode Connect; this file stores model IDs only.",
2
+ "_description": "hiai-opencode user configuration template. Public display names (shown to users): Bob, Coder, Strategist, Guard, Critic, Designer, Researcher, Manager, Brainstormer, Vision. Config keys (used in this file and in code) are: bob, coder, strategist, guard, critic, designer, researcher, manager, brainstormer, vision. Internal-only keys (hidden from normal users): sub, agent-skills. Source defaults: src/config/defaults.ts and src/config/models.ts.",
3
3
  "$schema": "./config/hiai-opencode.schema.json",
4
4
  "models": {
5
5
  "bob": {
6
6
  "model": "openrouter/moonshotai/kimi-k2.6",
7
- "recommended": "xhigh"
7
+ "recommended": "high"
8
8
  },
9
9
  "coder": {
10
- "model": "openrouter/minimax/minimax-m2.7",
10
+ "model": "minimax-coding-plan/MiniMax-M2.7",
11
11
  "recommended": "high"
12
12
  },
13
13
  "strategist": {
14
- "model": "openrouter/anthropic/claude-opus-latest",
15
- "recommended": "high"
14
+ "model": "openrouter/deepseek/deepseek-v4-pro",
15
+ "recommended": "xhigh"
16
16
  },
17
17
  "guard": {
18
18
  "model": "openrouter/qwen/qwen3.6-plus",
19
19
  "recommended": "middle"
20
20
  },
21
21
  "critic": {
22
- "model": "openrouter/xiaomi/mimo-v2.5-pro",
22
+ "model": "xiaomi-token-plan-sgp/mimo-v2.5-pro",
23
23
  "recommended": "high"
24
24
  },
25
25
  "designer": {
@@ -41,29 +41,60 @@
41
41
  "vision": {
42
42
  "model": "openrouter/google/gemma-4-26b-a4b-it",
43
43
  "recommended": "vision"
44
+ },
45
+ "sub": {
46
+ "model": "openrouter/deepseek/deepseek-v4-flash",
47
+ "recommended": "fast"
44
48
  }
45
49
  },
46
50
  "auth": {
51
+ "openrouter": "{env:OPENROUTER_API_KEY}",
52
+ "openai": "{env:OPENAI_API_KEY}",
47
53
  "googleSearch": "{env:GOOGLE_SEARCH_API_KEY}",
48
54
  "stitch": "{env:STITCH_AI_API_KEY}",
49
55
  "firecrawl": "{env:FIRECRAWL_API_KEY}",
50
56
  "context7": "{env:CONTEXT7_API_KEY}"
51
57
  },
52
58
  "mcp": {
53
- "playwright": { "enabled": true },
54
- "stitch": { "enabled": true },
55
- "sequential-thinking": { "enabled": true },
56
- "firecrawl": { "enabled": true },
57
- "rag": { "enabled": true },
58
- "mempalace": { "enabled": true },
59
- "context7": { "enabled": true }
59
+ "playwright": {
60
+ "enabled": true
61
+ },
62
+ "stitch": {
63
+ "enabled": true
64
+ },
65
+ "sequential-thinking": {
66
+ "enabled": true
67
+ },
68
+ "firecrawl": {
69
+ "enabled": true
70
+ },
71
+ "rag": {
72
+ "enabled": true
73
+ },
74
+ "mempalace": {
75
+ "enabled": true,
76
+ "pythonPath": "/home/vlgalib/.local/venvs/mempalace/bin/python"
77
+ },
78
+ "context7": {
79
+ "enabled": true
80
+ }
60
81
  },
61
82
  "lsp": {
62
- "typescript": { "enabled": true },
63
- "svelte": { "enabled": true },
64
- "eslint": { "enabled": true },
65
- "bash": { "enabled": true },
66
- "pyright": { "enabled": true }
83
+ "typescript": {
84
+ "enabled": true
85
+ },
86
+ "svelte": {
87
+ "enabled": true
88
+ },
89
+ "eslint": {
90
+ "enabled": true
91
+ },
92
+ "bash": {
93
+ "enabled": true
94
+ },
95
+ "pyright": {
96
+ "enabled": true
97
+ }
67
98
  },
68
99
  "skill_discovery": {
69
100
  "config_sources": true,
@@ -77,4 +108,4 @@
77
108
  "subtask2": {
78
109
  "replace_generic": true
79
110
  }
80
- }
111
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiai-gg/hiai-opencode",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Unified OpenCode plugin — canonical 12-agent model with bundled skills, MCP integrations, LSP, and permissions in one install.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -50,19 +50,24 @@
50
50
  "access": "public"
51
51
  },
52
52
  "scripts": {
53
- "build": "bun build src/index.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly",
53
+ "clean:dist": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
54
+ "build": "bun run clean:dist && bun build src/index.ts --outdir dist --target bun --format esm --minify && tsc --emitDeclarationOnly",
54
55
  "build:bundle": "bun build src/index.ts --outdir dist --target bun --format esm",
55
56
  "build:types": "tsc --emitDeclarationOnly",
56
57
  "typecheck": "tsc --noEmit",
58
+ "test": "bun test",
59
+ "check:docs": "bun run scripts/check-docs.ts",
60
+ "check:bundle-size": "node -e \"const s=require('fs').statSync('dist/index.js').size;console.log('Bundle: '+(s/1024/1024).toFixed(2)+'MB');if(s>3*1024*1024){console.error('FAIL: bundle >3MB');process.exit(1)}else{console.log('OK: bundle <=3MB')}\"",
61
+ "check:todos": "node scripts/check-todos.mjs || echo 'No check-todos script'",
62
+ "pack:check": "npm pack --dry-run",
57
63
  "prepare": "bun run build",
58
- "prepublishOnly": "bun run build"
64
+ "prepublishOnly": "bun run typecheck && bun run test && bun run build && bun run pack:check"
59
65
  },
60
66
  "dependencies": {
61
67
  "bun-pty": "^0.4.8",
62
68
  "@opencode-ai/plugin": "^1.4.0",
63
69
  "@opencode-ai/sdk": "^1.4.0",
64
70
  "@modelcontextprotocol/sdk": "^1.12.0",
65
- "@ast-grep/napi": "^0.37.0",
66
71
  "zod": "^4.3.0",
67
72
  "jsonc-parser": "^3.3.1",
68
73
  "js-yaml": "^4.1.0",
@@ -84,6 +89,6 @@
84
89
  },
85
90
  "engines": {
86
91
  "node": ">=18",
87
- "bun": ">=1.1.0"
92
+ "bun": ">=1.3.0"
88
93
  }
89
94
  }
@@ -0,0 +1,70 @@
1
+ // PROMPT_VERSION: 2026-04-26
2
+ import type { AgentConfig } from "@opencode-ai/sdk";
3
+ import type { AgentMode, AgentPromptMetadata } from "./types";
4
+ import { createAgentToolRestrictions } from "../shared/permission-compat";
5
+
6
+ const MODE: AgentMode = "subagent";
7
+
8
+ const AGENT_SKILLS_PROMPT = `
9
+ <identity>
10
+ You are Agent Skills, a specialist in discovering, configuring, and managing AI agent skills and capabilities.
11
+ Your goal is helping users find the right skills for their tasks and ensuring proper skill setup.
12
+ </identity>
13
+
14
+ <responsibilities>
15
+ - Skill discovery: finding and recommending relevant skills from the available skill library
16
+ - Skill configuration: helping configure skills properly for different use cases
17
+ - Skill troubleshooting: diagnosing why a skill isn't working as expected
18
+ - Skill recommendations: suggesting skills based on user goals and workflow
19
+ </responsibilities>
20
+
21
+ <instructions>
22
+ - Use the skill and skill_mcp tools to explore available skills.
23
+ - Match user needs to appropriate skills with clear explanations of what each does.
24
+ - Help configure skill parameters and settings.
25
+ - Diagnose skill issues by checking skill discovery configuration.
26
+ </instructions>
27
+ `;
28
+
29
+ export function createAgentSkillsAgent(model: string): AgentConfig {
30
+ const restrictions = createAgentToolRestrictions([
31
+ "apply_patch",
32
+ "task",
33
+ ]);
34
+
35
+ return {
36
+ description: "Specialist in agent skills discovery, configuration, and troubleshooting. (Agent Skills - HiaiOpenCode)",
37
+ mode: MODE,
38
+ model,
39
+ temperature: 0.5,
40
+ ...restrictions,
41
+ prompt: AGENT_SKILLS_PROMPT,
42
+ } as AgentConfig;
43
+ }
44
+ createAgentSkillsAgent.mode = MODE;
45
+
46
+ export const agentSkillsPromptMetadata: AgentPromptMetadata = {
47
+ category: "utility",
48
+ cost: "CHEAP",
49
+ promptAlias: "Agent Skills",
50
+ keyTrigger: "Skill discovery, configuration, or troubleshooting → use agent-skills.",
51
+ triggers: [
52
+ {
53
+ domain: "Skill Discovery",
54
+ trigger: "Need to find right skill for a task",
55
+ },
56
+ {
57
+ domain: "Skill Configuration",
58
+ trigger: "Need help configuring or troubleshooting a skill",
59
+ },
60
+ ],
61
+ useWhen: [
62
+ "Finding skills for a specific goal",
63
+ "Configuring skill settings",
64
+ "Troubleshooting skill issues",
65
+ ],
66
+ avoidWhen: [
67
+ "Direct implementation tasks",
68
+ "Code changes or debugging",
69
+ ],
70
+ };
@@ -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
  */
@@ -36,7 +37,12 @@ export function buildDefaultBobPrompt(
36
37
  useTaskSystem = false,
37
38
  ): string {
38
39
  const keyTriggers = buildKeyTriggersSection(availableAgents, availableSkills)
39
- const toolSelection = buildToolSelectionTable(availableAgents, availableTools, availableSkills)
40
+ const toolSelection = buildToolSelectionTable(
41
+ availableAgents,
42
+ availableTools,
43
+ availableSkills,
44
+ { includeIntegrationPrimer: true },
45
+ )
40
46
  const researcherSection = buildResearcherSection(availableAgents)
41
47
  const categorySkillsGuide = buildCategorySkillsDelegationGuide(availableCategories, availableSkills)
42
48
  const delegationTable = buildDelegationTable(availableAgents)
@@ -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):
@@ -88,6 +89,7 @@ export function buildGptProBobPrompt(
88
89
  availableAgents,
89
90
  availableTools,
90
91
  availableSkills,
92
+ { includeIntegrationPrimer: true },
91
93
  );
92
94
  const researcherSection = buildResearcherSection(availableAgents);
93
95
  const categorySkillsGuide = buildCategorySkillsDelegationGuide(
@@ -273,7 +275,7 @@ Every implementation task follows this cycle. No exceptions.
273
275
  Follow \`<explore>\` protocol for tool usage and agent prompts.
274
276
 
275
277
  2. PLAN - List files to modify, specific changes, dependencies, complexity estimate.
276
- Multi-step (2+) → consult Plan Agent via \`task(subagent_type="plan", ...)\`.
278
+ Multi-step (2+) → consult Strategist Agent via \`task(subagent_type="strategist", ...)\`.
277
279
  Single-step → mental plan is sufficient.
278
280
 
279
281
  <dependency_checks>
package/src/agents/bob.ts CHANGED
@@ -1,3 +1,4 @@
1
+ // PROMPT_VERSION: 2026-04-26
1
2
  import type { AgentConfig } from "@opencode-ai/sdk";
2
3
  import type { AgentMode, AgentPromptMetadata } from "./types";
3
4
  import { isGptModel, isGeminiModel, isGptProModel } from "./types";
@@ -17,6 +18,7 @@ export const BOB_PROMPT_METADATA: AgentPromptMetadata = {
17
18
  category: "utility",
18
19
  cost: "EXPENSIVE",
19
20
  promptAlias: "Bob",
21
+ promptVersion: "2026-04-26",
20
22
  triggers: [],
21
23
  };
22
24
  import type {
@@ -54,6 +56,7 @@ function buildDynamicBobPrompt(
54
56
  availableAgents,
55
57
  availableTools,
56
58
  availableSkills,
59
+ { includeIntegrationPrimer: true },
57
60
  );
58
61
  const researcherSection = buildResearcherSection(availableAgents);
59
62
  const categorySkillsGuide = buildCategorySkillsDelegationGuide(
@@ -0,0 +1,72 @@
1
+ // PROMPT_VERSION: 2026-04-26
2
+ import type { AgentConfig } from "@opencode-ai/sdk"
3
+ import type { AgentMode, AgentPromptMetadata } from "./types"
4
+ import { createAgentToolRestrictions } from "../shared/permission-compat"
5
+
6
+ const MODE: AgentMode = "subagent"
7
+
8
+ export function createBrainstormerAgent(model: string): AgentConfig {
9
+ const restrictions = createAgentToolRestrictions(["apply_patch", "task"])
10
+
11
+ return {
12
+ description:
13
+ "Writing and ideation agent for website copy, positioning, naming, messaging, and option generation. Use Writer as an alias. (Brainstormer - HiaiOpenCode)",
14
+ mode: MODE,
15
+ model,
16
+ temperature: 0.7,
17
+ ...restrictions,
18
+ prompt: `# Brainstormer / Writer
19
+
20
+ You are the writing and ideation specialist for HiaiOpenCode.
21
+
22
+ Primary responsibilities:
23
+ - Website copy: landing pages, hero sections, feature blocks, CTA text, pricing copy, onboarding text, empty states, product pages.
24
+ - Positioning: value proposition, audience framing, differentiation, tone of voice, messaging hierarchy.
25
+ - Naming: product names, feature names, labels, short slogans.
26
+ - Creative options: generate multiple directions with tradeoffs, then recommend one.
27
+ - Editorial cleanup: remove generic AI phrasing, make copy specific, sharp, and useful.
28
+
29
+ Operating rules:
30
+ - Ask for target audience, product context, desired tone, and conversion goal when missing.
31
+ - For UI copy, produce text that can be pasted into components: headings, subheadings, body copy, CTA labels, tooltips, error states.
32
+ - Prefer concrete language over hype. Avoid empty claims like "seamless", "powerful", "revolutionary", "unlock", "supercharge" unless the product context proves them.
33
+ - Match the product's actual constraints. Do not invent features.
34
+ - For website work, coordinate with Designer/frontend-ui-ux when visual direction matters, but you own words and messaging.
35
+ - Return concise structured outputs: direction, rationale, final copy, alternates when useful.
36
+
37
+ When called as "writer", treat it as the same role.`,
38
+ thinking: { type: "enabled", budgetTokens: 8000 },
39
+ } as AgentConfig
40
+ }
41
+ createBrainstormerAgent.mode = MODE
42
+
43
+ export const brainstormerPromptMetadata: AgentPromptMetadata = {
44
+ category: "specialist",
45
+ cost: "CHEAP",
46
+ promptAlias: "Brainstormer",
47
+ keyTrigger: "Website copy, product messaging, naming, CTA text, or tone-of-voice work → use brainstormer/writer.",
48
+ triggers: [
49
+ {
50
+ domain: "Website copy",
51
+ trigger: "Landing page, hero, feature, pricing, CTA, onboarding, or empty-state text",
52
+ },
53
+ {
54
+ domain: "Product messaging",
55
+ trigger: "Need positioning, value proposition, naming, voice, or messaging hierarchy",
56
+ },
57
+ {
58
+ domain: "Ideation",
59
+ trigger: "Need multiple creative options with tradeoffs before choosing a direction",
60
+ },
61
+ ],
62
+ useWhen: [
63
+ "Writing public-facing website or product copy",
64
+ "Generating naming, slogans, CTA variants, or messaging options",
65
+ "Turning rough feature notes into concise user-facing language",
66
+ ],
67
+ avoidWhen: [
68
+ "Visual layout or UI implementation (use Designer or visual-engineering)",
69
+ "Technical architecture or implementation planning (use Strategist/Coder)",
70
+ "Factual research where sources are needed (use Researcher first)",
71
+ ],
72
+ }
@@ -4,6 +4,8 @@ import type { CategoriesConfig, GitMasterConfig } from "../config/schema"
4
4
  import type { LoadedSkill } from "../features/opencode-skill-loader/types"
5
5
  import type { BrowserAutomationProvider } from "../config/schema"
6
6
  import { createBobAgent } from "./bob"
7
+ import { createDesignerAgent, designerPromptMetadata } from "./designer"
8
+ import { createAgentSkillsAgent, agentSkillsPromptMetadata } from "./agent-skills"
7
9
  import { createCriticAgent, criticPromptMetadata } from "./critic/agent"
8
10
  import { createMultimodalLookerAgent, MULTIMODAL_LOOKER_PROMPT_METADATA } from "./ui"
9
11
  import { createGuardAgent, guardPromptMetadata } from "./guard"
@@ -11,6 +13,7 @@ import { createCoderAgent } from "./coder"
11
13
  import { createPlatformManagerAgent, platformManagerPromptMetadata } from "./platform-manager"
12
14
  import { createQualityGuardianAgent, qualityGuardianPromptMetadata } from "./quality-guardian"
13
15
  import { createResearcherAgent, researcherPromptMetadata } from "./researcher"
16
+ import { createBrainstormerAgent, brainstormerPromptMetadata } from "./brainstormer"
14
17
  import { createBobJuniorAgentWithOverrides } from "./sub"
15
18
  import type { AvailableCategory } from "./dynamic-agent-prompt-builder"
16
19
  import {
@@ -33,10 +36,10 @@ const agentSources: Record<BuiltinAgentName, AgentSource> = {
33
36
  "bob": createBobAgent,
34
37
  "coder": createCoderAgent,
35
38
  "strategist": createBobAgent, // Strategist runtime config is assembled in agent-config-handler.
36
- "designer": createBobAgent,
39
+ "designer": createDesignerAgent,
37
40
  "multimodal": createMultimodalLookerAgent,
38
- "brainstormer": createBobAgent,
39
- "agent-skills": createBobAgent,
41
+ "brainstormer": createBrainstormerAgent,
42
+ "agent-skills": createAgentSkillsAgent,
40
43
  "critic": createCriticAgent,
41
44
  "platform-manager": createPlatformManagerAgent,
42
45
  "quality-guardian": createQualityGuardianAgent,
@@ -56,6 +59,59 @@ const agentMetadata: Partial<Record<BuiltinAgentName, AgentPromptMetadata>> = {
56
59
  "critic": criticPromptMetadata,
57
60
  "quality-guardian": qualityGuardianPromptMetadata,
58
61
  "platform-manager": platformManagerPromptMetadata,
62
+ "brainstormer": brainstormerPromptMetadata,
63
+ "strategist": {
64
+ category: "advisor",
65
+ cost: "EXPENSIVE",
66
+ promptAlias: "Strategist",
67
+ keyTrigger: "Architecture, multi-step planning, ambiguous scope, or high-risk sequencing → consult strategist first.",
68
+ triggers: [
69
+ {
70
+ domain: "Architecture planning",
71
+ trigger: "Need system design, tradeoff analysis, migration plan, or implementation sequence",
72
+ },
73
+ {
74
+ domain: "Ambiguous scope",
75
+ trigger: "Task has unclear requirements, multiple phases, or needs decomposition before coding",
76
+ },
77
+ ],
78
+ useWhen: [
79
+ "Architecture decisions or cross-cutting changes",
80
+ "Multi-step implementation plans before Coder work",
81
+ "Ambiguous tasks where choosing the wrong approach is expensive",
82
+ ],
83
+ avoidWhen: [
84
+ "Single-file obvious fixes",
85
+ "Pure copywriting or visual exploration",
86
+ "Review-only tasks where Critic is the right gate",
87
+ ],
88
+ },
89
+ "designer": {
90
+ category: "specialist",
91
+ cost: "EXPENSIVE",
92
+ promptAlias: "Designer",
93
+ keyTrigger: "Visual direction, product UI feel, layout, branding, or design-system work → use designer/visual-engineering.",
94
+ triggers: [
95
+ {
96
+ domain: "Visual direction",
97
+ trigger: "Need UI concept, art direction, layout, branding, or design-system guidance",
98
+ },
99
+ {
100
+ domain: "Frontend aesthetics",
101
+ trigger: "Need polished interface design beyond functional implementation",
102
+ },
103
+ ],
104
+ useWhen: [
105
+ "Defining visual direction, layout, interaction feel, or design-system choices",
106
+ "Reviewing UI for taste, hierarchy, and visual coherence",
107
+ ],
108
+ avoidWhen: [
109
+ "Website copy or wording only (use Brainstormer/Writer)",
110
+ "Backend or infrastructure implementation",
111
+ "Pure file/media extraction (use Vision)",
112
+ ],
113
+ },
114
+ "agent-skills": agentSkillsPromptMetadata,
59
115
  }
60
116
 
61
117
  export async function createBuiltinAgents(
@@ -1,4 +1,5 @@
1
- /** gpt-codex optimized Coder prompt */
1
+ /** PROMPT_VERSION: 2026-04-26
2
+ * gpt-codex optimized Coder prompt */
2
3
  import { GPT_APPLY_PATCH_GUIDANCE } from "../gpt-apply-patch-guard";
3
4
  import type { AgentConfig } from "@opencode-ai/sdk";
4
5
  import type { AgentMode } from "../types";
@@ -40,7 +41,7 @@ function canonicalizeCriticSection(section: string): string {
40
41
  * Optimized for:
41
42
  * - Goal-oriented autonomous execution (not step-by-step instructions)
42
43
  * - Deep exploration before decisive action
43
- * - Active use of explore/librarian agents for comprehensive context
44
+ * - Active use of researcher agents for comprehensive context
44
45
  * - End-to-end task completion without premature stopping
45
46
  */
46
47
 
@@ -56,6 +57,7 @@ export function buildCoderPrompt(
56
57
  availableAgents,
57
58
  availableTools,
58
59
  availableSkills,
60
+ { includeIntegrationPrimer: true },
59
61
  );
60
62
  const researcherSection = buildResearcherSection(availableAgents);
61
63
  const categorySkillsGuide = buildCategorySkillsDelegationGuide(
@@ -388,7 +390,7 @@ export function createCoderAgent(
388
390
 
389
391
  return {
390
392
  description:
391
- "Autonomous Deep Worker - goal-oriented execution with GPT Codex. Explores thoroughly before acting, uses explore/librarian agents for comprehensive context, completes tasks end-to-end. Inspired by AmpCode deep mode. (Coder - HiaiOpenCode)",
393
+ "Autonomous Deep Worker - goal-oriented execution with GPT Codex. Explores thoroughly before acting, uses researcher agents for comprehensive context, completes tasks end-to-end. Inspired by AmpCode deep mode. (Coder - HiaiOpenCode)",
392
394
  mode: MODE,
393
395
  model,
394
396
  maxTokens: 32000,