@caupulican/pi-adaptative 0.80.8 → 0.80.10

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 (786) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +0 -0
  3. package/dist/bun/cli.d.ts +0 -0
  4. package/dist/bun/cli.d.ts.map +0 -0
  5. package/dist/bun/cli.js +0 -0
  6. package/dist/bun/cli.js.map +0 -0
  7. package/dist/bun/register-bedrock.d.ts +0 -0
  8. package/dist/bun/register-bedrock.d.ts.map +0 -0
  9. package/dist/bun/register-bedrock.js +0 -0
  10. package/dist/bun/register-bedrock.js.map +0 -0
  11. package/dist/bun/restore-sandbox-env.d.ts +0 -0
  12. package/dist/bun/restore-sandbox-env.d.ts.map +0 -0
  13. package/dist/bun/restore-sandbox-env.js +0 -0
  14. package/dist/bun/restore-sandbox-env.js.map +0 -0
  15. package/dist/cli/args.d.ts +1 -0
  16. package/dist/cli/args.d.ts.map +1 -1
  17. package/dist/cli/args.js +16 -4
  18. package/dist/cli/args.js.map +1 -1
  19. package/dist/cli/config-selector.d.ts +0 -0
  20. package/dist/cli/config-selector.d.ts.map +0 -0
  21. package/dist/cli/config-selector.js +0 -0
  22. package/dist/cli/config-selector.js.map +0 -0
  23. package/dist/cli/file-processor.d.ts +0 -0
  24. package/dist/cli/file-processor.d.ts.map +0 -0
  25. package/dist/cli/file-processor.js +0 -0
  26. package/dist/cli/file-processor.js.map +0 -0
  27. package/dist/cli/initial-message.d.ts +0 -0
  28. package/dist/cli/initial-message.d.ts.map +0 -0
  29. package/dist/cli/initial-message.js +0 -0
  30. package/dist/cli/initial-message.js.map +0 -0
  31. package/dist/cli/list-models.d.ts +0 -0
  32. package/dist/cli/list-models.d.ts.map +0 -0
  33. package/dist/cli/list-models.js +0 -0
  34. package/dist/cli/list-models.js.map +0 -0
  35. package/dist/cli/session-picker.d.ts +0 -0
  36. package/dist/cli/session-picker.d.ts.map +0 -0
  37. package/dist/cli/session-picker.js +0 -0
  38. package/dist/cli/session-picker.js.map +0 -0
  39. package/dist/cli.d.ts +0 -0
  40. package/dist/cli.d.ts.map +1 -1
  41. package/dist/cli.js +17 -2
  42. package/dist/cli.js.map +1 -1
  43. package/dist/config.d.ts +0 -0
  44. package/dist/config.d.ts.map +1 -1
  45. package/dist/config.js +9 -1
  46. package/dist/config.js.map +1 -1
  47. package/dist/core/agent-session-runtime.d.ts +0 -0
  48. package/dist/core/agent-session-runtime.d.ts.map +0 -0
  49. package/dist/core/agent-session-runtime.js +0 -0
  50. package/dist/core/agent-session-runtime.js.map +0 -0
  51. package/dist/core/agent-session-services.d.ts +0 -0
  52. package/dist/core/agent-session-services.d.ts.map +0 -0
  53. package/dist/core/agent-session-services.js +0 -0
  54. package/dist/core/agent-session-services.js.map +0 -0
  55. package/dist/core/agent-session.d.ts +0 -0
  56. package/dist/core/agent-session.d.ts.map +0 -0
  57. package/dist/core/agent-session.js +0 -0
  58. package/dist/core/agent-session.js.map +0 -0
  59. package/dist/core/auth-guidance.d.ts +0 -0
  60. package/dist/core/auth-guidance.d.ts.map +0 -0
  61. package/dist/core/auth-guidance.js +0 -0
  62. package/dist/core/auth-guidance.js.map +0 -0
  63. package/dist/core/auth-storage.d.ts +0 -0
  64. package/dist/core/auth-storage.d.ts.map +1 -1
  65. package/dist/core/auth-storage.js +4 -3
  66. package/dist/core/auth-storage.js.map +1 -1
  67. package/dist/core/bash-executor.d.ts +0 -0
  68. package/dist/core/bash-executor.d.ts.map +0 -0
  69. package/dist/core/bash-executor.js +0 -0
  70. package/dist/core/bash-executor.js.map +0 -0
  71. package/dist/core/compaction/branch-summarization.d.ts +0 -0
  72. package/dist/core/compaction/branch-summarization.d.ts.map +0 -0
  73. package/dist/core/compaction/branch-summarization.js +0 -0
  74. package/dist/core/compaction/branch-summarization.js.map +0 -0
  75. package/dist/core/compaction/compaction.d.ts +0 -0
  76. package/dist/core/compaction/compaction.d.ts.map +0 -0
  77. package/dist/core/compaction/compaction.js +0 -0
  78. package/dist/core/compaction/compaction.js.map +0 -0
  79. package/dist/core/compaction/index.d.ts +0 -0
  80. package/dist/core/compaction/index.d.ts.map +0 -0
  81. package/dist/core/compaction/index.js +0 -0
  82. package/dist/core/compaction/index.js.map +0 -0
  83. package/dist/core/compaction/utils.d.ts +0 -0
  84. package/dist/core/compaction/utils.d.ts.map +0 -0
  85. package/dist/core/compaction/utils.js +0 -0
  86. package/dist/core/compaction/utils.js.map +0 -0
  87. package/dist/core/defaults.d.ts +0 -0
  88. package/dist/core/defaults.d.ts.map +0 -0
  89. package/dist/core/defaults.js +0 -0
  90. package/dist/core/defaults.js.map +0 -0
  91. package/dist/core/diagnostics.d.ts +0 -0
  92. package/dist/core/diagnostics.d.ts.map +0 -0
  93. package/dist/core/diagnostics.js +0 -0
  94. package/dist/core/diagnostics.js.map +0 -0
  95. package/dist/core/event-bus.d.ts +0 -0
  96. package/dist/core/event-bus.d.ts.map +0 -0
  97. package/dist/core/event-bus.js +0 -0
  98. package/dist/core/event-bus.js.map +0 -0
  99. package/dist/core/exec.d.ts +0 -0
  100. package/dist/core/exec.d.ts.map +0 -0
  101. package/dist/core/exec.js +0 -0
  102. package/dist/core/exec.js.map +0 -0
  103. package/dist/core/export-html/ansi-to-html.d.ts +0 -0
  104. package/dist/core/export-html/ansi-to-html.d.ts.map +0 -0
  105. package/dist/core/export-html/ansi-to-html.js +0 -0
  106. package/dist/core/export-html/ansi-to-html.js.map +0 -0
  107. package/dist/core/export-html/index.d.ts +0 -0
  108. package/dist/core/export-html/index.d.ts.map +0 -0
  109. package/dist/core/export-html/index.js +0 -0
  110. package/dist/core/export-html/index.js.map +0 -0
  111. package/dist/core/export-html/template.css +0 -0
  112. package/dist/core/export-html/template.html +0 -0
  113. package/dist/core/export-html/template.js +19 -6
  114. package/dist/core/export-html/tool-renderer.d.ts +0 -0
  115. package/dist/core/export-html/tool-renderer.d.ts.map +0 -0
  116. package/dist/core/export-html/tool-renderer.js +0 -0
  117. package/dist/core/export-html/tool-renderer.js.map +0 -0
  118. package/dist/core/export-html/vendor/highlight.min.js +0 -0
  119. package/dist/core/export-html/vendor/marked.min.js +0 -0
  120. package/dist/core/extensions/index.d.ts +0 -0
  121. package/dist/core/extensions/index.d.ts.map +0 -0
  122. package/dist/core/extensions/index.js +0 -0
  123. package/dist/core/extensions/index.js.map +0 -0
  124. package/dist/core/extensions/loader.d.ts +0 -0
  125. package/dist/core/extensions/loader.d.ts.map +1 -1
  126. package/dist/core/extensions/loader.js +8 -0
  127. package/dist/core/extensions/loader.js.map +1 -1
  128. package/dist/core/extensions/runner.d.ts +0 -0
  129. package/dist/core/extensions/runner.d.ts.map +0 -0
  130. package/dist/core/extensions/runner.js +0 -0
  131. package/dist/core/extensions/runner.js.map +0 -0
  132. package/dist/core/extensions/types.d.ts +0 -0
  133. package/dist/core/extensions/types.d.ts.map +0 -0
  134. package/dist/core/extensions/types.js +0 -0
  135. package/dist/core/extensions/types.js.map +0 -0
  136. package/dist/core/extensions/wrapper.d.ts +0 -0
  137. package/dist/core/extensions/wrapper.d.ts.map +0 -0
  138. package/dist/core/extensions/wrapper.js +0 -0
  139. package/dist/core/extensions/wrapper.js.map +0 -0
  140. package/dist/core/footer-data-provider.d.ts +0 -0
  141. package/dist/core/footer-data-provider.d.ts.map +0 -0
  142. package/dist/core/footer-data-provider.js +0 -0
  143. package/dist/core/footer-data-provider.js.map +0 -0
  144. package/dist/core/http-dispatcher.d.ts +0 -0
  145. package/dist/core/http-dispatcher.d.ts.map +0 -0
  146. package/dist/core/http-dispatcher.js +0 -0
  147. package/dist/core/http-dispatcher.js.map +0 -0
  148. package/dist/core/index.d.ts +0 -0
  149. package/dist/core/index.d.ts.map +0 -0
  150. package/dist/core/index.js +0 -0
  151. package/dist/core/index.js.map +0 -0
  152. package/dist/core/keybindings.d.ts +0 -0
  153. package/dist/core/keybindings.d.ts.map +0 -0
  154. package/dist/core/keybindings.js +0 -0
  155. package/dist/core/keybindings.js.map +0 -0
  156. package/dist/core/messages.d.ts +0 -0
  157. package/dist/core/messages.d.ts.map +0 -0
  158. package/dist/core/messages.js +0 -0
  159. package/dist/core/messages.js.map +0 -0
  160. package/dist/core/model-registry.d.ts +0 -0
  161. package/dist/core/model-registry.d.ts.map +0 -0
  162. package/dist/core/model-registry.js +0 -0
  163. package/dist/core/model-registry.js.map +0 -0
  164. package/dist/core/model-resolver.d.ts +0 -0
  165. package/dist/core/model-resolver.d.ts.map +0 -0
  166. package/dist/core/model-resolver.js +0 -0
  167. package/dist/core/model-resolver.js.map +0 -0
  168. package/dist/core/output-guard.d.ts +0 -0
  169. package/dist/core/output-guard.d.ts.map +0 -0
  170. package/dist/core/output-guard.js +0 -0
  171. package/dist/core/output-guard.js.map +0 -0
  172. package/dist/core/package-manager.d.ts +3 -0
  173. package/dist/core/package-manager.d.ts.map +1 -1
  174. package/dist/core/package-manager.js +47 -13
  175. package/dist/core/package-manager.js.map +1 -1
  176. package/dist/core/prompt-templates.d.ts +0 -0
  177. package/dist/core/prompt-templates.d.ts.map +0 -0
  178. package/dist/core/prompt-templates.js +0 -0
  179. package/dist/core/prompt-templates.js.map +0 -0
  180. package/dist/core/provider-display-names.d.ts +0 -0
  181. package/dist/core/provider-display-names.d.ts.map +0 -0
  182. package/dist/core/provider-display-names.js +0 -0
  183. package/dist/core/provider-display-names.js.map +0 -0
  184. package/dist/core/reload-blockers.d.ts +0 -0
  185. package/dist/core/reload-blockers.d.ts.map +0 -0
  186. package/dist/core/reload-blockers.js +0 -0
  187. package/dist/core/reload-blockers.js.map +0 -0
  188. package/dist/core/resolve-config-value.d.ts +0 -0
  189. package/dist/core/resolve-config-value.d.ts.map +0 -0
  190. package/dist/core/resolve-config-value.js +0 -0
  191. package/dist/core/resolve-config-value.js.map +0 -0
  192. package/dist/core/resource-loader.d.ts +1 -0
  193. package/dist/core/resource-loader.d.ts.map +1 -1
  194. package/dist/core/resource-loader.js +30 -22
  195. package/dist/core/resource-loader.js.map +1 -1
  196. package/dist/core/sdk.d.ts +0 -0
  197. package/dist/core/sdk.d.ts.map +1 -1
  198. package/dist/core/sdk.js +5 -3
  199. package/dist/core/sdk.js.map +1 -1
  200. package/dist/core/session-cwd.d.ts +0 -0
  201. package/dist/core/session-cwd.d.ts.map +0 -0
  202. package/dist/core/session-cwd.js +0 -0
  203. package/dist/core/session-cwd.js.map +0 -0
  204. package/dist/core/session-manager.d.ts +0 -0
  205. package/dist/core/session-manager.d.ts.map +0 -0
  206. package/dist/core/session-manager.js +0 -0
  207. package/dist/core/session-manager.js.map +0 -0
  208. package/dist/core/settings-manager.d.ts +10 -2
  209. package/dist/core/settings-manager.d.ts.map +1 -1
  210. package/dist/core/settings-manager.js +71 -30
  211. package/dist/core/settings-manager.js.map +1 -1
  212. package/dist/core/skills.d.ts +0 -0
  213. package/dist/core/skills.d.ts.map +0 -0
  214. package/dist/core/skills.js +0 -0
  215. package/dist/core/skills.js.map +0 -0
  216. package/dist/core/slash-commands.d.ts +0 -0
  217. package/dist/core/slash-commands.d.ts.map +1 -1
  218. package/dist/core/slash-commands.js +1 -0
  219. package/dist/core/slash-commands.js.map +1 -1
  220. package/dist/core/source-info.d.ts +0 -0
  221. package/dist/core/source-info.d.ts.map +0 -0
  222. package/dist/core/source-info.js +0 -0
  223. package/dist/core/source-info.js.map +0 -0
  224. package/dist/core/system-prompt.d.ts +0 -0
  225. package/dist/core/system-prompt.d.ts.map +0 -0
  226. package/dist/core/system-prompt.js +0 -0
  227. package/dist/core/system-prompt.js.map +0 -0
  228. package/dist/core/telemetry.d.ts +0 -0
  229. package/dist/core/telemetry.d.ts.map +0 -0
  230. package/dist/core/telemetry.js +0 -0
  231. package/dist/core/telemetry.js.map +0 -0
  232. package/dist/core/timings.d.ts +0 -0
  233. package/dist/core/timings.d.ts.map +0 -0
  234. package/dist/core/timings.js +0 -0
  235. package/dist/core/timings.js.map +0 -0
  236. package/dist/core/tools/bash.d.ts +0 -0
  237. package/dist/core/tools/bash.d.ts.map +0 -0
  238. package/dist/core/tools/bash.js +0 -0
  239. package/dist/core/tools/bash.js.map +0 -0
  240. package/dist/core/tools/edit-diff.d.ts +0 -0
  241. package/dist/core/tools/edit-diff.d.ts.map +0 -0
  242. package/dist/core/tools/edit-diff.js +0 -0
  243. package/dist/core/tools/edit-diff.js.map +0 -0
  244. package/dist/core/tools/edit.d.ts +0 -0
  245. package/dist/core/tools/edit.d.ts.map +0 -0
  246. package/dist/core/tools/edit.js +0 -0
  247. package/dist/core/tools/edit.js.map +0 -0
  248. package/dist/core/tools/file-encoding-policy.d.ts +0 -0
  249. package/dist/core/tools/file-encoding-policy.d.ts.map +0 -0
  250. package/dist/core/tools/file-encoding-policy.js +0 -0
  251. package/dist/core/tools/file-encoding-policy.js.map +0 -0
  252. package/dist/core/tools/file-mutation-queue.d.ts +0 -0
  253. package/dist/core/tools/file-mutation-queue.d.ts.map +0 -0
  254. package/dist/core/tools/file-mutation-queue.js +0 -0
  255. package/dist/core/tools/file-mutation-queue.js.map +0 -0
  256. package/dist/core/tools/find.d.ts +0 -0
  257. package/dist/core/tools/find.d.ts.map +0 -0
  258. package/dist/core/tools/find.js +0 -0
  259. package/dist/core/tools/find.js.map +0 -0
  260. package/dist/core/tools/git-filter.d.ts +0 -0
  261. package/dist/core/tools/git-filter.d.ts.map +0 -0
  262. package/dist/core/tools/git-filter.js +0 -0
  263. package/dist/core/tools/git-filter.js.map +0 -0
  264. package/dist/core/tools/grep.d.ts +0 -0
  265. package/dist/core/tools/grep.d.ts.map +0 -0
  266. package/dist/core/tools/grep.js +0 -0
  267. package/dist/core/tools/grep.js.map +0 -0
  268. package/dist/core/tools/index.d.ts +0 -0
  269. package/dist/core/tools/index.d.ts.map +0 -0
  270. package/dist/core/tools/index.js +0 -0
  271. package/dist/core/tools/index.js.map +0 -0
  272. package/dist/core/tools/ls.d.ts +0 -0
  273. package/dist/core/tools/ls.d.ts.map +0 -0
  274. package/dist/core/tools/ls.js +0 -0
  275. package/dist/core/tools/ls.js.map +0 -0
  276. package/dist/core/tools/output-accumulator.d.ts +0 -0
  277. package/dist/core/tools/output-accumulator.d.ts.map +0 -0
  278. package/dist/core/tools/output-accumulator.js +0 -0
  279. package/dist/core/tools/output-accumulator.js.map +0 -0
  280. package/dist/core/tools/path-utils.d.ts +0 -0
  281. package/dist/core/tools/path-utils.d.ts.map +0 -0
  282. package/dist/core/tools/path-utils.js +0 -0
  283. package/dist/core/tools/path-utils.js.map +0 -0
  284. package/dist/core/tools/read.d.ts +0 -0
  285. package/dist/core/tools/read.d.ts.map +0 -0
  286. package/dist/core/tools/read.js +0 -0
  287. package/dist/core/tools/read.js.map +0 -0
  288. package/dist/core/tools/render-utils.d.ts +0 -0
  289. package/dist/core/tools/render-utils.d.ts.map +0 -0
  290. package/dist/core/tools/render-utils.js +0 -0
  291. package/dist/core/tools/render-utils.js.map +0 -0
  292. package/dist/core/tools/tool-definition-wrapper.d.ts +0 -0
  293. package/dist/core/tools/tool-definition-wrapper.d.ts.map +0 -0
  294. package/dist/core/tools/tool-definition-wrapper.js +0 -0
  295. package/dist/core/tools/tool-definition-wrapper.js.map +0 -0
  296. package/dist/core/tools/truncate.d.ts +0 -0
  297. package/dist/core/tools/truncate.d.ts.map +0 -0
  298. package/dist/core/tools/truncate.js +0 -0
  299. package/dist/core/tools/truncate.js.map +0 -0
  300. package/dist/core/tools/write.d.ts +0 -0
  301. package/dist/core/tools/write.d.ts.map +0 -0
  302. package/dist/core/tools/write.js +0 -0
  303. package/dist/core/tools/write.js.map +0 -0
  304. package/dist/core/trust-manager.d.ts +9 -0
  305. package/dist/core/trust-manager.d.ts.map +1 -0
  306. package/dist/core/trust-manager.js +134 -0
  307. package/dist/core/trust-manager.js.map +1 -0
  308. package/dist/index.d.ts +3 -2
  309. package/dist/index.d.ts.map +1 -1
  310. package/dist/index.js +2 -1
  311. package/dist/index.js.map +1 -1
  312. package/dist/main.d.ts +0 -0
  313. package/dist/main.d.ts.map +1 -1
  314. package/dist/main.js +65 -6
  315. package/dist/main.js.map +1 -1
  316. package/dist/migrations.d.ts +0 -0
  317. package/dist/migrations.d.ts.map +0 -0
  318. package/dist/migrations.js +0 -0
  319. package/dist/migrations.js.map +0 -0
  320. package/dist/modes/index.d.ts +0 -0
  321. package/dist/modes/index.d.ts.map +0 -0
  322. package/dist/modes/index.js +0 -0
  323. package/dist/modes/index.js.map +0 -0
  324. package/dist/modes/interactive/assets/clankolas.png +0 -0
  325. package/dist/modes/interactive/components/armin.d.ts +0 -0
  326. package/dist/modes/interactive/components/armin.d.ts.map +0 -0
  327. package/dist/modes/interactive/components/armin.js +0 -0
  328. package/dist/modes/interactive/components/armin.js.map +0 -0
  329. package/dist/modes/interactive/components/assistant-message.d.ts +0 -0
  330. package/dist/modes/interactive/components/assistant-message.d.ts.map +0 -0
  331. package/dist/modes/interactive/components/assistant-message.js +0 -0
  332. package/dist/modes/interactive/components/assistant-message.js.map +0 -0
  333. package/dist/modes/interactive/components/bash-execution.d.ts +0 -0
  334. package/dist/modes/interactive/components/bash-execution.d.ts.map +0 -0
  335. package/dist/modes/interactive/components/bash-execution.js +0 -0
  336. package/dist/modes/interactive/components/bash-execution.js.map +0 -0
  337. package/dist/modes/interactive/components/bordered-loader.d.ts +0 -0
  338. package/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -0
  339. package/dist/modes/interactive/components/bordered-loader.js +0 -0
  340. package/dist/modes/interactive/components/bordered-loader.js.map +0 -0
  341. package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -0
  342. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  343. package/dist/modes/interactive/components/branch-summary-message.js +2 -2
  344. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  345. package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -0
  346. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  347. package/dist/modes/interactive/components/compaction-summary-message.js +2 -2
  348. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  349. package/dist/modes/interactive/components/config-selector.d.ts +0 -0
  350. package/dist/modes/interactive/components/config-selector.d.ts.map +0 -0
  351. package/dist/modes/interactive/components/config-selector.js +0 -0
  352. package/dist/modes/interactive/components/config-selector.js.map +0 -0
  353. package/dist/modes/interactive/components/countdown-timer.d.ts +0 -0
  354. package/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -0
  355. package/dist/modes/interactive/components/countdown-timer.js +0 -0
  356. package/dist/modes/interactive/components/countdown-timer.js.map +0 -0
  357. package/dist/modes/interactive/components/custom-editor.d.ts +0 -0
  358. package/dist/modes/interactive/components/custom-editor.d.ts.map +0 -0
  359. package/dist/modes/interactive/components/custom-editor.js +0 -0
  360. package/dist/modes/interactive/components/custom-editor.js.map +0 -0
  361. package/dist/modes/interactive/components/custom-message.d.ts +0 -0
  362. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  363. package/dist/modes/interactive/components/custom-message.js +2 -2
  364. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  365. package/dist/modes/interactive/components/daxnuts.d.ts +0 -0
  366. package/dist/modes/interactive/components/daxnuts.d.ts.map +0 -0
  367. package/dist/modes/interactive/components/daxnuts.js +0 -0
  368. package/dist/modes/interactive/components/daxnuts.js.map +0 -0
  369. package/dist/modes/interactive/components/diff.d.ts +0 -0
  370. package/dist/modes/interactive/components/diff.d.ts.map +0 -0
  371. package/dist/modes/interactive/components/diff.js +0 -0
  372. package/dist/modes/interactive/components/diff.js.map +0 -0
  373. package/dist/modes/interactive/components/dynamic-border.d.ts +0 -0
  374. package/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -0
  375. package/dist/modes/interactive/components/dynamic-border.js +0 -0
  376. package/dist/modes/interactive/components/dynamic-border.js.map +0 -0
  377. package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -0
  378. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +0 -0
  379. package/dist/modes/interactive/components/earendil-announcement.js +0 -0
  380. package/dist/modes/interactive/components/earendil-announcement.js.map +0 -0
  381. package/dist/modes/interactive/components/extension-editor.d.ts +0 -0
  382. package/dist/modes/interactive/components/extension-editor.d.ts.map +0 -0
  383. package/dist/modes/interactive/components/extension-editor.js +0 -0
  384. package/dist/modes/interactive/components/extension-editor.js.map +0 -0
  385. package/dist/modes/interactive/components/extension-input.d.ts +0 -0
  386. package/dist/modes/interactive/components/extension-input.d.ts.map +0 -0
  387. package/dist/modes/interactive/components/extension-input.js +0 -0
  388. package/dist/modes/interactive/components/extension-input.js.map +0 -0
  389. package/dist/modes/interactive/components/extension-selector.d.ts +0 -0
  390. package/dist/modes/interactive/components/extension-selector.d.ts.map +0 -0
  391. package/dist/modes/interactive/components/extension-selector.js +0 -0
  392. package/dist/modes/interactive/components/extension-selector.js.map +0 -0
  393. package/dist/modes/interactive/components/footer.d.ts +0 -0
  394. package/dist/modes/interactive/components/footer.d.ts.map +0 -0
  395. package/dist/modes/interactive/components/footer.js +0 -0
  396. package/dist/modes/interactive/components/footer.js.map +0 -0
  397. package/dist/modes/interactive/components/index.d.ts +2 -0
  398. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  399. package/dist/modes/interactive/components/index.js +2 -0
  400. package/dist/modes/interactive/components/index.js.map +1 -1
  401. package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -0
  402. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -0
  403. package/dist/modes/interactive/components/keybinding-hints.js +0 -0
  404. package/dist/modes/interactive/components/keybinding-hints.js.map +0 -0
  405. package/dist/modes/interactive/components/login-dialog.d.ts +0 -1
  406. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  407. package/dist/modes/interactive/components/login-dialog.js +3 -12
  408. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  409. package/dist/modes/interactive/components/model-selector.d.ts +0 -0
  410. package/dist/modes/interactive/components/model-selector.d.ts.map +0 -0
  411. package/dist/modes/interactive/components/model-selector.js +0 -0
  412. package/dist/modes/interactive/components/model-selector.js.map +0 -0
  413. package/dist/modes/interactive/components/oauth-selector.d.ts +0 -0
  414. package/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -0
  415. package/dist/modes/interactive/components/oauth-selector.js +0 -0
  416. package/dist/modes/interactive/components/oauth-selector.js.map +0 -0
  417. package/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -0
  418. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -0
  419. package/dist/modes/interactive/components/scoped-models-selector.js +0 -0
  420. package/dist/modes/interactive/components/scoped-models-selector.js.map +0 -0
  421. package/dist/modes/interactive/components/session-selector-search.d.ts +0 -0
  422. package/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -0
  423. package/dist/modes/interactive/components/session-selector-search.js +0 -0
  424. package/dist/modes/interactive/components/session-selector-search.js.map +0 -0
  425. package/dist/modes/interactive/components/session-selector.d.ts +0 -0
  426. package/dist/modes/interactive/components/session-selector.d.ts.map +0 -0
  427. package/dist/modes/interactive/components/session-selector.js +0 -0
  428. package/dist/modes/interactive/components/session-selector.js.map +0 -0
  429. package/dist/modes/interactive/components/settings-selector.d.ts +0 -0
  430. package/dist/modes/interactive/components/settings-selector.d.ts.map +0 -0
  431. package/dist/modes/interactive/components/settings-selector.js +0 -0
  432. package/dist/modes/interactive/components/settings-selector.js.map +0 -0
  433. package/dist/modes/interactive/components/show-images-selector.d.ts +0 -0
  434. package/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -0
  435. package/dist/modes/interactive/components/show-images-selector.js +0 -0
  436. package/dist/modes/interactive/components/show-images-selector.js.map +0 -0
  437. package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -0
  438. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  439. package/dist/modes/interactive/components/skill-invocation-message.js +9 -6
  440. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  441. package/dist/modes/interactive/components/theme-selector.d.ts +0 -0
  442. package/dist/modes/interactive/components/theme-selector.d.ts.map +0 -0
  443. package/dist/modes/interactive/components/theme-selector.js +0 -0
  444. package/dist/modes/interactive/components/theme-selector.js.map +0 -0
  445. package/dist/modes/interactive/components/thinking-selector.d.ts +0 -0
  446. package/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -0
  447. package/dist/modes/interactive/components/thinking-selector.js +0 -0
  448. package/dist/modes/interactive/components/thinking-selector.js.map +0 -0
  449. package/dist/modes/interactive/components/tool-execution.d.ts +1 -0
  450. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  451. package/dist/modes/interactive/components/tool-execution.js +18 -2
  452. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  453. package/dist/modes/interactive/components/tool-group.d.ts +0 -0
  454. package/dist/modes/interactive/components/tool-group.d.ts.map +0 -0
  455. package/dist/modes/interactive/components/tool-group.js +0 -0
  456. package/dist/modes/interactive/components/tool-group.js.map +0 -0
  457. package/dist/modes/interactive/components/tool-panel-registry.d.ts +0 -0
  458. package/dist/modes/interactive/components/tool-panel-registry.d.ts.map +0 -0
  459. package/dist/modes/interactive/components/tool-panel-registry.js +0 -0
  460. package/dist/modes/interactive/components/tool-panel-registry.js.map +0 -0
  461. package/dist/modes/interactive/components/tool-title.d.ts +43 -0
  462. package/dist/modes/interactive/components/tool-title.d.ts.map +1 -0
  463. package/dist/modes/interactive/components/tool-title.js +78 -0
  464. package/dist/modes/interactive/components/tool-title.js.map +1 -0
  465. package/dist/modes/interactive/components/tree-selector.d.ts +0 -0
  466. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  467. package/dist/modes/interactive/components/tree-selector.js +36 -13
  468. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  469. package/dist/modes/interactive/components/trust-selector.d.ts +20 -0
  470. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  471. package/dist/modes/interactive/components/trust-selector.js +86 -0
  472. package/dist/modes/interactive/components/trust-selector.js.map +1 -0
  473. package/dist/modes/interactive/components/user-message-selector.d.ts +0 -0
  474. package/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -0
  475. package/dist/modes/interactive/components/user-message-selector.js +0 -0
  476. package/dist/modes/interactive/components/user-message-selector.js.map +0 -0
  477. package/dist/modes/interactive/components/user-message.d.ts +0 -0
  478. package/dist/modes/interactive/components/user-message.d.ts.map +0 -0
  479. package/dist/modes/interactive/components/user-message.js +0 -0
  480. package/dist/modes/interactive/components/user-message.js.map +0 -0
  481. package/dist/modes/interactive/components/visual-truncate.d.ts +0 -0
  482. package/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -0
  483. package/dist/modes/interactive/components/visual-truncate.js +0 -0
  484. package/dist/modes/interactive/components/visual-truncate.js.map +0 -0
  485. package/dist/modes/interactive/interactive-mode.d.ts +2 -0
  486. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  487. package/dist/modes/interactive/interactive-mode.js +43 -1
  488. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  489. package/dist/modes/interactive/theme/dark.json +0 -0
  490. package/dist/modes/interactive/theme/light.json +0 -0
  491. package/dist/modes/interactive/theme/matrix-machine.json +0 -0
  492. package/dist/modes/interactive/theme/theme-schema.json +0 -0
  493. package/dist/modes/interactive/theme/theme.d.ts +0 -0
  494. package/dist/modes/interactive/theme/theme.d.ts.map +0 -0
  495. package/dist/modes/interactive/theme/theme.js +0 -0
  496. package/dist/modes/interactive/theme/theme.js.map +0 -0
  497. package/dist/modes/print-mode.d.ts +0 -0
  498. package/dist/modes/print-mode.d.ts.map +0 -0
  499. package/dist/modes/print-mode.js +0 -0
  500. package/dist/modes/print-mode.js.map +0 -0
  501. package/dist/modes/rpc/jsonl.d.ts +0 -0
  502. package/dist/modes/rpc/jsonl.d.ts.map +0 -0
  503. package/dist/modes/rpc/jsonl.js +0 -0
  504. package/dist/modes/rpc/jsonl.js.map +0 -0
  505. package/dist/modes/rpc/rpc-client.d.ts +0 -0
  506. package/dist/modes/rpc/rpc-client.d.ts.map +0 -0
  507. package/dist/modes/rpc/rpc-client.js +0 -0
  508. package/dist/modes/rpc/rpc-client.js.map +0 -0
  509. package/dist/modes/rpc/rpc-mode.d.ts +0 -0
  510. package/dist/modes/rpc/rpc-mode.d.ts.map +0 -0
  511. package/dist/modes/rpc/rpc-mode.js +0 -0
  512. package/dist/modes/rpc/rpc-mode.js.map +0 -0
  513. package/dist/modes/rpc/rpc-types.d.ts +0 -0
  514. package/dist/modes/rpc/rpc-types.d.ts.map +0 -0
  515. package/dist/modes/rpc/rpc-types.js +0 -0
  516. package/dist/modes/rpc/rpc-types.js.map +0 -0
  517. package/dist/package-manager-cli.d.ts +0 -0
  518. package/dist/package-manager-cli.d.ts.map +1 -1
  519. package/dist/package-manager-cli.js +55 -8
  520. package/dist/package-manager-cli.js.map +1 -1
  521. package/dist/utils/ansi.d.ts +0 -0
  522. package/dist/utils/ansi.d.ts.map +0 -0
  523. package/dist/utils/ansi.js +0 -0
  524. package/dist/utils/ansi.js.map +0 -0
  525. package/dist/utils/changelog.d.ts +0 -0
  526. package/dist/utils/changelog.d.ts.map +0 -0
  527. package/dist/utils/changelog.js +0 -0
  528. package/dist/utils/changelog.js.map +0 -0
  529. package/dist/utils/child-process.d.ts +0 -0
  530. package/dist/utils/child-process.d.ts.map +0 -0
  531. package/dist/utils/child-process.js +0 -0
  532. package/dist/utils/child-process.js.map +0 -0
  533. package/dist/utils/clipboard-image.d.ts +0 -0
  534. package/dist/utils/clipboard-image.d.ts.map +0 -0
  535. package/dist/utils/clipboard-image.js +0 -0
  536. package/dist/utils/clipboard-image.js.map +0 -0
  537. package/dist/utils/clipboard-native.d.ts +0 -0
  538. package/dist/utils/clipboard-native.d.ts.map +0 -0
  539. package/dist/utils/clipboard-native.js +0 -0
  540. package/dist/utils/clipboard-native.js.map +0 -0
  541. package/dist/utils/clipboard.d.ts +0 -0
  542. package/dist/utils/clipboard.d.ts.map +0 -0
  543. package/dist/utils/clipboard.js +0 -0
  544. package/dist/utils/clipboard.js.map +0 -0
  545. package/dist/utils/deprecation.d.ts +0 -0
  546. package/dist/utils/deprecation.d.ts.map +0 -0
  547. package/dist/utils/deprecation.js +0 -0
  548. package/dist/utils/deprecation.js.map +0 -0
  549. package/dist/utils/exif-orientation.d.ts +0 -0
  550. package/dist/utils/exif-orientation.d.ts.map +0 -0
  551. package/dist/utils/exif-orientation.js +0 -0
  552. package/dist/utils/exif-orientation.js.map +0 -0
  553. package/dist/utils/frontmatter.d.ts +0 -0
  554. package/dist/utils/frontmatter.d.ts.map +0 -0
  555. package/dist/utils/frontmatter.js +0 -0
  556. package/dist/utils/frontmatter.js.map +0 -0
  557. package/dist/utils/fs-watch.d.ts +0 -0
  558. package/dist/utils/fs-watch.d.ts.map +0 -0
  559. package/dist/utils/fs-watch.js +0 -0
  560. package/dist/utils/fs-watch.js.map +0 -0
  561. package/dist/utils/git.d.ts +0 -0
  562. package/dist/utils/git.d.ts.map +1 -1
  563. package/dist/utils/git.js +54 -22
  564. package/dist/utils/git.js.map +1 -1
  565. package/dist/utils/html.d.ts +0 -0
  566. package/dist/utils/html.d.ts.map +0 -0
  567. package/dist/utils/html.js +0 -0
  568. package/dist/utils/html.js.map +0 -0
  569. package/dist/utils/image-convert.d.ts +0 -0
  570. package/dist/utils/image-convert.d.ts.map +0 -0
  571. package/dist/utils/image-convert.js +0 -0
  572. package/dist/utils/image-convert.js.map +0 -0
  573. package/dist/utils/image-resize-core.d.ts +0 -0
  574. package/dist/utils/image-resize-core.d.ts.map +0 -0
  575. package/dist/utils/image-resize-core.js +0 -0
  576. package/dist/utils/image-resize-core.js.map +0 -0
  577. package/dist/utils/image-resize-worker.d.ts +0 -0
  578. package/dist/utils/image-resize-worker.d.ts.map +0 -0
  579. package/dist/utils/image-resize-worker.js +0 -0
  580. package/dist/utils/image-resize-worker.js.map +0 -0
  581. package/dist/utils/image-resize.d.ts +0 -0
  582. package/dist/utils/image-resize.d.ts.map +0 -0
  583. package/dist/utils/image-resize.js +0 -0
  584. package/dist/utils/image-resize.js.map +0 -0
  585. package/dist/utils/json.d.ts +0 -0
  586. package/dist/utils/json.d.ts.map +0 -0
  587. package/dist/utils/json.js +0 -0
  588. package/dist/utils/json.js.map +0 -0
  589. package/dist/utils/mime.d.ts +0 -0
  590. package/dist/utils/mime.d.ts.map +0 -0
  591. package/dist/utils/mime.js +0 -0
  592. package/dist/utils/mime.js.map +0 -0
  593. package/dist/utils/open-browser.d.ts +9 -0
  594. package/dist/utils/open-browser.d.ts.map +1 -0
  595. package/dist/utils/open-browser.js +22 -0
  596. package/dist/utils/open-browser.js.map +1 -0
  597. package/dist/utils/paths.d.ts +0 -0
  598. package/dist/utils/paths.d.ts.map +0 -0
  599. package/dist/utils/paths.js +0 -0
  600. package/dist/utils/paths.js.map +0 -0
  601. package/dist/utils/photon.d.ts +0 -0
  602. package/dist/utils/photon.d.ts.map +0 -0
  603. package/dist/utils/photon.js +0 -0
  604. package/dist/utils/photon.js.map +0 -0
  605. package/dist/utils/pi-user-agent.d.ts +0 -0
  606. package/dist/utils/pi-user-agent.d.ts.map +0 -0
  607. package/dist/utils/pi-user-agent.js +0 -0
  608. package/dist/utils/pi-user-agent.js.map +0 -0
  609. package/dist/utils/shell.d.ts +0 -0
  610. package/dist/utils/shell.d.ts.map +0 -0
  611. package/dist/utils/shell.js +0 -0
  612. package/dist/utils/shell.js.map +0 -0
  613. package/dist/utils/sleep.d.ts +0 -0
  614. package/dist/utils/sleep.d.ts.map +0 -0
  615. package/dist/utils/sleep.js +0 -0
  616. package/dist/utils/sleep.js.map +0 -0
  617. package/dist/utils/syntax-highlight.d.ts +0 -0
  618. package/dist/utils/syntax-highlight.d.ts.map +0 -0
  619. package/dist/utils/syntax-highlight.js +0 -0
  620. package/dist/utils/syntax-highlight.js.map +0 -0
  621. package/dist/utils/tools-manager.d.ts +0 -0
  622. package/dist/utils/tools-manager.d.ts.map +0 -0
  623. package/dist/utils/tools-manager.js +0 -0
  624. package/dist/utils/tools-manager.js.map +0 -0
  625. package/dist/utils/version-check.d.ts +0 -0
  626. package/dist/utils/version-check.d.ts.map +0 -0
  627. package/dist/utils/version-check.js +0 -0
  628. package/dist/utils/version-check.js.map +0 -0
  629. package/dist/utils/windows-self-update.d.ts +0 -0
  630. package/dist/utils/windows-self-update.d.ts.map +0 -0
  631. package/dist/utils/windows-self-update.js +0 -0
  632. package/dist/utils/windows-self-update.js.map +0 -0
  633. package/docs/adaptive-extension-shared-state-audit.md +0 -0
  634. package/docs/compaction.md +0 -0
  635. package/docs/custom-provider.md +0 -0
  636. package/docs/development.md +0 -0
  637. package/docs/docs.json +0 -0
  638. package/docs/extensions.md +0 -0
  639. package/docs/images/doom-extension.png +0 -0
  640. package/docs/images/exy.png +0 -0
  641. package/docs/images/interactive-mode.png +0 -0
  642. package/docs/images/tree-view.png +0 -0
  643. package/docs/index.md +0 -0
  644. package/docs/json.md +0 -0
  645. package/docs/keybindings.md +0 -0
  646. package/docs/models.md +0 -0
  647. package/docs/packages.md +0 -0
  648. package/docs/prompt-templates.md +0 -0
  649. package/docs/providers.md +0 -0
  650. package/docs/quickstart.md +0 -0
  651. package/docs/rpc.md +0 -0
  652. package/docs/sdk.md +0 -0
  653. package/docs/session-format.md +0 -0
  654. package/docs/sessions.md +0 -0
  655. package/docs/settings.md +0 -0
  656. package/docs/shell-aliases.md +0 -0
  657. package/docs/skills.md +0 -0
  658. package/docs/terminal-setup.md +0 -0
  659. package/docs/termux.md +0 -0
  660. package/docs/themes.md +0 -0
  661. package/docs/tmux.md +0 -0
  662. package/docs/tui.md +18 -0
  663. package/docs/usage.md +0 -0
  664. package/docs/windows.md +0 -0
  665. package/examples/README.md +0 -0
  666. package/examples/extensions/README.md +0 -0
  667. package/examples/extensions/auto-commit-on-exit.ts +0 -0
  668. package/examples/extensions/bash-spawn-hook.ts +0 -0
  669. package/examples/extensions/bookmark.ts +0 -0
  670. package/examples/extensions/border-status-editor.ts +0 -0
  671. package/examples/extensions/built-in-tool-renderer.ts +0 -0
  672. package/examples/extensions/claude-rules.ts +0 -0
  673. package/examples/extensions/commands.ts +0 -0
  674. package/examples/extensions/confirm-destructive.ts +0 -0
  675. package/examples/extensions/custom-compaction.ts +0 -0
  676. package/examples/extensions/custom-footer.ts +0 -0
  677. package/examples/extensions/custom-header.ts +0 -0
  678. package/examples/extensions/custom-provider-anthropic/index.ts +0 -0
  679. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  680. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  681. package/examples/extensions/custom-provider-gitlab-duo/index.ts +0 -0
  682. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  683. package/examples/extensions/custom-provider-gitlab-duo/test.ts +0 -0
  684. package/examples/extensions/dirty-repo-guard.ts +0 -0
  685. package/examples/extensions/doom-overlay/README.md +0 -0
  686. package/examples/extensions/doom-overlay/doom/build/doom.js +0 -0
  687. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +0 -0
  688. package/examples/extensions/doom-overlay/doom-component.ts +0 -0
  689. package/examples/extensions/doom-overlay/doom-engine.ts +0 -0
  690. package/examples/extensions/doom-overlay/doom-keys.ts +0 -0
  691. package/examples/extensions/doom-overlay/index.ts +0 -0
  692. package/examples/extensions/doom-overlay/wad-finder.ts +0 -0
  693. package/examples/extensions/dynamic-resources/SKILL.md +0 -0
  694. package/examples/extensions/dynamic-resources/dynamic.json +0 -0
  695. package/examples/extensions/dynamic-resources/dynamic.md +0 -0
  696. package/examples/extensions/dynamic-resources/index.ts +0 -0
  697. package/examples/extensions/dynamic-tools.ts +0 -0
  698. package/examples/extensions/event-bus.ts +0 -0
  699. package/examples/extensions/file-trigger.ts +0 -0
  700. package/examples/extensions/git-checkpoint.ts +0 -0
  701. package/examples/extensions/git-merge-and-resolve.ts +0 -0
  702. package/examples/extensions/github-issue-autocomplete.ts +0 -0
  703. package/examples/extensions/handoff.ts +0 -0
  704. package/examples/extensions/hello.ts +0 -0
  705. package/examples/extensions/hidden-thinking-label.ts +0 -0
  706. package/examples/extensions/inline-bash.ts +0 -0
  707. package/examples/extensions/input-transform-streaming.ts +0 -0
  708. package/examples/extensions/input-transform.ts +0 -0
  709. package/examples/extensions/interactive-shell.ts +0 -0
  710. package/examples/extensions/mac-system-theme.ts +0 -0
  711. package/examples/extensions/message-renderer.ts +0 -0
  712. package/examples/extensions/minimal-mode.ts +0 -0
  713. package/examples/extensions/modal-editor.ts +0 -0
  714. package/examples/extensions/model-status.ts +0 -0
  715. package/examples/extensions/notify.ts +0 -0
  716. package/examples/extensions/overlay-qa-tests.ts +0 -0
  717. package/examples/extensions/overlay-test.ts +0 -0
  718. package/examples/extensions/permission-gate.ts +0 -0
  719. package/examples/extensions/pirate.ts +0 -0
  720. package/examples/extensions/plan-mode/README.md +0 -0
  721. package/examples/extensions/plan-mode/index.ts +0 -0
  722. package/examples/extensions/plan-mode/utils.ts +0 -0
  723. package/examples/extensions/preset.ts +0 -0
  724. package/examples/extensions/prompt-customizer.ts +0 -0
  725. package/examples/extensions/protected-paths.ts +0 -0
  726. package/examples/extensions/provider-payload.ts +0 -0
  727. package/examples/extensions/qna.ts +0 -0
  728. package/examples/extensions/question.ts +0 -0
  729. package/examples/extensions/questionnaire.ts +0 -0
  730. package/examples/extensions/rainbow-editor.ts +0 -0
  731. package/examples/extensions/reload-runtime.ts +0 -0
  732. package/examples/extensions/rpc-demo.ts +0 -0
  733. package/examples/extensions/sandbox/index.ts +0 -0
  734. package/examples/extensions/sandbox/package-lock.json +2 -2
  735. package/examples/extensions/sandbox/package.json +1 -1
  736. package/examples/extensions/send-user-message.ts +0 -0
  737. package/examples/extensions/session-name.ts +0 -0
  738. package/examples/extensions/shutdown-command.ts +0 -0
  739. package/examples/extensions/snake.ts +0 -0
  740. package/examples/extensions/space-invaders.ts +0 -0
  741. package/examples/extensions/ssh.ts +0 -0
  742. package/examples/extensions/status-line.ts +0 -0
  743. package/examples/extensions/structured-output.ts +0 -0
  744. package/examples/extensions/subagent/README.md +0 -0
  745. package/examples/extensions/subagent/agents/planner.md +0 -0
  746. package/examples/extensions/subagent/agents/reviewer.md +0 -0
  747. package/examples/extensions/subagent/agents/scout.md +0 -0
  748. package/examples/extensions/subagent/agents/worker.md +0 -0
  749. package/examples/extensions/subagent/agents.ts +0 -0
  750. package/examples/extensions/subagent/index.ts +0 -0
  751. package/examples/extensions/subagent/prompts/implement-and-review.md +0 -0
  752. package/examples/extensions/subagent/prompts/implement.md +0 -0
  753. package/examples/extensions/subagent/prompts/scout-and-plan.md +0 -0
  754. package/examples/extensions/summarize.ts +0 -0
  755. package/examples/extensions/system-prompt-header.ts +0 -0
  756. package/examples/extensions/tic-tac-toe.ts +0 -0
  757. package/examples/extensions/timed-confirm.ts +0 -0
  758. package/examples/extensions/titlebar-spinner.ts +0 -0
  759. package/examples/extensions/todo.ts +0 -0
  760. package/examples/extensions/tool-override.ts +0 -0
  761. package/examples/extensions/tools.ts +0 -0
  762. package/examples/extensions/trigger-compact.ts +0 -0
  763. package/examples/extensions/truncated-tool.ts +0 -0
  764. package/examples/extensions/widget-placement.ts +0 -0
  765. package/examples/extensions/with-deps/index.ts +0 -0
  766. package/examples/extensions/with-deps/package-lock.json +2 -2
  767. package/examples/extensions/with-deps/package.json +1 -1
  768. package/examples/extensions/working-indicator.ts +0 -0
  769. package/examples/extensions/working-message-test.ts +0 -0
  770. package/examples/rpc-extension-ui.ts +0 -0
  771. package/examples/sdk/01-minimal.ts +0 -0
  772. package/examples/sdk/02-custom-model.ts +0 -0
  773. package/examples/sdk/03-custom-prompt.ts +0 -0
  774. package/examples/sdk/04-skills.ts +0 -0
  775. package/examples/sdk/05-tools.ts +0 -0
  776. package/examples/sdk/06-extensions.ts +0 -0
  777. package/examples/sdk/07-context-files.ts +0 -0
  778. package/examples/sdk/08-prompt-templates.ts +0 -0
  779. package/examples/sdk/09-api-keys-and-oauth.ts +0 -0
  780. package/examples/sdk/10-settings.ts +0 -0
  781. package/examples/sdk/11-sessions.ts +0 -0
  782. package/examples/sdk/12-full-control.ts +0 -0
  783. package/examples/sdk/13-session-runtime.ts +0 -0
  784. package/examples/sdk/README.md +0 -0
  785. package/npm-shrinkwrap.json +12 -12
  786. package/package.json +4 -4
