apex-code 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (573) hide show
  1. package/CHANGELOG.md +280 -6
  2. package/README.md +624 -0
  3. package/dist/bun/cli.d.ts +3 -1
  4. package/dist/bun/cli.d.ts.map +1 -1
  5. package/dist/bun/cli.js +3 -9
  6. package/dist/bun/cli.js.map +1 -1
  7. package/dist/bun/runtime-setup.d.ts +2 -0
  8. package/dist/bun/runtime-setup.d.ts.map +1 -0
  9. package/dist/bun/runtime-setup.js +9 -0
  10. package/dist/bun/runtime-setup.js.map +1 -0
  11. package/dist/bun/sandbox-env-setup.d.ts +2 -0
  12. package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
  13. package/dist/bun/sandbox-env-setup.js +4 -0
  14. package/dist/bun/sandbox-env-setup.js.map +1 -0
  15. package/dist/cli/args.d.ts.map +1 -1
  16. package/dist/cli/args.js +16 -5
  17. package/dist/cli/args.js.map +1 -1
  18. package/dist/cli/config-selector.d.ts.map +1 -1
  19. package/dist/cli/config-selector.js +2 -1
  20. package/dist/cli/config-selector.js.map +1 -1
  21. package/dist/cli/file-processor.d.ts +1 -1
  22. package/dist/cli/file-processor.d.ts.map +1 -1
  23. package/dist/cli/file-processor.js.map +1 -1
  24. package/dist/cli/session-picker.d.ts +1 -1
  25. package/dist/cli/session-picker.d.ts.map +1 -1
  26. package/dist/cli/session-picker.js.map +1 -1
  27. package/dist/cli/setup.d.ts +2 -0
  28. package/dist/cli/setup.d.ts.map +1 -0
  29. package/dist/cli/setup.js +13 -0
  30. package/dist/cli/setup.js.map +1 -0
  31. package/dist/config.d.ts +1 -0
  32. package/dist/config.d.ts.map +1 -1
  33. package/dist/config.js +1 -0
  34. package/dist/config.js.map +1 -1
  35. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  36. package/dist/core/agent-session-runtime.js +16 -8
  37. package/dist/core/agent-session-runtime.js.map +1 -1
  38. package/dist/core/agent-session.d.ts +85 -15
  39. package/dist/core/agent-session.d.ts.map +1 -1
  40. package/dist/core/agent-session.js +685 -266
  41. package/dist/core/agent-session.js.map +1 -1
  42. package/dist/core/auth-storage.d.ts +4 -0
  43. package/dist/core/auth-storage.d.ts.map +1 -1
  44. package/dist/core/auth-storage.js +55 -0
  45. package/dist/core/auth-storage.js.map +1 -1
  46. package/dist/core/bug-report.d.ts +176 -0
  47. package/dist/core/bug-report.d.ts.map +1 -0
  48. package/dist/core/bug-report.js +291 -0
  49. package/dist/core/bug-report.js.map +1 -0
  50. package/dist/core/cache-stats.d.ts.map +1 -1
  51. package/dist/core/cache-stats.js +12 -1
  52. package/dist/core/cache-stats.js.map +1 -1
  53. package/dist/core/cache-warmer.d.ts +103 -0
  54. package/dist/core/cache-warmer.d.ts.map +1 -0
  55. package/dist/core/cache-warmer.js +356 -0
  56. package/dist/core/cache-warmer.js.map +1 -0
  57. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  58. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  59. package/dist/core/compaction/branch-summarization.js +4 -3
  60. package/dist/core/compaction/branch-summarization.js.map +1 -1
  61. package/dist/core/compaction/compaction.d.ts +5 -3
  62. package/dist/core/compaction/compaction.d.ts.map +1 -1
  63. package/dist/core/compaction/compaction.js +163 -66
  64. package/dist/core/compaction/compaction.js.map +1 -1
  65. package/dist/core/context/pipeline.d.ts +8 -8
  66. package/dist/core/context/pipeline.d.ts.map +1 -1
  67. package/dist/core/context/pipeline.js +21 -12
  68. package/dist/core/context/pipeline.js.map +1 -1
  69. package/dist/core/crash-log.d.ts +27 -0
  70. package/dist/core/crash-log.d.ts.map +1 -0
  71. package/dist/core/crash-log.js +139 -0
  72. package/dist/core/crash-log.js.map +1 -0
  73. package/dist/core/export-html/template.js +6 -1
  74. package/dist/core/extensions/index.d.ts +1 -1
  75. package/dist/core/extensions/index.d.ts.map +1 -1
  76. package/dist/core/extensions/index.js.map +1 -1
  77. package/dist/core/extensions/jiti-loader.d.ts +2 -0
  78. package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
  79. package/dist/core/extensions/jiti-loader.js +4 -0
  80. package/dist/core/extensions/jiti-loader.js.map +1 -0
  81. package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
  82. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
  83. package/dist/core/extensions/jiti-static-loader.js +4 -0
  84. package/dist/core/extensions/jiti-static-loader.js.map +1 -0
  85. package/dist/core/extensions/loader.d.ts.map +1 -1
  86. package/dist/core/extensions/loader.js +40 -59
  87. package/dist/core/extensions/loader.js.map +1 -1
  88. package/dist/core/extensions/runner.d.ts +24 -8
  89. package/dist/core/extensions/runner.d.ts.map +1 -1
  90. package/dist/core/extensions/runner.js +195 -72
  91. package/dist/core/extensions/runner.js.map +1 -1
  92. package/dist/core/extensions/types.d.ts +142 -55
  93. package/dist/core/extensions/types.d.ts.map +1 -1
  94. package/dist/core/extensions/types.js.map +1 -1
  95. package/dist/core/extensions/virtual-modules.d.ts +3 -0
  96. package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
  97. package/dist/core/extensions/virtual-modules.js +41 -0
  98. package/dist/core/extensions/virtual-modules.js.map +1 -0
  99. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  100. package/dist/core/extensions/wrapper.js +1 -20
  101. package/dist/core/extensions/wrapper.js.map +1 -1
  102. package/dist/core/http-dispatcher.d.ts.map +1 -1
  103. package/dist/core/http-dispatcher.js +2 -0
  104. package/dist/core/http-dispatcher.js.map +1 -1
  105. package/dist/core/index.d.ts +2 -1
  106. package/dist/core/index.d.ts.map +1 -1
  107. package/dist/core/index.js.map +1 -1
  108. package/dist/core/keybindings.d.ts +6 -1
  109. package/dist/core/keybindings.d.ts.map +1 -1
  110. package/dist/core/keybindings.js +5 -1
  111. package/dist/core/keybindings.js.map +1 -1
  112. package/dist/core/messages.d.ts +1 -1
  113. package/dist/core/messages.d.ts.map +1 -1
  114. package/dist/core/messages.js +1 -0
  115. package/dist/core/messages.js.map +1 -1
  116. package/dist/core/model-config.d.ts +168 -20
  117. package/dist/core/model-config.d.ts.map +1 -1
  118. package/dist/core/model-config.js +44 -18
  119. package/dist/core/model-config.js.map +1 -1
  120. package/dist/core/model-registry.d.ts +5 -1
  121. package/dist/core/model-registry.d.ts.map +1 -1
  122. package/dist/core/model-registry.js +8 -0
  123. package/dist/core/model-registry.js.map +1 -1
  124. package/dist/core/model-resolver.d.ts.map +1 -1
  125. package/dist/core/model-resolver.js +4 -3
  126. package/dist/core/model-resolver.js.map +1 -1
  127. package/dist/core/model-runtime.d.ts +1 -0
  128. package/dist/core/model-runtime.d.ts.map +1 -1
  129. package/dist/core/model-runtime.js +12 -6
  130. package/dist/core/model-runtime.js.map +1 -1
  131. package/dist/core/permissions/store.d.ts.map +1 -1
  132. package/dist/core/permissions/store.js +11 -8
  133. package/dist/core/permissions/store.js.map +1 -1
  134. package/dist/core/prompt-templates.d.ts +6 -1
  135. package/dist/core/prompt-templates.d.ts.map +1 -1
  136. package/dist/core/prompt-templates.js +61 -35
  137. package/dist/core/prompt-templates.js.map +1 -1
  138. package/dist/core/provider-composer.d.ts +4 -2
  139. package/dist/core/provider-composer.d.ts.map +1 -1
  140. package/dist/core/provider-composer.js +29 -2
  141. package/dist/core/provider-composer.js.map +1 -1
  142. package/dist/core/radius.d.ts +3 -0
  143. package/dist/core/radius.d.ts.map +1 -1
  144. package/dist/core/radius.js +6 -0
  145. package/dist/core/radius.js.map +1 -1
  146. package/dist/core/resource-loader.d.ts.map +1 -1
  147. package/dist/core/resource-loader.js +6 -2
  148. package/dist/core/resource-loader.js.map +1 -1
  149. package/dist/core/sdk.d.ts.map +1 -1
  150. package/dist/core/sdk.js +63 -42
  151. package/dist/core/sdk.js.map +1 -1
  152. package/dist/core/session-export.d.ts +6 -2
  153. package/dist/core/session-export.d.ts.map +1 -1
  154. package/dist/core/session-export.js +14 -13
  155. package/dist/core/session-export.js.map +1 -1
  156. package/dist/core/session-manager.d.ts +66 -15
  157. package/dist/core/session-manager.d.ts.map +1 -1
  158. package/dist/core/session-manager.js +295 -115
  159. package/dist/core/session-manager.js.map +1 -1
  160. package/dist/core/settings-manager.d.ts +27 -4
  161. package/dist/core/settings-manager.d.ts.map +1 -1
  162. package/dist/core/settings-manager.js +56 -8
  163. package/dist/core/settings-manager.js.map +1 -1
  164. package/dist/core/skills.d.ts +1 -1
  165. package/dist/core/skills.d.ts.map +1 -1
  166. package/dist/core/skills.js +5 -4
  167. package/dist/core/skills.js.map +1 -1
  168. package/dist/core/slash-commands.d.ts.map +1 -1
  169. package/dist/core/slash-commands.js +1 -0
  170. package/dist/core/slash-commands.js.map +1 -1
  171. package/dist/core/system-prompt.d.ts +49 -6
  172. package/dist/core/system-prompt.d.ts.map +1 -1
  173. package/dist/core/system-prompt.js +140 -79
  174. package/dist/core/system-prompt.js.map +1 -1
  175. package/dist/core/tools/bash.d.ts +9 -15
  176. package/dist/core/tools/bash.d.ts.map +1 -1
  177. package/dist/core/tools/bash.js +20 -137
  178. package/dist/core/tools/bash.js.map +1 -1
  179. package/dist/core/tools/delegate.d.ts.map +1 -1
  180. package/dist/core/tools/delegate.js +2 -2
  181. package/dist/core/tools/delegate.js.map +1 -1
  182. package/dist/core/tools/edit.d.ts +1 -12
  183. package/dist/core/tools/edit.d.ts.map +1 -1
  184. package/dist/core/tools/edit.js +6 -204
  185. package/dist/core/tools/edit.js.map +1 -1
  186. package/dist/core/tools/find.d.ts.map +1 -1
  187. package/dist/core/tools/find.js +4 -55
  188. package/dist/core/tools/find.js.map +1 -1
  189. package/dist/core/tools/grep.d.ts.map +1 -1
  190. package/dist/core/tools/grep.js +4 -60
  191. package/dist/core/tools/grep.js.map +1 -1
  192. package/dist/core/tools/ls.d.ts.map +1 -1
  193. package/dist/core/tools/ls.js +4 -49
  194. package/dist/core/tools/ls.js.map +1 -1
  195. package/dist/core/tools/read.d.ts +4 -1
  196. package/dist/core/tools/read.d.ts.map +1 -1
  197. package/dist/core/tools/read.js +10 -122
  198. package/dist/core/tools/read.js.map +1 -1
  199. package/dist/core/tools/renderers/bash.d.ts +18 -0
  200. package/dist/core/tools/renderers/bash.d.ts.map +1 -0
  201. package/dist/core/tools/renderers/bash.js +126 -0
  202. package/dist/core/tools/renderers/bash.js.map +1 -0
  203. package/dist/core/tools/renderers/edit.d.ts +23 -0
  204. package/dist/core/tools/renderers/edit.d.ts.map +1 -0
  205. package/dist/core/tools/renderers/edit.js +207 -0
  206. package/dist/core/tools/renderers/edit.js.map +1 -0
  207. package/dist/core/tools/renderers/find.d.ts +10 -0
  208. package/dist/core/tools/renderers/find.d.ts.map +1 -0
  209. package/dist/core/tools/renderers/find.js +64 -0
  210. package/dist/core/tools/renderers/find.js.map +1 -0
  211. package/dist/core/tools/renderers/grep.d.ts +10 -0
  212. package/dist/core/tools/renderers/grep.d.ts.map +1 -0
  213. package/dist/core/tools/renderers/grep.js +69 -0
  214. package/dist/core/tools/renderers/grep.js.map +1 -0
  215. package/dist/core/tools/renderers/index.d.ts +34 -0
  216. package/dist/core/tools/renderers/index.d.ts.map +1 -0
  217. package/dist/core/tools/renderers/index.js +47 -0
  218. package/dist/core/tools/renderers/index.js.map +1 -0
  219. package/dist/core/tools/renderers/ls.d.ts +10 -0
  220. package/dist/core/tools/renderers/ls.d.ts.map +1 -0
  221. package/dist/core/tools/renderers/ls.js +58 -0
  222. package/dist/core/tools/renderers/ls.js.map +1 -0
  223. package/dist/core/tools/renderers/read.d.ts +11 -0
  224. package/dist/core/tools/renderers/read.d.ts.map +1 -0
  225. package/dist/core/tools/renderers/read.js +132 -0
  226. package/dist/core/tools/renderers/read.js.map +1 -0
  227. package/dist/core/tools/renderers/write.d.ts +10 -0
  228. package/dist/core/tools/renderers/write.d.ts.map +1 -0
  229. package/dist/core/tools/renderers/write.js +152 -0
  230. package/dist/core/tools/renderers/write.js.map +1 -0
  231. package/dist/core/tools/write.d.ts.map +1 -1
  232. package/dist/core/tools/write.js +6 -147
  233. package/dist/core/tools/write.js.map +1 -1
  234. package/dist/core/usage-totals.d.ts +1 -1
  235. package/dist/core/usage-totals.d.ts.map +1 -1
  236. package/dist/core/usage-totals.js +5 -1
  237. package/dist/core/usage-totals.js.map +1 -1
  238. package/dist/extensions/llama/client.d.ts +2 -0
  239. package/dist/extensions/llama/client.d.ts.map +1 -1
  240. package/dist/extensions/llama/client.js +7 -3
  241. package/dist/extensions/llama/client.js.map +1 -1
  242. package/dist/extensions/llama/provider.d.ts.map +1 -1
  243. package/dist/extensions/llama/provider.js +20 -5
  244. package/dist/extensions/llama/provider.js.map +1 -1
  245. package/dist/extensions/llama/ui.d.ts.map +1 -1
  246. package/dist/extensions/llama/ui.js +3 -2
  247. package/dist/extensions/llama/ui.js.map +1 -1
  248. package/dist/index.d.ts +5 -4
  249. package/dist/index.d.ts.map +1 -1
  250. package/dist/index.js +1 -1
  251. package/dist/index.js.map +1 -1
  252. package/dist/main.d.ts.map +1 -1
  253. package/dist/main.js +21 -13
  254. package/dist/main.js.map +1 -1
  255. package/dist/modes/interactive/bug-report.d.ts +16 -0
  256. package/dist/modes/interactive/bug-report.d.ts.map +1 -0
  257. package/dist/modes/interactive/bug-report.js +167 -0
  258. package/dist/modes/interactive/bug-report.js.map +1 -0
  259. package/dist/modes/interactive/chat-viewport.d.ts +20 -0
  260. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
  261. package/dist/modes/interactive/chat-viewport.js +28 -0
  262. package/dist/modes/interactive/chat-viewport.js.map +1 -0
  263. package/dist/modes/interactive/components/assistant-message.d.ts +7 -0
  264. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  265. package/dist/modes/interactive/components/assistant-message.js +63 -27
  266. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  267. package/dist/modes/interactive/components/autocomplete-source.d.ts +8 -0
  268. package/dist/modes/interactive/components/autocomplete-source.d.ts.map +1 -0
  269. package/dist/modes/interactive/components/autocomplete-source.js +23 -0
  270. package/dist/modes/interactive/components/autocomplete-source.js.map +1 -0
  271. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  272. package/dist/modes/interactive/components/bash-execution.js +6 -4
  273. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  274. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  275. package/dist/modes/interactive/components/bordered-loader.js +1 -1
  276. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  277. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  278. package/dist/modes/interactive/components/branch-summary-message.js +12 -5
  279. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  280. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  281. package/dist/modes/interactive/components/compaction-summary-message.js +12 -5
  282. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  283. package/dist/modes/interactive/components/composer-dock.d.ts +12 -0
  284. package/dist/modes/interactive/components/composer-dock.d.ts.map +1 -0
  285. package/dist/modes/interactive/components/composer-dock.js +24 -0
  286. package/dist/modes/interactive/components/composer-dock.js.map +1 -0
  287. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  288. package/dist/modes/interactive/components/config-selector.js +11 -9
  289. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  290. package/dist/modes/interactive/components/custom-editor.d.ts +12 -0
  291. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  292. package/dist/modes/interactive/components/custom-editor.js +38 -0
  293. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  294. package/dist/modes/interactive/components/error-summary.d.ts +11 -0
  295. package/dist/modes/interactive/components/error-summary.d.ts.map +1 -0
  296. package/dist/modes/interactive/components/error-summary.js +31 -0
  297. package/dist/modes/interactive/components/error-summary.js.map +1 -0
  298. package/dist/modes/interactive/components/extension-editor.d.ts +4 -1
  299. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  300. package/dist/modes/interactive/components/extension-editor.js +15 -10
  301. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  302. package/dist/modes/interactive/components/extension-input.d.ts +2 -0
  303. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  304. package/dist/modes/interactive/components/extension-input.js +15 -5
  305. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  306. package/dist/modes/interactive/components/extension-selector.d.ts +2 -0
  307. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  308. package/dist/modes/interactive/components/extension-selector.js +15 -10
  309. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  310. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  311. package/dist/modes/interactive/components/first-time-setup.js +6 -6
  312. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  313. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  314. package/dist/modes/interactive/components/footer.js +12 -4
  315. package/dist/modes/interactive/components/footer.js.map +1 -1
  316. package/dist/modes/interactive/components/index.d.ts +1 -1
  317. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  318. package/dist/modes/interactive/components/index.js.map +1 -1
  319. package/dist/modes/interactive/components/keybinding-hints.d.ts +21 -0
  320. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  321. package/dist/modes/interactive/components/keybinding-hints.js +34 -0
  322. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  323. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  324. package/dist/modes/interactive/components/login-dialog.js +27 -23
  325. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  326. package/dist/modes/interactive/components/model-selector.d.ts +1 -1
  327. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  328. package/dist/modes/interactive/components/model-selector.js +16 -20
  329. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  330. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  331. package/dist/modes/interactive/components/oauth-selector.js +7 -6
  332. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  333. package/dist/modes/interactive/components/permission-preview.d.ts.map +1 -1
  334. package/dist/modes/interactive/components/permission-preview.js +3 -3
  335. package/dist/modes/interactive/components/permission-preview.js.map +1 -1
  336. package/dist/modes/interactive/components/prompt-input.d.ts +12 -0
  337. package/dist/modes/interactive/components/prompt-input.d.ts.map +1 -0
  338. package/dist/modes/interactive/components/prompt-input.js +18 -0
  339. package/dist/modes/interactive/components/prompt-input.js.map +1 -0
  340. package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -1
  341. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  342. package/dist/modes/interactive/components/scoped-models-selector.js +17 -18
  343. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  344. package/dist/modes/interactive/components/session-selector.d.ts +5 -5
  345. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  346. package/dist/modes/interactive/components/session-selector.js +100 -67
  347. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  348. package/dist/modes/interactive/components/settings-selector.d.ts +5 -1
  349. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  350. package/dist/modes/interactive/components/settings-selector.js +74 -16
  351. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  352. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  353. package/dist/modes/interactive/components/settings-submenu.js +8 -6
  354. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  355. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  356. package/dist/modes/interactive/components/skill-invocation-message.js +11 -4
  357. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  358. package/dist/modes/interactive/components/status-indicator.d.ts +3 -1
  359. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  360. package/dist/modes/interactive/components/status-indicator.js +10 -3
  361. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  362. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  363. package/dist/modes/interactive/components/thinking-selector.js +14 -9
  364. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  365. package/dist/modes/interactive/components/tool-execution.d.ts +28 -16
  366. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  367. package/dist/modes/interactive/components/tool-execution.js +73 -80
  368. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  369. package/dist/modes/interactive/components/tool-panel.d.ts.map +1 -1
  370. package/dist/modes/interactive/components/tool-panel.js +7 -2
  371. package/dist/modes/interactive/components/tool-panel.js.map +1 -1
  372. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  373. package/dist/modes/interactive/components/tree-selector.js +18 -5
  374. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  375. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  376. package/dist/modes/interactive/components/trust-selector.js +12 -12
  377. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  378. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  379. package/dist/modes/interactive/components/user-message-selector.js +2 -2
  380. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  381. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  382. package/dist/modes/interactive/components/user-message.js +6 -3
  383. package/dist/modes/interactive/components/user-message.js.map +1 -1
  384. package/dist/modes/interactive/interactive-mode.d.ts +50 -31
  385. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  386. package/dist/modes/interactive/interactive-mode.js +494 -229
  387. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  388. package/dist/modes/interactive/theme/dark.json +2 -1
  389. package/dist/modes/interactive/theme/light.json +2 -1
  390. package/dist/modes/interactive/theme/theme-controller.d.ts +1 -0
  391. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  392. package/dist/modes/interactive/theme/theme-controller.js +5 -0
  393. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  394. package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
  395. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
  396. package/dist/modes/interactive/theme/theme-json.js +130 -0
  397. package/dist/modes/interactive/theme/theme-json.js.map +1 -0
  398. package/dist/modes/interactive/theme/theme-schema.json +6 -2
  399. package/dist/modes/interactive/theme/theme.d.ts +14 -5
  400. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  401. package/dist/modes/interactive/theme/theme.js +18 -119
  402. package/dist/modes/interactive/theme/theme.js.map +1 -1
  403. package/dist/modes/interactive/tui-renderer.d.ts +21 -0
  404. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
  405. package/dist/modes/interactive/tui-renderer.js +66 -0
  406. package/dist/modes/interactive/tui-renderer.js.map +1 -0
  407. package/dist/modes/print-mode.d.ts.map +1 -1
  408. package/dist/modes/print-mode.js +49 -23
  409. package/dist/modes/print-mode.js.map +1 -1
  410. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  411. package/dist/modes/rpc/rpc-mode.js +2 -2
  412. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  413. package/dist/testing/replay/recorded-provider.d.ts +2 -2
  414. package/dist/testing/replay/recorded-provider.d.ts.map +1 -1
  415. package/dist/testing/replay/recorded-provider.js +2 -5
  416. package/dist/testing/replay/recorded-provider.js.map +1 -1
  417. package/dist/testing/replay/runner.d.ts.map +1 -1
  418. package/dist/testing/replay/runner.js +0 -1
  419. package/dist/testing/replay/runner.js.map +1 -1
  420. package/dist/utils/clipboard-command.d.ts +7 -0
  421. package/dist/utils/clipboard-command.d.ts.map +1 -0
  422. package/dist/utils/clipboard-command.js +45 -0
  423. package/dist/utils/clipboard-command.js.map +1 -0
  424. package/dist/utils/clipboard-image.d.ts.map +1 -1
  425. package/dist/utils/clipboard-image.js +53 -81
  426. package/dist/utils/clipboard-image.js.map +1 -1
  427. package/dist/utils/clipboard.d.ts.map +1 -1
  428. package/dist/utils/clipboard.js +111 -121
  429. package/dist/utils/clipboard.js.map +1 -1
  430. package/dist/utils/exif-orientation.d.ts.map +1 -1
  431. package/dist/utils/exif-orientation.js +2 -3
  432. package/dist/utils/exif-orientation.js.map +1 -1
  433. package/dist/utils/mime.d.ts.map +1 -1
  434. package/dist/utils/mime.js +1 -1
  435. package/dist/utils/mime.js.map +1 -1
  436. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  437. package/dist/utils/syntax-highlight.js +21 -21
  438. package/dist/utils/syntax-highlight.js.map +1 -1
  439. package/dist/utils/tool-result-images.d.ts +3 -1
  440. package/dist/utils/tool-result-images.d.ts.map +1 -1
  441. package/dist/utils/tool-result-images.js +4 -1
  442. package/dist/utils/tool-result-images.js.map +1 -1
  443. package/dist/utils/tools-manager.d.ts.map +1 -1
  444. package/dist/utils/tools-manager.js +11 -2
  445. package/dist/utils/tools-manager.js.map +1 -1
  446. package/dist/utils/wsl.d.ts +3 -0
  447. package/dist/utils/wsl.d.ts.map +1 -0
  448. package/dist/utils/wsl.js +15 -0
  449. package/dist/utils/wsl.js.map +1 -0
  450. package/dist/utils/zip.d.ts +7 -0
  451. package/dist/utils/zip.d.ts.map +1 -0
  452. package/dist/utils/zip.js +60 -0
  453. package/dist/utils/zip.js.map +1 -0
  454. package/docs/cli-integration.md +107 -0
  455. package/docs/cli.md +269 -0
  456. package/docs/compaction.md +73 -24
  457. package/docs/configuration.md +45 -0
  458. package/docs/containerization.md +22 -21
  459. package/docs/custom-provider.md +21 -12
  460. package/docs/development.md +19 -0
  461. package/docs/docs.json +139 -95
  462. package/docs/extensions.md +243 -371
  463. package/docs/how-pi-works.md +49 -0
  464. package/docs/images/interactive-mode.png +0 -0
  465. package/docs/index.md +3 -3
  466. package/docs/json.md +43 -3
  467. package/docs/keybindings.md +57 -54
  468. package/docs/llama-cpp.md +2 -2
  469. package/docs/message-types.md +261 -0
  470. package/docs/models.md +103 -49
  471. package/docs/packages.md +49 -47
  472. package/docs/prompt-templates.md +29 -56
  473. package/docs/providers.md +91 -139
  474. package/docs/quickstart.md +42 -14
  475. package/docs/rpc-commands.md +854 -0
  476. package/docs/rpc-extension-ui.md +200 -0
  477. package/docs/rpc.md +121 -223
  478. package/docs/sdk.md +99 -124
  479. package/docs/security.md +7 -7
  480. package/docs/session-format.md +85 -82
  481. package/docs/sessions.md +41 -57
  482. package/docs/settings.md +95 -88
  483. package/docs/shell-aliases.md +68 -3
  484. package/docs/skills.md +62 -49
  485. package/docs/slash-commands.md +60 -0
  486. package/docs/terminal-setup.md +86 -55
  487. package/docs/termux.md +65 -75
  488. package/docs/themes.md +64 -86
  489. package/docs/tmux.md +29 -7
  490. package/docs/tui.md +67 -122
  491. package/docs/usage.md +31 -42
  492. package/docs/windows.md +41 -13
  493. package/examples/README.md +16 -2
  494. package/examples/extensions/README.md +0 -1
  495. package/examples/extensions/custom-provider-anthropic/index.ts +18 -12
  496. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  497. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  498. package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
  499. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  500. package/examples/extensions/dynamic-resources/dynamic.json +2 -0
  501. package/examples/extensions/gondolin/package-lock.json +2 -2
  502. package/examples/extensions/gondolin/package.json +1 -1
  503. package/examples/extensions/prompt-customizer.ts +19 -67
  504. package/examples/extensions/sandbox/package-lock.json +2 -2
  505. package/examples/extensions/sandbox/package.json +1 -1
  506. package/examples/extensions/with-deps/package-lock.json +2 -2
  507. package/examples/extensions/with-deps/package.json +1 -1
  508. package/examples/plugins/pi-example-plugin/README.md +38 -0
  509. package/examples/plugins/pi-example-plugin/package.json +10 -0
  510. package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
  511. package/examples/plugins/pi-example-plugin/src/session.ts +24 -0
  512. package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
  513. package/examples/rpc-client.ts +35 -0
  514. package/examples/rpc-extension-ui.ts +25 -5
  515. package/examples/sdk/README.md +1 -1
  516. package/npm-shrinkwrap.json +861 -513
  517. package/package.json +27 -18
  518. package/dist/bun/register-bedrock.d.ts +0 -2
  519. package/dist/bun/register-bedrock.d.ts.map +0 -1
  520. package/dist/bun/register-bedrock.js +0 -4
  521. package/dist/bun/register-bedrock.js.map +0 -1
  522. package/dist/cli/experimental/auth.d.ts +0 -16
  523. package/dist/cli/experimental/auth.d.ts.map +0 -1
  524. package/dist/cli/experimental/auth.js +0 -13
  525. package/dist/cli/experimental/auth.js.map +0 -1
  526. package/dist/cli/experimental/cli.d.ts +0 -6
  527. package/dist/cli/experimental/cli.d.ts.map +0 -1
  528. package/dist/cli/experimental/cli.js +0 -5
  529. package/dist/cli/experimental/cli.js.map +0 -1
  530. package/dist/cli/experimental/command-options.d.ts +0 -17
  531. package/dist/cli/experimental/command-options.d.ts.map +0 -1
  532. package/dist/cli/experimental/command-options.js +0 -35
  533. package/dist/cli/experimental/command-options.js.map +0 -1
  534. package/dist/cli/experimental/command.d.ts +0 -63
  535. package/dist/cli/experimental/command.d.ts.map +0 -1
  536. package/dist/cli/experimental/command.js +0 -130
  537. package/dist/cli/experimental/command.js.map +0 -1
  538. package/dist/cli/experimental/commands/client.d.ts +0 -13
  539. package/dist/cli/experimental/commands/client.d.ts.map +0 -1
  540. package/dist/cli/experimental/commands/client.js +0 -25
  541. package/dist/cli/experimental/commands/client.js.map +0 -1
  542. package/dist/cli/experimental/commands/pi.d.ts +0 -15
  543. package/dist/cli/experimental/commands/pi.d.ts.map +0 -1
  544. package/dist/cli/experimental/commands/pi.js +0 -28
  545. package/dist/cli/experimental/commands/pi.js.map +0 -1
  546. package/dist/cli/experimental/commands/server.d.ts +0 -13
  547. package/dist/cli/experimental/commands/server.d.ts.map +0 -1
  548. package/dist/cli/experimental/commands/server.js +0 -25
  549. package/dist/cli/experimental/commands/server.js.map +0 -1
  550. package/dist/cli/experimental/transport-address.d.ts +0 -10
  551. package/dist/cli/experimental/transport-address.d.ts.map +0 -1
  552. package/dist/cli/experimental/transport-address.js +0 -38
  553. package/dist/cli/experimental/transport-address.js.map +0 -1
  554. package/dist/client/index.d.ts +0 -3
  555. package/dist/client/index.d.ts.map +0 -1
  556. package/dist/client/index.js +0 -3
  557. package/dist/client/index.js.map +0 -1
  558. package/dist/client/remote-session.d.ts +0 -53
  559. package/dist/client/remote-session.d.ts.map +0 -1
  560. package/dist/client/remote-session.js +0 -340
  561. package/dist/client/remote-session.js.map +0 -1
  562. package/dist/client/transcript.d.ts +0 -12
  563. package/dist/client/transcript.d.ts.map +0 -1
  564. package/dist/client/transcript.js +0 -98
  565. package/dist/client/transcript.js.map +0 -1
  566. package/dist/modes/interactive/components/message-spine.d.ts +0 -14
  567. package/dist/modes/interactive/components/message-spine.d.ts.map +0 -1
  568. package/dist/modes/interactive/components/message-spine.js +0 -19
  569. package/dist/modes/interactive/components/message-spine.js.map +0 -1
  570. package/dist/utils/clipboard-native.d.ts +0 -11
  571. package/dist/utils/clipboard-native.d.ts.map +0 -1
  572. package/dist/utils/clipboard-native.js +0 -20
  573. package/dist/utils/clipboard-native.js.map +0 -1
