apex-code 0.0.1-alpha.0 → 0.0.1-alpha.2

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 (426) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +66 -681
  3. package/dist/cli/args.d.ts +5 -0
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +45 -6
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/auth-command.d.ts.map +1 -1
  8. package/dist/cli/auth-command.js +3 -3
  9. package/dist/cli/auth-command.js.map +1 -1
  10. package/dist/cli/cost-command.d.ts +19 -0
  11. package/dist/cli/cost-command.d.ts.map +1 -0
  12. package/dist/cli/cost-command.js +107 -0
  13. package/dist/cli/cost-command.js.map +1 -0
  14. package/dist/cli/startup-ui.d.ts +1 -1
  15. package/dist/cli/startup-ui.d.ts.map +1 -1
  16. package/dist/cli/startup-ui.js +1 -2
  17. package/dist/cli/startup-ui.js.map +1 -1
  18. package/dist/cli.d.ts.map +1 -1
  19. package/dist/cli.js +45 -16
  20. package/dist/cli.js.map +1 -1
  21. package/dist/config.d.ts +2 -2
  22. package/dist/config.d.ts.map +1 -1
  23. package/dist/config.js +14 -7
  24. package/dist/config.js.map +1 -1
  25. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  26. package/dist/core/agent-session-runtime.js +2 -0
  27. package/dist/core/agent-session-runtime.js.map +1 -1
  28. package/dist/core/agent-session-services.d.ts +9 -0
  29. package/dist/core/agent-session-services.d.ts.map +1 -1
  30. package/dist/core/agent-session-services.js +30 -4
  31. package/dist/core/agent-session-services.js.map +1 -1
  32. package/dist/core/agent-session.d.ts +46 -0
  33. package/dist/core/agent-session.d.ts.map +1 -1
  34. package/dist/core/agent-session.js +137 -19
  35. package/dist/core/agent-session.js.map +1 -1
  36. package/dist/core/auth-storage.d.ts.map +1 -1
  37. package/dist/core/auth-storage.js +6 -6
  38. package/dist/core/auth-storage.js.map +1 -1
  39. package/dist/core/bash-executor.d.ts.map +1 -1
  40. package/dist/core/bash-executor.js +1 -1
  41. package/dist/core/bash-executor.js.map +1 -1
  42. package/dist/core/context/deferred-schemas.d.ts +92 -0
  43. package/dist/core/context/deferred-schemas.d.ts.map +1 -0
  44. package/dist/core/context/deferred-schemas.js +74 -0
  45. package/dist/core/context/deferred-schemas.js.map +1 -0
  46. package/dist/core/context/eviction.d.ts +47 -0
  47. package/dist/core/context/eviction.d.ts.map +1 -0
  48. package/dist/core/context/eviction.js +83 -0
  49. package/dist/core/context/eviction.js.map +1 -0
  50. package/dist/core/context/pipeline.d.ts +90 -0
  51. package/dist/core/context/pipeline.d.ts.map +1 -0
  52. package/dist/core/context/pipeline.js +109 -0
  53. package/dist/core/context/pipeline.js.map +1 -0
  54. package/dist/core/credential-failover.d.ts +30 -0
  55. package/dist/core/credential-failover.d.ts.map +1 -0
  56. package/dist/core/credential-failover.js +46 -0
  57. package/dist/core/credential-failover.js.map +1 -0
  58. package/dist/core/credential-pool.d.ts +60 -0
  59. package/dist/core/credential-pool.d.ts.map +1 -0
  60. package/dist/core/credential-pool.js +84 -0
  61. package/dist/core/credential-pool.js.map +1 -0
  62. package/dist/core/delegation/agents.d.ts +15 -0
  63. package/dist/core/delegation/agents.d.ts.map +1 -0
  64. package/dist/core/delegation/agents.js +55 -0
  65. package/dist/core/delegation/agents.js.map +1 -0
  66. package/dist/core/delegation/ceiling.d.ts +29 -0
  67. package/dist/core/delegation/ceiling.d.ts.map +1 -0
  68. package/dist/core/delegation/ceiling.js +34 -0
  69. package/dist/core/delegation/ceiling.js.map +1 -0
  70. package/dist/core/delegation/runtime.d.ts +94 -0
  71. package/dist/core/delegation/runtime.d.ts.map +1 -0
  72. package/dist/core/delegation/runtime.js +117 -0
  73. package/dist/core/delegation/runtime.js.map +1 -0
  74. package/dist/core/durable-state/daemon.d.ts +37 -0
  75. package/dist/core/durable-state/daemon.d.ts.map +1 -0
  76. package/dist/core/durable-state/daemon.js +62 -0
  77. package/dist/core/durable-state/daemon.js.map +1 -0
  78. package/dist/core/durable-state/provenance.d.ts +7 -0
  79. package/dist/core/durable-state/provenance.d.ts.map +1 -0
  80. package/dist/core/durable-state/provenance.js +24 -0
  81. package/dist/core/durable-state/provenance.js.map +1 -0
  82. package/dist/core/durable-state/sqlite.d.ts +84 -0
  83. package/dist/core/durable-state/sqlite.d.ts.map +1 -0
  84. package/dist/core/durable-state/sqlite.js +331 -0
  85. package/dist/core/durable-state/sqlite.js.map +1 -0
  86. package/dist/core/environment.d.ts +12 -0
  87. package/dist/core/environment.d.ts.map +1 -0
  88. package/dist/core/environment.js +69 -0
  89. package/dist/core/environment.js.map +1 -0
  90. package/dist/core/evidence-policy.d.ts +17 -0
  91. package/dist/core/evidence-policy.d.ts.map +1 -0
  92. package/dist/core/evidence-policy.js +25 -0
  93. package/dist/core/evidence-policy.js.map +1 -0
  94. package/dist/core/evidence.d.ts +16 -0
  95. package/dist/core/evidence.d.ts.map +1 -0
  96. package/dist/core/evidence.js +51 -0
  97. package/dist/core/evidence.js.map +1 -0
  98. package/dist/core/experimental.d.ts.map +1 -1
  99. package/dist/core/experimental.js +2 -1
  100. package/dist/core/experimental.js.map +1 -1
  101. package/dist/core/extensions/types.d.ts +2 -0
  102. package/dist/core/extensions/types.d.ts.map +1 -1
  103. package/dist/core/extensions/types.js.map +1 -1
  104. package/dist/core/index.d.ts +1 -0
  105. package/dist/core/index.d.ts.map +1 -1
  106. package/dist/core/index.js +1 -0
  107. package/dist/core/index.js.map +1 -1
  108. package/dist/core/model-config.d.ts +8 -0
  109. package/dist/core/model-config.d.ts.map +1 -1
  110. package/dist/core/model-config.js +21 -5
  111. package/dist/core/model-config.js.map +1 -1
  112. package/dist/core/model-resolver.d.ts +20 -0
  113. package/dist/core/model-resolver.d.ts.map +1 -1
  114. package/dist/core/model-resolver.js +59 -0
  115. package/dist/core/model-resolver.js.map +1 -1
  116. package/dist/core/model-runtime.d.ts +73 -0
  117. package/dist/core/model-runtime.d.ts.map +1 -1
  118. package/dist/core/model-runtime.js +225 -8
  119. package/dist/core/model-runtime.js.map +1 -1
  120. package/dist/core/observability/aggregate.d.ts +21 -0
  121. package/dist/core/observability/aggregate.d.ts.map +1 -0
  122. package/dist/core/observability/aggregate.js +36 -0
  123. package/dist/core/observability/aggregate.js.map +1 -0
  124. package/dist/core/observability/otlp.d.ts +66 -0
  125. package/dist/core/observability/otlp.d.ts.map +1 -0
  126. package/dist/core/observability/otlp.js +95 -0
  127. package/dist/core/observability/otlp.js.map +1 -0
  128. package/dist/core/package-manager.d.ts.map +1 -1
  129. package/dist/core/package-manager.js +3 -2
  130. package/dist/core/package-manager.js.map +1 -1
  131. package/dist/core/permissions/gate.d.ts +35 -0
  132. package/dist/core/permissions/gate.d.ts.map +1 -0
  133. package/dist/core/permissions/gate.js +72 -0
  134. package/dist/core/permissions/gate.js.map +1 -0
  135. package/dist/core/permissions/modes.d.ts +18 -0
  136. package/dist/core/permissions/modes.d.ts.map +1 -0
  137. package/dist/core/permissions/modes.js +57 -0
  138. package/dist/core/permissions/modes.js.map +1 -0
  139. package/dist/core/permissions/responder.d.ts +30 -0
  140. package/dist/core/permissions/responder.d.ts.map +1 -0
  141. package/dist/core/permissions/responder.js +32 -0
  142. package/dist/core/permissions/responder.js.map +1 -0
  143. package/dist/core/permissions/rules.d.ts +34 -0
  144. package/dist/core/permissions/rules.d.ts.map +1 -0
  145. package/dist/core/permissions/rules.js +74 -0
  146. package/dist/core/permissions/rules.js.map +1 -0
  147. package/dist/core/permissions/startup.d.ts +33 -0
  148. package/dist/core/permissions/startup.d.ts.map +1 -0
  149. package/dist/core/permissions/startup.js +55 -0
  150. package/dist/core/permissions/startup.js.map +1 -0
  151. package/dist/core/permissions/store.d.ts +114 -0
  152. package/dist/core/permissions/store.d.ts.map +1 -0
  153. package/dist/core/permissions/store.js +229 -0
  154. package/dist/core/permissions/store.js.map +1 -0
  155. package/dist/core/project-trust.d.ts.map +1 -1
  156. package/dist/core/project-trust.js +1 -1
  157. package/dist/core/project-trust.js.map +1 -1
  158. package/dist/core/provider-attribution.d.ts.map +1 -1
  159. package/dist/core/provider-attribution.js +6 -7
  160. package/dist/core/provider-attribution.js.map +1 -1
  161. package/dist/core/remote-catalog-provider.d.ts +2 -2
  162. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  163. package/dist/core/remote-catalog-provider.js +20 -16
  164. package/dist/core/remote-catalog-provider.js.map +1 -1
  165. package/dist/core/sandbox/child-entry.d.ts +2 -0
  166. package/dist/core/sandbox/child-entry.d.ts.map +1 -0
  167. package/dist/core/sandbox/child-entry.js +11 -0
  168. package/dist/core/sandbox/child-entry.js.map +1 -0
  169. package/dist/core/sandbox/cli-launch.d.ts +27 -0
  170. package/dist/core/sandbox/cli-launch.d.ts.map +1 -0
  171. package/dist/core/sandbox/cli-launch.js +133 -0
  172. package/dist/core/sandbox/cli-launch.js.map +1 -0
  173. package/dist/core/sandbox/cli-supervisor.d.ts +25 -0
  174. package/dist/core/sandbox/cli-supervisor.d.ts.map +1 -0
  175. package/dist/core/sandbox/cli-supervisor.js +57 -0
  176. package/dist/core/sandbox/cli-supervisor.js.map +1 -0
  177. package/dist/core/sandbox/linux-backend.d.ts +18 -0
  178. package/dist/core/sandbox/linux-backend.d.ts.map +1 -0
  179. package/dist/core/sandbox/linux-backend.js +186 -0
  180. package/dist/core/sandbox/linux-backend.js.map +1 -0
  181. package/dist/core/sandbox/macos-backend.d.ts +18 -0
  182. package/dist/core/sandbox/macos-backend.d.ts.map +1 -0
  183. package/dist/core/sandbox/macos-backend.js +195 -0
  184. package/dist/core/sandbox/macos-backend.js.map +1 -0
  185. package/dist/core/sandbox/network-proxy.d.ts +19 -0
  186. package/dist/core/sandbox/network-proxy.d.ts.map +1 -0
  187. package/dist/core/sandbox/network-proxy.js +79 -0
  188. package/dist/core/sandbox/network-proxy.js.map +1 -0
  189. package/dist/core/sandbox/policy.d.ts +32 -0
  190. package/dist/core/sandbox/policy.d.ts.map +1 -0
  191. package/dist/core/sandbox/policy.js +38 -0
  192. package/dist/core/sandbox/policy.js.map +1 -0
  193. package/dist/core/sandbox/supervisor.d.ts +31 -0
  194. package/dist/core/sandbox/supervisor.d.ts.map +1 -0
  195. package/dist/core/sandbox/supervisor.js +18 -0
  196. package/dist/core/sandbox/supervisor.js.map +1 -0
  197. package/dist/core/sandbox/violations.d.ts +23 -0
  198. package/dist/core/sandbox/violations.d.ts.map +1 -0
  199. package/dist/core/sandbox/violations.js +30 -0
  200. package/dist/core/sandbox/violations.js.map +1 -0
  201. package/dist/core/sdk.d.ts +20 -36
  202. package/dist/core/sdk.d.ts.map +1 -1
  203. package/dist/core/sdk.js +129 -2
  204. package/dist/core/sdk.js.map +1 -1
  205. package/dist/core/session-manager.d.ts +41 -2
  206. package/dist/core/session-manager.d.ts.map +1 -1
  207. package/dist/core/session-manager.js +57 -0
  208. package/dist/core/session-manager.js.map +1 -1
  209. package/dist/core/session-share.d.ts +16 -0
  210. package/dist/core/session-share.d.ts.map +1 -0
  211. package/dist/core/session-share.js +22 -0
  212. package/dist/core/session-share.js.map +1 -0
  213. package/dist/core/settings-manager.d.ts +38 -9
  214. package/dist/core/settings-manager.d.ts.map +1 -1
  215. package/dist/core/settings-manager.js +39 -24
  216. package/dist/core/settings-manager.js.map +1 -1
  217. package/dist/core/system-prompt.d.ts.map +1 -1
  218. package/dist/core/system-prompt.js +5 -5
  219. package/dist/core/system-prompt.js.map +1 -1
  220. package/dist/core/timings.d.ts +1 -1
  221. package/dist/core/timings.d.ts.map +1 -1
  222. package/dist/core/timings.js +3 -2
  223. package/dist/core/timings.js.map +1 -1
  224. package/dist/core/tools/ask-user.d.ts +25 -0
  225. package/dist/core/tools/ask-user.d.ts.map +1 -0
  226. package/dist/core/tools/ask-user.js +49 -0
  227. package/dist/core/tools/ask-user.js.map +1 -0
  228. package/dist/core/tools/bash-command-segments.d.ts +22 -0
  229. package/dist/core/tools/bash-command-segments.d.ts.map +1 -0
  230. package/dist/core/tools/bash-command-segments.js +128 -0
  231. package/dist/core/tools/bash-command-segments.js.map +1 -0
  232. package/dist/core/tools/bash.d.ts +26 -3
  233. package/dist/core/tools/bash.d.ts.map +1 -1
  234. package/dist/core/tools/bash.js +105 -16
  235. package/dist/core/tools/bash.js.map +1 -1
  236. package/dist/core/tools/contract.d.ts +156 -0
  237. package/dist/core/tools/contract.d.ts.map +1 -0
  238. package/dist/core/tools/contract.js +48 -0
  239. package/dist/core/tools/contract.js.map +1 -0
  240. package/dist/core/tools/delegate.d.ts +38 -0
  241. package/dist/core/tools/delegate.d.ts.map +1 -0
  242. package/dist/core/tools/delegate.js +66 -0
  243. package/dist/core/tools/delegate.js.map +1 -0
  244. package/dist/core/tools/edit.d.ts +2 -2
  245. package/dist/core/tools/edit.d.ts.map +1 -1
  246. package/dist/core/tools/edit.js +24 -0
  247. package/dist/core/tools/edit.js.map +1 -1
  248. package/dist/core/tools/find.d.ts +2 -2
  249. package/dist/core/tools/find.d.ts.map +1 -1
  250. package/dist/core/tools/find.js +12 -0
  251. package/dist/core/tools/find.js.map +1 -1
  252. package/dist/core/tools/grep.d.ts +2 -2
  253. package/dist/core/tools/grep.d.ts.map +1 -1
  254. package/dist/core/tools/grep.js +12 -0
  255. package/dist/core/tools/grep.js.map +1 -1
  256. package/dist/core/tools/index.d.ts +29 -4
  257. package/dist/core/tools/index.d.ts.map +1 -1
  258. package/dist/core/tools/index.js +118 -2
  259. package/dist/core/tools/index.js.map +1 -1
  260. package/dist/core/tools/ls.d.ts +2 -2
  261. package/dist/core/tools/ls.d.ts.map +1 -1
  262. package/dist/core/tools/ls.js +12 -0
  263. package/dist/core/tools/ls.js.map +1 -1
  264. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  265. package/dist/core/tools/output-accumulator.js +1 -1
  266. package/dist/core/tools/output-accumulator.js.map +1 -1
  267. package/dist/core/tools/path-permission.d.ts +18 -0
  268. package/dist/core/tools/path-permission.d.ts.map +1 -0
  269. package/dist/core/tools/path-permission.js +28 -0
  270. package/dist/core/tools/path-permission.js.map +1 -0
  271. package/dist/core/tools/plan-present.d.ts +27 -0
  272. package/dist/core/tools/plan-present.d.ts.map +1 -0
  273. package/dist/core/tools/plan-present.js +55 -0
  274. package/dist/core/tools/plan-present.js.map +1 -0
  275. package/dist/core/tools/read.d.ts +2 -2
  276. package/dist/core/tools/read.d.ts.map +1 -1
  277. package/dist/core/tools/read.js +12 -0
  278. package/dist/core/tools/read.js.map +1 -1
  279. package/dist/core/tools/test.d.ts +34 -0
  280. package/dist/core/tools/test.d.ts.map +1 -0
  281. package/dist/core/tools/test.js +75 -0
  282. package/dist/core/tools/test.js.map +1 -0
  283. package/dist/core/tools/todo-write.d.ts +31 -0
  284. package/dist/core/tools/todo-write.d.ts.map +1 -0
  285. package/dist/core/tools/todo-write.js +51 -0
  286. package/dist/core/tools/todo-write.js.map +1 -0
  287. package/dist/core/tools/tool-definition-wrapper.d.ts +13 -2
  288. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  289. package/dist/core/tools/tool-definition-wrapper.js +11 -1
  290. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  291. package/dist/core/tools/tool-schema.d.ts +22 -0
  292. package/dist/core/tools/tool-schema.d.ts.map +1 -0
  293. package/dist/core/tools/tool-schema.js +45 -0
  294. package/dist/core/tools/tool-schema.js.map +1 -0
  295. package/dist/core/tools/web-fetch.d.ts +26 -0
  296. package/dist/core/tools/web-fetch.d.ts.map +1 -0
  297. package/dist/core/tools/web-fetch.js +62 -0
  298. package/dist/core/tools/web-fetch.js.map +1 -0
  299. package/dist/core/tools/web-search.d.ts +26 -0
  300. package/dist/core/tools/web-search.d.ts.map +1 -0
  301. package/dist/core/tools/web-search.js +53 -0
  302. package/dist/core/tools/web-search.js.map +1 -0
  303. package/dist/core/tools/write.d.ts +6 -2
  304. package/dist/core/tools/write.d.ts.map +1 -1
  305. package/dist/core/tools/write.js +32 -1
  306. package/dist/core/tools/write.js.map +1 -1
  307. package/dist/core/usage-performance-store.d.ts +56 -0
  308. package/dist/core/usage-performance-store.d.ts.map +1 -0
  309. package/dist/core/usage-performance-store.js +85 -0
  310. package/dist/core/usage-performance-store.js.map +1 -0
  311. package/dist/index.d.ts +1 -0
  312. package/dist/index.d.ts.map +1 -1
  313. package/dist/index.js +1 -0
  314. package/dist/index.js.map +1 -1
  315. package/dist/main.d.ts.map +1 -1
  316. package/dist/main.js +48 -6
  317. package/dist/main.js.map +1 -1
  318. package/dist/migrations.d.ts.map +1 -1
  319. package/dist/migrations.js +2 -2
  320. package/dist/migrations.js.map +1 -1
  321. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  322. package/dist/modes/interactive/components/config-selector.js +9 -6
  323. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  324. package/dist/modes/interactive/components/first-time-setup.d.ts +1 -4
  325. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  326. package/dist/modes/interactive/components/first-time-setup.js +11 -39
  327. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  328. package/dist/modes/interactive/components/footer.d.ts +8 -1
  329. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  330. package/dist/modes/interactive/components/footer.js +49 -20
  331. package/dist/modes/interactive/components/footer.js.map +1 -1
  332. package/dist/modes/interactive/components/settings-selector.d.ts +2 -2
  333. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  334. package/dist/modes/interactive/components/settings-selector.js +6 -6
  335. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  336. package/dist/modes/interactive/components/tool-execution.d.ts +2 -1
  337. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  338. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  339. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  340. package/dist/modes/interactive/external-editor.js +58 -9
  341. package/dist/modes/interactive/external-editor.js.map +1 -1
  342. package/dist/modes/interactive/interactive-mode.d.ts +2 -3
  343. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  344. package/dist/modes/interactive/interactive-mode.js +92 -104
  345. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  346. package/dist/modes/interactive/theme/theme-schema.json +2 -2
  347. package/dist/package-manager-cli.d.ts.map +1 -1
  348. package/dist/package-manager-cli.js +15 -10
  349. package/dist/package-manager-cli.js.map +1 -1
  350. package/dist/rpc-entry.d.ts.map +1 -1
  351. package/dist/rpc-entry.js +2 -1
  352. package/dist/rpc-entry.js.map +1 -1
  353. package/dist/server/create-harness.d.ts +1 -1
  354. package/dist/server/create-harness.d.ts.map +1 -1
  355. package/dist/server/create-harness.js +6 -5
  356. package/dist/server/create-harness.js.map +1 -1
  357. package/dist/testing/replay/metrics.d.ts +24 -0
  358. package/dist/testing/replay/metrics.d.ts.map +1 -0
  359. package/dist/testing/replay/metrics.js +35 -0
  360. package/dist/testing/replay/metrics.js.map +1 -0
  361. package/dist/testing/replay/recorded-provider.d.ts +10 -0
  362. package/dist/testing/replay/recorded-provider.d.ts.map +1 -0
  363. package/dist/testing/replay/recorded-provider.js +108 -0
  364. package/dist/testing/replay/recorded-provider.js.map +1 -0
  365. package/dist/testing/replay/runner.d.ts +56 -0
  366. package/dist/testing/replay/runner.d.ts.map +1 -0
  367. package/dist/testing/replay/runner.js +406 -0
  368. package/dist/testing/replay/runner.js.map +1 -0
  369. package/dist/utils/apex-code-user-agent.d.ts +2 -0
  370. package/dist/utils/apex-code-user-agent.d.ts.map +1 -0
  371. package/dist/utils/apex-code-user-agent.js +5 -0
  372. package/dist/utils/apex-code-user-agent.js.map +1 -0
  373. package/dist/utils/clipboard-image.d.ts.map +1 -1
  374. package/dist/utils/clipboard-image.js +1 -1
  375. package/dist/utils/clipboard-image.js.map +1 -1
  376. package/dist/utils/tools-manager.d.ts +32 -0
  377. package/dist/utils/tools-manager.d.ts.map +1 -1
  378. package/dist/utils/tools-manager.js +198 -100
  379. package/dist/utils/tools-manager.js.map +1 -1
  380. package/dist/utils/version-check.d.ts +5 -5
  381. package/dist/utils/version-check.d.ts.map +1 -1
  382. package/dist/utils/version-check.js +23 -14
  383. package/dist/utils/version-check.js.map +1 -1
  384. package/dist/utils/windows-self-update.d.ts.map +1 -1
  385. package/dist/utils/windows-self-update.js +1 -1
  386. package/dist/utils/windows-self-update.js.map +1 -1
  387. package/docs/compaction.md +21 -21
  388. package/docs/containerization.md +24 -21
  389. package/docs/custom-provider.md +9 -9
  390. package/docs/development.md +11 -11
  391. package/docs/environment-variables.md +36 -77
  392. package/docs/extensions.md +47 -47
  393. package/docs/index.md +12 -24
  394. package/docs/json.md +6 -6
  395. package/docs/keybindings.md +3 -3
  396. package/docs/llama-cpp.md +7 -7
  397. package/docs/models.md +11 -11
  398. package/docs/packages.md +46 -42
  399. package/docs/prompt-templates.md +3 -3
  400. package/docs/providers.md +10 -10
  401. package/docs/quickstart.md +49 -32
  402. package/docs/rpc.md +11 -11
  403. package/docs/sdk.md +4 -4
  404. package/docs/security.md +18 -18
  405. package/docs/session-format.md +9 -9
  406. package/docs/sessions.md +13 -13
  407. package/docs/settings.md +10 -14
  408. package/docs/shell-aliases.md +1 -1
  409. package/docs/skills.md +8 -8
  410. package/docs/terminal-setup.md +12 -12
  411. package/docs/termux.md +4 -4
  412. package/docs/themes.md +8 -8
  413. package/docs/tmux.md +4 -4
  414. package/docs/tui.md +3 -3
  415. package/docs/usage.md +54 -51
  416. package/docs/windows.md +1 -1
  417. package/npm-shrinkwrap.json +5 -5
  418. package/package.json +2 -3
  419. package/dist/core/telemetry.d.ts +0 -3
  420. package/dist/core/telemetry.d.ts.map +0 -1
  421. package/dist/core/telemetry.js +0 -9
  422. package/dist/core/telemetry.js.map +0 -1
  423. package/dist/utils/pi-user-agent.d.ts +0 -2
  424. package/dist/utils/pi-user-agent.d.ts.map +0 -1
  425. package/dist/utils/pi-user-agent.js +0 -5
  426. package/dist/utils/pi-user-agent.js.map +0 -1