File without changes
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,mCAAmC;IACnC,IAAI,EAAE,KAAK,CAAC;IACZ,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AA4GF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CA0D5D","sourcesContent":["import hostedGitInfo from \"hosted-git-info\";\n\n/**\n * Parsed git URL information.\n */\nexport type GitSource = {\n\t/** Always \"git\" for git sources */\n\ttype: \"git\";\n\t/** Clone URL (always valid for git clone, without ref suffix) */\n\trepo: string;\n\t/** Git host domain (e.g., \"github.com\") */\n\thost: string;\n\t/** Repository path (e.g., \"user/repo\") */\n\tpath: string;\n\t/** Git ref (branch, tag, commit) if specified */\n\tref?: string;\n\t/** True if ref was specified (package won't be auto-updated) */\n\tpinned: boolean;\n};\n\nfunction splitRef(url: string): { repo: string; ref?: string } {\n\tconst scpLikeMatch = url.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\tconst pathWithMaybeRef = scpLikeMatch[2] ?? \"\";\n\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\tif (refSeparator < 0) return { repo: url };\n\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\tif (!repoPath || !ref) return { repo: url };\n\t\treturn {\n\t\t\trepo: `git@${scpLikeMatch[1] ?? \"\"}:${repoPath}`,\n\t\t\tref,\n\t\t};\n\t}\n\n\tif (url.includes(\"://\")) {\n\t\ttry {\n\t\t\tconst parsed = new URL(url);\n\t\t\tconst pathWithMaybeRef = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\t\tif (refSeparator < 0) return { repo: url };\n\t\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\t\tif (!repoPath || !ref) return { repo: url };\n\t\t\tparsed.pathname = `/${repoPath}`;\n\t\t\treturn {\n\t\t\t\trepo: parsed.toString().replace(/\\/$/, \"\"),\n\t\t\t\tref,\n\t\t\t};\n\t\t} catch {\n\t\t\treturn { repo: url };\n\t\t}\n\t}\n\n\tconst slashIndex = url.indexOf(\"/\");\n\tif (slashIndex < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst host = url.slice(0, slashIndex);\n\tconst pathWithMaybeRef = url.slice(slashIndex + 1);\n\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\tif (refSeparator < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\tif (!repoPath || !ref) {\n\t\treturn { repo: url };\n\t}\n\treturn {\n\t\trepo: `${host}/${repoPath}`,\n\t\tref,\n\t};\n}\n\nfunction parseGenericGitUrl(url: string): GitSource | null {\n\tconst { repo: repoWithoutRef, ref } = splitRef(url);\n\tlet repo = repoWithoutRef;\n\tlet host = \"\";\n\tlet path = \"\";\n\n\tconst scpLikeMatch = repoWithoutRef.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\thost = scpLikeMatch[1] ?? \"\";\n\t\tpath = scpLikeMatch[2] ?? \"\";\n\t} else if (\n\t\trepoWithoutRef.startsWith(\"https://\") ||\n\t\trepoWithoutRef.startsWith(\"http://\") ||\n\t\trepoWithoutRef.startsWith(\"ssh://\") ||\n\t\trepoWithoutRef.startsWith(\"git://\")\n\t) {\n\t\ttry {\n\t\t\tconst parsed = new URL(repoWithoutRef);\n\t\t\thost = parsed.hostname;\n\t\t\tpath = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\tconst slashIndex = repoWithoutRef.indexOf(\"/\");\n\t\tif (slashIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\thost = repoWithoutRef.slice(0, slashIndex);\n\t\tpath = repoWithoutRef.slice(slashIndex + 1);\n\t\tif (!host.includes(\".\") && host !== \"localhost\") {\n\t\t\treturn null;\n\t\t}\n\t\trepo = `https://${repoWithoutRef}`;\n\t}\n\n\tconst normalizedPath = path.replace(/\\.git$/, \"\").replace(/^\\/+/, \"\");\n\tif (!host || !normalizedPath || normalizedPath.split(\"/\").length < 2) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\ttype: \"git\",\n\t\trepo,\n\t\thost,\n\t\tpath: normalizedPath,\n\t\tref,\n\t\tpinned: Boolean(ref),\n\t};\n}\n\n/**\n * Parse git source into a GitSource.\n *\n * Rules:\n * - With git: prefix, accept all historical shorthand forms.\n * - Without git: prefix, only accept explicit protocol URLs.\n */\nexport function parseGitUrl(source: string): GitSource | null {\n\tconst trimmed = source.trim();\n\tconst hasGitPrefix = trimmed.startsWith(\"git:\");\n\tconst url = hasGitPrefix ? trimmed.slice(4).trim() : trimmed;\n\n\tif (!hasGitPrefix && !/^(https?|ssh|git):\\/\\//i.test(url)) {\n\t\treturn null;\n\t}\n\n\tconst split = splitRef(url);\n\n\tconst hostedCandidates = [split.ref ? `${split.repo}#${split.ref}` : undefined, url].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of hostedCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst useHttpsPrefix =\n\t\t\t\t!split.repo.startsWith(\"http://\") &&\n\t\t\t\t!split.repo.startsWith(\"https://\") &&\n\t\t\t\t!split.repo.startsWith(\"ssh://\") &&\n\t\t\t\t!split.repo.startsWith(\"git://\") &&\n\t\t\t\t!split.repo.startsWith(\"git@\");\n\t\t\treturn {\n\t\t\t\ttype: \"git\",\n\t\t\t\trepo: useHttpsPrefix ? `https://${split.repo}` : split.repo,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`.replace(/\\.git$/, \"\"),\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t\tpinned: Boolean(info.committish || split.ref),\n\t\t\t};\n\t\t}\n\t}\n\n\tconst httpsCandidates = [split.ref ? `https://${split.repo}#${split.ref}` : undefined, `https://${url}`].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of httpsCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"git\",\n\t\t\t\trepo: `https://${split.repo}`,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`.replace(/\\.git$/, \"\"),\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t\tpinned: Boolean(info.committish || split.ref),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn parseGenericGitUrl(url);\n}\n"]}
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,mCAAmC;IACnC,IAAI,EAAE,KAAK,CAAC;IACZ,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AAkJF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAsD5D","sourcesContent":["import hostedGitInfo from \"hosted-git-info\";\n\n/**\n * Parsed git URL information.\n */\nexport type GitSource = {\n\t/** Always \"git\" for git sources */\n\ttype: \"git\";\n\t/** Clone URL (always valid for git clone, without ref suffix) */\n\trepo: string;\n\t/** Git host domain (e.g., \"github.com\") */\n\thost: string;\n\t/** Repository path (e.g., \"user/repo\") */\n\tpath: string;\n\t/** Git ref (branch, tag, commit) if specified */\n\tref?: string;\n\t/** True if ref was specified (package won't be auto-updated) */\n\tpinned: boolean;\n};\n\nfunction splitRef(url: string): { repo: string; ref?: string } {\n\tconst scpLikeMatch = url.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\tconst pathWithMaybeRef = scpLikeMatch[2] ?? \"\";\n\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\tif (refSeparator < 0) return { repo: url };\n\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\tif (!repoPath || !ref) return { repo: url };\n\t\treturn {\n\t\t\trepo: `git@${scpLikeMatch[1] ?? \"\"}:${repoPath}`,\n\t\t\tref,\n\t\t};\n\t}\n\n\tif (url.includes(\"://\")) {\n\t\ttry {\n\t\t\tconst parsed = new URL(url);\n\t\t\tconst pathWithMaybeRef = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\t\tif (refSeparator < 0) return { repo: url };\n\t\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\t\tif (!repoPath || !ref) return { repo: url };\n\t\t\tparsed.pathname = `/${repoPath}`;\n\t\t\treturn {\n\t\t\t\trepo: parsed.toString().replace(/\\/$/, \"\"),\n\t\t\t\tref,\n\t\t\t};\n\t\t} catch {\n\t\t\treturn { repo: url };\n\t\t}\n\t}\n\n\tconst slashIndex = url.indexOf(\"/\");\n\tif (slashIndex < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst host = url.slice(0, slashIndex);\n\tconst pathWithMaybeRef = url.slice(slashIndex + 1);\n\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\tif (refSeparator < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\tif (!repoPath || !ref) {\n\t\treturn { repo: url };\n\t}\n\treturn {\n\t\trepo: `${host}/${repoPath}`,\n\t\tref,\n\t};\n}\n\nfunction decodeForValidation(value: string): string | null {\n\ttry {\n\t\treturn decodeURIComponent(value);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction hasUnsafeGitInstallPart(value: string, allowSlash: boolean): boolean {\n\tconst decoded = decodeForValidation(value);\n\tif (decoded === null) {\n\t\treturn true;\n\t}\n\tconst candidates = [value, decoded];\n\tfor (const candidate of candidates) {\n\t\tif (candidate.includes(\"\\0\") || candidate.includes(\"\\\\\") || candidate.startsWith(\"/\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!allowSlash && candidate.includes(\"/\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (candidate.split(\"/\").includes(\"..\")) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction buildGitSource(args: { repo: string; host: string; path: string; ref?: string }): GitSource | null {\n\tif (args.path.startsWith(\"/\")) {\n\t\treturn null;\n\t}\n\tconst normalizedPath = args.path.replace(/\\.git$/, \"\").replace(/^\\/+/, \"\");\n\tif (!args.host || !normalizedPath || normalizedPath.split(\"/\").length < 2) {\n\t\treturn null;\n\t}\n\tif (hasUnsafeGitInstallPart(args.host, false) || hasUnsafeGitInstallPart(normalizedPath, true)) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\ttype: \"git\",\n\t\trepo: args.repo,\n\t\thost: args.host,\n\t\tpath: normalizedPath,\n\t\tref: args.ref,\n\t\tpinned: Boolean(args.ref),\n\t};\n}\n\nfunction parseGenericGitUrl(url: string): GitSource | null {\n\tconst { repo: repoWithoutRef, ref } = splitRef(url);\n\tlet repo = repoWithoutRef;\n\tlet host = \"\";\n\tlet path = \"\";\n\n\tconst scpLikeMatch = repoWithoutRef.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\thost = scpLikeMatch[1] ?? \"\";\n\t\tpath = scpLikeMatch[2] ?? \"\";\n\t} else if (\n\t\trepoWithoutRef.startsWith(\"https://\") ||\n\t\trepoWithoutRef.startsWith(\"http://\") ||\n\t\trepoWithoutRef.startsWith(\"ssh://\") ||\n\t\trepoWithoutRef.startsWith(\"git://\")\n\t) {\n\t\ttry {\n\t\t\tconst parsed = new URL(repoWithoutRef);\n\t\t\thost = parsed.hostname;\n\t\t\tpath = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\tconst slashIndex = repoWithoutRef.indexOf(\"/\");\n\t\tif (slashIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\thost = repoWithoutRef.slice(0, slashIndex);\n\t\tpath = repoWithoutRef.slice(slashIndex + 1);\n\t\tif (!host.includes(\".\") && host !== \"localhost\") {\n\t\t\treturn null;\n\t\t}\n\t\trepo = `https://${repoWithoutRef}`;\n\t}\n\n\treturn buildGitSource({ repo, host, path, ref });\n}\n\n/**\n * Parse git source into a GitSource.\n *\n * Rules:\n * - With git: prefix, accept all historical shorthand forms.\n * - Without git: prefix, only accept explicit protocol URLs.\n */\nexport function parseGitUrl(source: string): GitSource | null {\n\tconst trimmed = source.trim();\n\tconst hasGitPrefix = trimmed.startsWith(\"git:\");\n\tconst url = hasGitPrefix ? trimmed.slice(4).trim() : trimmed;\n\n\tif (!hasGitPrefix && !/^(https?|ssh|git):\\/\\//i.test(url)) {\n\t\treturn null;\n\t}\n\n\tconst split = splitRef(url);\n\n\tconst hostedCandidates = [split.ref ? `${split.repo}#${split.ref}` : undefined, url].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of hostedCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst useHttpsPrefix =\n\t\t\t\t!split.repo.startsWith(\"http://\") &&\n\t\t\t\t!split.repo.startsWith(\"https://\") &&\n\t\t\t\t!split.repo.startsWith(\"ssh://\") &&\n\t\t\t\t!split.repo.startsWith(\"git://\") &&\n\t\t\t\t!split.repo.startsWith(\"git@\");\n\t\t\treturn buildGitSource({\n\t\t\t\trepo: useHttpsPrefix ? `https://${split.repo}` : split.repo,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`,\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\tconst httpsCandidates = [split.ref ? `https://${split.repo}#${split.ref}` : undefined, `https://${url}`].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of httpsCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn buildGitSource({\n\t\t\t\trepo: `https://${split.repo}`,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`,\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn parseGenericGitUrl(url);\n}\n"]}
package/dist/utils/git.js CHANGED
@@ -56,6 +56,53 @@ function splitRef(url) {
56
56
  ref,
57
57
  };
