@astralyn/pi 1.4.10 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (595) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/bundle/chunks/anthropic-messages-G5ZGBHOH.js +6 -0
  3. package/dist/bundle/chunks/azure-openai-responses-EMPTMYNF.js +2 -0
  4. package/dist/bundle/chunks/bedrock-converse-stream.js +22 -15
  5. package/dist/bundle/chunks/chunk-AXX7FFFD.js +2 -0
  6. package/dist/bundle/chunks/chunk-FNGB3ASD.js +2 -0
  7. package/dist/bundle/chunks/chunk-FPALVF3F.js +4 -0
  8. package/dist/bundle/chunks/chunk-H3UF54OB.js +9 -0
  9. package/dist/bundle/chunks/chunk-IC6JXX2J.js +10 -0
  10. package/dist/bundle/chunks/{chunk-UCH27AVQ.js → chunk-IRUUTK4W.js} +1 -1
  11. package/dist/bundle/chunks/{chunk-MZJC45TM.js → chunk-J7L6O5XA.js} +3 -3
  12. package/dist/bundle/chunks/{chunk-DLVLAQEG.js → chunk-KBFO53OG.js} +3 -3
  13. package/dist/bundle/chunks/{chunk-TPVFPFJP.js → chunk-P7VXFB2M.js} +1 -1
  14. package/dist/bundle/chunks/chunk-PSYLMRL6.js +9 -0
  15. package/dist/bundle/chunks/chunk-QNZARXLE.js +82 -0
  16. package/dist/bundle/chunks/chunk-R3YHAMWH.js +1503 -0
  17. package/dist/bundle/chunks/chunk-RAIYJ5FC.js +4 -0
  18. package/dist/bundle/chunks/{chunk-OV2VMHBX.js → chunk-SR6EWNPW.js} +1 -1
  19. package/dist/bundle/chunks/chunk-TA3YH2ZI.js +16 -0
  20. package/dist/bundle/chunks/{chunk-MF3T3ETJ.js → chunk-THAJ4BZF.js} +58 -62
  21. package/dist/bundle/chunks/{chunk-24FY4C5S.js → chunk-TRSJS3FM.js} +1 -1
  22. package/dist/bundle/chunks/chunk-ZRI3ICDE.js +2 -0
  23. package/dist/bundle/chunks/{cli-MBFCFGI2.js → cli-LAZQG54B.js} +11 -9
  24. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-7BKATOEJ.js → cloudflare-workers-ai-system-one-4L2ABUJE.js} +1 -1
  25. package/dist/bundle/chunks/{execute-FQKRO4XJ.js → execute-ACWDKC3C.js} +1 -1
  26. package/dist/bundle/chunks/github-copilot.js +1 -1
  27. package/dist/bundle/chunks/{google-generative-ai-HTUSU45F.js → google-generative-ai-OOVDGS5W.js} +1 -1
  28. package/dist/bundle/chunks/{google-vertex-AVQV4P76.js → google-vertex-IK5RNG7J.js} +1 -1
  29. package/dist/bundle/chunks/image-resize-worker.js +1 -1
  30. package/dist/bundle/chunks/kimi-coding.js +1 -1
  31. package/dist/bundle/chunks/{llama-cpp-classify-27QYLJZY.js → llama-cpp-classify-XHAVT37C.js} +1 -1
  32. package/dist/bundle/chunks/meta.js +1 -1
  33. package/dist/bundle/chunks/mistral-conversations-Z56KY4OJ.js +5 -0
  34. package/dist/bundle/chunks/{openai-codex-responses-Q25MHDFX.js → openai-codex-responses-5NAH3SK6.js} +1 -1
  35. package/dist/bundle/chunks/openai-completions-S7S6PO3J.js +7 -0
  36. package/dist/bundle/chunks/{openai-decisions-3WYFPGSK.js → openai-decisions-7A36EAHE.js} +1 -1
  37. package/dist/bundle/chunks/{openai-responses-E4BNZIQK.js → openai-responses-ZQRZJKH4.js} +1 -1
  38. package/dist/bundle/chunks/{openrouter-images-CBP3OPOD.js → openrouter-images-X7PX72ON.js} +1 -1
  39. package/dist/bundle/chunks/pi-messages-TXNWPLI4.js +8 -0
  40. package/dist/bundle/chunks/radius.js +1 -1
  41. package/dist/bundle/chunks/{runtime-3RPOJS5T.js → runtime-X3XOMNXQ.js} +1 -1
  42. package/dist/bundle/chunks/{typesafe-system-one-BNICP2LS.js → typesafe-system-one-XJGMSHWL.js} +1 -1
  43. package/dist/bundle/chunks/virtual-modules-T2KLVAFL.js +2 -0
  44. package/dist/bundle/cli.js +1 -1
  45. package/dist/bundle/index.js +1 -1
  46. package/dist/bundle/rpc-entry.js +1 -1
  47. package/dist/cli/args.d.ts.map +1 -1
  48. package/dist/cli/args.js +8 -7
  49. package/dist/cli/args.js.map +1 -1
  50. package/dist/config.d.ts +10 -0
  51. package/dist/config.d.ts.map +1 -1
  52. package/dist/config.js +24 -5
  53. package/dist/config.js.map +1 -1
  54. package/dist/core/agent-session-runtime.d.ts +0 -5
  55. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  56. package/dist/core/agent-session-runtime.js +12 -28
  57. package/dist/core/agent-session-runtime.js.map +1 -1
  58. package/dist/core/agent-session.d.ts +21 -14
  59. package/dist/core/agent-session.d.ts.map +1 -1
  60. package/dist/core/agent-session.js +67 -96
  61. package/dist/core/agent-session.js.map +1 -1
  62. package/dist/core/compaction/branch-summarization.d.ts +4 -2
  63. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  64. package/dist/core/compaction/branch-summarization.js +16 -4
  65. package/dist/core/compaction/branch-summarization.js.map +1 -1
  66. package/dist/core/exec.d.ts +9 -1
  67. package/dist/core/exec.d.ts.map +1 -1
  68. package/dist/core/exec.js +104 -60
  69. package/dist/core/exec.js.map +1 -1
  70. package/dist/core/export-html/template.css +9 -0
  71. package/dist/core/export-html/template.js +165 -45
  72. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  73. package/dist/core/export-html/tool-renderer.js +5 -0
  74. package/dist/core/export-html/tool-renderer.js.map +1 -1
  75. package/dist/core/extensions/index.d.ts +2 -2
  76. package/dist/core/extensions/index.d.ts.map +1 -1
  77. package/dist/core/extensions/index.js.map +1 -1
  78. package/dist/core/extensions/loader.d.ts.map +1 -1
  79. package/dist/core/extensions/loader.js +20 -12
  80. package/dist/core/extensions/loader.js.map +1 -1
  81. package/dist/core/extensions/pi-ai-extension-view.d.ts +19 -0
  82. package/dist/core/extensions/pi-ai-extension-view.d.ts.map +1 -0
  83. package/dist/core/extensions/pi-ai-extension-view.js +22 -0
  84. package/dist/core/extensions/pi-ai-extension-view.js.map +1 -0
  85. package/dist/core/extensions/runner.d.ts +0 -1
  86. package/dist/core/extensions/runner.d.ts.map +1 -1
  87. package/dist/core/extensions/runner.js +7 -12
  88. package/dist/core/extensions/runner.js.map +1 -1
  89. package/dist/core/extensions/types.d.ts +41 -23
  90. package/dist/core/extensions/types.d.ts.map +1 -1
  91. package/dist/core/extensions/types.js.map +1 -1
  92. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  93. package/dist/core/extensions/virtual-modules.js +8 -7
  94. package/dist/core/extensions/virtual-modules.js.map +1 -1
  95. package/dist/core/mcp-servers.d.ts +11 -4
  96. package/dist/core/mcp-servers.d.ts.map +1 -1
  97. package/dist/core/mcp-servers.js +15 -5
  98. package/dist/core/mcp-servers.js.map +1 -1
  99. package/dist/core/model-config.d.ts +1678 -2029
  100. package/dist/core/model-config.d.ts.map +1 -1
  101. package/dist/core/model-config.js +2 -3
  102. package/dist/core/model-config.js.map +1 -1
  103. package/dist/core/model-resolver.d.ts.map +1 -1
  104. package/dist/core/model-resolver.js +16 -10
  105. package/dist/core/model-resolver.js.map +1 -1
  106. package/dist/core/package-manager.d.ts +14 -0
  107. package/dist/core/package-manager.d.ts.map +1 -1
  108. package/dist/core/package-manager.js +160 -46
  109. package/dist/core/package-manager.js.map +1 -1
  110. package/dist/core/pi-ai-schemas.d.ts +163 -0
  111. package/dist/core/pi-ai-schemas.d.ts.map +1 -0
  112. package/dist/core/pi-ai-schemas.js +21 -0
  113. package/dist/core/pi-ai-schemas.js.map +1 -0
  114. package/dist/core/pi-manifest.d.ts +1 -0
  115. package/dist/core/pi-manifest.d.ts.map +1 -1
  116. package/dist/core/pi-manifest.js +4 -0
  117. package/dist/core/pi-manifest.js.map +1 -1
  118. package/dist/core/project-trust.js +1 -1
  119. package/dist/core/project-trust.js.map +1 -1
  120. package/dist/core/quiescence.d.ts +24 -0
  121. package/dist/core/quiescence.d.ts.map +1 -0
  122. package/dist/core/quiescence.js +81 -0
  123. package/dist/core/quiescence.js.map +1 -0
  124. package/dist/core/resource-loader.d.ts +4 -1
  125. package/dist/core/resource-loader.d.ts.map +1 -1
  126. package/dist/core/resource-loader.js +41 -28
  127. package/dist/core/resource-loader.js.map +1 -1
  128. package/dist/core/sdk.d.ts.map +1 -1
  129. package/dist/core/sdk.js +3 -1
  130. package/dist/core/sdk.js.map +1 -1
  131. package/dist/core/session-manager.d.ts +7 -0
  132. package/dist/core/session-manager.d.ts.map +1 -1
  133. package/dist/core/session-manager.js +32 -13
  134. package/dist/core/session-manager.js.map +1 -1
  135. package/dist/core/settings-manager.d.ts +2 -0
  136. package/dist/core/settings-manager.d.ts.map +1 -1
  137. package/dist/core/settings-manager.js +11 -0
  138. package/dist/core/settings-manager.js.map +1 -1
  139. package/dist/core/settings-schema.d.ts +4 -2
  140. package/dist/core/settings-schema.d.ts.map +1 -1
  141. package/dist/core/settings-schema.js +8 -1
  142. package/dist/core/settings-schema.js.map +1 -1
  143. package/dist/core/skills.d.ts.map +1 -1
  144. package/dist/core/skills.js +6 -14
  145. package/dist/core/skills.js.map +1 -1
  146. package/dist/core/slash-command-name.d.ts +6 -0
  147. package/dist/core/slash-command-name.d.ts.map +1 -0
  148. package/dist/core/slash-command-name.js +11 -0
  149. package/dist/core/slash-command-name.js.map +1 -0
  150. package/dist/core/slash-commands.js +2 -2
  151. package/dist/core/slash-commands.js.map +1 -1
  152. package/dist/core/source-info.d.ts +9 -0
  153. package/dist/core/source-info.d.ts.map +1 -1
  154. package/dist/core/source-info.js +13 -0
  155. package/dist/core/source-info.js.map +1 -1
  156. package/dist/core/system-prompt.d.ts.map +1 -1
  157. package/dist/core/system-prompt.js +5 -6
  158. package/dist/core/system-prompt.js.map +1 -1
  159. package/dist/core/tasks/codec.d.ts +14 -0
  160. package/dist/core/tasks/codec.d.ts.map +1 -1
  161. package/dist/core/tasks/codec.js +57 -4
  162. package/dist/core/tasks/codec.js.map +1 -1
  163. package/dist/core/tasks/delivery.d.ts +4 -20
  164. package/dist/core/tasks/delivery.d.ts.map +1 -1
  165. package/dist/core/tasks/delivery.js +5 -58
  166. package/dist/core/tasks/delivery.js.map +1 -1
  167. package/dist/core/tasks/limits.d.ts +3 -19
  168. package/dist/core/tasks/limits.d.ts.map +1 -1
  169. package/dist/core/tasks/limits.js +3 -24
  170. package/dist/core/tasks/limits.js.map +1 -1
  171. package/dist/core/tasks/record.d.ts +1 -7
  172. package/dist/core/tasks/record.d.ts.map +1 -1
  173. package/dist/core/tasks/record.js +0 -18
  174. package/dist/core/tasks/record.js.map +1 -1
  175. package/dist/core/tasks/reminder.d.ts +3 -2
  176. package/dist/core/tasks/reminder.d.ts.map +1 -1
  177. package/dist/core/tasks/reminder.js +4 -3
  178. package/dist/core/tasks/reminder.js.map +1 -1
  179. package/dist/core/tasks/runtime.d.ts +1 -14
  180. package/dist/core/tasks/runtime.d.ts.map +1 -1
  181. package/dist/core/tasks/runtime.js +3 -96
  182. package/dist/core/tasks/runtime.js.map +1 -1
  183. package/dist/core/tasks/session.d.ts +9 -5
  184. package/dist/core/tasks/session.d.ts.map +1 -1
  185. package/dist/core/tasks/session.js +22 -24
  186. package/dist/core/tasks/session.js.map +1 -1
  187. package/dist/core/tasks/types.d.ts +3 -92
  188. package/dist/core/tasks/types.d.ts.map +1 -1
  189. package/dist/core/tasks/types.js +3 -3
  190. package/dist/core/tasks/types.js.map +1 -1
  191. package/dist/core/tools/bash.d.ts +8 -7
  192. package/dist/core/tools/bash.d.ts.map +1 -1
  193. package/dist/core/tools/bash.js +6 -5
  194. package/dist/core/tools/bash.js.map +1 -1
  195. package/dist/core/tools/edit.d.ts +3 -3
  196. package/dist/core/tools/edit.d.ts.map +1 -1
  197. package/dist/core/tools/edit.js +2 -4
  198. package/dist/core/tools/edit.js.map +1 -1
  199. package/dist/core/tools/find.d.ts +2 -2
  200. package/dist/core/tools/find.d.ts.map +1 -1
  201. package/dist/core/tools/find.js.map +1 -1
  202. package/dist/core/tools/grep.d.ts +2 -2
  203. package/dist/core/tools/grep.d.ts.map +1 -1
  204. package/dist/core/tools/grep.js +1 -1
  205. package/dist/core/tools/grep.js.map +1 -1
  206. package/dist/core/tools/ls.d.ts +2 -2
  207. package/dist/core/tools/ls.d.ts.map +1 -1
  208. package/dist/core/tools/ls.js.map +1 -1
  209. package/dist/core/tools/powershell.d.ts +1 -5
  210. package/dist/core/tools/powershell.d.ts.map +1 -1
  211. package/dist/core/tools/read.d.ts +2 -2
  212. package/dist/core/tools/read.d.ts.map +1 -1
  213. package/dist/core/tools/read.js.map +1 -1
  214. package/dist/core/tools/render-utils.d.ts +4 -6
  215. package/dist/core/tools/render-utils.d.ts.map +1 -1
  216. package/dist/core/tools/render-utils.js +19 -41
  217. package/dist/core/tools/render-utils.js.map +1 -1
  218. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  219. package/dist/core/tools/renderers/bash.js +3 -25
  220. package/dist/core/tools/renderers/bash.js.map +1 -1
  221. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  222. package/dist/core/tools/renderers/write.js +18 -19
  223. package/dist/core/tools/renderers/write.js.map +1 -1
  224. package/dist/core/tools/shell-execution.d.ts +20 -13
  225. package/dist/core/tools/shell-execution.d.ts.map +1 -1
  226. package/dist/core/tools/shell-execution.js +165 -183
  227. package/dist/core/tools/shell-execution.js.map +1 -1
  228. package/dist/core/tools/shell-tool.d.ts +9 -14
  229. package/dist/core/tools/shell-tool.d.ts.map +1 -1
  230. package/dist/core/tools/shell-tool.js +38 -66
  231. package/dist/core/tools/shell-tool.js.map +1 -1
  232. package/dist/core/tools/tool-definition-wrapper.d.ts +14 -4
  233. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  234. package/dist/core/tools/tool-definition-wrapper.js +2 -3
  235. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  236. package/dist/core/tools/write.d.ts +2 -2
  237. package/dist/core/tools/write.d.ts.map +1 -1
  238. package/dist/core/tools/write.js.map +1 -1
  239. package/dist/core/trust-manager.d.ts.map +1 -1
  240. package/dist/core/trust-manager.js +30 -13
  241. package/dist/core/trust-manager.js.map +1 -1
  242. package/dist/core/usage-totals.d.ts +0 -9
  243. package/dist/core/usage-totals.d.ts.map +1 -1
  244. package/dist/core/usage-totals.js +24 -91
  245. package/dist/core/usage-totals.js.map +1 -1
  246. package/dist/extensions/agent/activity-lines.d.ts +2 -3
  247. package/dist/extensions/agent/activity-lines.d.ts.map +1 -1
  248. package/dist/extensions/agent/activity-lines.js +5 -9
  249. package/dist/extensions/agent/activity-lines.js.map +1 -1
  250. package/dist/extensions/agent/activity.d.ts +0 -2
  251. package/dist/extensions/agent/activity.d.ts.map +1 -1
  252. package/dist/extensions/agent/activity.js +1 -1
  253. package/dist/extensions/agent/activity.js.map +1 -1
  254. package/dist/extensions/agent/progress.d.ts +0 -3
  255. package/dist/extensions/agent/progress.d.ts.map +1 -1
  256. package/dist/extensions/agent/progress.js +2 -8
  257. package/dist/extensions/agent/progress.js.map +1 -1
  258. package/dist/extensions/agent/render.js +1 -1
  259. package/dist/extensions/agent/render.js.map +1 -1
  260. package/dist/extensions/agent/tool.d.ts.map +1 -1
  261. package/dist/extensions/agent/tool.js +0 -6
  262. package/dist/extensions/agent/tool.js.map +1 -1
  263. package/dist/{core/isolated-session.d.ts → extensions/agent/worker-session.d.ts} +6 -6
  264. package/dist/extensions/agent/worker-session.d.ts.map +1 -0
  265. package/dist/{core/isolated-session.js → extensions/agent/worker-session.js} +9 -9
  266. package/dist/extensions/agent/worker-session.js.map +1 -0
  267. package/dist/extensions/agent/worker.d.ts +0 -3
  268. package/dist/extensions/agent/worker.d.ts.map +1 -1
  269. package/dist/extensions/agent/worker.js +2 -3
  270. package/dist/extensions/agent/worker.js.map +1 -1
  271. package/dist/extensions/btw/agent.d.ts.map +1 -1
  272. package/dist/extensions/btw/agent.js +2 -1
  273. package/dist/extensions/btw/agent.js.map +1 -1
  274. package/dist/extensions/cached-compaction/render.d.ts.map +1 -1
  275. package/dist/extensions/cached-compaction/render.js +3 -3
  276. package/dist/extensions/cached-compaction/render.js.map +1 -1
  277. package/dist/extensions/cached-compaction/summary.d.ts +1 -1
  278. package/dist/extensions/cached-compaction/summary.d.ts.map +1 -1
  279. package/dist/extensions/cached-compaction/summary.js +13 -16
  280. package/dist/extensions/cached-compaction/summary.js.map +1 -1
  281. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  282. package/dist/extensions/codemode/renderer.js +6 -2
  283. package/dist/extensions/codemode/renderer.js.map +1 -1
  284. package/dist/extensions/codemode/tool.d.ts +2 -1
  285. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  286. package/dist/extensions/codemode/tool.js +33 -8
  287. package/dist/extensions/codemode/tool.js.map +1 -1
  288. package/dist/extensions/deepwiki/schema.d.ts.map +1 -1
  289. package/dist/extensions/deepwiki/schema.js +1 -1
  290. package/dist/extensions/deepwiki/schema.js.map +1 -1
  291. package/dist/extensions/llama/ui.d.ts.map +1 -1
  292. package/dist/extensions/llama/ui.js +16 -4
  293. package/dist/extensions/llama/ui.js.map +1 -1
  294. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  295. package/dist/extensions/mcp/cli.js +34 -8
  296. package/dist/extensions/mcp/cli.js.map +1 -1
  297. package/dist/extensions/mcp/oauth.d.ts +1 -1
  298. package/dist/extensions/mcp/oauth.d.ts.map +1 -1
  299. package/dist/extensions/mcp/oauth.js +36 -13
  300. package/dist/extensions/mcp/oauth.js.map +1 -1
  301. package/dist/extensions/mcp/ui.d.ts +1 -0
  302. package/dist/extensions/mcp/ui.d.ts.map +1 -1
  303. package/dist/extensions/mcp/ui.js +33 -24
  304. package/dist/extensions/mcp/ui.js.map +1 -1
  305. package/dist/extensions/run-summary/index.d.ts +1 -1
  306. package/dist/extensions/run-summary/index.d.ts.map +1 -1
  307. package/dist/extensions/run-summary/index.js +11 -23
  308. package/dist/extensions/run-summary/index.js.map +1 -1
  309. package/dist/extensions/statusline/usage.d.ts.map +1 -1
  310. package/dist/extensions/statusline/usage.js +2 -1
  311. package/dist/extensions/statusline/usage.js.map +1 -1
  312. package/dist/extensions/tasks/tool/actions.d.ts +1 -2
  313. package/dist/extensions/tasks/tool/actions.d.ts.map +1 -1
  314. package/dist/extensions/tasks/tool/actions.js +7 -79
  315. package/dist/extensions/tasks/tool/actions.js.map +1 -1
  316. package/dist/extensions/tasks/tool/constants.d.ts +1 -3
  317. package/dist/extensions/tasks/tool/constants.d.ts.map +1 -1
  318. package/dist/extensions/tasks/tool/constants.js +1 -3
  319. package/dist/extensions/tasks/tool/constants.js.map +1 -1
  320. package/dist/extensions/tasks/tool/schema.d.ts +1 -2
  321. package/dist/extensions/tasks/tool/schema.d.ts.map +1 -1
  322. package/dist/extensions/tasks/tool/schema.js +7 -15
  323. package/dist/extensions/tasks/tool/schema.js.map +1 -1
  324. package/dist/extensions/tasks/tool/types.d.ts +1 -19
  325. package/dist/extensions/tasks/tool/types.d.ts.map +1 -1
  326. package/dist/extensions/tasks/tool/types.js.map +1 -1
  327. package/dist/extensions/tasks/tool.d.ts +1 -2
  328. package/dist/extensions/tasks/tool.d.ts.map +1 -1
  329. package/dist/extensions/tasks/tool.js +2 -4
  330. package/dist/extensions/tasks/tool.js.map +1 -1
  331. package/dist/extensions/tasks/ui/completion-render.d.ts +5 -1
  332. package/dist/extensions/tasks/ui/completion-render.d.ts.map +1 -1
  333. package/dist/extensions/tasks/ui/completion-render.js +25 -70
  334. package/dist/extensions/tasks/ui/completion-render.js.map +1 -1
  335. package/dist/extensions/tasks/ui/inspector.d.ts +1 -1
  336. package/dist/extensions/tasks/ui/inspector.d.ts.map +1 -1
  337. package/dist/extensions/tasks/ui/inspector.js +0 -6
  338. package/dist/extensions/tasks/ui/inspector.js.map +1 -1
  339. package/dist/extensions/tasks/ui/manager.d.ts +1 -1
  340. package/dist/extensions/tasks/ui/manager.d.ts.map +1 -1
  341. package/dist/extensions/tasks/ui/manager.js.map +1 -1
  342. package/dist/extensions/tasks/ui/render.d.ts +2 -16
  343. package/dist/extensions/tasks/ui/render.d.ts.map +1 -1
  344. package/dist/extensions/tasks/ui/render.js +3 -79
  345. package/dist/extensions/tasks/ui/render.js.map +1 -1
  346. package/dist/extensions/tasks/ui/views.d.ts +2 -4
  347. package/dist/extensions/tasks/ui/views.d.ts.map +1 -1
  348. package/dist/extensions/tasks/ui/views.js +3 -7
  349. package/dist/extensions/tasks/ui/views.js.map +1 -1
  350. package/dist/extensions/tool-presentation/fallback.d.ts.map +1 -0
  351. package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/fallback.js +5 -5
  352. package/dist/extensions/tool-presentation/fallback.js.map +1 -0
  353. package/dist/extensions/tool-presentation/index.js +1 -1
  354. package/dist/extensions/tool-presentation/index.js.map +1 -1
  355. package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/shell.d.ts +1 -1
  356. package/dist/extensions/tool-presentation/shell.d.ts.map +1 -0
  357. package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/shell.js +3 -3
  358. package/dist/extensions/tool-presentation/shell.js.map +1 -0
  359. package/dist/extensions/tool-search/tool.d.ts +21 -6
  360. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  361. package/dist/extensions/tool-search/tool.js +104 -36
  362. package/dist/extensions/tool-search/tool.js.map +1 -1
  363. package/dist/index.d.ts +3 -3
  364. package/dist/index.d.ts.map +1 -1
  365. package/dist/index.js.map +1 -1
  366. package/dist/main.d.ts.map +1 -1
  367. package/dist/main.js +15 -8
  368. package/dist/main.js.map +1 -1
  369. package/dist/modes/interactive/components/assistant-message.d.ts +5 -3
  370. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  371. package/dist/modes/interactive/components/assistant-message.js +61 -45
  372. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  373. package/dist/modes/interactive/components/config-selector-skills.d.ts +54 -0
  374. package/dist/modes/interactive/components/config-selector-skills.d.ts.map +1 -0
  375. package/dist/modes/interactive/components/config-selector-skills.js +178 -0
  376. package/dist/modes/interactive/components/config-selector-skills.js.map +1 -0
  377. package/dist/modes/interactive/components/config-selector.d.ts +2 -11
  378. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  379. package/dist/modes/interactive/components/config-selector.js +31 -181
  380. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  381. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  382. package/dist/modes/interactive/components/custom-editor.js +7 -0
  383. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  384. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  385. package/dist/modes/interactive/components/custom-entry.js +2 -1
  386. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  387. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  388. package/dist/modes/interactive/components/custom-message.js +2 -1
  389. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  390. package/dist/modes/interactive/components/extension-editor.d.ts +2 -0
  391. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  392. package/dist/modes/interactive/components/extension-editor.js +4 -0
  393. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  394. package/dist/modes/interactive/components/login-dialog.d.ts +5 -0
  395. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  396. package/dist/modes/interactive/components/login-dialog.js +103 -10
  397. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  398. package/dist/modes/interactive/components/markdown-transform.d.ts +2 -1
  399. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
  400. package/dist/modes/interactive/components/markdown-transform.js +3 -2
  401. package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
  402. package/dist/modes/interactive/components/model-selector.d.ts +1 -0
  403. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  404. package/dist/modes/interactive/components/model-selector.js +17 -6
  405. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  406. package/dist/modes/interactive/components/oauth-selector.d.ts +1 -0
  407. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  408. package/dist/modes/interactive/components/oauth-selector.js +13 -4
  409. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  410. package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -0
  411. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  412. package/dist/modes/interactive/components/scoped-models-selector.js +14 -3
  413. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  414. package/dist/modes/interactive/components/session-selector-search.d.ts +4 -0
  415. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  416. package/dist/modes/interactive/components/session-selector-search.js +86 -22
  417. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  418. package/dist/modes/interactive/components/session-selector.d.ts +2 -1
  419. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  420. package/dist/modes/interactive/components/session-selector.js +15 -23
  421. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  422. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  423. package/dist/modes/interactive/components/settings-submenu.js +2 -0
  424. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  425. package/dist/modes/interactive/components/tool-execution.d.ts +7 -0
  426. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  427. package/dist/modes/interactive/components/tool-execution.js +48 -9
  428. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  429. package/dist/modes/interactive/components/tree-selector.d.ts +1 -0
  430. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  431. package/dist/modes/interactive/components/tree-selector.js +5 -6
  432. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  433. package/dist/modes/interactive/components/user-message-selector.d.ts +1 -0
  434. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  435. package/dist/modes/interactive/components/user-message-selector.js +9 -1
  436. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  437. package/dist/modes/interactive/components/user-message.d.ts +3 -1
  438. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  439. package/dist/modes/interactive/components/user-message.js +4 -2
  440. package/dist/modes/interactive/components/user-message.js.map +1 -1
  441. package/dist/modes/interactive/editor-host.d.ts.map +1 -1
  442. package/dist/modes/interactive/editor-host.js +3 -2
  443. package/dist/modes/interactive/editor-host.js.map +1 -1
  444. package/dist/modes/interactive/external-editor.d.ts +1 -0
  445. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  446. package/dist/modes/interactive/external-editor.js +17 -5
  447. package/dist/modes/interactive/external-editor.js.map +1 -1
  448. package/dist/modes/interactive/interactive-mode.d.ts +8 -12
  449. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  450. package/dist/modes/interactive/interactive-mode.js +169 -112
  451. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  452. package/dist/modes/interactive/model-search.d.ts +10 -0
  453. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  454. package/dist/modes/interactive/model-search.js +21 -0
  455. package/dist/modes/interactive/model-search.js.map +1 -1
  456. package/dist/modes/interactive/theme/theme.d.ts +10 -0
  457. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  458. package/dist/modes/interactive/theme/theme.js +30 -23
  459. package/dist/modes/interactive/theme/theme.js.map +1 -1
  460. package/dist/modes/interactive/tool-view/chat.d.ts +2 -2
  461. package/dist/modes/interactive/tool-view/chat.d.ts.map +1 -1
  462. package/dist/modes/interactive/tool-view/chat.js +22 -19
  463. package/dist/modes/interactive/tool-view/chat.js.map +1 -1
  464. package/dist/modes/interactive/transcript-layout.d.ts +2 -0
  465. package/dist/modes/interactive/transcript-layout.d.ts.map +1 -1
  466. package/dist/modes/interactive/transcript-layout.js +5 -2
  467. package/dist/modes/interactive/transcript-layout.js.map +1 -1
  468. package/dist/modes/print-mode.d.ts.map +1 -1
  469. package/dist/modes/print-mode.js +1 -0
  470. package/dist/modes/print-mode.js.map +1 -1
  471. package/dist/modes/rpc/rpc-client.d.ts +9 -1
  472. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  473. package/dist/modes/rpc/rpc-client.js +23 -23
  474. package/dist/modes/rpc/rpc-client.js.map +1 -1
  475. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  476. package/dist/modes/rpc/rpc-mode.js +1 -3
  477. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  478. package/dist/package-manager-cli.d.ts.map +1 -1
  479. package/dist/package-manager-cli.js +55 -4
  480. package/dist/package-manager-cli.js.map +1 -1
  481. package/dist/utils/ansi.d.ts.map +1 -1
  482. package/dist/utils/ansi.js +5 -2
  483. package/dist/utils/ansi.js.map +1 -1
  484. package/dist/utils/clipboard-command.d.ts.map +1 -1
  485. package/dist/utils/clipboard-command.js +4 -0
  486. package/dist/utils/clipboard-command.js.map +1 -1
  487. package/dist/utils/git.d.ts +1 -1
  488. package/dist/utils/git.d.ts.map +1 -1
  489. package/dist/utils/git.js.map +1 -1
  490. package/dist/utils/image-resize-core.d.ts.map +1 -1
  491. package/dist/utils/image-resize-core.js +5 -3
  492. package/dist/utils/image-resize-core.js.map +1 -1
  493. package/dist/utils/open-browser.d.ts.map +1 -1
  494. package/dist/utils/open-browser.js +4 -1
  495. package/dist/utils/open-browser.js.map +1 -1
  496. package/dist/utils/paths.d.ts +17 -0
  497. package/dist/utils/paths.d.ts.map +1 -1
  498. package/dist/utils/paths.js +42 -1
  499. package/dist/utils/paths.js.map +1 -1
  500. package/dist/utils/shell.d.ts.map +1 -1
  501. package/dist/utils/shell.js +14 -0
  502. package/dist/utils/shell.js.map +1 -1
  503. package/dist/utils/syntax-highlight.d.ts +5 -0
  504. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  505. package/dist/utils/syntax-highlight.js +7 -0
  506. package/dist/utils/syntax-highlight.js.map +1 -1
  507. package/dist/utils/tools-manager.d.ts.map +1 -1
  508. package/dist/utils/tools-manager.js +30 -35
  509. package/dist/utils/tools-manager.js.map +1 -1
  510. package/dist/utils/usage.d.ts +5 -0
  511. package/dist/utils/usage.d.ts.map +1 -0
  512. package/dist/utils/usage.js +16 -0
  513. package/dist/utils/usage.js.map +1 -0
  514. package/docs/bundled/README.md +1 -1
  515. package/docs/bundled/extensions/agent.md +7 -7
  516. package/docs/bundled/extensions/run-summary.md +4 -4
  517. package/docs/bundled/extensions/statusline.md +1 -1
  518. package/docs/bundled/tasks.md +12 -27
  519. package/docs/bundled/tool-presentation.md +2 -2
  520. package/docs/custom-provider.md +1 -1
  521. package/docs/environment-variables.md +2 -0
  522. package/docs/extensions.md +41 -28
  523. package/docs/keybindings.md +1 -1
  524. package/docs/llama-cpp.md +17 -12
  525. package/docs/mcp.md +6 -4
  526. package/docs/models-configuration.md +1 -1
  527. package/docs/models.md +7 -85
  528. package/docs/packages.md +26 -1
  529. package/docs/rpc.md +1 -1
  530. package/docs/sdk.md +10 -8
  531. package/docs/session-format.md +3 -3
  532. package/docs/sessions.md +10 -0
  533. package/docs/settings.md +5 -4
  534. package/docs/terminal-setup.md +2 -2
  535. package/docs/tmux.md +6 -0
  536. package/docs/tui.md +12 -7
  537. package/docs/usage.md +19 -9
  538. package/docs/windows.md +29 -0
  539. package/examples/extensions/README.md +2 -1
  540. package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
  541. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  542. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  543. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  544. package/examples/extensions/debug-provider.ts +2 -2
  545. package/examples/extensions/gondolin/package-lock.json +19 -29
  546. package/examples/extensions/gondolin/package.json +2 -2
  547. package/examples/extensions/preset.ts +2 -0
  548. package/examples/extensions/reload-runtime.ts +17 -5
  549. package/examples/extensions/tools.ts +2 -0
  550. package/examples/extensions/with-deps/package-lock.json +2 -2
  551. package/examples/extensions/with-deps/package.json +1 -1
  552. package/package.json +11 -12
  553. package/schemas/models.schema.json +36 -36
  554. package/schemas/settings.schema.json +17 -0
  555. package/dist/bundle/chunks/anthropic-messages-HWL6AS7T.js +0 -6
  556. package/dist/bundle/chunks/azure-openai-responses-4YYPDYV5.js +0 -2
  557. package/dist/bundle/chunks/chunk-6GTUUUCJ.js +0 -1499
  558. package/dist/bundle/chunks/chunk-6JS2SOFO.js +0 -11
  559. package/dist/bundle/chunks/chunk-ANCZPKX7.js +0 -2
  560. package/dist/bundle/chunks/chunk-FEZ5RM2B.js +0 -2
  561. package/dist/bundle/chunks/chunk-LPF7HQ3S.js +0 -4
  562. package/dist/bundle/chunks/chunk-MMNIHCU7.js +0 -2
  563. package/dist/bundle/chunks/chunk-R267VV5T.js +0 -82
  564. package/dist/bundle/chunks/chunk-RVKT7OUB.js +0 -9
  565. package/dist/bundle/chunks/chunk-SA2AQYEI.js +0 -7
  566. package/dist/bundle/chunks/chunk-ZAIGBRV5.js +0 -16
  567. package/dist/bundle/chunks/mistral-conversations-V2JJTMJ5.js +0 -5
  568. package/dist/bundle/chunks/openai-completions-TXZXILJR.js +0 -7
  569. package/dist/bundle/chunks/pi-messages-LBJQ4NGP.js +0 -8
  570. package/dist/bundle/chunks/virtual-modules-6IJ6V2CG.js +0 -2
  571. package/dist/core/isolated-session.d.ts.map +0 -1
  572. package/dist/core/isolated-session.js.map +0 -1
  573. package/dist/core/tasks/wait.d.ts +0 -19
  574. package/dist/core/tasks/wait.d.ts.map +0 -1
  575. package/dist/core/tasks/wait.js +0 -45
  576. package/dist/core/tasks/wait.js.map +0 -1
  577. package/dist/modes/interactive/tool-view/fallback.d.ts.map +0 -1
  578. package/dist/modes/interactive/tool-view/fallback.js.map +0 -1
  579. package/dist/modes/interactive/tool-view/shell.d.ts.map +0 -1
  580. package/dist/modes/interactive/tool-view/shell.js.map +0 -1
  581. package/dist/modes/interactive/tool-view/tool-execution.d.ts +0 -14
  582. package/dist/modes/interactive/tool-view/tool-execution.d.ts.map +0 -1
  583. package/dist/modes/interactive/tool-view/tool-execution.js +0 -13
  584. package/dist/modes/interactive/tool-view/tool-execution.js.map +0 -1
  585. package/dist/utils/path-identity.d.ts +0 -12
  586. package/dist/utils/path-identity.d.ts.map +0 -1
  587. package/dist/utils/path-identity.js +0 -63
  588. package/dist/utils/path-identity.js.map +0 -1
  589. package/docs/images/doom-extension.png +0 -0
  590. package/docs/images/exy.png +0 -0
  591. package/examples/extensions/sandbox/index.ts +0 -321
  592. package/examples/extensions/sandbox/package-lock.json +0 -92
  593. package/examples/extensions/sandbox/package.json +0 -19
  594. package/npm-shrinkwrap.json +0 -4207
  595. /package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/fallback.d.ts +0 -0
