@code-yeongyu/senpi 2026.6.14 → 2026.6.16

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 (317) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/dist/core/compaction/compaction.d.ts.map +1 -1
  3. package/dist/core/compaction/compaction.js +5 -0
  4. package/dist/core/compaction/compaction.js.map +1 -1
  5. package/dist/core/extensions/builtin/bash-timeout/index.d.ts.map +1 -1
  6. package/dist/core/extensions/builtin/bash-timeout/index.js +3 -1
  7. package/dist/core/extensions/builtin/bash-timeout/index.js.map +1 -1
  8. package/dist/core/extensions/builtin/bash-timeout/timeout.js +2 -2
  9. package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
  10. package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
  11. package/dist/core/extensions/builtin/compaction/speculative.js +24 -12
  12. package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
  13. package/dist/core/extensions/builtin/goal/command.d.ts +14 -0
  14. package/dist/core/extensions/builtin/goal/command.d.ts.map +1 -0
  15. package/dist/core/extensions/builtin/goal/command.js +16 -0
  16. package/dist/core/extensions/builtin/goal/command.js.map +1 -0
  17. package/dist/core/extensions/builtin/goal/continuation.d.ts +4 -0
  18. package/dist/core/extensions/builtin/goal/continuation.d.ts.map +1 -0
  19. package/dist/core/extensions/builtin/goal/continuation.js +7 -0
  20. package/dist/core/extensions/builtin/goal/continuation.js.map +1 -0
  21. package/dist/core/extensions/builtin/goal/errors.d.ts +13 -0
  22. package/dist/core/extensions/builtin/goal/errors.d.ts.map +1 -0
  23. package/dist/core/extensions/builtin/goal/errors.js +25 -0
  24. package/dist/core/extensions/builtin/goal/errors.js.map +1 -0
  25. package/dist/core/extensions/builtin/goal/format.d.ts +8 -0
  26. package/dist/core/extensions/builtin/goal/format.d.ts.map +1 -0
  27. package/dist/core/extensions/builtin/goal/format.js +71 -0
  28. package/dist/core/extensions/builtin/goal/format.js.map +1 -0
  29. package/dist/core/extensions/builtin/goal/index.d.ts +3 -0
  30. package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -0
  31. package/dist/core/extensions/builtin/goal/index.js +322 -0
  32. package/dist/core/extensions/builtin/goal/index.js.map +1 -0
  33. package/dist/core/extensions/builtin/goal/prompt.d.ts +3 -0
  34. package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -0
  35. package/dist/core/extensions/builtin/goal/prompt.js +34 -0
  36. package/dist/core/extensions/builtin/goal/prompt.js.map +1 -0
  37. package/dist/core/extensions/builtin/goal/store.d.ts +9 -0
  38. package/dist/core/extensions/builtin/goal/store.d.ts.map +1 -0
  39. package/dist/core/extensions/builtin/goal/store.js +173 -0
  40. package/dist/core/extensions/builtin/goal/store.js.map +1 -0
  41. package/dist/core/extensions/builtin/goal/types.d.ts +50 -0
  42. package/dist/core/extensions/builtin/goal/types.d.ts.map +1 -0
  43. package/dist/core/extensions/builtin/goal/types.js +6 -0
  44. package/dist/core/extensions/builtin/goal/types.js.map +1 -0
  45. package/dist/core/extensions/builtin/goal/ui.d.ts +6 -0
  46. package/dist/core/extensions/builtin/goal/ui.d.ts.map +1 -0
  47. package/dist/core/extensions/builtin/goal/ui.js +20 -0
  48. package/dist/core/extensions/builtin/goal/ui.js.map +1 -0
  49. package/dist/core/extensions/builtin/goal/validation.d.ts +3 -0
  50. package/dist/core/extensions/builtin/goal/validation.d.ts.map +1 -0
  51. package/dist/core/extensions/builtin/goal/validation.js +13 -0
  52. package/dist/core/extensions/builtin/goal/validation.js.map +1 -0
  53. package/dist/core/extensions/builtin/index.d.ts.map +1 -1
  54. package/dist/core/extensions/builtin/index.js +10 -2
  55. package/dist/core/extensions/builtin/index.js.map +1 -1
  56. package/dist/core/extensions/builtin/nested-agents-md/core/containment.d.ts +10 -0
  57. package/dist/core/extensions/builtin/nested-agents-md/core/containment.d.ts.map +1 -0
  58. package/dist/core/extensions/builtin/nested-agents-md/core/containment.js +23 -0
  59. package/dist/core/extensions/builtin/nested-agents-md/core/containment.js.map +1 -0
  60. package/dist/core/extensions/builtin/nested-agents-md/core/errors.d.ts +5 -0
  61. package/dist/core/extensions/builtin/nested-agents-md/core/errors.d.ts.map +1 -0
  62. package/dist/core/extensions/builtin/nested-agents-md/core/errors.js +9 -0
  63. package/dist/core/extensions/builtin/nested-agents-md/core/errors.js.map +1 -0
  64. package/dist/core/extensions/builtin/nested-agents-md/core/find-agents-md-up.d.ts +7 -0
  65. package/dist/core/extensions/builtin/nested-agents-md/core/find-agents-md-up.d.ts.map +1 -0
  66. package/dist/core/extensions/builtin/nested-agents-md/core/find-agents-md-up.js +44 -0
  67. package/dist/core/extensions/builtin/nested-agents-md/core/find-agents-md-up.js.map +1 -0
  68. package/dist/core/extensions/builtin/nested-agents-md/core/format.d.ts +7 -0
  69. package/dist/core/extensions/builtin/nested-agents-md/core/format.d.ts.map +1 -0
  70. package/dist/core/extensions/builtin/nested-agents-md/core/format.js +7 -0
  71. package/dist/core/extensions/builtin/nested-agents-md/core/format.js.map +1 -0
  72. package/dist/core/extensions/builtin/nested-agents-md/core/inject-directory-context.d.ts +11 -0
  73. package/dist/core/extensions/builtin/nested-agents-md/core/inject-directory-context.d.ts.map +1 -0
  74. package/dist/core/extensions/builtin/nested-agents-md/core/inject-directory-context.js +77 -0
  75. package/dist/core/extensions/builtin/nested-agents-md/core/inject-directory-context.js.map +1 -0
  76. package/dist/core/extensions/builtin/nested-agents-md/core/injection-cache.d.ts +11 -0
  77. package/dist/core/extensions/builtin/nested-agents-md/core/injection-cache.d.ts.map +1 -0
  78. package/dist/core/extensions/builtin/nested-agents-md/core/injection-cache.js +33 -0
  79. package/dist/core/extensions/builtin/nested-agents-md/core/injection-cache.js.map +1 -0
  80. package/dist/core/extensions/builtin/nested-agents-md/core/session-key.d.ts +8 -0
  81. package/dist/core/extensions/builtin/nested-agents-md/core/session-key.d.ts.map +1 -0
  82. package/dist/core/extensions/builtin/nested-agents-md/core/session-key.js +8 -0
  83. package/dist/core/extensions/builtin/nested-agents-md/core/session-key.js.map +1 -0
  84. package/dist/core/extensions/builtin/nested-agents-md/core/truncate.d.ts +8 -0
  85. package/dist/core/extensions/builtin/nested-agents-md/core/truncate.d.ts.map +1 -0
  86. package/dist/core/extensions/builtin/nested-agents-md/core/truncate.js +26 -0
  87. package/dist/core/extensions/builtin/nested-agents-md/core/truncate.js.map +1 -0
  88. package/dist/core/extensions/builtin/nested-agents-md/core/types.d.ts +25 -0
  89. package/dist/core/extensions/builtin/nested-agents-md/core/types.d.ts.map +1 -0
  90. package/dist/core/extensions/builtin/nested-agents-md/core/types.js +4 -0
  91. package/dist/core/extensions/builtin/nested-agents-md/core/types.js.map +1 -0
  92. package/dist/core/extensions/builtin/nested-agents-md/index.d.ts +3 -0
  93. package/dist/core/extensions/builtin/nested-agents-md/index.d.ts.map +1 -0
  94. package/dist/core/extensions/builtin/nested-agents-md/index.js +102 -0
  95. package/dist/core/extensions/builtin/nested-agents-md/index.js.map +1 -0
  96. package/dist/core/extensions/builtin/nested-agents-md/ui/reporter.d.ts +32 -0
  97. package/dist/core/extensions/builtin/nested-agents-md/ui/reporter.d.ts.map +1 -0
  98. package/dist/core/extensions/builtin/nested-agents-md/ui/reporter.js +66 -0
  99. package/dist/core/extensions/builtin/nested-agents-md/ui/reporter.js.map +1 -0
  100. package/dist/core/extensions/builtin/prompt-preset/presets.js +2 -2
  101. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  102. package/dist/core/extensions/builtin/rules/commands.d.ts +4 -0
  103. package/dist/core/extensions/builtin/rules/commands.d.ts.map +1 -0
  104. package/dist/core/extensions/builtin/rules/commands.js +87 -0
  105. package/dist/core/extensions/builtin/rules/commands.js.map +1 -0
  106. package/dist/core/extensions/builtin/rules/index.d.ts +3 -0
  107. package/dist/core/extensions/builtin/rules/index.d.ts.map +1 -0
  108. package/dist/core/extensions/builtin/rules/index.js +127 -0
  109. package/dist/core/extensions/builtin/rules/index.js.map +1 -0
  110. package/dist/core/extensions/builtin/rules/rules/cache.d.ts +10 -0
  111. package/dist/core/extensions/builtin/rules/rules/cache.d.ts.map +1 -0
  112. package/dist/core/extensions/builtin/rules/rules/cache.js +51 -0
  113. package/dist/core/extensions/builtin/rules/rules/cache.js.map +1 -0
  114. package/dist/core/extensions/builtin/rules/rules/constants.d.ts +57 -0
  115. package/dist/core/extensions/builtin/rules/rules/constants.d.ts.map +1 -0
  116. package/dist/core/extensions/builtin/rules/rules/constants.js +96 -0
  117. package/dist/core/extensions/builtin/rules/rules/constants.js.map +1 -0
  118. package/dist/core/extensions/builtin/rules/rules/engine.d.ts +67 -0
  119. package/dist/core/extensions/builtin/rules/rules/engine.d.ts.map +1 -0
  120. package/dist/core/extensions/builtin/rules/rules/engine.js +443 -0
  121. package/dist/core/extensions/builtin/rules/rules/engine.js.map +1 -0
  122. package/dist/core/extensions/builtin/rules/rules/errors.d.ts +7 -0
  123. package/dist/core/extensions/builtin/rules/rules/errors.d.ts.map +1 -0
  124. package/dist/core/extensions/builtin/rules/rules/errors.js +13 -0
  125. package/dist/core/extensions/builtin/rules/rules/errors.js.map +1 -0
  126. package/dist/core/extensions/builtin/rules/rules/finder.d.ts +27 -0
  127. package/dist/core/extensions/builtin/rules/rules/finder.d.ts.map +1 -0
  128. package/dist/core/extensions/builtin/rules/rules/finder.js +241 -0
  129. package/dist/core/extensions/builtin/rules/rules/finder.js.map +1 -0
  130. package/dist/core/extensions/builtin/rules/rules/formatter.d.ts +8 -0
  131. package/dist/core/extensions/builtin/rules/rules/formatter.d.ts.map +1 -0
  132. package/dist/core/extensions/builtin/rules/rules/formatter.js +44 -0
  133. package/dist/core/extensions/builtin/rules/rules/formatter.js.map +1 -0
  134. package/dist/core/extensions/builtin/rules/rules/matcher.d.ts +25 -0
  135. package/dist/core/extensions/builtin/rules/rules/matcher.d.ts.map +1 -0
  136. package/dist/core/extensions/builtin/rules/rules/matcher.js +107 -0
  137. package/dist/core/extensions/builtin/rules/rules/matcher.js.map +1 -0
  138. package/dist/core/extensions/builtin/rules/rules/ordering.d.ts +4 -0
  139. package/dist/core/extensions/builtin/rules/rules/ordering.d.ts.map +1 -0
  140. package/dist/core/extensions/builtin/rules/rules/ordering.js +28 -0
  141. package/dist/core/extensions/builtin/rules/rules/ordering.js.map +1 -0
  142. package/dist/core/extensions/builtin/rules/rules/parser.d.ts +4 -0
  143. package/dist/core/extensions/builtin/rules/rules/parser.d.ts.map +1 -0
  144. package/dist/core/extensions/builtin/rules/rules/parser.js +290 -0
  145. package/dist/core/extensions/builtin/rules/rules/parser.js.map +1 -0
  146. package/dist/core/extensions/builtin/rules/rules/project-root.d.ts +2 -0
  147. package/dist/core/extensions/builtin/rules/rules/project-root.d.ts.map +1 -0
  148. package/dist/core/extensions/builtin/rules/rules/project-root.js +24 -0
  149. package/dist/core/extensions/builtin/rules/rules/project-root.js.map +1 -0
  150. package/dist/core/extensions/builtin/rules/rules/scanner.d.ts +14 -0
  151. package/dist/core/extensions/builtin/rules/rules/scanner.d.ts.map +1 -0
  152. package/dist/core/extensions/builtin/rules/rules/scanner.js +96 -0
  153. package/dist/core/extensions/builtin/rules/rules/scanner.js.map +1 -0
  154. package/dist/core/extensions/builtin/rules/rules/tool-paths.d.ts +4 -0
  155. package/dist/core/extensions/builtin/rules/rules/tool-paths.d.ts.map +1 -0
  156. package/dist/core/extensions/builtin/rules/rules/tool-paths.js +37 -0
  157. package/dist/core/extensions/builtin/rules/rules/tool-paths.js.map +1 -0
  158. package/dist/core/extensions/builtin/rules/rules/truncator.d.ts +18 -0
  159. package/dist/core/extensions/builtin/rules/rules/truncator.d.ts.map +1 -0
  160. package/dist/core/extensions/builtin/rules/rules/truncator.js +46 -0
  161. package/dist/core/extensions/builtin/rules/rules/truncator.js.map +1 -0
  162. package/dist/core/extensions/builtin/rules/rules/types.d.ts +124 -0
  163. package/dist/core/extensions/builtin/rules/rules/types.d.ts.map +1 -0
  164. package/dist/core/extensions/builtin/rules/rules/types.js +9 -0
  165. package/dist/core/extensions/builtin/rules/rules/types.js.map +1 -0
  166. package/dist/core/extensions/builtin/rules/ui/dynamic-border.d.ts +8 -0
  167. package/dist/core/extensions/builtin/rules/ui/dynamic-border.d.ts.map +1 -0
  168. package/dist/core/extensions/builtin/rules/ui/dynamic-border.js +10 -0
  169. package/dist/core/extensions/builtin/rules/ui/dynamic-border.js.map +1 -0
  170. package/dist/core/extensions/builtin/rules/ui/rules-banner.d.ts +22 -0
  171. package/dist/core/extensions/builtin/rules/ui/rules-banner.d.ts.map +1 -0
  172. package/dist/core/extensions/builtin/rules/ui/rules-banner.js +51 -0
  173. package/dist/core/extensions/builtin/rules/ui/rules-banner.js.map +1 -0
  174. package/dist/core/extensions/builtin/webfetch/index.d.ts +10 -0
  175. package/dist/core/extensions/builtin/webfetch/index.d.ts.map +1 -0
  176. package/dist/core/extensions/builtin/webfetch/index.js +53 -0
  177. package/dist/core/extensions/builtin/webfetch/index.js.map +1 -0
  178. package/dist/core/extensions/builtin/webfetch/webfetch/content.d.ts +4 -0
  179. package/dist/core/extensions/builtin/webfetch/webfetch/content.d.ts.map +1 -0
  180. package/dist/core/extensions/builtin/webfetch/webfetch/content.js +60 -0
  181. package/dist/core/extensions/builtin/webfetch/webfetch/content.js.map +1 -0
  182. package/dist/core/extensions/builtin/webfetch/webfetch/errors.d.ts +13 -0
  183. package/dist/core/extensions/builtin/webfetch/webfetch/errors.d.ts.map +1 -0
  184. package/dist/core/extensions/builtin/webfetch/webfetch/errors.js +25 -0
  185. package/dist/core/extensions/builtin/webfetch/webfetch/errors.js.map +1 -0
  186. package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.d.ts +24 -0
  187. package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.d.ts.map +1 -0
  188. package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.js +148 -0
  189. package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.js.map +1 -0
  190. package/dist/core/extensions/builtin/webfetch/webfetch/renderers.d.ts +15 -0
  191. package/dist/core/extensions/builtin/webfetch/webfetch/renderers.d.ts.map +1 -0
  192. package/dist/core/extensions/builtin/webfetch/webfetch/renderers.js +110 -0
  193. package/dist/core/extensions/builtin/webfetch/webfetch/renderers.js.map +1 -0
  194. package/dist/core/extensions/builtin/webfetch/webfetch/tool.d.ts +28 -0
  195. package/dist/core/extensions/builtin/webfetch/webfetch/tool.d.ts.map +1 -0
  196. package/dist/core/extensions/builtin/webfetch/webfetch/tool.js +79 -0
  197. package/dist/core/extensions/builtin/webfetch/webfetch/tool.js.map +1 -0
  198. package/dist/core/extensions/builtin/websearch/index.d.ts +3 -0
  199. package/dist/core/extensions/builtin/websearch/index.d.ts.map +1 -0
  200. package/dist/core/extensions/builtin/websearch/index.js +76 -0
  201. package/dist/core/extensions/builtin/websearch/index.js.map +1 -0
  202. package/dist/core/extensions/builtin/websearch/websearch/config.d.ts +12 -0
  203. package/dist/core/extensions/builtin/websearch/websearch/config.d.ts.map +1 -0
  204. package/dist/core/extensions/builtin/websearch/websearch/config.js +245 -0
  205. package/dist/core/extensions/builtin/websearch/websearch/config.js.map +1 -0
  206. package/dist/core/extensions/builtin/websearch/websearch/native.d.ts +19 -0
  207. package/dist/core/extensions/builtin/websearch/websearch/native.d.ts.map +1 -0
  208. package/dist/core/extensions/builtin/websearch/websearch/native.js +65 -0
  209. package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -0
  210. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.d.ts +5 -0
  211. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.d.ts.map +1 -0
  212. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js +58 -0
  213. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js.map +1 -0
  214. package/dist/core/extensions/builtin/websearch/websearch/providers.d.ts +4 -0
  215. package/dist/core/extensions/builtin/websearch/websearch/providers.d.ts.map +1 -0
  216. package/dist/core/extensions/builtin/websearch/websearch/providers.js +464 -0
  217. package/dist/core/extensions/builtin/websearch/websearch/providers.js.map +1 -0
  218. package/dist/core/extensions/builtin/websearch/websearch/renderers.d.ts +26 -0
  219. package/dist/core/extensions/builtin/websearch/websearch/renderers.d.ts.map +1 -0
  220. package/dist/core/extensions/builtin/websearch/websearch/renderers.js +66 -0
  221. package/dist/core/extensions/builtin/websearch/websearch/renderers.js.map +1 -0
  222. package/dist/core/extensions/builtin/websearch/websearch/search.d.ts +9 -0
  223. package/dist/core/extensions/builtin/websearch/websearch/search.d.ts.map +1 -0
  224. package/dist/core/extensions/builtin/websearch/websearch/search.js +261 -0
  225. package/dist/core/extensions/builtin/websearch/websearch/search.js.map +1 -0
  226. package/dist/core/extensions/builtin/websearch/websearch/tool.d.ts +18 -0
  227. package/dist/core/extensions/builtin/websearch/websearch/tool.d.ts.map +1 -0
  228. package/dist/core/extensions/builtin/websearch/websearch/tool.js +88 -0
  229. package/dist/core/extensions/builtin/websearch/websearch/tool.js.map +1 -0
  230. package/dist/core/extensions/builtin/websearch/websearch/types.d.ts +115 -0
  231. package/dist/core/extensions/builtin/websearch/websearch/types.d.ts.map +1 -0
  232. package/dist/core/extensions/builtin/websearch/websearch/types.js +2 -0
  233. package/dist/core/extensions/builtin/websearch/websearch/types.js.map +1 -0
  234. package/dist/core/extensions/runner.d.ts.map +1 -1
  235. package/dist/core/extensions/runner.js +8 -1
  236. package/dist/core/extensions/runner.js.map +1 -1
  237. package/dist/core/tools/bash.d.ts.map +1 -1
  238. package/dist/core/tools/bash.js +4 -0
  239. package/dist/core/tools/bash.js.map +1 -1
  240. package/dist/main.d.ts +5 -0
  241. package/dist/main.d.ts.map +1 -1
  242. package/dist/main.js +8 -4
  243. package/dist/main.js.map +1 -1
  244. package/dist/modes/interactive/components/diff.d.ts +14 -0
  245. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  246. package/dist/modes/interactive/components/diff.js +65 -1
  247. package/dist/modes/interactive/components/diff.js.map +1 -1
  248. package/dist/modes/interactive/components/session-selector.d.ts +0 -1
  249. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  250. package/dist/modes/interactive/components/session-selector.js +0 -4
  251. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  252. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  253. package/dist/modes/interactive/components/tree-selector.js +87 -12
  254. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  255. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  256. package/dist/modes/interactive/interactive-mode.js +6 -17
  257. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  258. package/dist/utils/child-process.d.ts +7 -4
  259. package/dist/utils/child-process.d.ts.map +1 -1
  260. package/dist/utils/child-process.js +23 -5
  261. package/dist/utils/child-process.js.map +1 -1
  262. package/docs/containerization.md +36 -36
  263. package/docs/extensions.md +4 -4
  264. package/docs/index.md +1 -1
  265. package/docs/security.md +13 -13
  266. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  267. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  268. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  269. package/examples/extensions/gondolin/package-lock.json +2 -2
  270. package/examples/extensions/gondolin/package.json +1 -1
  271. package/examples/extensions/question.ts +39 -18
  272. package/examples/extensions/questionnaire.ts +49 -28
  273. package/examples/extensions/sandbox/package-lock.json +2 -2
  274. package/examples/extensions/sandbox/package.json +1 -1
  275. package/examples/extensions/with-deps/package-lock.json +2 -2
  276. package/examples/extensions/with-deps/package.json +1 -1
  277. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  278. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +5 -0
  279. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  280. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  281. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  282. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +140 -47
  283. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  284. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +169 -122
  285. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  286. package/node_modules/@earendil-works/pi-ai/dist/models.js +4 -1
  287. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  288. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  289. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +18 -1
  290. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
  291. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +2 -1
  292. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -1
  293. package/node_modules/@earendil-works/pi-ai/dist/providers/google.js +2 -1
  294. package/node_modules/@earendil-works/pi-ai/dist/providers/google.js.map +1 -1
  295. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  296. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +20 -2
  297. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
  298. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +2 -0
  299. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  300. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  301. package/node_modules/@earendil-works/pi-ai/dist/utils/tool-choice-fallback.d.ts +5 -0
  302. package/node_modules/@earendil-works/pi-ai/dist/utils/tool-choice-fallback.d.ts.map +1 -0
  303. package/node_modules/@earendil-works/pi-ai/dist/utils/tool-choice-fallback.js +41 -0
  304. package/node_modules/@earendil-works/pi-ai/dist/utils/tool-choice-fallback.js.map +1 -0
  305. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  306. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  307. package/node_modules/@earendil-works/pi-tui/dist/tui.js +14 -1
  308. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  309. package/node_modules/@earendil-works/pi-tui/dist/utils.js +1 -1
  310. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  311. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  312. package/npm-shrinkwrap.json +45 -12
  313. package/package.json +8 -4
  314. package/dist/core/extensions/builtin/kimi-web-search/index.d.ts +0 -3
  315. package/dist/core/extensions/builtin/kimi-web-search/index.d.ts.map +0 -1
  316. package/dist/core/extensions/builtin/kimi-web-search/index.js +0 -208
  317. package/dist/core/extensions/builtin/kimi-web-search/index.js.map +0 -1
