@tomsun28/pizza 0.0.9 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (382) hide show
  1. package/README.md +20 -143
  2. package/README.zh-CN.md +36 -0
  3. package/dist/bun/cli.d.ts +2 -0
  4. package/dist/bun/cli.js +6 -0
  5. package/dist/bun/register-bedrock.d.ts +1 -0
  6. package/dist/bun/register-bedrock.js +3 -0
  7. package/dist/cli/args.d.ts +48 -0
  8. package/dist/cli/args.js +330 -0
  9. package/dist/cli/config-selector.d.ts +13 -0
  10. package/dist/cli/config-selector.js +30 -0
  11. package/dist/cli/file-processor.d.ts +14 -0
  12. package/dist/cli/file-processor.js +82 -0
  13. package/dist/cli/initial-message.d.ts +17 -0
  14. package/dist/cli/initial-message.js +21 -0
  15. package/dist/cli/list-models.d.ts +8 -0
  16. package/dist/cli/list-models.js +96 -0
  17. package/dist/cli.d.ts +2 -0
  18. package/dist/cli.js +68 -0
  19. package/dist/config.d.ts +79 -0
  20. package/dist/config.js +223 -0
  21. package/dist/core/agent/index.d.ts +6 -0
  22. package/dist/core/agent/index.js +6 -0
  23. package/dist/core/agent/types.d.ts +202 -0
  24. package/dist/core/agent/types.js +51 -0
  25. package/dist/core/auth-storage.d.ts +135 -0
  26. package/dist/core/auth-storage.js +417 -0
  27. package/dist/core/bash-executor.d.ts +31 -0
  28. package/dist/core/bash-executor.js +107 -0
  29. package/dist/core/compaction/branch-summarization.d.ts +87 -0
  30. package/dist/core/compaction/branch-summarization.js +242 -0
  31. package/dist/core/compaction/compaction-engine.d.ts +40 -0
  32. package/dist/core/compaction/compaction-engine.js +292 -0
  33. package/dist/core/compaction/compaction.d.ts +106 -0
  34. package/dist/core/compaction/compaction.js +295 -0
  35. package/dist/core/compaction/index.d.ts +7 -0
  36. package/dist/core/compaction/index.js +7 -0
  37. package/dist/core/compaction/utils.d.ts +37 -0
  38. package/dist/core/compaction/utils.js +152 -0
  39. package/dist/core/defaults.d.ts +2 -0
  40. package/dist/core/defaults.js +1 -0
  41. package/dist/core/diagnostics.d.ts +14 -0
  42. package/dist/core/diagnostics.js +1 -0
  43. package/dist/core/event-bus.d.ts +8 -0
  44. package/dist/core/event-bus.js +24 -0
  45. package/dist/core/event-store/events.d.ts +465 -0
  46. package/dist/core/event-store/events.js +6 -0
  47. package/dist/core/event-store/index.d.ts +10 -0
  48. package/dist/core/event-store/index.js +10 -0
  49. package/dist/core/event-store/sqlite-store.d.ts +27 -0
  50. package/dist/core/event-store/sqlite-store.js +275 -0
  51. package/dist/core/event-store/store.d.ts +91 -0
  52. package/dist/core/event-store/store.js +7 -0
  53. package/dist/core/event-store/thread-scoped-store.d.ts +29 -0
  54. package/dist/core/event-store/thread-scoped-store.js +50 -0
  55. package/dist/core/event-store/types.d.ts +70 -0
  56. package/dist/core/event-store/types.js +7 -0
  57. package/dist/core/event-store/workspace.d.ts +37 -0
  58. package/dist/core/event-store/workspace.js +71 -0
  59. package/dist/core/exec.d.ts +28 -0
  60. package/dist/core/exec.js +74 -0
  61. package/dist/core/export-html/ansi-to-html.d.ts +21 -0
  62. package/dist/core/export-html/ansi-to-html.js +248 -0
  63. package/dist/core/export-html/index.d.ts +29 -0
  64. package/dist/core/export-html/index.js +186 -0
  65. package/dist/core/export-html/template.css +1017 -0
  66. package/dist/core/export-html/template.html +55 -0
  67. package/dist/core/export-html/template.js +1742 -0
  68. package/dist/core/export-html/tool-renderer.d.ts +39 -0
  69. package/dist/core/export-html/tool-renderer.js +94 -0
  70. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  71. package/dist/core/export-html/vendor/marked.min.js +6 -0
  72. package/dist/core/extensions/index.d.ts +12 -0
  73. package/dist/core/extensions/index.js +9 -0
  74. package/dist/core/extensions/loader.d.ts +24 -0
  75. package/dist/core/extensions/loader.js +492 -0
  76. package/dist/core/extensions/runner.d.ts +167 -0
  77. package/dist/core/extensions/runner.js +898 -0
  78. package/dist/core/extensions/session-context.d.ts +67 -0
  79. package/dist/core/extensions/session-context.js +272 -0
  80. package/dist/core/extensions/types.d.ts +1147 -0
  81. package/dist/core/extensions/types.js +44 -0
  82. package/dist/core/extensions/wrapper.d.ts +19 -0
  83. package/dist/core/extensions/wrapper.js +21 -0
  84. package/dist/core/footer-data-provider.d.ts +47 -0
  85. package/dist/core/footer-data-provider.js +321 -0
  86. package/dist/core/goal/index.d.ts +3 -0
  87. package/dist/core/goal/index.js +1 -0
  88. package/dist/core/goal/scheduler.d.ts +83 -0
  89. package/dist/core/goal/scheduler.js +154 -0
  90. package/dist/core/goal/types.d.ts +182 -0
  91. package/dist/core/goal/types.js +11 -0
  92. package/dist/core/index.d.ts +8 -0
  93. package/dist/core/index.js +8 -0
  94. package/dist/core/intent/classifier.d.ts +53 -0
  95. package/dist/core/intent/classifier.js +353 -0
  96. package/dist/core/intent/index.d.ts +8 -0
  97. package/dist/core/intent/index.js +8 -0
  98. package/dist/core/intent/tool-adapter.d.ts +31 -0
  99. package/dist/core/intent/tool-adapter.js +168 -0
  100. package/dist/core/intent/types.d.ts +71 -0
  101. package/dist/core/intent/types.js +6 -0
  102. package/dist/core/keybindings.d.ts +297 -0
  103. package/dist/core/keybindings.js +250 -0
  104. package/dist/core/messages.d.ts +30 -0
  105. package/dist/core/messages.js +134 -0
  106. package/dist/core/model-registry.d.ts +131 -0
  107. package/dist/core/model-registry.js +634 -0
  108. package/dist/core/model-resolver.d.ts +109 -0
  109. package/dist/core/model-resolver.js +486 -0
  110. package/dist/core/output-guard.d.ts +5 -0
  111. package/dist/core/output-guard.js +58 -0
  112. package/dist/core/package-manager.d.ts +196 -0
  113. package/dist/core/package-manager.js +1873 -0
  114. package/dist/core/projection/boundary-inferrer.d.ts +58 -0
  115. package/dist/core/projection/boundary-inferrer.js +122 -0
  116. package/dist/core/projection/event-to-message.d.ts +35 -0
  117. package/dist/core/projection/event-to-message.js +253 -0
  118. package/dist/core/projection/goal-projection.d.ts +67 -0
  119. package/dist/core/projection/goal-projection.js +339 -0
  120. package/dist/core/projection/index.d.ts +13 -0
  121. package/dist/core/projection/index.js +13 -0
  122. package/dist/core/projection/session-manager.d.ts +100 -0
  123. package/dist/core/projection/session-manager.js +331 -0
  124. package/dist/core/projection/session-projection.d.ts +58 -0
  125. package/dist/core/projection/session-projection.js +257 -0
  126. package/dist/core/projection/task-history.d.ts +13 -0
  127. package/dist/core/projection/task-history.js +61 -0
  128. package/dist/core/projection/timeline-projection.d.ts +82 -0
  129. package/dist/core/projection/timeline-projection.js +276 -0
  130. package/dist/core/projection/types.d.ts +69 -0
  131. package/dist/core/projection/types.js +6 -0
  132. package/dist/core/prompt-templates.d.ts +51 -0
  133. package/dist/core/prompt-templates.js +249 -0
  134. package/dist/core/resolve-config-value.d.ts +22 -0
  135. package/dist/core/resolve-config-value.js +125 -0
  136. package/dist/core/resource-loader.d.ts +193 -0
  137. package/dist/core/resource-loader.js +685 -0
  138. package/dist/core/runtime/ai-client.d.ts +12 -0
  139. package/dist/core/runtime/ai-client.js +153 -0
  140. package/dist/core/runtime/checkpoint.d.ts +12 -0
  141. package/dist/core/runtime/checkpoint.js +78 -0
  142. package/dist/core/runtime/index.d.ts +12 -0
  143. package/dist/core/runtime/index.js +12 -0
  144. package/dist/core/runtime/llm-types.d.ts +99 -0
  145. package/dist/core/runtime/llm-types.js +6 -0
  146. package/dist/core/runtime/local-runtime.d.ts +23 -0
  147. package/dist/core/runtime/local-runtime.js +59 -0
  148. package/dist/core/runtime/policies.d.ts +72 -0
  149. package/dist/core/runtime/policies.js +37 -0
  150. package/dist/core/runtime/reactor.d.ts +213 -0
  151. package/dist/core/runtime/reactor.js +992 -0
  152. package/dist/core/runtime/runtime.d.ts +191 -0
  153. package/dist/core/runtime/runtime.js +449 -0
  154. package/dist/core/runtime/types.d.ts +42 -0
  155. package/dist/core/runtime/types.js +1 -0
  156. package/dist/core/sdk.d.ts +12 -0
  157. package/dist/core/sdk.js +10 -0
  158. package/dist/core/session-context-builder.d.ts +9 -0
  159. package/dist/core/session-context-builder.js +87 -0
  160. package/dist/core/session-cwd.d.ts +18 -0
  161. package/dist/core/session-cwd.js +36 -0
  162. package/dist/core/session-facade-factory.d.ts +79 -0
  163. package/dist/core/session-facade-factory.js +460 -0
  164. package/dist/core/session-facade.d.ts +57 -0
  165. package/dist/core/session-facade.js +91 -0
  166. package/dist/core/session-listing.d.ts +30 -0
  167. package/dist/core/session-listing.js +168 -0
  168. package/dist/core/session-reader.d.ts +19 -0
  169. package/dist/core/session-reader.js +101 -0
  170. package/dist/core/session-ref.d.ts +7 -0
  171. package/dist/core/session-ref.js +25 -0
  172. package/dist/core/session-services.d.ts +51 -0
  173. package/dist/core/session-services.js +90 -0
  174. package/dist/core/session-stats.d.ts +43 -0
  175. package/dist/core/session-stats.js +41 -0
  176. package/dist/core/settings-manager.d.ts +236 -0
  177. package/dist/core/settings-manager.js +706 -0
  178. package/dist/core/skill-block-parser.d.ts +12 -0
  179. package/dist/core/skill-block-parser.js +15 -0
  180. package/dist/core/skills.d.ts +59 -0
  181. package/dist/core/skills.js +408 -0
  182. package/dist/core/slash-commands.d.ts +13 -0
  183. package/dist/core/slash-commands.js +17 -0
  184. package/dist/core/source-info.d.ts +17 -0
  185. package/dist/core/source-info.js +18 -0
  186. package/dist/core/system-prompt.d.ts +27 -0
  187. package/dist/core/system-prompt.js +179 -0
  188. package/dist/core/timings.d.ts +7 -0
  189. package/dist/core/timings.js +30 -0
  190. package/dist/core/tools/bash.d.ts +95 -0
  191. package/dist/core/tools/bash.js +513 -0
  192. package/dist/core/tools/builtin-commands.d.ts +75 -0
  193. package/dist/core/tools/builtin-commands.js +503 -0
  194. package/dist/core/tools/compat-commands.d.ts +12 -0
  195. package/dist/core/tools/compat-commands.js +1280 -0
  196. package/dist/core/tools/edit-diff.d.ts +59 -0
  197. package/dist/core/tools/edit-diff.js +263 -0
  198. package/dist/core/tools/edit.d.ts +49 -0
  199. package/dist/core/tools/edit.js +340 -0
  200. package/dist/core/tools/file-mutation-queue.d.ts +5 -0
  201. package/dist/core/tools/file-mutation-queue.js +36 -0
  202. package/dist/core/tools/find.d.ts +34 -0
  203. package/dist/core/tools/find.js +459 -0
  204. package/dist/core/tools/grep.d.ts +36 -0
  205. package/dist/core/tools/grep.js +422 -0
  206. package/dist/core/tools/index.d.ts +70 -0
  207. package/dist/core/tools/index.js +129 -0
  208. package/dist/core/tools/line-anchors.d.ts +33 -0
  209. package/dist/core/tools/line-anchors.js +151 -0
  210. package/dist/core/tools/ls.d.ts +36 -0
  211. package/dist/core/tools/ls.js +268 -0
  212. package/dist/core/tools/path-utils.d.ts +7 -0
  213. package/dist/core/tools/path-utils.js +80 -0
  214. package/dist/core/tools/read.d.ts +35 -0
  215. package/dist/core/tools/read.js +244 -0
  216. package/dist/core/tools/render-utils.d.ts +20 -0
  217. package/dist/core/tools/render-utils.js +48 -0
  218. package/dist/core/tools/session-split.d.ts +9 -0
  219. package/dist/core/tools/session-split.js +77 -0
  220. package/dist/core/tools/tool-definition-wrapper.d.ts +13 -0
  221. package/dist/core/tools/tool-definition-wrapper.js +32 -0
  222. package/dist/core/tools/truncate.d.ts +69 -0
  223. package/dist/core/tools/truncate.js +204 -0
  224. package/dist/core/tools/write.d.ts +25 -0
  225. package/dist/core/tools/write.js +211 -0
  226. package/dist/core/types/session-types.d.ts +123 -0
  227. package/dist/core/types/session-types.js +8 -0
  228. package/dist/index.d.ts +27 -0
  229. package/dist/index.js +38 -0
  230. package/dist/main.d.ts +11 -2
  231. package/dist/main.js +577 -149
  232. package/dist/modes/event-mapper.d.ts +115 -0
  233. package/dist/modes/event-mapper.js +200 -0
  234. package/dist/modes/gui/server.d.ts +14 -0
  235. package/dist/modes/gui/server.js +1032 -0
  236. package/dist/modes/index.d.ts +10 -0
  237. package/dist/modes/index.js +9 -0
  238. package/dist/modes/interactive/assets/clankolas.png +0 -0
  239. package/dist/modes/interactive/components/armin.d.ts +33 -0
  240. package/dist/modes/interactive/components/armin.js +328 -0
  241. package/dist/modes/interactive/components/assistant-message.d.ts +19 -0
  242. package/dist/modes/interactive/components/assistant-message.js +115 -0
  243. package/dist/modes/interactive/components/bash-execution.d.ts +33 -0
  244. package/dist/modes/interactive/components/bash-execution.js +169 -0
  245. package/dist/modes/interactive/components/bordered-loader.d.ts +15 -0
  246. package/dist/modes/interactive/components/bordered-loader.js +50 -0
  247. package/dist/modes/interactive/components/branch-summary-message.d.ts +15 -0
  248. package/dist/modes/interactive/components/branch-summary-message.js +41 -0
  249. package/dist/modes/interactive/components/brand-header.d.ts +33 -0
  250. package/dist/modes/interactive/components/brand-header.js +235 -0
  251. package/dist/modes/interactive/components/compaction-summary-message.d.ts +15 -0
  252. package/dist/modes/interactive/components/compaction-summary-message.js +42 -0
  253. package/dist/modes/interactive/components/config-selector.d.ts +70 -0
  254. package/dist/modes/interactive/components/config-selector.js +469 -0
  255. package/dist/modes/interactive/components/countdown-timer.d.ts +13 -0
  256. package/dist/modes/interactive/components/countdown-timer.js +27 -0
  257. package/dist/modes/interactive/components/custom-editor.d.ts +27 -0
  258. package/dist/modes/interactive/components/custom-editor.js +94 -0
  259. package/dist/modes/interactive/components/custom-message.d.ts +19 -0
  260. package/dist/modes/interactive/components/custom-message.js +73 -0
  261. package/dist/modes/interactive/components/daxnuts.d.ts +22 -0
  262. package/dist/modes/interactive/components/daxnuts.js +137 -0
  263. package/dist/modes/interactive/components/diff.d.ts +11 -0
  264. package/dist/modes/interactive/components/diff.js +132 -0
  265. package/dist/modes/interactive/components/dynamic-border.d.ts +14 -0
  266. package/dist/modes/interactive/components/dynamic-border.js +19 -0
  267. package/dist/modes/interactive/components/earendil-announcement.d.ts +4 -0
  268. package/dist/modes/interactive/components/earendil-announcement.js +39 -0
  269. package/dist/modes/interactive/components/extension-editor.d.ts +19 -0
  270. package/dist/modes/interactive/components/extension-editor.js +105 -0
  271. package/dist/modes/interactive/components/extension-input.d.ts +22 -0
  272. package/dist/modes/interactive/components/extension-input.js +54 -0
  273. package/dist/modes/interactive/components/extension-selector.d.ts +23 -0
  274. package/dist/modes/interactive/components/extension-selector.js +70 -0
  275. package/dist/modes/interactive/components/footer.d.ts +55 -0
  276. package/dist/modes/interactive/components/footer.js +207 -0
  277. package/dist/modes/interactive/components/index.d.ts +31 -0
  278. package/dist/modes/interactive/components/index.js +32 -0
  279. package/dist/modes/interactive/components/keybinding-hints.d.ts +7 -0
  280. package/dist/modes/interactive/components/keybinding-hints.js +21 -0
  281. package/dist/modes/interactive/components/login-dialog.d.ts +41 -0
  282. package/dist/modes/interactive/components/login-dialog.js +138 -0
  283. package/dist/modes/interactive/components/model-selector.d.ts +32 -0
  284. package/dist/modes/interactive/components/model-selector.js +209 -0
  285. package/dist/modes/interactive/components/oauth-selector.d.ts +18 -0
  286. package/dist/modes/interactive/components/oauth-selector.js +91 -0
  287. package/dist/modes/interactive/components/settings-selector.d.ts +57 -0
  288. package/dist/modes/interactive/components/settings-selector.js +299 -0
  289. package/dist/modes/interactive/components/show-images-selector.d.ts +9 -0
  290. package/dist/modes/interactive/components/show-images-selector.js +37 -0
  291. package/dist/modes/interactive/components/skill-invocation-message.d.ts +16 -0
  292. package/dist/modes/interactive/components/skill-invocation-message.js +44 -0
  293. package/dist/modes/interactive/components/theme-selector.d.ts +10 -0
  294. package/dist/modes/interactive/components/theme-selector.js +47 -0
  295. package/dist/modes/interactive/components/thinking-selector.d.ts +10 -0
  296. package/dist/modes/interactive/components/thinking-selector.js +50 -0
  297. package/dist/modes/interactive/components/timeline-view.d.ts +31 -0
  298. package/dist/modes/interactive/components/timeline-view.js +81 -0
  299. package/dist/modes/interactive/components/tool-execution.d.ts +64 -0
  300. package/dist/modes/interactive/components/tool-execution.js +305 -0
  301. package/dist/modes/interactive/components/tree-selector.d.ts +88 -0
  302. package/dist/modes/interactive/components/tree-selector.js +1072 -0
  303. package/dist/modes/interactive/components/user-message-selector.d.ts +29 -0
  304. package/dist/modes/interactive/components/user-message-selector.js +110 -0
  305. package/dist/modes/interactive/components/user-message.d.ts +9 -0
  306. package/dist/modes/interactive/components/user-message.js +27 -0
  307. package/dist/modes/interactive/components/visual-truncate.d.ts +23 -0
  308. package/dist/modes/interactive/components/visual-truncate.js +32 -0
  309. package/dist/modes/interactive/interactive-mode.d.ts +394 -0
  310. package/dist/modes/interactive/interactive-mode.js +4116 -0
  311. package/dist/modes/interactive/theme/dark.json +85 -0
  312. package/dist/modes/interactive/theme/light.json +84 -0
  313. package/dist/modes/interactive/theme/theme-schema.json +335 -0
  314. package/dist/modes/interactive/theme/theme.d.ts +80 -0
  315. package/dist/modes/interactive/theme/theme.js +973 -0
  316. package/dist/modes/print-mode.d.ts +27 -0
  317. package/dist/modes/print-mode.js +102 -0
  318. package/dist/modes/rpc/jsonl.d.ts +16 -0
  319. package/dist/modes/rpc/jsonl.js +48 -0
  320. package/dist/modes/rpc/rpc-client.d.ts +219 -0
  321. package/dist/modes/rpc/rpc-client.js +405 -0
  322. package/dist/modes/rpc/rpc-mode.d.ts +19 -0
  323. package/dist/modes/rpc/rpc-mode.js +381 -0
  324. package/dist/modes/rpc/rpc-types.d.ts +406 -0
  325. package/dist/modes/rpc/rpc-types.js +7 -0
  326. package/dist/package-manager-cli.d.ts +3 -0
  327. package/dist/package-manager-cli.js +233 -0
  328. package/dist/utils/changelog.d.ts +20 -0
  329. package/dist/utils/changelog.js +86 -0
  330. package/dist/utils/child-process.d.ts +10 -0
  331. package/dist/utils/child-process.js +77 -0
  332. package/dist/utils/clipboard-image.d.ts +10 -0
  333. package/dist/utils/clipboard-image.js +244 -0
  334. package/dist/utils/clipboard-native.d.ts +7 -0
  335. package/dist/utils/clipboard-native.js +13 -0
  336. package/dist/utils/clipboard.d.ts +1 -0
  337. package/dist/utils/clipboard.js +77 -0
  338. package/dist/utils/exif-orientation.d.ts +4 -0
  339. package/dist/utils/exif-orientation.js +157 -0
  340. package/dist/utils/frontmatter.d.ts +7 -0
  341. package/dist/utils/frontmatter.js +25 -0
  342. package/dist/utils/git.d.ts +25 -0
  343. package/dist/utils/git.js +162 -0
  344. package/dist/utils/image-convert.d.ts +8 -0
  345. package/dist/utils/image-convert.js +38 -0
  346. package/dist/utils/image-resize.d.ts +35 -0
  347. package/dist/utils/image-resize.js +136 -0
  348. package/dist/utils/mime.d.ts +1 -0
  349. package/dist/utils/mime.js +25 -0
  350. package/dist/utils/path-shims.d.ts +1 -0
  351. package/dist/utils/path-shims.js +90 -0
  352. package/dist/utils/paths.d.ts +6 -0
  353. package/dist/utils/paths.js +18 -0
  354. package/dist/utils/photon.d.ts +20 -0
  355. package/dist/utils/photon.js +120 -0
  356. package/dist/utils/shell.d.ts +29 -0
  357. package/dist/utils/shell.js +189 -0
  358. package/dist/utils/sleep.d.ts +4 -0
  359. package/dist/utils/sleep.js +16 -0
  360. package/dist/utils/tools-manager.d.ts +3 -0
  361. package/dist/utils/tools-manager.js +101 -0
  362. package/dist/vendor/bin/darwin-arm64/fd +0 -0
  363. package/dist/vendor/bin/darwin-arm64/rg +0 -0
  364. package/dist/vendor/bin/darwin-x64/fd +0 -0
  365. package/dist/vendor/bin/darwin-x64/rg +0 -0
  366. package/dist/vendor/bin/linux-arm64/fd +0 -0
  367. package/dist/vendor/bin/linux-arm64/rg +0 -0
  368. package/dist/vendor/bin/linux-x64/fd +0 -0
  369. package/dist/vendor/bin/linux-x64/rg +0 -0
  370. package/dist/vendor/bin/win32-arm64/fd.exe +0 -0
  371. package/dist/vendor/bin/win32-arm64/rg.exe +0 -0
  372. package/dist/vendor/bin/win32-x64/fd.exe +0 -0
  373. package/dist/vendor/bin/win32-x64/rg.exe +0 -0
  374. package/package.json +90 -26
  375. package/dist/extension/core.d.ts +0 -69
  376. package/dist/extension/core.js +0 -270
  377. package/dist/extension/core.js.map +0 -1
  378. package/dist/extension/index.d.ts +0 -25
  379. package/dist/extension/index.js +0 -303
  380. package/dist/extension/index.js.map +0 -1
  381. package/dist/main.js.map +0 -1
  382. package/themes/pizza.json +0 -87