58
58
  }
59
+ function decodeForValidation(value) {
60
+ try {
61
+ return decodeURIComponent(value);
62
+ }
63
+ catch {
64
+ return null;
65
+ }
66
+ }
67
+ function hasUnsafeGitInstallPart(value, allowSlash) {
68
+ const decoded = decodeForValidation(value);
69
+ if (decoded === null) {
70
+ return true;
71
+ }
72
+ const candidates = [value, decoded];
73
+ for (const candidate of candidates) {
74
+ if (candidate.includes("\0") || candidate.includes("\\") || candidate.startsWith("/")) {
75
+ return true;
76
+ }
77
+ if (!allowSlash && candidate.includes("/")) {
78
+ return true;
79
+ }
80
+ if (candidate.split("/").includes("..")) {
81
+ return true;
82
+ }
83
+ }
84
+ return false;
85
+ }
86
+ function buildGitSource(args) {
87
+ if (args.path.startsWith("/")) {
88
+ return null;
89
+ }
90
+ const normalizedPath = args.path.replace(/\.git$/, "").replace(/^\/+/, "");
91
+ if (!args.host || !normalizedPath || normalizedPath.split("/").length < 2) {
92
+ return null;
93
+ }
94
+ if (hasUnsafeGitInstallPart(args.host, false) || hasUnsafeGitInstallPart(normalizedPath, true)) {
95
+ return null;
96
+ }
97
+ return {
98
+ type: "git",
99
+ repo: args.repo,
100
+ host: args.host,
101
+ path: normalizedPath,
102
+ ref: args.ref,
103
+ pinned: Boolean(args.ref),
104
+ };
105
+ }
59
106
  function parseGenericGitUrl(url) {
60
107
  const { repo: repoWithoutRef, ref } = splitRef(url);
61
108
  let repo = repoWithoutRef;
@@ -91,18 +138,7 @@ function parseGenericGitUrl(url) {
91
138
  }
92
139
  repo = `https://${repoWithoutRef}`;
93
140
  }