@@ -1,10 +1,10 @@
1
- > pi can create extensions. Ask it to build one for your use case.
1
+ > Apex Code can create extensions. Ask it to build one for your use case.
2
2
 
3
3
  # Extensions
4
4
 
5
- Extensions are TypeScript modules that extend pi's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
5
+ Extensions are TypeScript modules that extend Apex Code's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
6
6
 
7
- > **Placement for /reload:** Put extensions in `~/.apex-code/agent/extensions/` (global) or `.apex-code/extensions/` (project-local) for auto-discovery. Use `pi -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
7
+ > **Placement for /reload:** Put extensions in `~/.apex-code/agent/extensions/` (global) or `.apex-code/extensions/` (project-local) for auto-discovery. Use `apex-code -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
8
8
 
9
9
  **Key capabilities:**
10
10
  - **Custom tools** - Register tools the LLM can call via `pi.registerTool()`
@@ -103,7 +103,7 @@ export default function (pi: ExtensionAPI) {
103
103
  Test with `--extension` (or `-e`) flag:
104
104
 
105
105
  ```bash
106
- pi -e ./my-extension.ts
106
+ apex-code -e ./my-extension.ts
107
107
  ```
108
108
 
109
109
  ## Extension Locations
@@ -134,7 +134,7 @@ Additional paths via `settings.json`:
134
134
  }
