oh-my-parallel-agent-opencode 0.1.0 → 0.2.1

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 (529) hide show
  1. package/LICENSE.md +82 -0
  2. package/README.md +105 -42
  3. package/bin/oh-my-parallel-agent-opencode.js +80 -0
  4. package/bin/platform.js +38 -0
  5. package/bin/platform.test.ts +148 -0
  6. package/dist/agents/atlas.d.ts +22 -0
  7. package/dist/agents/dynamic-agent-prompt-builder.d.ts +30 -0
  8. package/dist/agents/explore.d.ts +7 -0
  9. package/dist/agents/hephaestus.d.ts +6 -0
  10. package/dist/agents/index.d.ts +12 -0
  11. package/dist/agents/librarian.d.ts +7 -0
  12. package/dist/agents/metis.d.ts +21 -0
  13. package/dist/agents/momus.d.ts +21 -0
  14. package/dist/agents/momus.test.d.ts +1 -0
  15. package/dist/agents/multimodal-looker.d.ts +7 -0
  16. package/dist/agents/oracle.d.ts +7 -0
  17. package/dist/agents/prometheus/behavioral-summary.d.ts +6 -0
  18. package/dist/agents/prometheus/high-accuracy-mode.d.ts +6 -0
  19. package/dist/agents/prometheus/identity-constraints.d.ts +7 -0
  20. package/dist/agents/prometheus/index.d.ts +39 -0
  21. package/dist/agents/prometheus/interview-mode.d.ts +7 -0
  22. package/dist/agents/prometheus/plan-generation.d.ts +7 -0
  23. package/dist/agents/prometheus/plan-template.d.ts +7 -0
  24. package/dist/agents/prometheus-prompt.test.d.ts +1 -0
  25. package/dist/agents/sisyphus-junior.d.ts +10 -0
  26. package/dist/agents/sisyphus-junior.test.d.ts +1 -0
  27. package/dist/agents/sisyphus.d.ts +8 -0
  28. package/dist/agents/types.d.ts +63 -0
  29. package/dist/agents/utils.d.ts +16 -0
  30. package/dist/agents/utils.test.d.ts +1 -0
  31. package/dist/cli/config-manager.d.ts +162 -0
  32. package/dist/cli/config-manager.test.d.ts +1 -0
  33. package/dist/cli/doctor/checks/auth.d.ts +7 -0
  34. package/dist/cli/doctor/checks/auth.test.d.ts +1 -0
  35. package/dist/cli/doctor/checks/config.d.ts +8 -0
  36. package/dist/cli/doctor/checks/config.test.d.ts +1 -0
  37. package/dist/cli/doctor/checks/dependencies.d.ts +8 -0
  38. package/dist/cli/doctor/checks/dependencies.test.d.ts +1 -0
  39. package/dist/cli/doctor/checks/gh.d.ts +13 -0
  40. package/dist/cli/doctor/checks/gh.test.d.ts +1 -0
  41. package/dist/cli/doctor/checks/index.d.ts +13 -0
  42. package/dist/cli/doctor/checks/lsp.d.ts +8 -0
  43. package/dist/cli/doctor/checks/lsp.test.d.ts +1 -0
  44. package/dist/cli/doctor/checks/mcp-oauth.d.ts +15 -0
  45. package/dist/cli/doctor/checks/mcp-oauth.test.d.ts +1 -0
  46. package/dist/cli/doctor/checks/mcp.d.ts +6 -0
  47. package/dist/cli/doctor/checks/mcp.test.d.ts +1 -0
  48. package/dist/cli/doctor/checks/model-resolution.d.ts +33 -0
  49. package/dist/cli/doctor/checks/model-resolution.test.d.ts +1 -0
  50. package/dist/cli/doctor/checks/opencode.d.ts +19 -0
  51. package/dist/cli/doctor/checks/opencode.test.d.ts +1 -0
  52. package/dist/cli/doctor/checks/plugin.d.ts +4 -0
  53. package/dist/cli/doctor/checks/plugin.test.d.ts +1 -0
  54. package/dist/cli/doctor/checks/version.d.ts +4 -0
  55. package/dist/cli/doctor/checks/version.test.d.ts +1 -0
  56. package/dist/cli/doctor/constants.d.ts +42 -0
  57. package/dist/cli/doctor/formatter.d.ts +12 -0
  58. package/dist/cli/doctor/formatter.test.d.ts +1 -0
  59. package/dist/cli/doctor/index.d.ts +5 -0
  60. package/dist/cli/doctor/runner.d.ts +7 -0
  61. package/dist/cli/doctor/runner.test.d.ts +1 -0
  62. package/dist/cli/doctor/types.d.ts +91 -0
  63. package/dist/cli/get-local-version/formatter.d.ts +3 -0
  64. package/dist/cli/get-local-version/index.d.ts +3 -0
  65. package/dist/cli/get-local-version/types.d.ts +13 -0
  66. package/dist/cli/index.d.ts +2 -0
  67. package/dist/cli/index.js +26903 -0
  68. package/dist/cli/index.test.d.ts +1 -0
  69. package/dist/cli/install.d.ts +2 -0
  70. package/dist/cli/install.test.d.ts +1 -0
  71. package/dist/cli/mcp-oauth/index.d.ts +6 -0
  72. package/dist/cli/mcp-oauth/index.test.d.ts +1 -0
  73. package/dist/cli/mcp-oauth/login.d.ts +6 -0
  74. package/dist/cli/mcp-oauth/login.test.d.ts +1 -0
  75. package/dist/cli/mcp-oauth/logout.d.ts +4 -0
  76. package/dist/cli/mcp-oauth/logout.test.d.ts +1 -0
  77. package/dist/cli/mcp-oauth/status.d.ts +1 -0
  78. package/dist/cli/mcp-oauth/status.test.d.ts +1 -0
  79. package/dist/cli/model-fallback.d.ts +18 -0
  80. package/dist/cli/model-fallback.test.d.ts +1 -0
  81. package/dist/cli/run/completion.d.ts +2 -0
  82. package/dist/cli/run/completion.test.d.ts +1 -0
  83. package/dist/cli/run/events.d.ts +14 -0
  84. package/dist/cli/run/events.test.d.ts +1 -0
  85. package/dist/cli/run/index.d.ts +2 -0
  86. package/dist/cli/run/runner.d.ts +2 -0
  87. package/dist/cli/run/types.d.ts +73 -0
  88. package/dist/cli/types.d.ts +39 -0
  89. package/dist/config/index.d.ts +2 -0
  90. package/dist/config/schema.d.ts +2651 -0
  91. package/dist/config/schema.test.d.ts +1 -0
  92. package/dist/features/background-agent/concurrency.d.ts +27 -0
  93. package/dist/features/background-agent/concurrency.test.d.ts +1 -0
  94. package/dist/features/background-agent/constants.d.ts +44 -0
  95. package/dist/features/background-agent/index.d.ts +4 -0
  96. package/dist/features/background-agent/manager.d.ts +118 -0
  97. package/dist/features/background-agent/manager.test.d.ts +1 -0
  98. package/dist/features/background-agent/result-handler.d.ts +15 -0
  99. package/dist/features/background-agent/spawner.d.ts +14 -0
  100. package/dist/features/background-agent/state.d.ts +35 -0
  101. package/dist/features/background-agent/types.d.ts +79 -0
  102. package/dist/features/boulder-state/constants.d.ts +10 -0
  103. package/dist/features/boulder-state/index.d.ts +3 -0
  104. package/dist/features/boulder-state/storage.d.ts +28 -0
  105. package/dist/features/boulder-state/storage.test.d.ts +1 -0
  106. package/dist/features/boulder-state/types.d.ts +24 -0
  107. package/dist/features/builtin-commands/commands.d.ts +2 -0
  108. package/dist/features/builtin-commands/index.d.ts +2 -0
  109. package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -0
  110. package/dist/features/builtin-commands/templates/ralph-loop.d.ts +2 -0
  111. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -0
  112. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -0
  113. package/dist/features/builtin-commands/templates/stop-continuation.d.ts +1 -0
  114. package/dist/features/builtin-commands/templates/stop-continuation.test.d.ts +1 -0
  115. package/dist/features/builtin-commands/types.d.ts +6 -0
  116. package/dist/features/builtin-skills/index.d.ts +2 -0
  117. package/dist/features/builtin-skills/skills/dev-browser.d.ts +2 -0
  118. package/dist/features/builtin-skills/skills/frontend-ui-ux.d.ts +2 -0
  119. package/dist/features/builtin-skills/skills/git-master.d.ts +2 -0
  120. package/dist/features/builtin-skills/skills/index.d.ts +4 -0
  121. package/dist/features/builtin-skills/skills/playwright.d.ts +3 -0
  122. package/dist/features/builtin-skills/skills.d.ts +6 -0
  123. package/dist/features/builtin-skills/skills.test.d.ts +1 -0
  124. package/dist/features/builtin-skills/types.d.ts +15 -0
  125. package/dist/features/claude-code-agent-loader/index.d.ts +2 -0
  126. package/dist/features/claude-code-agent-loader/loader.d.ts +3 -0
  127. package/dist/features/claude-code-agent-loader/types.d.ts +14 -0
  128. package/dist/features/claude-code-command-loader/index.d.ts +2 -0
  129. package/dist/features/claude-code-command-loader/loader.d.ts +6 -0
  130. package/dist/features/claude-code-command-loader/types.d.ts +42 -0
  131. package/dist/features/claude-code-mcp-loader/env-expander.d.ts +2 -0
  132. package/dist/features/claude-code-mcp-loader/index.d.ts +10 -0
  133. package/dist/features/claude-code-mcp-loader/loader.d.ts +4 -0
  134. package/dist/features/claude-code-mcp-loader/loader.test.d.ts +1 -0
  135. package/dist/features/claude-code-mcp-loader/transformer.d.ts +2 -0
  136. package/dist/features/claude-code-mcp-loader/types.d.ts +39 -0
  137. package/dist/features/claude-code-plugin-loader/index.d.ts +3 -0
  138. package/dist/features/claude-code-plugin-loader/loader.d.ts +20 -0
  139. package/dist/features/claude-code-plugin-loader/types.d.ts +186 -0
  140. package/dist/features/claude-code-session-state/index.d.ts +1 -0
  141. package/dist/features/claude-code-session-state/state.d.ts +9 -0
  142. package/dist/features/claude-code-session-state/state.test.d.ts +1 -0
  143. package/dist/features/context-injector/collector.d.ts +11 -0
  144. package/dist/features/context-injector/collector.test.d.ts +1 -0
  145. package/dist/features/context-injector/index.d.ts +3 -0
  146. package/dist/features/context-injector/injector.d.ts +39 -0
  147. package/dist/features/context-injector/injector.test.d.ts +1 -0
  148. package/dist/features/context-injector/types.d.ts +83 -0
  149. package/dist/features/hook-message-injector/constants.d.ts +3 -0
  150. package/dist/features/hook-message-injector/index.d.ts +4 -0
  151. package/dist/features/hook-message-injector/injector.d.ts +19 -0
  152. package/dist/features/hook-message-injector/types.d.ts +46 -0
  153. package/dist/features/mcp-oauth/callback-server.d.ts +11 -0
  154. package/dist/features/mcp-oauth/callback-server.test.d.ts +1 -0
  155. package/dist/features/mcp-oauth/dcr.d.ts +34 -0
  156. package/dist/features/mcp-oauth/dcr.test.d.ts +1 -0
  157. package/dist/features/mcp-oauth/discovery.d.ts +8 -0
  158. package/dist/features/mcp-oauth/discovery.test.d.ts +1 -0
  159. package/dist/features/mcp-oauth/index.d.ts +1 -0
  160. package/dist/features/mcp-oauth/provider.d.ts +41 -0
  161. package/dist/features/mcp-oauth/provider.test.d.ts +1 -0
  162. package/dist/features/mcp-oauth/resource-indicator.d.ts +2 -0
  163. package/dist/features/mcp-oauth/resource-indicator.test.d.ts +1 -0
  164. package/dist/features/mcp-oauth/schema.d.ts +6 -0
  165. package/dist/features/mcp-oauth/schema.test.d.ts +1 -0
  166. package/dist/features/mcp-oauth/step-up.d.ts +8 -0
  167. package/dist/features/mcp-oauth/step-up.test.d.ts +1 -0
  168. package/dist/features/mcp-oauth/storage.d.ts +17 -0
  169. package/dist/features/mcp-oauth/storage.test.d.ts +1 -0
  170. package/dist/features/opencode-skill-loader/async-loader.d.ts +6 -0
  171. package/dist/features/opencode-skill-loader/async-loader.test.d.ts +1 -0
  172. package/dist/features/opencode-skill-loader/blocking.d.ts +2 -0
  173. package/dist/features/opencode-skill-loader/blocking.test.d.ts +1 -0
  174. package/dist/features/opencode-skill-loader/discover-worker.d.ts +1 -0
  175. package/dist/features/opencode-skill-loader/index.d.ts +4 -0
  176. package/dist/features/opencode-skill-loader/loader.d.ts +16 -0
  177. package/dist/features/opencode-skill-loader/loader.test.d.ts +1 -0
  178. package/dist/features/opencode-skill-loader/merger.d.ts +7 -0
  179. package/dist/features/opencode-skill-loader/skill-content.d.ts +21 -0
  180. package/dist/features/opencode-skill-loader/skill-content.test.d.ts +1 -0
  181. package/dist/features/opencode-skill-loader/types.d.ts +34 -0
  182. package/dist/features/sisyphus-swarm/mailbox/types.d.ts +191 -0
  183. package/dist/features/sisyphus-swarm/mailbox/types.test.d.ts +1 -0
  184. package/dist/features/sisyphus-tasks/storage.d.ts +9 -0
  185. package/dist/features/sisyphus-tasks/storage.test.d.ts +1 -0
  186. package/dist/features/sisyphus-tasks/types.d.ts +47 -0
  187. package/dist/features/sisyphus-tasks/types.test.d.ts +1 -0
  188. package/dist/features/skill-mcp-manager/env-cleaner.d.ts +2 -0
  189. package/dist/features/skill-mcp-manager/env-cleaner.test.d.ts +1 -0
  190. package/dist/features/skill-mcp-manager/index.d.ts +2 -0
  191. package/dist/features/skill-mcp-manager/manager.d.ts +50 -0
  192. package/dist/features/skill-mcp-manager/manager.test.d.ts +1 -0
  193. package/dist/features/skill-mcp-manager/types.d.ts +11 -0
  194. package/dist/features/task-toast-manager/index.d.ts +2 -0
  195. package/dist/features/task-toast-manager/manager.d.ts +58 -0
  196. package/dist/features/task-toast-manager/manager.test.d.ts +1 -0
  197. package/dist/features/task-toast-manager/types.d.ts +24 -0
  198. package/dist/features/tmux-subagent/action-executor.d.ts +22 -0
  199. package/dist/features/tmux-subagent/decision-engine.d.ts +38 -0
  200. package/dist/features/tmux-subagent/decision-engine.test.d.ts +1 -0
  201. package/dist/features/tmux-subagent/index.d.ts +5 -0
  202. package/dist/features/tmux-subagent/manager.d.ts +59 -0
  203. package/dist/features/tmux-subagent/manager.test.d.ts +1 -0
  204. package/dist/features/tmux-subagent/pane-state-querier.d.ts +2 -0
  205. package/dist/features/tmux-subagent/types.d.ts +53 -0
  206. package/dist/hooks/agent-usage-reminder/constants.d.ts +5 -0
  207. package/dist/hooks/agent-usage-reminder/index.d.ts +22 -0
  208. package/dist/hooks/agent-usage-reminder/storage.d.ts +4 -0
  209. package/dist/hooks/agent-usage-reminder/types.d.ts +6 -0
  210. package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +4 -0
  211. package/dist/hooks/anthropic-context-window-limit-recovery/executor.test.d.ts +1 -0
  212. package/dist/hooks/anthropic-context-window-limit-recovery/index.d.ts +16 -0
  213. package/dist/hooks/anthropic-context-window-limit-recovery/parser.d.ts +2 -0
  214. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.d.ts +7 -0
  215. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.test.d.ts +1 -0
  216. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-types.d.ts +36 -0
  217. package/dist/hooks/anthropic-context-window-limit-recovery/storage.d.ts +28 -0
  218. package/dist/hooks/anthropic-context-window-limit-recovery/storage.test.d.ts +1 -0
  219. package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +37 -0
  220. package/dist/hooks/atlas/index.d.ts +35 -0
  221. package/dist/hooks/atlas/index.test.d.ts +1 -0
  222. package/dist/hooks/auto-slash-command/constants.d.ts +5 -0
  223. package/dist/hooks/auto-slash-command/detector.d.ts +9 -0
  224. package/dist/hooks/auto-slash-command/detector.test.d.ts +1 -0
  225. package/dist/hooks/auto-slash-command/executor.d.ts +11 -0
  226. package/dist/hooks/auto-slash-command/index.d.ts +12 -0
  227. package/dist/hooks/auto-slash-command/index.test.d.ts +1 -0
  228. package/dist/hooks/auto-slash-command/types.d.ts +27 -0
  229. package/dist/hooks/auto-update-checker/cache.d.ts +3 -0
  230. package/dist/hooks/auto-update-checker/checker.d.ts +20 -0
  231. package/dist/hooks/auto-update-checker/checker.test.d.ts +1 -0
  232. package/dist/hooks/auto-update-checker/constants.d.ts +10 -0
  233. package/dist/hooks/auto-update-checker/index.d.ts +17 -0
  234. package/dist/hooks/auto-update-checker/index.test.d.ts +1 -0
  235. package/dist/hooks/auto-update-checker/types.d.ts +25 -0
  236. package/dist/hooks/background-notification/index.d.ts +18 -0
  237. package/dist/hooks/background-notification/types.d.ts +4 -0
  238. package/dist/hooks/category-skill-reminder/index.d.ts +22 -0
  239. package/dist/hooks/category-skill-reminder/index.test.d.ts +1 -0
  240. package/dist/hooks/claude-code-hooks/config-loader.d.ts +13 -0
  241. package/dist/hooks/claude-code-hooks/config.d.ts +3 -0
  242. package/dist/hooks/claude-code-hooks/index.d.ts +48 -0
  243. package/dist/hooks/claude-code-hooks/plugin-config.d.ts +8 -0
  244. package/dist/hooks/claude-code-hooks/post-tool-use.d.ts +40 -0
  245. package/dist/hooks/claude-code-hooks/pre-compact.d.ts +16 -0
  246. package/dist/hooks/claude-code-hooks/pre-tool-use.d.ts +25 -0
  247. package/dist/hooks/claude-code-hooks/stop.d.ts +20 -0
  248. package/dist/hooks/claude-code-hooks/todo.d.ts +12 -0
  249. package/dist/hooks/claude-code-hooks/tool-input-cache.d.ts +5 -0
  250. package/dist/hooks/claude-code-hooks/transcript.d.ts +34 -0
  251. package/dist/hooks/claude-code-hooks/types.d.ts +183 -0
  252. package/dist/hooks/claude-code-hooks/user-prompt-submit.d.ts +22 -0
  253. package/dist/hooks/comment-checker/cli.d.ts +52 -0
  254. package/dist/hooks/comment-checker/cli.test.d.ts +1 -0
  255. package/dist/hooks/comment-checker/downloader.d.ts +25 -0
  256. package/dist/hooks/comment-checker/index.d.ts +19 -0
  257. package/dist/hooks/comment-checker/types.d.ts +31 -0
  258. package/dist/hooks/compaction-context-injector/index.d.ts +8 -0
  259. package/dist/hooks/compaction-context-injector/index.test.d.ts +1 -0
  260. package/dist/hooks/context-window-monitor.d.ts +18 -0
  261. package/dist/hooks/delegate-task-retry/index.d.ts +24 -0
  262. package/dist/hooks/delegate-task-retry/index.test.d.ts +1 -0
  263. package/dist/hooks/directory-agents-injector/constants.d.ts +3 -0
  264. package/dist/hooks/directory-agents-injector/index.d.ts +26 -0
  265. package/dist/hooks/directory-agents-injector/storage.d.ts +1 -0
  266. package/dist/hooks/directory-readme-injector/constants.d.ts +3 -0
  267. package/dist/hooks/directory-readme-injector/index.d.ts +26 -0
  268. package/dist/hooks/directory-readme-injector/storage.d.ts +1 -0
  269. package/dist/hooks/edit-error-recovery/index.d.ts +31 -0
  270. package/dist/hooks/edit-error-recovery/index.test.d.ts +1 -0
  271. package/dist/hooks/empty-task-response-detector.d.ts +12 -0
  272. package/dist/hooks/index.d.ts +35 -0
  273. package/dist/hooks/interactive-bash-session/constants.d.ts +4 -0
  274. package/dist/hooks/interactive-bash-session/index.d.ts +23 -0
  275. package/dist/hooks/interactive-bash-session/storage.d.ts +4 -0
  276. package/dist/hooks/interactive-bash-session/types.d.ts +10 -0
  277. package/dist/hooks/keyword-detector/analyze/default.d.ts +12 -0
  278. package/dist/hooks/keyword-detector/analyze/index.d.ts +1 -0
  279. package/dist/hooks/keyword-detector/constants.d.ts +10 -0
  280. package/dist/hooks/keyword-detector/detector.d.ts +11 -0
  281. package/dist/hooks/keyword-detector/index.d.ts +23 -0
  282. package/dist/hooks/keyword-detector/index.test.d.ts +1 -0
  283. package/dist/hooks/keyword-detector/search/default.d.ts +12 -0
  284. package/dist/hooks/keyword-detector/search/index.d.ts +1 -0
  285. package/dist/hooks/keyword-detector/types.d.ts +4 -0
  286. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +10 -0
  287. package/dist/hooks/keyword-detector/ultrawork/gpt5.2.d.ts +16 -0
  288. package/dist/hooks/keyword-detector/ultrawork/index.d.ts +17 -0
  289. package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +6 -0
  290. package/dist/hooks/keyword-detector/ultrawork/utils.d.ts +24 -0
  291. package/dist/hooks/non-interactive-env/constants.d.ts +34 -0
  292. package/dist/hooks/non-interactive-env/detector.d.ts +1 -0
  293. package/dist/hooks/non-interactive-env/index.d.ts +14 -0
  294. package/dist/hooks/non-interactive-env/index.test.d.ts +1 -0
  295. package/dist/hooks/non-interactive-env/types.d.ts +3 -0
  296. package/dist/hooks/prometheus-md-only/constants.d.ts +7 -0
  297. package/dist/hooks/prometheus-md-only/index.d.ts +12 -0
  298. package/dist/hooks/prometheus-md-only/index.test.d.ts +1 -0
  299. package/dist/hooks/question-label-truncator/index.d.ts +7 -0
  300. package/dist/hooks/question-label-truncator/index.test.d.ts +1 -0
  301. package/dist/hooks/ralph-loop/constants.d.ts +5 -0
  302. package/dist/hooks/ralph-loop/index.d.ts +21 -0
  303. package/dist/hooks/ralph-loop/index.test.d.ts +1 -0
  304. package/dist/hooks/ralph-loop/storage.d.ts +6 -0
  305. package/dist/hooks/ralph-loop/types.d.ts +17 -0
  306. package/dist/hooks/rules-injector/constants.d.ts +8 -0
  307. package/dist/hooks/rules-injector/finder.d.ts +33 -0
  308. package/dist/hooks/rules-injector/finder.test.d.ts +1 -0
  309. package/dist/hooks/rules-injector/index.d.ts +26 -0
  310. package/dist/hooks/rules-injector/matcher.d.ts +21 -0
  311. package/dist/hooks/rules-injector/output-path.d.ts +5 -0
  312. package/dist/hooks/rules-injector/output-path.test.d.ts +1 -0
  313. package/dist/hooks/rules-injector/parser.d.ts +18 -0
  314. package/dist/hooks/rules-injector/parser.test.d.ts +1 -0
  315. package/dist/hooks/rules-injector/storage.d.ts +9 -0
  316. package/dist/hooks/rules-injector/types.d.ts +54 -0
  317. package/dist/hooks/session-notification-utils.d.ts +9 -0
  318. package/dist/hooks/session-notification.d.ts +20 -0
  319. package/dist/hooks/session-notification.test.d.ts +1 -0
  320. package/dist/hooks/session-recovery/constants.d.ts +6 -0
  321. package/dist/hooks/session-recovery/index.d.ts +22 -0
  322. package/dist/hooks/session-recovery/index.test.d.ts +1 -0
  323. package/dist/hooks/session-recovery/storage.d.ts +19 -0
  324. package/dist/hooks/session-recovery/types.d.ts +90 -0
  325. package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +2 -0
  326. package/dist/hooks/sisyphus-junior-notepad/index.d.ts +12 -0
  327. package/dist/hooks/start-work/index.d.ts +16 -0
  328. package/dist/hooks/start-work/index.test.d.ts +1 -0
  329. package/dist/hooks/stop-continuation-guard/index.d.ts +16 -0
  330. package/dist/hooks/stop-continuation-guard/index.test.d.ts +1 -0
  331. package/dist/hooks/subagent-question-blocker/index.d.ts +2 -0
  332. package/dist/hooks/subagent-question-blocker/index.test.d.ts +1 -0
  333. package/dist/hooks/task-resume-info/index.d.ts +11 -0
  334. package/dist/hooks/think-mode/detector.d.ts +5 -0
  335. package/dist/hooks/think-mode/index.d.ts +14 -0
  336. package/dist/hooks/think-mode/index.test.d.ts +1 -0
  337. package/dist/hooks/think-mode/switcher.d.ts +69 -0
  338. package/dist/hooks/think-mode/switcher.test.d.ts +1 -0
  339. package/dist/hooks/think-mode/types.d.ts +21 -0
  340. package/dist/hooks/thinking-block-validator/index.d.ts +30 -0
  341. package/dist/hooks/todo-continuation-enforcer.d.ts +19 -0
  342. package/dist/hooks/todo-continuation-enforcer.test.d.ts +1 -0
  343. package/dist/hooks/tool-output-truncator.d.ts +17 -0
  344. package/dist/hooks/tool-output-truncator.test.d.ts +1 -0
  345. package/dist/hooks/unstable-agent-babysitter/index.d.ts +50 -0
  346. package/dist/hooks/unstable-agent-babysitter/index.test.d.ts +1 -0
  347. package/dist/index.d.ts +5 -0
  348. package/dist/index.js +76117 -0
  349. package/dist/index.test.d.ts +1 -0
  350. package/dist/mcp/context7.d.ts +9 -0
  351. package/dist/mcp/grep-app.d.ts +6 -0
  352. package/dist/mcp/index.d.ts +9 -0
  353. package/dist/mcp/index.test.d.ts +1 -0
  354. package/dist/mcp/types.d.ts +9 -0
  355. package/dist/mcp/websearch.d.ts +9 -0
  356. package/dist/oh-my-parallel-agent-opencode.schema.json +2182 -0
  357. package/dist/plugin-config.d.ts +4 -0
  358. package/dist/plugin-config.test.d.ts +1 -0
  359. package/dist/plugin-handlers/config-handler.d.ts +13 -0
  360. package/dist/plugin-handlers/config-handler.test.d.ts +1 -0
  361. package/dist/plugin-handlers/index.d.ts +1 -0
  362. package/dist/plugin-state.d.ts +6 -0
  363. package/dist/shared/agent-config-integration.test.d.ts +1 -0
  364. package/dist/shared/agent-display-names.d.ts +12 -0
  365. package/dist/shared/agent-display-names.test.d.ts +1 -0
  366. package/dist/shared/agent-tool-restrictions.d.ts +7 -0
  367. package/dist/shared/agent-variant.d.ts +9 -0
  368. package/dist/shared/agent-variant.test.d.ts +1 -0
  369. package/dist/shared/binary-downloader.d.ts +10 -0
  370. package/dist/shared/claude-config-dir.d.ts +1 -0
  371. package/dist/shared/claude-config-dir.test.d.ts +1 -0
  372. package/dist/shared/command-executor.d.ts +21 -0
  373. package/dist/shared/config-errors.d.ts +7 -0
  374. package/dist/shared/connected-providers-cache.d.ts +52 -0
  375. package/dist/shared/data-path.d.ts +30 -0
  376. package/dist/shared/deep-merge.d.ts +13 -0
  377. package/dist/shared/deep-merge.test.d.ts +1 -0
  378. package/dist/shared/dynamic-truncator.d.ts +27 -0
  379. package/dist/shared/external-plugin-detector.d.ts +18 -0
  380. package/dist/shared/external-plugin-detector.test.d.ts +1 -0
  381. package/dist/shared/file-reference-resolver.d.ts +1 -0
  382. package/dist/shared/file-utils.d.ts +7 -0
  383. package/dist/shared/first-message-variant.d.ts +11 -0
  384. package/dist/shared/first-message-variant.test.d.ts +1 -0
  385. package/dist/shared/frontmatter.d.ts +7 -0
  386. package/dist/shared/frontmatter.test.d.ts +1 -0
  387. package/dist/shared/hook-disabled.d.ts +2 -0
  388. package/dist/shared/index.d.ts +36 -0
  389. package/dist/shared/jsonc-parser.d.ts +15 -0
  390. package/dist/shared/jsonc-parser.test.d.ts +1 -0
  391. package/dist/shared/logger.d.ts +2 -0
  392. package/dist/shared/migration.d.ts +32 -0
  393. package/dist/shared/migration.test.d.ts +1 -0
  394. package/dist/shared/model-availability.d.ts +19 -0
  395. package/dist/shared/model-availability.test.d.ts +1 -0
  396. package/dist/shared/model-requirements.d.ts +13 -0
  397. package/dist/shared/model-requirements.test.d.ts +1 -0
  398. package/dist/shared/model-resolution-pipeline.d.ts +24 -0
  399. package/dist/shared/model-resolver.d.ts +22 -0
  400. package/dist/shared/model-resolver.test.d.ts +1 -0
  401. package/dist/shared/model-sanitizer.d.ts +3 -0
  402. package/dist/shared/model-suggestion-retry.d.ts +24 -0
  403. package/dist/shared/model-suggestion-retry.test.d.ts +1 -0
  404. package/dist/shared/ollama-ndjson-parser.d.ts +108 -0
  405. package/dist/shared/opencode-config-dir.d.ts +19 -0
  406. package/dist/shared/opencode-config-dir.test.d.ts +1 -0
  407. package/dist/shared/opencode-version.d.ts +19 -0
  408. package/dist/shared/opencode-version.test.d.ts +1 -0
  409. package/dist/shared/pattern-matcher.d.ts +3 -0
  410. package/dist/shared/permission-compat.d.ts +27 -0
  411. package/dist/shared/permission-compat.test.d.ts +1 -0
  412. package/dist/shared/session-cursor.d.ts +13 -0
  413. package/dist/shared/session-cursor.test.d.ts +1 -0
  414. package/dist/shared/session-injected-paths.d.ts +10 -0
  415. package/dist/shared/session-utils.d.ts +2 -0
  416. package/dist/shared/shell-env.d.ts +41 -0
  417. package/dist/shared/shell-env.test.d.ts +1 -0
  418. package/dist/shared/snake-case.d.ts +5 -0
  419. package/dist/shared/system-directive.d.ts +45 -0
  420. package/dist/shared/system-directive.test.d.ts +1 -0
  421. package/dist/shared/tmux/constants.d.ts +5 -0
  422. package/dist/shared/tmux/index.d.ts +3 -0
  423. package/dist/shared/tmux/tmux-utils.d.ts +17 -0
  424. package/dist/shared/tmux/tmux-utils.test.d.ts +1 -0
  425. package/dist/shared/tmux/types.d.ts +4 -0
  426. package/dist/shared/tool-name.d.ts +1 -0
  427. package/dist/shared/zip-extractor.d.ts +1 -0
  428. package/dist/tools/ast-grep/cli.d.ts +15 -0
  429. package/dist/tools/ast-grep/constants.d.ts +29 -0
  430. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  431. package/dist/tools/ast-grep/index.d.ts +8 -0
  432. package/dist/tools/ast-grep/tools.d.ts +3 -0
  433. package/dist/tools/ast-grep/types.d.ts +58 -0
  434. package/dist/tools/ast-grep/utils.d.ts +5 -0
  435. package/dist/tools/background-task/constants.d.ts +3 -0
  436. package/dist/tools/background-task/index.d.ts +4 -0
  437. package/dist/tools/background-task/tools.d.ts +47 -0
  438. package/dist/tools/background-task/tools.test.d.ts +1 -0
  439. package/dist/tools/background-task/types.d.ts +20 -0
  440. package/dist/tools/call-omo-agent/constants.d.ts +2 -0
  441. package/dist/tools/call-omo-agent/index.d.ts +3 -0
  442. package/dist/tools/call-omo-agent/tools.d.ts +3 -0
  443. package/dist/tools/call-omo-agent/types.d.ts +24 -0
  444. package/dist/tools/delegate-task/categories.d.ts +17 -0
  445. package/dist/tools/delegate-task/constants.d.ts +30 -0
  446. package/dist/tools/delegate-task/executor.d.ts +75 -0
  447. package/dist/tools/delegate-task/helpers.d.ts +30 -0
  448. package/dist/tools/delegate-task/index.d.ts +4 -0
  449. package/dist/tools/delegate-task/prompt-builder.d.ts +6 -0
  450. package/dist/tools/delegate-task/timing.d.ts +11 -0
  451. package/dist/tools/delegate-task/tools.d.ts +6 -0
  452. package/dist/tools/delegate-task/tools.test.d.ts +1 -0
  453. package/dist/tools/delegate-task/types.d.ts +44 -0
  454. package/dist/tools/glob/cli.d.ts +11 -0
  455. package/dist/tools/glob/cli.test.d.ts +1 -0
  456. package/dist/tools/glob/constants.d.ts +6 -0
  457. package/dist/tools/glob/index.d.ts +2 -0
  458. package/dist/tools/glob/tools.d.ts +2 -0
  459. package/dist/tools/glob/types.d.ts +20 -0
  460. package/dist/tools/glob/utils.d.ts +2 -0
  461. package/dist/tools/grep/cli.d.ts +3 -0
  462. package/dist/tools/grep/constants.d.ts +17 -0
  463. package/dist/tools/grep/downloader.d.ts +3 -0
  464. package/dist/tools/grep/downloader.test.d.ts +1 -0
  465. package/dist/tools/grep/index.d.ts +2 -0
  466. package/dist/tools/grep/tools.d.ts +2 -0
  467. package/dist/tools/grep/types.d.ts +36 -0
  468. package/dist/tools/grep/utils.d.ts +3 -0
  469. package/dist/tools/index.d.ts +15 -0
  470. package/dist/tools/interactive-bash/constants.d.ts +3 -0
  471. package/dist/tools/interactive-bash/index.d.ts +3 -0
  472. package/dist/tools/interactive-bash/tools.d.ts +7 -0
  473. package/dist/tools/interactive-bash/utils.d.ts +3 -0
  474. package/dist/tools/look-at/constants.d.ts +2 -0
  475. package/dist/tools/look-at/index.d.ts +3 -0
  476. package/dist/tools/look-at/tools.d.ts +9 -0
  477. package/dist/tools/look-at/tools.test.d.ts +1 -0
  478. package/dist/tools/look-at/types.d.ts +4 -0
  479. package/dist/tools/lsp/client.d.ts +50 -0
  480. package/dist/tools/lsp/config.d.ts +17 -0
  481. package/dist/tools/lsp/config.test.d.ts +1 -0
  482. package/dist/tools/lsp/constants.d.ts +9 -0
  483. package/dist/tools/lsp/index.d.ts +6 -0
  484. package/dist/tools/lsp/tools.d.ts +7 -0
  485. package/dist/tools/lsp/types.d.ts +123 -0
  486. package/dist/tools/lsp/utils.d.ts +26 -0
  487. package/dist/tools/session-manager/constants.d.ts +12 -0
  488. package/dist/tools/session-manager/index.d.ts +3 -0
  489. package/dist/tools/session-manager/storage.d.ts +12 -0
  490. package/dist/tools/session-manager/storage.test.d.ts +1 -0
  491. package/dist/tools/session-manager/tools.d.ts +5 -0
  492. package/dist/tools/session-manager/tools.test.d.ts +1 -0
  493. package/dist/tools/session-manager/types.d.ts +89 -0
  494. package/dist/tools/session-manager/utils.d.ts +11 -0
  495. package/dist/tools/session-manager/utils.test.d.ts +1 -0
  496. package/dist/tools/skill/constants.d.ts +3 -0
  497. package/dist/tools/skill/index.d.ts +3 -0
  498. package/dist/tools/skill/tools.d.ts +4 -0
  499. package/dist/tools/skill/tools.test.d.ts +1 -0
  500. package/dist/tools/skill/types.d.ts +28 -0
  501. package/dist/tools/skill-mcp/constants.d.ts +2 -0
  502. package/dist/tools/skill-mcp/index.d.ts +3 -0
  503. package/dist/tools/skill-mcp/tools.d.ts +11 -0
  504. package/dist/tools/skill-mcp/tools.test.d.ts +1 -0
  505. package/dist/tools/skill-mcp/types.d.ts +8 -0
  506. package/dist/tools/slashcommand/index.d.ts +2 -0
  507. package/dist/tools/slashcommand/tools.d.ts +5 -0
  508. package/dist/tools/slashcommand/tools.test.d.ts +1 -0
  509. package/dist/tools/slashcommand/types.d.ts +24 -0
  510. package/package.json +77 -6
  511. package/postinstall.mjs +43 -0
  512. package/__tests__/agents.test.ts +0 -107
  513. package/__tests__/config-handler.test.ts +0 -198
  514. package/__tests__/dynamic-agent.test.ts +0 -68
  515. package/__tests__/schema.test.ts +0 -149
  516. package/__tests__/setup.test.ts +0 -16
  517. package/bun.lock +0 -29
  518. package/oh-my-parallel-agent-opencode.example.json +0 -7
  519. package/src/agents/explore.ts +0 -117
  520. package/src/agents/index.ts +0 -69
  521. package/src/agents/librarian.ts +0 -302
  522. package/src/agents/metis.ts +0 -341
  523. package/src/agents/momus.ts +0 -237
  524. package/src/agents/types.ts +0 -95
  525. package/src/config/schema.ts +0 -15
  526. package/src/index.ts +0 -116
  527. package/src/plugin-handlers/config-handler.ts +0 -129
  528. package/src/utils/dynamic-agent.ts +0 -37
  529. package/tsconfig.json +0 -19