@@ -1,321 +0,0 @@
1
- /**
2
- * Sandbox Extension - OS-level sandboxing for bash commands
3
- *
4
- * Uses @anthropic-ai/sandbox-runtime to enforce filesystem and network
5
- * restrictions on bash commands at the OS level (sandbox-exec on macOS,
6
- * bubblewrap on Linux).
7
- *
8
- * Note: this example intentionally overrides the built-in `bash` tool to show
9
- * how built-in tools can be replaced. Alternatively, you could sandbox `bash`
10
- * via `tool_call` input mutation without replacing the tool.
11
- *
12
- * Config files (merged, project takes precedence):
13
- * - ~/.pi/agent/extensions/sandbox.json (global)
14
- * - <cwd>/.pi/sandbox.json (project-local)
15
- *
16
- * Example .pi/sandbox.json:
17
- * ```json
18
- * {
19
- * "enabled": true,
20
- * "network": {
21
- * "allowedDomains": ["github.com", "*.github.com"],
22
- * "deniedDomains": []
23
- * },
24
- * "filesystem": {
25
- * "denyRead": ["~/.ssh", "~/.aws"],
26
- * "allowWrite": [".", "/tmp"],
27
- * "denyWrite": [".env"]
28
- * }
29
- * }
30
- * ```
31
- *
32
- * Usage:
33
- * - `pi -e ./sandbox` - sandbox enabled with default/config settings
34
- * - `pi -e ./sandbox --no-sandbox` - disable sandboxing
35
- * - `/sandbox` - show current sandbox configuration
36
- *
37
- * Setup:
38
- * 1. Copy sandbox/ directory to ~/.pi/agent/extensions/
39
- * 2. Run `npm install` in ~/.pi/agent/extensions/sandbox/
40
- *
41
- * Linux also requires: bubblewrap, socat, ripgrep
42
- */
43
-
44
- import { spawn } from "node:child_process";
45
- import { existsSync, readFileSync } from "node:fs";
46
- import { join } from "node:path";
47
- import { SandboxManager, type SandboxRuntimeConfig } from "@anthropic-ai/sandbox-runtime";
48
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
49
- import { type BashOperations, CONFIG_DIR_NAME, createBashTool, getAgentDir } from "@earendil-works/pi-coding-agent";
50
-
51
- interface SandboxConfig extends SandboxRuntimeConfig {
52
- enabled?: boolean;
53
- }
54
-
55
- const DEFAULT_CONFIG: SandboxConfig = {
56
- enabled: true,
57
- network: {
58
- allowedDomains: [
59
- "npmjs.org",
60
- "*.npmjs.org",
61
- "registry.npmjs.org",
62
- "registry.yarnpkg.com",
63
- "pypi.org",
64
- "*.pypi.org",
65
- "github.com",
66
- "*.github.com",
67
- "api.github.com",
68
- "raw.githubusercontent.com",
69
- ],
70
- deniedDomains: [],
71
- },
72
- filesystem: {
73
- denyRead: ["~/.ssh", "~/.aws", "~/.gnupg"],
74
- allowWrite: [".", "/tmp"],
75
- denyWrite: [".env", ".env.*", "*.pem", "*.key"],
76
- },
77
- };
78
-
79
- function loadConfig(cwd: string): SandboxConfig {
80
- const projectConfigPath = join(cwd, CONFIG_DIR_NAME, "sandbox.json");
81
- const globalConfigPath = join(getAgentDir(), "extensions", "sandbox.json");
82
-
83
- let globalConfig: Partial<SandboxConfig> = {};
84
- let projectConfig: Partial<SandboxConfig> = {};
85
-
86
- if (existsSync(globalConfigPath)) {
87
- try {
88
- globalConfig = JSON.parse(readFileSync(globalConfigPath, "utf-8"));
89
- } catch (e) {
90
- console.error(`Warning: Could not parse ${globalConfigPath}: ${e}`);
91
- }
92
- }
93
-
94
- if (existsSync(projectConfigPath)) {
95
- try {
96
- projectConfig = JSON.parse(readFileSync(projectConfigPath, "utf-8"));
97
- } catch (e) {
98
- console.error(`Warning: Could not parse ${projectConfigPath}: ${e}`);
99
- }
100
- }
101
-
102
- return deepMerge(deepMerge(DEFAULT_CONFIG, globalConfig), projectConfig);
103
- }
104
-
105
- function deepMerge(base: SandboxConfig, overrides: Partial<SandboxConfig>): SandboxConfig {
106
- const result: SandboxConfig = { ...base };
107
-
108
- if (overrides.enabled !== undefined) result.enabled = overrides.enabled;
109
- if (overrides.network) {
110
- result.network = { ...base.network, ...overrides.network };
111
- }
112
- if (overrides.filesystem) {
113
- result.filesystem = { ...base.filesystem, ...overrides.filesystem };
114
- }
115
-
116
- const extOverrides = overrides as {
117
- ignoreViolations?: Record<string, string[]>;
118
- enableWeakerNestedSandbox?: boolean;
119
- };
120
- const extResult = result as { ignoreViolations?: Record<string, string[]>; enableWeakerNestedSandbox?: boolean };
121
-
122
- if (extOverrides.ignoreViolations) {
123
- extResult.ignoreViolations = extOverrides.ignoreViolations;
124
- }
125
- if (extOverrides.enableWeakerNestedSandbox !== undefined) {
126
- extResult.enableWeakerNestedSandbox = extOverrides.enableWeakerNestedSandbox;
127
- }
128
-
129
- return result;
130
- }
131
-
132
- function createSandboxedBashOps(): BashOperations {
133
- return {
134
- async exec(command, cwd, { onData, signal, timeout }) {
135
- if (!existsSync(cwd)) {
136
- throw new Error(`Working directory does not exist: ${cwd}`);
137
- }
138
-
139
- const wrappedCommand = await SandboxManager.wrapWithSandbox(command);
140
-
141
- return new Promise((resolve, reject) => {
142
- const child = spawn("bash", ["-c", wrappedCommand], {
143
- cwd,
144
- detached: true,
145
- stdio: ["ignore", "pipe", "pipe"],
146
- });
147
-
148
- let timedOut = false;
149
- let timeoutHandle: NodeJS.Timeout | undefined;
150
-
151
- if (timeout !== undefined && timeout > 0) {
152
- timeoutHandle = setTimeout(() => {
153
- timedOut = true;
154
- if (child.pid) {
155
- try {
156
- process.kill(-child.pid, "SIGKILL");
157
- } catch {
158
- child.kill("SIGKILL");
159
- }
160
- }
161
- }, timeout * 1000);
162
- }
163
-
164
- child.stdout?.on("data", onData);
165
- child.stderr?.on("data", onData);
166
-
167
- child.on("error", (err) => {
168
- if (timeoutHandle) clearTimeout(timeoutHandle);
169
- reject(err);
170
- });
171
-
172
- const onAbort = () => {
173
- if (child.pid) {
174
- try {
175
- process.kill(-child.pid, "SIGKILL");
176
- } catch {
177
- child.kill("SIGKILL");
178
- }
179
- }
180
- };
181
-
182
- signal?.addEventListener("abort", onAbort, { once: true });
183
-
184
- child.on("close", (code) => {
185
- if (timeoutHandle) clearTimeout(timeoutHandle);
186
- signal?.removeEventListener("abort", onAbort);
187
-
188
- if (signal?.aborted) {
189
- reject(new Error("aborted"));
190
- } else if (timedOut) {
191
- reject(new Error(`timeout:${timeout}`));
192
- } else {
193
- resolve({ exitCode: code });
194
- }
195
- });
196
- });
197
- },
198
- };
199
- }
200
-
201
- export default function (pi: ExtensionAPI) {
202
- pi.registerFlag("no-sandbox", {
203
- description: "Disable OS-level sandboxing for bash commands",
204
- type: "boolean",
205
- default: false,
206
- });
207
-
208
- const localCwd = process.cwd();
209
- const localBash = createBashTool(localCwd);
210
-
211
- let sandboxEnabled = false;
212
- let sandboxInitialized = false;
213
-
214
- pi.registerTool({
215
- ...localBash,
216
- label: "bash (sandboxed)",
217
- async execute(id, params, signal, onUpdate, _ctx) {
218
- if (!sandboxEnabled || !sandboxInitialized) {
219
- return localBash.execute(id, params, signal, onUpdate);
220
- }
221
-
222
- const sandboxedBash = createBashTool(localCwd, {
223
- operations: createSandboxedBashOps(),
224
- });
225
- return sandboxedBash.execute(id, params, signal, onUpdate);
226
- },
227
- });
228
-
229
- pi.on("user_bash", () => {
230
- if (!sandboxEnabled || !sandboxInitialized) return;
231
- return { operations: createSandboxedBashOps() };
232
- });
233
-
234
- pi.on("session_start", async (_event, ctx) => {
235
- const noSandbox = pi.getFlag("no-sandbox") as boolean;
236
-
237
- if (noSandbox) {
238
- sandboxEnabled = false;
239
- ctx.ui.notify("Sandbox disabled via --no-sandbox", "warning");
240
- return;
241
- }
242
-
243
- const config = loadConfig(ctx.cwd);
244
-
245
- if (!config.enabled) {
246
- sandboxEnabled = false;
247
- ctx.ui.notify("Sandbox disabled via config", "info");
248
- return;
249
- }
250
-
251
- const platform = process.platform;
252
- if (platform !== "darwin" && platform !== "linux") {
253
- sandboxEnabled = false;
254
- ctx.ui.notify(`Sandbox not supported on ${platform}`, "warning");
255
- return;
256
- }
257
-
258
- try {
259
- const configExt = config as unknown as {
260
- ignoreViolations?: Record<string, string[]>;
261
- enableWeakerNestedSandbox?: boolean;
262
- };
263
-
264
- await SandboxManager.initialize({
265
- network: config.network,
266
- filesystem: config.filesystem,
267
- ignoreViolations: configExt.ignoreViolations,
268
- enableWeakerNestedSandbox: configExt.enableWeakerNestedSandbox,
269
- });
270
-
271
- sandboxEnabled = true;
272
- sandboxInitialized = true;
273
-
274
- const networkCount = config.network?.allowedDomains?.length ?? 0;
275
- const writeCount = config.filesystem?.allowWrite?.length ?? 0;
276
- ctx.ui.setStatus(
277
- "sandbox",
278
- ctx.ui.theme.fg("accent", `🔒 Sandbox: ${networkCount} domains, ${writeCount} write paths`),
279
- );
280
- ctx.ui.notify("Sandbox initialized", "info");
281
- } catch (err) {
282
- sandboxEnabled = false;
283
- ctx.ui.notify(`Sandbox initialization failed: ${err instanceof Error ? err.message : err}`, "error");
284
- }
285
- });
286
-
287
- pi.on("session_shutdown", async () => {
288
- if (sandboxInitialized) {
289
- try {
290
- await SandboxManager.reset();
291
- } catch {
292
- // Ignore cleanup errors
293
- }
294
- }
295
- });
296
-
297
- pi.registerCommand("sandbox", {
298
- description: "Show sandbox configuration",
299
- handler: async (_args, ctx) => {
300
- if (!sandboxEnabled) {
301
- ctx.ui.notify("Sandbox is disabled", "info");
302
- return;
303
- }
304
-
305
- const config = loadConfig(ctx.cwd);
306
- const lines = [
307
- "Sandbox Configuration:",
308
- "",
309
- "Network:",
310
- ` Allowed: ${config.network?.allowedDomains?.join(", ") || "(none)"}`,
311
- ` Denied: ${config.network?.deniedDomains?.join(", ") || "(none)"}`,
312
- "",
313
- "Filesystem:",
314
- ` Deny Read: ${config.filesystem?.denyRead?.join(", ") || "(none)"}`,
315
- ` Allow Write: ${config.filesystem?.allowWrite?.join(", ") || "(none)"}`,
316
- ` Deny Write: ${config.filesystem?.denyWrite?.join(", ") || "(none)"}`,
317
- ];
318
- ctx.ui.notify(lines.join("\n"), "info");
319
- },
320
- });
321
- }
@@ -1,92 +0,0 @@
1
- {
2
- "name": "pi-extension-sandbox",
3
- "version": "1.4.0",
4
- "lockfileVersion": 3,
5
- "requires": true,
6
- "packages": {
7
- "": {
8
- "name": "pi-extension-sandbox",
9
- "version": "1.4.0",
10
- "dependencies": {
11
- "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
- }
13
- },
14
- "node_modules/@anthropic-ai/sandbox-runtime": {
15
- "version": "0.0.26",
16
- "resolved": "https://registry.npmjs.org/@anthropic-ai/sandbox-runtime/-/sandbox-runtime-0.0.26.tgz",
17
- "integrity": "sha512-DYV5LSsVMnzq0lbfaYMSpxZPUMAx4+hy343dRss+pVCLIfF62qOhxpYfZ5TmOk1GTDQm5f9wPprMNSStmnsV4w==",
18
- "license": "Apache-2.0",
19
- "dependencies": {
20
- "@pondwader/socks5-server": "^1.0.10",
21
- "@types/lodash-es": "^4.17.12",
22
- "commander": "^12.1.0",
23
- "lodash-es": "^4.17.21",
24
- "shell-quote": "^1.8.3",
25
- "zod": "^3.24.1"
26
- },
27
- "bin": {
28
- "srt": "dist/cli.js"
29
- },
30
- "engines": {
31
- "node": ">=18.0.0"
32
- }
33
- },
34
- "node_modules/@pondwader/socks5-server": {
35
- "version": "1.0.10",
36
- "resolved": "https://registry.npmjs.org/@pondwader/socks5-server/-/socks5-server-1.0.10.tgz",
37
- "integrity": "sha512-bQY06wzzR8D2+vVCUoBsr5QS2U6UgPUQRmErNwtsuI6vLcyRKkafjkr3KxbtGFf9aBBIV2mcvlsKD1UYaIV+sg==",
38
- "license": "MIT"
39
- },
40
- "node_modules/@types/lodash": {
41
- "version": "4.17.23",
42
- "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.23.tgz",
43
- "integrity": "sha512-RDvF6wTulMPjrNdCoYRC8gNR880JNGT8uB+REUpC2Ns4pRqQJhGz90wh7rgdXDPpCczF3VGktDuFGVnz8zP7HA==",
44
- "license": "MIT"
45
- },
46
- "node_modules/@types/lodash-es": {
47
- "version": "4.17.12",
48
- "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz",
49
- "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
50
- "license": "MIT",
51
- "dependencies": {
52
- "@types/lodash": "*"
53
- }
54
- },
55
- "node_modules/commander": {
56
- "version": "12.1.0",
57
- "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
58
- "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
59
- "license": "MIT",
60
- "engines": {
61
- "node": ">=18"
62
- }
63
- },
64
- "node_modules/lodash-es": {
65
- "version": "4.18.1",
66
- "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz",
67
- "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==",
68
- "license": "MIT"
69
- },
70
- "node_modules/shell-quote": {
71
- "version": "1.8.3",
72
- "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz",
73
- "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==",
74
- "license": "MIT",
75
- "engines": {
76
- "node": ">= 0.4"
77
- },
78
- "funding": {
79
- "url": "https://github.com/sponsors/ljharb"
80
- }
81
- },
82
- "node_modules/zod": {
83
- "version": "3.25.76",
84
- "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
85
- "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
86
- "license": "MIT",
87
- "funding": {
88
- "url": "https://github.com/sponsors/colinhacks"
89
- }
90
- }
91
- }
92
- }
@@ -1,19 +0,0 @@
1
- {
2
- "name": "pi-extension-sandbox",
3
- "private": true,
4
- "version": "1.4.0",
5
- "type": "module",
6
- "scripts": {
7
- "clean": "echo 'nothing to clean'",
8
- "build": "echo 'nothing to build'",
9
- "check": "echo 'nothing to check'"
10
- },
11
- "pi": {
12
- "extensions": [
13
- "./index.ts"
14
- ]
15
- },
16
- "dependencies": {
17
- "@anthropic-ai/sandbox-runtime": "0.0.26"
18
- }
19
- }