135
135
  ```
136
136
 
137
- To share extensions via npm or git as pi packages, see [packages.md](packages.md).
137
+ To share extensions via npm or git as Apex Code packages, see [packages.md](packages.md).
138
138
 
139
139
  ## Available Imports
140
140
 
@@ -147,7 +147,7 @@ To share extensions via npm or git as pi packages, see [packages.md](packages.md
147
147
 
148
148
  npm dependencies work too. Add a `package.json` next to your extension (or in a parent directory), run `npm install`, and imports from `node_modules/` are resolved automatically.
149
149
 
150
- For distributed pi packages installed with `pi install` (npm or git), runtime deps must be in `dependencies`. Package installation uses production installs (`npm install --omit=dev`) by default, so `devDependencies` are not available at runtime; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers.
150
+ For distributed Apex Code packages installed with `apex-code install` (npm or git), runtime deps must be in `dependencies`. Package installation uses production installs (`npm install --omit=dev`) by default, so `devDependencies` are not available at runtime; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers.
151
151
 
152
152
  Node.js built-ins (`node:fs`, `node:path`, etc.) are also available.
153
153
 
@@ -215,7 +215,7 @@ export default async function (pi: ExtensionAPI) {
215
215
  }
216
216
  ```
217
217
 
218
- This pattern makes the fetched models available during normal startup and to `pi --list-models`.
218
+ This pattern makes the fetched models available during normal startup and to `apex-code --list-models`.
219
219
 