package/README.md CHANGED
@@ -76,6 +76,42 @@ Canonical runtime controls use the `APEX_CODE_*` prefix, including
76
76
  remain for compatibility through the pre-1.0 line and will be removed no earlier than
77
77
  Apex Code 1.0.0 and 2027-02-16. Canonical values win when both forms are set.
78
78
 
79
+ ### Supported providers
80
+
81
+ **API keys:**
82
+ - Anthropic
83
+ - Ant Ling
84
+ - OpenAI
85
+ - Azure OpenAI
86
+ - DeepSeek
87
+ - NVIDIA NIM
88
+ - Google Gemini
89
+ - Google Vertex
90
+ - Amazon Bedrock
91
+ - Mistral
92
+ - Groq
93
+ - Cerebras
94
+ - Cloudflare AI Gateway
95
+ - Cloudflare Workers AI
96
+ - xAI
97
+ - OpenRouter
98
+ - Vercel AI Gateway
99
+ - ZAI Coding Plan (Global)
100
+ - ZAI Coding Plan (China)
101
+ - OpenCode Zen
102
+ - OpenCode Go
103
+ - Hugging Face
104
+ - Fireworks
105
+ - Together AI
106
+ - Baseten
107
+ - Kimi For Coding
108
+ - Meta
109
+ - MiniMax
110
+ - Xiaomi MiMo
111
+ - Xiaomi MiMo Token Plan (China)
112
+ - Xiaomi MiMo Token Plan (Amsterdam)
113
+ - Xiaomi MiMo Token Plan (Singapore)
114
+
79
115
  Extension callback variable names, the package manifest `pi` key, and imports from
