@diffra-ai/cli 0.1.0 → 0.1.2

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 (457) hide show
  1. package/CHANGELOG.md +47 -7
  2. package/dist/bundle/chunks/{anthropic-messages-RDYSW7WM.js → anthropic-messages-HME6WDIM.js} +1 -1
  3. package/dist/bundle/chunks/{azure-openai-responses-HB77OIU4.js → azure-openai-responses-WKSFBZF5.js} +1 -1
  4. package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
  5. package/dist/bundle/chunks/{chunk-QRII7KJY.js → chunk-3MKQN3ZR.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-VJQ6ZYW4.js → chunk-4NMBWIZG.js} +5 -5
  7. package/dist/bundle/chunks/{chunk-INTHKDF2.js → chunk-65DC2T66.js} +1 -1
  8. package/dist/bundle/chunks/{chunk-762GZFUO.js → chunk-6L2FT6AE.js} +1 -1
  9. package/dist/bundle/chunks/chunk-6ZD23B2R.js +2 -0
  10. package/dist/bundle/chunks/{chunk-ZVEA4XD4.js → chunk-E3MJ4MPN.js} +1 -1
  11. package/dist/bundle/chunks/chunk-GRDBYTYT.js +2003 -0
  12. package/dist/bundle/chunks/{chunk-RJRIMI6M.js → chunk-GRYHVZSI.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-Z72M6UD7.js → chunk-MITPYV3F.js} +1 -1
  14. package/dist/bundle/chunks/{chunk-JJOJ6QJX.js → chunk-MJRIJM22.js} +1 -1
  15. package/dist/bundle/chunks/{chunk-B4DODQSC.js → chunk-PQGGR7SQ.js} +1 -1
  16. package/dist/bundle/chunks/{chunk-Z36XYVPO.js → chunk-PXE534VH.js} +2 -2
  17. package/dist/bundle/chunks/{chunk-OYSUJGUM.js → chunk-QMZGTPRI.js} +1 -1
  18. package/dist/bundle/chunks/{chunk-VSFRR6IC.js → chunk-QQ6NVGNW.js} +1 -1
  19. package/dist/bundle/chunks/{chunk-DWKLYVGO.js → chunk-RUI3NOFB.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-6S2AQWGR.js → chunk-SI7T4LPD.js} +4 -4
  21. package/dist/bundle/chunks/{chunk-V5GJW5IX.js → chunk-SMYD2SB5.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-B3FUE2LF.js → chunk-XAA355T2.js} +1 -1
  23. package/dist/bundle/chunks/{cli-SYWCWCZU.js → cli-GKHAGQO6.js} +1 -1
  24. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-AASXI4DD.js → cloudflare-workers-ai-system-one-PVUECIVD.js} +1 -1
  25. package/dist/bundle/chunks/{easter-egg-3d-QN5RJMZR.js → easter-egg-3d-VAZ2JWDP.js} +1 -1
  26. package/dist/bundle/chunks/{execute-3J63CQJG.js → execute-OEFRHFHI.js} +1 -1
  27. package/dist/bundle/chunks/{google-generative-ai-6HC6JYFU.js → google-generative-ai-2YH7DK5J.js} +1 -1
  28. package/dist/bundle/chunks/{google-vertex-UJFQATKN.js → google-vertex-QNIS4SPE.js} +1 -1
  29. package/dist/bundle/chunks/{llama-cpp-classify-GCDAR6VP.js → llama-cpp-classify-EMBT3ZMY.js} +1 -1
  30. package/dist/bundle/chunks/{mistral-conversations-CF3OZSLK.js → mistral-conversations-RCHJWX2M.js} +1 -1
  31. package/dist/bundle/chunks/{openai-codex-responses-L3IPEYDP.js → openai-codex-responses-LBZQ7HUY.js} +1 -1
  32. package/dist/bundle/chunks/{openai-completions-UXPSYQS7.js → openai-completions-U7NS5GFY.js} +1 -1
  33. package/dist/bundle/chunks/{openai-decisions-DML6VHFQ.js → openai-decisions-YC4ZEGAR.js} +1 -1
  34. package/dist/bundle/chunks/{openai-responses-46Z64FIE.js → openai-responses-4YX6XMEO.js} +1 -1
  35. package/dist/bundle/chunks/{openrouter-images-EI7VO7CT.js → openrouter-images-QPPGKFJY.js} +1 -1
  36. package/dist/bundle/chunks/{pi-messages-4MV3SCQE.js → pi-messages-5W3GZ7B6.js} +1 -1
  37. package/dist/bundle/chunks/{runtime-KEVIZBAR.js → runtime-SI4R3AXJ.js} +1 -1
  38. package/dist/bundle/chunks/{typesafe-system-one-FZU6TH2G.js → typesafe-system-one-GWMQ2NLX.js} +1 -1
  39. package/dist/bundle/chunks/virtual-modules-ENTYMDSQ.js +2 -0
  40. package/dist/bundle/cli-runtime.js +1 -1
  41. package/dist/bundle/index.js +1 -1
  42. package/dist/bundle/rpc-entry.js +1 -1
  43. package/dist/cli/args.d.ts +2 -0
  44. package/dist/cli/args.d.ts.map +1 -1
  45. package/dist/cli/args.js +13 -0
  46. package/dist/cli/args.js.map +1 -1
  47. package/dist/cli/sandbox-command.d.ts +8 -0
  48. package/dist/cli/sandbox-command.d.ts.map +1 -0
  49. package/dist/cli/sandbox-command.js +52 -0
  50. package/dist/cli/sandbox-command.js.map +1 -0
  51. package/dist/config.d.ts +7 -0
  52. package/dist/config.d.ts.map +1 -1
  53. package/dist/config.js +14 -0
  54. package/dist/config.js.map +1 -1
  55. package/dist/core/agent-session.d.ts +20 -0
  56. package/dist/core/agent-session.d.ts.map +1 -1
  57. package/dist/core/agent-session.js +72 -2
  58. package/dist/core/agent-session.js.map +1 -1
  59. package/dist/core/approval-mode.d.ts +28 -0
  60. package/dist/core/approval-mode.d.ts.map +1 -0
  61. package/dist/core/approval-mode.js +34 -0
  62. package/dist/core/approval-mode.js.map +1 -0
  63. package/dist/core/extensions/loader.d.ts.map +1 -1
  64. package/dist/core/extensions/loader.js +15 -0
  65. package/dist/core/extensions/loader.js.map +1 -1
  66. package/dist/core/extensions/runner.d.ts.map +1 -1
  67. package/dist/core/extensions/runner.js +3 -0
  68. package/dist/core/extensions/runner.js.map +1 -1
  69. package/dist/core/extensions/types.d.ts +28 -1
  70. package/dist/core/extensions/types.d.ts.map +1 -1
  71. package/dist/core/extensions/types.js.map +1 -1
  72. package/dist/core/fast-model.d.ts +10 -0
  73. package/dist/core/fast-model.d.ts.map +1 -0
  74. package/dist/core/fast-model.js +13 -0
  75. package/dist/core/fast-model.js.map +1 -0
  76. package/dist/core/keybindings.d.ts +8 -0
  77. package/dist/core/keybindings.d.ts.map +1 -1
  78. package/dist/core/keybindings.js +4 -0
  79. package/dist/core/keybindings.js.map +1 -1
  80. package/dist/core/sandbox/escalation.d.ts +32 -0
  81. package/dist/core/sandbox/escalation.d.ts.map +1 -0
  82. package/dist/core/sandbox/escalation.js +70 -0
  83. package/dist/core/sandbox/escalation.js.map +1 -0
  84. package/dist/core/sandbox/launch.d.ts +14 -0
  85. package/dist/core/sandbox/launch.d.ts.map +1 -0
  86. package/dist/core/sandbox/launch.js +18 -0
  87. package/dist/core/sandbox/launch.js.map +1 -0
  88. package/dist/core/sandbox/policy.d.ts +50 -0
  89. package/dist/core/sandbox/policy.d.ts.map +1 -0
  90. package/dist/core/sandbox/policy.js +96 -0
  91. package/dist/core/sandbox/policy.js.map +1 -0
  92. package/dist/core/sandbox/seatbelt.d.ts +17 -0
  93. package/dist/core/sandbox/seatbelt.d.ts.map +1 -0
  94. package/dist/core/sandbox/seatbelt.js +169 -0
  95. package/dist/core/sandbox/seatbelt.js.map +1 -0
  96. package/dist/core/sandbox/windows.d.ts +30 -0
  97. package/dist/core/sandbox/windows.d.ts.map +1 -0
  98. package/dist/core/sandbox/windows.js +104 -0
  99. package/dist/core/sandbox/windows.js.map +1 -0
  100. package/dist/core/settings-defaults.d.ts +28 -0
  101. package/dist/core/settings-defaults.d.ts.map +1 -1
  102. package/dist/core/settings-defaults.js +28 -0
  103. package/dist/core/settings-defaults.js.map +1 -1
  104. package/dist/core/settings-manager.d.ts +9 -1
  105. package/dist/core/settings-manager.d.ts.map +1 -1
  106. package/dist/core/settings-manager.js +58 -1
  107. package/dist/core/settings-manager.js.map +1 -1
  108. package/dist/core/settings-schema.d.ts +124 -0
  109. package/dist/core/settings-schema.d.ts.map +1 -1
  110. package/dist/core/settings-schema.js +177 -0
  111. package/dist/core/settings-schema.js.map +1 -1
  112. package/dist/core/tools/bash.d.ts +12 -2
  113. package/dist/core/tools/bash.d.ts.map +1 -1
  114. package/dist/core/tools/bash.js +27 -7
  115. package/dist/core/tools/bash.js.map +1 -1
  116. package/dist/core/tools/edit.d.ts +3 -0
  117. package/dist/core/tools/edit.d.ts.map +1 -1
  118. package/dist/core/tools/edit.js +2 -0
  119. package/dist/core/tools/edit.js.map +1 -1
  120. package/dist/core/tools/powershell.d.ts +3 -2
  121. package/dist/core/tools/powershell.d.ts.map +1 -1
  122. package/dist/core/tools/powershell.js +4 -6
  123. package/dist/core/tools/powershell.js.map +1 -1
  124. package/dist/core/tools/render-utils.d.ts +2 -2
  125. package/dist/core/tools/render-utils.js +5 -5
  126. package/dist/core/tools/render-utils.js.map +1 -1
  127. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  128. package/dist/core/tools/renderers/edit.js +16 -19
  129. package/dist/core/tools/renderers/edit.js.map +1 -1
  130. package/dist/core/tools/write.d.ts +3 -0
  131. package/dist/core/tools/write.d.ts.map +1 -1
  132. package/dist/core/tools/write.js +2 -0
  133. package/dist/core/tools/write.js.map +1 -1
  134. package/dist/extensions/agents/agent-tool.d.ts +61 -0
  135. package/dist/extensions/agents/agent-tool.d.ts.map +1 -0
  136. package/dist/extensions/agents/agent-tool.js +277 -0
  137. package/dist/extensions/agents/agent-tool.js.map +1 -0
  138. package/dist/extensions/agents/background.d.ts +56 -0
  139. package/dist/extensions/agents/background.d.ts.map +1 -0
  140. package/dist/extensions/agents/background.js +142 -0
  141. package/dist/extensions/agents/background.js.map +1 -0
  142. package/dist/extensions/agents/builtin-agents.d.ts +8 -0
  143. package/dist/extensions/agents/builtin-agents.d.ts.map +1 -0
  144. package/dist/extensions/agents/builtin-agents.js +38 -0
  145. package/dist/extensions/agents/builtin-agents.js.map +1 -0
  146. package/dist/extensions/agents/call-scopes.d.ts +34 -0
  147. package/dist/extensions/agents/call-scopes.d.ts.map +1 -0
  148. package/dist/extensions/agents/call-scopes.js +36 -0
  149. package/dist/extensions/agents/call-scopes.js.map +1 -0
  150. package/dist/extensions/agents/definitions.d.ts +64 -0
  151. package/dist/extensions/agents/definitions.d.ts.map +1 -0
  152. package/dist/extensions/agents/definitions.js +216 -0
  153. package/dist/extensions/agents/definitions.js.map +1 -0
  154. package/dist/extensions/agents/index.d.ts +15 -0
  155. package/dist/extensions/agents/index.d.ts.map +1 -0
  156. package/dist/extensions/agents/index.js +327 -0
  157. package/dist/extensions/agents/index.js.map +1 -0
  158. package/dist/extensions/agents/runner.d.ts +63 -0
  159. package/dist/extensions/agents/runner.d.ts.map +1 -0
  160. package/dist/extensions/agents/runner.js +156 -0
  161. package/dist/extensions/agents/runner.js.map +1 -0
  162. package/dist/extensions/approval/auto-classifier.d.ts +32 -0
  163. package/dist/extensions/approval/auto-classifier.d.ts.map +1 -0
  164. package/dist/extensions/approval/auto-classifier.js +116 -0
  165. package/dist/extensions/approval/auto-classifier.js.map +1 -0
  166. package/dist/extensions/approval/exit-plan-mode.d.ts +24 -0
  167. package/dist/extensions/approval/exit-plan-mode.d.ts.map +1 -0
  168. package/dist/extensions/approval/exit-plan-mode.js +99 -0
  169. package/dist/extensions/approval/exit-plan-mode.js.map +1 -0
  170. package/dist/extensions/approval/index.d.ts +15 -0
  171. package/dist/extensions/approval/index.d.ts.map +1 -0
  172. package/dist/extensions/approval/index.js +329 -0
  173. package/dist/extensions/approval/index.js.map +1 -0
  174. package/dist/extensions/approval/plan-reminders.d.ts +9 -0
  175. package/dist/extensions/approval/plan-reminders.d.ts.map +1 -0
  176. package/dist/extensions/approval/plan-reminders.js +42 -0
  177. package/dist/extensions/approval/plan-reminders.js.map +1 -0
  178. package/dist/extensions/approval/policy.d.ts +52 -0
  179. package/dist/extensions/approval/policy.d.ts.map +1 -0
  180. package/dist/extensions/approval/policy.js +124 -0
  181. package/dist/extensions/approval/policy.js.map +1 -0
  182. package/dist/extensions/approval/shell-safety.d.ts +11 -0
  183. package/dist/extensions/approval/shell-safety.d.ts.map +1 -0
  184. package/dist/extensions/approval/shell-safety.js +264 -0
  185. package/dist/extensions/approval/shell-safety.js.map +1 -0
  186. package/dist/extensions/cron/cron-expression.d.ts +30 -0
  187. package/dist/extensions/cron/cron-expression.d.ts.map +1 -0
  188. package/dist/extensions/cron/cron-expression.js +119 -0
  189. package/dist/extensions/cron/cron-expression.js.map +1 -0
  190. package/dist/extensions/cron/index.d.ts +19 -0
  191. package/dist/extensions/cron/index.d.ts.map +1 -0
  192. package/dist/extensions/cron/index.js +215 -0
  193. package/dist/extensions/cron/index.js.map +1 -0
  194. package/dist/extensions/cron/loop-args.d.ts +35 -0
  195. package/dist/extensions/cron/loop-args.d.ts.map +1 -0
  196. package/dist/extensions/cron/loop-args.js +95 -0
  197. package/dist/extensions/cron/loop-args.js.map +1 -0
  198. package/dist/extensions/cron/loop-texts.d.ts +29 -0
  199. package/dist/extensions/cron/loop-texts.d.ts.map +1 -0
  200. package/dist/extensions/cron/loop-texts.js +83 -0
  201. package/dist/extensions/cron/loop-texts.js.map +1 -0
  202. package/dist/extensions/cron/scheduler.d.ts +79 -0
  203. package/dist/extensions/cron/scheduler.d.ts.map +1 -0
  204. package/dist/extensions/cron/scheduler.js +146 -0
  205. package/dist/extensions/cron/scheduler.js.map +1 -0
  206. package/dist/extensions/cron/tools.d.ts +47 -0
  207. package/dist/extensions/cron/tools.d.ts.map +1 -0
  208. package/dist/extensions/cron/tools.js +141 -0
  209. package/dist/extensions/cron/tools.js.map +1 -0
  210. package/dist/extensions/goals/evidence.d.ts +20 -0
  211. package/dist/extensions/goals/evidence.d.ts.map +1 -0
  212. package/dist/extensions/goals/evidence.js +77 -0
  213. package/dist/extensions/goals/evidence.js.map +1 -0
  214. package/dist/extensions/goals/index.d.ts +45 -0
  215. package/dist/extensions/goals/index.d.ts.map +1 -0
  216. package/dist/extensions/goals/index.js +438 -0
  217. package/dist/extensions/goals/index.js.map +1 -0
  218. package/dist/extensions/goals/prompts.d.ts +15 -0
  219. package/dist/extensions/goals/prompts.d.ts.map +1 -0
  220. package/dist/extensions/goals/prompts.js +51 -0
  221. package/dist/extensions/goals/prompts.js.map +1 -0
  222. package/dist/extensions/goals/state.d.ts +88 -0
  223. package/dist/extensions/goals/state.d.ts.map +1 -0
  224. package/dist/extensions/goals/state.js +204 -0
  225. package/dist/extensions/goals/state.js.map +1 -0
  226. package/dist/extensions/goals/tools.d.ts +40 -0
  227. package/dist/extensions/goals/tools.d.ts.map +1 -0
  228. package/dist/extensions/goals/tools.js +118 -0
  229. package/dist/extensions/goals/tools.js.map +1 -0
  230. package/dist/extensions/goals/verifier.d.ts +30 -0
  231. package/dist/extensions/goals/verifier.d.ts.map +1 -0
  232. package/dist/extensions/goals/verifier.js +89 -0
  233. package/dist/extensions/goals/verifier.js.map +1 -0
  234. package/dist/extensions/hooks/aggregate.d.ts +30 -0
  235. package/dist/extensions/hooks/aggregate.d.ts.map +1 -0
  236. package/dist/extensions/hooks/aggregate.js +103 -0
  237. package/dist/extensions/hooks/aggregate.js.map +1 -0
  238. package/dist/extensions/hooks/config.d.ts +47 -0
  239. package/dist/extensions/hooks/config.d.ts.map +1 -0
  240. package/dist/extensions/hooks/config.js +169 -0
  241. package/dist/extensions/hooks/config.js.map +1 -0
  242. package/dist/extensions/hooks/file-watcher.d.ts +31 -0
  243. package/dist/extensions/hooks/file-watcher.d.ts.map +1 -0
  244. package/dist/extensions/hooks/file-watcher.js +106 -0
  245. package/dist/extensions/hooks/file-watcher.js.map +1 -0
  246. package/dist/extensions/hooks/index.d.ts +17 -0
  247. package/dist/extensions/hooks/index.d.ts.map +1 -0
  248. package/dist/extensions/hooks/index.js +349 -0
  249. package/dist/extensions/hooks/index.js.map +1 -0
  250. package/dist/extensions/hooks/matcher.d.ts +10 -0
  251. package/dist/extensions/hooks/matcher.d.ts.map +1 -0
  252. package/dist/extensions/hooks/matcher.js +85 -0
  253. package/dist/extensions/hooks/matcher.js.map +1 -0
  254. package/dist/extensions/hooks/runner.d.ts +54 -0
  255. package/dist/extensions/hooks/runner.d.ts.map +1 -0
  256. package/dist/extensions/hooks/runner.js +197 -0
  257. package/dist/extensions/hooks/runner.js.map +1 -0
  258. package/dist/extensions/index.d.ts.map +1 -1
  259. package/dist/extensions/index.js +29 -2
  260. package/dist/extensions/index.js.map +1 -1
  261. package/dist/extensions/lsp/config.d.ts +40 -0
  262. package/dist/extensions/lsp/config.d.ts.map +1 -0
  263. package/dist/extensions/lsp/config.js +92 -0
  264. package/dist/extensions/lsp/config.js.map +1 -0
  265. package/dist/extensions/lsp/connection.d.ts +32 -0
  266. package/dist/extensions/lsp/connection.d.ts.map +1 -0
  267. package/dist/extensions/lsp/connection.js +124 -0
  268. package/dist/extensions/lsp/connection.js.map +1 -0
  269. package/dist/extensions/lsp/index.d.ts +15 -0
  270. package/dist/extensions/lsp/index.d.ts.map +1 -0
  271. package/dist/extensions/lsp/index.js +103 -0
  272. package/dist/extensions/lsp/index.js.map +1 -0
  273. package/dist/extensions/lsp/server.d.ts +68 -0
  274. package/dist/extensions/lsp/server.d.ts.map +1 -0
  275. package/dist/extensions/lsp/server.js +373 -0
  276. package/dist/extensions/lsp/server.js.map +1 -0
  277. package/dist/extensions/lsp/tool.d.ts +43 -0
  278. package/dist/extensions/lsp/tool.d.ts.map +1 -0
  279. package/dist/extensions/lsp/tool.js +534 -0
  280. package/dist/extensions/lsp/tool.js.map +1 -0
  281. package/dist/extensions/memory/index.d.ts +15 -0
  282. package/dist/extensions/memory/index.d.ts.map +1 -0
  283. package/dist/extensions/memory/index.js +336 -0
  284. package/dist/extensions/memory/index.js.map +1 -0
  285. package/dist/extensions/memory/memory-agent.d.ts +29 -0
  286. package/dist/extensions/memory/memory-agent.d.ts.map +1 -0
  287. package/dist/extensions/memory/memory-agent.js +102 -0
  288. package/dist/extensions/memory/memory-agent.js.map +1 -0
  289. package/dist/extensions/memory/prompts.d.ts +18 -0
  290. package/dist/extensions/memory/prompts.d.ts.map +1 -0
  291. package/dist/extensions/memory/prompts.js +124 -0
  292. package/dist/extensions/memory/prompts.js.map +1 -0
  293. package/dist/extensions/memory/recall.d.ts +14 -0
  294. package/dist/extensions/memory/recall.d.ts.map +1 -0
  295. package/dist/extensions/memory/recall.js +80 -0
  296. package/dist/extensions/memory/recall.js.map +1 -0
  297. package/dist/extensions/memory/store.d.ts +48 -0
  298. package/dist/extensions/memory/store.d.ts.map +1 -0
  299. package/dist/extensions/memory/store.js +132 -0
  300. package/dist/extensions/memory/store.js.map +1 -0
  301. package/dist/extensions/skills/bundled/batch/SKILL.md +74 -0
  302. package/dist/extensions/skills/bundled/review/SKILL.md +93 -0
  303. package/dist/extensions/skills/index.d.ts +15 -0
  304. package/dist/extensions/skills/index.d.ts.map +1 -0
  305. package/dist/extensions/skills/index.js +68 -0
  306. package/dist/extensions/skills/index.js.map +1 -0
  307. package/dist/extensions/skills/learn.d.ts +9 -0
  308. package/dist/extensions/skills/learn.d.ts.map +1 -0
  309. package/dist/extensions/skills/learn.js +46 -0
  310. package/dist/extensions/skills/learn.js.map +1 -0
  311. package/dist/extensions/todo/index.d.ts +14 -0
  312. package/dist/extensions/todo/index.d.ts.map +1 -0
  313. package/dist/extensions/todo/index.js +55 -0
  314. package/dist/extensions/todo/index.js.map +1 -0
  315. package/dist/extensions/todo/todos.d.ts +64 -0
  316. package/dist/extensions/todo/todos.d.ts.map +1 -0
  317. package/dist/extensions/todo/todos.js +145 -0
  318. package/dist/extensions/todo/todos.js.map +1 -0
  319. package/dist/extensions/todo/tool.d.ts +23 -0
  320. package/dist/extensions/todo/tool.d.ts.map +1 -0
  321. package/dist/extensions/todo/tool.js +104 -0
  322. package/dist/extensions/todo/tool.js.map +1 -0
  323. package/dist/extensions/web-fetch/fetch-tool.d.ts +27 -0
  324. package/dist/extensions/web-fetch/fetch-tool.d.ts.map +1 -0
  325. package/dist/extensions/web-fetch/fetch-tool.js +319 -0
  326. package/dist/extensions/web-fetch/fetch-tool.js.map +1 -0
  327. package/dist/extensions/web-fetch/html-to-markdown.d.ts +7 -0
  328. package/dist/extensions/web-fetch/html-to-markdown.d.ts.map +1 -0
  329. package/dist/extensions/web-fetch/html-to-markdown.js +21 -0
  330. package/dist/extensions/web-fetch/html-to-markdown.js.map +1 -0
  331. package/dist/extensions/web-fetch/index.d.ts +10 -0
  332. package/dist/extensions/web-fetch/index.d.ts.map +1 -0
  333. package/dist/extensions/web-fetch/index.js +13 -0
  334. package/dist/extensions/web-fetch/index.js.map +1 -0
  335. package/dist/extensions/web-fetch/page-fetch.d.ts +45 -0
  336. package/dist/extensions/web-fetch/page-fetch.d.ts.map +1 -0
  337. package/dist/extensions/web-fetch/page-fetch.js +117 -0
  338. package/dist/extensions/web-fetch/page-fetch.js.map +1 -0
  339. package/dist/extensions/web-fetch/pdf-text.d.ts +29 -0
  340. package/dist/extensions/web-fetch/pdf-text.d.ts.map +1 -0
  341. package/dist/extensions/web-fetch/pdf-text.js +71 -0
  342. package/dist/extensions/web-fetch/pdf-text.js.map +1 -0
  343. package/dist/extensions/web-fetch/preapproved-hosts.d.ts +7 -0
  344. package/dist/extensions/web-fetch/preapproved-hosts.d.ts.map +1 -0
  345. package/dist/extensions/web-fetch/preapproved-hosts.js +110 -0
  346. package/dist/extensions/web-fetch/preapproved-hosts.js.map +1 -0
  347. package/dist/extensions/web-search/dashscope-search.d.ts +29 -0
  348. package/dist/extensions/web-search/dashscope-search.d.ts.map +1 -0
  349. package/dist/extensions/web-search/dashscope-search.js +279 -0
  350. package/dist/extensions/web-search/dashscope-search.js.map +1 -0
  351. package/dist/extensions/web-search/index.d.ts +15 -0
  352. package/dist/extensions/web-search/index.d.ts.map +1 -0
  353. package/dist/extensions/web-search/index.js +51 -0
  354. package/dist/extensions/web-search/index.js.map +1 -0
  355. package/dist/extensions/web-search/search-config.d.ts +53 -0
  356. package/dist/extensions/web-search/search-config.d.ts.map +1 -0
  357. package/dist/extensions/web-search/search-config.js +174 -0
  358. package/dist/extensions/web-search/search-config.js.map +1 -0
  359. package/dist/extensions/web-search/search-tool.d.ts +29 -0
  360. package/dist/extensions/web-search/search-tool.d.ts.map +1 -0
  361. package/dist/extensions/web-search/search-tool.js +149 -0
  362. package/dist/extensions/web-search/search-tool.js.map +1 -0
  363. package/dist/extensions/worktree/git-worktree.d.ts +69 -0
  364. package/dist/extensions/worktree/git-worktree.d.ts.map +1 -0
  365. package/dist/extensions/worktree/git-worktree.js +199 -0
  366. package/dist/extensions/worktree/git-worktree.js.map +1 -0
  367. package/dist/extensions/worktree/index.d.ts +27 -0
  368. package/dist/extensions/worktree/index.d.ts.map +1 -0
  369. package/dist/extensions/worktree/index.js +188 -0
  370. package/dist/extensions/worktree/index.js.map +1 -0
  371. package/dist/extensions/worktree/startup.d.ts +17 -0
  372. package/dist/extensions/worktree/startup.d.ts.map +1 -0
  373. package/dist/extensions/worktree/startup.js +56 -0
  374. package/dist/extensions/worktree/startup.js.map +1 -0
  375. package/dist/main.d.ts.map +1 -1
  376. package/dist/main.js +28 -4
  377. package/dist/main.js.map +1 -1
  378. package/dist/modes/interactive/components/custom-editor.d.ts +18 -0
  379. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  380. package/dist/modes/interactive/components/custom-editor.js +87 -20
  381. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  382. package/dist/modes/interactive/components/diffra-logo.d.ts +6 -0
  383. package/dist/modes/interactive/components/diffra-logo.d.ts.map +1 -1
  384. package/dist/modes/interactive/components/diffra-logo.js +30 -4
  385. package/dist/modes/interactive/components/diffra-logo.js.map +1 -1
  386. package/dist/modes/interactive/components/dynamic-border.d.ts +1 -1
  387. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  388. package/dist/modes/interactive/components/dynamic-border.js +3 -3
  389. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  390. package/dist/modes/interactive/components/footer.d.ts +16 -0
  391. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  392. package/dist/modes/interactive/components/footer.js +84 -46
  393. package/dist/modes/interactive/components/footer.js.map +1 -1
  394. package/dist/modes/interactive/components/tool-execution.d.ts +5 -2
  395. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  396. package/dist/modes/interactive/components/tool-execution.js +152 -62
  397. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  398. package/dist/modes/interactive/components/tool-status.d.ts +5 -0
  399. package/dist/modes/interactive/components/tool-status.d.ts.map +1 -0
  400. package/dist/modes/interactive/components/tool-status.js +15 -0
  401. package/dist/modes/interactive/components/tool-status.js.map +1 -0
  402. package/dist/modes/interactive/components/user-message.d.ts +4 -8
  403. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  404. package/dist/modes/interactive/components/user-message.js +38 -36
  405. package/dist/modes/interactive/components/user-message.js.map +1 -1
  406. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  407. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  408. package/dist/modes/interactive/interactive-mode.js +24 -8
  409. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  410. package/dist/modes/interactive/theme/dark.json +3 -2
  411. package/dist/modes/interactive/theme/light.json +3 -2
  412. package/dist/modes/interactive/theme/system-theme.d.ts +1 -0
  413. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -1
  414. package/dist/modes/interactive/theme/system-theme.js +41 -14
  415. package/dist/modes/interactive/theme/system-theme.js.map +1 -1
  416. package/dist/utils/shell.d.ts +1 -1
  417. package/dist/utils/shell.d.ts.map +1 -1
  418. package/dist/utils/shell.js +12 -2
  419. package/dist/utils/shell.js.map +1 -1
  420. package/dist/utils/tools-manager.d.ts +5 -1
  421. package/dist/utils/tools-manager.d.ts.map +1 -1
  422. package/dist/utils/tools-manager.js +81 -47
  423. package/dist/utils/tools-manager.js.map +1 -1
  424. package/docs/approval-modes.md +99 -0
  425. package/docs/builtin-skills.md +53 -0
  426. package/docs/cli.md +380 -356
  427. package/docs/docs.json +264 -220
  428. package/docs/environment-variables.md +110 -103
  429. package/docs/extensions.md +24 -0
  430. package/docs/goals.md +84 -0
  431. package/docs/hooks.md +112 -0
  432. package/docs/keybindings.md +1 -0
  433. package/docs/lsp.md +71 -0
  434. package/docs/memory.md +71 -0
  435. package/docs/sandbox.md +108 -0
  436. package/docs/scheduled-tasks.md +84 -0
  437. package/docs/security.md +100 -99
  438. package/docs/settings.md +198 -173
  439. package/docs/shell-aliases.md +1 -1
  440. package/docs/skills.md +4 -0
  441. package/docs/slash-commands.md +15 -0
  442. package/docs/subagents.md +102 -0
  443. package/docs/web-tools.md +83 -0
  444. package/docs/windows.md +2 -1
  445. package/docs/worktrees.md +52 -0
  446. package/examples/extensions/README.md +1 -1
  447. package/examples/extensions/plan-mode/README.md +2 -2
  448. package/examples/extensions/plan-mode/index.ts +7 -4
  449. package/examples/extensions/subagent/README.md +2 -0
  450. package/examples/extensions/subagent/index.ts +3 -0
  451. package/examples/extensions/todo.ts +4 -0
  452. package/package.json +9 -8
  453. package/schemas/keybindings.schema.json +4 -0
  454. package/schemas/settings.schema.json +421 -0
  455. package/dist/bundle/chunks/chunk-EIL6ZC3J.js +0 -1240
  456. package/dist/bundle/chunks/chunk-GCKVPVMH.js +0 -2
  457. package/dist/bundle/chunks/virtual-modules-RGWFZDWP.js +0 -2