@@ -1,69 +0,0 @@
1
- import type { AgentConfig } from "@opencode-ai/sdk"
2
- import type { AgentOverrideConfig } from "./types"
3
- import { createLibrarianAgent } from "./librarian"
4
- import { createExploreAgent } from "./explore"
5
- import { createMetisAgent } from "./metis"
6
- import { createMomusAgent } from "./momus"
7
-
8
- export { createLibrarianAgent, createExploreAgent, createMetisAgent, createMomusAgent }
9
-
10
- export type SupportedAgentName = "librarian" | "explore" | "metis" | "momus"
11
-
12
- const AGENT_FACTORIES: Record<SupportedAgentName, (model: string) => AgentConfig> = {
13
- librarian: createLibrarianAgent,
14
- explore: createExploreAgent,
15
- metis: createMetisAgent,
16
- momus: createMomusAgent,
17
- }
18
-
19
- /**
20
- * 동적 에이전트 생성 함수
21
- *
22
- * @param name - 에이전트 이름 ("librarian" | "explore" | "metis" | "momus")
23
- * @param model - 사용할 모델 (예: "openai/gpt-5.2")
24
- * @param config - 선택적 오버라이드 설정 (모델, prompt_append 등)
25
- * @returns AgentConfig - 생성된 에이전트 설정
26
- *
27
- * @example
28
- * // 기본 사용
29
- * const momus = createDynamicAgent("momus", "openai/gpt-5.2")
30
- *
31
- * @example
32
- * // prompt_append 추가
33
- * const customMomus = createDynamicAgent("momus", "openai/gpt-5.2", {
34
- * prompt_append: "추가 지시사항: 한글로 응답하세요."
35
- * })
36
- *
37
- * @example
38
- * // 모델 오버라이드
39
- * const customExplore = createDynamicAgent("explore", "anthropic/claude-3-opus", {
40
- * temperature: 0.5
41
- * })
42
- */
43
- export function createDynamicAgent(
44
- name: SupportedAgentName,
45
- model: string,
46
- config?: AgentOverrideConfig
47
- ): AgentConfig {
48
- const factory_var = AGENT_FACTORIES[name]
49
- if (!factory_var) {
50
- throw new Error(`Unknown agent name: ${name}. Supported agents: ${Object.keys(AGENT_FACTORIES).join(", ")}`)
51
- }
52
-
53
- let agentConfig_var = factory_var(model)
54
-
55
- if (config) {
56
- const { prompt_append, ...restConfig_var } = config
57
-
58
- agentConfig_var = {
59
- ...agentConfig_var,
60
- ...restConfig_var,
61
- }
62
-
63
- if (prompt_append && agentConfig_var.prompt) {
64
- agentConfig_var.prompt = agentConfig_var.prompt + "\n" + prompt_append
65
- }
66
- }
67
-
68
- return agentConfig_var
69
- }
@@ -1,302 +0,0 @@
1
- import type { AgentConfig } from "@opencode-ai/sdk"
2
- import type { AgentMode, AgentPromptMetadata } from "./types"
3
-
4
- const MODE: AgentMode = "subagent"
5
-
6
- export const LIBRARIAN_PROMPT_METADATA: AgentPromptMetadata = {
7
- category: "exploration",
8
- cost: "CHEAP",
9
- promptAlias: "Librarian",
10
- keyTrigger: "External library/source mentioned → fire `librarian` background",
11
- triggers: [
12
- { domain: "Librarian", trigger: "Unfamiliar packages / libraries, struggles at weird behaviour (to find existing implementation of opensource)" },
13
- ],
14
- useWhen: [
15
- "How do I use [library]?",
16
- "What's the best practice for [framework feature]?",
17
- "Why does [external dependency] behave this way?",
18
- "Find examples of [library] usage",
19
- "Working with unfamiliar npm/pip/cargo packages",
20
- ],
21
- }
22
-
23
- export function createLibrarianAgent(model_var: string): AgentConfig {
24
- return {
25
- description:
26
- "Specialized codebase understanding agent for multi-repository analysis, searching remote codebases, retrieving official documentation, and finding implementation examples using GitHub CLI, Context7, and Web Search. MUST BE USED when users ask to look up code in remote repositories, explain library internals, or find usage examples in open source. (Librarian - OhMyOpenCode)",
27
- mode: MODE,
28
- model: model_var,
29
- temperature: 0.1,
30
- permission: {
31
- "write": "deny",
32
- "edit": "deny",
33
- "task": "deny",
34
- "delegate_task": "deny",
35
- "call_omo_agent": "deny",
36
- },
37
- prompt: `# THE LIBRARIAN
38
-
39
- You are **THE LIBRARIAN**, a specialized open-source codebase understanding agent.
40
-
41
- Your job: Answer questions about open-source libraries by finding **EVIDENCE** with **GitHub permalinks**.
42
-
43
- ## CRITICAL: DATE AWARENESS
44
-
45
- **CURRENT YEAR CHECK**: Before ANY search, verify the current date from environment context.
46
- - **NEVER search for ${new Date().getFullYear() - 1}** - It is NOT ${new Date().getFullYear() - 1} anymore
47
- - **ALWAYS use current year** (${new Date().getFullYear()}+) in search queries
48
- - When searching: use "library-name topic ${new Date().getFullYear()}" NOT "${new Date().getFullYear() - 1}"
49
- - Filter out outdated ${new Date().getFullYear() - 1} results when they conflict with ${new Date().getFullYear()} information
50
-
51
- ---
52
-
53
- ## PHASE 0: REQUEST CLASSIFICATION (MANDATORY FIRST STEP)
54
-
55
- Classify EVERY request into one of these categories before taking action:
56
-
57
- | Type | Trigger Examples | Tools |
58
- |------|------------------|-------|
59
- | **TYPE A: CONCEPTUAL** | "How do I use X?", "Best practice for Y?" | Doc Discovery → context7 + websearch |
60
- | **TYPE B: IMPLEMENTATION** | "How does X implement Y?", "Show me source of Z" | gh clone + read + blame |
61
- | **TYPE C: CONTEXT** | "Why was this changed?", "History of X?" | gh issues/prs + git log/blame |
62
- | **TYPE D: COMPREHENSIVE** | Complex/ambiguous requests | Doc Discovery → ALL tools |
63
-
64
- ---
65
-
66
- ## PHASE 0.5: DOCUMENTATION DISCOVERY (FOR TYPE A & D)
67
-
68
- **When to execute**: Before TYPE A or TYPE D investigations involving external libraries/frameworks.
69
-
70
- ### Step 1: Find Official Documentation
71
- \`\`\`
72
- websearch("library-name official documentation site")
73
- \`\`\`
74
- - Identify the **official documentation URL** (not blogs, not tutorials)
75
- - Note the base URL (e.g., \`https://docs.example.com\`)
76
-
77
- ### Step 2: Version Check (if version specified)
78
- If user mentions a specific version (e.g., "React 18", "Next.js 14", "v2.x"):
79
- \`\`\`
80
- websearch("library-name v{version} documentation")
81
- // OR check if docs have version selector:
82
- webfetch(official_docs_url + "/versions")
83
- // or
84
- webfetch(official_docs_url + "/v{version}")
85
- \`\`\`
86
- - Confirm you're looking at the **correct version's documentation**
87
- - Many docs have versioned URLs: \`/docs/v2/\`, \`/v14/\`, etc.
88
-
89
- ### Step 3: Sitemap Discovery (understand doc structure)
90
- \`\`\`
91
- webfetch(official_docs_base_url + "/sitemap.xml")
92
- // Fallback options:
93
- webfetch(official_docs_base_url + "/sitemap-0.xml")
94
- webfetch(official_docs_base_url + "/docs/sitemap.xml")
95
- \`\`\`
96
- - Parse sitemap to understand documentation structure
97
- - Identify relevant sections for the user's question
98
- - This prevents random searching—you now know WHERE to look
99
-
100
- ### Step 4: Targeted Investigation
101
- With sitemap knowledge, fetch the SPECIFIC documentation pages relevant to the query:
102
- \`\`\`
103
- webfetch(specific_doc_page_from_sitemap)
104
- context7_query-docs(libraryId: id, query: "specific topic")
105
- \`\`\`
106
-
107
- **Skip Doc Discovery when**:
108
- - TYPE B (implementation) - you're cloning repos anyway
109
- - TYPE C (context/history) - you're looking at issues/PRs
110
- - Library has no official docs (rare OSS projects)
111
-
112
- ---
113
-
114
- ## PHASE 1: EXECUTE BY REQUEST TYPE
115
-
116
- ### TYPE A: CONCEPTUAL QUESTION
117
- **Trigger**: "How do I...", "What is...", "Best practice for...", rough/general questions
118
-
119
- **Execute Documentation Discovery FIRST (Phase 0.5)**, then:
120
- \`\`\`
121
- Tool 1: context7_resolve-library-id("library-name")
122
- → then context7_query-docs(libraryId: id, query: "specific-topic")
123
- Tool 2: webfetch(relevant_pages_from_sitemap) // Targeted, not random
124
- Tool 3: grep_app_searchGitHub(query: "usage pattern", language: ["TypeScript"])
125
- \`\`\`
126
-
127
- **Output**: Summarize findings with links to official docs (versioned if applicable) and real-world examples.
128
-
129
- ---
130
-
131
- ### TYPE B: IMPLEMENTATION REFERENCE
132
- **Trigger**: "How does X implement...", "Show me the source...", "Internal logic of..."
133
-
134
- **Execute in sequence**:
135
- \`\`\`
136
- Step 1: Clone to temp directory
137
- gh repo clone owner/repo \${TMPDIR:-/tmp}/repo-name -- --depth 1
138
-
139
- Step 2: Get commit SHA for permalinks
140
- cd \${TMPDIR:-/tmp}/repo-name && git rev-parse HEAD
141
-
142
- Step 3: Find the implementation
143
- - grep/ast_grep_search for function/class
144
- - read the specific file
145
- - git blame for context if needed
146
-
147
- Step 4: Construct permalink
148
- https://github.com/owner/repo/blob/<sha>/path/to/file#L10-L20
149
- \`\`\`
150
-
151
- **Parallel acceleration (4+ calls)**:
152
- \`\`\`
153
- Tool 1: gh repo clone owner/repo \${TMPDIR:-/tmp}/repo -- --depth 1
154
- Tool 2: grep_app_searchGitHub(query: "function_name", repo: "owner/repo")
155
- Tool 3: gh api repos/owner/repo/commits/HEAD --jq '.sha'
156
- Tool 4: context7_get-library-docs(id, topic: "relevant-api")
157
- \`\`\`
158
-
159
- ---
160
-
161
- ### TYPE C: CONTEXT & HISTORY
162
- **Trigger**: "Why was this changed?", "What's the history?", "Related issues/PRs?"
163
-
164
- **Execute in parallel (4+ calls)**:
165
- \`\`\`
166
- Tool 1: gh search issues "keyword" --repo owner/repo --state all --limit 10
167
- Tool 2: gh search prs "keyword" --repo owner/repo --state merged --limit 10
168
- Tool 3: gh repo clone owner/repo \${TMPDIR:-/tmp}/repo -- --depth 50
169
- → then: git log --oneline -n 20 -- path/to/file
170
- → then: git blame -L 10,30 path/to/file
171
- Tool 4: gh api repos/owner/repo/releases --jq '.[0:5]'
172
- \`\`\`
173
-
174
- **For specific issue/PR context**:
175
- \`\`\`
176
- gh issue view <number> --repo owner/repo --comments
177
- gh pr view <number> --repo owner/repo --comments
178
- gh api repos/owner/repo/pulls/<number>/files
179
- \`\`\`
180
-
181
- ---
182
-
183
- ## PHASE 2: EVIDENCE SYNTHESIS
184
-
185
- ### MANDATORY CITATION FORMAT
186
-
187
- Every claim MUST include a permalink:
188
-
189
- \`\`\`markdown
190
- **Claim**: [What you're asserting]
191
-
192
- **Evidence** ([source](https://github.com/owner/repo/blob/<sha>/path#L10-L20)):
193
- \\\`\\\`\\\`typescript
194
- // The actual code
195
- function example() { ... }
196
- \\\`\\\`\\\`
197
-
198
- **Explanation**: This works because [specific reason from the code].
199
- \`\`\`
200
-
201
- ### PERMALINK CONSTRUCTION
202
-
203
- \`\`\`
204
- https://github.com/<owner>/<repo>/blob/<commit-sha>/<filepath>#L<start>-L<end>
205
-
206
- Example:
207
- https://github.com/tanstack/query/blob/abc123def/packages/react-query/src/useQuery.ts#L42-L50
208
- \`\`\`
209
-
210
- **Getting SHA**:
211
- - From clone: \`git rev-parse HEAD\`
212
- - From API: \`gh api repos/owner/repo/commits/HEAD --jq '.sha'\`
213
- - From tag: \`gh api repos/owner/repo/git/refs/tags/v1.0.0 --jq '.object.sha'\`
214
-
215
- ---
216
-
217
- ## TOOL REFERENCE
218
-
219
- ### Primary Tools by Purpose
220
-
221
- | Purpose | Tool | Command/Usage |
222
- |---------|------|---------------|
223
- | **Official Docs** | context7 | \`context7_resolve-library-id\` → \`context7_query-docs\` |
224
- | **Find Docs URL** | websearch_exa | \`websearch_exa_web_search_exa("library official documentation")\` |
225
- | **Sitemap Discovery** | webfetch | \`webfetch(docs_url + "/sitemap.xml")\` to understand doc structure |
226
- | **Read Doc Page** | webfetch | \`webfetch(specific_doc_page)\` for targeted documentation |
227
- | **Latest Info** | websearch_exa | \`websearch_exa_web_search_exa("query ${new Date().getFullYear()}")\` |
228
- | **Fast Code Search** | grep_app | \`grep_app_searchGitHub(query, language, useRegexp)\` |
229
- | **Deep Code Search** | gh CLI | \`gh search code "query" --repo owner/repo\` |
230
- | **Clone Repo** | gh CLI | \`gh repo clone owner/repo \${TMPDIR:-/tmp}/name -- --depth 1\` |
231
- | **Issues/PRs** | gh CLI | \`gh search issues/prs "query" --repo owner/repo\` |
232
- | **View Issue/PR** | gh CLI | \`gh issue/pr view <num> --repo owner/repo --comments\` |
233
- | **Release Info** | gh CLI | \`gh api repos/owner/repo/releases/latest\` |
234
- | **Git History** | git | \`git log\`, \`git blame\`, \`git show\` |
235
-
236
- ### Temp Directory
237
-
238
- Use OS-appropriate temp directory:
239
- \`\`\`bash
240
- # Cross-platform
241
- \${TMPDIR:-/tmp}/repo-name
242
-
243
- # Examples:
244
- # macOS: /var/folders/.../repo-name or /tmp/repo-name
245
- # Linux: /tmp/repo-name
246
- # Windows: C:\\Users\\...\\AppData\\Local\\Temp\\repo-name
247
- \`\`\`
248
-
249
- ---
250
-
251
- ## PARALLEL EXECUTION REQUIREMENTS
252
-
253
- | Request Type | Suggested Calls | Doc Discovery Required |
254
- |--------------|----------------|
255
- | TYPE A (Conceptual) | 1-2 | YES (Phase 0.5 first) |
256
- | TYPE B (Implementation) | 2-3 | NO |
257
- | TYPE C (Context) | 2-3 | NO |
258
- | TYPE D (Comprehensive) | 3-5 | YES (Phase 0.5 first) |
259
- | Request Type | Minimum Parallel Calls
260
-
261
- **Doc Discovery is SEQUENTIAL** (websearch → version check → sitemap → investigate).
262
- **Main phase is PARALLEL** once you know where to look.
263
-
264
- **Always vary queries** when using grep_app:
265
- \`\`\`
266
- // GOOD: Different angles
267
- grep_app_searchGitHub(query: "useQuery(", language: ["TypeScript"])
268
- grep_app_searchGitHub(query: "queryOptions", language: ["TypeScript"])
269
- grep_app_searchGitHub(query: "staleTime:", language: ["TypeScript"])
270
-
271
- // BAD: Same pattern
272
- grep_app_searchGitHub(query: "useQuery")
273
- grep_app_searchGitHub(query: "useQuery")
274
- \`\`\`
275
-
276
- ---
277
-
278
- ## FAILURE RECOVERY
279
-
280
- | Failure | Recovery Action |
281
- |---------|-----------------|
282
- | context7 not found | Clone repo, read source + README directly |
283
- | grep_app no results | Broaden query, try concept instead of exact name |
284
- | gh API rate limit | Use cloned repo in temp directory |
285
- | Repo not found | Search for forks or mirrors |
286
- | Sitemap not found | Try \`/sitemap-0.xml\`, \`/sitemap_index.xml\`, or fetch docs index page and parse navigation |
287
- | Versioned docs not found | Fall back to latest version, note this in response |
288
- | Uncertain | **STATE YOUR UNCERTAINTY**, propose hypothesis |
289
-
290
- ---
291
-
292
- ## COMMUNICATION RULES
293
-
294
- 1. **NO TOOL NAMES**: Say "I'll search the codebase" not "I'll use grep_app"
295
- 2. **NO PREAMBLE**: Answer directly, skip "I'll help you with..."
296
- 3. **ALWAYS CITE**: Every code claim needs a permalink
297
- 4. **USE MARKDOWN**: Code blocks with language identifiers
298
- 5. **BE CONCISE**: Facts > opinions, evidence > speculation
299
- `,
300
- }
301
- }
302
- createLibrarianAgent.mode = MODE