gsd-pi 2.34.0 → 2.35.0-dev.cd3b7ea

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 (418) hide show
  1. package/dist/resources/extensions/gsd/changelog.js +162 -0
  2. package/dist/resources/extensions/gsd/commands-bootstrap.js +1 -0
  3. package/dist/resources/extensions/gsd/commands-prefs-wizard.js +5 -1
  4. package/dist/resources/extensions/gsd/commands.js +8 -1
  5. package/dist/resources/extensions/gsd/docs/preferences-reference.md +10 -0
  6. package/dist/resources/extensions/gsd/doctor-checks.js +113 -5
  7. package/dist/resources/extensions/gsd/doctor-proactive.js +22 -0
  8. package/dist/resources/extensions/gsd/doctor.js +36 -0
  9. package/dist/resources/extensions/gsd/guided-flow.js +4 -2
  10. package/dist/resources/extensions/gsd/preferences-validation.js +38 -0
  11. package/dist/resources/extensions/gsd/preferences.js +2 -0
  12. package/dist/resources/extensions/mcp-client/index.js +2 -1
  13. package/dist/resources/skills/create-gsd-extension/references/events-reference.md +4 -4
  14. package/package.json +1 -1
  15. package/packages/native/dist/native.d.ts +0 -2
  16. package/packages/native/dist/native.js +0 -2
  17. package/packages/native/src/native.ts +0 -3
  18. package/packages/pi-agent-core/dist/agent-loop.d.ts +14 -0
  19. package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  20. package/packages/pi-agent-core/dist/agent-loop.js +24 -27
  21. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
  22. package/packages/pi-agent-core/dist/agent.d.ts +1 -0
  23. package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
  24. package/packages/pi-agent-core/dist/agent.js +11 -22
  25. package/packages/pi-agent-core/dist/agent.js.map +1 -1
  26. package/packages/pi-agent-core/dist/proxy.d.ts +1 -25
  27. package/packages/pi-agent-core/dist/proxy.d.ts.map +1 -1
  28. package/packages/pi-agent-core/dist/proxy.js +3 -9
  29. package/packages/pi-agent-core/dist/proxy.js.map +1 -1
  30. package/packages/pi-agent-core/src/agent-loop.ts +30 -27
  31. package/packages/pi-agent-core/src/agent.ts +12 -23
  32. package/packages/pi-agent-core/src/proxy.ts +3 -9
  33. package/packages/pi-ai/dist/api-registry.d.ts +0 -2
  34. package/packages/pi-ai/dist/api-registry.d.ts.map +1 -1
  35. package/packages/pi-ai/dist/api-registry.js +0 -10
  36. package/packages/pi-ai/dist/api-registry.js.map +1 -1
  37. package/packages/pi-ai/dist/providers/anthropic.d.ts +0 -8
  38. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  39. package/packages/pi-ai/dist/providers/anthropic.js +1 -1
  40. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  41. package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
  42. package/packages/pi-ai/dist/providers/azure-openai-responses.js +5 -41
  43. package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
  44. package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts +0 -1
  45. package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -1
  46. package/packages/pi-ai/dist/providers/github-copilot-headers.js +1 -1
  47. package/packages/pi-ai/dist/providers/github-copilot-headers.js.map +1 -1
  48. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts +1 -43
  49. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
  50. package/packages/pi-ai/dist/providers/google-gemini-cli.js +2 -2
  51. package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
  52. package/packages/pi-ai/dist/providers/google-shared.d.ts +0 -4
  53. package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
  54. package/packages/pi-ai/dist/providers/google-shared.js +1 -1
  55. package/packages/pi-ai/dist/providers/google-shared.js.map +1 -1
  56. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  57. package/packages/pi-ai/dist/providers/openai-completions.js +10 -73
  58. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
  59. package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
  60. package/packages/pi-ai/dist/providers/openai-responses.js +8 -79
  61. package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -1
  62. package/packages/pi-ai/dist/providers/openai-shared.d.ts +65 -0
  63. package/packages/pi-ai/dist/providers/openai-shared.d.ts.map +1 -0
  64. package/packages/pi-ai/dist/providers/openai-shared.js +146 -0
  65. package/packages/pi-ai/dist/providers/openai-shared.js.map +1 -0
  66. package/packages/pi-ai/dist/providers/register-builtins.d.ts +0 -1
  67. package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
  68. package/packages/pi-ai/dist/providers/register-builtins.js +1 -1
  69. package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -1
  70. package/packages/pi-ai/dist/utils/event-stream.d.ts +0 -2
  71. package/packages/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  72. package/packages/pi-ai/dist/utils/event-stream.js +0 -4
  73. package/packages/pi-ai/dist/utils/event-stream.js.map +1 -1
  74. package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -1
  75. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +7 -135
  76. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -1
  77. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -1
  78. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +7 -135
  79. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -1
  80. package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.d.ts +46 -0
  81. package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.d.ts.map +1 -0
  82. package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.js +160 -0
  83. package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.js.map +1 -0
  84. package/packages/pi-ai/dist/utils/overflow.d.ts +0 -4
  85. package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  86. package/packages/pi-ai/dist/utils/overflow.js +0 -6
  87. package/packages/pi-ai/dist/utils/overflow.js.map +1 -1
  88. package/packages/pi-ai/dist/utils/validation.d.ts +0 -8
  89. package/packages/pi-ai/dist/utils/validation.d.ts.map +1 -1
  90. package/packages/pi-ai/dist/utils/validation.js +0 -14
  91. package/packages/pi-ai/dist/utils/validation.js.map +1 -1
  92. package/packages/pi-ai/src/api-registry.ts +0 -12
  93. package/packages/pi-ai/src/providers/anthropic.ts +1 -1
  94. package/packages/pi-ai/src/providers/azure-openai-responses.ts +11 -45
  95. package/packages/pi-ai/src/providers/github-copilot-headers.ts +1 -1
  96. package/packages/pi-ai/src/providers/google-gemini-cli.ts +2 -2
  97. package/packages/pi-ai/src/providers/google-shared.ts +1 -1
  98. package/packages/pi-ai/src/providers/openai-completions.ts +16 -86
  99. package/packages/pi-ai/src/providers/openai-responses.ts +15 -95
  100. package/packages/pi-ai/src/providers/openai-shared.ts +193 -0
  101. package/packages/pi-ai/src/providers/register-builtins.ts +1 -1
  102. package/packages/pi-ai/src/utils/event-stream.ts +0 -5
  103. package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +14 -162
  104. package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +13 -161
  105. package/packages/pi-ai/src/utils/oauth/google-oauth-utils.ts +201 -0
  106. package/packages/pi-ai/src/utils/overflow.ts +1 -8
  107. package/packages/pi-ai/src/utils/validation.ts +0 -15
  108. package/packages/pi-coding-agent/dist/config.d.ts +0 -9
  109. package/packages/pi-coding-agent/dist/config.d.ts.map +1 -1
  110. package/packages/pi-coding-agent/dist/config.js +4 -8
  111. package/packages/pi-coding-agent/dist/config.js.map +1 -1
  112. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +16 -63
  113. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  114. package/packages/pi-coding-agent/dist/core/agent-session.js +104 -641
  115. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  116. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +0 -1
  117. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  118. package/packages/pi-coding-agent/dist/core/auth-storage.js +4 -35
  119. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  120. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  121. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js +5 -43
  122. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
  123. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  124. package/packages/pi-coding-agent/dist/core/compaction/compaction.js +11 -69
  125. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  126. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +40 -0
  127. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
  128. package/packages/pi-coding-agent/dist/core/compaction/utils.js +78 -0
  129. package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
  130. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts +77 -0
  131. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts.map +1 -0
  132. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +331 -0
  133. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -0
  134. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts +0 -4
  135. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  136. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js +1 -1
  137. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -1
  138. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +2 -2
  139. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  140. package/packages/pi-coding-agent/dist/core/extensions/index.js +1 -1
  141. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  142. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +15 -5
  143. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  144. package/packages/pi-coding-agent/dist/core/extensions/runner.js +129 -256
  145. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  146. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +49 -42
  147. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  148. package/packages/pi-coding-agent/dist/core/extensions/types.js +2 -21
  149. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  150. package/packages/pi-coding-agent/dist/core/keybindings.d.ts +0 -8
  151. package/packages/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
  152. package/packages/pi-coding-agent/dist/core/keybindings.js +2 -2
  153. package/packages/pi-coding-agent/dist/core/keybindings.js.map +1 -1
  154. package/packages/pi-coding-agent/dist/core/lock-utils.d.ts +39 -0
  155. package/packages/pi-coding-agent/dist/core/lock-utils.d.ts.map +1 -0
  156. package/packages/pi-coding-agent/dist/core/lock-utils.js +89 -0
  157. package/packages/pi-coding-agent/dist/core/lock-utils.js.map +1 -0
  158. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts +0 -17
  159. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -1
  160. package/packages/pi-coding-agent/dist/core/lsp/client.js +3 -62
  161. package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -1
  162. package/packages/pi-coding-agent/dist/core/lsp/config.d.ts +1 -1
  163. package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
  164. package/packages/pi-coding-agent/dist/core/lsp/config.js +2 -6
  165. package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -1
  166. package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts +0 -5
  167. package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts.map +1 -1
  168. package/packages/pi-coding-agent/dist/core/lsp/edits.js +1 -1
  169. package/packages/pi-coding-agent/dist/core/lsp/edits.js.map +1 -1
  170. package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -1
  171. package/packages/pi-coding-agent/dist/core/lsp/index.js +52 -107
  172. package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -1
  173. package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts +0 -1
  174. package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -1
  175. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +3 -22
  176. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -1
  177. package/packages/pi-coding-agent/dist/core/lsp/types.d.ts +0 -1
  178. package/packages/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -1
  179. package/packages/pi-coding-agent/dist/core/lsp/types.js +0 -28
  180. package/packages/pi-coding-agent/dist/core/lsp/types.js.map +1 -1
  181. package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts +1 -6
  182. package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts.map +1 -1
  183. package/packages/pi-coding-agent/dist/core/lsp/utils.js +1 -28
  184. package/packages/pi-coding-agent/dist/core/lsp/utils.js.map +1 -1
  185. package/packages/pi-coding-agent/dist/core/messages.d.ts +0 -8
  186. package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -1
  187. package/packages/pi-coding-agent/dist/core/messages.js +5 -5
  188. package/packages/pi-coding-agent/dist/core/messages.js.map +1 -1
  189. package/packages/pi-coding-agent/dist/core/model-registry.d.ts +0 -3
  190. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  191. package/packages/pi-coding-agent/dist/core/model-registry.js +1 -3
  192. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  193. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts +1 -26
  194. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  195. package/packages/pi-coding-agent/dist/core/model-resolver.js +3 -59
  196. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  197. package/packages/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  198. package/packages/pi-coding-agent/dist/core/package-manager.js +2 -4
  199. package/packages/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  200. package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts +0 -17
  201. package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts.map +1 -1
  202. package/packages/pi-coding-agent/dist/core/prompt-templates.js +2 -2
  203. package/packages/pi-coding-agent/dist/core/prompt-templates.js.map +1 -1
  204. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +2 -4
  205. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  206. package/packages/pi-coding-agent/dist/core/resource-loader.js +33 -58
  207. package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  208. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +87 -0
  209. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -0
  210. package/packages/pi-coding-agent/dist/core/retry-handler.js +295 -0
  211. package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -0
  212. package/packages/pi-coding-agent/dist/core/session-manager.d.ts +0 -5
  213. package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
  214. package/packages/pi-coding-agent/dist/core/session-manager.js +5 -32
  215. package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
  216. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +8 -12
  217. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  218. package/packages/pi-coding-agent/dist/core/settings-manager.js +78 -168
  219. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  220. package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
  221. package/packages/pi-coding-agent/dist/core/skills.js +1 -3
  222. package/packages/pi-coding-agent/dist/core/skills.js.map +1 -1
  223. package/packages/pi-coding-agent/dist/index.d.ts +1 -1
  224. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  225. package/packages/pi-coding-agent/dist/index.js +1 -1
  226. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  227. package/packages/pi-coding-agent/dist/migrations.d.ts +0 -16
  228. package/packages/pi-coding-agent/dist/migrations.d.ts.map +1 -1
  229. package/packages/pi-coding-agent/dist/migrations.js +2 -2
  230. package/packages/pi-coding-agent/dist/migrations.js.map +1 -1
  231. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +0 -2
  232. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  233. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js +2 -2
  234. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  235. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts +1 -1
  236. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  237. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js +9 -26
  238. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -1
  239. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  240. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +1 -13
  241. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  242. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.d.ts +44 -0
  243. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.d.ts.map +1 -0
  244. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.js +61 -0
  245. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.js.map +1 -0
  246. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  247. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +6 -9
  248. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -1
  249. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +1 -24
  250. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  251. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +50 -512
  252. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  253. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts +71 -0
  254. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -0
  255. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +514 -0
  256. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -0
  257. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +65 -4
  258. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  259. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +6 -23
  260. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  261. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts +12 -0
  262. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -0
  263. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +175 -0
  264. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -0
  265. package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.d.ts +6 -0
  266. package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.d.ts.map +1 -0
  267. package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.js +15 -0
  268. package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.js.map +1 -0
  269. package/packages/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
  270. package/packages/pi-coding-agent/dist/modes/print-mode.js +2 -30
  271. package/packages/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
  272. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  273. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +2 -28
  274. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
  275. package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.d.ts +19 -0
  276. package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.d.ts.map +1 -0
  277. package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.js +45 -0
  278. package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.js.map +1 -0
  279. package/packages/pi-coding-agent/dist/utils/changelog.d.ts +0 -4
  280. package/packages/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
  281. package/packages/pi-coding-agent/dist/utils/changelog.js +1 -1
  282. package/packages/pi-coding-agent/dist/utils/changelog.js.map +1 -1
  283. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts +0 -1
  284. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
  285. package/packages/pi-coding-agent/dist/utils/clipboard-image.js +1 -1
  286. package/packages/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -1
  287. package/packages/pi-coding-agent/dist/utils/error.d.ts +5 -0
  288. package/packages/pi-coding-agent/dist/utils/error.d.ts.map +1 -0
  289. package/packages/pi-coding-agent/dist/utils/error.js +7 -0
  290. package/packages/pi-coding-agent/dist/utils/error.js.map +1 -0
  291. package/packages/pi-coding-agent/dist/utils/photon.d.ts +0 -19
  292. package/packages/pi-coding-agent/dist/utils/photon.d.ts.map +1 -1
  293. package/packages/pi-coding-agent/dist/utils/photon.js +1 -120
  294. package/packages/pi-coding-agent/dist/utils/photon.js.map +1 -1
  295. package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts +0 -1
  296. package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts.map +1 -1
  297. package/packages/pi-coding-agent/dist/utils/tools-manager.js +1 -1
  298. package/packages/pi-coding-agent/dist/utils/tools-manager.js.map +1 -1
  299. package/packages/pi-coding-agent/package.json +1 -1
  300. package/packages/pi-coding-agent/src/config.ts +5 -10
  301. package/packages/pi-coding-agent/src/core/agent-session.ts +117 -745
  302. package/packages/pi-coding-agent/src/core/auth-storage.ts +4 -38
  303. package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +7 -53
  304. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +14 -74
  305. package/packages/pi-coding-agent/src/core/compaction/utils.ts +100 -0
  306. package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +424 -0
  307. package/packages/pi-coding-agent/src/core/export-html/ansi-to-html.ts +1 -1
  308. package/packages/pi-coding-agent/src/core/extensions/index.ts +1 -21
  309. package/packages/pi-coding-agent/src/core/extensions/runner.ts +119 -256
  310. package/packages/pi-coding-agent/src/core/extensions/types.ts +50 -69
  311. package/packages/pi-coding-agent/src/core/keybindings.ts +2 -2
  312. package/packages/pi-coding-agent/src/core/lock-utils.ts +113 -0
  313. package/packages/pi-coding-agent/src/core/lsp/client.ts +3 -73
  314. package/packages/pi-coding-agent/src/core/lsp/config.ts +2 -10
  315. package/packages/pi-coding-agent/src/core/lsp/edits.ts +1 -1
  316. package/packages/pi-coding-agent/src/core/lsp/index.ts +83 -152
  317. package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +3 -23
  318. package/packages/pi-coding-agent/src/core/lsp/types.ts +0 -29
  319. package/packages/pi-coding-agent/src/core/lsp/utils.ts +1 -33
  320. package/packages/pi-coding-agent/src/core/messages.ts +5 -5
  321. package/packages/pi-coding-agent/src/core/model-registry.ts +0 -2
  322. package/packages/pi-coding-agent/src/core/model-resolver.ts +3 -77
  323. package/packages/pi-coding-agent/src/core/package-manager.ts +1 -4
  324. package/packages/pi-coding-agent/src/core/prompt-templates.ts +2 -2
  325. package/packages/pi-coding-agent/src/core/resource-loader.ts +43 -67
  326. package/packages/pi-coding-agent/src/core/retry-handler.ts +359 -0
  327. package/packages/pi-coding-agent/src/core/session-manager.ts +5 -34
  328. package/packages/pi-coding-agent/src/core/settings-manager.ts +87 -166
  329. package/packages/pi-coding-agent/src/core/skills.ts +1 -4
  330. package/packages/pi-coding-agent/src/index.ts +1 -7
  331. package/packages/pi-coding-agent/src/migrations.ts +2 -2
  332. package/packages/pi-coding-agent/src/modes/interactive/components/session-selector-search.ts +2 -2
  333. package/packages/pi-coding-agent/src/modes/interactive/components/session-selector.ts +17 -29
  334. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +1 -13
  335. package/packages/pi-coding-agent/src/modes/interactive/components/tree-render-utils.ts +81 -0
  336. package/packages/pi-coding-agent/src/modes/interactive/components/tree-selector.ts +14 -19
  337. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +50 -561
  338. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +653 -0
  339. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +7 -26
  340. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +196 -0
  341. package/packages/pi-coding-agent/src/modes/interactive/utils/shorten-path.ts +14 -0
  342. package/packages/pi-coding-agent/src/modes/print-mode.ts +2 -30
  343. package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +2 -28
  344. package/packages/pi-coding-agent/src/modes/shared/command-context-actions.ts +53 -0
  345. package/packages/pi-coding-agent/src/utils/changelog.ts +1 -1
  346. package/packages/pi-coding-agent/src/utils/clipboard-image.ts +1 -1
  347. package/packages/pi-coding-agent/src/utils/error.ts +6 -0
  348. package/packages/pi-coding-agent/src/utils/photon.ts +0 -137
  349. package/packages/pi-coding-agent/src/utils/tools-manager.ts +1 -1
  350. package/packages/pi-tui/dist/components/editor.d.ts +0 -10
  351. package/packages/pi-tui/dist/components/editor.d.ts.map +1 -1
  352. package/packages/pi-tui/dist/components/editor.js +1 -1
  353. package/packages/pi-tui/dist/components/editor.js.map +1 -1
  354. package/packages/pi-tui/dist/components/markdown.d.ts +5 -0
  355. package/packages/pi-tui/dist/components/markdown.d.ts.map +1 -1
  356. package/packages/pi-tui/dist/components/markdown.js +25 -31
  357. package/packages/pi-tui/dist/components/markdown.js.map +1 -1
  358. package/packages/pi-tui/dist/keys.d.ts +0 -4
  359. package/packages/pi-tui/dist/keys.d.ts.map +1 -1
  360. package/packages/pi-tui/dist/keys.js +94 -162
  361. package/packages/pi-tui/dist/keys.js.map +1 -1
  362. package/packages/pi-tui/dist/overlay-layout.d.ts +55 -0
  363. package/packages/pi-tui/dist/overlay-layout.d.ts.map +1 -0
  364. package/packages/pi-tui/dist/overlay-layout.js +288 -0
  365. package/packages/pi-tui/dist/overlay-layout.js.map +1 -0
  366. package/packages/pi-tui/dist/tui.d.ts +0 -22
  367. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  368. package/packages/pi-tui/dist/tui.js +6 -272
  369. package/packages/pi-tui/dist/tui.js.map +1 -1
  370. package/packages/pi-tui/dist/utils.d.ts +0 -7
  371. package/packages/pi-tui/dist/utils.d.ts.map +1 -1
  372. package/packages/pi-tui/dist/utils.js +0 -44
  373. package/packages/pi-tui/dist/utils.js.map +1 -1
  374. package/packages/pi-tui/src/components/editor.ts +1 -1
  375. package/packages/pi-tui/src/components/markdown.ts +25 -29
  376. package/packages/pi-tui/src/keys.ts +94 -173
  377. package/packages/pi-tui/src/overlay-layout.ts +372 -0
  378. package/packages/pi-tui/src/tui.ts +11 -312
  379. package/packages/pi-tui/src/utils.ts +0 -43
  380. package/pkg/dist/core/export-html/ansi-to-html.d.ts +0 -4
  381. package/pkg/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  382. package/pkg/dist/core/export-html/ansi-to-html.js +1 -1
  383. package/pkg/dist/core/export-html/ansi-to-html.js.map +1 -1
  384. package/pkg/dist/modes/interactive/theme/theme.d.ts +65 -4
  385. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  386. package/pkg/dist/modes/interactive/theme/theme.js +6 -23
  387. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  388. package/pkg/dist/modes/interactive/theme/themes.d.ts +12 -0
  389. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -0
  390. package/pkg/dist/modes/interactive/theme/themes.js +175 -0
  391. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -0
  392. package/pkg/package.json +1 -1
  393. package/src/resources/extensions/gsd/changelog.ts +213 -0
  394. package/src/resources/extensions/gsd/commands-bootstrap.ts +1 -0
  395. package/src/resources/extensions/gsd/commands-prefs-wizard.ts +5 -1
  396. package/src/resources/extensions/gsd/commands.ts +9 -1
  397. package/src/resources/extensions/gsd/docs/preferences-reference.md +10 -0
  398. package/src/resources/extensions/gsd/doctor-checks.ts +107 -5
  399. package/src/resources/extensions/gsd/doctor-proactive.ts +24 -0
  400. package/src/resources/extensions/gsd/doctor-types.ts +9 -1
  401. package/src/resources/extensions/gsd/doctor.ts +35 -0
  402. package/src/resources/extensions/gsd/guided-flow.ts +4 -2
  403. package/src/resources/extensions/gsd/preferences-validation.ts +38 -0
  404. package/src/resources/extensions/gsd/preferences.ts +2 -0
  405. package/src/resources/extensions/gsd/tests/doctor-git.test.ts +98 -2
  406. package/src/resources/extensions/gsd/tests/doctor-runtime.test.ts +59 -3
  407. package/src/resources/extensions/gsd/tests/preferences.test.ts +28 -0
  408. package/src/resources/extensions/mcp-client/index.ts +2 -1
  409. package/src/resources/skills/create-gsd-extension/references/events-reference.md +4 -4
  410. package/packages/pi-coding-agent/dist/modes/interactive/theme/dark.json +0 -85
  411. package/packages/pi-coding-agent/dist/modes/interactive/theme/light.json +0 -84
  412. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -335
  413. package/packages/pi-coding-agent/src/modes/interactive/theme/dark.json +0 -85
  414. package/packages/pi-coding-agent/src/modes/interactive/theme/light.json +0 -84
  415. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.json +0 -335
  416. package/pkg/dist/modes/interactive/theme/dark.json +0 -85
  417. package/pkg/dist/modes/interactive/theme/light.json +0 -84
  418. package/pkg/dist/modes/interactive/theme/theme-schema.json +0 -335