80
116
  `@earendil-works/pi-ai` / `@earendil-works/pi-tui` are retained compatibility and
81
117
  upstream vocabulary, not executable or product branding.
@@ -100,6 +136,594 @@ Apex Code forks `pi-coding-agent` and `pi-agent-core`, while consuming `pi-ai` a
100
136
  `pi-tui` as upstream dependencies. Historical Pi links, API vocabulary, and
101
137
  attribution remain where compatibility requires them.
102
138
 
139
+ The interface from top to bottom:
140
+
141
+ - **Startup header** - Shows shortcuts (`/hotkeys` for all), loaded AGENTS.md files, prompt templates, skills, and extensions
142
+ - **Messages** - Your messages, assistant responses, tool calls and results, notifications, errors, and extension UI
143
+ - **Editor** - Where you type; border color indicates thinking level and the border shows the streaming working indicator
144
+ - **Footer** - Working directory, session name, total token/cache usage (`↑` input, `↓` output, `R` cache read, `W` cache write, `CH` latest cache hit rate), cost, context usage, current model. Totals include assistant responses, usage reported by tools, and summary generation.
145
+
146
+ The editor can be temporarily replaced by other UI, like built-in `/settings` or custom UI from extensions (e.g., a Q&A tool that lets the user answer model questions in a structured format). [Extensions](#extensions) can also replace the editor, add widgets above/below it, a status line, custom footer, or overlays.
147
+
148
+ ### Editor
149
+
150
+ | Feature | How |
151
+ |---------|-----|
152
+ | File reference | Type `@` to fuzzy-search project files |
153
+ | Path completion | Tab to complete paths |
154
+ | Multi-line | Shift+Enter (or Ctrl+Enter on Windows Terminal) |
155
+ | External editor | Ctrl+G opens `externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere |
156
+ | Clipboard | Ctrl+V to paste an image or text (Alt+V on Windows), or drag images onto terminal |
157
+ | Bash commands | `!command` runs and sends output to LLM, `!!command` runs without sending |
158
+
159
+ Standard editing keybindings for delete word, undo, etc. See [docs/keybindings.md](docs/keybindings.md).
160
+
161
+ ### Commands
162
+
163
+ Type `/` in the editor to trigger commands. [Extensions](#extensions) can register custom commands, [skills](#skills) are available as `/skill:name`, and [prompt templates](#prompt-templates) expand via `/templatename`.
164
+
165
+ | Command | Description |
166
+ |---------|-------------|
167
+ | `/login`, `/logout` | Manage provider credentials |
168
+ | [`/llama`](docs/llama-cpp.md) | Download, load, and unload llama.cpp router models |
169
+ | `/model` | Switch models; Ctrl+S in the picker saves the startup default |
170
+ | `/thinking` | Switch thinking level; Ctrl+S in the picker saves the startup default |
171
+ | `/scoped-models` | Enable/disable models for Ctrl+P cycling |
172
+ | `/settings` | Theme, message delivery, transport, and other preferences |
173
+ | `/resume` | Pick from previous sessions |
174
+ | `/new` | Start a new session |
175
+ | `/name <name>` | Set session display name |
176
+ | `/session` | Show session info (file, ID, messages, tokens, cost) |
177
+ | `/tree` | Jump to any point in the session and continue from there |
178
+ | `/trust` | Save project trust decision for future sessions (restart required) |
179
+ | `/fork` | Create a new session from a previous user message |
180
+ | `/clone` | Duplicate the current active branch into a new session |
181
+ | `/compact [prompt]` | Manually compact context, optional custom instructions |
182
+ | `/copy` | Copy last assistant message to clipboard |
183
+ | `/export [file]` | Export session to HTML or JSONL file |
184
+ | `/import <file>` | Import and resume a session from a JSONL file |
185
+ | `/share` | Upload as private GitHub gist with shareable HTML link |
186
+ | `/bug [description]` | Report a bug to the Pi developers; see [Sessions](docs/sessions.md#reporting-bugs) |
187
+ | `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
188
+ | `/hotkeys` | Show all keyboard shortcuts |
189
+ | `/changelog` | Display version history |
190
+ | `/quit` | Quit pi |
191
+
192
+ ### Keyboard Shortcuts
193
+
194
+ See `/hotkeys` for the full list. Customize via `~/.apex-code/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
195
+
196
+ **Commonly used:**
197
+
198
+ | Key | Action |
199
+ |-----|--------|
200
+ | Ctrl+C | Clear editor |
201
+ | Ctrl+C twice | Quit |
202
+ | Escape | Cancel/abort |
203
+ | Escape twice | Open `/tree` |
204
+ | Ctrl+L | Open model selector |
205
+ | Ctrl+P / Shift+Ctrl+P | Cycle scoped models forward/backward |
206
+ | Shift+Tab | Cycle thinking level |
207
+ | Ctrl+O | Collapse/expand tool output |
208
+ | Ctrl+T | Collapse/expand thinking blocks |
209
+ | Ctrl+X | Copy the last assistant message; with fullscreen copy-on-select disabled, copy the active text selection |
210
+
211
+ ### Message Queue
212
+
213
+ Submit messages while the agent is working:
214
+
215
+ - **Enter** queues a *steering* message, delivered after the current assistant turn finishes executing its tool calls
216
+ - **Alt+Enter** queues a *follow-up* message, delivered only after the agent finishes all work
217
+ - **Escape** aborts and restores queued messages to editor
218
+ - **Alt+Up** retrieves queued messages back to editor
219
+
220
+ On Windows Terminal, `Alt+Enter` is fullscreen by default. Remap it in [docs/terminal-setup.md](docs/terminal-setup.md) so pi can receive the follow-up shortcut.
221
+
222
+ Configure delivery in [settings](docs/settings.md): `steeringMode` and `followUpMode` can be `"one-at-a-time"` (default, waits for response) or `"all"` (delivers all queued at once). `transport` selects provider transport preference (`"sse"`, `"websocket"`, or `"auto"`) for providers that support multiple transports.
223
+
224
+ ---
225
+
226
+ ## Sessions
227
+
228
+ Sessions are stored as JSONL files with a tree structure. Each entry has an `id` and `parentId`, enabling in-place branching without creating new files. See [docs/session-format.md](docs/session-format.md) for file format.
229
+
230
+ ### Management
231
+
232
+ Sessions auto-save to `~/.apex-code/agent/sessions/` organized by working directory.
233
+
234
+ ```bash
235
+ apex-code -c # Continue most recent session
236
+ apex-code -r # Browse and select from past sessions
237
+ apex-code --no-session # Ephemeral mode (don't save)
238
+ apex-code --name "my task" # Set session display name at startup
239
+ apex-code --session <path|id> # Use specific session file or ID
240
+ apex-code --fork <path|id> # Fork specific session file or ID into a new session
241
+ ```
242
+
243
+ Use `/session` in interactive mode to see the current session ID before reusing it with `--session <id>` or `--fork <id>`.
244
+
245
+ ### Branching
246
+
247
+ **`/tree`** - Navigate the session tree in-place. Select any previous point, continue from there, and switch between branches. All history preserved in a single file. Selecting a point while the model is responding cancels that response. Navigation cannot proceed while compaction or another tree navigation is still running; wait for it to finish and retry.
248
+
249
+ <p align="center"><img src="docs/images/tree-view.png" alt="Tree View" width="600"></p>
250
+
251
+ - Search by typing, fold/unfold and jump between branches with Ctrl+←/Ctrl+→ or Alt+←/Alt+→, page with ←/→
252
+ - Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
253
+ - Press Ctrl+X to copy the selected message
254
+ - Press Shift+L to label entries as bookmarks and Shift+T to toggle label timestamps
255
+
256
+ **`/fork`** - Create a new session file from a previous user message on the active branch. Opens a selector, copies the active path up to that point, and places the selected prompt in the editor for modification.
257
+
258
+ **`/clone`** - Duplicate the current active branch into a new session file at the current position. The new session keeps the full active-path history and opens with an empty editor.
259
+
260
+ **`--fork <path|id>`** - Fork an existing session file or partial session UUID directly from the CLI. This copies the full source session into a new session file in the current project.
261
+
262
+ ### Compaction
263
+
264
+ Long sessions can exhaust context windows. Compaction summarizes older messages while keeping recent ones.
265
+
266
+ **Manual:** `/compact` or `/compact <custom instructions>`
267
+
268
+ **Automatic:** Enabled by default. Triggers on context overflow (recovers and retries) or when approaching the limit (proactive). Configure via `/settings` or `settings.json`.
269
+
270
+ Compaction is lossy. The full history remains in the JSONL file; use `/tree` to revisit. Customize compaction behavior via [extensions](#extensions). See [docs/compaction.md](docs/compaction.md) for internals.
271
+
272
+ Session model context is projected from append-only history. Extensions can append a `context_edit` to omit or replace an earlier message only for future model requests; raw history and usage remain unchanged:
273
+
274
+ ```typescript
275
+ const assistantId = sessionManager.appendMessage(partialAssistant);
276
+ sessionManager.appendContextEdit(assistantId, null); // Hidden from model context, retained in JSONL.
277
+ ```
278
+
279
+ A retain-none compaction uses `appendCompaction(summary, null, tokensBefore)` to make the exact summary the new context root while preserving prior raw entries.
280
+
281
+ ---
282
+
283
+ ## Settings
284
+
285
+ Use `/settings` to modify common options, or edit JSON files directly:
286
+
287
+ | Location | Scope |
288
+ |----------|-------|
289
+ | `~/.apex-code/agent/settings.json` | Global (all projects) |
290
+ | `.apex-code/settings.json` | Project (overrides global) |
291
+
292
+ See [docs/settings.md](docs/settings.md) for all options.
293
+
294
+ ### Project Trust
295
+
296
+ On interactive startup, pi asks before trusting a project folder that contains project-local settings, resources, or project `.agents/skills` and has no saved decision for the folder or a parent folder in `~/.apex-code/agent/trust.json`. Trusting a project allows pi to load `.apex-code/settings.json` and `.pi` resources, install missing project packages, and execute project extensions.
297
+
298
+ Before the trust decision, pi loads only context files, user/global extensions, and CLI `-e` extensions so they can handle the `project_trust` event. Project-local extensions, project package-managed extensions, and project settings are loaded only after the project is trusted. This split also applies when switching to a session from a different cwd whose trust has not been resolved in the current process.
299
+
300
+ Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore those project resources, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
301
+
302
+ If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.apex-code/agent/settings.json`, or change it with `/settings`.
303
+
304
+ `apex-code config` and package commands use the same project trust flow, except `apex-code update` never prompts. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
305
+
306
+ Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.apex-code/agent/trust.json` only; the current session is not reloaded, so restart pi for changes to take effect.
307
+
308
+ ### Version checks and telemetry
309
+
310
+ Apex Code sends no install or update telemetry. At startup it may request the latest
311
+ `apex-code` version from the npm registry. Set `APEX_CODE_SKIP_VERSION_CHECK=1` to
312
+ disable that request, or use `--offline` / `APEX_CODE_OFFLINE=1` to disable startup
313
+ network operations.
314
+
315
+ ---
316
+
317
+ ## Context Files
318
+
319
+ Pi loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
320
+ - `~/.apex-code/agent/AGENTS.md` (global)
321
+ - Parent directories (walking up from cwd)
322
+ - Current directory
323
+
324
+ If a directory contains `AGENTS.override.md`, Pi loads it instead of `AGENTS.md` or `CLAUDE.md` from that directory. Context files from other directories are still concatenated.
325
+
326
+ Use for project instructions (`AGENTS.md`/`CLAUDE.md`), conventions, common commands. All matching files are concatenated.
327
+
328
+ Disable context file loading with `--no-context-files` (or `-nc`).
329
+
330
+ ### System Prompt
331
+
332
+ Replace the default system prompt with `.apex-code/SYSTEM.md` (project) or `~/.apex-code/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
333
+
334
+ ---
335
+
336
+ ## Customization
337
+
338
+ ### Prompt Templates
339
+
340
+ Reusable prompts as Markdown files. Type `/name` to expand.
341
+
342
+ ```markdown
343
+ <!-- ~/.apex-code/agent/prompts/review.md -->
344
+ Review this code for bugs, security issues, and performance problems.
345
+ Focus on: {{focus}}
346
+ ```
347
+
348
+ Place in `~/.apex-code/agent/prompts/`, `.apex-code/prompts/`, or a [pi package](#pi-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
349
+
350
+ ### Skills
351
+
352
+ On-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.
353
+
354
+ ```markdown
355
+ <!-- ~/.apex-code/agent/skills/my-skill/SKILL.md -->
356
+ # My Skill
357
+ Use this skill when the user asks about X.
358
+
359
+ ## Steps
360
+ 1. Do this
361
+ 2. Then that
362
+ ```
363
+
364
+ Place in `~/.apex-code/agent/skills/`, `~/.agents/skills/`, `.apex-code/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [pi package](#pi-packages) to share with others. See [docs/skills.md](docs/skills.md).
365
+
366
+ ### Extensions
367
+
368
+ <p align="center"><img src="docs/images/doom-extension.png" alt="Doom Extension" width="600"></p>
369
+
370
+ TypeScript modules that extend pi with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
371
+
372
+ ```typescript
373
+ export default function (pi: ExtensionAPI) {
374
+ pi.registerTool({ name: "deploy", ... });
375
+ pi.registerCommand("stats", { ... });
376
+ pi.on("tool_call", async (event, ctx) => { ... });
377
+ }
378
+ ```
379
+
380
+ `turn_end` and `agent_before_settle` are actionable persistence boundaries. Handlers can append structural entries and request one continuation. Later handlers see earlier proposals:
381
+
382
+ ```typescript
383
+ let replacedResponse = false;
384
+ pi.on("turn_end", (event) => {
385
+ if (replacedResponse || event.outcome !== "completed" || event.toolResults.length > 0) return;
386
+ replacedResponse = true;
387
+ return {
388
+ entries: [
389
+ ...event.entries,
390
+ { type: "context_edit", targetId: event.messageEntryId, replacement: null },
391
+ {
392
+ type: "custom_message",
393
+ customType: "replacement-instruction",
394
+ content: "Answer again using the persisted user request.",
395
+ display: false,
396
+ },
397
+ ],
398
+ continue: true,
399
+ };
400
+ });
401
+ ```
402
+
403
+ Continuation is one-shot per boundary result, not per registered handler. It ensures one next provider request: tool-result, steering, or follow-up scheduling can satisfy that request without adding another one; otherwise Pi makes one context-only request. Guard handlers like the example above because an unconditional `continue: true` is evaluated again after the next response and can loop indefinitely. Error and aborted responses remain hard exits.
404
+
405
+ Use `agent_before_settle` for final actions after retries, compaction, and queued input are exhausted. See [docs/extensions.md](docs/extensions.md#agent_start--agent_end--agent_before_settle--agent_settled).
406
+
407
+ The default export can also be `async`. pi waits for async extension factories before startup continues, which is useful for one-time initialization such as fetching remote model lists before calling `pi.registerProvider()`.
408
+
409
+ **What's possible:**
410
+ - Custom tools (or replace built-in tools entirely)
411
+ - Sub-agents and plan mode
412
+ - Custom compaction and summarization
413
+ - Permission gates and path protection
414
+ - Custom editors and UI components
415
+ - Status lines, headers, footers
416
+ - Git checkpointing and auto-commit
417
+ - SSH and sandbox execution
418
+ - MCP server integration
419
+ - Make pi look like Claude Code
420
+ - Games while waiting (yes, Doom runs)
421
+ - ...anything you can dream up
422
+
423
+ Place in `~/.apex-code/agent/extensions/`, `.apex-code/extensions/`, or a [pi package](#pi-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).
424
+
425
+ ### Themes
426
+
427
+ Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and pi immediately applies changes.
428
+
429
+ Place in `~/.apex-code/agent/themes/`, `.apex-code/themes/`, or a [pi package](#pi-packages) to share with others. See [docs/themes.md](docs/themes.md).
430
+
431
+ ### Pi Packages
432
+
433
+ Bundle and share extensions, skills, prompts, and themes via npm or git. Find packages on [npmjs.com](https://www.npmjs.com/search?q=keywords%3Api-package) or [Discord](https://discord.com/channels/1456806362351669492/1457744485428629628).
434
+
435
+ > **Security:** Pi packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
436
+
437
+ ```bash
438
+ apex-code install npm:@foo/pi-tools
439
+ apex-code install npm:@foo/pi-tools@1.2.3 # pinned version
440
+ apex-code install git:github.com/user/repo
441
+ apex-code install git:github.com/user/repo@v1 # tag or commit
442
+ apex-code install git:git@github.com:user/repo
443
+ apex-code install git:git@github.com:user/repo@v1 # tag or commit
444
+ apex-code install https://github.com/user/repo
445
+ apex-code install https://github.com/user/repo@v1 # tag or commit
446
+ apex-code install ssh://git@github.com/user/repo
447
+ apex-code install ssh://git@github.com/user/repo@v1 # tag or commit
448
+ apex-code remove npm:@foo/pi-tools
449
+ apex-code uninstall npm:@foo/pi-tools # alias for remove
450
+ apex-code list
451
+ apex-code update # update pi only
452
+ apex-code update --all # update pi and packages
453
+ apex-code update --extensions # update packages only
454
+ apex-code update --models # refresh model catalogs only
455
+ apex-code update --self # update pi only
456
+ apex-code update --self --force # reinstall pi even if current
457
+ apex-code update npm:@foo/pi-tools # update one package
458
+ apex-code config # enable/disable extensions, skills, prompts, themes
459
+ ```
460
+
461
+ Packages install to `~/.apex-code/agent/git/` (git) or `~/.apex-code/agent/npm/` (npm). Use `-l` for project-local installs (`.apex-code/git/`, `.apex-code/npm/`). Git `@ref` values are pinned tags or commits; pinned packages are skipped by `apex-code update --extensions` and `apex-code update --all`, so use `apex-code install git:host/user/repo@new-ref` to move an existing package to a new ref. Git packages install dependencies with `npm install --omit=dev` by default, so runtime deps must be listed under `dependencies`; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers. If you use a Node version manager and want package installs to reuse a stable npm context, set `npmCommand` in `settings.json`, for example `["mise", "exec", "node@20", "--", "npm"]`.
462
+
463
+ Create a package by adding a `pi` key to `package.json`:
464
+
465
+ ```json
466
+ {
467
+ "name": "my-pi-package",
468
+ "keywords": ["pi-package"],
469
+ "pi": {
470
+ "extensions": ["./extensions"],
471
+ "skills": ["./skills"],
472
+ "prompts": ["./prompts"],
473
+ "themes": ["./themes"]
474
+ }
475
+ }
476
+ ```
477
+
478
+ Without a `pi` manifest, pi auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
479
+
480
+ See [docs/packages.md](docs/packages.md).
481
+
482
+ ---
483
+
484
+ ## Programmatic Usage
485
+
486
+ ### SDK
487
+
488
+ ```typescript
489
+ import { createAgentSession, ModelRuntime, SessionManager } from "@earendil-works/pi-coding-agent";
490
+
491
+ const modelRuntime = await ModelRuntime.create();
492
+ const { session } = await createAgentSession({
493
+ sessionManager: SessionManager.inMemory(),
494
+ modelRuntime,
495
+ });
496
+
497
+ await session.prompt("What files are in the current directory?");
498
+ ```
499
+
500
+ For advanced multi-session runtime replacement, use `createAgentSessionRuntime()` and `AgentSessionRuntime`.
501
+
502
+ See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/).
503
+
504
+ ### RPC Mode
505
+
506
+ For non-Node.js integrations, use RPC mode over stdin/stdout:
507
+
508
+ ```bash
509
+ apex-code --mode rpc
510
+ ```
511
+
512
+ RPC mode uses strict LF-delimited JSONL framing. Clients must split records on `\n` only. Do not use generic line readers like Node `readline`, which also split on Unicode separators inside JSON payloads.
513
+
514
+ See [docs/rpc.md](docs/rpc.md) for the protocol.
515
+
516
+ ---
517
+
518
+ ## Philosophy
519
+
520
+ Pi is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [pi packages](#pi-packages). This keeps the core minimal while letting you shape pi to fit how you work.
521
+
522
+ **No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support. [Why?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
523
+
524
+ **No sub-agents.** There's many ways to do this. Spawn pi instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
525
+
526
+ **No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
527
+
528
+ **No plan mode.** Write plans to files, or build it with [extensions](#extensions), or install a package.
529
+
530
+ **No built-in to-dos.** They confuse models. Use a TODO.md file, or build your own with [extensions](#extensions).
531
+
532
+ **No background bash.** Use tmux. Full observability, direct interaction.
533
+
534
+ Read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/) for the full rationale.
535
+
536
+ ---
537
+
538
+ ## CLI Reference
539
+
540
+ ```bash
541
+ apex-code [options] [--] [@files...] [messages...]
542
+ ```
543
+
544
+ ### Package Commands
545
+
546
+ ```bash
547
+ apex-code install <source> [-l] # Install package, -l for project-local
548
+ apex-code remove <source> [-l] # Remove package
549
+ apex-code uninstall <source> [-l] # Alias for remove
550
+ apex-code update [source|self|pi] # Update pi only, or one package source
551
+ apex-code update --all # Update pi and packages
552
+ apex-code update --extensions # Update packages only
553
+ apex-code update --models # Refresh model catalogs only
554
+ apex-code update --self # Update pi only
555
+ apex-code update --self --force # Reinstall pi even if current
556
+ apex-code update --extension <src> # Update one package
557
+ apex-code list # List installed packages
558
+ apex-code config # Enable/disable package resources
559
+ ```
560
+
561
+ `apex-code config` and project package commands accept `--approve`/`--no-approve` to trust or ignore project-local settings for one command. `apex-code update` never prompts for project trust.
562
+
563
+ ### Modes
564
+
565
+ | Flag | Description |
566
+ |------|-------------|
567
+ | (default) | Interactive mode |
568
+ | `-p`, `--print` | Print response and exit |
569
+ | `--mode json` | Output all events as JSON lines (see [docs/json.md](docs/json.md)) |
570
+ | `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |
571
+ | `--export <in> [out]` | Export session to HTML |
572
+
573
+ In print mode, pi also reads piped stdin and merges it into the initial prompt:
574
+
575
+ ```bash
576
+ cat README.md | apex-code -p "Summarize this text"
577
+ ```
578
+
579
+ ### Model Options
580
+
581
+ | Option | Description |
582
+ |--------|-------------|
583
+ | `--provider <name>` | Provider (anthropic, openai, google, etc.) |
584
+ | `--model <pattern>` | Model pattern or ID (supports `provider/id` and optional `:<thinking>`) |
585
+ | `--api-key <key>` | API key (overrides env vars) |
586
+ | `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
587
+ | `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
588
+ | `--list-models [search]` | List available models |
589
+
590
+ ### Session Options
591
+
592
+ | Option | Description |
593
+ |--------|-------------|
594
+ | `-c`, `--continue` | Continue most recent session |
595
+ | `-r`, `--resume` | Browse and select session |
596
+ | `--session <path\|id>` | Use specific session file or partial UUID |
597
+ | `--fork <path\|id>` | Fork specific session file or partial UUID into a new session |
598
+ | `--session-dir <dir>` | Custom session storage directory |
599
+ | `--no-session` | Ephemeral mode (don't save) |
600
+ | `--name <name>`, `-n <name>` | Set session display name at startup |
601
+
602
+ ### Tool Options
603
+
604
+ | Option | Description |
605
+ |--------|-------------|
606
+ | `--tools <list>`, `-t <list>` | Allowlist specific tool names across built-in, extension, and custom tools |
607
+ | `--exclude-tools <list>`, `-xt <list>` | Disable specific tool names across built-in, extension, and custom tools |
608
+ | `--no-builtin-tools`, `-nbt` | Disable built-in tools by default but keep extension/custom tools enabled |
609
+ | `--no-tools`, `-nt` | Disable all tools by default |
610
+
611
+ Available built-in tools: `read`, `bash`, `powershell` (Windows), `edit`, `write`, `grep`, `find`, `ls`
612
+
613
+ ### Resource Options
614
+
615
+ | Option | Description |
616
+ |--------|-------------|
617
+ | `-e`, `--extension <source>` | Load extension from path, npm, or git (repeatable) |
618
+ | `--no-extensions` | Disable extension discovery |
619
+ | `--skill <path>` | Load skill (repeatable) |
620
+ | `--no-skills` | Disable skill discovery |
621
+ | `--prompt-template <path>` | Load prompt template (repeatable) |
622
+ | `--no-prompt-templates` | Disable prompt template discovery |
623
+ | `--theme <path>` | Load theme (repeatable) |
624
+ | `--no-themes` | Disable theme discovery |
625
+ | `--no-context-files`, `-nc` | Disable AGENTS.md and CLAUDE.md context file discovery |
626
+
627
+ Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings.json (e.g., `--no-extensions -e ./my-ext.ts`).
628
+
629
+ ### Other Options
630
+
631
+ | Option | Description |
632
+ |--------|-------------|
633
+ | `--system-prompt <text>` | Replace default prompt (context files and skills still appended) |
634
+ | `--append-system-prompt <text>` | Append to system prompt |
635
+ | `--tui-mode <mode>` | TUI mode: `regular` (default) or experimental `fullscreen` |
636
+ | `--use-theme <name[/name]>` | Set the initial interactive theme for this run without changing settings |
637
+ | `--verbose` | Force verbose startup |
638
+ | `-a`, `--approve` | Trust project-local files for this run |
639
+ | `-na`, `--no-approve` | Ignore project-local files for this run |
640
+ | `--` | Stop option parsing; remaining arguments are prompts or `@file` inputs |
641
+ | `-h`, `--help` | Show help |
642
+ | `-v`, `--version` | Show version |
643
+
644
+ ### File Arguments
645
+
646
+ Prefix files with `@` to include in the message:
647
+
648
+ ```bash
649
+ apex-code @prompt.md "Answer this"
650
+ apex-code -p @screenshot.png "What's in this image?"
651
+ apex-code @code.ts @test.ts "Review these files"
652
+ ```
653
+
654
+ ### Examples
655
+
656
+ ```bash
657
+ # Interactive with initial prompt
658
+ apex-code "List all .ts files in src/"
659
+
660
+ # Non-interactive
661
+ apex-code -p "Summarize this codebase"
662
+
663
+ # Prompt beginning with a dash
664
+ apex-code -p -- "- Summarize these points"
665
+
666
+ # Non-interactive with piped stdin
667
+ cat README.md | apex-code -p "Summarize this text"
668
+
669
+ # Named one-shot session
670
+ apex-code --name "release audit" -p "Audit this repository"
671
+
672
+ # Different model
673
+ apex-code --provider openai --model gpt-4o "Help me refactor"
674
+
675
+ # Model with provider prefix (no --provider needed)
676
+ apex-code --model openai/gpt-4o "Help me refactor"
677
+
678
+ # Model with thinking level shorthand
679
+ apex-code --model sonnet:high "Solve this complex problem"
680
+
681
+ # Limit model cycling
682
+ apex-code --models "claude-*,gpt-4o"
683
+
684
+ # Read-only mode
685
+ apex-code --tools read,grep,find,ls -p "Review the code"
686
+
687
+ # Disable one extension or built-in tool while keeping the rest available
688
+ apex-code --exclude-tools ask_question
689
+
690
+ # High thinking level
691
+ apex-code --thinking high "Solve this complex problem"
692
+ ```
693
+
694
+ ### Environment Variables
695
+
696
+ | Variable | Description |
697
+ |----------|-------------|
698
+ | `AI_AGENT` | Set to `pi` by the CLI and RPC entry points so generic tooling can attribute child processes to Pi |
699
+ | `PI_CODING_AGENT` | Set to `true` by the CLI and RPC entry points so child processes can detect that they run inside Pi |
700
+ | `PI_CODING_AGENT_DIR` | Override config directory (default: `~/.apex-code/agent`) |
701
+ | `PI_CODING_AGENT_SESSION_DIR` | Override session storage directory (overridden by `--session-dir`) |
702
+ | `PI_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
703
+ | `PI_OFFLINE` | Disable startup network operations, including update checks, package update checks, and install/update telemetry |
704
+ | `PI_SKIP_VERSION_CHECK` | Skip the Pi version update check at startup. This prevents the `pi.dev` latest-version request |
705
+ | `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers. Use `1`/`true`/`yes` to enable or `0`/`false`/`no` to disable. This does not disable update checks |
706
+ | `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
707
+ | `VISUAL`, `EDITOR` | Fallback external editor for Ctrl+G when `externalEditor` is unset; defaults to Notepad on Windows and `nano` elsewhere |
708
+
709
+ Commands run by the LLM-callable `bash` and `powershell` tools also receive current session metadata:
710
+
711
+ | Variable | Description |
712
+ |----------|-------------|
713
+ | `PI_SESSION_ID` | Current session ID |
714
+ | `PI_SESSION_FILE` | Absolute session JSONL path; unset for ephemeral sessions |
715
+ | `PI_PROVIDER` | Currently selected model provider |
716
+ | `PI_MODEL` | Currently selected model ID |
717
+ | `PI_REASONING_LEVEL` | Current effective reasoning level |
718
+
719
+ These values are resolved when each command starts. See [Environment Variables](docs/environment-variables.md#shell-tool-session-environment) for semantics, examples, and custom-tool opt-out.
720
+
721
+ ---
722
+
723
+ ## Contributing & Development
724
+
725
+ See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines and [docs/development.md](docs/development.md) for setup, forking, and debugging.
726
+
103
727
  ## License
104
728
 
105
729
  MIT. See the source repository's `LICENSE` and `NOTICE` files.
package/dist/bun/cli.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ import "./sandbox-env-setup.ts";
3
+ import "./runtime-setup.ts";
4
+ import "../cli.ts";
3
5
  //# sourceMappingURL=cli.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":"","sourcesContent":["#!/usr/bin/env node\nimport { registerBunOAuthFlows } from \"@earendil-works/pi-ai/bun-oauth\";\nimport { APP_NAME } from \"../config.ts\";\n\nprocess.title = APP_NAME;\nprocess.emitWarning = (() => {}) as typeof process.emitWarning;\n\nregisterBunOAuthFlows();\n\nimport { restoreSandboxEnv } from \"./restore-sandbox-env.ts\";\n\nrestoreSandboxEnv();\n\nawait import(\"./register-bedrock.ts\");\nawait import(\"../cli.ts\");\n"]}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":";AACA,OAAO,wBAAwB,CAAC;AAChC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,WAAW,CAAC","sourcesContent":["#!/usr/bin/env node\nimport \"./sandbox-env-setup.ts\";\nimport \"./runtime-setup.ts\";\nimport \"../cli.ts\";\n"]}
package/dist/bun/cli.js CHANGED
@@ -1,11 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { registerBunOAuthFlows } from "@earendil-works/pi-ai/bun-oauth";
3
- import { APP_NAME } from "../config.js";
4
- process.title = APP_NAME;
5
- process.emitWarning = (() => { });
6
- registerBunOAuthFlows();
7
- import { restoreSandboxEnv } from "./restore-sandbox-env.js";
8
- restoreSandboxEnv();
9
- await import("./register-bedrock.js");
10
- await import("../cli.js");
2
+ import "./sandbox-env-setup.js";
3
+ import "./runtime-setup.js";
4
+ import "../cli.js";
11
5
  //# sourceMappingURL=cli.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC;AACzB,OAAO,CAAC,WAAW,GAAG,CAAC,GAAG,EAAE,CAAC,EAAC,CAAC,CAA+B,CAAC;AAE/D,qBAAqB,EAAE,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,iBAAiB,EAAE,CAAC;AAEpB,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;AACtC,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { registerBunOAuthFlows } from \"@earendil-works/pi-ai/bun-oauth\";\nimport { APP_NAME } from \"../config.ts\";\n\nprocess.title = APP_NAME;\nprocess.emitWarning = (() => {}) as typeof process.emitWarning;\n\nregisterBunOAuthFlows();\n\nimport { restoreSandboxEnv } from \"./restore-sandbox-env.ts\";\n\nrestoreSandboxEnv();\n\nawait import(\"./register-bedrock.ts\");\nawait import(\"../cli.ts\");\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":";AACA,OAAO,wBAAwB,CAAC;AAChC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,WAAW,CAAC","sourcesContent":["#!/usr/bin/env node\nimport \"./sandbox-env-setup.ts\";\nimport \"./runtime-setup.ts\";\nimport \"../cli.ts\";\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=runtime-setup.d.ts.map