220
220
  ### Long-lived resources and shutdown
221
221
 
@@ -275,7 +275,7 @@ Run `npm install` in the extension directory, then imports from `node_modules/`
275
275
  ### Lifecycle Overview
276
276
 
277
277
  ```
278
- pi starts
278
+ apex-code starts
279
279
 
280
280
  ├─► project_trust (user/global and CLI extensions only, before project resources load)
281
281
  ├─► session_start { reason: "startup" }
@@ -351,7 +351,7 @@ exit (Ctrl+C, Ctrl+D, SIGHUP, SIGTERM)
351
351
 
352
352
  #### project_trust
353
353
 
354
- Fired before pi decides whether to trust a project with dynamic configs (`.pi` or `.agents/skills`). It runs during startup and when session replacement (for example `/resume`) enters a cwd whose trust has not been resolved in the current process. Only user/global extensions and CLI `-e` extensions participate; project-local extensions are not loaded until after trust is resolved.
354
+ Fired before Apex Code decides whether to trust a project with dynamic configs (`.apex-code` or `.agents/skills`). It runs during startup and when session replacement (for example `/resume`) enters a cwd whose trust has not been resolved in the current process. Only user/global extensions and CLI `-e` extensions participate; project-local extensions are not loaded until after trust is resolved.
355
355
 
356
356
  ```typescript