94
- const normalizedPath = path.replace(/\.git$/, "").replace(/^\/+/, "");
95
- if (!host || !normalizedPath || normalizedPath.split("/").length < 2) {
96
- return null;
97
- }
98
- return {
99
- type: "git",
100
- repo,
101
- host,
102
- path: normalizedPath,
103
- ref,
104
- pinned: Boolean(ref),
105
- };
141
+ return buildGitSource({ repo, host, path, ref });
106
142
  }
107
143
  /**
108
144
  * Parse git source into a GitSource.
@@ -131,14 +167,12 @@ export function parseGitUrl(source) {
131
167
  !split.repo.startsWith("ssh://") &&
132
168
  !split.repo.startsWith("git://") &&
133
169
  !split.repo.startsWith("git@");
134
- return {
135
- type: "git",
170
+ return buildGitSource({
136
171
  repo: useHttpsPrefix ? `https://${split.repo}` : split.repo,
137
172
  host: info.domain || "",
138
- path: `${info.user}/${info.project}`.replace(/\.git$/, ""),
173
+ path: `${info.user}/${info.project}`,
139
174
  ref: info.committish || split.ref || undefined,
140
- pinned: Boolean(info.committish || split.ref),
141
- };
175
+ });
142
176
  }
143
177
  }
144
178
  const httpsCandidates = [split.ref ? `https://${split.repo}#${split.ref}` : undefined, `https://${url}`].filter((value) => Boolean(value));
@@ -148,14 +182,12 @@ export function parseGitUrl(source) {
148
182
  if (split.ref && info.project?.includes("@")) {
149
183
  continue;
150
184
  }
151
- return {
152
- type: "git",
185
+ return buildGitSource({
153
186
  repo: `https://${split.repo}`,
154
187
  host: info.domain || "",
155
- path: `${info.user}/${info.project}`.replace(/\.git$/, ""),
188
+ path: `${info.user}/${info.project}`,
156
189
  ref: info.committish || split.ref || undefined,
157
- pinned: Boolean(info.committish || split.ref),
158
- };
190
+ });
159
191
  }
160
192
  }
161
193
  return parseGenericGitUrl(url);
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAoB5C,SAAS,QAAQ,CAAC,GAAW,EAAkC;IAC9D,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACrD,IAAI,YAAY,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/C,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,YAAY,GAAG,CAAC;YAAE,OA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,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,IAAI,EAAE,CAAC;YACV,IAAI,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9C,SAAS;YACV,CAAC;YACD,OAAO;gBACN,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,WAAW,KAAK,CAAC,IAAI,EAAE;gBAC7B,IAAI,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;gBACvB,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;gBAC1D,GAAG,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,IAAI,SAAS;gBAC9C,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC;aAC7C,CAAC;QACH,CAAC;IACF,CAAC;IAED,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAAA,CAC/B","sourcesContent":["import hostedGitInfo from \"hosted-git-info\";\n\n/**\n * Parsed git URL information.\n */\nexport type GitSource = {\n\t/** Always \"git\" for git sources */\n\ttype: \"git\";\n\t/** Clone URL (always valid for git clone, without ref suffix) */\n\trepo: string;\n\t/** Git host domain (e.g., \"github.com\") */\n\thost: string;\n\t/** Repository path (e.g., \"user/repo\") */\n\tpath: string;\n\t/** Git ref (branch, tag, commit) if specified */\n\tref?: string;\n\t/** True if ref was specified (package won't be auto-updated) */\n\tpinned: boolean;\n};\n\nfunction splitRef(url: string): { repo: string; ref?: string } {\n\tconst scpLikeMatch = url.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\tconst pathWithMaybeRef = scpLikeMatch[2] ?? \"\";\n\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\tif (refSeparator < 0) return { repo: url };\n\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\tif (!repoPath || !ref) return { repo: url };\n\t\treturn {\n\t\t\trepo: `git@${scpLikeMatch[1] ?? \"\"}:${repoPath}`,\n\t\t\tref,\n\t\t};\n\t}\n\n\tif (url.includes(\"://\")) {\n\t\ttry {\n\t\t\tconst parsed = new URL(url);\n\t\t\tconst pathWithMaybeRef = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\t\tif (refSeparator < 0) return { repo: url };\n\t\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\t\tif (!repoPath || !ref) return { repo: url };\n\t\t\tparsed.pathname = `/${repoPath}`;\n\t\t\treturn {\n\t\t\t\trepo: parsed.toString().replace(/\\/$/, \"\"),\n\t\t\t\tref,\n\t\t\t};\n\t\t} catch {\n\t\t\treturn { repo: url };\n\t\t}\n\t}\n\n\tconst slashIndex = url.indexOf(\"/\");\n\tif (slashIndex < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst host = url.slice(0, slashIndex);\n\tconst pathWithMaybeRef = url.slice(slashIndex + 1);\n\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\tif (refSeparator < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\tif (!repoPath || !ref) {\n\t\treturn { repo: url };\n\t}\n\treturn {\n\t\trepo: `${host}/${repoPath}`,\n\t\tref,\n\t};\n}\n\nfunction parseGenericGitUrl(url: string): GitSource | null {\n\tconst { repo: repoWithoutRef, ref } = splitRef(url);\n\tlet repo = repoWithoutRef;\n\tlet host = \"\";\n\tlet path = \"\";\n\n\tconst scpLikeMatch = repoWithoutRef.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\thost = scpLikeMatch[1] ?? \"\";\n\t\tpath = scpLikeMatch[2] ?? \"\";\n\t} else if (\n\t\trepoWithoutRef.startsWith(\"https://\") ||\n\t\trepoWithoutRef.startsWith(\"http://\") ||\n\t\trepoWithoutRef.startsWith(\"ssh://\") ||\n\t\trepoWithoutRef.startsWith(\"git://\")\n\t) {\n\t\ttry {\n\t\t\tconst parsed = new URL(repoWithoutRef);\n\t\t\thost = parsed.hostname;\n\t\t\tpath = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\tconst slashIndex = repoWithoutRef.indexOf(\"/\");\n\t\tif (slashIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\thost = repoWithoutRef.slice(0, slashIndex);\n\t\tpath = repoWithoutRef.slice(slashIndex + 1);\n\t\tif (!host.includes(\".\") && host !== \"localhost\") {\n\t\t\treturn null;\n\t\t}\n\t\trepo = `https://${repoWithoutRef}`;\n\t}\n\n\tconst normalizedPath = path.replace(/\\.git$/, \"\").replace(/^\\/+/, \"\");\n\tif (!host || !normalizedPath || normalizedPath.split(\"/\").length < 2) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\ttype: \"git\",\n\t\trepo,\n\t\thost,\n\t\tpath: normalizedPath,\n\t\tref,\n\t\tpinned: Boolean(ref),\n\t};\n}\n\n/**\n * Parse git source into a GitSource.\n *\n * Rules:\n * - With git: prefix, accept all historical shorthand forms.\n * - Without git: prefix, only accept explicit protocol URLs.\n */\nexport function parseGitUrl(source: string): GitSource | null {\n\tconst trimmed = source.trim();\n\tconst hasGitPrefix = trimmed.startsWith(\"git:\");\n\tconst url = hasGitPrefix ? trimmed.slice(4).trim() : trimmed;\n\n\tif (!hasGitPrefix && !/^(https?|ssh|git):\\/\\//i.test(url)) {\n\t\treturn null;\n\t}\n\n\tconst split = splitRef(url);\n\n\tconst hostedCandidates = [split.ref ? `${split.repo}#${split.ref}` : undefined, url].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of hostedCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst useHttpsPrefix =\n\t\t\t\t!split.repo.startsWith(\"http://\") &&\n\t\t\t\t!split.repo.startsWith(\"https://\") &&\n\t\t\t\t!split.repo.startsWith(\"ssh://\") &&\n\t\t\t\t!split.repo.startsWith(\"git://\") &&\n\t\t\t\t!split.repo.startsWith(\"git@\");\n\t\t\treturn {\n\t\t\t\ttype: \"git\",\n\t\t\t\trepo: useHttpsPrefix ? `https://${split.repo}` : split.repo,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`.replace(/\\.git$/, \"\"),\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t\tpinned: Boolean(info.committish || split.ref),\n\t\t\t};\n\t\t}\n\t}\n\n\tconst httpsCandidates = [split.ref ? `https://${split.repo}#${split.ref}` : undefined, `https://${url}`].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of httpsCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"git\",\n\t\t\t\trepo: `https://${split.repo}`,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`.replace(/\\.git$/, \"\"),\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t\tpinned: Boolean(info.committish || split.ref),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn parseGenericGitUrl(url);\n}\n"]}
1
+ {"version":3,"file":"git.js","sourceRo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EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;gBACvB,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE;gBACpC,GAAG,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,IAAI,SAAS;aAC9C,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,MAAM,eAAe,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,WAAW,GAAG,EAAE,CAAC,CAAC,MAAM,CAC9G,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAC1C,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,IAAI,EAAE,CAAC;YACV,IAAI,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9C,SAAS;YACV,CAAC;YACD,OAAO,cAAc,CAAC;gBACrB,IAAI,EAAE,WAAW,KAAK,CAAC,IAAI,EAAE;gBAC7B,IAAI,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;gBACvB,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE;gBACpC,GAAG,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,IAAI,SAAS;aAC9C,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAAA,CAC/B","sourcesContent":["import hostedGitInfo from \"hosted-git-info\";\n\n/**\n * Parsed git URL information.\n */\nexport type GitSource = {\n\t/** Always \"git\" for git sources */\n\ttype: \"git\";\n\t/** Clone URL (always valid for git clone, without ref suffix) */\n\trepo: string;\n\t/** Git host domain (e.g., \"github.com\") */\n\thost: string;\n\t/** Repository path (e.g., \"user/repo\") */\n\tpath: string;\n\t/** Git ref (branch, tag, commit) if specified */\n\tref?: string;\n\t/** True if ref was specified (package won't be auto-updated) */\n\tpinned: boolean;\n};\n\nfunction splitRef(url: string): { repo: string; ref?: string } {\n\tconst scpLikeMatch = url.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\tconst pathWithMaybeRef = scpLikeMatch[2] ?? \"\";\n\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\tif (refSeparator < 0) return { repo: url };\n\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\tif (!repoPath || !ref) return { repo: url };\n\t\treturn {\n\t\t\trepo: `git@${scpLikeMatch[1] ?? \"\"}:${repoPath}`,\n\t\t\tref,\n\t\t};\n\t}\n\n\tif (url.includes(\"://\")) {\n\t\ttry {\n\t\t\tconst parsed = new URL(url);\n\t\t\tconst pathWithMaybeRef = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\t\tif (refSeparator < 0) return { repo: url };\n\t\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\t\tif (!repoPath || !ref) return { repo: url };\n\t\t\tparsed.pathname = `/${repoPath}`;\n\t\t\treturn {\n\t\t\t\trepo: parsed.toString().replace(/\\/$/, \"\"),\n\t\t\t\tref,\n\t\t\t};\n\t\t} catch {\n\t\t\treturn { repo: url };\n\t\t}\n\t}\n\n\tconst slashIndex = url.indexOf(\"/\");\n\tif (slashIndex < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst host = url.slice(0, slashIndex);\n\tconst pathWithMaybeRef = url.slice(slashIndex + 1);\n\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\tif (refSeparator < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\tif (!repoPath || !ref) {\n\t\treturn { repo: url };\n\t}\n\treturn {\n\t\trepo: `${host}/${repoPath}`,\n\t\tref,\n\t};\n}\n\nfunction decodeForValidation(value: string): string | null {\n\ttry {\n\t\treturn decodeURIComponent(value);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction hasUnsafeGitInstallPart(value: string, allowSlash: boolean): boolean {\n\tconst decoded = decodeForValidation(value);\n\tif (decoded === null) {\n\t\treturn true;\n\t}\n\tconst candidates = [value, decoded];\n\tfor (const candidate of candidates) {\n\t\tif (candidate.includes(\"\\0\") || candidate.includes(\"\\\\\") || candidate.startsWith(\"/\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!allowSlash && candidate.includes(\"/\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (candidate.split(\"/\").includes(\"..\")) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction buildGitSource(args: { repo: string; host: string; path: string; ref?: string }): GitSource | null {\n\tif (args.path.startsWith(\"/\")) {\n\t\treturn null;\n\t}\n\tconst normalizedPath = args.path.replace(/\\.git$/, \"\").replace(/^\\/+/, \"\");\n\tif (!args.host || !normalizedPath || normalizedPath.split(\"/\").length < 2) {\n\t\treturn null;\n\t}\n\tif (hasUnsafeGitInstallPart(args.host, false) || hasUnsafeGitInstallPart(normalizedPath, true)) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\ttype: \"git\",\n\t\trepo: args.repo,\n\t\thost: args.host,\n\t\tpath: normalizedPath,\n\t\tref: args.ref,\n\t\tpinned: Boolean(args.ref),\n\t};\n}\n\nfunction parseGenericGitUrl(url: string): GitSource | null {\n\tconst { repo: repoWithoutRef, ref } = splitRef(url);\n\tlet repo = repoWithoutRef;\n\tlet host = \"\";\n\tlet path = \"\";\n\n\tconst scpLikeMatch = repoWithoutRef.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\thost = scpLikeMatch[1] ?? \"\";\n\t\tpath = scpLikeMatch[2] ?? \"\";\n\t} else if (\n\t\trepoWithoutRef.startsWith(\"https://\") ||\n\t\trepoWithoutRef.startsWith(\"http://\") ||\n\t\trepoWithoutRef.startsWith(\"ssh://\") ||\n\t\trepoWithoutRef.startsWith(\"git://\")\n\t) {\n\t\ttry {\n\t\t\tconst parsed = new URL(repoWithoutRef);\n\t\t\thost = parsed.hostname;\n\t\t\tpath = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\tconst slashIndex = repoWithoutRef.indexOf(\"/\");\n\t\tif (slashIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\thost = repoWithoutRef.slice(0, slashIndex);\n\t\tpath = repoWithoutRef.slice(slashIndex + 1);\n\t\tif (!host.includes(\".\") && host !== \"localhost\") {\n\t\t\treturn null;\n\t\t}\n\t\trepo = `https://${repoWithoutRef}`;\n\t}\n\n\treturn buildGitSource({ repo, host, path, ref });\n}\n\n/**\n * Parse git source into a GitSource.\n *\n * Rules:\n * - With git: prefix, accept all historical shorthand forms.\n * - Without git: prefix, only accept explicit protocol URLs.\n */\nexport function parseGitUrl(source: string): GitSource | null {\n\tconst trimmed = source.trim();\n\tconst hasGitPrefix = trimmed.startsWith(\"git:\");\n\tconst url = hasGitPrefix ? trimmed.slice(4).trim() : trimmed;\n\n\tif (!hasGitPrefix && !/^(https?|ssh|git):\\/\\//i.test(url)) {\n\t\treturn null;\n\t}\n\n\tconst split = splitRef(url);\n\n\tconst hostedCandidates = [split.ref ? `${split.repo}#${split.ref}` : undefined, url].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of hostedCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst useHttpsPrefix =\n\t\t\t\t!split.repo.startsWith(\"http://\") &&\n\t\t\t\t!split.repo.startsWith(\"https://\") &&\n\t\t\t\t!split.repo.startsWith(\"ssh://\") &&\n\t\t\t\t!split.repo.startsWith(\"git://\") &&\n\t\t\t\t!split.repo.startsWith(\"git@\");\n\t\t\treturn buildGitSource({\n\t\t\t\trepo: useHttpsPrefix ? `https://${split.repo}` : split.repo,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`,\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\tconst httpsCandidates = [split.ref ? `https://${split.repo}#${split.ref}` : undefined, `https://${url}`].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of httpsCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn buildGitSource({\n\t\t\t\trepo: `https://${split.repo}`,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`,\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn parseGenericGitUrl(url);\n}\n"]}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Open a URL or file in the platform browser/default handler.
3
+ *
4
+ * This intentionally never invokes a shell. On Windows, do not use
5
+ * `cmd /c start`: cmd.exe re-parses metacharacters (&, |, ^, ...) before
6
+ * `start` runs, which would make attacker-controlled URLs injectable.
7
+ */
8
+ export declare function openBrowser(target: string): void;
9
+ //# sourceMappingURL=open-browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-browser.d.ts","sourceRoot":"","sources":["../../src/utils/open-browser.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAchD","sourcesContent":["import { spawn } from \"node:child_process\";\n\n/**\n * Open a URL or file in the platform browser/default handler.\n *\n * This intentionally never invokes a shell. On Windows, do not use\n * `cmd /c start`: cmd.exe re-parses metacharacters (&, |, ^, ...) before\n * `start` runs, which would make attacker-controlled URLs injectable.\n */\nexport function openBrowser(target: string): void {\n\tconst [cmd, args]: [string, string[]] =\n\t\tprocess.platform === \"darwin\"\n\t\t\t? [\"open\", [target]]\n\t\t\t: process.platform === \"win32\"\n\t\t\t\t? [\"rundll32\", [\"url.dll,FileProtocolHandler\", target]]\n\t\t\t\t: [\"xdg-open\", [target]];\n\n\t// spawn reports launcher failures (for example, missing xdg-open) via an\n\t// error event. Browser launch is best-effort: callers still present the target\n\t// to the user, so keep the launcher failure from becoming a process crash.\n\tspawn(cmd, args, { stdio: \"ignore\", detached: true })\n\t\t.on(\"error\", () => {})\n\t\t.unref();\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { spawn } from "node:child_process";
2
+ /**
3
+ * Open a URL or file in the platform browser/default handler.
4
+ *
5
+ * This intentionally never invokes a shell. On Windows, do not use
6
+ * `cmd /c start`: cmd.exe re-parses metacharacters (&, |, ^, ...) before
7
+ * `start` runs, which would make attacker-controlled URLs injectable.
8
+ */
9
+ export function openBrowser(target) {
10
+ const [cmd, args] = process.platform === "darwin"
11
+ ? ["open", [target]]
12
+ : process.platform === "win32"
13
+ ? ["rundll32", ["url.dll,FileProtocolHandler", target]]
14
+ : ["xdg-open", [target]];
15
+ // spawn reports launcher failures (for example, missing xdg-open) via an
16
+ // error event. Browser launch is best-effort: callers still present the target
17
+ // to the user, so keep the launcher failure from becoming a process crash.
18
+ spawn(cmd, args, { stdio: "ignore", detached: true })
19
+ .on("error", () => { })
20
+ .unref();
21
+ }
22
+ //# sourceMappingURL=open-browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-browser.js","sourceRoot":"","sources":["../../src/utils/open-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc,EAAQ;IACjD,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAChB,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAC5B,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO;YAC7B,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAE5B,yEAAyE;IACzE,+EAA+E;IAC/E,2EAA2E;IAC3E,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SACnD,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;SACrB,KAAK,EAAE,CAAC;AAAA,CACV","sourcesContent":["import { spawn } from \"node:child_process\";\n\n/**\n * Open a URL or file in the platform browser/default handler.\n *\n * This intentionally never invokes a shell. On Windows, do not use\n * `cmd /c start`: cmd.exe re-parses metacharacters (&, |, ^, ...) before\n * `start` runs, which would make attacker-controlled URLs injectable.\n */\nexport function openBrowser(target: string): void {\n\tconst [cmd, args]: [string, string[]] =\n\t\tprocess.platform === \"darwin\"\n\t\t\t? [\"open\", [target]]\n\t\t\t: process.platform === \"win32\"\n\t\t\t\t? [\"rundll32\", [\"url.dll,FileProtocolHandler\", target]]\n\t\t\t\t: [\"xdg-open\", [target]];\n\n\t// spawn reports launcher failures (for example, missing xdg-open) via an\n\t// error event. Browser launch is best-effort: callers still present the target\n\t// to the user, so keep the launcher failure from becoming a process crash.\n\tspawn(cmd, args, { stdio: \"ignore\", detached: true })\n\t\t.on(\"error\", () => {})\n\t\t.unref();\n}\n"]}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/docs/docs.json CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/docs/index.md CHANGED
File without changes
package/docs/json.md CHANGED
File without changes
File without changes
package/docs/models.md CHANGED
File without changes
package/docs/packages.md CHANGED
File without changes
File without changes
package/docs/providers.md CHANGED
File without changes
File without changes
package/docs/rpc.md CHANGED
File without changes
package/docs/sdk.md CHANGED
File without changes
File without changes
package/docs/sessions.md CHANGED
File without changes
package/docs/settings.md CHANGED
File without changes
File without changes
package/docs/skills.md CHANGED
File without changes
File without changes
package/docs/termux.md CHANGED
File without changes
package/docs/themes.md CHANGED
File without changes
package/docs/tmux.md CHANGED
File without changes
package/docs/tui.md CHANGED
@@ -585,6 +585,24 @@ This pattern is NOT needed when:
585
585
 
