@draht/coding-agent 2026.10.31 → 2026.11.5-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (512) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/dist/bundle/chunks/anthropic-messages-UJZ4SGHU.js +6 -0
  3. package/dist/bundle/chunks/azure-openai-responses-NCMJPZVJ.js +2 -0
  4. package/dist/bundle/chunks/bedrock-converse-stream.js +27 -24
  5. package/dist/bundle/chunks/chunk-2JZLKNZ4.js +3 -0
  6. package/dist/bundle/chunks/chunk-3BJ462DN.js +132 -0
  7. package/dist/bundle/chunks/chunk-5OXIAQP5.js +2 -0
  8. package/dist/bundle/chunks/chunk-6M3D4XVD.js +2 -0
  9. package/dist/bundle/chunks/{chunk-KVH4HR57.js → chunk-6WESOD4H.js} +1 -1
  10. package/dist/bundle/chunks/chunk-AOCWORXE.js +2 -0
  11. package/dist/bundle/chunks/chunk-BK5LXGIH.js +2 -0
  12. package/dist/bundle/chunks/chunk-CA23BDNK.js +2 -0
  13. package/dist/bundle/chunks/chunk-DWOGGNWY.js +18 -0
  14. package/dist/bundle/chunks/{chunk-RMLEJL4F.js → chunk-EOXOMUKR.js} +1 -1
  15. package/dist/bundle/chunks/chunk-F5TDVH26.js +159 -0
  16. package/dist/bundle/chunks/chunk-GBFVS2SF.js +12 -0
  17. package/dist/bundle/chunks/{chunk-ITP6IDBA.js → chunk-GQXRTK54.js} +2 -2
  18. package/dist/bundle/chunks/chunk-HJ3PS7QP.js +4 -0
  19. package/dist/bundle/chunks/chunk-ITKDPD4D.js +12 -0
  20. package/dist/bundle/chunks/chunk-KFREX3FS.js +10 -0
  21. package/dist/bundle/chunks/chunk-LO6CVU2L.js +6 -0
  22. package/dist/bundle/chunks/{chunk-AACPRSR2.js → chunk-P7O36UDU.js} +2 -2
  23. package/dist/bundle/chunks/chunk-PMINB7UH.js +1401 -0
  24. package/dist/bundle/chunks/chunk-PZKD35UB.js +2 -0
  25. package/dist/bundle/chunks/{chunk-JQF3BGRS.js → chunk-Q2QKCYPU.js} +1 -1
  26. package/dist/bundle/chunks/chunk-QBUTRTYN.js +2 -0
  27. package/dist/bundle/chunks/chunk-SUVMF4W5.js +2 -0
  28. package/dist/bundle/chunks/chunk-UFACUBF2.js +16 -0
  29. package/dist/bundle/chunks/chunk-VXO6B72D.js +9 -0
  30. package/dist/bundle/chunks/{chunk-NUUJKLOX.js → chunk-WXASQQBZ.js} +9 -9
  31. package/dist/bundle/chunks/chunk-Y3NLUJYO.js +2 -0
  32. package/dist/bundle/chunks/chunk-Y7QE2R34.js +2 -0
  33. package/dist/bundle/chunks/chunk-YD5VPPI4.js +30 -0
  34. package/dist/bundle/chunks/chunk-YWRWN7ZB.js +82 -0
  35. package/dist/bundle/chunks/{cli-LGOE6EXL.js → cli-4SUT6MJ6.js} +10 -10
  36. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-BJVMNETD.js +2 -0
  37. package/dist/bundle/chunks/{execute-ZVQ7ITER.js → execute-ZI7T2SUH.js} +1 -1
  38. package/dist/bundle/chunks/github-copilot.js +1 -1
  39. package/dist/bundle/chunks/{google-generative-ai-IHELIMAC.js → google-generative-ai-N5IPPKQY.js} +1 -1
  40. package/dist/bundle/chunks/{google-vertex-3QCFWSNG.js → google-vertex-A4BKUE4H.js} +1 -1
  41. package/dist/bundle/chunks/https-proxy-agent-WQIRL24U.js +13 -0
  42. package/dist/bundle/chunks/image-resize-worker.js +1 -1
  43. package/dist/bundle/chunks/kimi-coding.js +1 -1
  44. package/dist/bundle/chunks/lib-ULKZYRGD.js +9 -0
  45. package/dist/bundle/chunks/{llama-cpp-classify-6J5XKC7Q.js → llama-cpp-classify-L4URPZ4F.js} +1 -1
  46. package/dist/bundle/chunks/meta.js +1 -1
  47. package/dist/bundle/chunks/mistral-conversations-CK2BS74V.js +5 -0
  48. package/dist/bundle/chunks/{multipart-parser-AZP5BX2W.js → multipart-parser-HMCXZ4BD.js} +1 -1
  49. package/dist/bundle/chunks/{node-BZAVEWJ3.js → node-DXZFQBEO.js} +1 -1
  50. package/dist/bundle/chunks/{node-C2JGH2OB.js → node-LBZLUIBE.js} +1 -1
  51. package/dist/bundle/chunks/openai-codex-responses-XGVNKP4D.js +10 -0
  52. package/dist/bundle/chunks/openai-completions-72XZO4Q3.js +7 -0
  53. package/dist/bundle/chunks/{openai-decisions-NDYRKL2E.js → openai-decisions-P5OCXLLD.js} +1 -1
  54. package/dist/bundle/chunks/openai-responses-RGLZ4E3Q.js +4 -0
  55. package/dist/bundle/chunks/{openrouter-images-ZIDF5HXA.js → openrouter-images-LSBWMZDK.js} +1 -1
  56. package/dist/bundle/chunks/pi-messages-CL4MEVNS.js +8 -0
  57. package/dist/bundle/chunks/radius.js +1 -1
  58. package/dist/bundle/chunks/{runtime-MZVF4MP6.js → runtime-F4362CZF.js} +1 -1
  59. package/dist/bundle/chunks/{runtime-7BIFTREJ.js → runtime-FJYRBK3O.js} +1 -1
  60. package/dist/bundle/chunks/settings-manager-T6G6KKY3.js +2 -0
  61. package/dist/bundle/chunks/src-KDGO7EGF.js +4 -0
  62. package/dist/bundle/chunks/typesafe-system-one-BFYS6AEA.js +2 -0
  63. package/dist/bundle/chunks/virtual-modules-BPZIVXNK.js +2 -0
  64. package/dist/bundle/cli-runtime.js +1 -1
  65. package/dist/bundle/index.js +1 -1
  66. package/dist/bundle/rpc-entry.js +1 -1
  67. package/dist/cli/args.d.ts.map +1 -1
  68. package/dist/cli/args.js +8 -7
  69. package/dist/cli/args.js.map +1 -1
  70. package/dist/cli/config-selector.d.ts.map +1 -1
  71. package/dist/cli/config-selector.js +3 -1
  72. package/dist/cli/config-selector.js.map +1 -1
  73. package/dist/config.d.ts +10 -0
  74. package/dist/config.d.ts.map +1 -1
  75. package/dist/config.js +24 -5
  76. package/dist/config.js.map +1 -1
  77. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  78. package/dist/core/agent-session-runtime.js +4 -3
  79. package/dist/core/agent-session-runtime.js.map +1 -1
  80. package/dist/core/agent-session.d.ts +16 -1
  81. package/dist/core/agent-session.d.ts.map +1 -1
  82. package/dist/core/agent-session.js +104 -30
  83. package/dist/core/agent-session.js.map +1 -1
  84. package/dist/core/ai-schemas.d.ts +166 -0
  85. package/dist/core/ai-schemas.d.ts.map +1 -0
  86. package/dist/core/ai-schemas.js +21 -0
  87. package/dist/core/ai-schemas.js.map +1 -0
  88. package/dist/core/auth-storage.d.ts.map +1 -1
  89. package/dist/core/auth-storage.js +3 -2
  90. package/dist/core/auth-storage.js.map +1 -1
  91. package/dist/core/bash-executor.d.ts.map +1 -1
  92. package/dist/core/bash-executor.js +3 -1
  93. package/dist/core/bash-executor.js.map +1 -1
  94. package/dist/core/bug-report.d.ts +4 -4
  95. package/dist/core/cache-warmer.d.ts.map +1 -1
  96. package/dist/core/cache-warmer.js +2 -0
  97. package/dist/core/cache-warmer.js.map +1 -1
  98. package/dist/core/compaction/branch-summarization.d.ts +4 -2
  99. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  100. package/dist/core/compaction/branch-summarization.js +16 -4
  101. package/dist/core/compaction/branch-summarization.js.map +1 -1
  102. package/dist/core/exec.d.ts +9 -1
  103. package/dist/core/exec.d.ts.map +1 -1
  104. package/dist/core/exec.js +104 -60
  105. package/dist/core/exec.js.map +1 -1
  106. package/dist/core/export-html/template.css +9 -0
  107. package/dist/core/export-html/template.js +165 -45
  108. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  109. package/dist/core/export-html/tool-renderer.js +3 -0
  110. package/dist/core/export-html/tool-renderer.js.map +1 -1
  111. package/dist/core/extensions/ai-extension-view.d.ts +19 -0
  112. package/dist/core/extensions/ai-extension-view.d.ts.map +1 -0
  113. package/dist/core/extensions/ai-extension-view.js +22 -0
  114. package/dist/core/extensions/ai-extension-view.js.map +1 -0
  115. package/dist/core/extensions/index.d.ts +1 -1
  116. package/dist/core/extensions/index.d.ts.map +1 -1
  117. package/dist/core/extensions/index.js.map +1 -1
  118. package/dist/core/extensions/loader.d.ts.map +1 -1
  119. package/dist/core/extensions/loader.js +15 -9
  120. package/dist/core/extensions/loader.js.map +1 -1
  121. package/dist/core/extensions/runner.d.ts +1 -0
  122. package/dist/core/extensions/runner.d.ts.map +1 -1
  123. package/dist/core/extensions/runner.js +9 -1
  124. package/dist/core/extensions/runner.js.map +1 -1
  125. package/dist/core/extensions/types.d.ts +55 -11
  126. package/dist/core/extensions/types.d.ts.map +1 -1
  127. package/dist/core/extensions/types.js.map +1 -1
  128. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  129. package/dist/core/extensions/virtual-modules.js +6 -5
  130. package/dist/core/extensions/virtual-modules.js.map +1 -1
  131. package/dist/core/keybindings.d.ts +2 -2
  132. package/dist/core/keybindings.js +1 -1
  133. package/dist/core/keybindings.js.map +1 -1
  134. package/dist/core/mcp-servers.d.ts +21 -38
  135. package/dist/core/mcp-servers.d.ts.map +1 -1
  136. package/dist/core/mcp-servers.js +58 -134
  137. package/dist/core/mcp-servers.js.map +1 -1
  138. package/dist/core/model-config.d.ts +1717 -1990
  139. package/dist/core/model-config.d.ts.map +1 -1
  140. package/dist/core/model-config.js +2 -3
  141. package/dist/core/model-config.js.map +1 -1
  142. package/dist/core/model-resolver.d.ts.map +1 -1
  143. package/dist/core/model-resolver.js +16 -9
  144. package/dist/core/model-resolver.js.map +1 -1
  145. package/dist/core/model-runtime.d.ts.map +1 -1
  146. package/dist/core/model-runtime.js +4 -4
  147. package/dist/core/model-runtime.js.map +1 -1
  148. package/dist/core/package-manager.d.ts +24 -1
  149. package/dist/core/package-manager.d.ts.map +1 -1
  150. package/dist/core/package-manager.js +215 -52
  151. package/dist/core/package-manager.js.map +1 -1
  152. package/dist/core/pi-manifest.d.ts +1 -0
  153. package/dist/core/pi-manifest.d.ts.map +1 -1
  154. package/dist/core/pi-manifest.js +3 -0
  155. package/dist/core/pi-manifest.js.map +1 -1
  156. package/dist/core/project-trust.js +1 -1
  157. package/dist/core/project-trust.js.map +1 -1
  158. package/dist/core/provider-composer.d.ts +2 -1
  159. package/dist/core/provider-composer.d.ts.map +1 -1
  160. package/dist/core/provider-composer.js +8 -4
  161. package/dist/core/provider-composer.js.map +1 -1
  162. package/dist/core/resource-loader.d.ts +4 -1
  163. package/dist/core/resource-loader.d.ts.map +1 -1
  164. package/dist/core/resource-loader.js +38 -23
  165. package/dist/core/resource-loader.js.map +1 -1
  166. package/dist/core/sdk.d.ts.map +1 -1
  167. package/dist/core/sdk.js +3 -1
  168. package/dist/core/sdk.js.map +1 -1
  169. package/dist/core/session-manager.d.ts +7 -0
  170. package/dist/core/session-manager.d.ts.map +1 -1
  171. package/dist/core/session-manager.js +32 -13
  172. package/dist/core/session-manager.js.map +1 -1
  173. package/dist/core/settings-manager.d.ts +2 -0
  174. package/dist/core/settings-manager.d.ts.map +1 -1
  175. package/dist/core/settings-manager.js +11 -0
  176. package/dist/core/settings-manager.js.map +1 -1
  177. package/dist/core/settings-schema.d.ts +4 -2
  178. package/dist/core/settings-schema.d.ts.map +1 -1
  179. package/dist/core/settings-schema.js +8 -1
  180. package/dist/core/settings-schema.js.map +1 -1
  181. package/dist/core/skills.d.ts.map +1 -1
  182. package/dist/core/skills.js +6 -15
  183. package/dist/core/skills.js.map +1 -1
  184. package/dist/core/slash-commands.js +2 -2
  185. package/dist/core/slash-commands.js.map +1 -1
  186. package/dist/core/source-info.d.ts +9 -0
  187. package/dist/core/source-info.d.ts.map +1 -1
  188. package/dist/core/source-info.js +14 -0
  189. package/dist/core/source-info.js.map +1 -1
  190. package/dist/core/system-prompt.d.ts.map +1 -1
  191. package/dist/core/system-prompt.js +5 -6
  192. package/dist/core/system-prompt.js.map +1 -1
  193. package/dist/core/tools/bash.d.ts +2 -2
  194. package/dist/core/tools/bash.d.ts.map +1 -1
  195. package/dist/core/tools/bash.js.map +1 -1
  196. package/dist/core/tools/edit.d.ts +3 -3
  197. package/dist/core/tools/edit.d.ts.map +1 -1
  198. package/dist/core/tools/edit.js +2 -4
  199. package/dist/core/tools/edit.js.map +1 -1
  200. package/dist/core/tools/find.d.ts +2 -2
  201. package/dist/core/tools/find.d.ts.map +1 -1
  202. package/dist/core/tools/find.js +41 -25
  203. package/dist/core/tools/find.js.map +1 -1
  204. package/dist/core/tools/grep.d.ts +4 -5
  205. package/dist/core/tools/grep.d.ts.map +1 -1
  206. package/dist/core/tools/grep.js +73 -70
  207. package/dist/core/tools/grep.js.map +1 -1
  208. package/dist/core/tools/ls.d.ts +2 -2
  209. package/dist/core/tools/ls.d.ts.map +1 -1
  210. package/dist/core/tools/ls.js +2 -1
  211. package/dist/core/tools/ls.js.map +1 -1
  212. package/dist/core/tools/read.d.ts +2 -2
  213. package/dist/core/tools/read.d.ts.map +1 -1
  214. package/dist/core/tools/read.js.map +1 -1
  215. package/dist/core/tools/render-utils.d.ts.map +1 -1
  216. package/dist/core/tools/render-utils.js +2 -7
  217. package/dist/core/tools/render-utils.js.map +1 -1
  218. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  219. package/dist/core/tools/renderers/write.js +19 -19
  220. package/dist/core/tools/renderers/write.js.map +1 -1
  221. package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
  222. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  223. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  224. package/dist/core/tools/truncate.d.ts +0 -14
  225. package/dist/core/tools/truncate.d.ts.map +1 -1
  226. package/dist/core/tools/truncate.js +0 -29
  227. package/dist/core/tools/truncate.js.map +1 -1
  228. package/dist/core/tools/write.d.ts +2 -2
  229. package/dist/core/tools/write.d.ts.map +1 -1
  230. package/dist/core/tools/write.js.map +1 -1
  231. package/dist/core/trust-manager.d.ts.map +1 -1
  232. package/dist/core/trust-manager.js +15 -8
  233. package/dist/core/trust-manager.js.map +1 -1
  234. package/dist/core/usage-totals.d.ts.map +1 -1
  235. package/dist/core/usage-totals.js +2 -0
  236. package/dist/core/usage-totals.js.map +1 -1
  237. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  238. package/dist/extensions/codemode/renderer.js +6 -2
  239. package/dist/extensions/codemode/renderer.js.map +1 -1
  240. package/dist/extensions/codemode/tool.d.ts +2 -1
  241. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  242. package/dist/extensions/codemode/tool.js +33 -8
  243. package/dist/extensions/codemode/tool.js.map +1 -1
  244. package/dist/extensions/llama/client.d.ts +2 -0
  245. package/dist/extensions/llama/client.d.ts.map +1 -1
  246. package/dist/extensions/llama/client.js +23 -2
  247. package/dist/extensions/llama/client.js.map +1 -1
  248. package/dist/extensions/llama/ui.d.ts.map +1 -1
  249. package/dist/extensions/llama/ui.js +16 -4
  250. package/dist/extensions/llama/ui.js.map +1 -1
  251. package/dist/extensions/mcp/cli.d.ts +2 -0
  252. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  253. package/dist/extensions/mcp/cli.js +72 -15
  254. package/dist/extensions/mcp/cli.js.map +1 -1
  255. package/dist/extensions/mcp/config.d.ts.map +1 -1
  256. package/dist/extensions/mcp/config.js +4 -7
  257. package/dist/extensions/mcp/config.js.map +1 -1
  258. package/dist/extensions/mcp/index.d.ts.map +1 -1
  259. package/dist/extensions/mcp/index.js +2 -2
  260. package/dist/extensions/mcp/index.js.map +1 -1
  261. package/dist/extensions/mcp/oauth.d.ts +13 -50
  262. package/dist/extensions/mcp/oauth.d.ts.map +1 -1
  263. package/dist/extensions/mcp/oauth.js +53 -319
  264. package/dist/extensions/mcp/oauth.js.map +1 -1
  265. package/dist/extensions/mcp/resources.d.ts +1 -1
  266. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  267. package/dist/extensions/mcp/resources.js +4 -3
  268. package/dist/extensions/mcp/resources.js.map +1 -1
  269. package/dist/extensions/mcp/runtime.d.ts +4 -3
  270. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  271. package/dist/extensions/mcp/runtime.js +4 -3
  272. package/dist/extensions/mcp/runtime.js.map +1 -1
  273. package/dist/extensions/mcp/tools.d.ts +2 -23
  274. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  275. package/dist/extensions/mcp/tools.js +6 -58
  276. package/dist/extensions/mcp/tools.js.map +1 -1
  277. package/dist/extensions/mcp/ui.d.ts +1 -0
  278. package/dist/extensions/mcp/ui.d.ts.map +1 -1
  279. package/dist/extensions/mcp/ui.js +33 -24
  280. package/dist/extensions/mcp/ui.js.map +1 -1
  281. package/dist/extensions/tool-search/tool.d.ts +21 -6
  282. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  283. package/dist/extensions/tool-search/tool.js +104 -36
  284. package/dist/extensions/tool-search/tool.js.map +1 -1
  285. package/dist/index.d.ts +2 -2
  286. package/dist/index.d.ts.map +1 -1
  287. package/dist/index.js.map +1 -1
  288. package/dist/main.d.ts.map +1 -1
  289. package/dist/main.js +16 -8
  290. package/dist/main.js.map +1 -1
  291. package/dist/modes/interactive/components/assistant-message.d.ts +4 -1
  292. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  293. package/dist/modes/interactive/components/assistant-message.js +44 -20
  294. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  295. package/dist/modes/interactive/components/branch-summary-message.d.ts +5 -1
  296. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  297. package/dist/modes/interactive/components/branch-summary-message.js +12 -4
  298. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  299. package/dist/modes/interactive/components/compaction-summary-message.d.ts +5 -1
  300. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  301. package/dist/modes/interactive/components/compaction-summary-message.js +12 -4
  302. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  303. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  304. package/dist/modes/interactive/components/config-selector.js +4 -18
  305. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  306. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  307. package/dist/modes/interactive/components/custom-editor.js +7 -0
  308. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  309. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  310. package/dist/modes/interactive/components/custom-entry.js +2 -1
  311. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  312. package/dist/modes/interactive/components/custom-message.d.ts +5 -2
  313. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  314. package/dist/modes/interactive/components/custom-message.js +12 -4
  315. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  316. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  317. package/dist/modes/interactive/components/diff.js +11 -5
  318. package/dist/modes/interactive/components/diff.js.map +1 -1
  319. package/dist/modes/interactive/components/extension-editor.d.ts +2 -0
  320. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  321. package/dist/modes/interactive/components/extension-editor.js +4 -0
  322. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  323. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  324. package/dist/modes/interactive/components/extension-selector.js +9 -1
  325. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  326. package/dist/modes/interactive/components/login-dialog.d.ts +5 -0
  327. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  328. package/dist/modes/interactive/components/login-dialog.js +104 -10
  329. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  330. package/dist/modes/interactive/components/markdown-transform.d.ts +2 -1
  331. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
  332. package/dist/modes/interactive/components/markdown-transform.js +3 -2
  333. package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
  334. package/dist/modes/interactive/components/mermaid.d.ts +2 -1
  335. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  336. package/dist/modes/interactive/components/mermaid.js +25 -20
  337. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  338. package/dist/modes/interactive/components/model-selector.d.ts +1 -0
  339. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  340. package/dist/modes/interactive/components/model-selector.js +17 -6
  341. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  342. package/dist/modes/interactive/components/oauth-selector.d.ts +1 -0
  343. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  344. package/dist/modes/interactive/components/oauth-selector.js +13 -4
  345. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  346. package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -0
  347. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  348. package/dist/modes/interactive/components/scoped-models-selector.js +14 -3
  349. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  350. package/dist/modes/interactive/components/session-selector-search.d.ts +4 -0
  351. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  352. package/dist/modes/interactive/components/session-selector-search.js +86 -22
  353. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  354. package/dist/modes/interactive/components/session-selector.d.ts +2 -1
  355. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  356. package/dist/modes/interactive/components/session-selector.js +20 -27
  357. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  358. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  359. package/dist/modes/interactive/components/settings-submenu.js +2 -0
  360. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  361. package/dist/modes/interactive/components/skill-invocation-message.d.ts +5 -1
  362. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  363. package/dist/modes/interactive/components/skill-invocation-message.js +12 -4
  364. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  365. package/dist/modes/interactive/components/tool-execution.d.ts +6 -0
  366. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  367. package/dist/modes/interactive/components/tool-execution.js +14 -2
  368. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  369. package/dist/modes/interactive/components/tree-selector.d.ts +2 -0
  370. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  371. package/dist/modes/interactive/components/tree-selector.js +24 -16
  372. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  373. package/dist/modes/interactive/components/user-message-selector.d.ts +1 -0
  374. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  375. package/dist/modes/interactive/components/user-message-selector.js +9 -1
  376. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  377. package/dist/modes/interactive/components/user-message.d.ts +3 -1
  378. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  379. package/dist/modes/interactive/components/user-message.js +6 -2
  380. package/dist/modes/interactive/components/user-message.js.map +1 -1
  381. package/dist/modes/interactive/external-editor.d.ts +1 -0
  382. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  383. package/dist/modes/interactive/external-editor.js +16 -4
  384. package/dist/modes/interactive/external-editor.js.map +1 -1
  385. package/dist/modes/interactive/interactive-mode.d.ts +7 -0
  386. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  387. package/dist/modes/interactive/interactive-mode.js +179 -53
  388. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  389. package/dist/modes/interactive/model-search.d.ts +10 -0
  390. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  391. package/dist/modes/interactive/model-search.js +21 -0
  392. package/dist/modes/interactive/model-search.js.map +1 -1
  393. package/dist/modes/interactive/theme/theme.d.ts +10 -0
  394. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  395. package/dist/modes/interactive/theme/theme.js +35 -23
  396. package/dist/modes/interactive/theme/theme.js.map +1 -1
  397. package/dist/modes/print-mode.d.ts.map +1 -1
  398. package/dist/modes/print-mode.js +19 -10
  399. package/dist/modes/print-mode.js.map +1 -1
  400. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  401. package/dist/modes/rpc/rpc-mode.js +53 -23
  402. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  403. package/dist/package-manager-cli.d.ts.map +1 -1
  404. package/dist/package-manager-cli.js +78 -9
  405. package/dist/package-manager-cli.js.map +1 -1
  406. package/dist/utils/ansi.d.ts.map +1 -1
  407. package/dist/utils/ansi.js +5 -2
  408. package/dist/utils/ansi.js.map +1 -1
  409. package/dist/utils/changelog.d.ts +2 -2
  410. package/dist/utils/changelog.d.ts.map +1 -1
  411. package/dist/utils/changelog.js +15 -2
  412. package/dist/utils/changelog.js.map +1 -1
  413. package/dist/utils/clipboard-command.d.ts.map +1 -1
  414. package/dist/utils/clipboard-command.js +4 -0
  415. package/dist/utils/clipboard-command.js.map +1 -1
  416. package/dist/utils/git.d.ts +1 -1
  417. package/dist/utils/git.d.ts.map +1 -1
  418. package/dist/utils/git.js.map +1 -1
  419. package/dist/utils/image-resize-core.d.ts.map +1 -1
  420. package/dist/utils/image-resize-core.js +5 -3
  421. package/dist/utils/image-resize-core.js.map +1 -1
  422. package/dist/utils/open-browser.d.ts.map +1 -1
  423. package/dist/utils/open-browser.js +4 -1
  424. package/dist/utils/open-browser.js.map +1 -1
  425. package/dist/utils/paths.d.ts +17 -0
  426. package/dist/utils/paths.d.ts.map +1 -1
  427. package/dist/utils/paths.js +42 -1
  428. package/dist/utils/paths.js.map +1 -1
  429. package/dist/utils/shell.d.ts.map +1 -1
  430. package/dist/utils/shell.js +14 -0
  431. package/dist/utils/shell.js.map +1 -1
  432. package/dist/utils/syntax-highlight.d.ts +5 -0
  433. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  434. package/dist/utils/syntax-highlight.js +7 -0
  435. package/dist/utils/syntax-highlight.js.map +1 -1
  436. package/dist/utils/tools-manager.d.ts.map +1 -1
  437. package/dist/utils/tools-manager.js +30 -35
  438. package/dist/utils/tools-manager.js.map +1 -1
  439. package/docs/cli.md +22 -10
  440. package/docs/custom-provider.md +2 -0
  441. package/docs/environment-variables.md +2 -0
  442. package/docs/extensions.md +3201 -233
  443. package/docs/keybindings.md +2 -2
  444. package/docs/llama-cpp.md +23 -15
  445. package/docs/message-types.md +1 -1
  446. package/docs/models-configuration.md +17 -4
  447. package/docs/models.md +9 -4
  448. package/docs/packages.md +24 -0
  449. package/docs/providers.md +1 -1
  450. package/docs/rpc.md +3 -1
  451. package/docs/sessions.md +11 -3
  452. package/docs/settings.md +5 -4
  453. package/docs/slash-commands.md +3 -2
  454. package/docs/terminal-setup.md +3 -1
  455. package/docs/tmux.md +6 -0
  456. package/docs/tui.md +2 -0
  457. package/docs/windows.md +27 -0
  458. package/eval/drahtbank/isolated-tools.ts +0 -1
  459. package/examples/extensions/antigravity-image-gen.ts +1 -1
  460. package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
  461. package/examples/extensions/debug-provider.ts +2 -2
  462. package/examples/extensions/gondolin/package.json +1 -1
  463. package/examples/extensions/plan-mode/index.ts +23 -13
  464. package/examples/extensions/plan-mode/utils.ts +42 -16
  465. package/examples/extensions/preset.ts +2 -0
  466. package/examples/extensions/reload-runtime.ts +17 -5
  467. package/examples/extensions/sandbox/package-lock.json +15 -41
  468. package/examples/extensions/sandbox/package.json +1 -1
  469. package/examples/extensions/subagent/index.ts +388 -171
  470. package/examples/extensions/todo.ts +7 -0
  471. package/examples/extensions/tools.ts +2 -0
  472. package/examples/tsconfig.json +188 -0
  473. package/package.json +15 -16
  474. package/schemas/models.schema.json +85 -39
  475. package/schemas/settings.schema.json +17 -0
  476. package/dist/bundle/chunks/anthropic-messages-OR5LCIS6.js +0 -6
  477. package/dist/bundle/chunks/azure-openai-responses-D6DVM232.js +0 -2
  478. package/dist/bundle/chunks/chunk-2MJ6J5N2.js +0 -6
  479. package/dist/bundle/chunks/chunk-2RI4GIFP.js +0 -166
  480. package/dist/bundle/chunks/chunk-57PET6SW.js +0 -82
  481. package/dist/bundle/chunks/chunk-6MSE6LZ3.js +0 -6
  482. package/dist/bundle/chunks/chunk-736QBNUZ.js +0 -12
  483. package/dist/bundle/chunks/chunk-76YNMQ57.js +0 -2
  484. package/dist/bundle/chunks/chunk-7JJWQ53O.js +0 -1428
  485. package/dist/bundle/chunks/chunk-AEG546ID.js +0 -16
  486. package/dist/bundle/chunks/chunk-CKPJSVRD.js +0 -2
  487. package/dist/bundle/chunks/chunk-CMKX4CSI.js +0 -6
  488. package/dist/bundle/chunks/chunk-DLEJ4D4T.js +0 -2
  489. package/dist/bundle/chunks/chunk-FXCTQRNN.js +0 -2
  490. package/dist/bundle/chunks/chunk-KINQOWAP.js +0 -4
  491. package/dist/bundle/chunks/chunk-LK54N67E.js +0 -7
  492. package/dist/bundle/chunks/chunk-QJADVGUY.js +0 -2
  493. package/dist/bundle/chunks/chunk-QMN7OD6G.js +0 -2
  494. package/dist/bundle/chunks/chunk-SYRVFGYE.js +0 -2
  495. package/dist/bundle/chunks/chunk-TIA2T6EO.js +0 -3
  496. package/dist/bundle/chunks/chunk-X4UBYFTC.js +0 -11
  497. package/dist/bundle/chunks/chunk-XB4F3WGD.js +0 -132
  498. package/dist/bundle/chunks/chunk-XOGEYN4Q.js +0 -2
  499. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-YVG4FYXV.js +0 -2
  500. package/dist/bundle/chunks/https-proxy-agent-O2PVUIOI.js +0 -13
  501. package/dist/bundle/chunks/lib-XOG5PI3Y.js +0 -9
  502. package/dist/bundle/chunks/mistral-conversations-D3JRG6BL.js +0 -5
  503. package/dist/bundle/chunks/openai-codex-responses-CBOPSGUQ.js +0 -10
  504. package/dist/bundle/chunks/openai-completions-LDMDMEF2.js +0 -7
  505. package/dist/bundle/chunks/openai-responses-EZWJOXWT.js +0 -4
  506. package/dist/bundle/chunks/pi-messages-R75QWB4G.js +0 -8
  507. package/dist/bundle/chunks/settings-manager-QF6DRH5C.js +0 -2
  508. package/dist/bundle/chunks/src-TIBHS42X.js +0 -4
  509. package/dist/bundle/chunks/typesafe-system-one-YUNLPYVG.js +0 -2
  510. package/dist/bundle/chunks/virtual-modules-4DJB4LTP.js +0 -2
  511. /package/dist/bundle/chunks/{chunk-UQSONZLL.js → chunk-DN7SM3LX.js} +0 -0
  512. /package/dist/bundle/chunks/{chunk-ZZD35WKM.js → chunk-MOOADNVS.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- import { chmodSync, existsSync, globSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
2
+ import { chmodSync, existsSync, globSync, mkdirSync, readdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync, } from "node:fs";
3
3
  import { homedir } from "node:os";
4
4
  function getEnv() {
5
5
  if (process.platform !== "linux" || Object.keys(process.env).length > 0) {
@@ -20,23 +20,24 @@ function getEnv() {
20
20
  return process.env;
21
21
  }
22
22
  }
23
- import { basename, dirname, join, relative, resolve, sep } from "node:path";
23
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
24
24
  import ignore from "ignore";
25
25
  import { minimatch } from "minimatch";
26
26
  import { gt, maxSatisfying, rcompare, satisfies, valid, validRange } from "semver";
27
27
  import { CONFIG_DIR_NAME } from "../config.js";
28
- import { comparablePath, realHomeDir, realPathStrict } from "../utils/canonical-path.js";
28
+ import { realHomeDir, realPathStrict } from "../utils/canonical-path.js";
29
29
  import { spawnProcess, spawnProcessSync } from "../utils/child-process.js";
30
30
  import { parseGitUrl } from "../utils/git.js";
31
- import { isLocalPath, markPathIgnoredByCloudSync, normalizePath, resolvePath } from "../utils/paths.js";
31
+ import { getPathComparisonKey, isLocalPath, markPathIgnoredByCloudSync, normalizePath, pathsEqual, resolvePath, } from "../utils/paths.js";
32
32
  import { stripBom } from "../utils/text.js";
33
33
  import { isStdoutTakenOver } from "./output-guard.js";
34
34
  import { readPiManifest } from "./pi-manifest.js";
35
- import { BUILTIN_PATH_PREFIX } from "./source-info.js";
35
+ import { BUILTIN_PATH_PREFIX, getResourcePathKey } from "./source-info.js";
36
36
  const NETWORK_TIMEOUT_MS = 10000;
37
37
  const UPDATE_CHECK_CONCURRENCY = 4;
38
38
  const GIT_UPDATE_CONCURRENCY = 4;
39
- function isOfflineModeEnabled() {
39
+ /** Whether DRAHT_OFFLINE is set; package installs and updates then skip all network access. */
40
+ export function isOfflineModeEnabled() {
40
41
  const value = process.env.DRAHT_OFFLINE;
41
42
  if (!value)
42
43
  return false;
@@ -474,6 +475,37 @@ function collectResourceFiles(dir, resourceType) {
474
475
  }
475
476
  return collectFiles(dir, FILE_PATTERNS[resourceType]);
476
477
  }
478
+ // A `draht` object counts as an explicit resource manifest only when it lists resources. Packages whose
479
+ // `draht` object holds only metadata (changelogPath, gallery image/video) still use directory auto-discovery.
480
+ function hasManifestResourceFields(manifest) {
481
+ return RESOURCE_TYPES.some((resourceType) => manifest[resourceType] !== undefined);
482
+ }
483
+ function isPathInside(parent, child) {
484
+ const relativePath = relative(parent, child);
485
+ return (relativePath !== "" && relativePath !== ".." && !relativePath.startsWith(`..${sep}`) && !isAbsolute(relativePath));
486
+ }
487
+ function resolvePackageChangelogPath(packageRoot, manifest) {
488
+ const changelogPath = manifest?.changelogPath ?? "CHANGELOG.md";
489
+ if (!changelogPath)
490
+ return undefined;
491
+ const resolvedPath = resolve(packageRoot, changelogPath);
492
+ if (!existsSync(resolvedPath))
493
+ return undefined;
494
+ // Containment is a security decision: compare fully resolved real paths, never a partial resolution.
495
+ const canonicalPackageRoot = realPathStrict(packageRoot);
496
+ const canonicalChangelogPath = realPathStrict(resolvedPath);
497
+ if (!canonicalPackageRoot ||
498
+ !canonicalChangelogPath ||
499
+ !isPathInside(canonicalPackageRoot, canonicalChangelogPath)) {
500
+ return undefined;
501
+ }
502
+ try {
503
+ return statSync(resolvedPath).isFile() ? resolvedPath : undefined;
504
+ }
505
+ catch {
506
+ return undefined;
507
+ }
508
+ }
477
509
  function matchesAnyPattern(filePath, patterns, baseDir) {
478
510
  const rel = toPosixPath(relative(baseDir, filePath));
479
511
  const name = basename(filePath);
@@ -721,7 +753,7 @@ export class DefaultPackageManager {
721
753
  }
722
754
  // Dedupe: project scope wins over global for same package identity
723
755
  const packageSources = this.dedupePackages(allPackages);
724
- await this.resolvePackageSources(packageSources, accumulator, onMissing);
756
+ const installFailures = await this.resolvePackageSources(packageSources, accumulator, onMissing);
725
757
  const globalBaseDir = this.agentDir;
726
758
  const projectBaseDir = join(this.cwd, CONFIG_DIR_NAME);
727
759
  for (const resourceType of RESOURCE_TYPES) {
@@ -747,7 +779,7 @@ export class DefaultPackageManager {
747
779
  const projectEnabled = applyAutoloadDisabledPatterns([path], getOverridePatterns(projectSettings.extensions ?? []), projectBaseDir).get(path);
748
780
  this.addResource(accumulator.extensions, path, { source: "builtin", scope: projectEnabled === undefined ? "user" : "project", origin: "top-level" }, projectEnabled ?? isEnabledByOverrides(path, globalSettings.extensions ?? [], globalBaseDir));
749
781
  }
750
- return this.toResolvedPaths(accumulator);
782
+ return { ...this.toResolvedPaths(accumulator), installFailures };
751
783
  }
752
784
  async resolveExtensionSources(sources, options) {
753
785
  const accumulator = this.createAccumulator();
@@ -759,8 +791,8 @@ export class DefaultPackageManager {
759
791
  const packageSources = sources
760
792
  .filter((source) => !source.startsWith(BUILTIN_PATH_PREFIX))
761
793
  .map((source) => ({ pkg: source, scope }));
762
- await this.resolvePackageSources(packageSources, accumulator);
763
- return this.toResolvedPaths(accumulator);
794
+ const installFailures = await this.resolvePackageSources(packageSources, accumulator);
795
+ return { ...this.toResolvedPaths(accumulator), installFailures };
764
796
  }
765
797
  listConfiguredPackages() {
766
798
  const globalSettings = this.settingsManager.getGlobalSettings();
@@ -883,17 +915,18 @@ export class DefaultPackageManager {
883
915
  gitCandidates.push({ ...entry, parsed });
884
916
  }
885
917
  }
886
- const npmCheckTasks = npmCandidates.map((entry) => async () => ({
887
- entry,
888
- shouldUpdate: await this.shouldUpdateNpmSource(entry.parsed, entry.scope),
889
- }));
918
+ const npmCheckTasks = npmCandidates.map((entry) => async () => {
919
+ const check = await this.shouldUpdateNpmSource(entry.parsed, entry.scope);
920
+ return {
921
+ entry: { ...entry, installedVersion: check.installedVersion, targetVersion: check.targetVersion },
922
+ shouldUpdate: check.shouldUpdate,
923
+ };
924
+ });
890
925
  const npmCheckResults = await this.runWithConcurrency(npmCheckTasks, UPDATE_CHECK_CONCURRENCY);
891
926
  const userNpmUpdates = [];
892
927
  const projectNpmUpdates = [];
893
- for (const result of npmCheckResults) {
894
- if (!result.shouldUpdate) {
895
- continue;
896
- }
928
+ const npmUpdates = npmCheckResults.filter((result) => result.shouldUpdate);
929
+ for (const result of npmUpdates) {
897
930
  if (result.entry.scope === "user") {
898
931
  userNpmUpdates.push(result.entry);
899
932
  }
@@ -908,27 +941,73 @@ export class DefaultPackageManager {
908
941
  if (projectNpmUpdates.length > 0) {
909
942
  tasks.push(this.updateNpmBatch(projectNpmUpdates, "project"));
910
943
  }
944
+ const gitUpdates = [];
911
945
  if (gitCandidates.length > 0) {
912
946
  const gitTasks = gitCandidates.map((entry) => async () => this.withProgress("update", entry.source, `Updating ${entry.source}...`, async () => {
947
+ const targetDir = this.getGitInstallPath(entry.parsed, entry.scope);
948
+ const from = await this.getGitHead(targetDir);
913
949
  await this.updateGit(entry.parsed, entry.scope);
950
+ const to = await this.getGitHead(targetDir);
951
+ if (from !== to) {
952
+ gitUpdates.push({ source: entry.source, type: "git", scope: entry.scope, from, to });
953
+ }
914
954
  }));
915
955
  tasks.push(this.runWithConcurrency(gitTasks, GIT_UPDATE_CONCURRENCY).then(() => { }));
916
956
  }
917
957
  await Promise.all(tasks);
958
+ const updated = [];
959
+ for (const { entry } of npmUpdates) {
960
+ const installedPath = this.getManagedNpmInstallPath(entry.parsed, entry.scope);
961
+ const to = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
962
+ if (to !== entry.installedVersion) {
963
+ updated.push({ source: entry.source, type: "npm", scope: entry.scope, from: entry.installedVersion, to });
964
+ }
965
+ }
966
+ // Keep git results in configured order, independent of completion order.
967
+ for (const entry of gitCandidates) {
968
+ const update = gitUpdates.find((u) => u.source === entry.source && u.scope === entry.scope);
969
+ if (update)
970
+ updated.push(update);
971
+ }
972
+ // Report each changed package, e.g. "npm:foo 1.2.0 -> 1.3.0".
973
+ for (const pkg of updated) {
974
+ const format = (value) => value === undefined ? "(none)" : pkg.type === "git" ? value.slice(0, 7) : value;
975
+ const scope = pkg.scope === "project" ? " (project)" : "";
976
+ this.emitProgress({
977
+ type: "result",
978
+ action: "update",
979
+ source: pkg.source,
980
+ message: `${pkg.source}${scope} ${format(pkg.from)} -> ${format(pkg.to)}`,
981
+ });
982
+ }
983
+ }
984
+ async getGitHead(targetDir) {
985
+ if (!existsSync(targetDir))
986
+ return undefined;
987
+ try {
988
+ const head = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
989
+ cwd: targetDir,
990
+ timeoutMs: NETWORK_TIMEOUT_MS,
991
+ });
992
+ return head.trim() || undefined;
993
+ }
994
+ catch {
995
+ return undefined;
996
+ }
918
997
  }
919
998
  async shouldUpdateNpmSource(source, scope) {
920
999
  const installedPath = this.getManagedNpmInstallPath(source, scope);
921
1000
  const installedVersion = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
922
1001
  if (!installedVersion) {
923
- return true;
1002
+ return { shouldUpdate: true };
924
1003
  }
925
1004
  try {
926
1005
  const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range);
927
- return gt(targetVersion, installedVersion);
1006
+ return { shouldUpdate: gt(targetVersion, installedVersion), installedVersion, targetVersion };
928
1007
  }
929
1008
  catch {
930
1009
  // Preserve existing update behavior when version lookup fails.
931
- return true;
1010
+ return { shouldUpdate: true, installedVersion };
932
1011
  }
933
1012
  }
934
1013
  async updateNpmBatch(sources, scope) {
@@ -941,6 +1020,29 @@ export class DefaultPackageManager {
941
1020
  await this.withProgress("update", sourceLabel, message, async () => {
942
1021
  await this.installNpmBatch(specs, scope);
943
1022
  });
1023
+ this.reportUnchangedNpmUpdates(sources, scope);
1024
+ }
1025
+ /**
1026
+ * npm can resolve stale registry metadata shortly after a publish and install the old
1027
+ * version without an error. Warn when an announced update did not change the installed version.
1028
+ */
1029
+ reportUnchangedNpmUpdates(sources, scope) {
1030
+ for (const entry of sources) {
1031
+ if (!entry.installedVersion || !entry.targetVersion) {
1032
+ continue;
1033
+ }
1034
+ const installedPath = this.getManagedNpmInstallPath(entry.parsed, scope);
1035
+ const versionAfter = this.getInstalledNpmVersion(installedPath);
1036
+ if (versionAfter !== entry.installedVersion) {
1037
+ continue;
1038
+ }
1039
+ this.emitProgress({
1040
+ type: "progress",
1041
+ action: "update",
1042
+ source: entry.source,
1043
+ message: `${entry.source} is still ${versionAfter} (registry reports ${entry.targetVersion}); npm registry metadata may be stale, try again in a few minutes`,
1044
+ });
1045
+ }
944
1046
  }
945
1047
  async installNpmBatch(specs, scope) {
946
1048
  const installRoot = this.getNpmInstallRoot(scope, false);
@@ -1004,6 +1106,7 @@ export class DefaultPackageManager {
1004
1106
  return results.filter((result) => result !== undefined);
1005
1107
  }
1006
1108
  async resolvePackageSources(sources, accumulator, onMissing) {
1109
+ const installFailures = [];
1007
1110
  for (const { pkg, scope } of sources) {
1008
1111
  const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
1009
1112
  const filter = typeof pkg === "object" ? pkg : undefined;
@@ -1020,21 +1123,46 @@ export class DefaultPackageManager {
1020
1123
  const installMissing = async () => {
1021
1124
  if (isOfflineModeEnabled())
1022
1125
  return false;
1023
- if (!onMissing) {
1126
+ if (onMissing) {
1127
+ const action = await onMissing(resolvedSource);
1128
+ if (action === "skip")
1129
+ return false;
1130
+ if (action === "error")
1131
+ throw new Error(`Missing source: ${resolvedSource}`);
1132
+ }
1133
+ // A source that cannot be installed (no network, missing package, failing git prepare step)
1134
+ // must not abort startup. Skip its resources, like offline mode does, and report the failure.
1135
+ try {
1024
1136
  await this.installParsedSource(parsed, resolvedScope);
1025
1137
  return true;
1026
1138
  }
1027
- const action = await onMissing(resolvedSource);
1028
- if (action === "skip")
1139
+ catch (error) {
1140
+ installFailures.push({
1141
+ source: resolvedSource,
1142
+ scope: resolvedScope,
1143
+ message: error instanceof Error ? error.message : String(error),
1144
+ });
1029
1145
  return false;
1030
- if (action === "error")
1031
- throw new Error(`Missing source: ${resolvedSource}`);
1032
- await this.installParsedSource(parsed, resolvedScope);
1033
- return true;
1146
+ }
1034
1147
  };
1035
1148
  if (parsed.type === "npm") {
1036
1149
  let installedPath = this.getNpmInstallPath(parsed, resolvedScope);
1037
1150
  const needsInstall = !existsSync(installedPath) || !(await this.installedNpmMatchesConfiguredVersion(parsed, installedPath));
1151
+ if (!needsInstall &&
1152
+ resolvedScope === "temporary" &&
1153
+ !parsed.pinned &&
1154
+ (await this.npmHasAvailableUpdate(parsed, installedPath))) {
1155
+ // Temporary (-e) sources have no `draht update` path, so refresh unpinned ones on load like
1156
+ // temporary git sources. Like `draht update`, install `name@latest` for unversioned specs because a bare
1157
+ // `npm install name` keeps the range already saved in the temporary package.json.
1158
+ const spec = parsed.version ? parsed.spec : `${parsed.name}@latest`;
1159
+ try {
1160
+ await this.installNpm({ ...parsed, spec }, resolvedScope, true);
1161
+ }
1162
+ catch {
1163
+ // Keep the cached install if the refresh fails.
1164
+ }
1165
+ }
1038
1166
  if (needsInstall) {
1039
1167
  const installed = await installMissing();
1040
1168
  if (!installed)
@@ -1053,14 +1181,15 @@ export class DefaultPackageManager {
1053
1181
  if (!installed)
1054
1182
  continue;
1055
1183
  }
1056
- else if (resolvedScope === "temporary" && !parsed.pinned && !isOfflineModeEnabled()) {
1057
- await this.refreshTemporaryGitSource(parsed, resolvedSource);
1184
+ else if (resolvedScope === "temporary" && !isOfflineModeEnabled()) {
1185
+ await this.refreshTemporaryGitSource(parsed, resolvedSource, installedPath);
1058
1186
  }
1059
1187
  metadata.baseDir = installedPath;
1060
1188
  metadata.packageRoot = installedPath;
1061
1189
  this.collectPackageResources(installedPath, accumulator, filter, metadata);
1062
1190
  }
1063
1191
  }
1192
+ return installFailures;
1064
1193
  }
1065
1194
  findAutoloadDeltaBase(pkg, scope, sources) {
1066
1195
  if (scope !== "project" || typeof pkg !== "object" || pkg.autoload !== false)
@@ -1116,7 +1245,7 @@ export class DefaultPackageManager {
1116
1245
  if (parsed.type === "git") {
1117
1246
  return `git:${parsed.host}/${parsed.path}`;
1118
1247
  }
1119
- return `local:${this.resolvePath(parsed.path)}`;
1248
+ return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
1120
1249
  }
1121
1250
  getSourceMatchKeyForSettings(source, scope) {
1122
1251
  const parsed = this.parseSource(source);
@@ -1127,7 +1256,7 @@ export class DefaultPackageManager {
1127
1256
  return `git:${parsed.host}/${parsed.path}`;
1128
1257
  }
1129
1258
  const baseDir = this.getBaseDirForScope(scope);
1130
- return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
1259
+ return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
1131
1260
  }
1132
1261
  buildNoMatchingPackageMessage(source, configuredPackages) {
1133
1262
  const suggestion = this.findSuggestedConfiguredSource(source, configuredPackages);
@@ -1406,9 +1535,9 @@ export class DefaultPackageManager {
1406
1535
  }
1407
1536
  if (scope) {
1408
1537
  const baseDir = this.getBaseDirForScope(scope);
1409
- return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
1538
+ return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
1410
1539
  }
1411
- return `local:${this.resolvePath(parsed.path)}`;
1540
+ return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
1412
1541
  }
1413
1542
  /**
1414
1543
  * Dedupe packages: if same package identity appears in both global and project,
@@ -1499,7 +1628,7 @@ export class DefaultPackageManager {
1499
1628
  "--config.strict-dep-builds=false",
1500
1629
  ];
1501
1630
  case "npm":
1502
- return ["install", "--omit=dev", "--legacy-peer-deps"];
1631
+ return ["install", "--omit=dev", "--legacy-peer-deps", "--no-audit", "--no-fund"];
1503
1632
  default:
1504
1633
  return ["install"];
1505
1634
  }
@@ -1508,7 +1637,9 @@ export class DefaultPackageManager {
1508
1637
  const npmCommand = this.getNpmCommand();
1509
1638
  return this.runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);
1510
1639
  }
1511
- getNpmInstallArgs(specs, installRoot) {
1640
+ getNpmInstallArgs(specs, root) {
1641
+ // npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
1642
+ const installRoot = existsSync(root) ? realpathSync(root) : root;
1512
1643
  const packageManagerName = this.getPackageManagerName();
1513
1644
  // Extension packages run inside pi and resolve pi APIs through loader aliases/virtual modules.
1514
1645
  // Disable peer dependency resolution for managed installs (npm's --legacy-peer-deps, and
@@ -1528,7 +1659,8 @@ export class DefaultPackageManager {
1528
1659
  "--config.strict-dep-builds=false",
1529
1660
  ];
1530
1661
  }
1531
- return ["install", ...specs, "--prefix", installRoot, "--legacy-peer-deps"];
1662
+ // npm audit fix would run without --legacy-peer-deps and install draht peers, so skip audit advice.
1663
+ return ["install", ...specs, "--prefix", installRoot, "--legacy-peer-deps", "--no-audit", "--no-fund"];
1532
1664
  }
1533
1665
  async installNpm(source, scope, temporary) {
1534
1666
  const installRoot = this.getNpmInstallRoot(scope, temporary);
@@ -1536,10 +1668,12 @@ export class DefaultPackageManager {
1536
1668
  await this.runNpmCommand(this.getNpmInstallArgs([source.spec], installRoot));
1537
1669
  }
1538
1670
  async uninstallNpm(source, scope) {
1539
- const installRoot = this.getNpmInstallRoot(scope, false);
1540
- if (!existsSync(installRoot)) {
1671
+ const root = this.getNpmInstallRoot(scope, false);
1672
+ if (!existsSync(root)) {
1541
1673
  return;
1542
1674
  }
1675
+ // npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
1676
+ const installRoot = realpathSync(root);
1543
1677
  const packageManagerName = this.getPackageManagerName();
1544
1678
  if (packageManagerName === "bun") {
1545
1679
  await this.runNpmCommand(["uninstall", source.name, "--cwd", installRoot]);
@@ -1547,7 +1681,7 @@ export class DefaultPackageManager {
1547
1681
  }
1548
1682
  const args = ["uninstall", source.name, "--prefix", installRoot];
1549
1683
  if (packageManagerName !== "pnpm") {
1550
- args.push("--legacy-peer-deps");
1684
+ args.push("--legacy-peer-deps", "--no-audit", "--no-fund");
1551
1685
  }
1552
1686
  await this.runNpmCommand(args);
1553
1687
  }
@@ -1629,20 +1763,31 @@ export class DefaultPackageManager {
1629
1763
  return join(dirname(targetDir), `.${basename(targetDir)}.pi-update-incomplete`);
1630
1764
  }
1631
1765
  async cleanAndInstallGitDependencies(targetDir, markerPath) {
1632
- // Clean untracked files (extensions should be pristine). If this fails after
1633
- // deleting dependencies, repair them so the existing extension still loads.
1766
+ // Clean untracked files (extensions should be pristine). On Windows, files loaded by
1767
+ // another process (e.g. a native module of this extension in another draht session) cannot
1768
+ // be deleted, so git clean fails. Still install dependencies for the new commit, but keep
1769
+ // the marker so the next update retries the clean.
1770
+ let cleaned = true;
1634
1771
  try {
1635
1772
  await this.runCommand("git", ["clean", "-fdx"], { cwd: targetDir });
1636
1773
  }
1637
1774
  catch (error) {
1638
- await this.repairMissingGitDependencies(targetDir).catch(() => { });
1639
- throw error;
1775
+ cleaned = false;
1776
+ const reason = error instanceof Error ? error.message : String(error);
1777
+ this.emitProgress({
1778
+ type: "progress",
1779
+ action: "update",
1780
+ source: targetDir,
1781
+ message: `Could not remove all untracked files in ${targetDir} (${reason}). Files may be in use by another draht session; close it and run the update again.`,
1782
+ });
1640
1783
  }
1641
1784
  const packageJsonPath = join(targetDir, "package.json");
1642
1785
  if (existsSync(packageJsonPath)) {
1643
1786
  await this.runNpmCommand(this.getGitDependencyInstallArgs(), { cwd: targetDir });
1644
1787
  }
1645
- rmSync(markerPath, { force: true });
1788
+ if (cleaned) {
1789
+ rmSync(markerPath, { force: true });
1790
+ }
1646
1791
  }
1647
1792
  async ensureGitRef(targetDir, fetchArgs, ref) {
1648
1793
  // Fetch only the ref we will reset to, avoiding unrelated branch/tag noise.
@@ -1670,11 +1815,22 @@ export class DefaultPackageManager {
1670
1815
  await this.runCommand("git", ["reset", "--hard", commitRef], { cwd: targetDir });
1671
1816
  await this.cleanAndInstallGitDependencies(targetDir, markerPath);
1672
1817
  }
1673
- async refreshTemporaryGitSource(source, sourceStr) {
1818
+ async refreshTemporaryGitSource(source, sourceStr, installedPath) {
1674
1819
  if (isOfflineModeEnabled()) {
1675
1820
  return;
1676
1821
  }
1677
1822
  try {
1823
+ // A ref can name a moving branch, so refresh refs too. Skip the network call only when the
1824
+ // ref is a commit hash that is already checked out.
1825
+ if (source.ref && /^[0-9a-f]{7,64}$/i.test(source.ref)) {
1826
+ const head = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
1827
+ cwd: installedPath,
1828
+ timeoutMs: NETWORK_TIMEOUT_MS,
1829
+ });
1830
+ if (head.trim().toLowerCase().startsWith(source.ref.toLowerCase())) {
1831
+ return;
1832
+ }
1833
+ }
1678
1834
  await this.withProgress("pull", sourceStr, `Refreshing ${sourceStr}...`, async () => {
1679
1835
  await this.updateGit(source, "temporary");
1680
1836
  });
@@ -1852,6 +2008,14 @@ export class DefaultPackageManager {
1852
2008
  return resolvePath(input, baseDir, { homeDir: getHomeDir(), trim: true });
1853
2009
  }
1854
2010
  collectPackageResources(packageRoot, accumulator, filter, metadata) {
2011
+ const manifest = readPiManifest(join(packageRoot, "package.json"));
2012
+ const changelogPath = resolvePackageChangelogPath(packageRoot, manifest);
2013
+ if (changelogPath) {
2014
+ metadata.changelogPath = changelogPath;
2015
+ }
2016
+ else {
2017
+ delete metadata.changelogPath;
2018
+ }
1855
2019
  if (filter) {
1856
2020
  for (const resourceType of RESOURCE_TYPES) {
1857
2021
  const patterns = filter[resourceType];
@@ -1868,8 +2032,7 @@ export class DefaultPackageManager {
1868
2032
  }
1869
2033
  return true;
1870
2034
  }
1871
- const manifest = this.readPiManifest(packageRoot);
1872
- if (manifest) {
2035
+ if (manifest && hasManifestResourceFields(manifest)) {
1873
2036
  for (const resourceType of RESOURCE_TYPES) {
1874
2037
  const entries = manifest[resourceType];
1875
2038
  this.addManifestEntries(entries, packageRoot, resourceType, this.getTargetMap(accumulator, resourceType), metadata);
@@ -2035,7 +2198,7 @@ export class DefaultPackageManager {
2035
2198
  const canonicalUserAgentsSkillsDir = realHome === undefined ? undefined : join(realHome, ".agents", "skills");
2036
2199
  const projectTrusted = this.settingsManager.isProjectTrusted();
2037
2200
  const projectAgentsSkillDirs = projectTrusted
2038
- ? collectAncestorAgentsSkillDirs(this.cwdSpelling).filter((dir) => dir !== canonicalUserAgentsSkillsDir)
2201
+ ? collectAncestorAgentsSkillDirs(this.cwdSpelling).filter((dir) => canonicalUserAgentsSkillsDir === undefined || !pathsEqual(dir, canonicalUserAgentsSkillsDir))
2039
2202
  : [];
2040
2203
  const addResources = (resourceType, paths, metadata, overrides, baseDir) => {
2041
2204
  const target = this.getTargetMap(accumulator, resourceType);
@@ -2136,10 +2299,10 @@ export class DefaultPackageManager {
2136
2299
  resolved.sort((a, b) => resourcePrecedenceRank(a.metadata) - resourcePrecedenceRank(b.metadata));
2137
2300
  const seen = new Set();
2138
2301
  return resolved.filter((entry) => {
2139
- const canonicalPath = comparablePath(entry.path);
2140
- if (seen.has(canonicalPath))
2302
+ const pathKey = getResourcePathKey(entry.path);
2303
+ if (seen.has(pathKey))
2141
2304
  return false;
2142
- seen.add(canonicalPath);
2305
+ seen.add(pathKey);
2143
2306
  return true;
2144
2307
  });
2145
2308
  };