357
357
  pi.on("project_trust", async (event, ctx) => {
@@ -364,7 +364,7 @@ pi.on("project_trust", async (event, ctx) => {
364
364
  });
365
365
  ```
366
366
 
367
- A `project_trust` handler must return `{ trusted: "yes" | "no" | "undecided" }`. A user/global or CLI extension that returns `"yes"` or `"no"` owns the decision; the first yes/no decision wins and suppresses the built-in trust prompt. Use `remember: true` to persist a yes/no decision; otherwise it applies only to the current process. Return `"undecided"` to let later handlers or the built-in trust flow decide. Check `ctx.hasUI` before prompting. If no handler returns yes/no, normal trust resolution continues: saved `trust.json` decisions apply first, then `defaultProjectTrust` controls whether pi asks, trusts, or declines by default.
367
+ A `project_trust` handler must return `{ trusted: "yes" | "no" | "undecided" }`. A user/global or CLI extension that returns `"yes"` or `"no"` owns the decision; the first yes/no decision wins and suppresses the built-in trust prompt. Use `remember: true` to persist a yes/no decision; otherwise it applies only to the current process. Return `"undecided"` to let later handlers or the built-in trust flow decide. Check `ctx.hasUI` before prompting. If no handler returns yes/no, normal trust resolution continues: saved `trust.json` decisions apply first, then `defaultProjectTrust` controls whether Apex Code asks, trusts, or declines by default.
368
368
 
369
369
  ### Resource Events
370
370
 
@@ -428,7 +428,7 @@ pi.on("session_before_switch", async (event, ctx) => {
428
428
  });
429
429
  ```
430
430
 
431
- After a successful switch or new-session action, pi emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "new" | "resume"` and `previousSessionFile`.
431
+ After a successful switch or new-session action, Apex Code emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "new" | "resume"` and `previousSessionFile`.
432
432
  Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
433
433
 
434
434
  #### session_before_fork
@@ -445,7 +445,7 @@ pi.on("session_before_fork", async (event, ctx) => {
445
445
  });
446
446
  ```
447
447
 
448
- After a successful fork or clone, pi emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "fork"` and `previousSessionFile`.
448
+ After a successful fork or clone, Apex Code emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "fork"` and `previousSessionFile`.
449
449
  Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
450
450
 
451
451
  #### session_before_compact / session_compact
@@ -551,13 +551,13 @@ pi.on("before_agent_start", async (event, ctx) => {
551
551
  });
552
552
  ```
553
553
 
554
- The `systemPromptOptions` field gives extensions access to the same structured data Pi uses to build the system prompt. This lets you inspect what Pi has loaded — custom prompts, guidelines, tool snippets, context files, skills — without re-discovering resources or re-parsing flags. Use it when your extension needs to make deep, informed changes to the system prompt while respecting user-provided configuration.
554
+ The `systemPromptOptions` field gives extensions access to the same structured data Apex Code uses to build the system prompt. This lets you inspect what Apex Code has loaded — custom prompts, guidelines, tool snippets, context files, skills — without re-discovering resources or re-parsing flags. Use it when your extension needs to make deep, informed changes to the system prompt while respecting user-provided configuration.
555
555
 
556
556
  Inside `before_agent_start`, `event.systemPrompt` and `ctx.getSystemPrompt()` both reflect the chained system prompt as of the current handler. Later `before_agent_start` handlers can still modify it again.
557
557
 
558
558
  #### agent_start / agent_end / agent_settled
559
559
 
560
- `agent_start` fires when a low-level agent run begins. `agent_end` fires when that run ends, but Pi may still auto-retry, auto-compact and retry, or continue with queued follow-up messages. Use `agent_settled` for status integrations that need to know Pi will not continue running automatically.
560
+ `agent_start` fires when a low-level agent run begins. `agent_end` fires when that run ends, but Apex Code may still auto-retry, auto-compact and retry, or continue with queued follow-up messages. Use `agent_settled` for status integrations that need to know Apex Code will not continue running automatically.
561
561
 
562
562
  ```typescript
563
563
  pi.on("agent_start", async (_event, ctx) => {});
@@ -668,7 +668,7 @@ pi.on("before_provider_headers", (event, ctx) => {
668
668
  // Add or override — e.g. a session id for gateway tracing/attribution
669
669
  event.headers["x-session-id"] = ctx.sessionManager.getSessionId();
670
670
 
671
- // Drop a tracking header pi adds for this call
671
+ // Drop a tracking header Apex Code adds for this call
672
672
  event.headers["X-OpenRouter-Title"] = null;
673
673
  });
674
674
  ```
@@ -679,7 +679,7 @@ Runs once per provider request; retries reuse the same headers rather than re-fi
679
679
 
680
680
  Fired after the provider-specific payload is built, right before the request is sent. Handlers run in extension load order. Returning `undefined` keeps the payload unchanged. Returning any other value replaces the payload for later handlers and for the actual request.
681
681
 
682
- This hook can rewrite provider-level system instructions or remove them entirely. Those payload-level changes are not reflected by `ctx.getSystemPrompt()`, which reports Pi's system prompt string rather than the final serialized provider payload.
682
+ This hook can rewrite provider-level system instructions or remove them entirely. Those payload-level changes are not reflected by `ctx.getSystemPrompt()`, which reports Apex Code's system prompt string rather than the final serialized provider payload.
683
683
 
684
684
  ```typescript
685
685
  pi.on("before_provider_request", (event, ctx) => {
@@ -752,7 +752,7 @@ Use this to update extension UI when `pi.setThinkingLevel()`, model changes, or
752
752
 
753
753
  Fired after `tool_execution_start`, before the tool executes. **Can block.** Use `isToolCallEventType` to narrow and get typed inputs.
754
754
 
755
- Before `tool_call` runs, pi waits for previously emitted Agent events to finish draining through `AgentSession`. This means `ctx.sessionManager` is up to date through the current assistant tool-calling message.
755
+ Before `tool_call` runs, Apex Code waits for previously emitted Agent events to finish draining through `AgentSession`. This means `ctx.sessionManager` is up to date through the current assistant tool-calling message.
756
756
 
757
757
  In the default parallel tool execution mode, sibling tool calls from the same assistant message are preflighted sequentially, then executed concurrently. `tool_call` is not guaranteed to see sibling tool results from that same assistant message in `ctx.sessionManager`.
758
758
 
@@ -864,7 +864,7 @@ pi.on("user_bash", (event, ctx) => {
864
864
  // Option 1: Provide custom operations (e.g., SSH)
865
865
  return { operations: remoteBashOps };
866
866
 
867
- // Option 2: Wrap pi's built-in local bash backend
867
+ // Option 2: Wrap Apex Code's built-in local bash backend
868
868
  const local = createLocalBashOperations();
869
869
  return {
870
870
  operations: {
@@ -950,7 +950,7 @@ Current run mode: `"tui"`, `"rpc"`, `"json"`, or `"print"`. Use `ctx.mode === "t
950
950
 
951
951
  Current working directory.
952
952
 
953
- Use `CONFIG_DIR_NAME` instead of hardcoding `.pi` when constructing project-local config paths. Rebranded distributions can use a different config directory name.
953
+ Use `CONFIG_DIR_NAME` instead of hardcoding `.apex-code` when constructing project-local config paths. Rebranded distributions can use a different config directory name.
954
954
 
955
955
  ```typescript
956
956
  import { CONFIG_DIR_NAME, type ExtensionAPI } from "apex-code";
@@ -999,7 +999,7 @@ Use this for abort-aware nested work started by extension handlers, for example:
999
999
  - file or process helpers that accept `AbortSignal`
1000
1000
 
1001
1001
  `ctx.signal` is typically defined during active turn events such as `tool_call`, `tool_result`, `message_update`, and `turn_end`.
1002
- It is usually `undefined` in idle or non-turn contexts such as session events, extension commands, and shortcuts fired while pi is idle.
1002
+ It is usually `undefined` in idle or non-turn contexts such as session events, extension commands, and shortcuts fired while Apex Code is idle.
1003
1003
 
1004
1004
  ```typescript
1005
1005
  pi.on("tool_result", async (event, ctx) => {
@@ -1016,11 +1016,11 @@ pi.on("tool_result", async (event, ctx) => {
1016
1016
 
1017
1017
  ### ctx.isIdle() / ctx.abort() / ctx.hasPendingMessages()
1018
1018
 
1019
- Control flow helpers. `ctx.isIdle()` is false while Pi is processing an agent run, automatic retry, auto-compaction retry, or queued continuation.
1019
+ Control flow helpers. `ctx.isIdle()` is false while Apex Code is processing an agent run, automatic retry, auto-compaction retry, or queued continuation.
1020
1020
 
1021
1021
  ### ctx.shutdown()
1022
1022
 
1023
- Request a graceful shutdown of pi.
1023
+ Request a graceful shutdown of Apex Code.
1024
1024
 
1025
1025
  - **Interactive mode:** Deferred until the agent becomes idle (after processing all queued steering and follow-up messages).
1026
1026
  - **RPC mode:** Deferred until the next idle state (after completing the current command response, when waiting for the next command).
@@ -1065,7 +1065,7 @@ ctx.compact({
1065
1065
 
1066
1066
  ### ctx.getSystemPrompt()
1067
1067
 
1068
- Returns Pi's current system prompt string.
1068
+ Returns Apex Code's current system prompt string.
1069
1069
 
1070
1070
  - During `before_agent_start`, this reflects chained system-prompt changes made so far for the current turn.
1071
1071
  - It does not include later `context` message mutations.
@@ -1085,7 +1085,7 @@ Command handlers receive `ExtensionCommandContext`, which extends `ExtensionCont
1085
1085
 
1086
1086
  ### ctx.getSystemPromptOptions()
1087
1087
 
1088
- Returns the base inputs Pi currently uses to build the system prompt.
1088
+ Returns the base inputs Apex Code currently uses to build the system prompt.
1089
1089
 
1090
1090
  ```typescript
1091
1091
  const options = ctx.getSystemPromptOptions();
@@ -1495,7 +1495,7 @@ Labels persist in the session and survive restarts. Use them to mark important p
1495
1495
 
1496
1496
  Register a command.
1497
1497
 
1498
- If multiple extensions register the same command name, pi keeps them all and assigns numeric invocation suffixes in load order, for example `/review:1` and `/review:2`.
1498
+ If multiple extensions register the same command name, Apex Code keeps them all and assigns numeric invocation suffixes in load order, for example `/review:1` and `/review:2`.
1499
1499
 
1500
1500
  ```typescript
1501
1501
  pi.registerCommand("stats", {
@@ -1565,7 +1565,7 @@ Register a custom TUI renderer for custom messages with your `customType`. Custo
1565
1565
 
1566
1566
  ### pi.registerMarkdownTransformer(transformer)
1567
1567
 
1568
- Register a transformer for the Markdown in normal user text, assistant text, and thinking blocks. Transformers run in extension load order, and each transformer receives the Markdown returned by the previous transformer. After the chain finishes, Pi renders the transformed content with its built-in renderer.
1568
+ Register a transformer for the Markdown in normal user text, assistant text, and thinking blocks. Transformers run in extension load order, and each transformer receives the Markdown returned by the previous transformer. After the chain finishes, Apex Code renders the transformed content with its built-in renderer.
1569
1569
 
1570
1570
  The transformer receives the Markdown string and a context with:
1571
1571
 
@@ -1582,7 +1582,7 @@ pi.registerMarkdownTransformer((markdown, { messageType, isStreaming }) => {
1582
1582
  });
1583
1583
  ```
1584
1584
 
1585
- If a transformer throws, Pi keeps the Markdown produced so far and continues with the next transformer. The hook is display-only: the original message remains unchanged in the session and model context. It runs for new user messages, assistant streaming updates, restored session messages, and terminal width changes, so transformers should remain synchronous and inexpensive.
1585
+ If a transformer throws, Apex Code keeps the Markdown produced so far and continues with the next transformer. The hook is display-only: the original message remains unchanged in the session and model context. It runs for new user messages, assistant streaming updates, restored session messages, and terminal width changes, so transformers should remain synchronous and inexpensive.
1586
1586
 
1587
1587
  ### pi.registerEntryRenderer(customType, renderer)
1588
1588
 
@@ -1708,7 +1708,7 @@ Register or override a model provider dynamically. Useful for proxies, custom en
1708
1708
 
1709
1709
  Calls made during the extension factory function are queued and applied once the runner initialises. Calls made after that — for example from a command handler following a user setup flow — take effect immediately without requiring a `/reload`.
1710
1710
 
1711
- Dynamic providers can implement `refreshModels`. Pi calls it during model refresh, publishes the returned list synchronously through the provider, and passes the canonical credential/stored-catalog/network/signal context. The extension decides whether to persist catalog metadata through generation-checked `context.publish({ persist: entry })`; live servers such as llama.cpp can return models without persisting them.
1711
+ Dynamic providers can implement `refreshModels`. Apex Code calls it during model refresh, publishes the returned list synchronously through the provider, and passes the canonical credential/stored-catalog/network/signal context. The extension decides whether to persist catalog metadata through generation-checked `context.publish({ persist: entry })`; live servers such as llama.cpp can return models without persisting them.
1712
1712
 
1713
1713
  `context.signal` is always a concrete signal and provider callbacks must pass it to blocking I/O. Public `ModelRuntime.refresh()` and `ModelRegistry.refresh()` calls accept an optional signal and are unbounded when it is omitted; extensions and applications choose their own deadlines. Cancellation stops the caller waiting even if a provider ignores the signal, but cooperation is still required to stop the underlying work.
1714
1714
 
@@ -1979,7 +1979,7 @@ pi.registerTool({
1979
1979
  });
1980
1980
  ```
1981
1981
 
1982
- **Usage accounting:** If a tool makes nested LLM calls, return their combined `Usage` as `usage`. Pi persists it on the tool result and includes it in footer, `/session`, and RPC session totals. `tool_result` handlers can inspect or replace this value.
1982
+ **Usage accounting:** If a tool makes nested LLM calls, return their combined `Usage` as `usage`. Apex Code persists it on the tool result and includes it in footer, `/session`, and RPC session totals. `tool_result` handlers can inspect or replace this value.
1983
1983
 
1984
1984
  **Signaling errors:** To mark a tool execution as failed (sets `isError: true` on the result and reports it to the LLM), throw an error from `execute`. Returning a value never sets the error flag regardless of what properties you include in the return object.
1985
1985
 
@@ -1997,7 +1997,7 @@ async execute(toolCallId, params) {
1997
1997
 
1998
1998
  **Important:** Use `StringEnum` from `@earendil-works/pi-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
1999
1999
 
2000
- **Argument preparation:** `prepareArguments(args)` is optional. If defined, it runs before schema validation and before `execute()`. Use it to mimic an older accepted input shape when pi resumes an older session whose stored tool call arguments no longer match the current schema. Return the object you want validated against `parameters`. Keep the public schema strict. Do not add deprecated compatibility fields to `parameters` just to keep old resumed sessions working.
2000
+ **Argument preparation:** `prepareArguments(args)` is optional. If defined, it runs before schema validation and before `execute()`. Use it to mimic an older accepted input shape when Apex Code resumes an older session whose stored tool call arguments no longer match the current schema. Return the object you want validated against `parameters`. Keep the public schema strict. Do not add deprecated compatibility fields to `parameters` just to keep old resumed sessions working.
2001
2001
 
2002
2002
  Example: an older session may contain an `edit` tool call with top-level `oldText` and `newText`, while the current schema only accepts `edits: [{ oldText, newText }]`.
2003
2003
 
@@ -2050,13 +2050,13 @@ Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`,
2050
2050
 
2051
2051
  ```bash
2052
2052
  # Extension's read tool replaces built-in read
2053
- pi -e ./tool-override.ts
2053
+ apex-code -e ./tool-override.ts
2054
2054
  ```
2055
2055
 
2056
2056
  Alternatively, use `--no-builtin-tools` to start without any built-in tools while keeping extension tools enabled:
2057
2057
  ```bash
2058
2058
  # No built-in tools, only extension tools
2059
- pi --no-builtin-tools -e ./my-extension.ts
2059
+ apex-code --no-builtin-tools -e ./my-extension.ts
2060
2060
  ```
2061
2061
 
2062
2062
  See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.ts) for a complete example that overrides `read` with logging and access control.
@@ -2068,13 +2068,13 @@ See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.
2068
2068
  **Your implementation must match the exact result shape**, including the `details` type. The UI and session logic depend on these shapes for rendering and state tracking.
2069
2069
 
2070
2070
  Built-in tool implementations:
2071
- - [read.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/read.ts) - `ReadToolDetails`
2072
- - [bash.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/bash.ts) - `BashToolDetails`
2073
- - [edit.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/edit.ts)
2074
- - [write.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/write.ts)
2075
- - [grep.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/grep.ts) - `GrepToolDetails`
2076
- - [find.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/find.ts) - `FindToolDetails`
2077
- - [ls.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/ls.ts) - `LsToolDetails`
2071
+ - [read.ts](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/core/tools/read.ts) - `ReadToolDetails`
2072
+ - [bash.ts](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/core/tools/bash.ts) - `BashToolDetails`
2073
+ - [edit.ts](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/core/tools/edit.ts)
2074
+ - [write.ts](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/core/tools/write.ts)
2075
+ - [grep.ts](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/core/tools/grep.ts) - `GrepToolDetails`
2076
+ - [find.ts](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/core/tools/find.ts) - `FindToolDetails`
2077
+ - [ls.ts](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/core/tools/ls.ts) - `LsToolDetails`
2078
2078
 
2079
2079
  ### Remote Execution
2080
2080
 
@@ -2107,7 +2107,7 @@ pi.registerTool({
2107
2107
 
2108
2108
  **Operations interfaces:** `ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, `LsOperations`, `GrepOperations`, `FindOperations`
2109
2109
 
2110
- For `user_bash`, extensions can reuse pi's local shell backend via `createLocalBashOperations()` instead of reimplementing local process spawning, shell resolution, and process-tree termination.
2110
+ For `user_bash`, extensions can reuse Apex Code's local shell backend via `createLocalBashOperations()` instead of reimplementing local process spawning, shell resolution, and process-tree termination.
2111
2111
 
2112
2112
  The bash tool also supports a spawn hook to adjust the command, cwd, or env before execution:
2113
2113
 
@@ -2205,7 +2205,7 @@ export default function (pi: ExtensionAPI) {
2205
2205
 
2206
2206
  ### Custom Rendering
2207
2207
 
2208
- Tools can provide `renderCall` and `renderResult` for custom TUI display. See [tui.md](tui.md) for the full component API and [tool-execution.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/modes/interactive/components/tool-execution.ts) for how tool rows are composed.
2208
+ Tools can provide `renderCall` and `renderResult` for custom TUI display. See [tui.md](tui.md) for the full component API and [tool-execution.ts](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/modes/interactive/components/tool-execution.ts) for how tool rows are composed.
2209
2209
 
2210
2210
  By default, tool output is wrapped in a `Box` that handles padding and background. A defined `renderCall` or `renderResult` must return a `Component`. If a slot renderer is not defined, `tool-execution.ts` uses fallback rendering for that slot.
2211
2211
 
@@ -2339,8 +2339,8 @@ The lifecycle is:
2339
2339
  1. Register every tool with `pi.registerTool()` so it appears in `pi.getAllTools()`.
2340
2340
  2. Keep loader tools, such as `search_tools`, active and leave searchable tools inactive.
2341
2341
  3. During loader execution, call `pi.setActiveTools([...currentTools, ...matchingTools])`. The change must be additive: do not remove currently active tools in the same call.
2342
- 4. Pi records which tools were added on the loader's tool result.
2343
- 5. Before the next model response, Pi exposes the added definitions using native deferred loading when supported, or the normal active tool list otherwise.
2342
+ 4. Apex Code records which tools were added on the loader's tool result.
2343
+ 5. Before the next model response, Apex Code exposes the added definitions using native deferred loading when supported, or the normal active tool list otherwise.
2344
2344
 
2345
2345
  You do not need to return provider-specific tool references or mark the loader as a special search tool. The active-tool change is the signal. Names passed to `pi.setActiveTools()` must already be registered; unknown names are ignored.
2346
2346
 
@@ -2351,15 +2351,15 @@ You do not need to return provider-specific tool references or mark the loader a
2351
2351
  - **Native representation:** Deferred definitions use `defer_loading`; the load point uses `tool_reference` content.
2352
2352
  - **OpenAI**
2353
2353
  - **Models:** `gpt-5.4` and newer family
2354
- - **Native representation:** Pi adds completed client `tool_search_call` and `tool_search_output` items at the load point.
2354
+ - **Native representation:** Apex Code adds completed client `tool_search_call` and `tool_search_output` items at the load point.
2355
2355
 
2356
2356
  For a verified custom model or proxy, native handling can be enabled with `compat.supportsToolReferences: true` for `anthropic-messages`, or `compat.supportsToolSearch: true` for `openai-responses` and `openai-codex-responses`. Leave these disabled unless the endpoint and model accept the corresponding native protocol.
2357
2357
 
2358
2358
  #### Fallback behavior
2359
2359
 
2360
- For all other models and providers, dynamic activation still works: Pi sends the complete current active tool list normally on the next request. The model can call the newly activated tools, but adding their definitions may invalidate the provider's cached prompt prefix.
2360
+ For all other models and providers, dynamic activation still works: Apex Code sends the complete current active tool list normally on the next request. The model can call the newly activated tools, but adding their definitions may invalidate the provider's cached prompt prefix.
2361
2361
 
2362
- Pi also uses this safe fallback when the active set is not purely additive, such as replacing one group of tools with another. Tool removals therefore work, but they do not use deferred loading.
2362
+ Apex Code also uses this safe fallback when the active set is not purely additive, such as replacing one group of tools with another. Tool removals therefore work, but they do not use deferred loading.
2363
2363
 
2364
2364
  For the best cache behavior, keep the loader tool active for the whole session and add tools instead of replacing the active set. Also note that activating a tool with `promptSnippet` or `promptGuidelines` rebuilds the system prompt; that system-prompt change can invalidate the prefix even when the provider supports deferred schemas. Lazily loaded tools should usually rely on their tool `description` and omit active-only prompt metadata.
2365
2365
 
@@ -2591,7 +2591,7 @@ ctx.ui.setFooter((tui, theme) => ({
2591
2591
  ctx.ui.setFooter(undefined); // Restore built-in footer
2592
2592
 
2593
2593
  // Terminal title
2594
- ctx.ui.setTitle("pi - my-project");
2594
+ ctx.ui.setTitle("apex-code - my-project");
2595
2595
 
2596
2596
  // Editor text
2597
2597
  ctx.ui.setEditorText("Prefill text");
package/docs/index.md CHANGED
@@ -1,49 +1,37 @@
1
- # Pi Documentation
1
+ # Apex Code Documentation
2
2
 
3
- Pi is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and pi packages.
3
+ Apex Code is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and Apex Code packages.
4
4
 
5
5
  ## Quick start
6
6
 
7
- Install Pi with npm:
7
+ Install Apex Code with npm, pnpm, Yarn, or Bun — all resolve it from the same npm registry:
8
8
 
9
9
  ```bash
10
10
  npm install -g --ignore-scripts apex-code
11
11
  ```
12
12
 
13
- `--ignore-scripts` disables dependency lifecycle scripts during install. Pi does not require install scripts for normal npm installs.
13
+ `--ignore-scripts` disables dependency lifecycle scripts during install. Apex Code does not require install scripts for normal npm installs.
14
14
 
15
- On Linux or macOS, you can also use the installer:
16
-
17
- ```bash
18
- curl -fsSL https://pi.dev/install.sh | sh
19
- ```
20
-
21
- To uninstall pi itself, use npm for curl and npm installs:
22
-
23
- ```bash
24
- npm uninstall -g apex-code
25
- ```
26
-
27
- For pnpm, Yarn, or Bun installs, use the matching global remove command: `pnpm remove -g apex-code`, `yarn global remove apex-code`, or `bun uninstall -g apex-code`.
15
+ To uninstall, use the package manager that installed it: `npm uninstall -g apex-code`, `pnpm remove -g apex-code`, `yarn global remove apex-code`, or `bun uninstall -g apex-code`.
28
16
 
29
17
  Then run it in a project directory:
30
18
 
31
19
  ```bash
32
- pi
20
+ apex-code
33
21
  ```
34
22
 
35
- Authenticate with `/login` for subscription providers, or set an API key such as `ANTHROPIC_API_KEY` before starting pi.
23
+ Authenticate with `/login` for subscription providers, or set an API key such as `ANTHROPIC_API_KEY` before starting Apex Code.
36
24
 
37
25
  For the full first-run flow, see [Quickstart](quickstart.md).
38
26
 
39
27
  ## Start here
40
28
 
41
29
  - [Quickstart](quickstart.md) - install, authenticate, and run a first session.
42
- - [Using Pi](usage.md) - interactive mode, slash commands, context files, and CLI reference.
30
+ - [Using Apex Code](usage.md) - interactive mode, slash commands, context files, and CLI reference.
43
31
  - [Providers](providers.md) - subscription and API-key setup for built-in providers.
44
32
  - [llama.cpp](llama-cpp.md) - run a local router and manage models with `/llama`.
45
33
  - [Security](security.md) - project trust, sandbox boundaries, and vulnerability reporting.
46
- - [Containerization](containerization.md) - sandbox pi with Gondolin, Docker, or OpenShell.
34
+ - [Containerization](containerization.md) - sandbox Apex Code with Gondolin, Docker, or OpenShell.
47
35
  - [Settings](settings.md) - global and project settings.
48
36
  - [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
49
37
  - [Sessions](sessions.md) - session management, branching, and tree navigation.
@@ -55,20 +43,20 @@ For the full first-run flow, see [Quickstart](quickstart.md).
55
43
  - [Skills](skills.md) - Agent Skills for reusable on-demand capabilities.
56
44
  - [Prompt templates](prompt-templates.md) - reusable prompts that expand from slash commands.
57
45
  - [Themes](themes.md) - built-in and custom terminal themes.
58
- - [Pi packages](packages.md) - bundle and share extensions, skills, prompts, and themes.
46
+ - [Apex Code packages](packages.md) - bundle and share extensions, skills, prompts, and themes.
59
47
  - [Custom models](models.md) - add model entries for supported provider APIs.
60
48
  - [Custom providers](custom-provider.md) - implement custom APIs and OAuth flows.
61
49
 
62
50
  ## Programmatic usage
63
51
 
64
- - [SDK](sdk.md) - embed pi in Node.js applications.
52
+ - [SDK](sdk.md) - embed Apex Code in Node.js applications.
65
53
  - [RPC mode](rpc.md) - integrate over stdin/stdout JSONL.
66
54
  - [JSON event stream mode](json.md) - print mode with structured events.
67
55
  - [TUI components](tui.md) - build custom terminal UI for extensions.
68
56
 
69
57
  ## Reference
70
58
 
71
- - [Environment variables](environment-variables.md) - Pi process configuration and session metadata available to bash tools.
59
+ - [Environment variables](environment-variables.md) - Apex Code process configuration and session metadata available to bash tools.
72
60
  - [Session format](session-format.md) - JSONL session file format, entry types, and SessionManager API.
73
61
 
74
62
  ## Platform setup
package/docs/json.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # JSON Event Stream Mode
2
2
 
3
3
  ```bash
4
- pi --mode json "Your prompt"
4
+ apex-code --mode json "Your prompt"
5
5
  ```
6
6
 
7
- Outputs all session events as JSON lines to stdout. Useful for integrating pi into other tools or custom UIs.
7
+ Outputs all session events as JSON lines to stdout. Useful for integrating Apex Code into other tools or custom UIs.
8
8
 
9
9
  ## Event Types
10
10
 
11
11
  Wire events use `JsonAgentSessionEvent`. It matches
12
- [`AgentSessionEvent`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/agent-session.ts)
12
+ [`AgentSessionEvent`](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/core/agent-session.ts)
13
13
  except that streaming message updates omit cumulative snapshots:
14
14
 
15
15
  ```typescript
@@ -26,7 +26,7 @@ type JsonAgentSessionEvent =
26
26
  `queue_update` emits the full pending steering and follow-up queues whenever they change. `compaction_start` and `compaction_end` cover both manual and automatic compaction.
27
27
 
28
28
  Other base events come from
29
- [`AgentEvent`](https://github.com/earendil-works/pi-mono/blob/main/packages/agent/src/types.ts):
29
+ [`AgentEvent`](https://github.com/Fchery87/apex-code/blob/main/packages/agent/src/types.ts):
30
30
 
31
31
  ```typescript
32
32
  type AgentEvent =
@@ -53,7 +53,7 @@ Base messages from [`packages/ai/src/types.ts`](https://github.com/earendil-work
53
53
  - `AssistantMessage` (line 140)
54
54
  - `ToolResultMessage` (line 152)
55
55
 
56
- Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/messages.ts#L29):
56
+ Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/src/core/messages.ts#L29):
57
57
  - `BashExecutionMessage` (line 29)
58
58
  - `CustomMessage` (line 46)
59
59
  - `BranchSummaryMessage` (line 55)
@@ -87,5 +87,5 @@ the final authoritative message.
87
87
  ## Example
88
88
 
89
89
  ```bash
90
- pi --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
90
+ apex-code --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
91
91
  ```
@@ -2,11 +2,11 @@
2
2
 
3
3
  All keyboard shortcuts can be customized via `~/.apex-code/agent/keybindings.json`. Each action can be bound to one or more keys.
4
4
 
5
- The config file uses the same namespaced keybinding ids that pi uses internally and that extension authors use in `keyHint()` and injected `keybindings` managers.
5
+ The config file uses the same namespaced keybinding ids that Apex Code uses internally and that extension authors use in `keyHint()` and injected `keybindings` managers.
6
6
 
7
7
  Older configs using pre-namespaced ids such as `cursorUp` or `expandTools` are migrated automatically to the namespaced ids on startup.
8
8
 
9
- After editing `keybindings.json`, run `/reload` in pi to apply the changes without restarting the session.
9
+ After editing `keybindings.json`, run `/reload` in Apex Code to apply the changes without restarting the session.
10
10
 
11
11
  ## Key Format
12
12
 
@@ -198,7 +198,7 @@ Create `~/.apex-code/agent/keybindings.json`:
198
198
 
199
199
  Each action can have a single key or an array of keys. User config overrides defaults.
200
200
 
201
- On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually, pi shows a status message instead of suspending. In WSL, the normal Linux `ctrl+z`/`fg` behavior still applies.
201
+ On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually, Apex Code shows a status message instead of suspending. In WSL, the normal Linux `ctrl+z`/`fg` behavior still applies.
202
202
 
203
203
  ### Emacs Example
204
204
 
package/docs/llama-cpp.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # llama.cpp
2
2
 
3
- Pi supports the [llama.cpp](https://github.com/ggml-org/llama.cpp) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
3
+ Apex Code supports the [llama.cpp](https://github.com/ggml-org/llama.cpp) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
4
4
 
5
5
  Use a current llama.cpp build with router support. Follow the [build instructions](https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md) or install a [prebuilt release](https://github.com/ggml-org/llama.cpp/releases) for your platform.
6
6
 
@@ -43,9 +43,9 @@ A single-file model can sit directly in the model directory. Put multimodal and
43
43
 
44
44
  Restart the router after manually adding files. For per-model context sizes and other options, use [llama.cpp model presets](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md#model-presets).
45
45
 
46
- ## Configure Pi
46
+ ## Configure Apex Code
47
47
 
48
- Start Pi and configure the provider:
48
+ Start Apex Code and configure the provider:
49
49
 
50
50
  ```text
51
51
  /login llama.cpp
@@ -58,7 +58,7 @@ Environment variables can configure the same values without `/login`:
58
58
  ```bash
59
59
  export LLAMA_BASE_URL=http://127.0.0.1:8080
60
60
  export LLAMA_API_KEY=optional-secret
61
- pi
61
+ apex-code
62
62
  ```
63
63
 
64
64
  If the server uses an API key, start `llama-server` with the matching `--api-key` value. Keep `--host 127.0.0.1` for local-only access.
@@ -76,11 +76,11 @@ Run:
76
76
  - Select **Download model…**, search Hugging Face, then choose a repository and quantization. Exact `owner/repository[:quant]` values also work.
77
77
  - Press Escape during a load or download to confirm cancellation.
78
78
 
79
- Hugging Face search uses `HF_TOKEN` when set, then checks `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token`. Search also works without authentication, subject to lower rate limits. Pi warns before downloading gated repositories and links to their access page. The llama.cpp server performs the download, so its process must also have `HF_TOKEN` when the selected repository requires access.
79
+ Hugging Face search uses `HF_TOKEN` when set, then checks `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token`. Search also works without authentication, subject to lower rate limits. Apex Code warns before downloading gated repositories and links to their access page. The llama.cpp server performs the download, so its process must also have `HF_TOKEN` when the selected repository requires access.
80
80
 
81
- If other models are loaded, Pi asks whether to unload them first or keep them loaded. Pi does not silently unload models and never deletes model files. The router may be shared with other clients, so `/llama` always displays the router's current state.
81
+ If other models are loaded, Apex Code asks whether to unload them first or keep them loaded. Apex Code does not silently unload models and never deletes model files. The router may be shared with other clients, so `/llama` always displays the router's current state.
82
82
 
83
- Only loaded models appear in `/model`. After loading a model, run `/model` to select it for the current Pi session.
83
+ Only loaded models appear in `/model`. After loading a model, run `/model` to select it for the current Apex Code session.
84
84
 
85
85
  If the router disconnects, `/llama` shows **Retry** and **Close**. Retry reconnects and refreshes model state without replaying the interrupted operation.
86
86