gsd-pi 2.72.0 → 2.73.0-dev.1cfd50c

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 (319) hide show
  1. package/README.md +12 -2
  2. package/dist/cli.js +59 -3
  3. package/dist/onboarding.js +10 -0
  4. package/dist/resources/extensions/async-jobs/await-tool.js +7 -4
  5. package/dist/resources/extensions/async-jobs/job-manager.js +28 -3
  6. package/dist/resources/extensions/claude-code-cli/partial-builder.js +40 -12
  7. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +48 -23
  8. package/dist/resources/extensions/gsd/auto/loop.js +84 -1
  9. package/dist/resources/extensions/gsd/auto-post-unit.js +6 -0
  10. package/dist/resources/extensions/gsd/auto-recovery.js +11 -0
  11. package/dist/resources/extensions/gsd/auto.js +25 -19
  12. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +9 -11
  13. package/dist/resources/extensions/gsd/commands-handlers.js +4 -1
  14. package/dist/resources/extensions/gsd/context-injector.js +1 -1
  15. package/dist/resources/extensions/gsd/custom-workflow-engine.js +3 -7
  16. package/dist/resources/extensions/gsd/definition-io.js +15 -0
  17. package/dist/resources/extensions/gsd/dispatch-guard.js +4 -0
  18. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +6 -3
  19. package/dist/resources/extensions/gsd/git-service.js +11 -8
  20. package/dist/resources/extensions/gsd/gitignore.js +12 -6
  21. package/dist/resources/extensions/gsd/gsd-db.js +49 -6
  22. package/dist/resources/extensions/gsd/key-manager.js +2 -0
  23. package/dist/resources/extensions/gsd/preferences-skills.js +2 -34
  24. package/dist/resources/extensions/gsd/preferences-types.js +15 -0
  25. package/dist/resources/extensions/gsd/preferences.js +16 -3
  26. package/dist/resources/extensions/gsd/prompt-loader.js +4 -1
  27. package/dist/resources/extensions/gsd/prompts/discuss.md +122 -13
  28. package/dist/resources/extensions/gsd/prompts/system.md +1 -1
  29. package/dist/resources/extensions/gsd/state.js +21 -1
  30. package/dist/resources/extensions/gsd/workflow-projections.js +7 -0
  31. package/dist/resources/extensions/gsd/worktree-manager.js +30 -3
  32. package/dist/resources/extensions/gsd/write-intercept.js +10 -1
  33. package/dist/resources/extensions/ollama/index.js +4 -5
  34. package/dist/resources/extensions/ollama/ollama-client.js +35 -6
  35. package/dist/resources/extensions/ollama/ollama-discovery.js +32 -6
  36. package/dist/web/standalone/.next/BUILD_ID +1 -1
  37. package/dist/web/standalone/.next/app-path-routes-manifest.json +15 -15
  38. package/dist/web/standalone/.next/build-manifest.json +3 -3
  39. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  40. package/dist/web/standalone/.next/required-server-files.json +3 -3
  41. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  42. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  43. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  44. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  45. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  46. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  47. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  48. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  49. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  50. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  51. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  52. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  53. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  54. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  55. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  56. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  57. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  58. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  59. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  60. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  61. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  62. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  63. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  64. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  65. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  66. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  67. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  68. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  69. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  70. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  71. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  72. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  73. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  74. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  75. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  76. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  77. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  78. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  79. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  80. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  81. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  82. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  83. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  84. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  85. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  86. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  87. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  88. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  89. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  90. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  91. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  92. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  93. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  94. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  95. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  96. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  97. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  98. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  99. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  100. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  101. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  102. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  103. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  104. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  105. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  106. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  107. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  108. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  109. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  110. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  111. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  113. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  114. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  115. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  116. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  117. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  118. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  119. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  120. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  121. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  122. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  123. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  124. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  125. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  126. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  127. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
  130. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  132. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  134. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +3 -3
  136. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  145. package/dist/web/standalone/.next/server/app/index.html +1 -1
  146. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  147. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  148. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  149. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  150. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  151. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  152. package/dist/web/standalone/.next/server/app/page.js +2 -2
  153. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app-paths-manifest.json +15 -15
  155. package/dist/web/standalone/.next/server/chunks/2331.js +16 -16
  156. package/dist/web/standalone/.next/server/chunks/4741.js +12 -12
  157. package/dist/web/standalone/.next/server/chunks/5822.js +2 -2
  158. package/dist/web/standalone/.next/server/chunks/63.js +8 -8
  159. package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
  160. package/dist/web/standalone/.next/server/edge-runtime-webpack.js +2 -0
  161. package/dist/web/standalone/.next/server/functions-config-manifest.json +0 -9
  162. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  163. package/dist/web/standalone/.next/server/middleware-manifest.json +29 -2
  164. package/dist/web/standalone/.next/server/middleware.js +4 -12
  165. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  166. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  167. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  168. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  169. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  170. package/dist/web/standalone/.next/server/webpack-runtime.js +1 -1
  171. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  172. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  173. package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
  174. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  175. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  176. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  177. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  178. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  179. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  180. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  181. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  182. package/dist/web/standalone/server.js +1 -1
  183. package/package.json +1 -1
  184. package/packages/pi-ai/dist/env-api-keys.js +1 -0
  185. package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
  186. package/packages/pi-ai/dist/models.custom.d.ts +105 -0
  187. package/packages/pi-ai/dist/models.custom.d.ts.map +1 -1
  188. package/packages/pi-ai/dist/models.custom.js +97 -0
  189. package/packages/pi-ai/dist/models.custom.js.map +1 -1
  190. package/packages/pi-ai/dist/models.generated.d.ts +648 -140
  191. package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
  192. package/packages/pi-ai/dist/models.generated.js +867 -370
  193. package/packages/pi-ai/dist/models.generated.js.map +1 -1
  194. package/packages/pi-ai/dist/models.generated.test.d.ts +2 -0
  195. package/packages/pi-ai/dist/models.generated.test.d.ts.map +1 -0
  196. package/packages/pi-ai/dist/models.generated.test.js +334 -0
  197. package/packages/pi-ai/dist/models.generated.test.js.map +1 -0
  198. package/packages/pi-ai/dist/models.test.js +105 -0
  199. package/packages/pi-ai/dist/models.test.js.map +1 -1
  200. package/packages/pi-ai/dist/types.d.ts +1 -1
  201. package/packages/pi-ai/dist/types.d.ts.map +1 -1
  202. package/packages/pi-ai/dist/types.js.map +1 -1
  203. package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  204. package/packages/pi-ai/dist/utils/oauth/github-copilot.js +5 -1
  205. package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  206. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts +2 -0
  207. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts.map +1 -0
  208. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +57 -0
  209. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -0
  210. package/packages/pi-ai/src/env-api-keys.ts +1 -0
  211. package/packages/pi-ai/src/models.custom.ts +98 -0
  212. package/packages/pi-ai/src/models.generated.test.ts +373 -0
  213. package/packages/pi-ai/src/models.generated.ts +867 -370
  214. package/packages/pi-ai/src/models.test.ts +135 -0
  215. package/packages/pi-ai/src/types.ts +1 -0
  216. package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +71 -0
  217. package/packages/pi-ai/src/utils/oauth/github-copilot.ts +4 -1
  218. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  219. package/packages/pi-coding-agent/dist/core/model-resolver.js +1 -0
  220. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  221. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  222. package/packages/pi-coding-agent/dist/core/sdk.js +9 -0
  223. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  224. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +36 -0
  225. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  226. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  227. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +87 -12
  228. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  229. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts +1 -0
  230. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  231. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +22 -9
  232. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  233. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.d.ts +2 -0
  234. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.d.ts.map +1 -0
  235. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +63 -0
  236. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -0
  237. package/packages/pi-coding-agent/package.json +1 -1
  238. package/packages/pi-coding-agent/src/core/model-resolver.ts +1 -0
  239. package/packages/pi-coding-agent/src/core/sdk.ts +10 -0
  240. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +72 -0
  241. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +84 -12
  242. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +71 -0
  243. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +23 -9
  244. package/packages/pi-tui/dist/components/__tests__/editor.test.js +12 -0
  245. package/packages/pi-tui/dist/components/__tests__/editor.test.js.map +1 -1
  246. package/packages/pi-tui/dist/components/__tests__/input.test.js +12 -0
  247. package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -1
  248. package/packages/pi-tui/dist/keys.d.ts.map +1 -1
  249. package/packages/pi-tui/dist/keys.js +27 -0
  250. package/packages/pi-tui/dist/keys.js.map +1 -1
  251. package/packages/pi-tui/src/components/__tests__/editor.test.ts +18 -0
  252. package/packages/pi-tui/src/components/__tests__/input.test.ts +18 -0
  253. package/packages/pi-tui/src/keys.ts +32 -0
  254. package/pkg/package.json +1 -1
  255. package/src/resources/extensions/async-jobs/await-tool.test.ts +40 -7
  256. package/src/resources/extensions/async-jobs/await-tool.ts +7 -4
  257. package/src/resources/extensions/async-jobs/job-manager.ts +33 -3
  258. package/src/resources/extensions/claude-code-cli/partial-builder.ts +45 -12
  259. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +49 -24
  260. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +91 -2
  261. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +112 -0
  262. package/src/resources/extensions/gsd/auto/loop.ts +89 -1
  263. package/src/resources/extensions/gsd/auto-post-unit.ts +7 -0
  264. package/src/resources/extensions/gsd/auto-recovery.ts +10 -0
  265. package/src/resources/extensions/gsd/auto.ts +25 -20
  266. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +8 -10
  267. package/src/resources/extensions/gsd/commands-handlers.ts +5 -1
  268. package/src/resources/extensions/gsd/context-injector.ts +1 -1
  269. package/src/resources/extensions/gsd/custom-workflow-engine.ts +4 -8
  270. package/src/resources/extensions/gsd/definition-io.ts +18 -0
  271. package/src/resources/extensions/gsd/dispatch-guard.ts +5 -0
  272. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +6 -3
  273. package/src/resources/extensions/gsd/git-service.ts +11 -8
  274. package/src/resources/extensions/gsd/gitignore.ts +12 -6
  275. package/src/resources/extensions/gsd/gsd-db.ts +54 -6
  276. package/src/resources/extensions/gsd/key-manager.ts +2 -0
  277. package/src/resources/extensions/gsd/preferences-skills.ts +2 -36
  278. package/src/resources/extensions/gsd/preferences-types.ts +16 -0
  279. package/src/resources/extensions/gsd/preferences.ts +19 -6
  280. package/src/resources/extensions/gsd/prompt-loader.ts +6 -1
  281. package/src/resources/extensions/gsd/prompts/discuss.md +122 -13
  282. package/src/resources/extensions/gsd/prompts/system.md +1 -1
  283. package/src/resources/extensions/gsd/state.ts +20 -0
  284. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +27 -0
  285. package/src/resources/extensions/gsd/tests/block-db-writes.test.ts +63 -0
  286. package/src/resources/extensions/gsd/tests/definition-io.test.ts +57 -0
  287. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +26 -0
  288. package/src/resources/extensions/gsd/tests/doctor-heal-fixable-warnings.test.ts +14 -0
  289. package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +104 -0
  290. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +107 -5
  291. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +8 -6
  292. package/src/resources/extensions/gsd/tests/key-manager.test.ts +63 -0
  293. package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +54 -0
  294. package/src/resources/extensions/gsd/tests/plan-milestone-artifact-verification.test.ts +62 -0
  295. package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +34 -0
  296. package/src/resources/extensions/gsd/tests/preferences-formatting.test.ts +87 -0
  297. package/src/resources/extensions/gsd/tests/preferences.test.ts +53 -0
  298. package/src/resources/extensions/gsd/tests/projection-regression.test.ts +96 -1
  299. package/src/resources/extensions/gsd/tests/prompt-loader-working-directory.test.ts +19 -0
  300. package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +97 -0
  301. package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +41 -0
  302. package/src/resources/extensions/gsd/workflow-projections.ts +8 -0
  303. package/src/resources/extensions/gsd/worktree-manager.ts +29 -3
  304. package/src/resources/extensions/gsd/write-intercept.ts +10 -1
  305. package/src/resources/extensions/ollama/index.ts +4 -5
  306. package/src/resources/extensions/ollama/ollama-client.ts +35 -6
  307. package/src/resources/extensions/ollama/ollama-discovery.ts +37 -6
  308. package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +54 -0
  309. package/dist/resources/extensions/gsd/auto-observability.js +0 -54
  310. package/dist/resources/extensions/gsd/file-watcher.js +0 -80
  311. package/dist/resources/extensions/gsd/rtk-status.js +0 -43
  312. package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
  313. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  314. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  315. package/src/resources/extensions/gsd/auto-observability.ts +0 -72
  316. package/src/resources/extensions/gsd/file-watcher.ts +0 -100
  317. package/src/resources/extensions/gsd/rtk-status.ts +0 -53
  318. /package/dist/web/standalone/.next/static/{Y0I7CjXJl-tWoV__KidV4 → uNGVqSkAnszMl0okA4nnp}/_buildManifest.js +0 -0
  319. /package/dist/web/standalone/.next/static/{Y0I7CjXJl-tWoV__KidV4 → uNGVqSkAnszMl0okA4nnp}/_ssgManifest.js +0 -0
@@ -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,GAAgB;IAC1B,WAAW,EAAE,CAAC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AAC;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,EAAE,CAAC,IAAI;KACvB;CACD,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E,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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AAC,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;QACrB,MAAM,CAAC,KAAK,CAAC,K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,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,GACX,QAAQ,GACR,QAAQ,GACR,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EjD;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
  }