@@ -6,10 +6,13 @@ export declare function spawnProcessSync(command: string, args: string[], option
6
6
  /**
7
7
  * Wait for a child process to terminate without hanging on inherited stdio handles.
8
8
  *
9
- * On Windows, daemonized descendants can inherit the child's stdout/stderr pipe
10
- * handles. In that case the child emits `exit`, but `close` can hang forever even
11
- * though the original process is already gone. We wait briefly for stdio to end,
12
- * then forcibly stop tracking the inherited handles.
9
+ * A short-lived child can `exit` while a detached descendant keeps its stdout/stderr
10
+ * pipe open. We must not resolve and destroy the streams on a fixed deadline measured
11
+ * from `exit`, or output still being written past that deadline is silently lost
12
+ * (earendil-works/pi#5303). Instead, after `exit` we wait for the pipes to fall idle:
13
+ * the grace timer is re-armed on every chunk, so an actively writing descendant keeps
14
+ * us reading, while a quiet inherited handle (e.g. a Windows daemonized descendant
15
+ * that never lets `close` fire) still releases us after the grace elapses.
13
16
  */
14
17
  export declare function waitForChildProcess(child: ChildProcess): Promise<number | null>;
15
18
  //# sourceMappingURL=child-process.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"child-process.d.ts","sourceRoot":"","sources":["../../src/utils/child-process.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAGxB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,kCAAkC,EACvC,KAAK,gBAAgB,EACrB,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wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAAC;AAKnG,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,kCAAkC,GACzC,gBAAgB,CAAC,MAAM,CAAC,CAI1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAwF/E"}
@@ -12,10 +12,13 @@ export function spawnProcessSync(command, args, options) {
12
12
  /**
13
13
  * Wait for a child process to terminate without hanging on inherited stdio handles.
14
14
  *
15
- * On Windows, daemonized descendants can inherit the child's stdout/stderr pipe
16
- * handles. In that case the child emits `exit`, but `close` can hang forever even
17
- * though the original process is already gone. We wait briefly for stdio to end,
18
- * then forcibly stop tracking the inherited handles.
15
+ * A short-lived child can `exit` while a detached descendant keeps its stdout/stderr
16
+ * pipe open. We must not resolve and destroy the streams on a fixed deadline measured
17
+ * from `exit`, or output still being written past that deadline is silently lost
18
+ * (earendil-works/pi#5303). Instead, after `exit` we wait for the pipes to fall idle:
19
+ * the grace timer is re-armed on every chunk, so an actively writing descendant keeps
20
+ * us reading, while a quiet inherited handle (e.g. a Windows daemonized descendant
21
+ * that never lets `close` fire) still releases us after the grace elapses.
19
22
  */
20
23
  export function waitForChildProcess(child) {
21
24
  return new Promise((resolve, reject) => {
@@ -35,6 +38,8 @@ export function waitForChildProcess(child) {
35
38
  child.removeListener("close", onClose);
36
39
  child.stdout?.removeListener("end", onStdoutEnd);
37
40
  child.stderr?.removeListener("end", onStderrEnd);
41
+ child.stdout?.removeListener("data", onData);
42
+ child.stderr?.removeListener("data", onData);
38
43
  };
39
44
  const finalize = (code) => {
40
45
  if (settled)
@@ -52,6 +57,17 @@ export function waitForChildProcess(child) {
52
57
  finalize(exitCode);
53
58
  }
54
59
  };
60
+ const armIdleTimer = () => {
61
+ if (postExitTimer)
62
+ clearTimeout(postExitTimer);
63
+ postExitTimer = setTimeout(() => finalize(exitCode), EXIT_STDIO_GRACE_MS);
64
+ };
65
+ const onData = () => {
66
+ // Output is still arriving after exit; defer finalizing so we don't
67
+ // destroy the stream mid-write and truncate the tail.
68
+ if (exited && !settled)
69
+ armIdleTimer();
70
+ };
55
71
  const onStdoutEnd = () => {
56
72
  stdoutEnded = true;
57
73
  maybeFinalizeAfterExit();
@@ -72,7 +88,7 @@ export function waitForChildProcess(child) {
72
88
  exitCode = code;
73
89
  maybeFinalizeAfterExit();
74
90
  if (!settled) {
75
- postExitTimer = setTimeout(() => finalize(code), EXIT_STDIO_GRACE_MS);
91
+ armIdleTimer();
76
92
  }
77
93
  };
78
94
  const onClose = (code) => {
@@ -80,6 +96,8 @@ export function waitForChildProcess(child) {
80
96
  };
81
97
  child.stdout?.once("end", onStdoutEnd);
82
98
  child.stderr?.once("end", onStderrEnd);
99
+ child.stdout?.on("data", onData);
100
+ child.stderr?.on("data", onData);
83
101
  child.once("error", onError);
84
102
  child.once("exit", onExit);
85
103
  child.once("close", onClose);
@@ -1 +1 @@
1
- {"version":3,"file":"child-process.js","sourceRoot":"","sources":["../../src/utils/child-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,IAAI,SAAS,EAClB,SAAS,IAAI,aAAa,GAO1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAQhC,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,IAAc,EAAE,OAAqB;IAClF,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9G,CAAC;A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E,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACvC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACvC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n\ttype ChildProcess,\n\ttype ChildProcessByStdio,\n\tspawn as nodeSpawn,\n\tspawnSync as nodeSpawnSync,\n\ttype SpawnOptions,\n\ttype SpawnOptionsWithStdioTuple,\n\ttype SpawnSyncOptionsWithStringEncoding,\n\ttype SpawnSyncReturns,\n\ttype StdioNull,\n\ttype StdioPipe,\n} from \"node:child_process\";\nimport type { Readable } from \"node:stream\";\nimport crossSpawn from \"cross-spawn\";\n\nconst EXIT_STDIO_GRACE_MS = 100;\n\nexport function spawnProcess(\n\tcommand: string,\n\targs: string[],\n\toptions: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,\n): ChildProcessByStdio<null, Readable, Readable>;\nexport function spawnProcess(command: string, args: string[], options: SpawnOptions): ChildProcess;\nexport function spawnProcess(command: string, args: string[], options: SpawnOptions): ChildProcess {\n\treturn process.platform === \"win32\" ? crossSpawn(command, args, options) : nodeSpawn(command, args, options);\n}\n\nexport function spawnProcessSync(\n\tcommand: string,\n\targs: string[],\n\toptions: SpawnSyncOptionsWithStringEncoding,\n): SpawnSyncReturns<string> {\n\treturn process.platform === \"win32\"\n\t\t? crossSpawn.sync(command, args, options)\n\t\t: nodeSpawnSync(command, args, options);\n}\n\n/**\n * Wait for a child process to terminate without hanging on inherited stdio handles.\n *\n * On Windows, daemonized descendants can inherit the child's stdout/stderr pipe\n * handles. In that case the child emits `exit`, but `close` can hang forever even\n * though the original process is already gone. We wait briefly for stdio to end,\n * then forcibly stop tracking the inherited handles.\n */\nexport function waitForChildProcess(child: ChildProcess): Promise<number | null> {\n\treturn new Promise((resolve, reject) => {\n\t\tlet settled = false;\n\t\tlet exited = false;\n\t\tlet exitCode: number | null = null;\n\t\tlet postExitTimer: NodeJS.Timeout | undefined;\n\t\tlet stdoutEnded = child.stdout === null;\n\t\tlet stderrEnded = child.stderr === null;\n\n\t\tconst cleanup = () => {\n\t\t\tif (postExitTimer) {\n\t\t\t\tclearTimeout(postExitTimer);\n\t\t\t\tpostExitTimer = undefined;\n\t\t\t}\n\t\t\tchild.removeListener(\"error\", onError);\n\t\t\tchild.removeListener(\"exit\", onExit);\n\t\t\tchild.removeListener(\"close\", onClose);\n\t\t\tchild.stdout?.removeListener(\"end\", onStdoutEnd);\n\t\t\tchild.stderr?.removeListener(\"end\", onStderrEnd);\n\t\t};\n\n\t\tconst finalize = (code: number | null) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\tchild.stdout?.destroy();\n\t\t\tchild.stderr?.destroy();\n\t\t\tresolve(code);\n\t\t};\n\n\t\tconst maybeFinalizeAfterExit = () => {\n\t\t\tif (!exited || settled) return;\n\t\t\tif (stdoutEnded && stderrEnded) {\n\t\t\t\tfinalize(exitCode);\n\t\t\t}\n\t\t};\n\n\t\tconst onStdoutEnd = () => {\n\t\t\tstdoutEnded = true;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t};\n\n\t\tconst onStderrEnd = () => {\n\t\t\tstderrEnded = true;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t};\n\n\t\tconst onError = (err: Error) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\treject(err);\n\t\t};\n\n\t\tconst onExit = (code: number | null) => {\n\t\t\texited = true;\n\t\t\texitCode = code;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t\tif (!settled) {\n\t\t\t\tpostExitTimer = setTimeout(() => finalize(code), EXIT_STDIO_GRACE_MS);\n\t\t\t}\n\t\t};\n\n\t\tconst onClose = (code: number | null) => {\n\t\t\tfinalize(code);\n\t\t};\n\n\t\tchild.stdout?.once(\"end\", onStdoutEnd);\n\t\tchild.stderr?.once(\"end\", onStderrEnd);\n\t\tchild.once(\"error\", onError);\n\t\tchild.once(\"exit\", onExit);\n\t\tchild.once(\"close\", onClose);\n\t});\n}\n"]}
1
+ {"version":3,"file":"child-process.js","sourceRoot":"","sources":["../../src/utils/child-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,IAAI,SAAS,EAClB,SAAS,IAAI,aAAa,GAO1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAQhC,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,IAAc,EAAE,OAAqB;IAClF,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9G,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC/B,OAAe,EACf,IAAc,EACd,OAA2C;IAE3C,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO;QAClC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;QACzC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAmB;IACtD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAI,Q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C,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACvC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n\ttype ChildProcess,\n\ttype ChildProcessByStdio,\n\tspawn as nodeSpawn,\n\tspawnSync as nodeSpawnSync,\n\ttype SpawnOptions,\n\ttype SpawnOptionsWithStdioTuple,\n\ttype SpawnSyncOptionsWithStringEncoding,\n\ttype SpawnSyncReturns,\n\ttype StdioNull,\n\ttype StdioPipe,\n} from \"node:child_process\";\nimport type { Readable } from \"node:stream\";\nimport crossSpawn from \"cross-spawn\";\n\nconst EXIT_STDIO_GRACE_MS = 100;\n\nexport function spawnProcess(\n\tcommand: string,\n\targs: string[],\n\toptions: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,\n): ChildProcessByStdio<null, Readable, Readable>;\nexport function spawnProcess(command: string, args: string[], options: SpawnOptions): ChildProcess;\nexport function spawnProcess(command: string, args: string[], options: SpawnOptions): ChildProcess {\n\treturn process.platform === \"win32\" ? crossSpawn(command, args, options) : nodeSpawn(command, args, options);\n}\n\nexport function spawnProcessSync(\n\tcommand: string,\n\targs: string[],\n\toptions: SpawnSyncOptionsWithStringEncoding,\n): SpawnSyncReturns<string> {\n\treturn process.platform === \"win32\"\n\t\t? crossSpawn.sync(command, args, options)\n\t\t: nodeSpawnSync(command, args, options);\n}\n\n/**\n * Wait for a child process to terminate without hanging on inherited stdio handles.\n *\n * A short-lived child can `exit` while a detached descendant keeps its stdout/stderr\n * pipe open. We must not resolve and destroy the streams on a fixed deadline measured\n * from `exit`, or output still being written past that deadline is silently lost\n * (earendil-works/pi#5303). Instead, after `exit` we wait for the pipes to fall idle:\n * the grace timer is re-armed on every chunk, so an actively writing descendant keeps\n * us reading, while a quiet inherited handle (e.g. a Windows daemonized descendant\n * that never lets `close` fire) still releases us after the grace elapses.\n */\nexport function waitForChildProcess(child: ChildProcess): Promise<number | null> {\n\treturn new Promise((resolve, reject) => {\n\t\tlet settled = false;\n\t\tlet exited = false;\n\t\tlet exitCode: number | null = null;\n\t\tlet postExitTimer: NodeJS.Timeout | undefined;\n\t\tlet stdoutEnded = child.stdout === null;\n\t\tlet stderrEnded = child.stderr === null;\n\n\t\tconst cleanup = () => {\n\t\t\tif (postExitTimer) {\n\t\t\t\tclearTimeout(postExitTimer);\n\t\t\t\tpostExitTimer = undefined;\n\t\t\t}\n\t\t\tchild.removeListener(\"error\", onError);\n\t\t\tchild.removeListener(\"exit\", onExit);\n\t\t\tchild.removeListener(\"close\", onClose);\n\t\t\tchild.stdout?.removeListener(\"end\", onStdoutEnd);\n\t\t\tchild.stderr?.removeListener(\"end\", onStderrEnd);\n\t\t\tchild.stdout?.removeListener(\"data\", onData);\n\t\t\tchild.stderr?.removeListener(\"data\", onData);\n\t\t};\n\n\t\tconst finalize = (code: number | null) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\tchild.stdout?.destroy();\n\t\t\tchild.stderr?.destroy();\n\t\t\tresolve(code);\n\t\t};\n\n\t\tconst maybeFinalizeAfterExit = () => {\n\t\t\tif (!exited || settled) return;\n\t\t\tif (stdoutEnded && stderrEnded) {\n\t\t\t\tfinalize(exitCode);\n\t\t\t}\n\t\t};\n\n\t\tconst armIdleTimer = () => {\n\t\t\tif (postExitTimer) clearTimeout(postExitTimer);\n\t\t\tpostExitTimer = setTimeout(() => finalize(exitCode), EXIT_STDIO_GRACE_MS);\n\t\t};\n\n\t\tconst onData = () => {\n\t\t\t// Output is still arriving after exit; defer finalizing so we don't\n\t\t\t// destroy the stream mid-write and truncate the tail.\n\t\t\tif (exited && !settled) armIdleTimer();\n\t\t};\n\n\t\tconst onStdoutEnd = () => {\n\t\t\tstdoutEnded = true;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t};\n\n\t\tconst onStderrEnd = () => {\n\t\t\tstderrEnded = true;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t};\n\n\t\tconst onError = (err: Error) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\treject(err);\n\t\t};\n\n\t\tconst onExit = (code: number | null) => {\n\t\t\texited = true;\n\t\t\texitCode = code;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t\tif (!settled) {\n\t\t\t\tarmIdleTimer();\n\t\t\t}\n\t\t};\n\n\t\tconst onClose = (code: number | null) => {\n\t\t\tfinalize(code);\n\t\t};\n\n\t\tchild.stdout?.once(\"end\", onStdoutEnd);\n\t\tchild.stderr?.once(\"end\", onStderrEnd);\n\t\tchild.stdout?.on(\"data\", onData);\n\t\tchild.stderr?.on(\"data\", onData);\n\t\tchild.once(\"error\", onError);\n\t\tchild.once(\"exit\", onExit);\n\t\tchild.once(\"close\", onClose);\n\t});\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  # Containerization
2
2
 
3
- Pi runs with all permissions by default, but in some cases, you will want to have more control over what directories Pi can write to and which accesses it has.
3
+ senpi runs with all permissions by default, but in some cases, you will want to have more control over what directories senpi can write to and which accesses it has.
4
4
 
5
5
  There are two general options. You can either
6
6
  1. run the whole `senpi` process inside an isolated environment, or
@@ -10,46 +10,12 @@ There are two general options. You can either
10
10
 
11
11
  | Pattern | What is isolated | Best for | Notes |
12
12
  | --- | --- | --- | --- |
13
- | OpenShell | Whole `senpi` process in a policy-controlled sandbox | Local or remote managed sandbox | Requires an OpenShell gateway |
14
13
  | Gondolin extension | Built-in tools and `!` commands | Local micro-VM isolation while keeping auth on host | See [`examples/extensions/gondolin/`](../examples/extensions/gondolin/). |
15
14
  | Plain Docker | Whole `senpi` process in a local container | Simple local isolation | Provider API keys enter the container. |
15
+ | OpenShell | Whole `senpi` process in a policy-controlled sandbox | Local or remote managed sandbox | Requires an OpenShell gateway |
16
16
 
17
17
  Extensions run wherever the `senpi` process runs. If you run host `senpi` with a tool-routing extension, other custom extension tools still run on the host unless they also delegate their operations.
18
18
 
19
- ## OpenShell
20
-
21
- Use [NVIDIA OpenShell](https://docs.nvidia.com/openshell/about/overview) when you want a policy-controlled sandbox with filesystem, process, network, credential, and inference controls.
22
- OpenShell can run sandboxes through a local gateway backed by Docker, Podman, or a VM runtime, or through a remote Kubernetes gateway.
23
-
24
- Every sandbox requires an active gateway.
25
- Register and select one before creating a sandbox:
26
-
27
- ```bash
28
- openshell gateway add <gateway-url> --name <name>
29
- openshell gateway select <name>
30
- ```
31
-
32
- Launch `senpi` inside an OpenShell sandbox:
33
-
34
- ```bash
35
- openshell sandbox create --name senpi-sandbox --from senpi -- senpi
36
- ```
37
-
38
- In this pattern, the whole `senpi` process runs inside the sandbox.
39
- Built-in tools, `!` commands, and extension tools execute inside the OpenShell boundary.
40
-
41
- If the gateway is remote, project files are not bind-mounted from the host, meaning writes in the sandbox are not reflected on your machine.
42
- Clone the repository inside the sandbox or use OpenShell file transfer commands:
43
-
44
- ```bash
45
- openshell sandbox upload senpi-sandbox ./repo /workspace
46
- openshell sandbox download senpi-sandbox /workspace/repo ./repo-out
47
- ```
48
-
49
- OpenShell providers can keep raw model API keys outside the sandbox.
50
- When inference routing is configured, code inside the sandbox can call `https://inference.local`, and the gateway injects the configured provider credentials upstream.
51
- Configure Pi to use the corresponding OpenAI-compatible or Anthropic-compatible endpoint if you want model traffic to use this route.
52
-
53
19
  ## Gondolin
54
20
 
55
21
  [Gondolin](https://github.com/earendil-works/gondolin) is a local Linux micro-VM.
@@ -109,3 +75,37 @@ docker run --rm -it \
109
75
  The `-v "$PWD:/workspace"` mounts your current directory into the container at /workspace such that reads and writes in `/workspace` inside Docker directly affect your host files, like in the Gondolin example.
110
76
 
111
77
  Use a named volume for `/root/.senpi/agent` if you want container-local settings and sessions. Mounting your host `~/.senpi/agent` exposes host auth and session files to the container.
78
+
79
+ ## OpenShell
80
+
81
+ Use [NVIDIA OpenShell](https://docs.nvidia.com/openshell/about/overview) when you want a policy-controlled sandbox with filesystem, process, network, credential, and inference controls.
82
+ OpenShell can run sandboxes through a local gateway backed by Docker, Podman, or a VM runtime, or through a remote Kubernetes gateway.
83
+
84
+ Every sandbox requires an active gateway.
85
+ Register and select one before creating a sandbox:
86
+
87
+ ```bash
88
+ openshell gateway add <gateway-url> --name <name>
89
+ openshell gateway select <name>
90
+ ```
91
+
92
+ Launch `senpi` inside an OpenShell sandbox:
93
+
94
+ ```bash
95
+ openshell sandbox create --name senpi-sandbox --from senpi -- senpi
96
+ ```
97
+
98
+ In this pattern, the whole `senpi` process runs inside the sandbox.
99
+ Built-in tools, `!` commands, and extension tools execute inside the OpenShell boundary.
100
+
101
+ If the gateway is remote, project files are not bind-mounted from the host, meaning writes in the sandbox are not reflected on your machine.
102
+ Clone the repository inside the sandbox or use OpenShell file transfer commands:
103
+
104
+ ```bash
105
+ openshell sandbox upload senpi-sandbox ./repo /workspace
106
+ openshell sandbox download senpi-sandbox /workspace/repo ./repo-out
107
+ ```
108
+
109
+ OpenShell providers can keep raw model API keys outside the sandbox.
110
+ When inference routing is configured, code inside the sandbox can call `https://inference.local`, and the gateway injects the configured provider credentials upstream.
111
+ Configure senpi to use the corresponding OpenAI-compatible or Anthropic-compatible endpoint if you want model traffic to use this route.
@@ -1534,21 +1534,21 @@ const result = await pi.exec("git", ["status"], { signal, timeout: 5000 });
1534
1534
 
1535
1535
  ### pi.getActiveTools() / pi.getAllTools() / pi.setActiveTools(names)
1536
1536
 
1537
- Manage active tools. This works for both built-in tools and dynamically registered tools.
1537
+ Manage active tools. This works for both built-in tools and dynamically registered tools. `pi.getActiveTools()` returns the active tool names as `string[]`; `pi.getAllTools()` returns metadata for all configured tools.
1538
1538
 
1539
1539
  ```typescript
1540
- const active = pi.getActiveTools();
1540
+ const active = pi.getActiveTools(); // ["read", "bash", ...]
1541
1541
  const all = pi.getAllTools();
1542
- // [{
1542
+ // all = [{
1543
1543
  // name: "read",
1544
1544
  // description: "Read file contents...",
1545
1545
  // parameters: ...,
1546
1546
  // promptGuidelines: ["Use read to examine files instead of cat or sed."],
1547
1547
  // sourceInfo: { path: "<builtin:read>", source: "builtin", scope: "temporary", origin: "top-level" }
1548
1548
  // }, ...]
1549
- const names = all.map(t => t.name);
1550
1549
  const builtinTools = all.filter((t) => t.sourceInfo.source === "builtin");
1551
1550
  const extensionTools = all.filter((t) => t.sourceInfo.source !== "builtin" && t.sourceInfo.source !== "sdk");
1551
+ pi.setActiveTools([...new Set([...active, "my_custom_tool"])]); // Keep current tools and enable my_custom_tool
1552
1552
  pi.setActiveTools(["read", "bash"]); // Switch to read-only
1553
1553
  ```
1554
1554
 
package/docs/index.md CHANGED
@@ -34,7 +34,7 @@ For the full first-run flow, see [Quickstart](quickstart.md).
34
34
  - [Using Senpi](usage.md) - interactive mode, slash commands, context files, and CLI reference.
35
35
  - [Providers](providers.md) - subscription and API-key setup for built-in providers.
36
36
  - [Security](security.md) - project trust, sandbox boundaries, and vulnerability reporting.
37
- - [Containerization](containerization.md) - sandbox senpi with OpenShell, Gondolin, or Docker.
37
+ - [Containerization](containerization.md) - sandbox senpi with Gondolin, Docker, or OpenShell.
38
38
  - [Settings](settings.md) - global and project settings.
39
39
  - [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
40
40
  - [Sessions](sessions.md) - session management, branching, and tree navigation.
package/docs/security.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Security
2
2
 
3
- Pi is a local coding agent. It runs with the permissions of the user account that starts it, and it treats files writable by that user as inside the same local trust boundary.
3
+ senpi is a local coding agent. It runs with the permissions of the user account that starts it, and it treats files writable by that user as inside the same local trust boundary.
4
4
 
5
5
  ## Project Trust
6
6
 
7
- Project trust controls whether pi loads project-local settings, resources, packages, and extensions. It is not a sandbox and it does not restrict what the model can ask tools to do after you start working in a directory.
7
+ Project trust controls whether senpi loads project-local settings, resources, packages, and extensions. It is not a sandbox and it does not restrict what the model can ask tools to do after you start working in a directory.
8
8
 
9
- Pi considers a project to have resources that require trust when it finds any of these from the current working directory:
9
+ senpi considers a project to have resources that require trust when it finds any of these from the current working directory:
10
10
 
11
11
  - `.senpi/settings.json`
12
12
  - `.senpi/extensions`, `.senpi/skills`, `.senpi/prompts`, or `.senpi/themes`
@@ -15,34 +15,34 @@ Pi considers a project to have resources that require trust when it finds any of
15
15
 
16
16
  A bare `.senpi` directory does not count as a project resource that requires trust.
17
17
 
18
- When an interactive session starts in a project with resources that require trust and no saved decision for the current directory or a parent directory, pi follows `defaultProjectTrust` from global settings. The default value is `"ask"`, which asks whether to trust the project when UI is available. Saved decisions are stored by canonical directory in `~/.senpi/agent/trust.json`, and the closest saved decision on the current or parent path applies before the global default.
18
+ When an interactive session starts in a project with resources that require trust and no saved decision for the current directory or a parent directory, senpi follows `defaultProjectTrust` from global settings. The default value is `"ask"`, which asks whether to trust the project when UI is available. Saved decisions are stored by canonical directory in `~/.senpi/agent/trust.json`, and the closest saved decision on the current or parent path applies before the global default.
19
19
 
20
- Trusting a project allows pi to load project resources that require trust, including:
20
+ Trusting a project allows senpi to load project resources that require trust, including:
21
21
 
22
22
  - `.senpi/settings.json`
23
23
  - `.senpi` resources such as extensions, skills, prompt templates, themes, and system prompt files
24
24
  - missing project packages configured through project settings
25
25
  - project-local extensions and project package-managed extensions
26
26
 
27
- Declining trust skips protected resources. `AGENTS.md` and `CLAUDE.md` context files are loaded regardless of project trust unless context loading is disabled. Before trust is resolved, pi only loads context files, user/global extensions, and CLI `-e` extensions. User/global and CLI extensions can handle the `project_trust` event; the first extension that returns a yes/no decision owns the decision.
27
+ Declining trust skips protected resources. `AGENTS.md` and `CLAUDE.md` context files are loaded regardless of project trust unless context loading is disabled. Before trust is resolved, senpi only loads context files, user/global extensions, and CLI `-e` extensions. User/global and CLI extensions can handle the `project_trust` event; the first extension that returns a yes/no decision owns the decision.
28
28
 
29
29
  Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, `defaultProjectTrust: "ask"` and `"never"` ignore such resources, while `"always"` trusts them. Use `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
30
30
 
31
31
  ## No Built-in Sandbox
32
32
 
33
- Pi does not include a built-in sandbox. Built-in tools can read files, write files, edit files, and run shell commands with the permissions of the pi process. Extensions are TypeScript modules that run with the same permissions. Package installs, shell commands, language servers, test commands, and other developer tools behave as ordinary local processes.
33
+ senpi does not include a built-in sandbox. Built-in tools can read files, write files, edit files, and run shell commands with the permissions of the senpi process. Extensions are TypeScript modules that run with the same permissions. Package installs, shell commands, language servers, test commands, and other developer tools behave as ordinary local processes.
34
34
 
35
- This is intentional. Pi is designed to operate on local source trees, invoke project toolchains, and integrate with the user's existing development environment. A partial in-process sandbox would be easy to misunderstand as a security boundary while still depending on the host shell, filesystem, package managers, credentials, and extension code. Real isolation needs to come from the operating system or a virtualization/container boundary.
35
+ This is intentional. senpi is designed to operate on local source trees, invoke project toolchains, and integrate with the user's existing development environment. A partial in-process sandbox would be easy to misunderstand as a security boundary while still depending on the host shell, filesystem, package managers, credentials, and extension code. Real isolation needs to come from the operating system or a virtualization/container boundary.
36
36
 
37
- Project trust is only an input-loading guard. It prevents a repository from silently changing pi's settings or extensions before you approve it. It does not make untrusted code, untrusted prompts, or untrusted model output safe. Prompt injection from repository files, comments, documentation, context files, or build output is expected local-agent risk and cannot be reliably prevented by pi.
37
+ Project trust is only an input-loading guard. It prevents a repository from silently changing senpi's settings or extensions before you approve it. It does not make untrusted code, untrusted prompts, or untrusted model output safe. Prompt injection from repository files, comments, documentation, context files, or build output is expected local-agent risk and cannot be reliably prevented by senpi.
38
38
 
39
39
  ## Running Untrusted or Unmonitored Work
40
40
 
41
- For untrusted repositories, generated code you do not intend to monitor closely, or unattended automation, run pi in a contained environment. Use a container, VM, micro-VM, remote sandbox, or policy-controlled sandbox with only the files and credentials required for the task.
41
+ For untrusted repositories, generated code you do not intend to monitor closely, or unattended automation, run senpi in a contained environment. Use a container, VM, micro-VM, remote sandbox, or policy-controlled sandbox with only the files and credentials required for the task.
42
42
 
43
43
  Common patterns are documented in [Containerization](containerization.md):
44
44
 
45
- - run the whole `senpi` process inside OpenShell or Docker
45
+ - run the whole `senpi` process inside a container/sandbox
46
46
  - run host senpi while routing built-in tool execution into a Gondolin micro-VM
47
47
  - mount only the workspace paths the agent should access
48
48
  - avoid mounting host `~/.senpi/agent` unless the container should access host sessions, settings, and credentials
@@ -54,6 +54,6 @@ If you bind-mount a host workspace read/write, writes from inside the container
54
54
 
55
55
  ## Reporting Security Issues
56
56
 
57
- To report a security issue, follow the repository [Security Policy](https://github.com/earendil-works/pi-mono/blob/main/SECURITY.md). Do not open a public issue for security-sensitive reports.
57
+ To report a security issue, follow the repository [Security Policy](https://github.com/code-yeongyu/senpi/security/policy). Do not open a public issue for security-sensitive reports.
58
58
 
59
- Expected local-agent behavior, lack of a built-in sandbox, prompt injection from untrusted content, and behavior of user-installed extensions or skills are generally outside the security boundary unless the report demonstrates a real privilege-boundary bypass or shows how pi grants access that the local user did not already have.
59
+ Expected local-agent behavior, lack of a built-in sandbox, prompt injection from untrusted content, and behavior of user-installed extensions or skills are generally outside the security boundary unless the report demonstrates a real privilege-boundary bypass or shows how senpi grants access that the local user did not already have.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.79.3",
3
+ "version": "0.79.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.79.3",
9
+ "version": "0.79.4",
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.79.3",
4
+ "version": "0.79.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.79.3",
4
+ "version": "0.79.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
- "version": "0.79.3",
3
+ "version": "0.79.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-gondolin",
9
- "version": "0.79.3",
9
+ "version": "0.79.4",
10
10
  "dependencies": {
11
11
  "@earendil-works/gondolin": "0.12.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
3
  "private": true,
4
- "version": "0.79.3",
4
+ "version": "0.79.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -5,7 +5,15 @@
5
5
  */
6
6
 
7
7
  import type { ExtensionAPI } from "@code-yeongyu/senpi";
8
- import { Editor, type EditorTheme, Key, matchesKey, Text, truncateToWidth } from "@earendil-works/pi-tui";
8
+ import {
9
+ Editor,
10
+ type EditorTheme,
11
+ Key,
12
+ matchesKey,
13
+ Text,
14
+ visibleWidth,
15
+ wrapTextWithAnsi,
16
+ } from "@earendil-works/pi-tui";
9
17
  import { Type } from "typebox";
10
18
 
11
19
  interface OptionWithDesc {
@@ -139,10 +147,27 @@ export default function question(pi: ExtensionAPI) {
139
147
  if (cachedLines) return cachedLines;
140
148
 
141
149
  const lines: string[] = [];
142
- const add = (s: string) => lines.push(truncateToWidth(s, width));
150
+ const renderWidth = Math.max(1, width);
143
151
 
144
- add(theme.fg("accent", "─".repeat(width)));
145
- add(theme.fg("text", ` ${params.question}`));
152
+ function addWrapped(text: string) {
153
+ lines.push(...wrapTextWithAnsi(text, renderWidth));
154
+ }
155
+
156
+ function addWrappedWithPrefix(prefix: string, text: string) {
157
+ const prefixWidth = visibleWidth(prefix);
158
+ if (prefixWidth >= renderWidth) {
159
+ addWrapped(prefix + text);
160
+ return;
161
+ }
162
+ const wrapped = wrapTextWithAnsi(text, renderWidth - prefixWidth);
163
+ const continuationPrefix = " ".repeat(prefixWidth);
164
+ for (let i = 0; i < wrapped.length; i++) {
165
+ lines.push(`${i === 0 ? prefix : continuationPrefix}${wrapped[i]}`);
166
+ }
167
+ }
168
+
169
+ lines.push(theme.fg("accent", "─".repeat(renderWidth)));
170
+ addWrappedWithPrefix(" ", theme.fg("text", params.question));
146
171
  lines.push("");
147
172
 
148
173
  for (let i = 0; i < allOptions.length; i++) {
@@ -150,36 +175,32 @@ export default function question(pi: ExtensionAPI) {
150
175
  const selected = i === optionIndex;
151
176
  const isOther = opt.isOther === true;
152
177
  const prefix = selected ? theme.fg("accent", "> ") : " ";
178
+ const label = `${i + 1}. ${opt.label}${isOther && editMode ? " ✎" : ""}`;
179
+ const color = selected || (isOther && editMode) ? "accent" : "text";
153
180
 
154
- if (isOther && editMode) {
155
- add(prefix + theme.fg("accent", `${i + 1}. ${opt.label} ✎`));
156
- } else if (selected) {
157
- add(prefix + theme.fg("accent", `${i + 1}. ${opt.label}`));
158
- } else {
159
- add(` ${theme.fg("text", `${i + 1}. ${opt.label}`)}`);
160
- }
181
+ addWrappedWithPrefix(prefix, theme.fg(color, label));
161
182
 
162
183
  // Show description if present
163
184
  if (opt.description) {
164
- add(` ${theme.fg("muted", opt.description)}`);
185
+ addWrappedWithPrefix(" ", theme.fg("muted", opt.description));
165
186
  }
166
187
  }
167
188
 
168
189
  if (editMode) {
169
190
  lines.push("");
170
- add(theme.fg("muted", " Your answer:"));
171
- for (const line of editor.render(width - 2)) {
172
- add(` ${line}`);
191
+ addWrappedWithPrefix(" ", theme.fg("muted", "Your answer:"));
192
+ for (const line of editor.render(Math.max(1, renderWidth - 2))) {
193
+ lines.push(` ${line}`);
173
194
  }
174
195
  }
175
196
 
176
197
  lines.push("");
177
198
  if (editMode) {
178
- add(theme.fg("dim", " Enter to submit • Esc to go back"));
199
+ addWrappedWithPrefix(" ", theme.fg("dim", "Enter to submit • Esc to go back"));
179
200
  } else {
180
- add(theme.fg("dim", " ↑↓ navigate • Enter to select • Esc to cancel"));
201
+ addWrappedWithPrefix(" ", theme.fg("dim", "↑↓ navigate • Enter to select • Esc to cancel"));
181
202
  }
182
- add(theme.fg("accent", "─".repeat(width)));
203
+ lines.push(theme.fg("accent", "─".repeat(renderWidth)));
183
204
 
184
205
  cachedLines = lines;
185
206
  return lines;