@@ -8,7 +8,7 @@ import * as os from "node:os";
8
8
  import * as path from "node:path";
9
9
  import { CombinedAutocompleteProvider, Container, fuzzyFilter, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, Text, TruncatedText, TUI, visibleWidth, } from "@gsd/pi-tui";
10
10
  import { spawn, spawnSync } from "child_process";
11
- import { APP_NAME, getAuthPath, getDebugLogPath, getShareViewerUrl, getUpdateInstruction, VERSION, } from "../../config.js";
11
+ import { APP_NAME, getAuthPath, getDebugLogPath, getUpdateInstruction, VERSION, } from "../../config.js";
12
12
  import { parseSkillBlock } from "../../core/agent-session.js";
13
13
  import { FooterDataProvider } from "../../core/footer-data-provider.js";
14
14
  import { KeybindingsManager } from "../../core/keybindings.js";
@@ -17,10 +17,8 @@ import { resolveModelScope } from "../../core/model-resolver.js";
17
17
  import { SessionManager } from "../../core/session-manager.js";
18
18
  import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
19
19
  import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
20
- import { copyToClipboard } from "../../utils/clipboard.js";
21
20
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
22
21
  import { ensureTool } from "../../utils/tools-manager.js";
23
- import { ArminComponent } from "./components/armin.js";
24
22
  import { AssistantMessageComponent } from "./components/assistant-message.js";
