@oh-my-pi/pi-coding-agent 6.9.69 → 8.0.0

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 (502) hide show
  1. package/CHANGELOG.md +219 -51
  2. package/README.md +1 -1
  3. package/docs/hooks.md +2 -2
  4. package/docs/sdk.md +1 -1
  5. package/examples/sdk/04-skills.ts +1 -1
  6. package/package.json +10 -10
  7. package/scripts/format-prompts.ts +143 -0
  8. package/scripts/generate-template.ts +1 -1
  9. package/src/cli/args.ts +3 -3
  10. package/src/cli/config-cli.ts +4 -4
  11. package/src/cli/file-processor.ts +3 -3
  12. package/src/cli/list-models.ts +2 -2
  13. package/src/cli/plugin-cli.ts +3 -3
  14. package/src/cli/session-picker.ts +2 -2
  15. package/src/cli/setup-cli.ts +2 -2
  16. package/src/cli/stats-cli.ts +1 -1
  17. package/src/cli/update-cli.ts +2 -2
  18. package/src/{core → config}/keybindings.ts +1 -1
  19. package/src/{core → config}/model-registry.ts +8 -1
  20. package/src/{core → config}/model-resolver.ts +3 -3
  21. package/src/{core → config}/prompt-templates.ts +2 -2
  22. package/src/{core → config}/settings-manager.ts +6 -6
  23. package/src/{core/cursor/exec-bridge.ts → cursor.ts} +4 -4
  24. package/src/discovery/agents-md.ts +4 -4
  25. package/src/discovery/builtin.ts +17 -17
  26. package/src/discovery/claude.ts +12 -12
  27. package/src/discovery/cline.ts +6 -6
  28. package/src/discovery/codex.ts +21 -21
  29. package/src/discovery/cursor.ts +9 -9
  30. package/src/discovery/gemini.ts +9 -9
  31. package/src/discovery/github.ts +6 -6
  32. package/src/discovery/helpers.ts +4 -4
  33. package/src/discovery/index.ts +16 -16
  34. package/src/discovery/mcp-json.ts +4 -4
  35. package/src/discovery/ssh.ts +4 -4
  36. package/src/discovery/vscode.ts +4 -4
  37. package/src/discovery/windsurf.ts +6 -6
  38. package/src/{core/tools/exa → exa}/company.ts +2 -3
  39. package/src/{core/tools/exa → exa}/index.ts +2 -2
  40. package/src/{core/tools/exa → exa}/linkedin.ts +2 -3
  41. package/src/{core/tools/exa → exa}/mcp-client.ts +2 -2
  42. package/src/{core/tools/exa → exa}/render.ts +3 -3
  43. package/src/{core/tools/exa → exa}/researcher.ts +1 -1
  44. package/src/{core/tools/exa → exa}/search.ts +2 -10
  45. package/src/{core/tools/exa → exa}/websets.ts +1 -1
  46. package/src/{core → exec}/bash-executor.ts +23 -7
  47. package/src/{core → export}/custom-share.ts +1 -1
  48. package/src/{core/export-html → export/html}/index.ts +3 -3
  49. package/src/{core → export}/ttsr.ts +2 -2
  50. package/src/{core → extensibility}/custom-commands/bundled/review/index.ts +4 -4
  51. package/src/{core → extensibility}/custom-commands/loader.ts +3 -3
  52. package/src/{core → extensibility}/custom-commands/types.ts +1 -1
  53. package/src/{core → extensibility}/custom-tools/loader.ts +9 -9
  54. package/src/{core → extensibility}/custom-tools/types.ts +6 -6
  55. package/src/{core → extensibility}/custom-tools/wrapper.ts +1 -1
  56. package/src/{core → extensibility}/extensions/loader.ts +8 -8
  57. package/src/{core → extensibility}/extensions/runner.ts +3 -3
  58. package/src/{core → extensibility}/extensions/types.ts +15 -15
  59. package/src/{core → extensibility}/extensions/wrapper.ts +1 -1
  60. package/src/{core → extensibility}/hooks/index.ts +1 -1
  61. package/src/{core → extensibility}/hooks/loader.ts +7 -7
  62. package/src/{core → extensibility}/hooks/runner.ts +4 -4
  63. package/src/{core → extensibility}/hooks/types.ts +9 -9
  64. package/src/{core → extensibility}/plugins/doctor.ts +1 -1
  65. package/src/{core → extensibility}/plugins/installer.ts +2 -3
  66. package/src/{core → extensibility}/plugins/paths.ts +1 -1
  67. package/src/{core → extensibility}/skills.ts +8 -48
  68. package/src/{core → extensibility}/slash-commands.ts +6 -6
  69. package/src/index.ts +127 -128
  70. package/src/internal-urls/agent-protocol.ts +126 -0
  71. package/src/internal-urls/artifact-protocol.ts +93 -0
  72. package/src/internal-urls/index.ts +28 -0
  73. package/src/internal-urls/json-query.ts +126 -0
  74. package/src/internal-urls/router.ts +69 -0
  75. package/src/internal-urls/rule-protocol.ts +56 -0
  76. package/src/internal-urls/skill-protocol.ts +112 -0
  77. package/src/internal-urls/types.ts +48 -0
  78. package/src/{core/python-executor.ts → ipy/executor.ts} +74 -13
  79. package/src/{core/python-gateway-coordinator.ts → ipy/gateway-coordinator.ts} +40 -270
  80. package/src/{core/python-kernel.ts → ipy/kernel.ts} +38 -10
  81. package/src/{core/python-prelude.py → ipy/prelude.py} +201 -8
  82. package/src/ipy/prelude.ts +3 -0
  83. package/src/{core/tools/lsp → lsp}/client.ts +7 -6
  84. package/src/{core/tools/lsp → lsp}/clients/biome-client.ts +1 -1
  85. package/src/{core/tools/lsp → lsp}/clients/index.ts +1 -1
  86. package/src/{core/tools/lsp → lsp}/clients/lsp-linter-client.ts +4 -4
  87. package/src/{core/tools/lsp → lsp}/config.ts +1 -1
  88. package/src/{core/tools/lsp → lsp}/index.ts +29 -17
  89. package/src/{core/tools/lsp → lsp}/render.ts +2 -2
  90. package/src/{core/tools/lsp → lsp}/types.ts +14 -16
  91. package/src/{core/tools/lsp → lsp}/utils.ts +1 -1
  92. package/src/main.ts +12 -12
  93. package/src/{core/mcp → mcp}/config.ts +8 -8
  94. package/src/{core/mcp → mcp}/loader.ts +5 -6
  95. package/src/{core/mcp → mcp}/manager.ts +2 -2
  96. package/src/{core/mcp → mcp}/tool-bridge.ts +35 -6
  97. package/src/{core/mcp → mcp}/tool-cache.ts +1 -1
  98. package/src/{core/mcp → mcp}/transports/http.ts +7 -1
  99. package/src/{core/mcp → mcp}/transports/stdio.ts +1 -1
  100. package/src/{core/mcp → mcp}/types.ts +1 -1
  101. package/src/migrations.ts +2 -2
  102. package/src/modes/{interactive/components → components}/armin.ts +1 -1
  103. package/src/modes/{interactive/components → components}/assistant-message.ts +1 -1
  104. package/src/modes/{interactive/components → components}/bash-execution.ts +37 -29
  105. package/src/modes/{interactive/components → components}/bordered-loader.ts +1 -1
  106. package/src/modes/{interactive/components → components}/branch-summary-message.ts +2 -2
  107. package/src/modes/{interactive/components → components}/compaction-summary-message.ts +2 -2
  108. package/src/modes/{interactive/components → components}/custom-message.ts +3 -3
  109. package/src/modes/{interactive/components → components}/diff.ts +1 -1
  110. package/src/modes/{interactive/components → components}/dynamic-border.ts +1 -1
  111. package/src/modes/{interactive/components → components}/extensions/extension-dashboard.ts +3 -3
  112. package/src/modes/{interactive/components → components}/extensions/extension-list.ts +2 -2
  113. package/src/modes/{interactive/components → components}/extensions/inspector-panel.ts +1 -1
  114. package/src/modes/{interactive/components → components}/extensions/state-manager.ts +11 -17
  115. package/src/modes/{interactive/components → components}/extensions/types.ts +1 -1
  116. package/src/modes/{interactive/components → components}/footer.ts +3 -3
  117. package/src/modes/{interactive/components → components}/history-search.ts +2 -2
  118. package/src/modes/{interactive/components → components}/hook-editor.ts +1 -1
  119. package/src/modes/{interactive/components → components}/hook-input.ts +1 -1
  120. package/src/modes/{interactive/components → components}/hook-message.ts +3 -3
  121. package/src/modes/{interactive/components → components}/hook-selector.ts +1 -1
  122. package/src/modes/{interactive/components → components}/keybinding-hints.ts +2 -2
  123. package/src/modes/{interactive/components → components}/login-dialog.ts +1 -1
  124. package/src/modes/{interactive/components → components}/model-selector.ts +5 -5
  125. package/src/modes/{interactive/components → components}/oauth-selector.ts +2 -2
  126. package/src/modes/{interactive/components → components}/plugin-settings.ts +3 -3
  127. package/src/modes/{interactive/components → components}/python-execution.ts +35 -24
  128. package/src/modes/{interactive/components → components}/queue-mode-selector.ts +1 -1
  129. package/src/modes/{interactive/components → components}/read-tool-group.ts +2 -2
  130. package/src/modes/{interactive/components → components}/session-selector.ts +3 -3
  131. package/src/modes/{interactive/components → components}/settings-defs.ts +2 -2
  132. package/src/modes/{interactive/components → components}/settings-selector.ts +2 -2
  133. package/src/modes/{interactive/components → components}/show-images-selector.ts +1 -1
  134. package/src/modes/{interactive/components → components}/status-line/segments.ts +2 -2
  135. package/src/modes/{interactive/components → components}/status-line/separators.ts +1 -1
  136. package/src/modes/{interactive/components → components}/status-line/types.ts +2 -2
  137. package/src/modes/{interactive/components → components}/status-line-segment-editor.ts +2 -2
  138. package/src/modes/{interactive/components → components}/status-line.ts +3 -3
  139. package/src/modes/{interactive/components → components}/theme-selector.ts +1 -1
  140. package/src/modes/{interactive/components → components}/thinking-selector.ts +1 -1
  141. package/src/modes/{interactive/components → components}/todo-display.ts +3 -4
  142. package/src/modes/{interactive/components → components}/todo-reminder.ts +2 -2
  143. package/src/modes/{interactive/components → components}/tool-execution.ts +8 -8
  144. package/src/modes/{interactive/components → components}/tree-selector.ts +3 -3
  145. package/src/modes/{interactive/components → components}/ttsr-notification.ts +2 -2
  146. package/src/modes/{interactive/components → components}/user-message-selector.ts +1 -1
  147. package/src/modes/{interactive/components → components}/user-message.ts +1 -1
  148. package/src/modes/{interactive/components → components}/welcome.ts +2 -2
  149. package/src/modes/{interactive/controllers → controllers}/command-controller.ts +381 -30
  150. package/src/modes/{interactive/controllers → controllers}/event-controller.ts +9 -9
  151. package/src/modes/{interactive/controllers → controllers}/extension-ui-controller.ts +8 -8
  152. package/src/modes/{interactive/controllers → controllers}/input-controller.ts +61 -13
  153. package/src/modes/{interactive/controllers → controllers}/selector-controller.ts +16 -16
  154. package/src/modes/index.ts +1 -1
  155. package/src/modes/{interactive/interactive-mode.ts → interactive-mode.ts} +20 -15
  156. package/src/modes/print-mode.ts +1 -1
  157. package/src/modes/rpc/rpc-client.ts +3 -3
  158. package/src/modes/rpc/rpc-mode.ts +3 -3
  159. package/src/modes/rpc/rpc-types.ts +3 -3
  160. package/src/modes/{interactive/theme → theme}/theme.ts +1 -1
  161. package/src/modes/{interactive/types.ts → types.ts} +10 -10
  162. package/src/modes/{interactive/utils → utils}/ui-helpers.ts +20 -27
  163. package/src/{core/tools/patch → patch}/applicator.ts +1 -1
  164. package/src/{core/tools/patch → patch}/diff.ts +1 -1
  165. package/src/{core/tools/patch → patch}/index.ts +31 -36
  166. package/src/{core/tools/patch → patch}/shared.ts +9 -6
  167. package/src/prompts/agents/explore.md +83 -46
  168. package/src/prompts/agents/init.md +9 -4
  169. package/src/prompts/agents/plan.md +8 -7
  170. package/src/prompts/agents/reviewer.md +36 -18
  171. package/src/prompts/agents/task.md +4 -4
  172. package/src/prompts/compaction/branch-summary-preamble.md +0 -1
  173. package/src/prompts/review-request.md +0 -1
  174. package/src/prompts/system/custom-system-prompt.md +2 -14
  175. package/src/prompts/system/file-operations.md +0 -2
  176. package/src/prompts/system/system-prompt.md +182 -171
  177. package/src/prompts/system/web-search.md +26 -0
  178. package/src/prompts/tools/ask.md +31 -24
  179. package/src/prompts/tools/bash.md +20 -17
  180. package/src/prompts/tools/calculator.md +9 -5
  181. package/src/prompts/tools/fetch.md +16 -0
  182. package/src/prompts/tools/find.md +15 -5
  183. package/src/prompts/tools/gemini-image.md +21 -6
  184. package/src/prompts/tools/grep.md +28 -12
  185. package/src/prompts/tools/lsp.md +35 -14
  186. package/src/prompts/tools/patch.md +39 -41
  187. package/src/prompts/tools/python.md +59 -77
  188. package/src/prompts/tools/read.md +23 -22
  189. package/src/prompts/tools/replace.md +19 -12
  190. package/src/prompts/tools/ssh.md +21 -28
  191. package/src/prompts/tools/task.md +54 -44
  192. package/src/prompts/tools/todo-write.md +52 -163
  193. package/src/prompts/tools/web-search.md +16 -9
  194. package/src/prompts/tools/write.md +13 -2
  195. package/src/{core/sdk.ts → sdk.ts} +65 -34
  196. package/src/{core → session}/agent-session.ts +157 -41
  197. package/src/{core → session}/agent-storage.ts +2 -2
  198. package/src/session/artifacts.ts +110 -0
  199. package/src/{core → session}/auth-storage.ts +525 -203
  200. package/src/{core → session}/compaction/branch-summarization.ts +5 -5
  201. package/src/{core → session}/compaction/compaction.ts +6 -6
  202. package/src/{core → session}/compaction/utils.ts +3 -3
  203. package/src/{core → session}/history-storage.ts +1 -1
  204. package/src/{core → session}/messages.ts +6 -8
  205. package/src/{core → session}/session-manager.ts +2 -2
  206. package/src/{core → session}/storage-migration.ts +2 -2
  207. package/src/session/streaming-output.ts +177 -0
  208. package/src/{core/ssh → ssh}/connection-manager.ts +1 -1
  209. package/src/{core/ssh → ssh}/ssh-executor.ts +19 -4
  210. package/src/{core/ssh → ssh}/sshfs-mount.ts +1 -1
  211. package/src/{core/system-prompt.ts → system-prompt.ts} +8 -37
  212. package/src/{core/tools/task → task}/agents.ts +8 -8
  213. package/src/{core/tools/task → task}/commands.ts +5 -6
  214. package/src/{core/tools/task → task}/discovery.ts +3 -3
  215. package/src/{core/tools/task → task}/executor.ts +34 -44
  216. package/src/{core/tools/task → task}/index.ts +206 -50
  217. package/src/{core/tools/task → task}/render.ts +80 -23
  218. package/src/{core/tools/task → task}/subprocess-tool-registry.ts +1 -1
  219. package/src/task/template.ts +47 -0
  220. package/src/{core/tools/task → task}/types.ts +19 -27
  221. package/src/{core/tools/task → task}/worker-protocol.ts +8 -4
  222. package/src/{core/tools/task → task}/worker.ts +34 -29
  223. package/src/task/worktree.ts +166 -0
  224. package/src/{core/tools → tools}/ask.ts +13 -21
  225. package/src/{core/tools → tools}/bash-interceptor.ts +1 -1
  226. package/src/{core/tools → tools}/bash.ts +61 -63
  227. package/src/{core/tools → tools}/calculator.ts +4 -4
  228. package/src/{core/tools → tools}/complete.ts +1 -1
  229. package/src/{core/tools → tools}/context.ts +2 -2
  230. package/src/{core/tools/web-fetch.ts → tools/fetch.ts} +97 -76
  231. package/src/{core/tools → tools}/find.ts +96 -107
  232. package/src/{core/tools → tools}/gemini-image.ts +420 -29
  233. package/src/{core/tools → tools}/grep.ts +155 -164
  234. package/src/{core/tools → tools}/index.ts +63 -56
  235. package/src/tools/list-limit.ts +40 -0
  236. package/src/{core/tools → tools}/ls.ts +44 -35
  237. package/src/{core/tools → tools}/notebook.ts +3 -3
  238. package/src/tools/output-meta.ts +443 -0
  239. package/src/tools/output-utils.ts +63 -0
  240. package/src/{core/tools → tools}/python.ts +106 -89
  241. package/src/tools/read.ts +882 -0
  242. package/src/{core/tools → tools}/render-utils.ts +1 -1
  243. package/src/{core/tools → tools}/renderers.ts +8 -10
  244. package/src/{core/tools → tools}/review.ts +2 -2
  245. package/src/{core/tools → tools}/ssh.ts +56 -59
  246. package/src/{core/tools → tools}/todo-write.ts +12 -23
  247. package/src/tools/tool-errors.ts +95 -0
  248. package/src/tools/tool-result.ts +92 -0
  249. package/src/{core/tools → tools}/truncate.ts +2 -2
  250. package/src/{core/tools → tools}/write.ts +15 -13
  251. package/src/utils/changelog.ts +1 -1
  252. package/src/{core → utils}/file-mentions.ts +4 -4
  253. package/src/utils/image-convert.ts +1 -1
  254. package/src/utils/image-resize.ts +1 -1
  255. package/src/utils/shell.ts +1 -1
  256. package/src/{core → utils}/title-generator.ts +4 -4
  257. package/src/utils/tools-manager.ts +1 -1
  258. package/src/{core/tools/web-scrapers → web/scrapers}/choosealicense.ts +1 -1
  259. package/src/{core/tools/web-scrapers → web/scrapers}/twitter.ts +3 -2
  260. package/src/{core/tools/web-scrapers → web/scrapers}/types.ts +4 -2
  261. package/src/{core/tools/web-scrapers → web/scrapers}/utils.ts +1 -1
  262. package/src/{core/tools/web-scrapers → web/scrapers}/youtube.ts +14 -13
  263. package/src/{core/tools/web-search → web/search}/auth.ts +4 -4
  264. package/src/{core/tools/web-search → web/search}/index.ts +22 -71
  265. package/src/{core/tools/web-search → web/search}/providers/anthropic.ts +7 -10
  266. package/src/{core/tools/web-search → web/search}/providers/exa.ts +2 -2
  267. package/src/{core/tools/web-search → web/search}/providers/perplexity.ts +4 -16
  268. package/src/{core/tools/web-search → web/search}/render.ts +3 -3
  269. package/scripts/migrate-sessions.sh +0 -93
  270. package/src/core/index.ts +0 -56
  271. package/src/core/python-prelude.ts +0 -3
  272. package/src/core/ssh-executor.ts +0 -5
  273. package/src/core/streaming-output.ts +0 -115
  274. package/src/core/tools/output.ts +0 -519
  275. package/src/core/tools/read.ts +0 -717
  276. package/src/core/tools/task/template.ts +0 -37
  277. package/src/prompts/tools/output.md +0 -47
  278. package/src/prompts/tools/web-fetch.md +0 -9
  279. /package/src/{core/tools/exa → exa}/types.ts +0 -0
  280. /package/src/{core → exec}/exec.ts +0 -0
  281. /package/src/{core/export-html → export/html}/template.css +0 -0
  282. /package/src/{core/export-html → export/html}/template.generated.ts +0 -0
  283. /package/src/{core/export-html → export/html}/template.html +0 -0
  284. /package/src/{core/export-html → export/html}/template.js +0 -0
  285. /package/src/{core/export-html → export/html}/template.macro.ts +0 -0
  286. /package/src/{core/export-html → export/html}/vendor/highlight.min.js +0 -0
  287. /package/src/{core/export-html → export/html}/vendor/marked.min.js +0 -0
  288. /package/src/{core → extensibility}/custom-commands/index.ts +0 -0
  289. /package/src/{core → extensibility}/custom-tools/index.ts +0 -0
  290. /package/src/{core → extensibility}/extensions/index.ts +0 -0
  291. /package/src/{core → extensibility}/hooks/tool-wrapper.ts +0 -0
  292. /package/src/{core → extensibility}/plugins/index.ts +0 -0
  293. /package/src/{core → extensibility}/plugins/loader.ts +0 -0
  294. /package/src/{core → extensibility}/plugins/manager.ts +0 -0
  295. /package/src/{core → extensibility}/plugins/parser.ts +0 -0
  296. /package/src/{core → extensibility}/plugins/types.ts +0 -0
  297. /package/src/{core/python-modules.ts → ipy/modules.ts} +0 -0
  298. /package/src/{core/tools/lsp → lsp}/defaults.json +0 -0
  299. /package/src/{core/tools/lsp → lsp}/edits.ts +0 -0
  300. /package/src/{core/tools/lsp → lsp}/lspmux.ts +0 -0
  301. /package/src/{core/tools/lsp → lsp}/rust-analyzer.ts +0 -0
  302. /package/src/{core/mcp → mcp}/client.ts +0 -0
  303. /package/src/{core/mcp → mcp}/index.ts +0 -0
  304. /package/src/{core/mcp → mcp}/json-rpc.ts +0 -0
  305. /package/src/{core/mcp → mcp}/transports/index.ts +0 -0
  306. /package/src/modes/{interactive/components → components}/countdown-timer.ts +0 -0
  307. /package/src/modes/{interactive/components → components}/custom-editor.ts +0 -0
  308. /package/src/modes/{interactive/components → components}/extensions/index.ts +0 -0
  309. /package/src/modes/{interactive/components → components}/index.ts +0 -0
  310. /package/src/modes/{interactive/components → components}/status-line/index.ts +0 -0
  311. /package/src/modes/{interactive/components → components}/status-line/presets.ts +0 -0
  312. /package/src/modes/{interactive/components → components}/visual-truncate.ts +0 -0
  313. /package/src/modes/{interactive/theme → theme}/dark.json +0 -0
  314. /package/src/modes/{interactive/theme → theme}/defaults/alabaster.json +0 -0
  315. /package/src/modes/{interactive/theme → theme}/defaults/amethyst.json +0 -0
  316. /package/src/modes/{interactive/theme → theme}/defaults/anthracite.json +0 -0
  317. /package/src/modes/{interactive/theme → theme}/defaults/basalt.json +0 -0
  318. /package/src/modes/{interactive/theme → theme}/defaults/birch.json +0 -0
  319. /package/src/modes/{interactive/theme → theme}/defaults/dark-abyss.json +0 -0
  320. /package/src/modes/{interactive/theme → theme}/defaults/dark-arctic.json +0 -0
  321. /package/src/modes/{interactive/theme → theme}/defaults/dark-aurora.json +0 -0
  322. /package/src/modes/{interactive/theme → theme}/defaults/dark-catppuccin.json +0 -0
  323. /package/src/modes/{interactive/theme → theme}/defaults/dark-cavern.json +0 -0
  324. /package/src/modes/{interactive/theme → theme}/defaults/dark-copper.json +0 -0
  325. /package/src/modes/{interactive/theme → theme}/defaults/dark-cosmos.json +0 -0
  326. /package/src/modes/{interactive/theme → theme}/defaults/dark-cyberpunk.json +0 -0
  327. /package/src/modes/{interactive/theme → theme}/defaults/dark-dracula.json +0 -0
  328. /package/src/modes/{interactive/theme → theme}/defaults/dark-eclipse.json +0 -0
  329. /package/src/modes/{interactive/theme → theme}/defaults/dark-ember.json +0 -0
  330. /package/src/modes/{interactive/theme → theme}/defaults/dark-equinox.json +0 -0
  331. /package/src/modes/{interactive/theme → theme}/defaults/dark-forest.json +0 -0
  332. /package/src/modes/{interactive/theme → theme}/defaults/dark-github.json +0 -0
  333. /package/src/modes/{interactive/theme → theme}/defaults/dark-gruvbox.json +0 -0
  334. /package/src/modes/{interactive/theme → theme}/defaults/dark-lavender.json +0 -0
  335. /package/src/modes/{interactive/theme → theme}/defaults/dark-lunar.json +0 -0
  336. /package/src/modes/{interactive/theme → theme}/defaults/dark-midnight.json +0 -0
  337. /package/src/modes/{interactive/theme → theme}/defaults/dark-monochrome.json +0 -0
  338. /package/src/modes/{interactive/theme → theme}/defaults/dark-monokai.json +0 -0
  339. /package/src/modes/{interactive/theme → theme}/defaults/dark-nebula.json +0 -0
  340. /package/src/modes/{interactive/theme → theme}/defaults/dark-nord.json +0 -0
  341. /package/src/modes/{interactive/theme → theme}/defaults/dark-ocean.json +0 -0
  342. /package/src/modes/{interactive/theme → theme}/defaults/dark-one.json +0 -0
  343. /package/src/modes/{interactive/theme → theme}/defaults/dark-rainforest.json +0 -0
  344. /package/src/modes/{interactive/theme → theme}/defaults/dark-reef.json +0 -0
  345. /package/src/modes/{interactive/theme → theme}/defaults/dark-retro.json +0 -0
  346. /package/src/modes/{interactive/theme → theme}/defaults/dark-rose-pine.json +0 -0
  347. /package/src/modes/{interactive/theme → theme}/defaults/dark-sakura.json +0 -0
  348. /package/src/modes/{interactive/theme → theme}/defaults/dark-slate.json +0 -0
  349. /package/src/modes/{interactive/theme → theme}/defaults/dark-solarized.json +0 -0
  350. /package/src/modes/{interactive/theme → theme}/defaults/dark-solstice.json +0 -0
  351. /package/src/modes/{interactive/theme → theme}/defaults/dark-starfall.json +0 -0
  352. /package/src/modes/{interactive/theme → theme}/defaults/dark-sunset.json +0 -0
  353. /package/src/modes/{interactive/theme → theme}/defaults/dark-swamp.json +0 -0
  354. /package/src/modes/{interactive/theme → theme}/defaults/dark-synthwave.json +0 -0
  355. /package/src/modes/{interactive/theme → theme}/defaults/dark-taiga.json +0 -0
  356. /package/src/modes/{interactive/theme → theme}/defaults/dark-terminal.json +0 -0
  357. /package/src/modes/{interactive/theme → theme}/defaults/dark-tokyo-night.json +0 -0
  358. /package/src/modes/{interactive/theme → theme}/defaults/dark-tundra.json +0 -0
  359. /package/src/modes/{interactive/theme → theme}/defaults/dark-twilight.json +0 -0
  360. /package/src/modes/{interactive/theme → theme}/defaults/dark-volcanic.json +0 -0
  361. /package/src/modes/{interactive/theme → theme}/defaults/graphite.json +0 -0
  362. /package/src/modes/{interactive/theme → theme}/defaults/index.ts +0 -0
  363. /package/src/modes/{interactive/theme → theme}/defaults/light-arctic.json +0 -0
  364. /package/src/modes/{interactive/theme → theme}/defaults/light-aurora-day.json +0 -0
  365. /package/src/modes/{interactive/theme → theme}/defaults/light-canyon.json +0 -0
  366. /package/src/modes/{interactive/theme → theme}/defaults/light-catppuccin.json +0 -0
  367. /package/src/modes/{interactive/theme → theme}/defaults/light-cirrus.json +0 -0
  368. /package/src/modes/{interactive/theme → theme}/defaults/light-coral.json +0 -0
  369. /package/src/modes/{interactive/theme → theme}/defaults/light-cyberpunk.json +0 -0
  370. /package/src/modes/{interactive/theme → theme}/defaults/light-dawn.json +0 -0
  371. /package/src/modes/{interactive/theme → theme}/defaults/light-dunes.json +0 -0
  372. /package/src/modes/{interactive/theme → theme}/defaults/light-eucalyptus.json +0 -0
  373. /package/src/modes/{interactive/theme → theme}/defaults/light-forest.json +0 -0
  374. /package/src/modes/{interactive/theme → theme}/defaults/light-frost.json +0 -0
  375. /package/src/modes/{interactive/theme → theme}/defaults/light-github.json +0 -0
  376. /package/src/modes/{interactive/theme → theme}/defaults/light-glacier.json +0 -0
  377. /package/src/modes/{interactive/theme → theme}/defaults/light-gruvbox.json +0 -0
  378. /package/src/modes/{interactive/theme → theme}/defaults/light-haze.json +0 -0
  379. /package/src/modes/{interactive/theme → theme}/defaults/light-honeycomb.json +0 -0
  380. /package/src/modes/{interactive/theme → theme}/defaults/light-lagoon.json +0 -0
  381. /package/src/modes/{interactive/theme → theme}/defaults/light-lavender.json +0 -0
  382. /package/src/modes/{interactive/theme → theme}/defaults/light-meadow.json +0 -0
  383. /package/src/modes/{interactive/theme → theme}/defaults/light-mint.json +0 -0
  384. /package/src/modes/{interactive/theme → theme}/defaults/light-monochrome.json +0 -0
  385. /package/src/modes/{interactive/theme → theme}/defaults/light-ocean.json +0 -0
  386. /package/src/modes/{interactive/theme → theme}/defaults/light-one.json +0 -0
  387. /package/src/modes/{interactive/theme → theme}/defaults/light-opal.json +0 -0
  388. /package/src/modes/{interactive/theme → theme}/defaults/light-orchard.json +0 -0
  389. /package/src/modes/{interactive/theme → theme}/defaults/light-paper.json +0 -0
  390. /package/src/modes/{interactive/theme → theme}/defaults/light-prism.json +0 -0
  391. /package/src/modes/{interactive/theme → theme}/defaults/light-retro.json +0 -0
  392. /package/src/modes/{interactive/theme → theme}/defaults/light-sand.json +0 -0
  393. /package/src/modes/{interactive/theme → theme}/defaults/light-savanna.json +0 -0
  394. /package/src/modes/{interactive/theme → theme}/defaults/light-solarized.json +0 -0
  395. /package/src/modes/{interactive/theme → theme}/defaults/light-soleil.json +0 -0
  396. /package/src/modes/{interactive/theme → theme}/defaults/light-sunset.json +0 -0
  397. /package/src/modes/{interactive/theme → theme}/defaults/light-synthwave.json +0 -0
  398. /package/src/modes/{interactive/theme → theme}/defaults/light-tokyo-night.json +0 -0
  399. /package/src/modes/{interactive/theme → theme}/defaults/light-wetland.json +0 -0
  400. /package/src/modes/{interactive/theme → theme}/defaults/light-zenith.json +0 -0
  401. /package/src/modes/{interactive/theme → theme}/defaults/limestone.json +0 -0
  402. /package/src/modes/{interactive/theme → theme}/defaults/mahogany.json +0 -0
  403. /package/src/modes/{interactive/theme → theme}/defaults/marble.json +0 -0
  404. /package/src/modes/{interactive/theme → theme}/defaults/obsidian.json +0 -0
  405. /package/src/modes/{interactive/theme → theme}/defaults/onyx.json +0 -0
  406. /package/src/modes/{interactive/theme → theme}/defaults/pearl.json +0 -0
  407. /package/src/modes/{interactive/theme → theme}/defaults/porcelain.json +0 -0
  408. /package/src/modes/{interactive/theme → theme}/defaults/quartz.json +0 -0
  409. /package/src/modes/{interactive/theme → theme}/defaults/sandstone.json +0 -0
  410. /package/src/modes/{interactive/theme → theme}/defaults/titanium.json +0 -0
  411. /package/src/modes/{interactive/theme → theme}/light.json +0 -0
  412. /package/src/modes/{interactive/theme → theme}/theme-schema.json +0 -0
  413. /package/src/{core/tools/patch → patch}/fuzzy.ts +0 -0
  414. /package/src/{core/tools/patch → patch}/normalize.ts +0 -0
  415. /package/src/{core/tools/patch → patch}/normative.ts +0 -0
  416. /package/src/{core/tools/patch → patch}/parser.ts +0 -0
  417. /package/src/{core/tools/patch → patch}/types.ts +0 -0
  418. /package/src/{core → session}/compaction/index.ts +0 -0
  419. /package/src/{core → session}/session-storage.ts +0 -0
  420. /package/src/{core/tools/task → task}/name-generator.ts +0 -0
  421. /package/src/{core/tools/task → task}/omp-command.ts +0 -0
  422. /package/src/{core/tools/task → task}/parallel.ts +0 -0
  423. /package/src/{core/tools → tools}/jtd-to-json-schema.ts +0 -0
  424. /package/src/{core/tools → tools}/path-utils.ts +0 -0
  425. /package/src/{core → utils}/event-bus.ts +0 -0
  426. /package/src/{core → utils}/frontmatter.ts +0 -0
  427. /package/src/{core → utils}/terminal-notify.ts +0 -0
  428. /package/src/{core → utils}/timings.ts +0 -0
  429. /package/src/{core → utils}/utils.ts +0 -0
  430. /package/src/{core/tools/web-scrapers → web/scrapers}/artifacthub.ts +0 -0
  431. /package/src/{core/tools/web-scrapers → web/scrapers}/arxiv.ts +0 -0
  432. /package/src/{core/tools/web-scrapers → web/scrapers}/aur.ts +0 -0
  433. /package/src/{core/tools/web-scrapers → web/scrapers}/biorxiv.ts +0 -0
  434. /package/src/{core/tools/web-scrapers → web/scrapers}/bluesky.ts +0 -0
  435. /package/src/{core/tools/web-scrapers → web/scrapers}/brew.ts +0 -0
  436. /package/src/{core/tools/web-scrapers → web/scrapers}/cheatsh.ts +0 -0
  437. /package/src/{core/tools/web-scrapers → web/scrapers}/chocolatey.ts +0 -0
  438. /package/src/{core/tools/web-scrapers → web/scrapers}/cisa-kev.ts +0 -0
  439. /package/src/{core/tools/web-scrapers → web/scrapers}/clojars.ts +0 -0
  440. /package/src/{core/tools/web-scrapers → web/scrapers}/coingecko.ts +0 -0
  441. /package/src/{core/tools/web-scrapers → web/scrapers}/crates-io.ts +0 -0
  442. /package/src/{core/tools/web-scrapers → web/scrapers}/crossref.ts +0 -0
  443. /package/src/{core/tools/web-scrapers → web/scrapers}/devto.ts +0 -0
  444. /package/src/{core/tools/web-scrapers → web/scrapers}/discogs.ts +0 -0
  445. /package/src/{core/tools/web-scrapers → web/scrapers}/discourse.ts +0 -0
  446. /package/src/{core/tools/web-scrapers → web/scrapers}/dockerhub.ts +0 -0
  447. /package/src/{core/tools/web-scrapers → web/scrapers}/fdroid.ts +0 -0
  448. /package/src/{core/tools/web-scrapers → web/scrapers}/firefox-addons.ts +0 -0
  449. /package/src/{core/tools/web-scrapers → web/scrapers}/flathub.ts +0 -0
  450. /package/src/{core/tools/web-scrapers → web/scrapers}/github-gist.ts +0 -0
  451. /package/src/{core/tools/web-scrapers → web/scrapers}/github.ts +0 -0
  452. /package/src/{core/tools/web-scrapers → web/scrapers}/gitlab.ts +0 -0
  453. /package/src/{core/tools/web-scrapers → web/scrapers}/go-pkg.ts +0 -0
  454. /package/src/{core/tools/web-scrapers → web/scrapers}/hackage.ts +0 -0
  455. /package/src/{core/tools/web-scrapers → web/scrapers}/hackernews.ts +0 -0
  456. /package/src/{core/tools/web-scrapers → web/scrapers}/hex.ts +0 -0
  457. /package/src/{core/tools/web-scrapers → web/scrapers}/huggingface.ts +0 -0
  458. /package/src/{core/tools/web-scrapers → web/scrapers}/iacr.ts +0 -0
  459. /package/src/{core/tools/web-scrapers → web/scrapers}/index.ts +0 -0
  460. /package/src/{core/tools/web-scrapers → web/scrapers}/jetbrains-marketplace.ts +0 -0
  461. /package/src/{core/tools/web-scrapers → web/scrapers}/lemmy.ts +0 -0
  462. /package/src/{core/tools/web-scrapers → web/scrapers}/lobsters.ts +0 -0
  463. /package/src/{core/tools/web-scrapers → web/scrapers}/mastodon.ts +0 -0
  464. /package/src/{core/tools/web-scrapers → web/scrapers}/maven.ts +0 -0
  465. /package/src/{core/tools/web-scrapers → web/scrapers}/mdn.ts +0 -0
  466. /package/src/{core/tools/web-scrapers → web/scrapers}/metacpan.ts +0 -0
  467. /package/src/{core/tools/web-scrapers → web/scrapers}/musicbrainz.ts +0 -0
  468. /package/src/{core/tools/web-scrapers → web/scrapers}/npm.ts +0 -0
  469. /package/src/{core/tools/web-scrapers → web/scrapers}/nuget.ts +0 -0
  470. /package/src/{core/tools/web-scrapers → web/scrapers}/nvd.ts +0 -0
  471. /package/src/{core/tools/web-scrapers → web/scrapers}/ollama.ts +0 -0
  472. /package/src/{core/tools/web-scrapers → web/scrapers}/open-vsx.ts +0 -0
  473. /package/src/{core/tools/web-scrapers → web/scrapers}/opencorporates.ts +0 -0
  474. /package/src/{core/tools/web-scrapers → web/scrapers}/openlibrary.ts +0 -0
  475. /package/src/{core/tools/web-scrapers → web/scrapers}/orcid.ts +0 -0
  476. /package/src/{core/tools/web-scrapers → web/scrapers}/osv.ts +0 -0
  477. /package/src/{core/tools/web-scrapers → web/scrapers}/packagist.ts +0 -0
  478. /package/src/{core/tools/web-scrapers → web/scrapers}/pub-dev.ts +0 -0
  479. /package/src/{core/tools/web-scrapers → web/scrapers}/pubmed.ts +0 -0
  480. /package/src/{core/tools/web-scrapers → web/scrapers}/pypi.ts +0 -0
  481. /package/src/{core/tools/web-scrapers → web/scrapers}/rawg.ts +0 -0
  482. /package/src/{core/tools/web-scrapers → web/scrapers}/readthedocs.ts +0 -0
  483. /package/src/{core/tools/web-scrapers → web/scrapers}/reddit.ts +0 -0
  484. /package/src/{core/tools/web-scrapers → web/scrapers}/repology.ts +0 -0
  485. /package/src/{core/tools/web-scrapers → web/scrapers}/rfc.ts +0 -0
  486. /package/src/{core/tools/web-scrapers → web/scrapers}/rubygems.ts +0 -0
  487. /package/src/{core/tools/web-scrapers → web/scrapers}/searchcode.ts +0 -0
  488. /package/src/{core/tools/web-scrapers → web/scrapers}/sec-edgar.ts +0 -0
  489. /package/src/{core/tools/web-scrapers → web/scrapers}/semantic-scholar.ts +0 -0
  490. /package/src/{core/tools/web-scrapers → web/scrapers}/snapcraft.ts +0 -0
  491. /package/src/{core/tools/web-scrapers → web/scrapers}/sourcegraph.ts +0 -0
  492. /package/src/{core/tools/web-scrapers → web/scrapers}/spdx.ts +0 -0
  493. /package/src/{core/tools/web-scrapers → web/scrapers}/spotify.ts +0 -0
  494. /package/src/{core/tools/web-scrapers → web/scrapers}/stackoverflow.ts +0 -0
  495. /package/src/{core/tools/web-scrapers → web/scrapers}/terraform.ts +0 -0
  496. /package/src/{core/tools/web-scrapers → web/scrapers}/tldr.ts +0 -0
  497. /package/src/{core/tools/web-scrapers → web/scrapers}/vimeo.ts +0 -0
  498. /package/src/{core/tools/web-scrapers → web/scrapers}/vscode-marketplace.ts +0 -0
  499. /package/src/{core/tools/web-scrapers → web/scrapers}/w3c.ts +0 -0
  500. /package/src/{core/tools/web-scrapers → web/scrapers}/wikidata.ts +0 -0
  501. /package/src/{core/tools/web-scrapers → web/scrapers}/wikipedia.ts +0 -0
  502. /package/src/{core/tools/web-search → web/search}/types.ts +0 -0
