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
@@ -0,0 +1,162 @@
1
+ /**
2
+ * GSD Changelog — Fetch and display categorized release notes from GitHub
3
+ *
4
+ * Fetches releases from the gsd-build/gsd-2 GitHub repository,
5
+ * prompts the user for a version filter, and sends raw release notes
6
+ * into the conversation for the LLM to summarize.
7
+ *
8
+ * Entry point: handleChangelog() called from commands.ts
9
+ */
10
+ // ─── Semver comparison ────────────────────────────────────────────────────────
11
+ function compareSemver(a, b) {
12
+ const pa = a.split(".").map(Number);
13
+ const pb = b.split(".").map(Number);
14
+ for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
15
+ const va = pa[i] || 0;
16
+ const vb = pb[i] || 0;
17
+ if (va > vb)
18
+ return 1;
19
+ if (va < vb)
20
+ return -1;
21
+ }
22
+ return 0;
23
+ }
24
+ function stripV(tag) {
25
+ return tag.startsWith("v") ? tag.slice(1) : tag;
26
+ }
27
+ function parseReleaseBody(body) {
28
+ if (!body)
29
+ return [];
30
+ const sections = [];
31
+ const lines = body.split("\n");
32
+ let currentHeading = null;
33
+ let currentLines = [];
34
+ for (const line of lines) {
35
+ if (line.startsWith("### ")) {
36
+ if (currentHeading !== null) {
37
+ const content = currentLines.join("\n").trim();
38
+ if (content) {
39
+ sections.push({ heading: currentHeading, content });
40
+ }
41
+ }
42
+ currentHeading = line.slice(4).trim();
43
+ currentLines = [];
44
+ }
45
+ else if (currentHeading !== null) {
46
+ currentLines.push(line);
47
+ }
48
+ }
49
+ if (currentHeading !== null) {
50
+ const content = currentLines.join("\n").trim();
51
+ if (content) {
52
+ sections.push({ heading: currentHeading, content });
53
+ }
54
+ }
55
+ return sections;
56
+ }
57
+ // ─── Display formatting ──────────────────────────────────────────────────────
58
+ function formatRelease(release) {
59
+ const version = stripV(release.tag_name);
60
+ const title = release.name || `v${version}`;
61
+ const sections = parseReleaseBody(release.body);
62
+ const parts = [`## ${title}`];
63
+ if (sections.length === 0) {
64
+ if (release.body?.trim()) {
65
+ parts.push(release.body.trim());
66
+ }
67
+ else {
68
+ parts.push("_No release notes._");
69
+ }
70
+ }
71
+ else {
72
+ for (const section of sections) {
73
+ parts.push(`### ${section.heading}`);
74
+ parts.push(section.content);
75
+ }
76
+ }
77
+ return parts.join("\n\n");
78
+ }
79
+ // ─── Entry Point ──────────────────────────────────────────────────────────────
80
+ const RELEASES_URL = "https://api.github.com/repos/gsd-build/gsd-2/releases?per_page=100";
81
+ export async function handleChangelog(args, ctx, pi) {
82
+ // ── Fetch releases ──────────────────────────────────────────────────────
83
+ let releases;
84
+ try {
85
+ const response = await fetch(RELEASES_URL, {
86
+ headers: { "User-Agent": "gsd-changelog" },
87
+ });
88
+ if (!response.ok) {
89
+ ctx.ui.notify(`Failed to fetch changelog: GitHub API returned ${response.status} ${response.statusText}`, "error");
90
+ return;
91
+ }
92
+ releases = (await response.json());
93
+ }
94
+ catch (err) {
95
+ const message = err instanceof Error ? err.message : String(err);
96
+ ctx.ui.notify(`Failed to fetch changelog: ${message}`, "error");
97
+ return;
98
+ }
99
+ if (!releases.length) {
100
+ ctx.ui.notify("No releases found in the repository.", "warning");
101
+ return;
102
+ }
103
+ // ── Determine version filter ────────────────────────────────────────────
104
+ const currentVersion = process.env.GSD_VERSION || "";
105
+ let sinceVersion;
106
+ let showCurrentOnly = false;
107
+ if (args.trim()) {
108
+ sinceVersion = stripV(args.trim());
109
+ }
110
+ else {
111
+ const input = await ctx.ui.input("Show changes since version:", currentVersion || "latest");
112
+ if (input === undefined) {
113
+ return;
114
+ }
115
+ if (input.trim() === "") {
116
+ showCurrentOnly = true;
117
+ }
118
+ else {
119
+ sinceVersion = stripV(input.trim());
120
+ }
121
+ }
122
+ // ── Filter releases ─────────────────────────────────────────────────────
123
+ let matched;
124
+ if (showCurrentOnly) {
125
+ if (!currentVersion) {
126
+ ctx.ui.notify("GSD_VERSION is not set — cannot determine current release. Provide a version instead.", "warning");
127
+ return;
128
+ }
129
+ const found = releases.find((r) => stripV(r.tag_name) === currentVersion);
130
+ if (!found) {
131
+ ctx.ui.notify(`No release found matching current version v${currentVersion}`, "warning");
132
+ return;
133
+ }
134
+ matched = [found];
135
+ }
136
+ else if (sinceVersion) {
137
+ matched = releases
138
+ .filter((r) => compareSemver(stripV(r.tag_name), sinceVersion) > 0)
139
+ .sort((a, b) => compareSemver(stripV(b.tag_name), stripV(a.tag_name)));
140
+ if (!matched.length) {
141
+ ctx.ui.notify(`No releases found since v${sinceVersion}`, "warning");
142
+ return;
143
+ }
144
+ }
145
+ else {
146
+ matched = [releases[0]];
147
+ }
148
+ // ── Send to LLM for summarization ───────────────────────────────────────
149
+ const rawOutput = matched.map(formatRelease).join("\n\n---\n\n");
150
+ const versionRange = sinceVersion
151
+ ? `since v${sinceVersion} (${matched.length} release${matched.length === 1 ? "" : "s"})`
152
+ : `for current release ${matched[0].name || matched[0].tag_name}`;
153
+ const prompt = [
154
+ `Here are the raw GSD changelog entries ${versionRange}.`,
155
+ "Summarize the most important changes — group by category (Added, Changed, Fixed, etc.),",
156
+ "keep only the most impactful items (max 5 per category), skip trivial changes,",
157
+ "and include the version where each item appeared. Keep it concise and scannable.",
158
+ "",
159
+ rawOutput,
160
+ ].join("\n");
161
+ pi.sendMessage({ customType: "gsd-changelog", content: prompt, display: true }, { triggerTurn: true });
162
+ }
@@ -11,6 +11,7 @@ const TOP_LEVEL_SUBCOMMANDS = [
11
11
  { cmd: "quick", desc: "Execute a quick task without full planning overhead" },
12
12
  { cmd: "discuss", desc: "Discuss architecture and decisions" },
13
13
  { cmd: "capture", desc: "Fire-and-forget thought capture" },
14
+ { cmd: "changelog", desc: "Show categorized release notes" },
14
15
  { cmd: "triage", desc: "Manually trigger triage of pending captures" },
15
16
  { cmd: "dispatch", desc: "Dispatch a specific phase directly" },
16
17
  { cmd: "history", desc: "View execution history" },
@@ -624,10 +624,14 @@ export function serializePreferencesToFrontmatter(prefs) {
624
624
  const orderedKeys = [
625
625
  "version", "mode", "always_use_skills", "prefer_skills", "avoid_skills",
626
626
  "skill_rules", "custom_instructions", "models", "skill_discovery",
627
- "auto_supervisor", "uat_dispatch", "unique_milestone_ids",
627
+ "skill_staleness_days", "auto_supervisor", "uat_dispatch", "unique_milestone_ids",
628
628
  "budget_ceiling", "budget_enforcement", "context_pause_threshold",
629
629
  "notifications", "remote_questions", "git",
630
630
  "post_unit_hooks", "pre_dispatch_hooks",
631
+ "dynamic_routing", "token_profile", "phases", "parallel",
632
+ "auto_visualize", "auto_report",
633
+ "verification_commands", "verification_auto_fix", "verification_max_retries",
634
+ "search_provider", "compression_strategy", "context_selection",
631
635
  ];
632
636
  const seen = new Set();
633
637
  for (const key of orderedKeys) {
@@ -56,7 +56,7 @@ export function projectRoot() {
56
56
  }
57
57
  export function registerGSDCommand(pi) {
58
58
  pi.registerCommand("gsd", {
59
- description: "GSD — Get Shit Done: /gsd help|start|templates|next|auto|stop|pause|status|visualize|queue|quick|capture|triage|dispatch|history|undo|skip|export|cleanup|mode|prefs|config|keys|hooks|run-hook|skill-health|doctor|forensics|migrate|remote|steer|knowledge|new-milestone|parallel|update",
59
+ description: "GSD — Get Shit Done: /gsd help|start|templates|next|auto|stop|pause|status|visualize|queue|quick|capture|triage|dispatch|history|undo|skip|export|cleanup|mode|prefs|config|keys|hooks|run-hook|skill-health|doctor|forensics|changelog|migrate|remote|steer|knowledge|new-milestone|parallel|update",
60
60
  getArgumentCompletions: (prefix) => {
61
61
  const subcommands = [
62
62
  { cmd: "help", desc: "Categorized command reference with descriptions" },
@@ -70,6 +70,7 @@ export function registerGSDCommand(pi) {
70
70
  { cmd: "quick", desc: "Execute a quick task without full planning overhead" },
71
71
  { cmd: "discuss", desc: "Discuss architecture and decisions" },
72
72
  { cmd: "capture", desc: "Fire-and-forget thought capture" },
73
+ { cmd: "changelog", desc: "Show categorized release notes" },
73
74
  { cmd: "triage", desc: "Manually trigger triage of pending captures" },
74
75
  { cmd: "dispatch", desc: "Dispatch a specific phase directly" },
75
76
  { cmd: "history", desc: "View execution history" },
@@ -448,6 +449,11 @@ export async function handleGSDCommand(args, ctx, pi) {
448
449
  await handleForensics(trimmed.replace(/^forensics\s*/, "").trim(), ctx, pi);
449
450
  return;
450
451
  }
452
+ if (trimmed === "changelog" || trimmed.startsWith("changelog ")) {
453
+ const { handleChangelog } = await import("./changelog.js");
454
+ await handleChangelog(trimmed.replace(/^changelog\s*/, "").trim(), ctx, pi);
455
+ return;
456
+ }
451
457
  if (trimmed === "next" || trimmed.startsWith("next ")) {
452
458
  if (trimmed.includes("--dry-run")) {
453
459
  await handleDryRun(ctx, projectRoot());
@@ -833,6 +839,7 @@ function showHelp(ctx) {
833
839
  " /gsd visualize Interactive 10-tab TUI (progress, timeline, deps, metrics, health, agent, changes, knowledge, captures, export)",
834
840
  " /gsd queue Show queued/dispatched units and execution order",
835
841
  " /gsd history View execution history [--cost] [--phase] [--model] [N]",
842
+ " /gsd changelog Show categorized release notes [version]",
836
843
  "",
837
844
  "COURSE CORRECTION",
838
845
  " /gsd steer <desc> Apply user override to active work",
@@ -134,6 +134,10 @@ Setting `prefer_skills: []` does **not** disable skill discovery — it just mea
134
134
  - `isolation`: `"worktree"`, `"branch"`, or `"none"` — controls auto-mode git isolation strategy. `"worktree"` creates a milestone worktree for isolated work; `"branch"` works directly in the project root but creates a milestone branch (useful for submodule-heavy repos); `"none"` works directly on the current branch with no worktree or milestone branch (ideal for step-mode with hot reloads). Default: `"worktree"`.
135
135
  - `manage_gitignore`: boolean — when `false`, GSD will not touch `.gitignore` at all. Useful when your project has a strictly managed `.gitignore` and you don't want GSD adding entries. Default: `true`.
136
136
  - `worktree_post_create`: string — script to run after a worktree is created (both auto-mode and manual `/worktree`). Receives `SOURCE_DIR` and `WORKTREE_DIR` as environment variables. Can be absolute or relative to project root. Runs with 30-second timeout. Failure is non-fatal (logged as warning). Default: none.
137
+ - `auto_pr`: boolean — automatically create a GitHub pull request after a milestone branch is merged. Requires `gh` CLI to be installed. Default: `false`.
138
+ - `pr_target_branch`: string — branch to target when `auto_pr` is enabled. Defaults to `main_branch` when omitted.
139
+ - **Deprecated:** `commit_docs` — no longer valid; `.gsd/` is always gitignored. Remove this setting.
140
+ - **Deprecated:** `merge_to_main` — no longer valid; milestone-level merge is always used. Remove this setting.
137
141
 
138
142
  - `unique_milestone_ids`: boolean — when `true`, generates milestone IDs in `M{seq}-{rand6}` format (e.g. `M001-eh88as`) instead of plain sequential `M001`. Prevents ID collisions in team workflows where multiple contributors create milestones concurrently. Both formats coexist — existing `M001`-style milestones remain valid. Default: `false`.
139
143
 
@@ -181,6 +185,12 @@ Setting `prefer_skills: []` does **not** disable skill discovery — it just mea
181
185
 
182
186
  - `auto_report`: boolean — generate an HTML report snapshot after each milestone completion. Default: `true`.
183
187
 
188
+ - `search_provider`: `"brave"`, `"tavily"`, `"ollama"`, `"native"`, or `"auto"` — selects the search backend for research phases. `"native"` forces Anthropic's built-in web search only; provider values force that backend and disable native search; `"auto"` uses the default heuristic. Default: `"auto"`.
189
+
190
+ - `compression_strategy`: `"truncate"` or `"compress"` — controls how context that exceeds the budget is reduced. `"truncate"` (default) drops sections from the end. `"compress"` applies heuristic compression before truncating, preserving more content at the cost of some fidelity. Default: `"truncate"`.
191
+
192
+ - `context_selection`: `"full"` or `"smart"` — controls how files are inlined into context. `"full"` inlines entire files; `"smart"` uses semantic chunking to include only the most relevant sections. Default is derived from `token_profile`.
193
+
184
194
  - `parallel`: configures parallel orchestration for running multiple slices concurrently. Keys:
185
195
  - `enabled`: boolean — enable parallel execution. Default: `false`.
186
196
  - `max_workers`: number — maximum concurrent workers (1-4). Default: `2`.
@@ -1,13 +1,13 @@
1
- import { existsSync, lstatSync, readdirSync, readFileSync, realpathSync, statSync } from "node:fs";
2
- import { join, sep } from "node:path";
1
+ import { existsSync, lstatSync, readdirSync, readFileSync, realpathSync, rmSync, statSync } from "node:fs";
2
+ import { basename, dirname, join, sep } from "node:path";
3
3
  import { loadFile, parseRoadmap } from "./files.js";
4
4
  import { resolveMilestoneFile, milestonesDir, gsdRoot, resolveGsdRootFile } from "./paths.js";
5
5
  import { deriveState, isMilestoneComplete } from "./state.js";
6
6
  import { saveFile } from "./files.js";
7
- import { listWorktrees, resolveGitDir } from "./worktree-manager.js";
7
+ import { listWorktrees, resolveGitDir, worktreesDir } from "./worktree-manager.js";
8
8
  import { abortAndReset } from "./git-self-heal.js";
9
- import { RUNTIME_EXCLUSION_PATHS } from "./git-service.js";
10
- import { nativeIsRepo, nativeWorktreeRemove, nativeBranchList, nativeBranchDelete, nativeLsFiles, nativeRmCached } from "./native-git-bridge.js";
9
+ import { RUNTIME_EXCLUSION_PATHS, readIntegrationBranch } from "./git-service.js";
10
+ import { nativeIsRepo, nativeBranchExists, nativeWorktreeList, nativeWorktreeRemove, nativeBranchList, nativeBranchDelete, nativeLsFiles, nativeRmCached } from "./native-git-bridge.js";
11
11
  import { readCrashLock, isLockProcessAlive, clearLock } from "./crash-recovery.js";
12
12
  import { ensureGitignore } from "./gitignore.js";
13
13
  import { readAllSessionStatuses, isSessionStale, removeSessionStatus } from "./session-status-io.js";
@@ -200,6 +200,75 @@ export async function checkGitHealth(basePath, issues, fixesApplied, shouldFix,
200
200
  catch {
201
201
  // git branch list failed — skip
202
202
  }
203
+ // ── Integration branch existence ──────────────────────────────────────
204
+ // For each active (non-complete) milestone, verify the stored integration
205
+ // branch still exists in git. A missing integration branch blocks merge-back
206
+ // and causes the next merge operation to fail silently.
207
+ try {
208
+ const state = await deriveState(basePath);
209
+ for (const milestone of state.registry) {
210
+ if (milestone.status === "complete")
211
+ continue;
212
+ const integrationBranch = readIntegrationBranch(basePath, milestone.id);
213
+ if (!integrationBranch)
214
+ continue; // No stored branch — skip (not yet set)
215
+ if (!nativeBranchExists(basePath, integrationBranch)) {
216
+ issues.push({
217
+ severity: "error",
218
+ code: "integration_branch_missing",
219
+ scope: "milestone",
220
+ unitId: milestone.id,
221
+ message: `Milestone ${milestone.id} recorded integration branch "${integrationBranch}" but that branch no longer exists in git. Merge-back will fail.`,
222
+ fixable: false,
223
+ });
224
+ }
225
+ }
226
+ }
227
+ catch {
228
+ // Non-fatal — integration branch check failed
229
+ }
230
+ // ── Orphaned worktree directories ────────────────────────────────────
231
+ // Worktree removal can fail after a branch delete, leaving a directory
232
+ // that is no longer registered with git. These orphaned dirs cause
233
+ // "already exists" errors when re-creating the same worktree name.
234
+ try {
235
+ const wtDir = worktreesDir(basePath);
236
+ if (existsSync(wtDir)) {
237
+ const registeredPaths = new Set(nativeWorktreeList(basePath).map(entry => entry.path));
238
+ for (const entry of readdirSync(wtDir)) {
239
+ const fullPath = join(wtDir, entry);
240
+ try {
241
+ if (!statSync(fullPath).isDirectory())
242
+ continue;
243
+ }
244
+ catch {
245
+ continue;
246
+ }
247
+ if (!registeredPaths.has(fullPath)) {
248
+ issues.push({
249
+ severity: "warning",
250
+ code: "worktree_directory_orphaned",
251
+ scope: "project",
252
+ unitId: entry,
253
+ message: `Worktree directory ${fullPath} exists on disk but is not registered with git. Run "git worktree prune" or doctor --fix to remove it.`,
254
+ fixable: true,
255
+ });
256
+ if (shouldFix("worktree_directory_orphaned")) {
257
+ try {
258
+ rmSync(fullPath, { recursive: true, force: true });
259
+ fixesApplied.push(`removed orphaned worktree directory ${fullPath}`);
260
+ }
261
+ catch {
262
+ fixesApplied.push(`failed to remove orphaned worktree directory ${fullPath}`);
263
+ }
264
+ }
265
+ }
266
+ }
267
+ }
268
+ }
269
+ catch {
270
+ // Non-fatal — orphaned worktree directory check failed
271
+ }
203
272
  }
204
273
  // ── Runtime Health Checks ──────────────────────────────────────────────────
205
274
  // Checks for stale crash locks, orphaned completed-units, stale hook state,
@@ -231,6 +300,45 @@ export async function checkRuntimeHealth(basePath, issues, fixesApplied, shouldF
231
300
  catch {
232
301
  // Non-fatal — crash lock check failed
233
302
  }
303
+ // ── Stranded lock directory ────────────────────────────────────────────
304
+ // proper-lockfile creates a `.gsd.lock/` directory as the OS-level lock
305
+ // mechanism. If the process was SIGKILLed or crashed hard, this directory
306
+ // can remain on disk without any live process holding it. The next session
307
+ // fails to acquire the lock until the directory is removed (#1245).
308
+ try {
309
+ const lockDir = join(dirname(root), `${basename(root)}.lock`);
310
+ if (existsSync(lockDir)) {
311
+ const statRes = statSync(lockDir);
312
+ if (statRes.isDirectory()) {
313
+ // Check if any live process actually holds this lock
314
+ const lock = readCrashLock(basePath);
315
+ const lockHolderAlive = lock ? isLockProcessAlive(lock) : false;
316
+ if (!lockHolderAlive) {
317
+ issues.push({
318
+ severity: "error",
319
+ code: "stranded_lock_directory",
320
+ scope: "project",
321
+ unitId: "project",
322
+ message: `Stranded lock directory "${lockDir}" exists but no live process holds the session lock. This blocks new auto-mode sessions from starting.`,
323
+ file: lockDir,
324
+ fixable: true,
325
+ });
326
+ if (shouldFix("stranded_lock_directory")) {
327
+ try {
328
+ rmSync(lockDir, { recursive: true, force: true });
329
+ fixesApplied.push(`removed stranded lock directory ${lockDir}`);
330
+ }
331
+ catch {
332
+ fixesApplied.push(`failed to remove stranded lock directory ${lockDir}`);
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ catch {
340
+ // Non-fatal — stranded lock directory check failed
341
+ }
234
342
  // ── Stale parallel sessions ────────────────────────────────────────────
235
343
  try {
236
344
  const parallelStatuses = readAllSessionStatuses(basePath);
@@ -19,6 +19,9 @@ import { gsdRoot, resolveGsdRootFile } from "./paths.js";
19
19
  import { readCrashLock, isLockProcessAlive, clearLock } from "./crash-recovery.js";
20
20
  import { abortAndReset } from "./git-self-heal.js";
21
21
  import { rebuildState } from "./doctor.js";
22
+ import { deriveState } from "./state.js";
23
+ import { readIntegrationBranch } from "./git-service.js";
24
+ import { nativeBranchExists, nativeIsRepo } from "./native-git-bridge.js";
22
25
  /** In-memory health history for the current auto-mode session. */
23
26
  let healthHistory = [];
24
27
  /** Count of consecutive units with unresolved errors. */
@@ -156,6 +159,25 @@ export async function preDispatchHealthGate(basePath) {
156
159
  catch {
157
160
  // Non-fatal — dispatch continues without STATE.md if rebuild fails
158
161
  }
162
+ // ── Integration branch existence check ──
163
+ // If the active milestone's recorded integration branch no longer exists in
164
+ // git, the merge-back at the end of the milestone will fail. Block dispatch
165
+ // now to surface this before work is lost.
166
+ try {
167
+ if (nativeIsRepo(basePath)) {
168
+ const state = await deriveState(basePath);
169
+ if (state.activeMilestone) {
170
+ const integrationBranch = readIntegrationBranch(basePath, state.activeMilestone.id);
171
+ if (integrationBranch && !nativeBranchExists(basePath, integrationBranch)) {
172
+ issues.push(`Integration branch "${integrationBranch}" for milestone ${state.activeMilestone.id} no longer exists in git. ` +
173
+ `Restore the branch or update the integration branch before dispatching. Run /gsd doctor for details.`);
174
+ }
175
+ }
176
+ }
177
+ }
178
+ catch {
179
+ // Non-fatal — dispatch continues if state/branch check fails
180
+ }
159
181
  // If we had critical issues that couldn't be auto-healed, block dispatch
160
182
  if (issues.length > 0) {
161
183
  return {
@@ -8,6 +8,7 @@ import { loadEffectiveGSDPreferences } from "./preferences.js";
8
8
  import { COMPLETION_TRANSITION_CODES } from "./doctor-types.js";
9
9
  import { checkGitHealth, checkRuntimeHealth } from "./doctor-checks.js";
10
10
  import { checkEnvironmentHealth } from "./doctor-environment.js";
11
+ import { runProviderChecks } from "./doctor-providers.js";
11
12
  export { summarizeDoctorIssues, filterDoctorIssues, formatDoctorReport, formatDoctorIssuesForPrompt } from "./doctor-format.js";
12
13
  export { runEnvironmentChecks, runFullEnvironmentChecks, formatEnvironmentReport } from "./doctor-environment.js";
13
14
  export { computeProgressScore, computeProgressScoreWithContext, formatProgressLine, formatProgressReport } from "./progress-score.js";
@@ -373,6 +374,41 @@ export async function runGSDDoctor(basePath, options) {
373
374
  const requirementsContent = await loadFile(requirementsPath);
374
375
  issues.push(...auditRequirements(requirementsContent));
375
376
  const state = await deriveState(basePath);
377
+ // Provider / auth health checks — only relevant when there is active work to dispatch.
378
+ // Skipped for idle projects (no active milestone) to avoid noise in environments
379
+ // where CI/test runners have no API key configured.
380
+ if (state.activeMilestone) {
381
+ try {
382
+ const providerResults = runProviderChecks();
383
+ for (const result of providerResults) {
384
+ if (!result.required)
385
+ continue;
386
+ if (result.status === "error") {
387
+ issues.push({
388
+ severity: "warning",
389
+ code: "provider_key_missing",
390
+ scope: "project",
391
+ unitId: "project",
392
+ message: result.message + (result.detail ? ` — ${result.detail}` : ""),
393
+ fixable: false,
394
+ });
395
+ }
396
+ else if (result.status === "warning") {
397
+ issues.push({
398
+ severity: "warning",
399
+ code: "provider_key_backedoff",
400
+ scope: "project",
401
+ unitId: "project",
402
+ message: result.message + (result.detail ? ` — ${result.detail}` : ""),
403
+ fixable: false,
404
+ });
405
+ }
406
+ }
407
+ }
408
+ catch {
409
+ // Non-fatal — provider check failure should not block other checks
410
+ }
411
+ }
376
412
  for (const milestone of state.registry) {
377
413
  const milestoneId = milestone.id;
378
414
  const milestonePath = resolveMilestonePath(basePath, milestoneId);
@@ -661,9 +661,11 @@ export async function showSmartEntry(ctx, pi, basePath, options) {
661
661
  untrackRuntimeFiles(basePath);
662
662
  // ── Self-heal stale runtime records from crashed auto-mode sessions ──
663
663
  selfHealRuntimeRecords(basePath, ctx);
664
- // Check for crash from previous auto-mode session
664
+ // Check for crash from previous auto-mode session.
665
+ // Skip if the lock was written by the current process — acquireSessionLock()
666
+ // writes to the same file, so we'd always false-positive (#1398).
665
667
  const crashLock = readCrashLock(basePath);
666
- if (crashLock) {
668
+ if (crashLock && crashLock.pid !== process.pid) {
667
669
  clearLock(basePath);
668
670
  // Bootstrap crash with zero completed units = no work was lost.
669
671
  // Auto-discard instead of prompting the user — this commonly happens
@@ -603,5 +603,43 @@ export function validatePreferences(preferences) {
603
603
  validated.git = git;
604
604
  }
605
605
  }
606
+ // ─── Auto Visualize ─────────────────────────────────────────────────
607
+ if (preferences.auto_visualize !== undefined) {
608
+ if (typeof preferences.auto_visualize === "boolean") {
609
+ validated.auto_visualize = preferences.auto_visualize;
610
+ }
611
+ else {
612
+ errors.push("auto_visualize must be a boolean");
613
+ }
614
+ }
615
+ // ─── Auto Report ────────────────────────────────────────────────────
616
+ if (preferences.auto_report !== undefined) {
617
+ if (typeof preferences.auto_report === "boolean") {
618
+ validated.auto_report = preferences.auto_report;
619
+ }
620
+ else {
621
+ errors.push("auto_report must be a boolean");
622
+ }
623
+ }
624
+ // ─── Compression Strategy ───────────────────────────────────────────
625
+ if (preferences.compression_strategy !== undefined) {
626
+ const validStrategies = new Set(["truncate", "compress"]);
627
+ if (typeof preferences.compression_strategy === "string" && validStrategies.has(preferences.compression_strategy)) {
628
+ validated.compression_strategy = preferences.compression_strategy;
629
+ }
630
+ else {
631
+ errors.push(`compression_strategy must be one of: truncate, compress`);
632
+ }
633
+ }
634
+ // ─── Context Selection ──────────────────────────────────────────────
635
+ if (preferences.context_selection !== undefined) {
636
+ const validModes = new Set(["full", "smart"]);
637
+ if (typeof preferences.context_selection === "string" && validModes.has(preferences.context_selection)) {
638
+ validated.context_selection = preferences.context_selection;
639
+ }
640
+ else {
641
+ errors.push(`context_selection must be one of: full, smart`);
642
+ }
643
+ }
606
644
  return { preferences: validated, errors, warnings };
607
645
  }
@@ -186,6 +186,8 @@ function mergePreferences(base, override) {
186
186
  search_provider: override.search_provider ?? base.search_provider,
187
187
  compression_strategy: override.compression_strategy ?? base.compression_strategy,
188
188
  context_selection: override.context_selection ?? base.context_selection,
189
+ auto_visualize: override.auto_visualize ?? base.auto_visualize,
190
+ auto_report: override.auto_report ?? base.auto_report,
189
191
  };
190
192
  }
191
193
  function mergeStringLists(base, override) {
@@ -280,7 +280,8 @@ export default function (pi) {
280
280
  tool: Type.String({
281
281
  description: "Tool name on that server, e.g. 'railway_list_projects'",
282
282
  }),
283
- args: Type.Optional(Type.Record(Type.String(), Type.Unknown(), {
283
+ args: Type.Optional(Type.Object({}, {
284
+ additionalProperties: true,
284
285
  description: "Tool arguments as key-value pairs matching the tool's input schema",
285
286
  })),
286
287
  }),
@@ -61,10 +61,10 @@ pi.on("tool_call", async (event, ctx) => {
61
61
 
62
62
  **tool_result** — Fired after tool executes. Can modify result. Handlers chain like middleware.
63
63
  ```typescript
64
- import { isBashToolResult } from "@mariozechner/pi-coding-agent";
64
+ import { isToolResultEventType } from "@mariozechner/pi-coding-agent";
65
65
 
66
66
  pi.on("tool_result", async (event, ctx) => {
67
- if (isBashToolResult(event)) {
67
+ if (isToolResultEventType("bash", event)) {
68
68
  // event.details is typed as BashToolDetails
69
69
  }
70
70
  // Return partial patch: { content, details, isError }
@@ -105,7 +105,7 @@ pi.on("model_select", async (event, ctx) => {
105
105
  Built-in type guards for tool events:
106
106
 
107
107
  ```typescript
108
- import { isToolCallEventType, isBashToolResult } from "@mariozechner/pi-coding-agent";
108
+ import { isToolCallEventType, isToolResultEventType } from "@mariozechner/pi-coding-agent";
109
109
 
110
110
  // Tool calls — narrows event.input type
111
111
  if (isToolCallEventType("bash", event)) { /* event.input: { command, timeout? } */ }
@@ -114,7 +114,7 @@ if (isToolCallEventType("write", event)) { /* event.input: { path, content } */
114
114
  if (isToolCallEventType("edit", event)) { /* event.input: { path, oldText, newText } */ }
115
115
 
116
116
  // Tool results — narrows event.details type
117
- if (isBashToolResult(event)) { /* event.details: BashToolDetails */ }
117
+ if (isToolResultEventType("bash", event)) { /* event.details: BashToolDetails */ }
118
118
  ```
119
119
 
120
120
  For custom tools, export your input type and use explicit type params:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-pi",
3
- "version": "2.34.0",
3
+ "version": "2.35.0-dev.cd3b7ea",
4
4
  "description": "GSD — Get Shit Done coding agent",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -55,5 +55,3 @@ export declare const native: {
55
55
  parseStreamingJson: (text: string) => unknown;
56
56
  xxHash32: (input: string, seed: number) => number;
57
57
  };
58
- /** True when the native addon loaded successfully. False on unsupported platforms. */
59
- export declare const nativeAvailable = false;
@@ -74,5 +74,3 @@ function loadNative() {
74
74
  });
75
75
  }
76
76
  export const native = loadNative();
77
- /** True when the native addon loaded successfully. False on unsupported platforms. */
78
- export const nativeAvailable = _loadedSuccessfully;
@@ -151,6 +151,3 @@ export const native = loadNative() as {
151
151
  parseStreamingJson: (text: string) => unknown;
152
152
  xxHash32: (input: string, seed: number) => number;
153
153
  };
154
-
155
- /** True when the native addon loaded successfully. False on unsupported platforms. */
156
- export const nativeAvailable = _loadedSuccessfully;
@@ -4,6 +4,20 @@
4
4
  */
5
5
  import { EventStream } from "@gsd/pi-ai";
6
6
  import type { AgentContext, AgentEvent, AgentLoopConfig, AgentMessage, StreamFn } from "./types.js";
7
+ export declare const ZERO_USAGE: {
8
+ readonly input: 0;
9
+ readonly output: 0;
10
+ readonly cacheRead: 0;
11
+ readonly cacheWrite: 0;
12
+ readonly totalTokens: 0;
13
+ readonly cost: {
14
+ readonly input: 0;
15
+ readonly output: 0;
16
+ readonly cacheRead: 0;
17
+ readonly cacheWrite: 0;
18
+ readonly total: 0;
19
+ };
20
+ };
7
21
  /**
8
22
  * Start an agent loop with a new prompt message.
9
23
  * The prompt is added to the context and events are emitted for it.