25
23
  import { BashExecutionComponent } from "./components/bash-execution.js";
26
24
  import { BorderedLoader } from "./components/bordered-loader.js";
@@ -34,19 +32,20 @@ import { ExtensionEditorComponent } from "./components/extension-editor.js";
34
32
  import { ExtensionInputComponent } from "./components/extension-input.js";
35
33
  import { ExtensionSelectorComponent } from "./components/extension-selector.js";
36
34
  import { FooterComponent } from "./components/footer.js";
37
- import { appKey, appKeyHint, editorKey, formatKeyForDisplay, keyHint, rawKeyHint } from "./components/keybinding-hints.js";
35
+ import { appKey, appKeyHint, keyHint, rawKeyHint } from "./components/keybinding-hints.js";
38
36
  import { LoginDialogComponent } from "./components/login-dialog.js";
39
37
  import { ModelSelectorComponent } from "./components/model-selector.js";
40
38
  import { OAuthSelectorComponent } from "./components/oauth-selector.js";
41
39
  import { ProviderManagerComponent } from "./components/provider-manager.js";
42
40
  import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
43
41
  import { SessionSelectorComponent } from "./components/session-selector.js";
44
- import { SelectSubmenu, SettingsSelectorComponent, THINKING_DESCRIPTIONS } from "./components/settings-selector.js";
42
+ import { SettingsSelectorComponent } from "./components/settings-selector.js";
45
43
  import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
