gsd-pi 2.72.0 → 2.73.0-dev.27730dc

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 (344) hide show
  1. package/README.md +12 -2
  2. package/dist/cli.js +59 -50
  3. package/dist/help-text.js +1 -1
  4. package/dist/onboarding.js +10 -0
  5. package/dist/resources/extensions/async-jobs/await-tool.js +7 -4
  6. package/dist/resources/extensions/async-jobs/job-manager.js +28 -3
  7. package/dist/resources/extensions/claude-code-cli/partial-builder.js +40 -12
  8. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +48 -23
  9. package/dist/resources/extensions/gsd/auto/loop.js +84 -1
  10. package/dist/resources/extensions/gsd/auto-dispatch.js +5 -3
  11. package/dist/resources/extensions/gsd/auto-post-unit.js +6 -0
  12. package/dist/resources/extensions/gsd/auto-prompts.js +9 -6
  13. package/dist/resources/extensions/gsd/auto-recovery.js +11 -0
  14. package/dist/resources/extensions/gsd/auto.js +30 -20
  15. package/dist/resources/extensions/gsd/bootstrap/crash-log.js +31 -0
  16. package/dist/resources/extensions/gsd/bootstrap/register-extension.js +18 -7
  17. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +9 -11
  18. package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -1
  19. package/dist/resources/extensions/gsd/commands-handlers.js +4 -1
  20. package/dist/resources/extensions/gsd/context-injector.js +1 -1
  21. package/dist/resources/extensions/gsd/crash-recovery.js +51 -0
  22. package/dist/resources/extensions/gsd/custom-workflow-engine.js +3 -7
  23. package/dist/resources/extensions/gsd/definition-io.js +15 -0
  24. package/dist/resources/extensions/gsd/dispatch-guard.js +4 -0
  25. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +6 -3
  26. package/dist/resources/extensions/gsd/git-service.js +11 -8
  27. package/dist/resources/extensions/gsd/gitignore.js +12 -6
  28. package/dist/resources/extensions/gsd/gsd-db.js +85 -8
  29. package/dist/resources/extensions/gsd/key-manager.js +2 -0
  30. package/dist/resources/extensions/gsd/milestone-actions.js +19 -1
  31. package/dist/resources/extensions/gsd/preferences-skills.js +2 -34
  32. package/dist/resources/extensions/gsd/preferences-types.js +15 -0
  33. package/dist/resources/extensions/gsd/preferences.js +16 -3
  34. package/dist/resources/extensions/gsd/prompt-loader.js +4 -1
  35. package/dist/resources/extensions/gsd/prompts/discuss.md +122 -13
  36. package/dist/resources/extensions/gsd/prompts/system.md +1 -1
  37. package/dist/resources/extensions/gsd/state.js +21 -1
  38. package/dist/resources/extensions/gsd/workflow-projections.js +7 -0
  39. package/dist/resources/extensions/gsd/worktree-manager.js +30 -3
  40. package/dist/resources/extensions/gsd/write-intercept.js +10 -1
  41. package/dist/resources/extensions/ollama/index.js +4 -5
  42. package/dist/resources/extensions/ollama/ollama-client.js +35 -6
  43. package/dist/resources/extensions/ollama/ollama-discovery.js +32 -6
  44. package/dist/startup-model-validation.js +8 -5
  45. package/dist/web/standalone/.next/BUILD_ID +1 -1
  46. package/dist/web/standalone/.next/app-path-routes-manifest.json +10 -10
  47. package/dist/web/standalone/.next/build-manifest.json +3 -3
  48. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  49. package/dist/web/standalone/.next/required-server-files.json +3 -3
  50. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  51. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  52. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  53. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  54. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  55. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  56. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  57. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  58. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  59. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  60. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  61. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  62. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  63. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  64. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  65. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  66. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  67. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  68. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  69. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  70. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  71. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  72. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  73. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  74. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  75. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  76. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  77. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  78. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  79. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  80. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  81. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  82. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  83. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  84. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  85. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  86. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  87. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  88. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  89. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  90. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  91. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  92. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  93. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  94. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  95. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  96. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  97. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  98. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  99. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  100. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  101. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  102. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  103. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  104. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  105. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  106. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  107. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  108. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  109. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  110. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  111. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  113. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  114. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  115. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  116. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  117. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  118. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  119. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  120. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  121. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  122. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  123. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  124. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  125. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  126. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  127. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
  139. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  141. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  143. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +3 -3
  145. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app/index.html +1 -1
  155. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  156. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  157. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  158. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  159. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  160. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  161. package/dist/web/standalone/.next/server/app/page.js +2 -2
  162. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  163. package/dist/web/standalone/.next/server/app-paths-manifest.json +10 -10
  164. package/dist/web/standalone/.next/server/chunks/2331.js +16 -16
  165. package/dist/web/standalone/.next/server/chunks/4741.js +12 -12
  166. package/dist/web/standalone/.next/server/chunks/5822.js +2 -2
  167. package/dist/web/standalone/.next/server/chunks/63.js +8 -8
  168. package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
  169. package/dist/web/standalone/.next/server/edge-runtime-webpack.js +2 -0
  170. package/dist/web/standalone/.next/server/functions-config-manifest.json +0 -9
  171. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/middleware-manifest.json +29 -2
  173. package/dist/web/standalone/.next/server/middleware.js +4 -12
  174. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  175. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  176. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  177. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  178. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  179. package/dist/web/standalone/.next/server/webpack-runtime.js +1 -1
  180. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  181. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  182. package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
  183. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  184. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  185. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  186. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  187. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  188. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  189. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  190. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  191. package/dist/web/standalone/server.js +1 -1
  192. package/package.json +1 -1
  193. package/packages/pi-ai/dist/env-api-keys.js +1 -0
  194. package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
  195. package/packages/pi-ai/dist/models.custom.d.ts +105 -0
  196. package/packages/pi-ai/dist/models.custom.d.ts.map +1 -1
  197. package/packages/pi-ai/dist/models.custom.js +97 -0
  198. package/packages/pi-ai/dist/models.custom.js.map +1 -1
  199. package/packages/pi-ai/dist/models.generated.d.ts +648 -140
  200. package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
  201. package/packages/pi-ai/dist/models.generated.js +867 -370
  202. package/packages/pi-ai/dist/models.generated.js.map +1 -1
  203. package/packages/pi-ai/dist/models.generated.test.d.ts +2 -0
  204. package/packages/pi-ai/dist/models.generated.test.d.ts.map +1 -0
  205. package/packages/pi-ai/dist/models.generated.test.js +334 -0
  206. package/packages/pi-ai/dist/models.generated.test.js.map +1 -0
  207. package/packages/pi-ai/dist/models.test.js +105 -0
  208. package/packages/pi-ai/dist/models.test.js.map +1 -1
  209. package/packages/pi-ai/dist/types.d.ts +1 -1
  210. package/packages/pi-ai/dist/types.d.ts.map +1 -1
  211. package/packages/pi-ai/dist/types.js.map +1 -1
  212. package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  213. package/packages/pi-ai/dist/utils/oauth/github-copilot.js +5 -1
  214. package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  215. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts +2 -0
  216. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts.map +1 -0
  217. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +57 -0
  218. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -0
  219. package/packages/pi-ai/src/env-api-keys.ts +1 -0
  220. package/packages/pi-ai/src/models.custom.ts +98 -0
  221. package/packages/pi-ai/src/models.generated.test.ts +373 -0
  222. package/packages/pi-ai/src/models.generated.ts +867 -370
  223. package/packages/pi-ai/src/models.test.ts +135 -0
  224. package/packages/pi-ai/src/types.ts +1 -0
  225. package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +71 -0
  226. package/packages/pi-ai/src/utils/oauth/github-copilot.ts +4 -1
  227. package/packages/pi-coding-agent/dist/core/auth-storage.js +1 -1
  228. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  229. package/packages/pi-coding-agent/dist/core/auth-storage.test.js +27 -0
  230. package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
  231. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  232. package/packages/pi-coding-agent/dist/core/model-resolver.js +25 -67
  233. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  234. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  235. package/packages/pi-coding-agent/dist/core/sdk.js +9 -0
  236. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  237. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +36 -0
  238. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.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 +87 -12
  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/controllers/chat-controller.d.ts +1 -0
  243. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  244. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +22 -9
  245. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  246. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.d.ts +2 -0
  247. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.d.ts.map +1 -0
  248. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +63 -0
  249. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -0
  250. package/packages/pi-coding-agent/package.json +1 -1
  251. package/packages/pi-coding-agent/src/core/auth-storage.test.ts +38 -0
  252. package/packages/pi-coding-agent/src/core/auth-storage.ts +1 -1
  253. package/packages/pi-coding-agent/src/core/model-resolver.ts +26 -69
  254. package/packages/pi-coding-agent/src/core/sdk.ts +10 -0
  255. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +72 -0
  256. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +84 -12
  257. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +71 -0
  258. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +23 -9
  259. package/packages/pi-tui/dist/components/__tests__/editor.test.js +12 -0
  260. package/packages/pi-tui/dist/components/__tests__/editor.test.js.map +1 -1
  261. package/packages/pi-tui/dist/components/__tests__/input.test.js +12 -0
  262. package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -1
  263. package/packages/pi-tui/dist/keys.d.ts.map +1 -1
  264. package/packages/pi-tui/dist/keys.js +27 -0
  265. package/packages/pi-tui/dist/keys.js.map +1 -1
  266. package/packages/pi-tui/src/components/__tests__/editor.test.ts +18 -0
  267. package/packages/pi-tui/src/components/__tests__/input.test.ts +18 -0
  268. package/packages/pi-tui/src/keys.ts +32 -0
  269. package/pkg/package.json +1 -1
  270. package/src/resources/extensions/async-jobs/await-tool.test.ts +40 -7
  271. package/src/resources/extensions/async-jobs/await-tool.ts +7 -4
  272. package/src/resources/extensions/async-jobs/job-manager.ts +33 -3
  273. package/src/resources/extensions/claude-code-cli/partial-builder.ts +45 -12
  274. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +49 -24
  275. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +91 -2
  276. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +112 -0
  277. package/src/resources/extensions/gsd/auto/loop.ts +89 -1
  278. package/src/resources/extensions/gsd/auto-dispatch.ts +5 -0
  279. package/src/resources/extensions/gsd/auto-post-unit.ts +7 -0
  280. package/src/resources/extensions/gsd/auto-prompts.ts +9 -3
  281. package/src/resources/extensions/gsd/auto-recovery.ts +10 -0
  282. package/src/resources/extensions/gsd/auto.ts +30 -20
  283. package/src/resources/extensions/gsd/bootstrap/crash-log.ts +32 -0
  284. package/src/resources/extensions/gsd/bootstrap/register-extension.ts +19 -7
  285. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +8 -10
  286. package/src/resources/extensions/gsd/bootstrap/system-context.ts +8 -1
  287. package/src/resources/extensions/gsd/commands-handlers.ts +5 -1
  288. package/src/resources/extensions/gsd/context-injector.ts +1 -1
  289. package/src/resources/extensions/gsd/crash-recovery.ts +59 -0
  290. package/src/resources/extensions/gsd/custom-workflow-engine.ts +4 -8
  291. package/src/resources/extensions/gsd/definition-io.ts +18 -0
  292. package/src/resources/extensions/gsd/dispatch-guard.ts +5 -0
  293. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +6 -3
  294. package/src/resources/extensions/gsd/git-service.ts +11 -8
  295. package/src/resources/extensions/gsd/gitignore.ts +12 -6
  296. package/src/resources/extensions/gsd/gsd-db.ts +106 -8
  297. package/src/resources/extensions/gsd/key-manager.ts +2 -0
  298. package/src/resources/extensions/gsd/milestone-actions.ts +19 -1
  299. package/src/resources/extensions/gsd/preferences-skills.ts +2 -36
  300. package/src/resources/extensions/gsd/preferences-types.ts +16 -0
  301. package/src/resources/extensions/gsd/preferences.ts +19 -6
  302. package/src/resources/extensions/gsd/prompt-loader.ts +6 -1
  303. package/src/resources/extensions/gsd/prompts/discuss.md +122 -13
  304. package/src/resources/extensions/gsd/prompts/system.md +1 -1
  305. package/src/resources/extensions/gsd/state.ts +20 -0
  306. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +27 -0
  307. package/src/resources/extensions/gsd/tests/block-db-writes.test.ts +63 -0
  308. package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +235 -0
  309. package/src/resources/extensions/gsd/tests/definition-io.test.ts +57 -0
  310. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +26 -0
  311. package/src/resources/extensions/gsd/tests/doctor-heal-fixable-warnings.test.ts +14 -0
  312. package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +104 -0
  313. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +165 -5
  314. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +8 -6
  315. package/src/resources/extensions/gsd/tests/key-manager.test.ts +63 -0
  316. package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +54 -0
  317. package/src/resources/extensions/gsd/tests/park-milestone.test.ts +64 -0
  318. package/src/resources/extensions/gsd/tests/plan-milestone-artifact-verification.test.ts +62 -0
  319. package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +34 -0
  320. package/src/resources/extensions/gsd/tests/preferences-formatting.test.ts +87 -0
  321. package/src/resources/extensions/gsd/tests/preferences.test.ts +53 -0
  322. package/src/resources/extensions/gsd/tests/projection-regression.test.ts +96 -1
  323. package/src/resources/extensions/gsd/tests/prompt-loader-working-directory.test.ts +19 -0
  324. package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +97 -0
  325. package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +41 -0
  326. package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +267 -0
  327. package/src/resources/extensions/gsd/workflow-projections.ts +8 -0
  328. package/src/resources/extensions/gsd/worktree-manager.ts +29 -3
  329. package/src/resources/extensions/gsd/write-intercept.ts +10 -1
  330. package/src/resources/extensions/ollama/index.ts +4 -5
  331. package/src/resources/extensions/ollama/ollama-client.ts +35 -6
  332. package/src/resources/extensions/ollama/ollama-discovery.ts +37 -6
  333. package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +54 -0
  334. package/dist/resources/extensions/gsd/auto-observability.js +0 -54
  335. package/dist/resources/extensions/gsd/file-watcher.js +0 -80
  336. package/dist/resources/extensions/gsd/rtk-status.js +0 -43
  337. package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
  338. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  339. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  340. package/src/resources/extensions/gsd/auto-observability.ts +0 -72
  341. package/src/resources/extensions/gsd/file-watcher.ts +0 -100
  342. package/src/resources/extensions/gsd/rtk-status.ts +0 -53
  343. /package/dist/web/standalone/.next/static/{Y0I7CjXJl-tWoV__KidV4 → jNiH700EcljeLnbQ2_RCv}/_buildManifest.js +0 -0
  344. /package/dist/web/standalone/.next/static/{Y0I7CjXJl-tWoV__KidV4 → jNiH700EcljeLnbQ2_RCv}/_ssgManifest.js +0 -0