@@ -1,63 +1,65 @@
1
- Launch a new agent to handle complex, multi-step tasks autonomously.
1
+ # Task
2
2
 
3
- The Task tool launches specialized agents (workers) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it.
3
+ Launch a new agent to handle complex, multi-step tasks autonomously. Each agent type has specific capabilities and tools available to it.
4
4
 
5
- **CRITICAL: Subagents have NO access to conversation history.** They only see:
6
- 1. Their agent-specific system prompt
7
- 2. The `context` string you provide
8
- 3. The `task` string you provide
9
-
10
- If you discussed requirements, plans, schemas, or decisions with the user, you MUST include that information in `context`. Subagents cannot see prior messages - they start fresh with only what you explicitly pass them.
11
-
12
- ## Available Agents
13
-
14
- {{#list agents prefix="- " join="\n"}}
15
- {{name}}: {{description}} (Tools: {{default (join tools ", ") "All tools"}}{{#if output}}, Output: structured{{/if}})
5
+ <agents>
6
+ {{#list agents join="\n"}}
7
+ <agent name="{{name}}"{{#if output}} output="structured"{{/if}}>
8
+ <description>{{description}}</description>
9
+ <tools>{{default (join tools ", ") "All tools"}}</tools>
10
+ </agent>
16
11
  {{/list}}
17
- {{#if moreAgents}}
18
- ...and {{moreAgents}} more agents
19
- {{/if}}
20
-
21
- Agents with "Output: structured" have a fixed schema enforced via frontmatter; your `output` parameter will be ignored for these agents.
22
-
23
- ## When NOT to Use
24
-
25
- - Reading a specific file path → Use Read tool instead
26
- - Finding files by pattern/name → Use Find tool instead
27
- - Searching for a specific class/function definition → Use Grep tool instead
28
- - Searching code within 2-3 specific files → Use Read tool instead
29
- - Tasks unrelated to the agent descriptions above
30
12
 
31
- ## Usage Notes
13
+ Agents with `output="structured"` have a fixed schema enforced via frontmatter; your `output` parameter will be ignored for these agents.
14
+ </agents>
32
15
 
16
+ <instruction>
33
17
  - Always include a short description of the task in the task parameter
34
18
  - **Plan-then-execute**: Put shared constraints in `context`, keep each task focused, specify acceptance criteria; use `output` when you need structured output
35
19
  - **Ask open-ended questions**: For exploration tasks, frame prompts to elicit factual discovery, not confirmation. Avoid yes/no questions that are easy to hallucinate.
36
- - Bad: "Is there rate limiting?" or "Does the API validate tokens?" → Binary answers invite hallucination
37
- - Good: "Find and describe how rate limiting is implemented" or "How does the API handle token validation?" → Forces investigation and factual reporting
20
+ - Bad: "Is there rate limiting?" or "Does the API validate tokens?" → Binary answers invite hallucination
21
+ - Good: "Find and describe how rate limiting is implemented" or "How does the API handle token validation?" → Forces investigation and factual reporting
38
22
  - The subagent should report *what exists*, then YOU verify if it meets requirements
39
- - **Minimize tool chatter**: Avoid repeating large context; use Output tool with output ids for full logs
23
+ - **Minimize tool chatter**: Avoid repeating large context; use `read agent://<id>` for full logs
40
24
  - **Structured completion**: If `output` is provided, subagents must call `complete` to finish
41
25
  - **Parallelize**: Launch multiple agents whenever possible. You MUST use a single Task call with multiple entries in the `tasks` array to do this.
42
26
  - **Isolate file scopes**: Assign each task distinct files or directories so agents don't conflict
43
27
  - **Results are intermediate data**: Agent findings provide context for YOU to perform actual work. Do not treat agent reports as "task complete" signals.
44
- - **Stateless invocations**: Subagents have zero memory of your conversation. Pass ALL relevant context: requirements discussed, decisions made, schemas agreed upon, file paths mentioned. If you reference something from earlier discussion without including it, the subagent will fail.
45
28
  - **Trust outputs**: Agent results should generally be trusted
46
29
  - **Clarify intent**: Tell the agent whether you expect code changes or just research (search, file reads, web fetches)
47
30
  - **Proactive use**: If an agent description says to use it proactively, do so without waiting for explicit user request
31
+ </instruction>
48
32
 
49
- ## Parameters
50
-
33
+ <parameters>
51
34
  - `agent`: Agent type to use for all tasks
52
- - `context`: Template with `{{placeholders}}` for multi-task. Each placeholder is filled from task vars.
53
- - `model`: (optional) Model override for all tasks (fuzzy matching, e.g., "sonnet", "opus")
54
- - `tasks`: Array of `{id, description, vars}` - tasks to run in parallel (max {{MAX_PARALLEL_TASKS}}, {{MAX_CONCURRENCY}} concurrent)
55
- - `id`: Short CamelCase identifier for display (max 20 chars, e.g., "SessionStore", "LspRefactor")
56
- - `description`: Short human-readable description of what the task does
57
- - `vars`: Object with keys matching `{{placeholders}}` in context
35
+ - `context`: Template with `\{{placeholders}}` for multi-task. Each placeholder is filled from task args. `\{{id}}` and `\{{description}}` are always available.
36
+ - `isolated`: (optional) Run each task in its own git worktree and return patches; patches are applied only if all apply cleanly.
37
+ - `tasks`: Array of `{id, description, args}` - tasks to run in parallel
38
+ - `id`: Short CamelCase identifier (max 32 chars, e.g., "SessionStore", "LspRefactor")
39
+ - `description`: Short human-readable description of what the task does
40
+ - `args`: Object with keys matching `\{{placeholders}}` in context (always include this, even if empty)
58
41
  - `output`: (optional) JTD schema for structured subagent output (used by the complete tool)
42
+ </parameters>
43
+
44
+ <output>
45
+ Returns task results for each spawned agent:
46
+ - Truncated preview of agent output (use `read agent://<id>` for full content if truncated)
47
+ - Summary with line/character counts
48
+ - For agents with `output` schema: structured JSON accessible via `agent://<id>?q=<query>` or `agent://<id>/<path>`
49
+
50
+ Results are keyed by task `id` (e.g., "AuthProvider", "AuthApi").
51
+ </output>
52
+
53
+ <critical>
54
+ **Subagents have NO access to conversation history.** They only see:
55
+ 1. Their agent-specific system prompt
56
+ 2. The `context` string you provide
57
+ 3. The `task` string you provide
59
58
 
60
- ## Example
59
+ If you discussed requirements, plans, schemas, or decisions with the user, you MUST include that information in `context`. Subagents cannot see prior messages—they start fresh with only what you explicitly pass them.
60
+
61
+ **Never call Task multiple times in parallel.** Use a single Task call with multiple entries in the `tasks` array. Parallel Task calls waste resources and bypass coordination.
62
+ </critical>
61
63
 
62
64
  <example>
63
65
  user: "Looks good, execute the plan"
@@ -65,7 +67,7 @@ assistant: I'll execute the refactoring plan.
65
67
  assistant: Uses the Task tool:
66
68
  {
67
69
  "agent": "task",
68
- "context": "Refactoring the auth module into separate concerns.\n\nPlan:\n1. AuthProvider - Extract React context and provider from src/auth/index.tsx\n2. AuthApi - Extract API calls to src/auth/api.ts, use existing fetchJson helper\n3. AuthTypes - Move types to types.ts, re-export from index\n\nConstraints:\n- Preserve all existing exports from src/auth/index.tsx\n- Use project's fetchJson (src/utils/http.ts), don't use raw fetch\n- No new dependencies\n\nTask: {{step}}\n\nFiles: {{files}}",
70
+ "context": "Refactoring the auth module into separate concerns.\n\nPlan:\n1. AuthProvider - Extract React context and provider from src/auth/index.tsx\n2. AuthApi - Extract API calls to src/auth/api.ts, use existing fetchJson helper\n3. AuthTypes - Move types to types.ts, re-export from index\n\nConstraints:\n- Preserve all existing exports from src/auth/index.tsx\n- Use project's fetchJson (src/utils/http.ts), don't use raw fetch\n- No new dependencies\n\nTask: \{{step}}\n\nFiles: \{{files}}",
69
71
  "output": {
70
72
  "properties": {
71
73
  "summary": { "type": "string" },
@@ -74,9 +76,17 @@ assistant: Uses the Task tool:
74
76
  }
75
77
  },
76
78
  "tasks": [
77
- { "id": "AuthProvider", "description": "Extract React context", "vars": { "step": "Execute step 1: Extract AuthProvider and AuthContext", "files": "src/auth/index.tsx" } },
78
- { "id": "AuthApi", "description": "Extract API layer", "vars": { "step": "Execute step 2: Extract API calls to api.ts", "files": "src/auth/api.ts" } },
79
- { "id": "AuthTypes", "description": "Extract types", "vars": { "step": "Execute step 3: Move types to types.ts", "files": "src/auth/types.ts" } }
79
+ { "id": "AuthProvider", "description": "Extract React context", "args": { "step": "Execute step 1: Extract AuthProvider and AuthContext", "files": "src/auth/index.tsx" } },
80
+ { "id": "AuthApi", "description": "Extract API layer", "args": { "step": "Execute step 2: Extract API calls to api.ts", "files": "src/auth/api.ts" } },
81
+ { "id": "AuthTypes", "description": "Extract types", "args": { "step": "Execute step 3: Move types to types.ts", "files": "src/auth/types.ts" } }
80
82
  ]
81
83
  }
82
84
  </example>
85
+
86
+ <avoid>
87
+ - Reading a specific file path → Use Read tool instead
88
+ - Finding files by pattern/name → Use Find tool instead
89
+ - Searching for a specific class/function definition → Use Grep tool instead
90
+ - Searching code within 2-3 specific files → Use Read tool instead
91
+ - Tasks unrelated to the agent descriptions above
92
+ </avoid>
@@ -1,10 +1,9 @@
1
- Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
2
- It also helps the user understand the progress of the task and overall progress of their requests.
1
+ # Todo Write
3
2
 
4
- ## When to Use This Tool
3
+ Create and manage a structured task list for your current coding session.
5
4
 
5
+ <conditions>
6
6
  Use this tool proactively in these scenarios:
7
-
8
7
  1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions
9
8
  2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations
10
9
  3. User explicitly requests todo list - When the user directly asks you to use the todo list
@@ -12,176 +11,66 @@ Use this tool proactively in these scenarios:
12
11
  5. After receiving new instructions - Immediately capture user requirements as todos
13
12
  6. When you start working on a task - Mark it as in_progress BEFORE beginning work. Ideally you should only have one todo as in_progress at a time
14
13
  7. After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation
14
+ </conditions>
15
15
 
16
- ## When NOT to Use This Tool
17
-
18
- Skip using this tool when:
19
-
20
- 1. There is only a single, straightforward task
21
- 2. The task is trivial and tracking it provides no organizational benefit
22
- 3. The task can be completed in less than 3 trivial steps
23
- 4. The task is purely conversational or informational
24
-
25
- NOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.
26
-
27
- ## Examples of When to Use the Todo List
28
-
29
- <example>
30
- User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!
31
- Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.
32
- *Creates todo list with the following items:*
33
- 1. Creating dark mode toggle component in Settings page
34
- 2. Adding dark mode state management (context/store)
35
- 3. Implementing CSS-in-JS styles for dark theme
36
- 4. Updating existing components to support theme switching
37
- 5. Running tests and build process, addressing any failures or errors that occur
38
- *Begins working on the first task*
39
-
40
- <reasoning>
41
- The assistant used the todo list because:
42
- 1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes
43
- 2. The user explicitly requested tests and build be run afterward
44
- 3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task
45
- </reasoning>
46
- </example>
47
-
48
- <example>
49
- User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project
50
- Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.
51
- *Uses grep or search tools to locate all instances of getCwd in the codebase*
52
- Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.
53
- *Creates todo list with specific items for each file that needs updating*
54
-
55
- <reasoning>
56
- The assistant used the todo list because:
57
- 1. First, the assistant searched to understand the scope of the task
58
- 2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps
59
- 3. The todo list helps ensure every instance is tracked and updated systematically
60
- 4. This approach prevents missing any occurrences and maintains code consistency
61
- </reasoning>
62
- </example>
63
-
64
- <example>
65
- User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.
66
- Assistant: I'll help implement these features. First, let's add all the features to the todo list.
67
- *Creates a todo list breaking down each feature into specific tasks based on the project architecture*
68
- Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.
69
-
70
- <reasoning>
71
- The assistant used the todo list because:
72
- 1. The user provided multiple complex features to implement in a comma separated list
73
- 2. The todo list helps organize these large features into manageable tasks
74
- 3. This approach allows for tracking progress across the entire implementation
75
- </reasoning>
76
- </example>
77
-
78
- <example>
79
- User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>
80
- Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.
81
- *Reviews component structure, render patterns, state management, and data fetching*
82
- Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.
83
- *Creates todo list with items like: 1) Implementing memoization for expensive calculations in ProductList, 2) Adding virtualization for long lists in Dashboard, 3) Optimizing image loading in Gallery component, 4) Fixing state update loops in ShoppingCart, 5) Reviewing bundle size and implementing code splitting*
84
- Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>
85
-
86
- <reasoning>
87
- The assistant used the todo list because:
88
- 1. First, the assistant examined the codebase to identify specific performance issues
89
- 2. Based on this analysis, it identified multiple optimization opportunities
90
- 3. Performance optimization is a non-trivial task requiring multiple steps
91
- 4. The todo list helps methodically track improvements across different components
92
- 5. This systematic approach ensures all performance bottlenecks are addressed
93
- </reasoning>
94
- </example>
16
+ <protocol>
17
+ 1. **Task States**: Use these states to track progress:
18
+ - pending: Task not yet started
19
+ - in_progress: Currently working on (limit to ONE task at a time)
20
+ - completed: Task finished successfully
95
21
 
96
- ## Examples of When NOT to Use the Todo List
22
+ 2. **Task Management**:
23
+ - Update task status in real-time as you work
24
+ - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)
25
+ - Exactly ONE task must be in_progress at any time (not less, not more)
26
+ - Complete current tasks before starting new ones
27
+ - Remove tasks that are no longer relevant from the list entirely
97
28
 
98
- <example>
99
- User: How do I print 'Hello World' in Python?
100
- Assistant: In Python, you can print "Hello World" with this simple code:
29
+ 3. **Task Completion Requirements**:
30
+ - ONLY mark a task as completed when you have FULLY accomplished it
31
+ - If you encounter errors, blockers, or cannot finish, keep the task as in_progress
32
+ - When blocked, create a new task describing what needs to be resolved
33
+ - Never mark a task as completed if:
34
+ - Tests are failing
35
+ - Implementation is partial
36
+ - You encountered unresolved errors
37
+ - You couldn't find necessary files or dependencies
101
38
 
102
- python
103
- print("Hello World")
39
+ 4. **Task Breakdown**:
40
+ - Create specific, actionable items
41
+ - Break complex tasks into smaller, manageable steps
42
+ - Use clear, descriptive task names
43
+ </protocol>
104
44
 
105
- This will output the text "Hello World" to the console when executed.</assistant>
45
+ <output>
46
+ Returns confirmation that the todo list has been updated. The updated list is displayed to the user in the UI, showing each task's status (pending, in_progress, completed) and description.
47
+ </output>
106
48
 
107
- <reasoning>
108
- The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.
109
- </reasoning>
110
- </example>
111
-
112
- <example>
113
- User: What does the git status command do?
114
- Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.
49
+ <important>
50
+ When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.
51
+ </important>
115
52
 
116
- <reasoning>
117
- The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.
118
- </reasoning>
53
+ <example name="use-dark-mode">
54
+ User: Add dark mode toggle to settings. Run tests when done.
55
+ → Creates todos: toggle component, state management, theme styles, update components, run tests
119
56
  </example>
120
57
 
121
- <example>
122
- User: Can you add a comment to the calculateTotal function to explain what it does?
123
- Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.
124
- * Uses the ${EDIT_TOOL_NAME} tool to add a comment to the calculateTotal function *
125
-
126
- <reasoning>
127
- The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.
128
- </reasoning>
58
+ <example name="use-features">
59
+ User: Implement user registration, product catalog, shopping cart, checkout.
60
+ Creates todos for each feature, broken into subtasks
129
61
  </example>
130
62
 
131
- <example>
132
- User: Run npm install for me and tell me what happens.
133
- Assistant: I'll run the npm install command for you.
134
-
135
- _Executes: npm install_
136
-
137
- The command completed successfully. Here's the output:
138
- [Output of npm install command]
139
-
140
- All dependencies have been installed according to your package.json file.
141
-
142
- <reasoning>
143
- The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.
144
- </reasoning>
63
+ <example name="skip">
64
+ User: Run npm install / Add a comment to this function / What does git status do?
65
+ Just do it directly. Single-step or informational tasks don't need tracking.
145
66
  </example>
146
67
 
147
- ## Task States and Management
148
-
149
- 1. **Task States**: Use these states to track progress:
150
-
151
- - pending: Task not yet started
152
- - in_progress: Currently working on (limit to ONE task at a time)
153
- - completed: Task finished successfully
154
-
155
- **IMPORTANT**: Task descriptions must have two forms:
156
-
157
- - content: The imperative form describing what needs to be done (e.g., "Run tests", "Build the project")
158
- - activeForm: The present continuous form shown during execution (e.g., "Running tests", "Building the project")
159
-
160
- 2. **Task Management**:
161
-
162
- - Update task status in real-time as you work
163
- - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)
164
- - Exactly ONE task must be in_progress at any time (not less, not more)
165
- - Complete current tasks before starting new ones
166
- - Remove tasks that are no longer relevant from the list entirely
167
-
168
- 3. **Task Completion Requirements**:
169
-
170
- - ONLY mark a task as completed when you have FULLY accomplished it
171
- - If you encounter errors, blockers, or cannot finish, keep the task as in_progress
172
- - When blocked, create a new task describing what needs to be resolved
173
- - Never mark a task as completed if:
174
- - Tests are failing
175
- - Implementation is partial
176
- - You encountered unresolved errors
177
- - You couldn't find necessary files or dependencies
178
-
179
- 4. **Task Breakdown**:
180
- - Create specific, actionable items
181
- - Break complex tasks into smaller, manageable steps
182
- - Use clear, descriptive task names
183
- - Always provide both forms:
184
- - content: "Fix authentication bug"
185
- - activeForm: "Fixing authentication bug"
68
+ <avoid>
69
+ Skip using this tool when:
70
+ 1. There is only a single, straightforward task
71
+ 2. The task is trivial and tracking it provides no organizational benefit
72
+ 3. The task can be completed in less than 3 trivial steps
73
+ 4. The task is purely conversational or informational
186
74
 
187
- When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.
75
+ If there is only one trivial task to do, just do it directly.
76
+ </avoid>
@@ -1,12 +1,19 @@
1
- Allows OMP to search the web and use the results to inform responses
2
- - Provides up-to-date information for current events and recent data
3
- - Returns search result information formatted as search result blocks, including links as markdown hyperlinks
4
- - Use this tool for accessing information beyond Claude's knowledge cutoff
5
- - Searches are performed automatically within a single API call
1
+ # Web Search
2
+
3
+ Search the web for up-to-date information beyond Claude's knowledge cutoff.
4
+
5
+ <instruction>
6
6
  - Prefer primary sources (papers, official docs) and corroborate key claims with multiple sources
7
7
  - Include links for cited sources in the final response
8
+ </instruction>
9
+
10
+ <output>
11
+ Returns search results formatted as blocks with:
12
+ - Result summaries and relevant excerpts
13
+ - Links as markdown hyperlinks for citation
14
+ - Provider-dependent structure based on selected backend
15
+ </output>
8
16
 
9
- Common: system_prompt (guides response style)
10
- Anthropic-specific: max_tokens
11
- Perplexity-specific: model (sonar/sonar-pro), search_recency_filter, search_domain_filter, search_context_size, return_related_questions
12
- Exa-specific: num_results
17
+ <important>
18
+ Searches are performed automatically within a single API call—no pagination or follow-up requests needed.
19
+ </important>
@@ -1,10 +1,21 @@
1
+ # Write
2
+
1
3
  Creates or overwrites a file at the specified path.
2
4
 
3
- When to use:
5
+ <conditions>
4
6
  - Creating new files explicitly required by the task
5
7
  - Replacing entire file contents when editing would be more complex
8
+ </conditions>
9
+
10
+ <output>
11
+ Confirmation of file creation/write with path. When LSP is available, content may be auto-formatted before writing and diagnostics are returned. Returns error if write fails (permissions, invalid path, disk full).
12
+ </output>
6
13
 
7
- Critical requirements:
14
+ <critical>
8
15
  - Prefer Edit tool for modifying existing files (more precise, preserves formatting)
9
16
  - Create documentation files (*.md, README) only when explicitly requested
17
+ </critical>
18
+
19
+ <important>
10
20
  - Include emojis only when explicitly requested
21
+ </important>
@@ -33,20 +33,25 @@ import type { Component } from "@oh-my-pi/pi-tui";
33
33
  // Import discovery to register all providers on startup
34
34
  import { logger, postmortem } from "@oh-my-pi/pi-utils";
35
35
  import chalk from "chalk";
36
- import { loadCapability } from "../capability/index";
37
- import { type Rule, ruleCapability } from "../capability/rule";
38
- import { getAgentDir, getConfigDirPaths } from "../config";
39
- import "../discovery";
40
- import { initializeWithSettings } from "../discovery";
41
- import { AgentSession } from "./agent-session";
42
- import { AuthStorage } from "./auth-storage";
43
- import { CursorExecHandlers } from "./cursor/exec-bridge";
36
+ import { loadCapability } from "$c/capability/index";
37
+ import { type Rule, ruleCapability } from "$c/capability/rule";
38
+ import { getAgentDir, getConfigDirPaths } from "$c/config";
39
+ import "./discovery";
40
+ import { CursorExecHandlers } from "$c/cursor";
41
+ import { initializeWithSettings } from "$c/discovery";
42
+ import { TtsrManager } from "$c/export/ttsr";
43
+ import { disposeAllKernelSessions } from "$c/ipy/executor";
44
+ import { closeAllConnections } from "$c/ssh/connection-manager";
45
+ import { unmountAll } from "$c/ssh/sshfs-mount";
46
+ import { ModelRegistry } from "./config/model-registry";
47
+ import { formatModelString, parseModelString } from "./config/model-resolver";
48
+ import { loadPromptTemplates as loadPromptTemplatesInternal, type PromptTemplate } from "./config/prompt-templates";
49
+ import { type Settings, SettingsManager, type SkillsSettings } from "./config/settings-manager";
44
50
  import {
45
51
  type CustomCommandsLoadResult,
46
52
  loadCustomCommands as loadCustomCommandsInternal,
47
- } from "./custom-commands/index";
48
- import type { CustomTool, CustomToolContext, CustomToolSessionEvent } from "./custom-tools/types";
49
- import { EventBus } from "./event-bus";
53
+ } from "./extensibility/custom-commands/index";
54
+ import type { CustomTool, CustomToolContext, CustomToolSessionEvent } from "./extensibility/custom-tools/types";
50
55
  import {
51
56
  discoverAndLoadExtensions,
52
57
  type ExtensionContext,
@@ -59,25 +64,26 @@ import {
59
64
  loadExtensions,
60
65
  type ToolDefinition,
61
66
  wrapRegisteredTools,
62
- } from "./extensions/index";
67
+ } from "./extensibility/extensions/index";
68
+ import { loadSkills as loadSkillsInternal, type Skill, type SkillWarning } from "./extensibility/skills";
69
+ import { type FileSlashCommand, loadSlashCommands as loadSlashCommandsInternal } from "./extensibility/slash-commands";
70
+ import {
71
+ AgentProtocolHandler,
72
+ ArtifactProtocolHandler,
73
+ InternalUrlRouter,
74
+ RuleProtocolHandler,
75
+ SkillProtocolHandler,
76
+ } from "./internal-urls";
63
77
  import { discoverAndLoadMCPTools, type MCPManager, type MCPToolsLoadResult } from "./mcp/index";
64
- import { convertToLlm } from "./messages";
65
- import { ModelRegistry } from "./model-registry";
66
- import { formatModelString, parseModelString } from "./model-resolver";
67
- import { loadPromptTemplates as loadPromptTemplatesInternal, type PromptTemplate } from "./prompt-templates";
68
- import { disposeAllKernelSessions } from "./python-executor";
69
- import { SessionManager } from "./session-manager";
70
- import { type Settings, SettingsManager, type SkillsSettings } from "./settings-manager";
71
- import { loadSkills as loadSkillsInternal, type Skill, type SkillWarning } from "./skills";
72
- import { type FileSlashCommand, loadSlashCommands as loadSlashCommandsInternal } from "./slash-commands";
73
- import { closeAllConnections } from "./ssh/connection-manager";
74
- import { unmountAll } from "./ssh/sshfs-mount";
75
- import { migrateJsonStorage } from "./storage-migration";
78
+ import { AgentSession } from "./session/agent-session";
79
+ import { AuthStorage } from "./session/auth-storage";
80
+ import { convertToLlm } from "./session/messages";
81
+ import { SessionManager } from "./session/session-manager";
82
+ import { migrateJsonStorage } from "./session/storage-migration";
76
83
  import {
77
84
  buildSystemPrompt as buildSystemPromptInternal,
78
85
  loadProjectContextFiles as loadContextFilesInternal,
79
86
  } from "./system-prompt";
80
- import { time } from "./timings";
81
87
  import { ToolContextStore } from "./tools/context";
82
88
  import { getGeminiImageTools } from "./tools/gemini-image";
83
89
  import {
@@ -99,7 +105,9 @@ import {
99
105
  WriteTool,
100
106
  warmupLspServers,
101
107
  } from "./tools/index";
102
- import { TtsrManager } from "./ttsr";
108
+ import { wrapToolsWithMetaNotice } from "./tools/output-meta";
109
+ import { EventBus } from "./utils/event-bus";
110
+ import { time } from "./utils/timings";
103
111
 
104
112
  // Types
105
113
  export interface CreateAgentSessionOptions {
@@ -193,20 +201,20 @@ export interface CreateAgentSessionResult {
193
201
 
194
202
  // Re-exports
195
203
 
196
- export type { CustomCommand, CustomCommandFactory } from "./custom-commands/types";
197
- export type { CustomTool, CustomToolFactory } from "./custom-tools/types";
204
+ export type { PromptTemplate } from "$c/config/prompt-templates";
205
+ export type { Settings, SkillsSettings } from "$c/config/settings-manager";
206
+ export type { CustomCommand, CustomCommandFactory } from "$c/extensibility/custom-commands/types";
207
+ export type { CustomTool, CustomToolFactory } from "$c/extensibility/custom-tools/types";
198
208
  export type {
199
209
  ExtensionAPI,
200
210
  ExtensionCommandContext,
201
211
  ExtensionContext,
202
212
  ExtensionFactory,
203
213
  ToolDefinition,
204
- } from "./extensions/index";
214
+ } from "$c/extensibility/extensions/index";
215
+ export type { Skill } from "$c/extensibility/skills";
216
+ export type { FileSlashCommand } from "$c/extensibility/slash-commands";
205
217
  export type { MCPManager, MCPServerConfig, MCPServerConnection, MCPToolsLoadResult } from "./mcp/index";
206
- export type { PromptTemplate } from "./prompt-templates";
207
- export type { Settings, SkillsSettings } from "./settings-manager";
208
- export type { Skill } from "./skills";
209
- export type { FileSlashCommand } from "./slash-commands";
210
218
  export type { Tool } from "./tools/index";
211
219
 
212
220
  export {
@@ -703,7 +711,30 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
703
711
  modelRegistry,
704
712
  };
705
713
 
706
- const builtinTools = await createTools(toolSession, options.toolNames);
714
+ // Initialize internal URL router for agent:// and skill:// URLs
715
+ const internalRouter = new InternalUrlRouter();
716
+ const getArtifactsDir = () => {
717
+ const sessionFile = sessionManager.getSessionFile();
718
+ return sessionFile ? sessionFile.slice(0, -6) : null; // strip .jsonl
719
+ };
720
+ internalRouter.register(new AgentProtocolHandler({ getArtifactsDir }));
721
+ internalRouter.register(new ArtifactProtocolHandler({ getArtifactsDir }));
722
+ internalRouter.register(
723
+ new SkillProtocolHandler({
724
+ getSkills: () => skills,
725
+ }),
726
+ );
727
+ internalRouter.register(
728
+ new RuleProtocolHandler({
729
+ getRules: () => rulebookRules,
730
+ }),
731
+ );
732
+ toolSession.internalRouter = internalRouter;
733
+ toolSession.getArtifactsDir = getArtifactsDir;
734
+
735
+ // Create and wrap tools with meta notice formatting
736
+ const rawBuiltinTools = await createTools(toolSession, options.toolNames);
737
+ const builtinTools = wrapToolsWithMetaNotice(rawBuiltinTools);
707
738
  time("createAllTools");
708
739
 
709
740
  // Discover MCP tools from .mcp.json files