46
44
  import { ToolExecutionComponent } from "./components/tool-execution.js";
47
45
  import { TreeSelectorComponent } from "./components/tree-selector.js";
48
46
  import { UserMessageComponent } from "./components/user-message.js";
49
47
  import { UserMessageSelectorComponent } from "./components/user-message-selector.js";
48
+ import { dispatchSlashCommand, getAppKeyDisplay } from "./slash-command-handlers.js";
50
49
  import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, initTheme, onThemeChange, setRegisteredThemes, setTheme, setThemeInstance, Theme, theme, } from "./theme/theme.js";
51
50
  function isExpandable(obj) {
52
51
  return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
@@ -1590,135 +1589,56 @@ export class InteractiveMode {
1590
1589
  // Silently ignore clipboard errors (may not have permission, etc.)
1591
1590
  }
1592
1591
  }
1592
+ getSlashCommandContext() {
1593
+ return {
1594
+ session: this.session,
1595
+ ui: this.ui,
1596
+ keybindings: this.keybindings,
1597
+ chatContainer: this.chatContainer,
1598
+ statusContainer: this.statusContainer,
1599
+ editorContainer: this.editorContainer,
1600
+ headerContainer: this.headerContainer,
1601
+ pendingMessagesContainer: this.pendingMessagesContainer,
1602
+ editor: this.editor,
1603
+ defaultEditor: this.defaultEditor,
1604
+ sessionManager: this.sessionManager,
1605
+ settingsManager: this.settingsManager,
1606
+ invalidateFooter: () => this.footer.invalidate(),
1607
+ showStatus: (msg) => this.showStatus(msg),
1608
+ showError: (msg) => this.showError(msg),
1609
+ showWarning: (msg) => this.showWarning(msg),
1610
+ showSelector: (create) => this.showSelector(create),
1611
+ updateEditorBorderColor: () => this.updateEditorBorderColor(),
1612
+ getMarkdownThemeWithSettings: () => this.getMarkdownThemeWithSettings(),
1613
+ requestRender: () => this.ui.requestRender(),
1614
+ updateTerminalTitle: () => this.updateTerminalTitle(),
1615
+ showSettingsSelector: () => this.showSettingsSelector(),
1616
+ showModelsSelector: () => this.showModelsSelector(),
1617
+ handleModelCommand: (searchTerm) => this.handleModelCommand(searchTerm),
1618
+ showUserMessageSelector: () => this.showUserMessageSelector(),
1619
+ showTreeSelector: () => this.showTreeSelector(),
1620
+ showProviderManager: () => this.showProviderManager(),
1621
+ showOAuthSelector: (mode) => this.showOAuthSelector(mode),
1622
+ showSessionSelector: () => this.showSessionSelector(),
1623
+ handleClearCommand: () => this.handleClearCommand(),
1624
+ handleReloadCommand: () => this.handleReloadCommand(),
1625
+ handleDebugCommand: () => this.handleDebugCommand(),
1626
+ shutdown: () => this.shutdown(),
1627
+ executeCompaction: (instructions, isAuto) => this.executeCompaction(instructions, isAuto),
1628
+ };
1629
+ }
1593
1630
  setupEditorSubmitHandler() {
1594
1631
  this.defaultEditor.onSubmit = async (text) => {
1595
1632
  text = text.trim();
1596
1633
  if (!text)
1597
1634
  return;
1598
- // Handle commands
1599
- if (text === "/settings") {
1600
- this.showSettingsSelector();
1601
- this.editor.setText("");
1602
- return;
1603
- }
1604
- if (text === "/scoped-models") {
1605
- this.editor.setText("");
1606
- await this.showModelsSelector();
1607
- return;
1608
- }
1609
- if (text === "/model" || text.startsWith("/model ")) {
1610
- const searchTerm = text.startsWith("/model ") ? text.slice(7).trim() : undefined;
1611
- this.editor.setText("");
1612
- await this.handleModelCommand(searchTerm);
1613
- return;
1614
- }
1615
- if (text.startsWith("/export")) {
1616
- await this.handleExportCommand(text);
1617
- this.editor.setText("");
1618
- return;
1619
- }
1620
- if (text === "/share") {
1621
- await this.handleShareCommand();
1622
- this.editor.setText("");
1623
- return;
1624
- }
1625
- if (text === "/copy") {
1626
- this.handleCopyCommand();
1627
- this.editor.setText("");
1628
- return;
1629
- }
1630
- if (text === "/name" || text.startsWith("/name ")) {
1631
- this.handleNameCommand(text);
1632
- this.editor.setText("");
1633
- return;
1634
- }
1635
- if (text === "/session") {
1636
- this.handleSessionCommand();
1637
- this.editor.setText("");
1638
- return;
1639
- }
1640
- if (text === "/changelog") {
1641
- this.handleChangelogCommand();
1642
- this.editor.setText("");
1643
- return;
1644
- }
1645
- if (text === "/hotkeys") {
1646
- this.handleHotkeysCommand();
1647
- this.editor.setText("");
1648
- return;
1649
- }
1650
- if (text === "/fork") {
1651
- this.showUserMessageSelector();
1652
- this.editor.setText("");
1653
- return;
1654
- }
1655
- if (text === "/tree") {
1656
- this.showTreeSelector();
1657
- this.editor.setText("");
1658
- return;
1659
- }
1660
- if (text === "/provider") {
1661
- this.showProviderManager();
1662
- this.editor.setText("");
1663
- return;
1664
- }
1665
- if (text === "/login") {
1666
- this.showOAuthSelector("login");
1667
- this.editor.setText("");
1668
- return;
1669
- }
1670
- if (text === "/logout") {
1671
- this.showOAuthSelector("logout");
1672
- this.editor.setText("");
1673
- return;
1674
- }
1675
- if (text === "/new") {
1676
- this.editor.setText("");
1677
- await this.handleClearCommand();
1678
- return;
1679
- }
1680
- if (text === "/compact" || text.startsWith("/compact ")) {
1681
- const customInstructions = text.startsWith("/compact ") ? text.slice(9).trim() : undefined;
1682
- this.editor.setText("");
1683
- await this.handleCompactCommand(customInstructions);
1684
- return;
1685
- }
1686
- if (text === "/reload") {
1687
- this.editor.setText("");
1688
- await this.handleReloadCommand();
1689
- return;
1690
- }
1691
- if (text === "/thinking" || text.startsWith("/thinking ")) {
1692
- const arg = text.startsWith("/thinking ") ? text.slice(10).trim() : undefined;
1693
- this.editor.setText("");
1694
- this.handleThinkingCommand(arg);
1695
- return;
1696
- }
1697
- if (text === "/edit-mode" || text.startsWith("/edit-mode ")) {
1698
- const arg = text.startsWith("/edit-mode ") ? text.slice(11).trim() : undefined;
1699
- this.editor.setText("");
1700
- this.handleEditModeCommand(arg);
1701
- return;
1702
- }
1703
- if (text === "/debug") {
1704
- this.handleDebugCommand();
1705
- this.editor.setText("");
1706
- return;
1707
- }
1708
- if (text === "/arminsayshi") {
1709
- this.handleArminSaysHi();
1710
- this.editor.setText("");
1711
- return;
1712
- }
1713
- if (text === "/resume") {
1714
- this.showSessionSelector();
1715
- this.editor.setText("");
1716
- return;
1717
- }
1718
- if (text === "/quit") {
1719
- this.editor.setText("");
1720
- await this.shutdown();
1721
- return;
1635
+ // Handle slash commands
1636
+ if (text.startsWith("/")) {
1637
+ const handled = await dispatchSlashCommand(text, this.getSlashCommandContext());
1638
+ if (handled) {
1639
+ this.editor.setText("");
1640
+ return;
1641
+ }
1722
1642
  }
1723
1643
  // Handle bash command (! for normal, !! for excluded from context)
1724
1644
  if (text.startsWith("!")) {
@@ -2395,63 +2315,6 @@ export class InteractiveMode {
2395
2315
  this.showStatus(`Thinking level: ${newLevel}`);
2396
2316
  }
2397
2317
  }
2398
- handleThinkingCommand(arg) {
2399
- if (!this.session.supportsThinking()) {
2400
- this.showStatus("Current model does not support thinking");
2401
- return;
2402
- }
2403
- const availableLevels = this.session.getAvailableThinkingLevels();
2404
- if (arg) {
2405
- const level = arg.toLowerCase();
2406
- if (!availableLevels.includes(level)) {
2407
- this.showStatus(`Invalid thinking level "${arg}". Available: ${availableLevels.join(", ")}`);
2408
- return;
2409
- }
2410
- this.session.setThinkingLevel(level);
2411
- this.footer.invalidate();
2412
- this.updateEditorBorderColor();
2413
- this.showStatus(`Thinking level: ${level}`);
2414
- return;
2415
- }
2416
- this.showThinkingSelector();
2417
- }
2418
- handleEditModeCommand(arg) {
2419
- const modes = ["standard", "hashline"];
2420
- if (arg) {
2421
- const mode = arg.toLowerCase();
2422
- if (!modes.includes(mode)) {
2423
- this.showStatus(`Invalid edit mode "${arg}". Available: standard, hashline`);
2424
- return;
2425
- }
2426
- this.session.setEditMode(mode);
2427
- this.showStatus(`Edit mode: ${mode}${mode === "hashline" ? " (LINE#ID anchored edits)" : " (text-match edits)"}`);
2428
- return;
2429
- }
2430
- // Toggle
2431
- const current = this.session.editMode;
2432
- const next = current === "standard" ? "hashline" : "standard";
2433
- this.session.setEditMode(next);
2434
- this.showStatus(`Edit mode: ${next}${next === "hashline" ? " (LINE#ID anchored edits)" : " (text-match edits)"}`);
2435
- }
2436
- showThinkingSelector() {
2437
- const availableLevels = this.session.getAvailableThinkingLevels();
2438
- this.showSelector((done) => {
2439
- const selector = new SelectSubmenu("Thinking Level", "Select reasoning depth for thinking-capable models", availableLevels.map((level) => ({
2440
- value: level,
2441
- label: level,
2442
- description: THINKING_DESCRIPTIONS[level],
2443
- })), this.session.thinkingLevel, (value) => {
2444
- this.session.setThinkingLevel(value);
2445
- this.footer.invalidate();
2446
- this.updateEditorBorderColor();
2447
- done();
2448
- this.showStatus(`Thinking level: ${value}`);
2449
- }, () => {
2450
- done();
2451
- });
2452
- return { component: selector, focus: selector };
2453
- });
2454
- }
2455
2318
  async cycleModel(direction) {
2456
2319
  try {
2457
2320
  const result = await this.session.cycleModel(direction);
@@ -2613,7 +2476,7 @@ export class InteractiveMode {
2613
2476
  const text = theme.fg("dim", `Follow-up: ${message}`);
2614
2477
  this.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));
2615
2478
  }
2616
- const dequeueHint = this.getAppKeyDisplay("dequeue");
2479
+ const dequeueHint = getAppKeyDisplay(this.keybindings, "dequeue");
2617
2480
  const hintText = theme.fg("dim", `↳ ${dequeueHint} to edit all queued messages`);
2618
2481
  this.pendingMessagesContainer.addChild(new TruncatedText(hintText, 1, 0));
2619
2482
  }
@@ -3519,317 +3382,6 @@ export class InteractiveMode {
3519
3382
  this.showError(`Reload failed: ${error instanceof Error ? error.message : String(error)}`);
3520
3383
  }
3521
3384
  }
3522
- async handleExportCommand(text) {
3523
- const parts = text.split(/\s+/);
3524
- const outputPath = parts.length > 1 ? parts[1] : undefined;
3525
- try {
3526
- const filePath = await this.session.exportToHtml(outputPath);
3527
- this.showStatus(`Session exported to: ${filePath}`);
3528
- }
3529
- catch (error) {
3530
- this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
3531
- }
3532
- }
3533
- async handleShareCommand() {
3534
- // Check if gh is available and logged in
3535
- try {
3536
- const authResult = spawnSync("gh", ["auth", "status"], { encoding: "utf-8" });
3537
- if (authResult.status !== 0) {
3538
- this.showError("GitHub CLI is not logged in. Run 'gh auth login' first.");
3539
- return;
3540
- }
3541
- }
3542
- catch {
3543
- this.showError("GitHub CLI (gh) is not installed. Install it from https://cli.github.com/");
3544
- return;
3545
- }
3546
- // Export to a temp file
3547
- const tmpFile = path.join(os.tmpdir(), "session.html");
3548
- try {
3549
- await this.session.exportToHtml(tmpFile);
3550
- }
3551
- catch (error) {
3552
- this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
3553
- return;
3554
- }
3555
- // Show cancellable loader, replacing the editor
3556
- const loader = new BorderedLoader(this.ui, theme, "Creating gist...");
3557
- this.editorContainer.clear();
3558
- this.editorContainer.addChild(loader);
3559
- this.ui.setFocus(loader);
3560
- this.ui.requestRender();
3561
- const restoreEditor = () => {
3562
- loader.dispose();
3563
- this.editorContainer.clear();
3564
- this.editorContainer.addChild(this.editor);
3565
- this.ui.setFocus(this.editor);
3566
- try {
3567
- fs.unlinkSync(tmpFile);
3568
- }
3569
- catch {
3570
- // Ignore cleanup errors
3571
- }
3572
- };
3573
- // Create a secret gist asynchronously
3574
- let proc = null;
3575
- loader.onAbort = () => {
3576
- proc?.kill();
3577
- restoreEditor();
3578
- this.showStatus("Share cancelled");
3579
- };
3580
- try {
3581
- const result = await new Promise((resolve) => {
3582
- proc = spawn("gh", ["gist", "create", "--public=false", tmpFile]);
3583
- let stdout = "";
3584
- let stderr = "";
3585
- proc.stdout?.on("data", (data) => {
3586
- stdout += data.toString();
3587
- });
3588
- proc.stderr?.on("data", (data) => {
3589
- stderr += data.toString();
3590
- });
3591
- proc.on("close", (code) => resolve({ stdout, stderr, code }));
3592
- });
3593
- if (loader.signal.aborted)
3594
- return;
3595
- restoreEditor();
3596
- if (result.code !== 0) {
3597
- const errorMsg = result.stderr?.trim() || "Unknown error";
3598
- this.showError(`Failed to create gist: ${errorMsg}`);
3599
- return;
3600
- }
3601
- // Extract gist ID from the URL returned by gh
3602
- // gh returns something like: https://gist.github.com/username/GIST_ID
3603
- const gistUrl = result.stdout?.trim();
3604
- const gistId = gistUrl?.split("/").pop();
3605
- if (!gistId) {
3606
- this.showError("Failed to parse gist ID from gh output");
3607
- return;
3608
- }
3609
- // Create the preview URL
3610
- const previewUrl = getShareViewerUrl(gistId);
3611
- this.showStatus(`Share URL: ${previewUrl}\nGist: ${gistUrl}`);
3612
- }
3613
- catch (error) {
3614
- if (!loader.signal.aborted) {
3615
- restoreEditor();
3616
- this.showError(`Failed to create gist: ${error instanceof Error ? error.message : "Unknown error"}`);
3617
- }
3618
- }
3619
- }
3620
- handleCopyCommand() {
3621
- const text = this.session.getLastAssistantText();
3622
- if (!text) {
3623
- this.showError("No agent messages to copy yet.");
3624
- return;
3625
- }
3626
- try {
3627
- copyToClipboard(text);
3628
- this.showStatus("Copied last agent message to clipboard");
3629
- }
3630
- catch (error) {
3631
- this.showError(error instanceof Error ? error.message : String(error));
3632
- }
3633
- }
3634
- handleNameCommand(text) {
3635
- const name = text.replace(/^\/name\s*/, "").trim();
3636
- if (!name) {
3637
- const currentName = this.sessionManager.getSessionName();
3638
- if (currentName) {
3639
- this.chatContainer.addChild(new Spacer(1));
3640
- this.chatContainer.addChild(new Text(theme.fg("dim", `Session name: ${currentName}`), 1, 0));
3641
- }
3642
- else {
3643
- this.showWarning("Usage: /name <name>");
3644
- }
3645
- this.ui.requestRender();
3646
- return;
3647
- }
3648
- this.sessionManager.appendSessionInfo(name);
3649
- this.updateTerminalTitle();
3650
- this.chatContainer.addChild(new Spacer(1));
3651
- this.chatContainer.addChild(new Text(theme.fg("dim", `Session name set: ${name}`), 1, 0));
3652
- this.ui.requestRender();
3653
- }
3654
- handleSessionCommand() {
3655
- const stats = this.session.getSessionStats();
3656
- const sessionName = this.sessionManager.getSessionName();
3657
- let info = `${theme.bold("Session Info")}\n\n`;
3658
- if (sessionName) {
3659
- info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
3660
- }
3661
- info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
3662
- info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
3663
- info += `${theme.bold("Messages")}\n`;
3664
- info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
3665
- info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
3666
- info += `${theme.fg("dim", "Tool Calls:")} ${stats.toolCalls}\n`;
3667
- info += `${theme.fg("dim", "Tool Results:")} ${stats.toolResults}\n`;
3668
- info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n\n`;
3669
- info += `${theme.bold("Tokens")}\n`;
3670
- info += `${theme.fg("dim", "Input:")} ${stats.tokens.input.toLocaleString()}\n`;
3671
- info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
3672
- if (stats.tokens.cacheRead > 0) {
3673
- info += `${theme.fg("dim", "Cache Read:")} ${stats.tokens.cacheRead.toLocaleString()}\n`;
3674
- }
3675
- if (stats.tokens.cacheWrite > 0) {
3676
- info += `${theme.fg("dim", "Cache Write:")} ${stats.tokens.cacheWrite.toLocaleString()}\n`;
3677
- }
3678
- info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
3679
- if (stats.cost > 0) {
3680
- info += `\n${theme.bold("Cost")}\n`;
3681
- info += `${theme.fg("dim", "Total:")} ${stats.cost.toFixed(4)}`;
3682
- }
3683
- this.chatContainer.addChild(new Spacer(1));
3684
- this.chatContainer.addChild(new Text(info, 1, 0));
3685
- this.ui.requestRender();
3686
- }
3687
- handleChangelogCommand() {
3688
- const changelogPath = getChangelogPath();
3689
- const allEntries = parseChangelog(changelogPath);
3690
- const changelogMarkdown = allEntries.length > 0
3691
- ? allEntries
3692
- .reverse()
3693
- .map((e) => e.content)
3694
- .join("\n\n")
3695
- : "No changelog entries found.";
3696
- this.chatContainer.addChild(new Spacer(1));
3697
- this.chatContainer.addChild(new DynamicBorder());
3698
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));
3699
- this.chatContainer.addChild(new Spacer(1));
3700
- this.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, this.getMarkdownThemeWithSettings()));
3701
- this.chatContainer.addChild(new DynamicBorder());
3702
- this.ui.requestRender();
3703
- }
3704
- /**
3705
- * Capitalize keybinding for display (e.g., "ctrl+c" -> "Ctrl+C").
3706
- */
3707
- capitalizeKey(key) {
3708
- return key
3709
- .split("/")
3710
- .map((k) => k
3711
- .split("+")
3712
- .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
3713
- .join("+"))
3714
- .join("/");
3715
- }
3716
- /**
3717
- * Get capitalized display string for an app keybinding action.
3718
- */
3719
- getAppKeyDisplay(action) {
3720
- return this.capitalizeKey(appKey(this.keybindings, action));
3721
- }
3722
- /**
3723
- * Get capitalized display string for an editor keybinding action.
3724
- */
3725
- getEditorKeyDisplay(action) {
3726
- return this.capitalizeKey(editorKey(action));
3727
- }
3728
- handleHotkeysCommand() {
3729
- // Navigation keybindings
3730
- const cursorWordLeft = this.getEditorKeyDisplay("cursorWordLeft");
3731
- const cursorWordRight = this.getEditorKeyDisplay("cursorWordRight");
3732
- const cursorLineStart = this.getEditorKeyDisplay("cursorLineStart");
3733
- const cursorLineEnd = this.getEditorKeyDisplay("cursorLineEnd");
3734
- const jumpForward = this.getEditorKeyDisplay("jumpForward");
3735
- const jumpBackward = this.getEditorKeyDisplay("jumpBackward");
3736
- const pageUp = this.getEditorKeyDisplay("pageUp");
3737
- const pageDown = this.getEditorKeyDisplay("pageDown");
3738
- // Editing keybindings
3739
- const submit = this.getEditorKeyDisplay("submit");
3740
- const newLine = this.getEditorKeyDisplay("newLine");
3741
- const deleteWordBackward = this.getEditorKeyDisplay("deleteWordBackward");
3742
- const deleteWordForward = this.getEditorKeyDisplay("deleteWordForward");
3743
- const deleteToLineStart = this.getEditorKeyDisplay("deleteToLineStart");
3744
- const deleteToLineEnd = this.getEditorKeyDisplay("deleteToLineEnd");
3745
- const yank = this.getEditorKeyDisplay("yank");
3746
- const yankPop = this.getEditorKeyDisplay("yankPop");
3747
- const undo = this.getEditorKeyDisplay("undo");
3748
- const tab = this.getEditorKeyDisplay("tab");
3749
- // App keybindings
3750
- const interrupt = this.getAppKeyDisplay("interrupt");
3751
- const clear = this.getAppKeyDisplay("clear");
3752
- const exit = this.getAppKeyDisplay("exit");
3753
- const suspend = this.getAppKeyDisplay("suspend");
3754
- const cycleThinkingLevel = this.getAppKeyDisplay("cycleThinkingLevel");
3755
- const cycleModelForward = this.getAppKeyDisplay("cycleModelForward");
3756
- const selectModel = this.getAppKeyDisplay("selectModel");
3757
- const expandTools = this.getAppKeyDisplay("expandTools");
3758
- const toggleThinking = this.getAppKeyDisplay("toggleThinking");
3759
- const externalEditor = this.getAppKeyDisplay("externalEditor");
3760
- const followUp = this.getAppKeyDisplay("followUp");
3761
- const dequeue = this.getAppKeyDisplay("dequeue");
3762
- let hotkeys = `
3763
- **Navigation**
3764
- | Key | Action |
3765
- |-----|--------|
3766
- | \`Arrow keys\` | Move cursor / browse history (Up when empty) |
3767
- | \`${cursorWordLeft}\` / \`${cursorWordRight}\` | Move by word |
3768
- | \`${cursorLineStart}\` | Start of line |
3769
- | \`${cursorLineEnd}\` | End of line |
3770
- | \`${jumpForward}\` | Jump forward to character |
3771
- | \`${jumpBackward}\` | Jump backward to character |
3772
- | \`${pageUp}\` / \`${pageDown}\` | Scroll by page |
3773
-
3774
- **Editing**
3775
- | Key | Action |
3776
- |-----|--------|
3777
- | \`${submit}\` | Send message |
3778
- | \`${newLine}\` | New line${process.platform === "win32" ? " (Ctrl+Enter on Windows Terminal)" : ""} |
3779
- | \`${deleteWordBackward}\` | Delete word backwards |
3780
- | \`${deleteWordForward}\` | Delete word forwards |
3781
- | \`${deleteToLineStart}\` | Delete to start of line |
3782
- | \`${deleteToLineEnd}\` | Delete to end of line |
3783
- | \`${yank}\` | Paste the most-recently-deleted text |
3784
- | \`${yankPop}\` | Cycle through the deleted text after pasting |
3785
- | \`${undo}\` | Undo |
3786
-
3787
- **Other**
3788
- | Key | Action |
3789
- |-----|--------|
3790
- | \`${tab}\` | Path completion / accept autocomplete |
3791
- | \`${interrupt}\` | Cancel autocomplete / abort streaming |
3792
- | \`${clear}\` | Clear editor (first) / exit (second) |
3793
- | \`${exit}\` | Exit (when editor is empty) |
3794
- | \`${suspend}\` | Suspend to background |
3795
- | \`${cycleThinkingLevel}\` | Cycle thinking level |
3796
- | \`${cycleModelForward}\` | Cycle models |
3797
- | \`${selectModel}\` | Open model selector |
3798
- | \`${expandTools}\` | Toggle tool output expansion |
3799
- | \`${toggleThinking}\` | Toggle thinking block visibility |
3800
- | \`${externalEditor}\` | Edit message in external editor |
3801
- | \`${followUp}\` | Queue follow-up message |
3802
- | \`${dequeue}\` | Restore queued messages |
3803
- | \`Ctrl+V\` | Paste image from clipboard |
3804
- | \`/\` | Slash commands |
3805
- | \`!\` | Run bash command |
3806
- | \`!!\` | Run bash command (excluded from context) |
3807
- `;
3808
- // Add extension-registered shortcuts
3809
- const extensionRunner = this.session.extensionRunner;
3810
- if (extensionRunner) {
3811
- const shortcuts = extensionRunner.getShortcuts(this.keybindings.getEffectiveConfig());
3812
- if (shortcuts.size > 0) {
3813
- hotkeys += `
3814
- **Extensions**
3815
- | Key | Action |
3816
- |-----|--------|
3817
- `;
3818
- for (const [key, shortcut] of shortcuts) {
3819
- const description = shortcut.description ?? shortcut.extensionPath;
3820
- const keyDisplay = formatKeyForDisplay(key).replace(/\b\w/g, (c) => c.toUpperCase());
3821
- hotkeys += `| \`${keyDisplay}\` | ${description} |\n`;
3822
- }
3823
- }
3824
- }
3825
- this.chatContainer.addChild(new Spacer(1));
3826
- this.chatContainer.addChild(new DynamicBorder());
3827
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0));
3828
- this.chatContainer.addChild(new Spacer(1));
3829
- this.chatContainer.addChild(new Markdown(hotkeys.trim(), 1, 1, this.getMarkdownThemeWithSettings()));
3830
- this.chatContainer.addChild(new DynamicBorder());
3831
- this.ui.requestRender();
3832
- }
3833
3385
  async handleClearCommand() {
3834
3386
  // Stop loading animation
3835
3387
  if (this.loadingAnimation) {
@@ -3878,11 +3430,6 @@ export class InteractiveMode {
3878
3430
  this.chatContainer.addChild(new Text(`${theme.fg("accent", "✓ Debug log written")}\n${theme.fg("muted", debugLogPath)}`, 1, 1));
3879
3431
  this.ui.requestRender();
3880
3432
  }
3881
- handleArminSaysHi() {
3882
- this.chatContainer.addChild(new Spacer(1));
3883
- this.chatContainer.addChild(new ArminComponent(this.ui));
3884
- this.ui.requestRender();
3885
- }
3886
3433
  handleDaxnuts() {
3887
3434
  this.chatContainer.addChild(new Spacer(1));
3888
3435
  this.chatContainer.addChild(new DaxnutsComponent(this.ui));
@@ -3960,15 +3507,6 @@ export class InteractiveMode {
3960
3507
  this.bashComponent = undefined;
3961
3508
  this.ui.requestRender();
3962
3509
  }
3963
- async handleCompactCommand(customInstructions) {
3964
- const entries = this.sessionManager.getEntries();
3965
- const messageCount = entries.filter((e) => e.type === "message").length;
3966
- if (messageCount < 2) {
3967
- this.showWarning("Nothing to compact (no messages yet)");
3968
- return;
3969
- }
3970
- await this.executeCompaction(customInstructions, false);
3971
- }
3972
3510
  async executeCompaction(customInstructions, isAuto = false) {
3973
3511
  // Stop loading animation
3974
3512
  if (this.loadingAnimation) {