586
586
  These patterns cover the most common UI needs in extensions. **Copy these patterns instead of building from scratch.**
587
587
 
588
+ ### Pattern 0: Title Badge
589
+
590
+ For compact status labels in custom messages, skill renderers, and `renderCall`/`renderResult`, use `TitleBadgeComponent` or `titleBadge()` from `@earendil-works/pi-coding-agent`. It keeps titles visually consistent, compact, and width-bounded. `ToolTitleComponent`/`toolTitle()` remain aliases for tool-specific code.
591
+
592
+ ```typescript
593
+ import { titleBadge } from "@earendil-works/pi-coding-agent";
594
+
595
+ renderCall(args, theme) {
596
+ return titleBadge(theme, {
597
+ label: "background script",
598
+ icon: "◆",
599
+ action: args.action || "list",
600
+ details: [args.id || args.name],
601
+ status: args.action === "stop" ? "warning" : "running",
602
+ });
603
+ }
604
+ ```
605
+
588
606
  ### Pattern 1: Selection Dialog (SelectList)
589
607
 
590
608
  For letting users pick from a list of options. Use `SelectList` from `@earendil-works/pi-tui` with `DynamicBorder` for framing.
package/docs/usage.md CHANGED
File without changes
package/docs/windows.md CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.80.8",
3
+ "version": "0.80.10",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.80.8",
9
+ "version": "0.80.10",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.80.8",
4
+ "version": "0.80.10",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",