gsd-pi 2.34.0 → 2.35.0-dev.34ce717

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 (510) hide show
  1. package/README.md +3 -1
  2. package/dist/cli.js +7 -2
  3. package/dist/resource-loader.d.ts +1 -1
  4. package/dist/resource-loader.js +13 -1
  5. package/dist/resources/extensions/async-jobs/await-tool.js +0 -2
  6. package/dist/resources/extensions/async-jobs/job-manager.js +0 -6
  7. package/dist/resources/extensions/bg-shell/output-formatter.js +1 -19
  8. package/dist/resources/extensions/bg-shell/process-manager.js +0 -4
  9. package/dist/resources/extensions/bg-shell/types.js +0 -2
  10. package/dist/resources/extensions/context7/index.js +5 -0
  11. package/dist/resources/extensions/get-secrets-from-user.js +2 -30
  12. package/dist/resources/extensions/google-search/index.js +5 -0
  13. package/dist/resources/extensions/gsd/auto-dispatch.js +43 -1
  14. package/dist/resources/extensions/gsd/auto-loop.js +17 -3
  15. package/dist/resources/extensions/gsd/auto-model-selection.js +15 -3
  16. package/dist/resources/extensions/gsd/auto-recovery.js +35 -0
  17. package/dist/resources/extensions/gsd/auto-start.js +35 -2
  18. package/dist/resources/extensions/gsd/auto.js +59 -4
  19. package/dist/resources/extensions/gsd/changelog.js +162 -0
  20. package/dist/resources/extensions/gsd/commands-bootstrap.js +1 -0
  21. package/dist/resources/extensions/gsd/commands-handlers.js +2 -2
  22. package/dist/resources/extensions/gsd/commands-inspect.js +10 -3
  23. package/dist/resources/extensions/gsd/commands-prefs-wizard.js +5 -1
  24. package/dist/resources/extensions/gsd/commands-rate.js +31 -0
  25. package/dist/resources/extensions/gsd/commands.js +51 -2
  26. package/dist/resources/extensions/gsd/docs/preferences-reference.md +10 -0
  27. package/dist/resources/extensions/gsd/doctor-checks.js +113 -5
  28. package/dist/resources/extensions/gsd/doctor-environment.js +26 -17
  29. package/dist/resources/extensions/gsd/doctor-proactive.js +22 -0
  30. package/dist/resources/extensions/gsd/doctor.js +36 -0
  31. package/dist/resources/extensions/gsd/files.js +11 -2
  32. package/dist/resources/extensions/gsd/gitignore.js +54 -7
  33. package/dist/resources/extensions/gsd/guided-flow.js +12 -4
  34. package/dist/resources/extensions/gsd/health-widget-core.js +96 -0
  35. package/dist/resources/extensions/gsd/health-widget.js +97 -46
  36. package/dist/resources/extensions/gsd/index.js +26 -33
  37. package/dist/resources/extensions/gsd/migrate-external.js +55 -2
  38. package/dist/resources/extensions/gsd/milestone-ids.js +3 -2
  39. package/dist/resources/extensions/gsd/paths.js +74 -7
  40. package/dist/resources/extensions/gsd/post-unit-hooks.js +4 -1
  41. package/dist/resources/extensions/gsd/preferences-validation.js +54 -1
  42. package/dist/resources/extensions/gsd/preferences.js +14 -0
  43. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +2 -0
  44. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -0
  45. package/dist/resources/extensions/gsd/roadmap-mutations.js +55 -0
  46. package/dist/resources/extensions/gsd/session-lock.js +53 -2
  47. package/dist/resources/extensions/gsd/state.js +2 -1
  48. package/dist/resources/extensions/gsd/templates/plan.md +8 -0
  49. package/dist/resources/extensions/gsd/worktree-resolver.js +12 -0
  50. package/dist/resources/extensions/mcp-client/index.js +2 -1
  51. package/dist/resources/extensions/remote-questions/remote-command.js +2 -22
  52. package/dist/resources/extensions/shared/mod.js +1 -1
  53. package/dist/resources/extensions/shared/sanitize.js +30 -0
  54. package/dist/resources/extensions/subagent/index.js +6 -14
  55. package/dist/resources/skills/create-gsd-extension/references/events-reference.md +4 -4
  56. package/package.json +2 -1
  57. package/packages/native/dist/native.d.ts +0 -2
  58. package/packages/native/dist/native.js +0 -2
  59. package/packages/native/src/native.ts +0 -3
  60. package/packages/pi-agent-core/dist/agent-loop.d.ts +14 -0
  61. package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  62. package/packages/pi-agent-core/dist/agent-loop.js +24 -27
  63. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
  64. package/packages/pi-agent-core/dist/agent.d.ts +1 -0
  65. package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
  66. package/packages/pi-agent-core/dist/agent.js +11 -22
  67. package/packages/pi-agent-core/dist/agent.js.map +1 -1
  68. package/packages/pi-agent-core/dist/proxy.d.ts +1 -25
  69. package/packages/pi-agent-core/dist/proxy.d.ts.map +1 -1
  70. package/packages/pi-agent-core/dist/proxy.js +3 -9
  71. package/packages/pi-agent-core/dist/proxy.js.map +1 -1
  72. package/packages/pi-agent-core/src/agent-loop.ts +30 -27
  73. package/packages/pi-agent-core/src/agent.ts +12 -23
  74. package/packages/pi-agent-core/src/proxy.ts +3 -9
  75. package/packages/pi-ai/dist/api-registry.d.ts +0 -2
  76. package/packages/pi-ai/dist/api-registry.d.ts.map +1 -1
  77. package/packages/pi-ai/dist/api-registry.js +0 -10
  78. package/packages/pi-ai/dist/api-registry.js.map +1 -1
  79. package/packages/pi-ai/dist/providers/anthropic.d.ts +0 -8
  80. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  81. package/packages/pi-ai/dist/providers/anthropic.js +1 -1
  82. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  83. package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
  84. package/packages/pi-ai/dist/providers/azure-openai-responses.js +5 -41
  85. package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
  86. package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts +0 -1
  87. package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -1
  88. package/packages/pi-ai/dist/providers/github-copilot-headers.js +1 -1
  89. package/packages/pi-ai/dist/providers/github-copilot-headers.js.map +1 -1
  90. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts +1 -43
  91. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
  92. package/packages/pi-ai/dist/providers/google-gemini-cli.js +2 -2
  93. package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
  94. package/packages/pi-ai/dist/providers/google-shared.d.ts +0 -4
  95. package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
  96. package/packages/pi-ai/dist/providers/google-shared.js +1 -1
  97. package/packages/pi-ai/dist/providers/google-shared.js.map +1 -1
  98. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  99. package/packages/pi-ai/dist/providers/openai-completions.js +10 -73
  100. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
  101. package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
  102. package/packages/pi-ai/dist/providers/openai-responses.js +9 -80
  103. package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -1
  104. package/packages/pi-ai/dist/providers/openai-shared.d.ts +65 -0
  105. package/packages/pi-ai/dist/providers/openai-shared.d.ts.map +1 -0
  106. package/packages/pi-ai/dist/providers/openai-shared.js +146 -0
  107. package/packages/pi-ai/dist/providers/openai-shared.js.map +1 -0
  108. package/packages/pi-ai/dist/providers/register-builtins.d.ts +0 -1
  109. package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
  110. package/packages/pi-ai/dist/providers/register-builtins.js +1 -1
  111. package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -1
  112. package/packages/pi-ai/dist/utils/event-stream.d.ts +0 -2
  113. package/packages/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  114. package/packages/pi-ai/dist/utils/event-stream.js +0 -4
  115. package/packages/pi-ai/dist/utils/event-stream.js.map +1 -1
  116. package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -1
  117. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +7 -135
  118. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -1
  119. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -1
  120. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +7 -135
  121. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -1
  122. package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.d.ts +46 -0
  123. package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.d.ts.map +1 -0
  124. package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.js +160 -0
  125. package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.js.map +1 -0
  126. package/packages/pi-ai/dist/utils/overflow.d.ts +0 -4
  127. package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  128. package/packages/pi-ai/dist/utils/overflow.js +0 -6
  129. package/packages/pi-ai/dist/utils/overflow.js.map +1 -1
  130. package/packages/pi-ai/dist/utils/validation.d.ts +0 -8
  131. package/packages/pi-ai/dist/utils/validation.d.ts.map +1 -1
  132. package/packages/pi-ai/dist/utils/validation.js +0 -14
  133. package/packages/pi-ai/dist/utils/validation.js.map +1 -1
  134. package/packages/pi-ai/src/api-registry.ts +0 -12
  135. package/packages/pi-ai/src/providers/anthropic.ts +1 -1
  136. package/packages/pi-ai/src/providers/azure-openai-responses.ts +11 -45
  137. package/packages/pi-ai/src/providers/github-copilot-headers.ts +1 -1
  138. package/packages/pi-ai/src/providers/google-gemini-cli.ts +2 -2
  139. package/packages/pi-ai/src/providers/google-shared.ts +1 -1
  140. package/packages/pi-ai/src/providers/openai-completions.ts +16 -86
  141. package/packages/pi-ai/src/providers/openai-responses.ts +16 -96
  142. package/packages/pi-ai/src/providers/openai-shared.ts +193 -0
  143. package/packages/pi-ai/src/providers/register-builtins.ts +1 -1
  144. package/packages/pi-ai/src/utils/event-stream.ts +0 -5
  145. package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +14 -162
  146. package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +13 -161
  147. package/packages/pi-ai/src/utils/oauth/google-oauth-utils.ts +201 -0
  148. package/packages/pi-ai/src/utils/overflow.ts +1 -8
  149. package/packages/pi-ai/src/utils/validation.ts +0 -15
  150. package/packages/pi-coding-agent/dist/config.d.ts +0 -9
  151. package/packages/pi-coding-agent/dist/config.d.ts.map +1 -1
  152. package/packages/pi-coding-agent/dist/config.js +4 -8
  153. package/packages/pi-coding-agent/dist/config.js.map +1 -1
  154. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +16 -63
  155. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  156. package/packages/pi-coding-agent/dist/core/agent-session.js +104 -641
  157. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  158. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +0 -1
  159. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  160. package/packages/pi-coding-agent/dist/core/auth-storage.js +4 -35
  161. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  162. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  163. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js +5 -43
  164. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
  165. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  166. package/packages/pi-coding-agent/dist/core/compaction/compaction.js +11 -69
  167. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  168. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +40 -0
  169. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
  170. package/packages/pi-coding-agent/dist/core/compaction/utils.js +78 -0
  171. package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
  172. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts +77 -0
  173. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts.map +1 -0
  174. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +331 -0
  175. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -0
  176. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts +0 -4
  177. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  178. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js +1 -1
  179. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -1
  180. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +2 -2
  181. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  182. package/packages/pi-coding-agent/dist/core/extensions/index.js +1 -1
  183. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  184. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +15 -5
  185. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  186. package/packages/pi-coding-agent/dist/core/extensions/runner.js +129 -256
  187. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  188. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +49 -42
  189. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  190. package/packages/pi-coding-agent/dist/core/extensions/types.js +2 -21
  191. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  192. package/packages/pi-coding-agent/dist/core/keybindings.d.ts +0 -8
  193. package/packages/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
  194. package/packages/pi-coding-agent/dist/core/keybindings.js +2 -2
  195. package/packages/pi-coding-agent/dist/core/keybindings.js.map +1 -1
  196. package/packages/pi-coding-agent/dist/core/lock-utils.d.ts +39 -0
  197. package/packages/pi-coding-agent/dist/core/lock-utils.d.ts.map +1 -0
  198. package/packages/pi-coding-agent/dist/core/lock-utils.js +89 -0
  199. package/packages/pi-coding-agent/dist/core/lock-utils.js.map +1 -0
  200. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts +0 -17
  201. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -1
  202. package/packages/pi-coding-agent/dist/core/lsp/client.js +3 -62
  203. package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -1
  204. package/packages/pi-coding-agent/dist/core/lsp/config.d.ts +1 -1
  205. package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
  206. package/packages/pi-coding-agent/dist/core/lsp/config.js +2 -6
  207. package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -1
  208. package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts +0 -5
  209. package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts.map +1 -1
  210. package/packages/pi-coding-agent/dist/core/lsp/edits.js +1 -1
  211. package/packages/pi-coding-agent/dist/core/lsp/edits.js.map +1 -1
  212. package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -1
  213. package/packages/pi-coding-agent/dist/core/lsp/index.js +52 -107
  214. package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -1
  215. package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts +0 -1
  216. package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -1
  217. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +3 -22
  218. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -1
  219. package/packages/pi-coding-agent/dist/core/lsp/types.d.ts +0 -1
  220. package/packages/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -1
  221. package/packages/pi-coding-agent/dist/core/lsp/types.js +0 -28
  222. package/packages/pi-coding-agent/dist/core/lsp/types.js.map +1 -1
  223. package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts +1 -6
  224. package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts.map +1 -1
  225. package/packages/pi-coding-agent/dist/core/lsp/utils.js +1 -28
  226. package/packages/pi-coding-agent/dist/core/lsp/utils.js.map +1 -1
  227. package/packages/pi-coding-agent/dist/core/messages.d.ts +0 -8
  228. package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -1
  229. package/packages/pi-coding-agent/dist/core/messages.js +5 -5
  230. package/packages/pi-coding-agent/dist/core/messages.js.map +1 -1
  231. package/packages/pi-coding-agent/dist/core/model-registry.d.ts +0 -3
  232. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  233. package/packages/pi-coding-agent/dist/core/model-registry.js +1 -3
  234. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  235. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts +1 -26
  236. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  237. package/packages/pi-coding-agent/dist/core/model-resolver.js +3 -59
  238. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  239. package/packages/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  240. package/packages/pi-coding-agent/dist/core/package-manager.js +2 -4
  241. package/packages/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  242. package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts +0 -17
  243. package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts.map +1 -1
  244. package/packages/pi-coding-agent/dist/core/prompt-templates.js +2 -2
  245. package/packages/pi-coding-agent/dist/core/prompt-templates.js.map +1 -1
  246. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +2 -4
  247. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  248. package/packages/pi-coding-agent/dist/core/resource-loader.js +46 -60
  249. package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  250. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +87 -0
  251. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -0
  252. package/packages/pi-coding-agent/dist/core/retry-handler.js +295 -0
  253. package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -0
  254. package/packages/pi-coding-agent/dist/core/session-manager.d.ts +0 -5
  255. package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
  256. package/packages/pi-coding-agent/dist/core/session-manager.js +5 -32
  257. package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
  258. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +8 -12
  259. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  260. package/packages/pi-coding-agent/dist/core/settings-manager.js +78 -168
  261. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  262. package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
  263. package/packages/pi-coding-agent/dist/core/skills.js +1 -3
  264. package/packages/pi-coding-agent/dist/core/skills.js.map +1 -1
  265. package/packages/pi-coding-agent/dist/index.d.ts +1 -1
  266. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  267. package/packages/pi-coding-agent/dist/index.js +1 -1
  268. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  269. package/packages/pi-coding-agent/dist/migrations.d.ts +0 -16
  270. package/packages/pi-coding-agent/dist/migrations.d.ts.map +1 -1
  271. package/packages/pi-coding-agent/dist/migrations.js +2 -2
  272. package/packages/pi-coding-agent/dist/migrations.js.map +1 -1
  273. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +0 -2
  274. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  275. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js +2 -2
  276. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  277. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts +1 -1
  278. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  279. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js +9 -26
  280. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -1
  281. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  282. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +1 -13
  283. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  284. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.d.ts +44 -0
  285. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.d.ts.map +1 -0
  286. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.js +61 -0
  287. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.js.map +1 -0
  288. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  289. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +6 -9
  290. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -1
  291. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +1 -24
  292. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  293. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +50 -512
  294. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  295. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts +71 -0
  296. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -0
  297. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +514 -0
  298. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -0
  299. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +65 -4
  300. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  301. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +6 -23
  302. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  303. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts +12 -0
  304. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -0
  305. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +175 -0
  306. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -0
  307. package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.d.ts +6 -0
  308. package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.d.ts.map +1 -0
  309. package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.js +15 -0
  310. package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.js.map +1 -0
  311. package/packages/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
  312. package/packages/pi-coding-agent/dist/modes/print-mode.js +2 -30
  313. package/packages/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
  314. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  315. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +2 -28
  316. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
  317. package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.d.ts +19 -0
  318. package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.d.ts.map +1 -0
  319. package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.js +45 -0
  320. package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.js.map +1 -0
  321. package/packages/pi-coding-agent/dist/utils/changelog.d.ts +0 -4
  322. package/packages/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
  323. package/packages/pi-coding-agent/dist/utils/changelog.js +1 -1
  324. package/packages/pi-coding-agent/dist/utils/changelog.js.map +1 -1
  325. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts +0 -1
  326. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
  327. package/packages/pi-coding-agent/dist/utils/clipboard-image.js +1 -1
  328. package/packages/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -1
  329. package/packages/pi-coding-agent/dist/utils/error.d.ts +5 -0
  330. package/packages/pi-coding-agent/dist/utils/error.d.ts.map +1 -0
  331. package/packages/pi-coding-agent/dist/utils/error.js +7 -0
  332. package/packages/pi-coding-agent/dist/utils/error.js.map +1 -0
  333. package/packages/pi-coding-agent/dist/utils/photon.d.ts +0 -19
  334. package/packages/pi-coding-agent/dist/utils/photon.d.ts.map +1 -1
  335. package/packages/pi-coding-agent/dist/utils/photon.js +1 -120
  336. package/packages/pi-coding-agent/dist/utils/photon.js.map +1 -1
  337. package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts +0 -1
  338. package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts.map +1 -1
  339. package/packages/pi-coding-agent/dist/utils/tools-manager.js +1 -1
  340. package/packages/pi-coding-agent/dist/utils/tools-manager.js.map +1 -1
  341. package/packages/pi-coding-agent/package.json +1 -1
  342. package/packages/pi-coding-agent/src/config.ts +5 -10
  343. package/packages/pi-coding-agent/src/core/agent-session.ts +117 -745
  344. package/packages/pi-coding-agent/src/core/auth-storage.ts +4 -38
  345. package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +7 -53
  346. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +14 -74
  347. package/packages/pi-coding-agent/src/core/compaction/utils.ts +100 -0
  348. package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +424 -0
  349. package/packages/pi-coding-agent/src/core/export-html/ansi-to-html.ts +1 -1
  350. package/packages/pi-coding-agent/src/core/extensions/index.ts +1 -21
  351. package/packages/pi-coding-agent/src/core/extensions/runner.ts +119 -256
  352. package/packages/pi-coding-agent/src/core/extensions/types.ts +50 -69
  353. package/packages/pi-coding-agent/src/core/keybindings.ts +2 -2
  354. package/packages/pi-coding-agent/src/core/lock-utils.ts +113 -0
  355. package/packages/pi-coding-agent/src/core/lsp/client.ts +3 -73
  356. package/packages/pi-coding-agent/src/core/lsp/config.ts +2 -10
  357. package/packages/pi-coding-agent/src/core/lsp/edits.ts +1 -1
  358. package/packages/pi-coding-agent/src/core/lsp/index.ts +83 -152
  359. package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +3 -23
  360. package/packages/pi-coding-agent/src/core/lsp/types.ts +0 -29
  361. package/packages/pi-coding-agent/src/core/lsp/utils.ts +1 -33
  362. package/packages/pi-coding-agent/src/core/messages.ts +5 -5
  363. package/packages/pi-coding-agent/src/core/model-registry.ts +0 -2
  364. package/packages/pi-coding-agent/src/core/model-resolver.ts +3 -77
  365. package/packages/pi-coding-agent/src/core/package-manager.ts +1 -4
  366. package/packages/pi-coding-agent/src/core/prompt-templates.ts +2 -2
  367. package/packages/pi-coding-agent/src/core/resource-loader.ts +56 -69
  368. package/packages/pi-coding-agent/src/core/retry-handler.ts +359 -0
  369. package/packages/pi-coding-agent/src/core/session-manager.ts +5 -34
  370. package/packages/pi-coding-agent/src/core/settings-manager.ts +87 -166
  371. package/packages/pi-coding-agent/src/core/skills.ts +1 -4
  372. package/packages/pi-coding-agent/src/index.ts +1 -7
  373. package/packages/pi-coding-agent/src/migrations.ts +2 -2
  374. package/packages/pi-coding-agent/src/modes/interactive/components/session-selector-search.ts +2 -2
  375. package/packages/pi-coding-agent/src/modes/interactive/components/session-selector.ts +17 -29
  376. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +1 -13
  377. package/packages/pi-coding-agent/src/modes/interactive/components/tree-render-utils.ts +81 -0
  378. package/packages/pi-coding-agent/src/modes/interactive/components/tree-selector.ts +14 -19
  379. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +50 -561
  380. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +653 -0
  381. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +7 -26
  382. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +196 -0
  383. package/packages/pi-coding-agent/src/modes/interactive/utils/shorten-path.ts +14 -0
  384. package/packages/pi-coding-agent/src/modes/print-mode.ts +2 -30
  385. package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +2 -28
  386. package/packages/pi-coding-agent/src/modes/shared/command-context-actions.ts +53 -0
  387. package/packages/pi-coding-agent/src/utils/changelog.ts +1 -1
  388. package/packages/pi-coding-agent/src/utils/clipboard-image.ts +1 -1
  389. package/packages/pi-coding-agent/src/utils/error.ts +6 -0
  390. package/packages/pi-coding-agent/src/utils/photon.ts +0 -137
  391. package/packages/pi-coding-agent/src/utils/tools-manager.ts +1 -1
  392. package/packages/pi-tui/dist/components/editor.d.ts +0 -10
  393. package/packages/pi-tui/dist/components/editor.d.ts.map +1 -1
  394. package/packages/pi-tui/dist/components/editor.js +1 -1
  395. package/packages/pi-tui/dist/components/editor.js.map +1 -1
  396. package/packages/pi-tui/dist/components/markdown.d.ts +5 -0
  397. package/packages/pi-tui/dist/components/markdown.d.ts.map +1 -1
  398. package/packages/pi-tui/dist/components/markdown.js +25 -31
  399. package/packages/pi-tui/dist/components/markdown.js.map +1 -1
  400. package/packages/pi-tui/dist/keys.d.ts +0 -4
  401. package/packages/pi-tui/dist/keys.d.ts.map +1 -1
  402. package/packages/pi-tui/dist/keys.js +94 -162
  403. package/packages/pi-tui/dist/keys.js.map +1 -1
  404. package/packages/pi-tui/dist/overlay-layout.d.ts +55 -0
  405. package/packages/pi-tui/dist/overlay-layout.d.ts.map +1 -0
  406. package/packages/pi-tui/dist/overlay-layout.js +288 -0
  407. package/packages/pi-tui/dist/overlay-layout.js.map +1 -0
  408. package/packages/pi-tui/dist/tui.d.ts +0 -22
  409. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  410. package/packages/pi-tui/dist/tui.js +6 -272
  411. package/packages/pi-tui/dist/tui.js.map +1 -1
  412. package/packages/pi-tui/dist/utils.d.ts +0 -7
  413. package/packages/pi-tui/dist/utils.d.ts.map +1 -1
  414. package/packages/pi-tui/dist/utils.js +0 -44
  415. package/packages/pi-tui/dist/utils.js.map +1 -1
  416. package/packages/pi-tui/src/components/editor.ts +1 -1
  417. package/packages/pi-tui/src/components/markdown.ts +25 -29
  418. package/packages/pi-tui/src/keys.ts +94 -173
  419. package/packages/pi-tui/src/overlay-layout.ts +372 -0
  420. package/packages/pi-tui/src/tui.ts +11 -312
  421. package/packages/pi-tui/src/utils.ts +0 -43
  422. package/pkg/dist/core/export-html/ansi-to-html.d.ts +0 -4
  423. package/pkg/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  424. package/pkg/dist/core/export-html/ansi-to-html.js +1 -1
  425. package/pkg/dist/core/export-html/ansi-to-html.js.map +1 -1
  426. package/pkg/dist/modes/interactive/theme/theme.d.ts +65 -4
  427. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  428. package/pkg/dist/modes/interactive/theme/theme.js +6 -23
  429. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  430. package/pkg/dist/modes/interactive/theme/themes.d.ts +12 -0
  431. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -0
  432. package/pkg/dist/modes/interactive/theme/themes.js +175 -0
  433. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -0
  434. package/pkg/package.json +1 -1
  435. package/src/resources/extensions/async-jobs/await-tool.ts +0 -2
  436. package/src/resources/extensions/async-jobs/job-manager.ts +0 -7
  437. package/src/resources/extensions/bg-shell/output-formatter.ts +0 -17
  438. package/src/resources/extensions/bg-shell/process-manager.ts +0 -4
  439. package/src/resources/extensions/bg-shell/types.ts +0 -12
  440. package/src/resources/extensions/context7/index.ts +7 -0
  441. package/src/resources/extensions/get-secrets-from-user.ts +2 -35
  442. package/src/resources/extensions/google-search/index.ts +7 -0
  443. package/src/resources/extensions/gsd/auto-dispatch.ts +49 -1
  444. package/src/resources/extensions/gsd/auto-loop.ts +22 -2
  445. package/src/resources/extensions/gsd/auto-model-selection.ts +23 -2
  446. package/src/resources/extensions/gsd/auto-recovery.ts +39 -0
  447. package/src/resources/extensions/gsd/auto-start.ts +42 -2
  448. package/src/resources/extensions/gsd/auto.ts +61 -3
  449. package/src/resources/extensions/gsd/changelog.ts +213 -0
  450. package/src/resources/extensions/gsd/commands-bootstrap.ts +1 -0
  451. package/src/resources/extensions/gsd/commands-handlers.ts +2 -2
  452. package/src/resources/extensions/gsd/commands-inspect.ts +10 -3
  453. package/src/resources/extensions/gsd/commands-prefs-wizard.ts +5 -1
  454. package/src/resources/extensions/gsd/commands-rate.ts +55 -0
  455. package/src/resources/extensions/gsd/commands.ts +52 -2
  456. package/src/resources/extensions/gsd/docs/preferences-reference.md +10 -0
  457. package/src/resources/extensions/gsd/doctor-checks.ts +107 -5
  458. package/src/resources/extensions/gsd/doctor-environment.ts +26 -16
  459. package/src/resources/extensions/gsd/doctor-proactive.ts +24 -0
  460. package/src/resources/extensions/gsd/doctor-types.ts +9 -1
  461. package/src/resources/extensions/gsd/doctor.ts +35 -0
  462. package/src/resources/extensions/gsd/files.ts +12 -2
  463. package/src/resources/extensions/gsd/gitignore.ts +54 -7
  464. package/src/resources/extensions/gsd/guided-flow.ts +12 -4
  465. package/src/resources/extensions/gsd/health-widget-core.ts +129 -0
  466. package/src/resources/extensions/gsd/health-widget.ts +103 -59
  467. package/src/resources/extensions/gsd/index.ts +30 -33
  468. package/src/resources/extensions/gsd/migrate-external.ts +47 -2
  469. package/src/resources/extensions/gsd/milestone-ids.ts +3 -2
  470. package/src/resources/extensions/gsd/paths.ts +73 -7
  471. package/src/resources/extensions/gsd/post-unit-hooks.ts +5 -1
  472. package/src/resources/extensions/gsd/preferences-validation.ts +54 -1
  473. package/src/resources/extensions/gsd/preferences.ts +16 -1
  474. package/src/resources/extensions/gsd/prompts/complete-milestone.md +2 -0
  475. package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -0
  476. package/src/resources/extensions/gsd/roadmap-mutations.ts +66 -0
  477. package/src/resources/extensions/gsd/session-lock.ts +59 -2
  478. package/src/resources/extensions/gsd/state.ts +2 -1
  479. package/src/resources/extensions/gsd/templates/plan.md +8 -0
  480. package/src/resources/extensions/gsd/tests/commands-inspect-open-db.test.ts +46 -0
  481. package/src/resources/extensions/gsd/tests/doctor-git.test.ts +98 -2
  482. package/src/resources/extensions/gsd/tests/doctor-runtime.test.ts +59 -3
  483. package/src/resources/extensions/gsd/tests/files-loadfile-eisdir.test.ts +20 -0
  484. package/src/resources/extensions/gsd/tests/gitignore-tracked-gsd.test.ts +214 -0
  485. package/src/resources/extensions/gsd/tests/health-widget.test.ts +158 -0
  486. package/src/resources/extensions/gsd/tests/paths.test.ts +113 -0
  487. package/src/resources/extensions/gsd/tests/preferences.test.ts +40 -2
  488. package/src/resources/extensions/gsd/tests/queue-reorder-e2e.test.ts +26 -0
  489. package/src/resources/extensions/gsd/tests/test-utils.ts +165 -0
  490. package/src/resources/extensions/gsd/tests/validate-directory.test.ts +15 -0
  491. package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +7 -0
  492. package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +32 -0
  493. package/src/resources/extensions/gsd/worktree-resolver.ts +11 -0
  494. package/src/resources/extensions/mcp-client/index.ts +2 -1
  495. package/src/resources/extensions/remote-questions/remote-command.ts +2 -23
  496. package/src/resources/extensions/shared/mod.ts +1 -1
  497. package/src/resources/extensions/shared/sanitize.ts +36 -0
  498. package/src/resources/extensions/subagent/index.ts +6 -12
  499. package/src/resources/skills/create-gsd-extension/references/events-reference.md +4 -4
  500. package/dist/resources/extensions/shared/wizard-ui.js +0 -478
  501. package/packages/pi-coding-agent/dist/modes/interactive/theme/dark.json +0 -85
  502. package/packages/pi-coding-agent/dist/modes/interactive/theme/light.json +0 -84
  503. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -335
  504. package/packages/pi-coding-agent/src/modes/interactive/theme/dark.json +0 -85
  505. package/packages/pi-coding-agent/src/modes/interactive/theme/light.json +0 -84
  506. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.json +0 -335
  507. package/pkg/dist/modes/interactive/theme/dark.json +0 -85
  508. package/pkg/dist/modes/interactive/theme/light.json +0 -84
  509. package/pkg/dist/modes/interactive/theme/theme-schema.json +0 -335
  510. package/src/resources/extensions/shared/wizard-ui.ts +0 -551