@@ -51,6 +51,60 @@ function str(value: unknown): string | null {
51
51
  return null; // Invalid type
52
52
  }
53
53
 
54
+ /**
55
+ * Split a Claude Code MCP tool name (`mcp__<server>__<tool>`) into its parts.
56
+ * Returns null for non-prefixed names. Duplicated from the claude-code-cli
57
+ * extension (parseMcpToolName) so this package doesn't have to import across
58
+ * the resources/extensions boundary.
59
+ */
60
+ function parseMcpToolName(name: string): { server: string; tool: string } | null {
61
+ if (!name.startsWith("mcp__")) return null;
62
+ const rest = name.slice("mcp__".length);
63
+ const delim = rest.indexOf("__");
64
+ if (delim <= 0 || delim === rest.length - 2) return null;
65
+ return { server: rest.slice(0, delim), tool: rest.slice(delim + 2) };
66
+ }
67
+
68
+ const COMPACT_ARG_VALUE_LIMIT = 60;
69
+ const GENERIC_OUTPUT_PREVIEW_LINES = 10;
70
+ const GENERIC_ARGS_JSON_PREVIEW_LINES = 10;
71
+
72
+ /**
73
+ * Format tool args for the generic-renderer fallback. Produces a one-line
74
+ * `k=v, k=v` summary when every value is a primitive that fits inline; falls
75
+ * back to a truncated JSON dump for structurally complex args.
76
+ */
77
+ function formatCompactArgs(args: unknown, expanded: boolean): string {
78
+ if (args == null) return "";
79
+ if (typeof args !== "object") return String(args);
80
+
81
+ const entries = Object.entries(args as Record<string, unknown>);
82
+ if (entries.length === 0) return "";
83
+
84
+ const allPrimitive = entries.every(([, value]) => {
85
+ const t = typeof value;
86
+ if (t === "number" || t === "boolean") return true;
87
+ if (t === "string") return (value as string).length <= COMPACT_ARG_VALUE_LIMIT;
88
+ return value == null;
89
+ });
90
+
91
+ if (allPrimitive) {
92
+ return entries
93
+ .map(([key, value]) => {
94
+ if (typeof value === "string") return `${key}=${JSON.stringify(value)}`;
95
+ if (value == null) return `${key}=null`;
96
+ return `${key}=${String(value)}`;
97
+ })
98
+ .join(", ");
99
+ }
100
+
101
+ // Complex args: show truncated JSON.
102
+ const lines = JSON.stringify(args, null, 2).split("\n");
103
+ const maxLines = expanded ? lines.length : GENERIC_ARGS_JSON_PREVIEW_LINES;
104
+ if (lines.length <= maxLines) return lines.join("\n");
105
+ return lines.slice(0, maxLines).join("\n") + "\n...";
106
+ }
107
+
54
108
  export interface ToolExecutionOptions {
55
109
  showImages?: boolean; // default: true (only used if terminal supports images)
56
110
  }