@@ -0,0 +1,83 @@
1
+ # Fetch and Search the Web
2
+
3
+ Diffra has two built-in web tools: `web_fetch` reads one URL, and `web_search` searches the web through a DashScope search agent. They come from the built-in extensions `builtin:web-fetch` and `builtin:web-search`; `-builtin:web-fetch` or `-builtin:web-search` in the [`extensions` setting](settings.md#resources) turns one off. Calls are not confirmed, like other tools (see [Run Diffra Safely](security.md)).
4
+
5
+ ## web_fetch
6
+
7
+ `web_fetch` is active by default. It takes:
8
+
9
+ | Parameter | Required | Meaning |
10
+ |---|---|---|
11
+ | `url` | yes | An `http://` or `https://` URL without credentials |
12
+ | `prompt` | yes | What to extract from the page |
13
+ | `format` | no | Only the `Accept` header: `auto` (default) prefers Markdown, then HTML, then plain text; `markdown`, `html`, and `text` prefer that type |
14
+
15
+ Diffra fetches the URL, converts HTML to Markdown with [turndown](https://github.com/mixmark-io/turndown) (leaving out scripts, styles, and images), and asks a model to answer `prompt` from the page. The answer comes back after a header with the URL, status, content type, and size:
16
+
17
+ - `http://` URLs to public hosts without an explicit port are fetched over HTTPS. When the HTTPS connection fails, the URL is fetched as given. Localhost, single-label hosts, `.local`/`.internal`/`.lan` names, and private IP addresses are fetched as given.
18
+ - GitHub `blob` URLs are fetched from `raw.githubusercontent.com`.
19
+ - Redirects within the same host (with or without `www.`), scheme, and port are followed, up to 10. A redirect to another host is not followed; the result names the target so the model can fetch it in a new call.
20
+ - Responses are limited to 10 MB and 60 seconds. Text longer than 100,000 characters is cut, and the full text is saved to a temporary file whose path the result names.
21
+ - Binary content, such as images, PDFs, and archives, is saved to a temporary file. Use `read` on saved images. When the `pdftotext` program is installed (from poppler-utils, or the xpdf build that ships with Git for Windows), the text of a PDF is extracted, up to 100,000 characters, and used like a page's text; otherwise the result says how to install it.
22
+ - Markdown pages from well-known documentation sites (for example `developer.mozilla.org` and `docs.python.org`) are returned as fetched, without the model step.
23
+ - The same URL with the same `format` is served from a cache for 15 minutes within a session.
24
+
25
+ The model step uses the [`fastModel` setting](settings.md) when it names a model, otherwise the session model. When that request fails, the result carries the raw page text instead. `DIFFRA_WEB_FETCH_PROCESSING_TIMEOUT_MS` changes its 300-second limit.
26
+
27
+ HTTP errors, unreachable hosts, and invalid URLs are tool errors, for example `Error during fetch for https://example.com/missing: Request failed with status code 404 Not Found`.
28
+
29
+ ## web_search
30
+
31
+ `web_search` takes a `query` of at least 2 characters. One call sends the query to a DashScope model with DashScope's server-side `web_search` tool and, unless turned off, `web_extractor`, which opens result pages. The result lists the narrated findings, the pages the search agent opened, other result URLs, and the queries it ran, followed by a citation policy that asks the model to end its answer with a `Sources:` list.
32
+
33
+ ### When it is available
34
+
35
+ The tool is declared to the model only while a search backend is available:
36
+
37
+ 1. **Automatic.** With nothing configured, it turns on when the session model is an OpenAI-compatible model on a DashScope-compatible endpoint with an API key, for example the Qwen Token Plan providers or a [`models.json`](models.md#configure-a-compatible-endpoint) provider on `dashscope.aliyuncs.com`. Searches then run on `qwen3.8-flash` through that endpoint and key. Coding Plan endpoints (`coding.*`) are not used.
38
+ 2. **A configured search model.** `webSearch.model` names a model as `provider/model-id`. Its provider must use a DashScope-compatible `https` endpoint and have an API key.
39
+ 3. **Environment only.** `WEB_SEARCH_BASE_URL` sets the endpoint, `WEB_SEARCH_MODEL` the plain model id, and `WEB_SEARCH_API_KEY` (or `DASHSCOPE_API_KEY`) the key.
40
+
41
+ DashScope-compatible endpoints are `dashscope.aliyuncs.com`, `dashscope-intl.aliyuncs.com`, `dashscope-us.aliyuncs.com`, `*.maas.aliyuncs.com`, `*.maas.qwencloudapi.com`, `*.maas.qianwenaiapi.com`, and Alibaba internal hosts. `webSearch.allowedHosts` adds hosts for the configured paths 2 and 3, never for the automatic one.
42
+
43
+ Diffra chooses the backend when a session starts and when the model changes. When nothing configures search and the model cannot back it, the tool stays off without a message. When search is turned on with `webSearch.enabled: true`, a model, or the environment, but cannot work, Diffra shows a warning that says what is missing, for example:
44
+
45
+ ```text
46
+ WebSearch is enabled but no search model is configured.
47
+ Set a search model on a DashScope-compatible provider in settings.json (recommended: qwen3.8-flash):
48
+ { "webSearch": { "enabled": true, "model": "<provider>/qwen3.8-flash" } }
49
+ ```
50
+
51
+ A search that runs out of time returns what arrived when at least one search ran, marked as partial; otherwise it is a tool error. A backend that answers without searching is retried once. Searches beyond `maxPerSession` in one session are skipped, and the model is told to continue with what it has. The count restarts when you start, resume, or fork a session.
52
+
53
+ ### Settings
54
+
55
+ ```json
56
+ {
57
+ "webSearch": {
58
+ "model": "dash/qwen3.8-flash",
59
+ "webExtractor": true,
60
+ "timeoutMs": 120000,
61
+ "maxPerSession": 200
62
+ }
63
+ }
64
+ ```
65
+
66
+ | Setting | Environment override | Default | Meaning |
67
+ |---|---|---|---|
68
+ | `webSearch.enabled` | `ENABLE_WEB_SEARCH` | unset | `false` turns the tool off. `true` without a model only warns when no backend can be derived |
69
+ | `webSearch.model` | `WEB_SEARCH_MODEL` | unset | Search model as `provider/model-id`; with `WEB_SEARCH_BASE_URL`, the plain model id |
70
+ | `webSearch.webExtractor` | `WEB_SEARCH_EXTRACTOR` | `true` | Let the search agent open result pages (billed separately by DashScope) |
71
+ | `webSearch.timeoutMs` | `WEB_SEARCH_TIMEOUT_MS` | `120000` | Time budget of one search, at most `600000` |
72
+ | `webSearch.maxPerSession` | `WEB_SEARCH_MAX_PER_SESSION` | `200` | `web_search` calls per session, at most `10000` |
73
+ | `webSearch.allowedHosts` | `WEB_SEARCH_ALLOWED_HOSTS` | `[]` | Extra trusted endpoint host suffixes for configured backends; comma-separated in the variable |
74
+ | | `WEB_SEARCH_BASE_URL` | unset | Endpoint for an environment-only backend |
75
+ | | `WEB_SEARCH_API_KEY` | unset | Key for `WEB_SEARCH_BASE_URL`; `DASHSCOPE_API_KEY` is used when it is unset |
76
+
77
+ Empty environment variables count as unset. Other search services, such as Tavily, can be added as [MCP servers](mcp.md).
78
+
79
+ ## Differences from Qwen Code
80
+
81
+ - `pdftotext` counts as installed when it starts at all; Qwen Code also requires `pdftotext -v` to exit with 0, which the xpdf build does not.
82
+ - `web_search` uses only the DashScope search agent; the Qwen subscription search backend is not included.
83
+ - Neither tool asks for permission in the default `yolo` [approval mode](approval-modes.md).
package/docs/windows.md CHANGED
@@ -21,7 +21,8 @@ Diffra resolves Bash in this order:
21
21
  1. `shellPath` from `~/.diffra/agent/settings.json`
22
22
  2. Git Bash at `%ProgramFiles%\Git\bin\bash.exe`
23
23
  3. Git Bash at `%ProgramFiles(x86)%\Git\bin\bash.exe`
24
- 4. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
24
+ 4. Git Bash next to `git.exe` on `PATH`, for Git installed on another drive or in a custom folder (`<Git folder>\cmd\git.exe` gives `<Git folder>\bin\bash.exe`)
25
+ 5. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
25
26
 
26
27
  Start Diffra and enter this command to verify the shell:
27
28
 
@@ -0,0 +1,52 @@
1
+ # Work in a Git Worktree
2
+
3
+ A git worktree is a second checkout of the same repository on its own branch. Working in one keeps the agent's changes away from your main checkout until you merge them. Diffra keeps its worktrees at `<repository root>/.diffra/worktrees/<name>`, each on a new branch `worktree-<name>` created from the branch that was checked out. Worktrees come from the built-in extension `builtin:worktree`.
4
+
5
+ ## Start a session in a worktree
6
+
7
+ ```bash
8
+ diffra --worktree # a new worktree with a generated name, such as swift-otter-1a2b3c
9
+ diffra --worktree feature-x # a new worktree named feature-x, or the existing one with that name
10
+ diffra --worktree '#123' # pull request 123: fetches origin pull/123/head into worktree pr-123
11
+ diffra --worktree https://github.com/owner/repo/pull/123
12
+ ```
13
+
14
+ Diffra creates the worktree before the first turn and runs the whole session in it: tools, project settings, and the session's directory are the worktree's. Paths in `-e`, `--skill`, `--prompt-template`, `--theme`, `--session-dir`, and `@file` arguments still resolve against the directory you started in.
15
+
16
+ A value after `--worktree` is always read as the name: `diffra --worktree "fix the bug"` fails because the name is invalid. Put the prompt after another flag, or use `--worktree=<name>`.
17
+
18
+ ## Let the agent enter one
19
+
20
+ When you ask for a worktree mid-session, the agent calls `enter_worktree` with an optional `name`. The session's directory does not change: the agent is told to use the worktree's absolute path for every file operation and command until it calls `exit_worktree`.
21
+
22
+ `exit_worktree` takes the `name` and an `action`:
23
+
24
+ - `keep` leaves the worktree and its branch on disk.
25
+ - `remove` deletes the worktree and its branch. It refuses when the worktree has uncommitted changes or untracked files (unless `discard_changes` is `true`), when its branch has commits that no other branch or remote branch has, when another session created it, or when it is the worktree the session runs in.
26
+
27
+ In the `default` and `auto-edit` approval modes both tools ask first.
28
+
29
+ ## What else happens
30
+
31
+ - `/.diffra/worktrees/` and the `.diffra-session` marker (which records the session that created a worktree) are added to the repository's `.git/info/exclude`, so they do not show up in `git status`.
32
+ - The footer shows `⎇ <branch> (<name>)` while a worktree is active. `"ui": { "hideBuiltinWorktreeIndicator": true }` hides it.
33
+ - The active worktree is recorded in the session. When you resume the session, the agent is reminded to keep using its path; a worktree that no longer exists is forgotten.
34
+
35
+ ## Settings
36
+
37
+ | Setting | Default | Meaning |
38
+ |---|---|---|
39
+ | `worktree.symlinkDirectories` | unset | Directories relative to the repository root, such as `["node_modules"]`, linked into new worktrees instead of being reinstalled. Absolute paths, entries with `..`, missing sources, and existing targets are skipped |
40
+ | `ui.hideBuiltinWorktreeIndicator` | `false` | Hide the worktree in the footer |
41
+
42
+ ## Differences from Qwen Code
43
+
44
+ - The `agent` tool has no `isolation: "worktree"` option: subagents run their tools through the main session, which has one working directory. There is no cleanup of old agent worktrees either.
45
+ - Leaving Diffra does not offer to keep or remove the worktree; use `exit_worktree` or `git worktree remove`.
46
+ - Ownership is checked against the session id only: a worktree created by another session cannot be removed with `exit_worktree`, even after that session ended.
47
+ - After `exit_worktree` with `keep`, the worktree is no longer the session's active worktree.
48
+ - A detached HEAD still gets a `worktree-<name>` branch at that commit, so its commits are never left without a branch.
49
+
50
+ ## Sandbox
51
+
52
+ Diffra has no built-in sandbox. Qwen Code's sandboxes need Docker or Podman with a published Qwen Code image, macOS `sandbox-exec`, or Linux bubblewrap or Landlock; none of them run on Windows natively. To isolate Diffra, run it in a container or virtual machine: see [Run Diffra in an isolated environment](containerization.md).
@@ -49,7 +49,7 @@ For isolation setup and limitations, see [Run Diffra in an isolated environment]
49
49
  | Extension | Description |
50
50
  |-----------|-------------|
51
51
  | `preset.ts` | Named presets for model, thinking level, tools, and instructions via `--preset` flag and `/preset` command |
52
- | `plan-mode/` | Claude Code-style plan mode for read-only exploration with `/plan` command and step tracking |
52
+ | `plan-mode/` | Claude Code-style plan mode for read-only exploration with a `/plan-mode` command and step tracking (Diffra also has built-in plan mode, `/plan`) |
53
53
  | `tools.ts` | Interactive `/tools` command to enable/disable tools with session persistence |
54
54
  | `handoff.ts` | Transfer context to a new focused session via `/handoff <goal>` |
55
55
  | `qna.ts` | Extracts questions from last response into editor via `ctx.ui.setEditorText()` |
@@ -13,13 +13,13 @@ Read-only exploration mode for safe code analysis.
13
13
 
14
14
  ## Commands
15
15
 
16
- - `/plan` - Toggle plan mode
16
+ - `/plan-mode` - Toggle plan mode (Diffra's built-in plan mode uses `/plan`; this example is separate)
17
17
  - `/todos` - Show current plan progress
18
18
  - `Ctrl+Alt+P` - Toggle plan mode (shortcut)
19
19
 
20
20
  ## Usage
21
21
 
22
- 1. Enable plan mode with `/plan` or `--plan` flag
22
+ 1. Enable plan mode with `/plan-mode` or `--plan` flag
23
23
  2. Ask the agent to analyze code and create a plan
24
24
  3. The agent should output a numbered plan under a `Plan:` header:
25
25
 
@@ -5,7 +5,10 @@
5
5
  * When enabled, built-in write tools are disabled.
6
6
  *
7
7
  * Features:
8
- * - /plan command or Ctrl+Alt+P to toggle
8
+ * - /plan-mode command or Ctrl+Alt+P to toggle
9
+ *
10
+ * Diffra has built-in plan mode (`/plan`, `/approval-mode plan`, `exit_plan_mode`). This example
11
+ * shows how an extension can build its own; its command is `/plan-mode` so both can be loaded.
9
12
  * - Bash restricted to allowlisted read-only commands
10
13
  * - Extracts numbered plan steps from "Plan:" sections
11
14
  * - [DONE:n] markers to complete steps during execution
@@ -142,7 +145,7 @@ export default function planModeExtension(diffra: ExtensionAPI): void {
142
145
  persistState();
143
146
  }
144
147
 
145
- diffra.registerCommand("plan", {
148
+ diffra.registerCommand("plan-mode", {
146
149
  description: "Toggle plan mode (read-only exploration)",
147
150
  handler: async (_args, ctx) => togglePlanMode(ctx),
148
151
  });
@@ -151,7 +154,7 @@ export default function planModeExtension(diffra: ExtensionAPI): void {
151
154
  description: "Show current plan todo list",
152
155
  handler: async (_args, ctx) => {
153
156
  if (todoItems.length === 0) {
154
- ctx.ui.notify("No todos. Create a plan first with /plan", "info");
157
+ ctx.ui.notify("No todos. Create a plan first with /plan-mode", "info");
155
158
  return;
156
159
  }
157
160
  const list = todoItems.map((item, i) => `${i + 1}. ${item.completed ? "✓" : "○"} ${item.text}`).join("\n");
@@ -172,7 +175,7 @@ export default function planModeExtension(diffra: ExtensionAPI): void {
172
175
  if (!isSafeCommand(command)) {
173
176
  return {
174
177
  block: true,
175
- reason: `Plan mode: command blocked (not allowlisted). Use /plan to disable plan mode first.\nCommand: ${command}`,
178
+ reason: `Plan mode: command blocked (not allowlisted). Use /plan-mode to disable plan mode first.\nCommand: ${command}`,
176
179
  };
177
180
  }
178
181
  });
@@ -1,5 +1,7 @@
1
1
  # Subagent Example
2
2
 
3
+ Diffra also has a built-in `agent` tool for subagents (see [Delegate to Subagents](../../../docs/subagents.md)). This example is separate: it runs each subagent as its own `diffra` process through a `subagent` tool, and both can be loaded together.
4
+
3
5
  Delegate tasks to specialized subagents with isolated context windows.
4
6
 
5
7
  ## Features
@@ -1,4 +1,7 @@
1
1
  /**
2
+ * Diffra has a built-in `agent` tool for subagents (`builtin:agents`, see docs/subagents.md). This
3
+ * example is separate: it runs each subagent as its own diffra process through the `subagent` tool.
4
+ *
2
5
  * Subagent Tool - Delegate tasks to specialized agents
3
6
  *
4
7
  * Spawns a separate `diffra` process for each subagent invocation,
@@ -8,6 +8,10 @@
8
8
  * State is stored in tool result details (not external files), which allows
9
9
  * proper branching - when you branch, the todo state is automatically
10
10
  * correct for that point in history.
11
+ *
12
+ * Diffra also ships a built-in `todo_write` tool (`builtin:todo`, enable it with
13
+ * `"defaultTools": ["+todo_write"]`). This example is a smaller, separate tool
14
+ * named `todo` that shows the session-entry state pattern.
11
15
  */
12
16
 
13
17
  import { StringEnum } from "@diffra-ai/ai";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diffra-ai/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "diffraConfig": {
@@ -33,19 +33,19 @@
33
33
  "build": "npm run build:unbundled && node ../../scripts/build-coding-agent-bundle.mjs",
34
34
  "build:unbundled": "tsc -p tsconfig.build.json && node ../../scripts/package-files.mjs executable dist/cli.js dist/rpc-entry.js && npm run copy-assets",
35
35
  "build:binary": "npm --prefix ../tui run build && npm --prefix ../telemetry run build && npm --prefix ../ai run build && npm --prefix ../agent run build && npm run build && bun build --compile --no-compile-autoload-bunfig --no-compile-autoload-dotenv --compile-autoload-package-json ./dist/bun/cli.js ./src/utils/image-resize-worker.ts ./src/extensions/codemode/worker.ts --outfile dist/diffra && npm run copy-binary-assets",
36
- "copy-assets": "node ../../scripts/package-files.mjs copy \"src/modes/interactive/theme/*.json\" dist/modes/interactive/theme && node ../../scripts/package-files.mjs copy \"src/modes/interactive/assets/*.png\" dist/modes/interactive/assets && node ../../scripts/package-files.mjs copy src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html && node ../../scripts/package-files.mjs copy \"src/core/export-html/vendor/*.js\" dist/core/export-html/vendor",
37
- "copy-binary-assets": "node ../../scripts/package-files.mjs copy package.json README.md CHANGELOG.md docs examples ../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm dist && node ../../scripts/package-files.mjs copy \"src/modes/interactive/theme/*.json\" dist/theme && node ../../scripts/package-files.mjs copy \"src/modes/interactive/assets/*.png\" dist/assets && node ../../scripts/package-files.mjs copy src/core/export-html/template.html dist/export-html && node ../../scripts/package-files.mjs copy \"src/core/export-html/vendor/*.js\" dist/export-html/vendor",
36
+ "copy-assets": "node ../../scripts/package-files.mjs copy \"src/modes/interactive/theme/*.json\" dist/modes/interactive/theme && node ../../scripts/package-files.mjs copy \"src/modes/interactive/assets/*.png\" dist/modes/interactive/assets && node ../../scripts/package-files.mjs copy src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html && node ../../scripts/package-files.mjs copy \"src/core/export-html/vendor/*.js\" dist/core/export-html/vendor && node ../../scripts/package-files.mjs copy \"src/extensions/skills/bundled/*\" dist/extensions/skills/bundled",
37
+ "copy-binary-assets": "node ../../scripts/package-files.mjs copy package.json README.md CHANGELOG.md docs examples ../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm dist && node ../../scripts/package-files.mjs copy \"src/modes/interactive/theme/*.json\" dist/theme && node ../../scripts/package-files.mjs copy \"src/modes/interactive/assets/*.png\" dist/assets && node ../../scripts/package-files.mjs copy src/core/export-html/template.html dist/export-html && node ../../scripts/package-files.mjs copy \"src/core/export-html/vendor/*.js\" dist/export-html/vendor && node ../../scripts/package-files.mjs copy \"src/extensions/skills/bundled/*\" dist/skills",
38
38
  "test": "vitest --run",
39
39
  "generate:schemas": "node --import ./src/experimental/source-resolver.ts scripts/generate-schemas.ts",
40
40
  "generate:references": "node --import ./src/experimental/source-resolver.ts scripts/generate-references.ts",
41
41
  "prepublishOnly": "npm run clean && npm run build"
42
42
  },
43
43
  "dependencies": {
44
- "@diffra-ai/agent-core": "0.1.0",
45
- "@diffra-ai/ai": "0.1.0",
46
- "@diffra-ai/codemode": "0.1.0",
47
- "@diffra-ai/mcp": "0.1.0",
48
- "@diffra-ai/tui": "0.1.0",
44
+ "@diffra-ai/agent-core": "0.1.2",
45
+ "@diffra-ai/ai": "0.1.2",
46
+ "@diffra-ai/codemode": "0.1.2",
47
+ "@diffra-ai/mcp": "0.1.2",
48
+ "@diffra-ai/tui": "0.1.2",
49
49
  "@silvia-odwyer/photon-node": "0.3.4",
50
50
  "brace-expansion": "5.0.12",
51
51
  "chalk": "6.0.0",
@@ -60,6 +60,7 @@
60
60
  "proper-lockfile": "4.1.2",
61
61
  "quickjs-wasi": "3.6.2",
62
62
  "semver": "7.8.5",
63
+ "turndown": "7.2.4",
63
64
  "typebox": "1.3.27",
64
65
  "undici": "8.12.4",
65
66
  "yaml": "2.9.0"
@@ -215,6 +215,10 @@
215
215
  "$ref": "#/$defs/KeybindingValue",
216
216
  "description": "Cycle thinking level"
217
217
  },
218
+ "app.approvalMode.cycle": {
219
+ "$ref": "#/$defs/KeybindingValue",
220
+ "description": "Cycle approval mode"
221
+ },
218
222
  "app.thinking.save": {
219
223
  "$ref": "#/$defs/KeybindingValue",
220
224
  "description": "Save thinking level"