@@ -0,0 +1,513 @@
1
+ import { randomBytes } from "node:crypto";
2
+ import { createWriteStream, existsSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { Container, Text, truncateToWidth } from "@earendil-works/pi-tui";
6
+ import { Type } from "@sinclair/typebox";
7
+ import { spawn } from "child_process";
8
+ import { keyHint } from "../../modes/interactive/components/keybinding-hints.js";
9
+ import { truncateToVisualLines } from "../../modes/interactive/components/visual-truncate.js";
10
+ import { theme } from "../../modes/interactive/theme/theme.js";
11
+ import { waitForChildProcess } from "../../utils/child-process.js";
12
+ import { injectPizzaPathShims } from "../../utils/path-shims.js";
13
+ import { getShellConfig, getShellEnv, killProcessTree, trackDetachedChildPid, untrackDetachedChildPid, } from "../../utils/shell.js";
14
+ import { getTextOutput, invalidArgText, str } from "./render-utils.js";
15
+ import { wrapToolDefinition } from "./tool-definition-wrapper.js";
16
+ import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateTail } from "./truncate.js";
17
+ import { BUILTIN_COMMANDS, getBuiltinCommandHelpForArgs, parseBuiltinCommand, parseBuiltinToolInput, } from "./builtin-commands.js";
18
+ import { createEditToolDefinition } from "./edit.js";
19
+ import { createReadToolDefinition } from "./read.js";
20
+ import { createWriteToolDefinition } from "./write.js";
21
+ /**
22
+ * Generate a unique temp file path for bash output.
23
+ */
24
+ function getTempFilePath() {
25
+ const id = randomBytes(8).toString("hex");
26
+ return join(tmpdir(), `pizza-bash-${id}.log`);
27
+ }
28
+ const bashSchema = Type.Object({
29
+ command: Type.String({ description: "Bash command to execute" }),
30
+ timeout: Type.Optional(Type.Number({ description: "Timeout in seconds (optional, no default timeout)" })),
31
+ });
32
+ /**
33
+ * Create bash operations using Pizza's built-in local shell execution backend.
34
+ *
35
+ * This is useful for extensions that intercept user_bash and still want Pizza's
36
+ * standard local shell behavior while wrapping or rewriting commands.
37
+ */
38
+ export function createLocalBashOperations(options) {
39
+ return {
40
+ exec: (command, cwd, { onData, signal, timeout, env }) => {
41
+ return new Promise((resolve, reject) => {
42
+ const { shell, args } = getShellConfig(options?.shellPath);
43
+ if (!existsSync(cwd)) {
44
+ reject(new Error(`Working directory does not exist: ${cwd}\nCannot execute bash commands.`));
45
+ return;
46
+ }
47
+ const childEnv = injectPizzaPathShims(env ?? getShellEnv());
48
+ const child = spawn(shell, [...args, command], {
49
+ cwd,
50
+ detached: true,
51
+ env: childEnv,
52
+ stdio: ["ignore", "pipe", "pipe"],
53
+ });
54
+ if (child.pid)
55
+ trackDetachedChildPid(child.pid);
56
+ let timedOut = false;
57
+ let timeoutHandle;
58
+ // Set timeout if provided.
59
+ if (timeout !== undefined && timeout > 0) {
60
+ timeoutHandle = setTimeout(() => {
61
+ timedOut = true;
62
+ if (child.pid)
63
+ killProcessTree(child.pid);
64
+ }, timeout * 1000);
65
+ }
66
+ // Stream stdout and stderr.
67
+ child.stdout?.on("data", onData);
68
+ child.stderr?.on("data", onData);
69
+ // Handle abort signal by killing the entire process tree.
70
+ const onAbort = () => {
71
+ if (child.pid)
72
+ killProcessTree(child.pid);
73
+ };
74
+ if (signal) {
75
+ if (signal.aborted)
76
+ onAbort();
77
+ else
78
+ signal.addEventListener("abort", onAbort, { once: true });
79
+ }
80
+ // Handle shell spawn errors and wait for the process to terminate without hanging
81
+ // on inherited stdio handles held by detached descendants.
82
+ waitForChildProcess(child)
83
+ .then((code) => {
84
+ if (child.pid)
85
+ untrackDetachedChildPid(child.pid);
86
+ if (timeoutHandle)
87
+ clearTimeout(timeoutHandle);
88
+ if (signal)
89
+ signal.removeEventListener("abort", onAbort);
90
+ if (signal?.aborted) {
91
+ reject(new Error("aborted"));
92
+ return;
93
+ }
94
+ if (timedOut) {
95
+ reject(new Error(`timeout:${timeout}`));
96
+ return;
97
+ }
98
+ resolve({ exitCode: code });
99
+ })
100
+ .catch((err) => {
101
+ if (child.pid)
102
+ untrackDetachedChildPid(child.pid);
103
+ if (timeoutHandle)
104
+ clearTimeout(timeoutHandle);
105
+ if (signal)
106
+ signal.removeEventListener("abort", onAbort);
107
+ reject(err);
108
+ });
109
+ });
110
+ },
111
+ };
112
+ }
113
+ function resolveSpawnContext(command, cwd, spawnHook) {
114
+ const baseContext = { command, cwd, env: { ...getShellEnv() } };
115
+ return spawnHook ? spawnHook(baseContext) : baseContext;
116
+ }
117
+ const BASH_PREVIEW_LINES = 5;
118
+ class BashResultRenderComponent extends Container {
119
+ constructor() {
120
+ super(...arguments);
121
+ this.state = {
122
+ cachedWidth: undefined,
123
+ cachedLines: undefined,
124
+ cachedSkipped: undefined,
125
+ };
126
+ }
127
+ }
128
+ function formatDuration(ms) {
129
+ return `${(ms / 1000).toFixed(1)}s`;
130
+ }
131
+ function formatBashCall(args) {
132
+ const command = str(args?.command);
133
+ const timeout = args?.timeout;
134
+ const timeoutSuffix = timeout ? theme.fg("muted", ` (timeout ${timeout}s)`) : "";
135
+ const commandDisplay = command === null ? invalidArgText(theme) : command ? command : theme.fg("toolOutput", "...");
136
+ return theme.fg("toolTitle", theme.bold(`$ ${commandDisplay}`)) + timeoutSuffix;
137
+ }
138
+ function rebuildBashResultRenderComponent(component, result, options, showImages, startedAt, endedAt) {
139
+ const state = component.state;
140
+ component.clear();
141
+ const output = getTextOutput(result, showImages).trim();
142
+ if (output) {
143
+ const styledOutput = output
144
+ .split("\n")
145
+ .map((line) => theme.fg("toolOutput", line))
146
+ .join("\n");
147
+ if (options.expanded) {
148
+ component.addChild(new Text(`\n${styledOutput}`, 0, 0));
149
+ }
150
+ else {
151
+ component.addChild({
152
+ render: (width) => {
153
+ if (state.cachedLines === undefined || state.cachedWidth !== width) {
154
+ const preview = truncateToVisualLines(styledOutput, BASH_PREVIEW_LINES, width);
155
+ state.cachedLines = preview.visualLines;
156
+ state.cachedSkipped = preview.skippedCount;
157
+ state.cachedWidth = width;
158
+ }
159
+ if (state.cachedSkipped && state.cachedSkipped > 0) {
160
+ const hint = theme.fg("muted", `... (${state.cachedSkipped} earlier lines,`) +
161
+ ` ${keyHint("app.tools.expand", "to expand")})`;
162
+ return ["", truncateToWidth(hint, width, "..."), ...(state.cachedLines ?? [])];
163
+ }
164
+ return ["", ...(state.cachedLines ?? [])];
165
+ },
166
+ invalidate: () => {
167
+ state.cachedWidth = undefined;
168
+ state.cachedLines = undefined;
169
+ state.cachedSkipped = undefined;
170
+ },
171
+ });
172
+ }
173
+ }
174
+ const truncation = result.details?.truncation;
175
+ const fullOutputPath = result.details?.fullOutputPath;
176
+ if (truncation?.truncated || fullOutputPath) {
177
+ const warnings = [];
178
+ if (fullOutputPath) {
179
+ warnings.push(`Full output: ${fullOutputPath}`);
180
+ }
181
+ if (truncation?.truncated) {
182
+ if (truncation.truncatedBy === "lines") {
183
+ warnings.push(`Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines`);
184
+ }
185
+ else {
186
+ warnings.push(`Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)`);
187
+ }
188
+ }
189
+ component.addChild(new Text(`\n${theme.fg("warning", `[${warnings.join(". ")}]`)}`, 0, 0));
190
+ }
191
+ if (startedAt !== undefined) {
192
+ const label = options.isPartial ? "Elapsed" : "Took";
193
+ const endTime = endedAt ?? Date.now();
194
+ component.addChild(new Text(`\n${theme.fg("muted", `${label} ${formatDuration(endTime - startedAt)}`)}`, 0, 0));
195
+ }
196
+ }
197
+ function parseBashBuiltinCommand(command) {
198
+ const parsed = parseBuiltinCommand(command);
199
+ const builtinName = parsed.command.toLowerCase();
200
+ if (!BUILTIN_COMMANDS.includes(builtinName)) {
201
+ return null;
202
+ }
203
+ if (!canRouteAsBuiltin(command, parsed)) {
204
+ return null;
205
+ }
206
+ if (getBuiltinCommandHelpForArgs(builtinName, parsed.args)) {
207
+ return null;
208
+ }
209
+ return parseBuiltinToolInput(builtinName, parsed.args, parsed.heredoc);
210
+ }
211
+ function canRouteAsBuiltin(command, parsed) {
212
+ if (parsed.heredoc !== undefined) {
213
+ return parsed.command.toLowerCase() === "write";
214
+ }
215
+ return !hasShellControlSyntax(command);
216
+ }
217
+ function hasShellControlSyntax(command) {
218
+ let quote;
219
+ let escaped = false;
220
+ for (let i = 0; i < command.length; i++) {
221
+ const char = command[i];
222
+ if (escaped) {
223
+ escaped = false;
224
+ continue;
225
+ }
226
+ if (char === "\\") {
227
+ escaped = true;
228
+ continue;
229
+ }
230
+ if (quote) {
231
+ if (char === quote)
232
+ quote = undefined;
233
+ continue;
234
+ }
235
+ if (char === "'" || char === "\"") {
236
+ quote = char;
237
+ continue;
238
+ }
239
+ if (char === "|" || char === "&" || char === ";" || char === "<" || char === ">" || char === "\n") {
240
+ return true;
241
+ }
242
+ }
243
+ return false;
244
+ }
245
+ function builtinKey(builtin) {
246
+ if ("command" in builtin) {
247
+ return JSON.stringify({ name: builtin.command, args: builtin.input });
248
+ }
249
+ return JSON.stringify({ name: builtin.name, args: builtin.args });
250
+ }
251
+ function resetBuiltinRendererStateIfNeeded(state, key) {
252
+ if (state.builtinKey === key)
253
+ return;
254
+ state.builtinKey = key;
255
+ state.builtinCallComponent = undefined;
256
+ state.builtinResultComponent = undefined;
257
+ state.builtinRendererState = {};
258
+ }
259
+ function makeBuiltinRenderContext(context, args, lastComponent, state) {
260
+ state.builtinRendererState ??= {};
261
+ return {
262
+ ...context,
263
+ args,
264
+ lastComponent,
265
+ state: state.builtinRendererState,
266
+ };
267
+ }
268
+ export function createBashToolDefinition(cwd, options) {
269
+ const ops = options?.operations ?? createLocalBashOperations({ shellPath: options?.shellPath });
270
+ const commandPrefix = options?.commandPrefix;
271
+ const spawnHook = options?.spawnHook;
272
+ const readDefinition = createReadToolDefinition(cwd, options?.read);
273
+ const writeDefinition = createWriteToolDefinition(cwd, options?.write);
274
+ const editDefinition = createEditToolDefinition(cwd, options?.edit);
275
+ return {
276
+ name: "cli",
277
+ label: "cli",
278
+ description: `Execute a CLI command in the current working directory. Built-in file commands are routed internally: read, write, and edit. Other commands execute through the system shell (grep, find, ls, git, npm, etc.). Truncated to ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB.`,
279
+ promptSnippet: "Execute CLI commands: read/write/edit built-ins, or shell commands (grep, find, ls, git, npm, etc.)",
280
+ parameters: bashSchema,
281
+ async execute(toolCallId, { command, timeout }, signal, onUpdate, ctx) {
282
+ // Direct command routing: if command starts with a built-in command name,
283
+ // execute it internally. Otherwise fall through to bash.
284
+ const trimmedCommand = command.trim();
285
+ const parsedCommand = parseBuiltinCommand(trimmedCommand);
286
+ const help = getBuiltinCommandHelpForArgs(parsedCommand.command, parsedCommand.args);
287
+ if (help) {
288
+ return { content: [{ type: "text", text: help }], details: undefined };
289
+ }
290
+ const builtin = parseBashBuiltinCommand(trimmedCommand);
291
+ if (builtin) {
292
+ switch (builtin.command) {
293
+ case "read": {
294
+ const result = await readDefinition.execute(toolCallId, builtin.input, signal, undefined, ctx);
295
+ return {
296
+ content: result.content,
297
+ details: { builtin: { name: "read", args: builtin.input, details: result.details } },
298
+ };
299
+ }
300
+ case "write": {
301
+ const result = await writeDefinition.execute(toolCallId, builtin.input, signal, undefined, ctx);
302
+ return {
303
+ content: result.content,
304
+ details: { builtin: { name: "write", args: builtin.input, details: result.details } },
305
+ };
306
+ }
307
+ case "edit": {
308
+ const prepared = editDefinition.prepareArguments
309
+ ? editDefinition.prepareArguments(builtin.input)
310
+ : builtin.input;
311
+ const result = await editDefinition.execute(toolCallId, prepared, signal, undefined, ctx);
312
+ return {
313
+ content: result.content,
314
+ details: { builtin: { name: "edit", args: prepared, details: result.details } },
315
+ };
316
+ }
317
+ }
318
+ }
319
+ const resolvedCommand = commandPrefix ? `${commandPrefix}\n${command}` : command;
320
+ const spawnContext = resolveSpawnContext(resolvedCommand, cwd, spawnHook);
321
+ if (onUpdate) {
322
+ onUpdate({ content: [], details: undefined });
323
+ }
324
+ return new Promise((resolve, reject) => {
325
+ let tempFilePath;
326
+ let tempFileStream;
327
+ let totalBytes = 0;
328
+ const chunks = [];
329
+ let chunksBytes = 0;
330
+ const maxChunksBytes = DEFAULT_MAX_BYTES * 2;
331
+ const ensureTempFile = () => {
332
+ if (tempFilePath)
333
+ return;
334
+ tempFilePath = getTempFilePath();
335
+ tempFileStream = createWriteStream(tempFilePath);
336
+ for (const chunk of chunks)
337
+ tempFileStream.write(chunk);
338
+ };
339
+ const handleData = (data) => {
340
+ totalBytes += data.length;
341
+ // Start writing to a temp file once output exceeds the in-memory threshold.
342
+ if (totalBytes > DEFAULT_MAX_BYTES) {
343
+ ensureTempFile();
344
+ }
345
+ // Write to temp file if we have one.
346
+ if (tempFileStream)
347
+ tempFileStream.write(data);
348
+ // Keep a rolling buffer of recent output for tail truncation.
349
+ chunks.push(data);
350
+ chunksBytes += data.length;
351
+ // Trim old chunks if the rolling buffer grows too large.
352
+ while (chunksBytes > maxChunksBytes && chunks.length > 1) {
353
+ const removed = chunks.shift();
354
+ chunksBytes -= removed.length;
355
+ }
356
+ // Stream partial output using the rolling tail buffer.
357
+ if (onUpdate) {
358
+ const fullBuffer = Buffer.concat(chunks);
359
+ const fullText = fullBuffer.toString("utf-8");
360
+ const truncation = truncateTail(fullText);
361
+ if (truncation.truncated) {
362
+ ensureTempFile();
363
+ }
364
+ onUpdate({
365
+ content: [{ type: "text", text: truncation.content || "" }],
366
+ details: {
367
+ truncation: truncation.truncated ? truncation : undefined,
368
+ fullOutputPath: tempFilePath,
369
+ },
370
+ });
371
+ }
372
+ };
373
+ ops.exec(spawnContext.command, spawnContext.cwd, {
374
+ onData: handleData,
375
+ signal,
376
+ timeout,
377
+ env: spawnContext.env,
378
+ })
379
+ .then(({ exitCode }) => {
380
+ // Combine the rolling buffer chunks.
381
+ const fullBuffer = Buffer.concat(chunks);
382
+ const fullOutput = fullBuffer.toString("utf-8");
383
+ // Apply tail truncation for the final display payload.
384
+ const truncation = truncateTail(fullOutput);
385
+ if (truncation.truncated) {
386
+ ensureTempFile();
387
+ }
388
+ // Close temp file stream before building the final result.
389
+ if (tempFileStream)
390
+ tempFileStream.end();
391
+ let outputText = truncation.content || "(no output)";
392
+ let details;
393
+ if (truncation.truncated) {
394
+ // Build truncation details and an actionable notice.
395
+ details = { truncation, fullOutputPath: tempFilePath };
396
+ const startLine = truncation.totalLines - truncation.outputLines + 1;
397
+ const endLine = truncation.totalLines;
398
+ if (truncation.lastLinePartial) {
399
+ // Edge case: the last line alone is larger than the byte limit.
400
+ const lastLineSize = formatSize(Buffer.byteLength(fullOutput.split("\n").pop() || "", "utf-8"));
401
+ outputText += `\n\n[Showing last ${formatSize(truncation.outputBytes)} of line ${endLine} (line is ${lastLineSize}). Full output: ${tempFilePath}]`;
402
+ }
403
+ else if (truncation.truncatedBy === "lines") {
404
+ outputText += `\n\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines}. Full output: ${tempFilePath}]`;
405
+ }
406
+ else {
407
+ outputText += `\n\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). Full output: ${tempFilePath}]`;
408
+ }
409
+ }
410
+ if (exitCode !== 0 && exitCode !== null) {
411
+ outputText += `\n\nCommand exited with code ${exitCode}`;
412
+ reject(new Error(outputText));
413
+ }
414
+ else {
415
+ resolve({ content: [{ type: "text", text: outputText }], details });
416
+ }
417
+ })
418
+ .catch((err) => {
419
+ // Close temp file stream and include buffered output in the error message.
420
+ if (tempFileStream)
421
+ tempFileStream.end();
422
+ const fullBuffer = Buffer.concat(chunks);
423
+ let output = fullBuffer.toString("utf-8");
424
+ if (err.message === "aborted") {
425
+ if (output)
426
+ output += "\n\n";
427
+ output += "Command aborted";
428
+ reject(new Error(output));
429
+ }
430
+ else if (err.message.startsWith("timeout:")) {
431
+ const timeoutSecs = err.message.split(":")[1];
432
+ if (output)
433
+ output += "\n\n";
434
+ output += `Command timed out after ${timeoutSecs} seconds`;
435
+ reject(new Error(output));
436
+ }
437
+ else {
438
+ reject(err);
439
+ }
440
+ });
441
+ });
442
+ },
443
+ renderCall(args, renderTheme, context) {
444
+ const state = context.state;
445
+ if (context.executionStarted && state.startedAt === undefined) {
446
+ state.startedAt = Date.now();
447
+ state.endedAt = undefined;
448
+ }
449
+ const command = str(args?.command);
450
+ if (command) {
451
+ try {
452
+ const builtin = parseBashBuiltinCommand(command);
453
+ if (builtin) {
454
+ const key = builtinKey(builtin);
455
+ resetBuiltinRendererStateIfNeeded(state, key);
456
+ const definition = builtin.command === "read"
457
+ ? readDefinition
458
+ : builtin.command === "write"
459
+ ? writeDefinition
460
+ : editDefinition;
461
+ const renderContext = makeBuiltinRenderContext(context, builtin.input, state.builtinCallComponent, state);
462
+ const component = definition.renderCall?.(builtin.input, renderTheme, renderContext);
463
+ if (component) {
464
+ state.builtinCallComponent = component;
465
+ return component;
466
+ }
467
+ }
468
+ }
469
+ catch {
470
+ // Fall back to the bash call renderer for malformed built-in commands.
471
+ }
472
+ }
473
+ const text = context.lastComponent ?? new Text("", 0, 0);
474
+ text.setText(formatBashCall(args));
475
+ return text;
476
+ },
477
+ renderResult(result, options, renderTheme, context) {
478
+ const state = context.state;
479
+ if (state.startedAt !== undefined && options.isPartial && !state.interval) {
480
+ state.interval = setInterval(() => context.invalidate(), 1000);
481
+ }
482
+ if (!options.isPartial || context.isError) {
483
+ state.endedAt ??= Date.now();
484
+ if (state.interval) {
485
+ clearInterval(state.interval);
486
+ state.interval = undefined;
487
+ }
488
+ }
489
+ const builtin = result.details?.builtin;
490
+ if (builtin) {
491
+ const key = builtinKey(builtin);
492
+ resetBuiltinRendererStateIfNeeded(state, key);
493
+ const renderContext = makeBuiltinRenderContext(context, builtin.args, state.builtinResultComponent, state);
494
+ const component = builtin.name === "read"
495
+ ? readDefinition.renderResult?.({ content: result.content, details: builtin.details }, options, renderTheme, renderContext)
496
+ : builtin.name === "write"
497
+ ? writeDefinition.renderResult?.({ content: result.content, details: builtin.details }, options, renderTheme, renderContext)
498
+ : editDefinition.renderResult?.({ content: result.content, details: builtin.details }, options, renderTheme, renderContext);
499
+ if (component) {
500
+ state.builtinResultComponent = component;
501
+ return component;
502
+ }
503
+ }
504
+ const component = context.lastComponent ?? new BashResultRenderComponent();
505
+ rebuildBashResultRenderComponent(component, result, options, context.showImages, state.startedAt, state.endedAt);
506
+ component.invalidate();
507
+ return component;
508
+ },
509
+ };
510
+ }
511
+ export function createBashTool(cwd, options) {
512
+ return wrapToolDefinition(createBashToolDefinition(cwd, options));
513
+ }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Built-in CLI commands for file operations.
3
+ * These are exposed to the LLM via the cli tool.
4
+ *
5
+ * Supports heredoc syntax for multi-line content:
6
+ * write <path> <<EOF
7
+ * line1
8
+ * line2
9
+ * EOF
10
+ */
11
+ import { type Edit } from "./edit-diff.js";
12
+ export interface BuiltinCommandResult {
13
+ stdout: string;
14
+ stderr: string;
15
+ exitCode: number;
16
+ }
17
+ export interface ParsedBuiltinCommand {
18
+ command: string;
19
+ args: string[];
20
+ heredoc?: string;
21
+ }
22
+ export type ParsedBuiltinToolInput = {
23
+ command: "read";
24
+ input: {
25
+ path: string;
26
+ offset?: number;
27
+ limit?: number;
28
+ anchors?: "line" | "none";
29
+ };
30
+ } | {
31
+ command: "write";
32
+ input: {
33
+ path: string;
34
+ content: string;
35
+ };
36
+ } | {
37
+ command: "edit";
38
+ input: {
39
+ path: string;
40
+ edits: Edit[];
41
+ };
42
+ };
43
+ /**
44
+ * Parse builtin command with optional heredoc.
45
+ * Supports:
46
+ * write <path> <<EOF
47
+ * line1
48
+ * line2
49
+ * EOF
50
+ */
51
+ export declare function parseBuiltinCommandWithHeredoc(input: string): ParsedBuiltinCommand | null;
52
+ export declare function parseBuiltinCommand(input: string): ParsedBuiltinCommand;
53
+ export declare function parseBuiltinToolInput(command: string, args: string[], heredoc?: string): ParsedBuiltinToolInput | null;
54
+ export declare function getBuiltinCommandHelp(command: string): string | undefined;
55
+ export declare function getBuiltinCommandHelpForArgs(command: string, args: string[]): string | undefined;
56
+ /** @deprecated Use parseBuiltinCommandWithHeredoc */
57
+ export declare const parseCommandWithHeredoc: typeof parseBuiltinCommandWithHeredoc;
58
+ export interface BuiltinCommandContext {
59
+ cwd: string;
60
+ }
61
+ export declare function executeBuiltinCommand(command: string, args: string[], context: BuiltinCommandContext): Promise<BuiltinCommandResult>;
62
+ export declare const BUILTIN_COMMANDS: readonly ["read", "write", "edit"];
63
+ export type BuiltinCommand = (typeof BUILTIN_COMMANDS)[number];
64
+ /** @deprecated Use BuiltinCommandResult */
65
+ export type NativeCommandResult = BuiltinCommandResult;
66
+ /** @deprecated Use ParsedBuiltinCommand */
67
+ export type ParsedCommand = ParsedBuiltinCommand;
68
+ /** @deprecated Use BuiltinCommandContext */
69
+ export type NativeCommandContext = BuiltinCommandContext;
70
+ /** @deprecated Use executeBuiltinCommand */
71
+ export declare const executeNativeCommand: typeof executeBuiltinCommand;
72
+ /** @deprecated Use BUILTIN_COMMANDS */
73
+ export declare const NATIVE_COMMANDS: readonly ["read", "write", "edit"];
74
+ /** @deprecated Use BuiltinCommand */
75
+ export type NativeCommand = BuiltinCommand;