@@ -990,19 +1044,37 @@ export class ToolExecutionComponent extends Container {
990
1044
  }
991
1045
  }
992
1046
  } else {
993
- // Generic tool (shouldn't reach here for custom tools)
994
- text = theme.fg("toolTitle", theme.bold(this.toolName));
995
-
996
- const contentLines = JSON.stringify(this.args, null, 2).split("\n");
997
- const maxContentLines = 20;
998
- const truncatedContent = contentLines.slice(0, maxContentLines);
999
- if (contentLines.length > maxContentLines) {
1000
- truncatedContent.push("...");
1047
+ // Generic tool / MCP tool without a registered renderer.
1048
+ // MCP tool names from Claude Code arrive as `mcp__<server>__<tool>`;
1049
+ // render the server prefix in muted style so the tool name reads
1050
+ // cleanly. GSD-registered MCP tools have already had their prefix
1051
+ // stripped upstream in partial-builder.ts and won't reach this branch.
1052
+ const parsed = parseMcpToolName(this.toolName);
1053
+ const displayName = parsed ? parsed.tool : this.toolName;
1054
+ const serverPrefix = parsed ? theme.fg("muted", `${parsed.server}\u00b7`) : "";
1055
+ text = serverPrefix + theme.fg("toolTitle", theme.bold(displayName));
1056
+
1057
+ const argsText = formatCompactArgs(this.args, this.expanded);
1058
+ if (argsText) {
1059
+ if (argsText.includes("\n")) {
1060
+ text += `\n\n${theme.fg("toolOutput", argsText)}`;
1061
+ } else {
1062
+ text += " " + theme.fg("toolOutput", argsText);
1063
+ }
1001
1064
  }
1002
- text += `\n\n${truncatedContent.join("\n")}`;
1003
- const output = this.getTextOutput();
1004
- if (output) {
1005
- text += `\n${output}`;
1065
+
1066
+ if (this.result) {
1067
+ const output = this.getTextOutput().trim();
1068
+ if (output) {
1069
+ const lines = output.split("\n");
1070
+ const maxLines = this.expanded ? lines.length : GENERIC_OUTPUT_PREVIEW_LINES;
1071
+ const displayLines = lines.slice(0, maxLines);
1072
+ const remaining = lines.length - maxLines;
1073
+ text += `\n\n${displayLines.map((line: string) => theme.fg("toolOutput", line)).join("\n")}`;
1074
+ if (remaining > 0) {
1075
+ text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
1076
+ }
1077
+ }
1006
1078
  }
1007
1079
  }
1008
1080
 
@@ -0,0 +1,71 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import { findLatestPinnableText } from "./chat-controller.js";
5
+
6
+ test("findLatestPinnableText: empty content returns empty string", () => {
7
+ assert.equal(findLatestPinnableText([]), "");
8
+ });
9
+
10
+ test("findLatestPinnableText: no tool calls returns empty string", () => {
11
+ const blocks = [
12
+ { type: "text", text: "hello" },
13
+ { type: "text", text: "world" },
14
+ ];
15
+ assert.equal(findLatestPinnableText(blocks), "");
16
+ });
17
+
18
+ test("findLatestPinnableText: returns text preceding a tool call", () => {
19
+ const blocks = [
20
+ { type: "text", text: "doing the thing" },
21
+ { type: "toolCall", id: "1", name: "Read" },
22
+ ];
23
+ assert.equal(findLatestPinnableText(blocks), "doing the thing");
24
+ });
25
+
26
+ test("findLatestPinnableText: ignores trailing streaming text after the last tool call (regression: pinned mirror duplicated chat-container tokens)", () => {
27
+ const blocks = [
28
+ { type: "text", text: "first prose" },
29
+ { type: "toolCall", id: "1", name: "Read" },
30
+ { type: "text", text: "second prose still streaming" },
31
+ ];
32
+ assert.equal(findLatestPinnableText(blocks), "first prose");
33
+ });
34
+
35
+ test("findLatestPinnableText: with multiple tools, picks text before the most recent tool call", () => {
36
+ const blocks = [
37
+ { type: "text", text: "first" },
38
+ { type: "toolCall", id: "1", name: "Read" },
39
+ { type: "text", text: "second" },
40
+ { type: "toolCall", id: "2", name: "Grep" },
41
+ { type: "text", text: "third streaming" },
42
+ ];
43
+ assert.equal(findLatestPinnableText(blocks), "second");
44
+ });
45
+
46
+ test("findLatestPinnableText: treats serverToolUse the same as toolCall", () => {
47
+ const blocks = [
48
+ { type: "text", text: "before web search" },
49
+ { type: "serverToolUse", id: "ws1", name: "web_search" },
50
+ { type: "text", text: "answer streaming" },
51
+ ];
52
+ assert.equal(findLatestPinnableText(blocks), "before web search");
53
+ });
54
+
55
+ test("findLatestPinnableText: skips empty/whitespace-only text blocks", () => {
56
+ const blocks = [
57
+ { type: "text", text: "real prose" },
58
+ { type: "text", text: " " },
59
+ { type: "text", text: "" },
60
+ { type: "toolCall", id: "1", name: "Read" },
61
+ ];
62
+ assert.equal(findLatestPinnableText(blocks), "real prose");
63
+ });
64
+
65
+ test("findLatestPinnableText: thinking blocks are not pinnable", () => {
66
+ const blocks = [
67
+ { type: "thinking", thinking: "internal" },
68
+ { type: "toolCall", id: "1", name: "Read" },
69
+ ];
70
+ assert.equal(findLatestPinnableText(blocks), "");
71
+ });
@@ -22,6 +22,28 @@ function hasAssistantToolBlocks(message: { content: Array<any> }): boolean {
22
22
  return message.content.some((c) => c.type === "toolCall" || c.type === "serverToolUse");
23
23
  }
24
24
 
25
+ // Pick the latest non-empty text block that appears strictly before the most
26
+ // recent tool call. Text blocks that come after the last tool call are still
27
+ // streaming live into the chat container, so mirroring them into the pinned
28
+ // "Latest Output" zone would render the same tokens twice.
29
+ export function findLatestPinnableText(contentBlocks: Array<any>): string {
30
+ let lastToolIdx = -1;
31
+ for (let i = contentBlocks.length - 1; i >= 0; i--) {
32
+ const c = contentBlocks[i];
33
+ if (c?.type === "toolCall" || c?.type === "serverToolUse") {
34
+ lastToolIdx = i;
35
+ break;
36
+ }
37
+ }
38
+ for (let i = lastToolIdx - 1; i >= 0; i--) {
39
+ const c = contentBlocks[i];
40
+ if (c?.type === "text" && typeof c.text === "string" && c.text.trim()) {
41
+ return c.text.trim();
42
+ }
43
+ }
44
+ return "";
45
+ }
46
+
25
47
  // Tracks the latest assistant text for the pinned message zone
26
48
  let lastPinnedText = "";
27
49
  // Whether any tool execution has been added in this assistant turn (triggers pinned display)
@@ -286,15 +308,7 @@ export async function handleAgentEvent(host: InteractiveModeStateHost & {
286
308
  if (hasTools) hasToolsInTurn = true;
287
309
 
288
310
  if (hasToolsInTurn) {
289
- // Collect the latest text block(s) from the assistant message
290
- let latestText = "";
291
- for (let i = contentBlocks.length - 1; i >= 0; i--) {
292
- const c = contentBlocks[i] as any;
293
- if (c.type === "text" && c.text?.trim()) {
294
- latestText = c.text.trim();
295
- break;
296
- }
297
- }
311
+ const latestText = findLatestPinnableText(contentBlocks);
298
312
 
299
313
  if (latestText && latestText !== lastPinnedText) {
300
314
  lastPinnedText = latestText;
@@ -50,5 +50,17 @@ describe("Editor", () => {
50
50
  const rendered = editor.render(40).join("\n");
51
51
  assert.ok(rendered.includes(CURSOR_MARKER));
52
52
  });
53
+ it("maps kitty keypad digits to plain editor text", () => {
54
+ const editor = new Editor(new TUI(makeTerminal()), theme);
55
+ editor.focused = true;
56
+ editor.handleInput("\x1b[57404;129u");
57
+ assert.equal(editor.getText(), "5");
58
+ });
59
+ it("does not insert kitty keypad navigation private-use glyphs into the editor", () => {
60
+ const editor = new Editor(new TUI(makeTerminal()), theme);
61
+ editor.focused = true;
62
+ editor.handleInput("\x1b[57419u");
63
+ assert.equal(editor.getText(), "");
64
+ });
53
65
  });
54
66
  //# sourceMappingURL=editor.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor.test.js","sourceRoot":"","sources":["../../../src/components/__tests__/editor.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAoB,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGlD,SAAS,YAAY;IACpB,OAAO;QACN,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,EAAE;QACR,mBAAmB,EAAE,KAAK;QAC1B,KAAK,KAAI,CAAC;QACV,IAAI,KAAI,CAAC;QACT,UAAU,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;QAC1B,KAAK,KAAI,CAAC;QACV,MAAM,KAAI,CAAC;QACX,UAAU,KAAI,CAAC;QACf,UAAU,KAAI,CAAC;QACf,SAAS,KAAI,CAAC;QACd,eAAe,KAAI,CAAC;QACpB,WAAW,KAAI,CAAC;QAChB,QAAQ,KAAI,CAAC;KACb,CAAC;AACH,CAAC;AAED,MAAM,KAAK,G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AAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAExD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE9C,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import assert from \"node:assert/strict\";\nimport { describe, it } from \"node:test\";\n\nimport { Editor, type EditorTheme } from \"../editor.js\";\nimport { CURSOR_MARKER, TUI } from \"../../tui.js\";\nimport type { Terminal } from \"../../terminal.js\";\n\nfunction makeTerminal(): Terminal {\n\treturn {\n\t\tisTTY: true,\n\t\tcolumns: 80,\n\t\trows: 24,\n\t\tkittyProtocolActive: false,\n\t\tstart() {},\n\t\tstop() {},\n\t\tdrainInput: async () => {},\n\t\twrite() {},\n\t\tmoveBy() {},\n\t\thideCursor() {},\n\t\tshowCursor() {},\n\t\tclearLine() {},\n\t\tclearFromCursor() {},\n\t\tclearScreen() {},\n\t\tsetTitle() {},\n\t};\n}\n\nconst theme: EditorTheme = {\n\tborderColor: (text) => text,\n\tselectList: {\n\t\tselectedPrefix: (text) => text,\n\t\tselectedText: (text) => text,\n\t\tdescription: (text) => text,\n\t\tscrollInfo: (text) => text,\n\t\tnoMatch: (text) => text,\n\t},\n};\n\ndescribe(\"Editor\", () => {\n\tit(\"clears bracketed paste state when focus is lost\", () => {\n\t\tconst editor = new Editor(new TUI(makeTerminal()), theme);\n\t\teditor.focused = true;\n\n\t\teditor.handleInput(\"\\x1b[200~partial\");\n\t\teditor.focused = false;\n\t\teditor.focused = true;\n\t\teditor.handleInput(\"hello\");\n\n\t\tassert.equal(editor.getText(), \"hello\");\n\t});\n\n\tit(\"keeps the hardware cursor marker visible while autocomplete is open\", () => {\n\t\tconst editor = new Editor(new TUI(makeTerminal()), theme);\n\t\teditor.focused = true;\n\t\teditor.setText(\"/se\");\n\n\t\t(editor as any).autocompleteState = \"regular\";\n\t\t(editor as any).autocompleteList = { render: () => [] };\n\n\t\tconst rendered = editor.render(40).join(\"\\n\");\n\n\t\tassert.ok(rendered.includes(CURSOR_MARKER));\n\t});\n});\n"]}
1
+ {"version":3,"file":"editor.test.js","sourceRoot":"","sources":["../../../src/components/__tests__/editor.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAoB,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGlD,SAAS,YAAY;IACpB,OAAO;QACN,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,EAAE;QACR,mBAAmB,EAAE,KAAK;QAC1B,KAAK,KAAI,CAAC;QACV,IAAI,KAAI,CAAC;QACT,UAAU,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;QAC1B,KAAK,KAAI,CAAC;QACV,MAAM,KAAI,CAAC;QACX,UAAU,KAAI,CAAC;QACf,UAAU,KAAI,CAAC;QACf,SAAS,KAAI,CAAC;QACd,eAAe,KAAI,CAAC;QACpB,WAAW,KAAI,CAAC;QAChB,QAAQ,KAAI,CAAC;KACb,CAAC;AACH,CAAC;AAED,MAAM,KAAK,GAAgB;IAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;IAC3B,UAAU,EAAE;QACX,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;QAC9B,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;QAC5B,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;QAC3B,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;QAC1B,OAAO,EAAE,CAAC,IAAI,EAAE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G,CAAC,YAAY,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QAC1D,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QAEtB,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAEtC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;QACrF,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QAC1D,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QAEtB,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAElC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import assert from \"node:assert/strict\";\nimport { describe, it } from \"node:test\";\n\nimport { Editor, type EditorTheme } from \"../editor.js\";\nimport { CURSOR_MARKER, TUI } from \"../../tui.js\";\nimport type { Terminal } from \"../../terminal.js\";\n\nfunction makeTerminal(): Terminal {\n\treturn {\n\t\tisTTY: true,\n\t\tcolumns: 80,\n\t\trows: 24,\n\t\tkittyProtocolActive: false,\n\t\tstart() {},\n\t\tstop() {},\n\t\tdrainInput: async () => {},\n\t\twrite() {},\n\t\tmoveBy() {},\n\t\thideCursor() {},\n\t\tshowCursor() {},\n\t\tclearLine() {},\n\t\tclearFromCursor() {},\n\t\tclearScreen() {},\n\t\tsetTitle() {},\n\t};\n}\n\nconst theme: EditorTheme = {\n\tborderColor: (text) => text,\n\tselectList: {\n\t\tselectedPrefix: (text) => text,\n\t\tselectedText: (text) => text,\n\t\tdescription: (text) => text,\n\t\tscrollInfo: (text) => text,\n\t\tnoMatch: (text) => text,\n\t},\n};\n\ndescribe(\"Editor\", () => {\n\tit(\"clears bracketed paste state when focus is lost\", () => {\n\t\tconst editor = new Editor(new TUI(makeTerminal()), theme);\n\t\teditor.focused = true;\n\n\t\teditor.handleInput(\"\\x1b[200~partial\");\n\t\teditor.focused = false;\n\t\teditor.focused = true;\n\t\teditor.handleInput(\"hello\");\n\n\t\tassert.equal(editor.getText(), \"hello\");\n\t});\n\n\tit(\"keeps the hardware cursor marker visible while autocomplete is open\", () => {\n\t\tconst editor = new Editor(new TUI(makeTerminal()), theme);\n\t\teditor.focused = true;\n\t\teditor.setText(\"/se\");\n\n\t\t(editor as any).autocompleteState = \"regular\";\n\t\t(editor as any).autocompleteList = { render: () => [] };\n\n\t\tconst rendered = editor.render(40).join(\"\\n\");\n\n\t\tassert.ok(rendered.includes(CURSOR_MARKER));\n\t});\n\n\tit(\"maps kitty keypad digits to plain editor text\", () => {\n\t\tconst editor = new Editor(new TUI(makeTerminal()), theme);\n\t\teditor.focused = true;\n\n\t\teditor.handleInput(\"\\x1b[57404;129u\");\n\n\t\tassert.equal(editor.getText(), \"5\");\n\t});\n\n\tit(\"does not insert kitty keypad navigation private-use glyphs into the editor\", () => {\n\t\tconst editor = new Editor(new TUI(makeTerminal()), theme);\n\t\teditor.focused = true;\n\n\t\teditor.handleInput(\"\\x1b[57419u\");\n\n\t\tassert.equal(editor.getText(), \"\");\n\t});\n});\n"]}
@@ -34,5 +34,17 @@ describe("Input", () => {
34
34
  assert.ok(!line.includes("secret123"), "rendered line must not expose raw secret text");
35
35
  assert.ok(line.includes("*********"), "rendered line should include masked characters");
36
36
  });
37
+ it("maps kitty keypad digits to text instead of inserting private-use glyphs", () => {
38
+ const input = new Input();
39
+ input.focused = true;
40
+ input.handleInput("\x1b[57400;129u");
41
+ assert.equal(input.getValue(), "1");
42
+ });
43
+ it("ignores kitty keypad navigation keys in text input", () => {
44
+ const input = new Input();
45
+ input.focused = true;
46
+ input.handleInput("\x1b[57417u");
47
+ assert.equal(input.getValue(), "");
48
+ });
37
49
  });
38
50
  //# sourceMappingURL=input.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.test.js","sourceRoot":"","sources":["../../../src/components/__tests__/input.test.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,4DAA4D;AAE5D,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACrD,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QAC1B,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QAErB,yDAAyD;QACzD,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;QAEtC,2BAA2B;QAC3B,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;QAEtB,mDAAmD;QACnD,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QAErB,iEAAiE;QACjE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAChD,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACnC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACrB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAClC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;QACtB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QACjE,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QAC1B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACrB,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE/B,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACvC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,+CAA+C,CAAC,CAAC;QACxF,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,gDAAgD,CAAC,CAAC;IACzF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// pi-tui Input component regression tests\n// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>\n\nimport { describe, it } from \"node:test\";\nimport assert from \"node:assert/strict\";\nimport { Input } from \"../input.js\";\n\ndescribe(\"Input\", () => {\n\tit(\"paste buffer is cleared when focus is lost\", () => {\n\t\tconst input = new Input();\n\t\tinput.focused = true;\n\n\t\t// Simulate starting a paste (bracket paste start marker)\n\t\tinput.handleInput(\"\\x1b[200~partial\");\n\n\t\t// Now lose focus mid-paste\n\t\tinput.focused = false;\n\n\t\t// Regain focus — should not have stale paste state\n\t\tinput.focused = true;\n\n\t\t// Typing normal text should work without paste buffer corruption\n\t\tinput.handleInput(\"hello\");\n\t\tassert.equal(input.getValue(), \"hello\");\n\t});\n\n\tit(\"focused getter/setter works correctly\", () => {\n\t\tconst input = new Input();\n\t\tassert.equal(input.focused, false);\n\t\tinput.focused = true;\n\t\tassert.equal(input.focused, true);\n\t\tinput.focused = false;\n\t\tassert.equal(input.focused, false);\n\t});\n\n\tit(\"secure mode obscures typed characters in render output\", () => {\n\t\tconst input = new Input();\n\t\tinput.secure = true;\n\t\tinput.focused = true;\n\t\tinput.handleInput(\"secret123\");\n\n\t\tconst line = input.render(40)[0] ?? \"\";\n\t\tassert.ok(!line.includes(\"secret123\"), \"rendered line must not expose raw secret text\");\n\t\tassert.ok(line.includes(\"*********\"), \"rendered line should include masked characters\");\n\t});\n});\n"]}
1
+ {"version":3,"file":"input.test.js","sourceRoot":"","sources":["../../../src/components/__tests__/input.test.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,4DAA4D;AAE5D,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACrD,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QAC1B,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QAErB,yDAAyD;QACzD,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;QAEtC,2BAA2B;QAC3B,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;QAEtB,mDAAmD;QACnD,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QAErB,iEAAiE;QACjE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAChD,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACnC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;Q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,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// pi-tui Input component regression tests\n// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>\n\nimport { describe, it } from \"node:test\";\nimport assert from \"node:assert/strict\";\nimport { Input } from \"../input.js\";\n\ndescribe(\"Input\", () => {\n\tit(\"paste buffer is cleared when focus is lost\", () => {\n\t\tconst input = new Input();\n\t\tinput.focused = true;\n\n\t\t// Simulate starting a paste (bracket paste start marker)\n\t\tinput.handleInput(\"\\x1b[200~partial\");\n\n\t\t// Now lose focus mid-paste\n\t\tinput.focused = false;\n\n\t\t// Regain focus — should not have stale paste state\n\t\tinput.focused = true;\n\n\t\t// Typing normal text should work without paste buffer corruption\n\t\tinput.handleInput(\"hello\");\n\t\tassert.equal(input.getValue(), \"hello\");\n\t});\n\n\tit(\"focused getter/setter works correctly\", () => {\n\t\tconst input = new Input();\n\t\tassert.equal(input.focused, false);\n\t\tinput.focused = true;\n\t\tassert.equal(input.focused, true);\n\t\tinput.focused = false;\n\t\tassert.equal(input.focused, false);\n\t});\n\n\tit(\"secure mode obscures typed characters in render output\", () => {\n\t\tconst input = new Input();\n\t\tinput.secure = true;\n\t\tinput.focused = true;\n\t\tinput.handleInput(\"secret123\");\n\n\t\tconst line = input.render(40)[0] ?? \"\";\n\t\tassert.ok(!line.includes(\"secret123\"), \"rendered line must not expose raw secret text\");\n\t\tassert.ok(line.includes(\"*********\"), \"rendered line should include masked characters\");\n\t});\n\n\tit(\"maps kitty keypad digits to text instead of inserting private-use glyphs\", () => {\n\t\tconst input = new Input();\n\t\tinput.focused = true;\n\n\t\tinput.handleInput(\"\\x1b[57400;129u\");\n\n\t\tassert.equal(input.getValue(), \"1\");\n\t});\n\n\tit(\"ignores kitty keypad navigation keys in text input\", () => {\n\t\tconst input = new Input();\n\t\tinput.focused = true;\n\n\t\tinput.handleInput(\"\\x1b[57417u\");\n\n\t\tassert.equal(input.getValue(), \"\");\n\t});\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAE5D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAMD,KAAK,MAAM,GACR,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;AAEP,KAAK,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEvE,KAAK,SAAS,GACX,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;AAEP,KAAK,UAAU,GACZ,QAAQ,GACR,KAAK,GACL,OAAO,GACP,QAAQ,GACR,KAAK,GACL,OAAO,GACP,WAAW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AI,EAAE,MAAM,GAAG,OAAO,CAEjD;AA2LD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAuV9D;AA2CD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA0EzD;AASD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA0CrE"}
@@ -171,6 +171,26 @@ const CODEPOINTS = {
171
171
  backspace: 127,
172
172
  kpEnter: 57414, // Numpad Enter (Kitty protocol)
173
173
  };
174
+ const KITTY_PRIVATE_USE_RANGE = { start: 57344, end: 63743 };
175
+ const KITTY_KEYPAD_PRINTABLES = new Map([
176
+ [57399, "0"], // KP_0
177
+ [57400, "1"], // KP_1
178
+ [57401, "2"], // KP_2
179
+ [57402, "3"], // KP_3
180
+ [57403, "4"], // KP_4
181
+ [57404, "5"], // KP_5
182
+ [57405, "6"], // KP_6
183
+ [57406, "7"], // KP_7
184
+ [57407, "8"], // KP_8
185
+ [57408, "9"], // KP_9
186
+ [57409, "."], // KP_DECIMAL
187
+ [57410, "/"], // KP_DIVIDE
188
+ [57411, "*"], // KP_MULTIPLY
189
+ [57412, "-"], // KP_SUBTRACT
190
+ [57413, "+"], // KP_ADD
191
+ [57415, "="], // KP_EQUAL
192
+ [57416, ","], // KP_SEPARATOR
193
+ ]);
174
194
  const ARROW_CODEPOINTS = {
175
195
  up: -1,
176
196
  down: -2,
@@ -968,6 +988,13 @@ export function decodeKittyPrintable(data) {
968
988
  // Drop control characters or invalid codepoints.
969
989
  if (!Number.isFinite(effectiveCodepoint) || effectiveCodepoint < 32)
970
990
  return undefined;
991
+ const keypadPrintable = KITTY_KEYPAD_PRINTABLES.get(effectiveCodepoint);
992
+ if (keypadPrintable !== undefined)
993
+ return keypadPrintable;
994
+ if (effectiveCodepoint >= KITTY_PRIVATE_USE_RANGE.start &&
995
+ effectiveCodepoint <= KITTY_PRIVATE_USE_RANGE.end) {
996
+ return undefined;
997
+ }
971
998
  try {
972
999
  return String.fromCodePoint(effectiveCodepoint);
973
1000
  }