@@ -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);
@@ -509,7 +509,8 @@ export async function loadFile(path) {
509
509
  return await fs.readFile(path, 'utf-8');
510
510
  }
511
511
  catch (err) {
512
- if (err.code === 'ENOENT')
512
+ const code = err.code;
513
+ if (code === 'ENOENT' || code === 'EISDIR')
513
514
  return null;
514
515
  throw err;
515
516
  }
@@ -704,7 +705,7 @@ export async function inlinePriorMilestoneSummary(mid, base) {
704
705
  * Returns `null` when no manifest file exists (path resolution failure or
705
706
  * file not on disk) - callers can distinguish "no manifest" from "empty manifest".
706
707
  */
707
- export async function getManifestStatus(base, milestoneId) {
708
+ export async function getManifestStatus(base, milestoneId, projectRoot) {
708
709
  const resolvedPath = resolveMilestoneFile(base, milestoneId, 'SECRETS');
709
710
  if (!resolvedPath)
710
711
  return null;
@@ -713,8 +714,16 @@ export async function getManifestStatus(base, milestoneId) {
713
714
  return null;
714
715
  const manifest = parseSecretsManifest(content);
715
716
  const keys = manifest.entries.map(e => e.key);
717
+ // Check both the base path .env AND the project root .env (#1387).
718
+ // In worktree mode, base is the worktree path which may not have .env.
719
+ // The project root's .env is where the user actually defined their keys.
716
720
  const existingKeys = await checkExistingEnvKeys(keys, resolve(base, '.env'));
717
721
  const existingSet = new Set(existingKeys);
722
+ if (projectRoot && projectRoot !== base) {
723
+ const rootKeys = await checkExistingEnvKeys(keys, resolve(projectRoot, '.env'));
724
+ for (const k of rootKeys)
725
+ existingSet.add(k);
726
+ }
718
727
  const result = {
719
728
  pending: [],
720
729
  collected: [],
@@ -6,8 +6,8 @@
6
6
  * Both idempotent — non-destructive if already present.
7
7
  */
8
8
  import { join } from "node:path";
9
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
10
- import { nativeRmCached } from "./native-git-bridge.js";
9
+ import { existsSync, lstatSync, readFileSync, writeFileSync } from "node:fs";
10
+ import { nativeRmCached, nativeLsFiles } from "./native-git-bridge.js";
11
11
  import { gsdRoot } from "./paths.js";
12
12
  /**
13
13
  * GSD runtime patterns for git index cleanup.
@@ -67,12 +67,48 @@ const BASELINE_PATTERNS = [
67
67
  "tmp/",
68
68
  ];
69
69
  /**
70
- * Ensure basePath/.gitignore contains a blanket `.gsd/` ignore.
71
- * Creates the file if missing; appends `.gsd/` if not present.
70
+ * Check whether `.gsd/` contains files tracked by git.
71
+ * If so, the project intentionally keeps `.gsd/` in version control
72
+ * and we must NOT add `.gsd` to `.gitignore` or attempt migration.
73
+ *
74
+ * Returns true if git tracks at least one file under `.gsd/`.
75
+ * Returns false (safe to ignore) if:
76
+ * - Not a git repo
77
+ * - `.gsd/` is a symlink (external state, should be ignored)
78
+ * - `.gsd/` doesn't exist
79
+ * - No tracked files found under `.gsd/`
80
+ */
81
+ export function hasGitTrackedGsdFiles(basePath) {
82
+ const localGsd = join(basePath, ".gsd");
83
+ // If .gsd doesn't exist or is already a symlink, no tracked files concern
84
+ if (!existsSync(localGsd))
85
+ return false;
86
+ try {
87
+ if (lstatSync(localGsd).isSymbolicLink())
88
+ return false;
89
+ }
90
+ catch {
91
+ return false;
92
+ }
93
+ // Check if git tracks any files under .gsd/
94
+ try {
95
+ const tracked = nativeLsFiles(basePath, ".gsd");
96
+ return tracked.length > 0;
97
+ }
98
+ catch {
99
+ // Not a git repo or git not available — safe to proceed
100
+ return false;
101
+ }
102
+ }
103
+ /**
104
+ * Ensure basePath/.gitignore contains baseline ignore patterns.
105
+ * Creates the file if missing; appends missing patterns.
72
106
  * Returns true if the file was created or modified, false if already complete.
73
107
  *
74
- * `.gsd/` state is managed externally (symlinked to `~/.gsd/projects/<hash>/`),
75
- * so the entire directory is always gitignored.
108
+ * **Safety check:** If `.gsd/` contains git-tracked files (i.e., the project
109
+ * intentionally keeps `.gsd/` in version control), the `.gsd` ignore pattern
110
+ * is excluded to prevent data loss. Only the `.gsd` pattern is affected —
111
+ * all other baseline patterns are still applied normally.
76
112
  */
77
113
  export function ensureGitignore(basePath, options) {
78
114
  // If manage_gitignore is explicitly false, do not touch .gitignore at all
@@ -88,8 +124,14 @@ export function ensureGitignore(basePath, options) {
88
124
  .split("\n")
89
125
  .map((l) => l.trim())
90
126
  .filter((l) => l && !l.startsWith("#")));
127
+ // Determine which patterns to apply. If .gsd/ has tracked files,
128
+ // exclude the ".gsd" pattern to prevent deleting tracked state.
129
+ const gsdIsTracked = hasGitTrackedGsdFiles(basePath);
130
+ const patternsToApply = gsdIsTracked
131
+ ? BASELINE_PATTERNS.filter((p) => p !== ".gsd")
132
+ : BASELINE_PATTERNS;
91
133
  // Find patterns not yet present
92
- const missing = BASELINE_PATTERNS.filter((p) => !existingLines.has(p));
134
+ const missing = patternsToApply.filter((p) => !existingLines.has(p));
93
135
  if (missing.length === 0)
94
136
  return false;
95
137
  // Build the block to append
@@ -111,6 +153,11 @@ export function ensureGitignore(basePath, options) {
111
153
  * already in the index even after .gitignore is updated.
112
154
  *
113
155
  * Only removes from the index (`--cached`), never from disk. Idempotent.
156
+ *
157
+ * Note: These are strictly runtime/ephemeral paths (activity logs, lock files,
158
+ * metrics, STATE.md). They are always safe to untrack, even when the project
159
+ * intentionally keeps other `.gsd/` files (like PROJECT.md, milestones/) in
160
+ * version control.
114
161
  */
115
162
  export function untrackRuntimeFiles(basePath) {
116
163
  const runtimePaths = GSD_RUNTIME_PATTERNS;
@@ -17,6 +17,7 @@ import { resolveExpectedArtifactPath } from "./auto.js";
17
17
  import { gsdRoot, milestonesDir, resolveMilestoneFile, resolveSliceFile, resolveSlicePath, resolveGsdRootFile, relGsdRootFile, relMilestoneFile, relSliceFile, } from "./paths.js";
18
18
  import { join } from "node:path";
19
19
  import { readFileSync, existsSync, mkdirSync, readdirSync, unlinkSync } from "node:fs";
20
+ import { readSessionLockData, isSessionLockProcessAlive } from "./session-lock.js";
20
21
  import { nativeIsRepo, nativeInit } from "./native-git-bridge.js";
21
22
  import { ensureGitignore, ensurePreferences, untrackRuntimeFiles } from "./gitignore.js";
22
23
  import { loadEffectiveGSDPreferences } from "./preferences.js";
@@ -154,7 +155,7 @@ function parseMilestoneSequenceFromProject(content) {
154
155
  * This is the only way the wizard triggers work — everything else is the LLM's job.
155
156
  */
156
157
  function dispatchWorkflow(pi, note, customType = "gsd-run") {
157
- const workflowPath = process.env.GSD_WORKFLOW_PATH ?? join(process.env.HOME ?? "~", ".pi", "GSD-WORKFLOW.md");
158
+ const workflowPath = process.env.GSD_WORKFLOW_PATH ?? join(process.env.HOME ?? "~", ".gsd", "agent", "GSD-WORKFLOW.md");
158
159
  const workflow = readFileSync(workflowPath, "utf-8");
159
160
  pi.sendMessage({
160
161
  customType,
@@ -426,7 +427,12 @@ export async function showDiscuss(ctx, pi, basePath) {
426
427
  // If all pending slices are discussed, notify and exit instead of looping
427
428
  const allDiscussed = pendingSlices.every(s => discussedMap.get(s.id));
428
429
  if (allDiscussed) {
429
- ctx.ui.notify(`All ${pendingSlices.length} slices discussed. Run /gsd to start planning.`, "info");
430
+ const lockData = readSessionLockData(basePath);
431
+ const remoteAutoRunning = lockData && lockData.pid !== process.pid && isSessionLockProcessAlive(lockData);
432
+ const nextStep = remoteAutoRunning
433
+ ? "Auto-mode is already running — use /gsd status to check progress."
434
+ : "Run /gsd to start planning.";
435
+ ctx.ui.notify(`All ${pendingSlices.length} slices discussed. ${nextStep}`, "info");
430
436
  return;
431
437
  }
432
438
  // Find the first undiscussed slice to recommend
@@ -661,9 +667,11 @@ export async function showSmartEntry(ctx, pi, basePath, options) {
661
667
  untrackRuntimeFiles(basePath);
662
668
  // ── Self-heal stale runtime records from crashed auto-mode sessions ──
663
669
  selfHealRuntimeRecords(basePath, ctx);
664
- // Check for crash from previous auto-mode session
670
+ // Check for crash from previous auto-mode session.
671
+ // Skip if the lock was written by the current process — acquireSessionLock()
672
+ // writes to the same file, so we'd always false-positive (#1398).
665
673
  const crashLock = readCrashLock(basePath);
666
- if (crashLock) {
674
+ if (crashLock && crashLock.pid !== process.pid) {
667
675
  clearLock(basePath);
668
676
  // Bootstrap crash with zero completed units = no work was lost.
669
677
  // Auto-discard instead of prompting the user — this commonly happens
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Pure GSD health widget logic.
3
+ *
4
+ * Separates project-state detection and line rendering from the widget's
5
+ * runtime integrations so the regressions can be tested directly.
6
+ */
7
+ import { existsSync, readdirSync } from "node:fs";
8
+ import { gsdRoot } from "./paths.js";
9
+ import { join } from "node:path";
10
+ export function detectHealthWidgetProjectState(basePath) {
11
+ const root = gsdRoot(basePath);
12
+ if (!existsSync(root))
13
+ return "none";
14
+ // Lightweight milestone count — avoids the full detectProjectState() scan
15
+ // (CI markers, Makefile targets, etc.) that is unnecessary on the 60s refresh.
16
+ try {
17
+ const milestonesDir = join(root, "milestones");
18
+ if (existsSync(milestonesDir)) {
19
+ const entries = readdirSync(milestonesDir, { withFileTypes: true });
20
+ if (entries.some(e => e.isDirectory()))
21
+ return "active";
22
+ }
23
+ }
24
+ catch { /* non-fatal */ }
25
+ return "initialized";
26
+ }
27
+ function formatCost(n) {
28
+ return n >= 1 ? `$${n.toFixed(2)}` : `${(n * 100).toFixed(1)}¢`;
29
+ }
30
+ function formatProgress(progress) {
31
+ if (!progress)
32
+ return null;
33
+ const parts = [];
34
+ parts.push(`M ${progress.milestones.done}/${progress.milestones.total}`);
35
+ if (progress.slices)
36
+ parts.push(`S ${progress.slices.done}/${progress.slices.total}`);
37
+ if (progress.tasks)
38
+ parts.push(`T ${progress.tasks.done}/${progress.tasks.total}`);
39
+ return parts.length > 0 ? `Progress: ${parts.join(" · ")}` : null;
40
+ }
41
+ function formatEnvironmentSummary(errorCount, warningCount) {
42
+ if (errorCount <= 0 && warningCount <= 0)
43
+ return null;
44
+ const parts = [];
45
+ if (errorCount > 0)
46
+ parts.push(`${errorCount} error${errorCount > 1 ? "s" : ""}`);
47
+ if (warningCount > 0)
48
+ parts.push(`${warningCount} warning${warningCount > 1 ? "s" : ""}`);
49
+ return `Env: ${parts.join(", ")}`;
50
+ }
51
+ function formatBudgetSummary(data) {
52
+ if (data.budgetCeiling !== undefined && data.budgetCeiling > 0) {
53
+ const pct = Math.min(100, (data.budgetSpent / data.budgetCeiling) * 100);
54
+ return `Budget: ${formatCost(data.budgetSpent)}/${formatCost(data.budgetCeiling)} (${pct.toFixed(0)}%)`;
55
+ }
56
+ if (data.budgetSpent > 0) {
57
+ return `Spent: ${formatCost(data.budgetSpent)}`;
58
+ }
59
+ return null;
60
+ }
61
+ function buildExecutionHeadline(data) {
62
+ const status = data.executionStatus ?? "Active project";
63
+ const target = data.executionTarget ?? data.blocker ?? "loading status…";
64
+ return ` GSD ${status}${target ? ` - ${target}` : ""}`;
65
+ }
66
+ /**
67
+ * Build compact health lines for the widget.
68
+ * Returns a string array suitable for setWidget().
69
+ */
70
+ export function buildHealthLines(data) {
71
+ if (data.projectState === "none") {
72
+ return [" GSD No project loaded — run /gsd to start"];
73
+ }
74
+ if (data.projectState === "initialized") {
75
+ return [" GSD Project initialized — run /gsd to continue setup"];
76
+ }
77
+ const lines = [buildExecutionHeadline(data)];
78
+ const details = [];
79
+ const progress = formatProgress(data.progress);
80
+ if (progress)
81
+ details.push(progress);
82
+ if (data.providerIssue)
83
+ details.push(data.providerIssue);
84
+ const environment = formatEnvironmentSummary(data.environmentErrorCount, data.environmentWarningCount);
85
+ if (environment)
86
+ details.push(environment);
87
+ const budget = formatBudgetSummary(data);
88
+ if (budget)
89
+ details.push(budget);
90
+ if (data.eta)
91
+ details.push(data.eta);
92
+ if (details.length > 0) {
93
+ lines.push(` ${details.join(" │ ")}`);
94
+ }
95
+ return lines;
96
+ }
@@ -11,21 +11,23 @@ import { runProviderChecks, summariseProviderIssues } from "./doctor-providers.j
11
11
  import { runEnvironmentChecks } from "./doctor-environment.js";
12
12
  import { loadEffectiveGSDPreferences } from "./preferences.js";
13
13
  import { loadLedgerFromDisk, getProjectTotals } from "./metrics.js";
14
+ import { describeNextUnit, estimateTimeRemaining, updateSliceProgressCache } from "./auto-dashboard.js";
14
15
  import { projectRoot } from "./commands.js";
16
+ import { deriveState, invalidateStateCache } from "./state.js";
17
+ import { buildHealthLines, detectHealthWidgetProjectState, } from "./health-widget-core.js";
15
18
  // ── Data loader ────────────────────────────────────────────────────────────────
16
- function loadHealthWidgetData(basePath) {
17
- let hasProject = false;
19
+ function loadBaseHealthWidgetData(basePath) {
18
20
  let budgetCeiling;
19
21
  let budgetSpent = 0;
20
22
  let providerIssue = null;
21
23
  let environmentErrorCount = 0;
22
24
  let environmentWarningCount = 0;
25
+ const projectState = detectHealthWidgetProjectState(basePath);
23
26
  try {
24
27
  const prefs = loadEffectiveGSDPreferences();
25
28
  budgetCeiling = prefs?.preferences?.budget_ceiling;
26
29
  const ledger = loadLedgerFromDisk(basePath);
27
30
  if (ledger) {
28
- hasProject = true;
29
31
  const totals = getProjectTotals(ledger.units ?? []);
30
32
  budgetSpent = totals.cost;
31
33
  }
@@ -47,7 +49,7 @@ function loadHealthWidgetData(basePath) {
47
49
  }
48
50
  catch { /* non-fatal */ }
49
51
  return {
50
- hasProject,
52
+ projectState,
51
53
  budgetCeiling,
52
54
  budgetSpent,
53
55
  providerIssue,
@@ -56,50 +58,85 @@ function loadHealthWidgetData(basePath) {
56
58
  lastRefreshed: Date.now(),
57
59
  };
58
60
  }
59
- // ── Rendering ──────────────────────────────────────────────────────────────────
60
- function formatCost(n) {
61
- return n >= 1 ? `$${n.toFixed(2)}` : `${(n * 100).toFixed(1)}¢`;
61
+ function compactText(text, max = 64) {
62
+ const trimmed = text.replace(/\s+/g, " ").trim();
63
+ if (trimmed.length <= max)
64
+ return trimmed;
65
+ return `${trimmed.slice(0, max - 1).trimEnd()}…`;
62
66
  }
63
- /**
64
- * Build compact health lines for the widget.
65
- * Returns a string array suitable for setWidget().
66
- */
67
- export function buildHealthLines(data) {
68
- if (!data.hasProject) {
69
- return [" GSD No project loaded — run /gsd to start"];
70
- }
71
- const parts = [];
72
- // System status signal
73
- const totalIssues = data.environmentErrorCount + data.environmentWarningCount + (data.providerIssue ? 1 : 0);
74
- if (totalIssues === 0) {
75
- parts.push(" System OK");
76
- }
77
- else if (data.environmentErrorCount > 0 || data.providerIssue?.includes("✗")) {
78
- parts.push(`✗ ${totalIssues} issue${totalIssues > 1 ? "s" : ""}`);
79
- }
80
- else {
81
- parts.push(`⚠ ${totalIssues} warning${totalIssues > 1 ? "s" : ""}`);
67
+ function summarizeExecutionStatus(state) {
68
+ switch (state.phase) {
69
+ case "blocked": return "Blocked";
70
+ case "paused": return "Paused";
71
+ case "complete": return "Complete";
72
+ case "executing": return "Executing";
73
+ case "planning": return "Planning";
74
+ case "pre-planning": return "Pre-planning";
75
+ case "summarizing": return "Summarizing";
76
+ case "validating-milestone": return "Validating";
77
+ case "completing-milestone": return "Completing";
78
+ case "needs-discussion": return "Needs discussion";
79
+ case "replanning-slice": return "Replanning";
80
+ default: return "Active";
82
81
  }
83
- // Budget
84
- if (data.budgetCeiling !== undefined && data.budgetCeiling > 0) {
85
- const pct = Math.min(100, (data.budgetSpent / data.budgetCeiling) * 100);
86
- parts.push(`Budget: ${formatCost(data.budgetSpent)}/${formatCost(data.budgetCeiling)} (${pct.toFixed(0)}%)`);
87
- }
88
- else if (data.budgetSpent > 0) {
89
- parts.push(`Spent: ${formatCost(data.budgetSpent)}`);
90
- }
91
- // Provider issue (if any)
92
- if (data.providerIssue) {
93
- parts.push(data.providerIssue);
82
+ }
83
+ function summarizeExecutionTarget(state) {
84
+ switch (state.phase) {
85
+ case "needs-discussion":
86
+ return state.activeMilestone ? `Discuss ${state.activeMilestone.id}` : "Discuss milestone draft";
87
+ case "pre-planning":
88
+ return state.activeMilestone ? `Plan ${state.activeMilestone.id}` : "Research & plan milestone";
89
+ case "planning":
90
+ return state.activeSlice ? `Plan ${state.activeSlice.id}` : "Plan next slice";
91
+ case "executing":
92
+ return state.activeTask ? `Execute ${state.activeTask.id}` : "Execute next task";
93
+ case "summarizing":
94
+ return state.activeSlice ? `Complete ${state.activeSlice.id}` : "Complete current slice";
95
+ case "validating-milestone":
96
+ return state.activeMilestone ? `Validate ${state.activeMilestone.id}` : "Validate milestone";
97
+ case "completing-milestone":
98
+ return state.activeMilestone ? `Complete ${state.activeMilestone.id}` : "Complete milestone";
99
+ case "replanning-slice":
100
+ return state.activeSlice ? `Replan ${state.activeSlice.id}` : "Replan current slice";
101
+ case "blocked":
102
+ return `waiting on ${compactText(state.blockers[0] ?? state.nextAction, 56)}`;
103
+ case "paused":
104
+ return compactText(state.nextAction || "waiting to resume", 56);
105
+ case "complete":
106
+ return "All milestones complete";
107
+ default:
108
+ return compactText(describeNextUnit(state).label, 56);
94
109
  }
95
- // Environment issues
96
- if (data.environmentErrorCount > 0) {
97
- parts.push(`Env: ${data.environmentErrorCount} error${data.environmentErrorCount > 1 ? "s" : ""}`);
110
+ }
111
+ async function enrichHealthWidgetData(basePath, baseData) {
112
+ if (baseData.projectState !== "active")
113
+ return baseData;
114
+ try {
115
+ invalidateStateCache();
116
+ const state = await deriveState(basePath);
117
+ if (state.activeMilestone) {
118
+ // Warm the slice-progress cache so estimateTimeRemaining() has data
119
+ updateSliceProgressCache(basePath, state.activeMilestone.id, state.activeSlice?.id);
120
+ }
121
+ return {
122
+ ...baseData,
123
+ executionPhase: state.phase,
124
+ executionStatus: summarizeExecutionStatus(state),
125
+ executionTarget: summarizeExecutionTarget(state),
126
+ nextAction: state.nextAction,
127
+ blocker: state.blockers[0] ?? null,
128
+ activeMilestoneId: state.activeMilestone?.id,
129
+ activeSliceId: state.activeSlice?.id,
130
+ activeTaskId: state.activeTask?.id,
131
+ progress: state.progress,
132
+ eta: state.phase === "blocked" || state.phase === "paused" || state.phase === "complete"
133
+ ? null
134
+ : estimateTimeRemaining(),
135
+ };
98
136
  }
99
- else if (data.environmentWarningCount > 0) {
100
- parts.push(`Env: ${data.environmentWarningCount} warning${data.environmentWarningCount > 1 ? "s" : ""}`);
137
+ catch {
138
+ return baseData;
101
139
  }
102
- return [` ${parts.join(" │ ")}`];
103
140
  }
104
141
  // ── Widget init ────────────────────────────────────────────────────────────────
105
142
  const REFRESH_INTERVAL_MS = 60_000;
@@ -112,19 +149,33 @@ export function initHealthWidget(ctx) {
112
149
  return;
113
150
  const basePath = projectRoot();
114
151
  // String-array fallback — used in RPC mode (factory is a no-op there)
115
- const initialData = loadHealthWidgetData(basePath);
152
+ const initialData = loadBaseHealthWidgetData(basePath);
116
153
  ctx.ui.setWidget("gsd-health", buildHealthLines(initialData), { placement: "belowEditor" });
117
154
  // Factory-based widget for TUI mode — replaces the string-array above
118
155
  ctx.ui.setWidget("gsd-health", (_tui, _theme) => {
119
156
  let data = initialData;
120
157
  let cachedLines;
121
- const refreshTimer = setInterval(() => {
158
+ let refreshInFlight = false;
159
+ const refresh = async () => {
160
+ if (refreshInFlight)
161
+ return;
162
+ refreshInFlight = true;
122
163
  try {
123
- data = loadHealthWidgetData(basePath);
164
+ const baseData = loadBaseHealthWidgetData(basePath);
165
+ data = await enrichHealthWidgetData(basePath, baseData);
124
166
  cachedLines = undefined;
125
167
  _tui.requestRender();
126
168
  }
127
169
  catch { /* non-fatal */ }
170
+ finally {
171
+ refreshInFlight = false;
172
+ }
173
+ };
174
+ // Fire first enrichment immediately. requestRender() inside is a no-op
175
+ // if the widget has not yet rendered, so this is safe before factory return.
176
+ void refresh();
177
+ const refreshTimer = setInterval(() => {
178
+ void refresh();
128
179
  }, REFRESH_INTERVAL_MS);
129
180
  return {
130
181
  render(_width) {
@@ -46,33 +46,21 @@ import { pauseAutoForProviderError, classifyProviderError } from "./provider-err
46
46
  import { toPosixPath } from "../shared/mod.js";
47
47
  import { isParallelActive, shutdownParallel } from "./parallel-orchestrator.js";
48
48
  import { DEFAULT_BASH_TIMEOUT_SECS } from "./constants.js";
49
- // ── Agent Instructions ────────────────────────────────────────────────────
50
- // Lightweight "always follow" files injected into every GSD agent session.
51
- // Global: ~/.gsd/agent-instructions.md Project: .gsd/agent-instructions.md
52
- // Both are loaded and concatenated (global first, project appends).
53
- function loadAgentInstructions() {
54
- const parts = [];
55
- const globalPath = join(homedir(), ".gsd", "agent-instructions.md");
56
- if (existsSync(globalPath)) {
57
- try {
58
- const content = readFileSync(globalPath, "utf-8").trim();
59
- if (content)
60
- parts.push(content);
61
- }
62
- catch { /* non-fatal — skip unreadable file */ }
63
- }
64
- const projectPath = join(process.cwd(), ".gsd", "agent-instructions.md");
65
- if (existsSync(projectPath)) {
66
- try {
67
- const content = readFileSync(projectPath, "utf-8").trim();
68
- if (content)
69
- parts.push(content);
49
+ // ── Agent Instructions (DEPRECATED) ──────────────────────────────────────
50
+ // agent-instructions.md is deprecated. Use AGENTS.md or CLAUDE.md instead.
51
+ // Pi core natively supports AGENTS.md (with CLAUDE.md fallback) per directory.
52
+ function warnDeprecatedAgentInstructions() {
53
+ const paths = [
54
+ join(homedir(), ".gsd", "agent-instructions.md"),
55
+ join(process.cwd(), ".gsd", "agent-instructions.md"),
56
+ ];
57
+ for (const p of paths) {
58
+ if (existsSync(p)) {
59
+ console.warn(`[GSD] DEPRECATED: ${p} is no longer loaded. ` +
60
+ `Migrate your instructions to AGENTS.md (or CLAUDE.md) in the same directory. ` +
61
+ `See https://github.com/gsd-build/GSD-2/issues/1492`);
70
62
  }
71
- catch { /* non-fatal — skip unreadable file */ }
72
63
  }
73
- if (parts.length === 0)
74
- return null;
75
- return parts.join("\n\n");
76
64
  }
77
65
  // ── Depth verification state ──────────────────────────────────────────────
78
66
  let depthVerificationDone = false;
@@ -140,7 +128,16 @@ export default function (pi) {
140
128
  // Pipe closed — nothing we can write; just exit cleanly
141
129
  process.exit(0);
142
130
  }
143
- // Re-throw anything that isn't EPIPE so real crashes still surface
131
+ if (err.code === "ENOENT" &&
132
+ err.syscall?.startsWith("spawn")) {
133
+ // spawn ENOENT — command not found (e.g., npx on Windows).
134
+ // This surfaces as an uncaught exception from child_process but
135
+ // is not a fatal process error. Log and continue instead of
136
+ // crashing auto-mode (#1384).
137
+ process.stderr.write(`[gsd] spawn ENOENT: ${err.path ?? "unknown"} — command not found\n`);
138
+ return;
139
+ }
140
+ // Re-throw anything that isn't EPIPE/ENOENT so real crashes still surface
144
141
  throw err;
145
142
  };
146
143
  process.on("uncaughtException", _gsdEpipeGuard);
@@ -580,12 +577,8 @@ export default function (pi) {
580
577
  newSkillsBlock = formatSkillsXml(newSkills);
581
578
  }
582
579
  }
583
- // Load agent instructions (global + project)
584
- let agentInstructionsBlock = "";
585
- const agentInstructions = loadAgentInstructions();
586
- if (agentInstructions) {
587
- agentInstructionsBlock = `\n\n## Agent Instructions\n\nThe following instructions were provided by the user and must be followed in every session:\n\n${agentInstructions}`;
588
- }
580
+ // Warn if deprecated agent-instructions.md files are still present
581
+ warnDeprecatedAgentInstructions();
589
582
  const injection = await buildGuidedExecuteContextInjection(event.prompt, process.cwd());
590
583
  // Worktree context — override the static CWD in the system prompt
591
584
  let worktreeBlock = "";
@@ -628,7 +621,7 @@ export default function (pi) {
628
621
  "Write every .gsd artifact in the worktree path above, never in the main project tree.",
629
622
  ].join("\n");
630
623
  }
631
- const fullSystem = `${event.systemPrompt}\n\n[SYSTEM CONTEXT — GSD]\n\n${systemContent}${preferenceBlock}${agentInstructionsBlock}${knowledgeBlock}${memoryBlock}${newSkillsBlock}${worktreeBlock}`;
624
+ const fullSystem = `${event.systemPrompt}\n\n[SYSTEM CONTEXT — GSD]\n\n${systemContent}${preferenceBlock}${knowledgeBlock}${memoryBlock}${newSkillsBlock}${worktreeBlock}`;
632
625
  stopContextTimer({
633
626
  systemPromptSize: fullSystem.length,
634
627
  injectionSize: injection?.length ?? 0,