gsd-pi 2.76.0 → 2.77.0-dev.538325aea

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 (1182) hide show
  1. package/README.md +32 -30
  2. package/dist/claude-cli-check.js +32 -3
  3. package/dist/cli.js +13 -21
  4. package/dist/extension-registry.js +1 -1
  5. package/dist/headless-ui.d.ts +1 -1
  6. package/dist/headless.js +2 -4
  7. package/dist/loader.js +0 -1
  8. package/dist/mcp-server.d.ts +7 -0
  9. package/dist/mcp-server.js +35 -1
  10. package/dist/onboarding.js +50 -5
  11. package/dist/provider-migrations.d.ts +2 -2
  12. package/dist/provider-migrations.js +2 -1
  13. package/dist/remote-questions-config.js +1 -1
  14. package/dist/resource-loader.d.ts +1 -1
  15. package/dist/resource-loader.js +2 -8
  16. package/dist/resources/agents/researcher.md +1 -1
  17. package/dist/resources/extensions/async-jobs/async-bash-tool.js +1 -1
  18. package/dist/resources/extensions/aws-auth/index.js +2 -1
  19. package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.js +6 -9
  20. package/dist/resources/extensions/bg-shell/process-manager.js +2 -1
  21. package/dist/resources/extensions/browser-tools/index.js +0 -1
  22. package/dist/resources/extensions/claude-code-cli/index.js +1 -1
  23. package/dist/resources/extensions/claude-code-cli/partial-builder.js +106 -17
  24. package/dist/resources/extensions/claude-code-cli/readiness.js +31 -8
  25. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +94 -27
  26. package/dist/resources/extensions/gsd/auto/loop.js +9 -0
  27. package/dist/resources/extensions/gsd/auto/phases.js +104 -11
  28. package/dist/resources/extensions/gsd/auto/run-unit.js +38 -2
  29. package/dist/resources/extensions/gsd/auto/session.js +22 -1
  30. package/dist/resources/extensions/gsd/auto-dispatch.js +56 -17
  31. package/dist/resources/extensions/gsd/auto-model-selection.js +53 -16
  32. package/dist/resources/extensions/gsd/auto-post-unit.js +59 -2
  33. package/dist/resources/extensions/gsd/auto-prompts.js +14 -0
  34. package/dist/resources/extensions/gsd/auto-recovery.js +69 -1
  35. package/dist/resources/extensions/gsd/auto-start.js +74 -59
  36. package/dist/resources/extensions/gsd/auto-verification.js +33 -0
  37. package/dist/resources/extensions/gsd/auto-worktree.js +51 -53
  38. package/dist/resources/extensions/gsd/auto.js +70 -28
  39. package/dist/resources/extensions/gsd/blocked-models.js +68 -0
  40. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +93 -1
  41. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +39 -9
  42. package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +93 -0
  43. package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +3 -0
  44. package/dist/resources/extensions/gsd/bootstrap/register-extension.js +12 -0
  45. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +52 -6
  46. package/dist/resources/extensions/gsd/bootstrap/system-context.js +84 -23
  47. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +34 -2
  48. package/dist/resources/extensions/gsd/clean-root-preflight.js +93 -0
  49. package/dist/resources/extensions/gsd/commands-extract-learnings.js +54 -89
  50. package/dist/resources/extensions/gsd/commands-prefs-wizard.js +968 -23
  51. package/dist/resources/extensions/gsd/compaction-snapshot.js +121 -0
  52. package/dist/resources/extensions/gsd/complexity-classifier.js +5 -3
  53. package/dist/resources/extensions/gsd/db-writer.js +88 -16
  54. package/dist/resources/extensions/gsd/dispatch-guard.js +44 -3
  55. package/dist/resources/extensions/gsd/doctor-git-checks.js +23 -29
  56. package/dist/resources/extensions/gsd/doctor-providers.js +51 -5
  57. package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +1 -0
  58. package/dist/resources/extensions/gsd/error-classifier.js +31 -3
  59. package/dist/resources/extensions/gsd/exec-history.js +120 -0
  60. package/dist/resources/extensions/gsd/exec-sandbox.js +258 -0
  61. package/dist/resources/extensions/gsd/gitignore.js +1 -0
  62. package/dist/resources/extensions/gsd/gsd-db.js +168 -23
  63. package/dist/resources/extensions/gsd/guided-flow.js +191 -2
  64. package/dist/resources/extensions/gsd/health-widget.js +4 -1
  65. package/dist/resources/extensions/gsd/hook-emitter.js +108 -0
  66. package/dist/resources/extensions/gsd/init-wizard.js +15 -1
  67. package/dist/resources/extensions/gsd/key-manager.js +28 -0
  68. package/dist/resources/extensions/gsd/memory-backfill.js +126 -0
  69. package/dist/resources/extensions/gsd/memory-store.js +19 -0
  70. package/dist/resources/extensions/gsd/model-router.js +36 -3
  71. package/dist/resources/extensions/gsd/pre-execution-checks.js +44 -9
  72. package/dist/resources/extensions/gsd/preferences-types.js +9 -0
  73. package/dist/resources/extensions/gsd/preferences-validation.js +83 -0
  74. package/dist/resources/extensions/gsd/preferences.js +17 -17
  75. package/dist/resources/extensions/gsd/prompt-loader.js +22 -7
  76. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  77. package/dist/resources/extensions/gsd/prompts/complete-slice.md +2 -2
  78. package/dist/resources/extensions/gsd/prompts/debug-diagnose.md +2 -0
  79. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -0
  80. package/dist/resources/extensions/gsd/prompts/discuss.md +29 -2
  81. package/dist/resources/extensions/gsd/prompts/execute-task.md +3 -2
  82. package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
  83. package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -0
  84. package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -0
  85. package/dist/resources/extensions/gsd/prompts/system.md +1 -0
  86. package/dist/resources/extensions/gsd/safety/evidence-collector.js +96 -0
  87. package/dist/resources/extensions/gsd/safety/file-change-validator.js +13 -5
  88. package/dist/resources/extensions/gsd/safety/safety-harness.js +5 -1
  89. package/dist/resources/extensions/gsd/state.js +43 -4
  90. package/dist/resources/extensions/gsd/token-counter.js +22 -5
  91. package/dist/resources/extensions/gsd/tools/complete-milestone.js +16 -10
  92. package/dist/resources/extensions/gsd/tools/exec-search-tool.js +59 -0
  93. package/dist/resources/extensions/gsd/tools/exec-tool.js +126 -0
  94. package/dist/resources/extensions/gsd/tools/memory-tools.js +26 -1
  95. package/dist/resources/extensions/gsd/tools/resume-tool.js +23 -0
  96. package/dist/resources/extensions/gsd/uok/plan-v2.js +20 -3
  97. package/dist/resources/extensions/gsd/workflow-mcp.js +3 -0
  98. package/dist/resources/extensions/gsd/workflow-templates/spike.md +6 -0
  99. package/dist/resources/extensions/gsd/worktree-resolver.js +50 -10
  100. package/dist/resources/extensions/mcp-client/index.js +1 -1
  101. package/dist/resources/extensions/ollama/index.js +1 -2
  102. package/dist/resources/extensions/ollama/ollama-chat-provider.js +5 -15
  103. package/dist/resources/extensions/remote-questions/config.js +12 -1
  104. package/dist/resources/extensions/search-the-web/command-search-provider.js +5 -4
  105. package/dist/resources/extensions/search-the-web/native-search.js +45 -13
  106. package/dist/resources/extensions/universal-config/index.js +1 -1
  107. package/dist/resources/skills/api-design/SKILL.md +190 -0
  108. package/dist/resources/skills/create-mcp-server/SKILL.md +121 -0
  109. package/dist/resources/skills/decompose-into-slices/SKILL.md +139 -0
  110. package/dist/resources/skills/dependency-upgrade/SKILL.md +158 -0
  111. package/dist/resources/skills/design-an-interface/SKILL.md +102 -0
  112. package/dist/resources/skills/forensics/SKILL.md +153 -0
  113. package/dist/resources/skills/grill-me/SKILL.md +93 -0
  114. package/dist/resources/skills/handoff/SKILL.md +121 -0
  115. package/dist/resources/skills/observability/SKILL.md +174 -0
  116. package/dist/resources/skills/security-review/SKILL.md +181 -0
  117. package/dist/resources/skills/spike-wrap-up/SKILL.md +138 -0
  118. package/dist/resources/skills/tdd/SKILL.md +112 -0
  119. package/dist/resources/skills/verify-before-complete/SKILL.md +98 -0
  120. package/dist/resources/skills/write-docs/SKILL.md +82 -0
  121. package/dist/resources/skills/write-milestone-brief/SKILL.md +135 -0
  122. package/dist/security-overrides.d.ts +4 -1
  123. package/dist/security-overrides.js +16 -3
  124. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  125. package/dist/web/standalone/.next/BUILD_ID +1 -1
  126. package/dist/web/standalone/.next/app-path-routes-manifest.json +11 -11
  127. package/dist/web/standalone/.next/build-manifest.json +4 -4
  128. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  129. package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
  130. package/dist/web/standalone/.next/required-server-files.json +4 -4
  131. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  132. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  133. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  134. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  135. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  136. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  137. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  138. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  139. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  140. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  141. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  142. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  143. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  144. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  145. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  146. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  147. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  148. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  149. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  150. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  151. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  158. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  163. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  170. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  184. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  190. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  192. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  194. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  196. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  197. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  198. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  199. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  200. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  201. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  202. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  203. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  204. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  205. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  206. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  207. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  208. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  209. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  210. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  211. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  212. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  213. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  214. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  215. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  216. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  217. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  218. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  219. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
  220. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  221. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  222. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  223. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  224. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  225. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
  226. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  227. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  228. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  229. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  230. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  231. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  232. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  233. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  234. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  235. package/dist/web/standalone/.next/server/app/index.html +1 -1
  236. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  237. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  238. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  239. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  240. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  241. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  242. package/dist/web/standalone/.next/server/app/page.js +2 -2
  243. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  244. package/dist/web/standalone/.next/server/app-paths-manifest.json +11 -11
  245. package/dist/web/standalone/.next/server/chunks/63.js +3 -3
  246. package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
  247. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  248. package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
  249. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  250. package/dist/web/standalone/.next/server/middleware.js +2 -2
  251. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  252. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  253. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  254. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  255. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  256. package/dist/web/standalone/.next/static/chunks/2826.d445fb428ef41fa1.js +9 -0
  257. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  258. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  259. package/dist/web/standalone/.next/static/chunks/app/page-5b113fd32bc2a1c3.js +1 -0
  260. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  261. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  262. package/dist/web/standalone/.next/static/chunks/{webpack-5fc74f13a25fa1bb.js → webpack-1832629448831fdc.js} +1 -1
  263. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  264. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  265. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  266. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  267. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  268. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  269. package/dist/web/standalone/server.js +1 -1
  270. package/dist/web-mode.js +1 -1
  271. package/dist/welcome-screen.js +19 -15
  272. package/dist/wizard.js +4 -5
  273. package/package.json +25 -7
  274. package/packages/daemon/package.json +2 -2
  275. package/packages/gsd-agent-core/dist/agent-session.d.ts +716 -0
  276. package/packages/gsd-agent-core/dist/agent-session.d.ts.map +1 -0
  277. package/packages/gsd-agent-core/dist/agent-session.js +2595 -0
  278. package/packages/gsd-agent-core/dist/agent-session.js.map +1 -0
  279. package/packages/gsd-agent-core/dist/artifact-manager.d.ts +52 -0
  280. package/packages/gsd-agent-core/dist/artifact-manager.d.ts.map +1 -0
  281. package/packages/gsd-agent-core/dist/artifact-manager.js +118 -0
  282. package/packages/gsd-agent-core/dist/artifact-manager.js.map +1 -0
  283. package/packages/gsd-agent-core/dist/bash-executor.d.ts +57 -0
  284. package/packages/gsd-agent-core/dist/bash-executor.d.ts.map +1 -0
  285. package/packages/gsd-agent-core/dist/bash-executor.js +282 -0
  286. package/packages/gsd-agent-core/dist/bash-executor.js.map +1 -0
  287. package/packages/gsd-agent-core/dist/blob-store.d.ts +39 -0
  288. package/packages/gsd-agent-core/dist/blob-store.d.ts.map +1 -0
  289. package/packages/gsd-agent-core/dist/blob-store.js +151 -0
  290. package/packages/gsd-agent-core/dist/blob-store.js.map +1 -0
  291. package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts +90 -0
  292. package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts.map +1 -0
  293. package/packages/gsd-agent-core/dist/compaction/branch-summarization.js +207 -0
  294. package/packages/gsd-agent-core/dist/compaction/branch-summarization.js.map +1 -0
  295. package/packages/gsd-agent-core/dist/compaction/compaction.d.ts +137 -0
  296. package/packages/gsd-agent-core/dist/compaction/compaction.d.ts.map +1 -0
  297. package/packages/gsd-agent-core/dist/compaction/compaction.js +621 -0
  298. package/packages/gsd-agent-core/dist/compaction/compaction.js.map +1 -0
  299. package/packages/gsd-agent-core/dist/compaction/index.d.ts +7 -0
  300. package/packages/gsd-agent-core/dist/compaction/index.d.ts.map +1 -0
  301. package/packages/gsd-agent-core/dist/compaction/index.js +7 -0
  302. package/packages/gsd-agent-core/dist/compaction/index.js.map +1 -0
  303. package/packages/gsd-agent-core/dist/compaction/utils.d.ts +78 -0
  304. package/packages/gsd-agent-core/dist/compaction/utils.d.ts.map +1 -0
  305. package/packages/gsd-agent-core/dist/compaction/utils.js +263 -0
  306. package/packages/gsd-agent-core/dist/compaction/utils.js.map +1 -0
  307. package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts +90 -0
  308. package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts.map +1 -0
  309. package/packages/gsd-agent-core/dist/compaction-orchestrator.js +338 -0
  310. package/packages/gsd-agent-core/dist/compaction-orchestrator.js.map +1 -0
  311. package/packages/gsd-agent-core/dist/contextual-tips.d.ts +43 -0
  312. package/packages/gsd-agent-core/dist/contextual-tips.d.ts.map +1 -0
  313. package/packages/gsd-agent-core/dist/contextual-tips.js +208 -0
  314. package/packages/gsd-agent-core/dist/contextual-tips.js.map +1 -0
  315. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts +18 -0
  316. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts.map +1 -0
  317. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js +250 -0
  318. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js.map +1 -0
  319. package/packages/gsd-agent-core/dist/export-html/index.d.ts +37 -0
  320. package/packages/gsd-agent-core/dist/export-html/index.d.ts.map +1 -0
  321. package/packages/gsd-agent-core/dist/export-html/index.js +257 -0
  322. package/packages/gsd-agent-core/dist/export-html/index.js.map +1 -0
  323. package/packages/gsd-agent-core/dist/export-html/template.css +971 -0
  324. package/packages/gsd-agent-core/dist/export-html/template.html +54 -0
  325. package/packages/gsd-agent-core/dist/export-html/template.js +1583 -0
  326. package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts +38 -0
  327. package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts.map +1 -0
  328. package/packages/gsd-agent-core/dist/export-html/tool-renderer.js +70 -0
  329. package/packages/gsd-agent-core/dist/export-html/tool-renderer.js.map +1 -0
  330. package/packages/gsd-agent-core/dist/export-html/vendor/highlight.min.js +1213 -0
  331. package/packages/gsd-agent-core/dist/export-html/vendor/marked.min.js +6 -0
  332. package/packages/gsd-agent-core/dist/fallback-resolver.d.ts +75 -0
  333. package/packages/gsd-agent-core/dist/fallback-resolver.d.ts.map +1 -0
  334. package/packages/gsd-agent-core/dist/fallback-resolver.js +118 -0
  335. package/packages/gsd-agent-core/dist/fallback-resolver.js.map +1 -0
  336. package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts +44 -0
  337. package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts.map +1 -0
  338. package/packages/gsd-agent-core/dist/image-overflow-recovery.js +99 -0
  339. package/packages/gsd-agent-core/dist/image-overflow-recovery.js.map +1 -0
  340. package/packages/gsd-agent-core/dist/index.d.ts +14 -0
  341. package/packages/gsd-agent-core/dist/index.d.ts.map +1 -0
  342. package/packages/gsd-agent-core/dist/index.js +19 -0
  343. package/packages/gsd-agent-core/dist/index.js.map +1 -0
  344. package/packages/gsd-agent-core/dist/keybindings.d.ts +47 -0
  345. package/packages/gsd-agent-core/dist/keybindings.d.ts.map +1 -0
  346. package/packages/gsd-agent-core/dist/keybindings.js +156 -0
  347. package/packages/gsd-agent-core/dist/keybindings.js.map +1 -0
  348. package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts +42 -0
  349. package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts.map +1 -0
  350. package/packages/gsd-agent-core/dist/lifecycle-hooks.js +204 -0
  351. package/packages/gsd-agent-core/dist/lifecycle-hooks.js.map +1 -0
  352. package/packages/gsd-agent-core/dist/retry-handler.d.ts +128 -0
  353. package/packages/gsd-agent-core/dist/retry-handler.d.ts.map +1 -0
  354. package/packages/gsd-agent-core/dist/retry-handler.js +518 -0
  355. package/packages/gsd-agent-core/dist/retry-handler.js.map +1 -0
  356. package/packages/gsd-agent-core/dist/sdk.d.ts +159 -0
  357. package/packages/gsd-agent-core/dist/sdk.d.ts.map +1 -0
  358. package/packages/gsd-agent-core/dist/sdk.js +375 -0
  359. package/packages/gsd-agent-core/dist/sdk.js.map +1 -0
  360. package/packages/gsd-agent-core/dist/system-prompt.d.ts +28 -0
  361. package/packages/gsd-agent-core/dist/system-prompt.d.ts.map +1 -0
  362. package/packages/gsd-agent-core/dist/system-prompt.js +201 -0
  363. package/packages/gsd-agent-core/dist/system-prompt.js.map +1 -0
  364. package/packages/gsd-agent-core/package.json +25 -0
  365. package/packages/gsd-agent-core/scripts/copy-assets.cjs +43 -0
  366. package/packages/gsd-agent-core/src/agent-session.test.ts +169 -0
  367. package/packages/gsd-agent-core/src/agent-session.ts +3358 -0
  368. package/packages/gsd-agent-core/src/artifact-manager.ts +126 -0
  369. package/packages/gsd-agent-core/src/bash-executor.ts +352 -0
  370. package/packages/gsd-agent-core/src/blob-store.ts +154 -0
  371. package/packages/gsd-agent-core/src/compaction/branch-summarization.ts +317 -0
  372. package/packages/gsd-agent-core/src/compaction/compaction.ts +855 -0
  373. package/packages/gsd-agent-core/src/compaction/index.ts +7 -0
  374. package/packages/gsd-agent-core/src/compaction/utils.ts +312 -0
  375. package/packages/gsd-agent-core/src/compaction-orchestrator.ts +449 -0
  376. package/packages/gsd-agent-core/src/contextual-tips.ts +232 -0
  377. package/packages/gsd-agent-core/src/export-html/ansi-to-html.ts +259 -0
  378. package/packages/gsd-agent-core/src/export-html/index.ts +345 -0
  379. package/packages/gsd-agent-core/src/export-html/template.css +971 -0
  380. package/packages/gsd-agent-core/src/export-html/template.html +54 -0
  381. package/packages/gsd-agent-core/src/export-html/template.js +1583 -0
  382. package/packages/gsd-agent-core/src/export-html/tool-renderer.ts +114 -0
  383. package/packages/gsd-agent-core/src/export-html/vendor/highlight.min.js +1213 -0
  384. package/packages/gsd-agent-core/src/export-html/vendor/marked.min.js +6 -0
  385. package/packages/gsd-agent-core/src/fallback-resolver.ts +193 -0
  386. package/packages/gsd-agent-core/src/image-overflow-recovery.ts +120 -0
  387. package/packages/gsd-agent-core/src/index.ts +68 -0
  388. package/packages/gsd-agent-core/src/keybindings.ts +220 -0
  389. package/packages/gsd-agent-core/src/lifecycle-hooks.ts +284 -0
  390. package/packages/gsd-agent-core/src/retry-handler.ts +620 -0
  391. package/packages/gsd-agent-core/src/sdk.ts +550 -0
  392. package/packages/gsd-agent-core/src/system-prompt.ts +270 -0
  393. package/packages/gsd-agent-core/tsconfig.json +28 -0
  394. package/packages/gsd-agent-core/tsconfig.tsbuildinfo +1 -0
  395. package/packages/gsd-agent-modes/dist/cli/args.d.ts +58 -0
  396. package/packages/gsd-agent-modes/dist/cli/args.d.ts.map +1 -0
  397. package/packages/gsd-agent-modes/dist/cli/args.js +324 -0
  398. package/packages/gsd-agent-modes/dist/cli/args.js.map +1 -0
  399. package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts +13 -0
  400. package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts.map +1 -0
  401. package/packages/gsd-agent-modes/dist/cli/config-selector.js +32 -0
  402. package/packages/gsd-agent-modes/dist/cli/config-selector.js.map +1 -0
  403. package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts +15 -0
  404. package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts.map +1 -0
  405. package/packages/gsd-agent-modes/dist/cli/file-processor.js +86 -0
  406. package/packages/gsd-agent-modes/dist/cli/file-processor.js.map +1 -0
  407. package/packages/gsd-agent-modes/dist/cli/list-models.d.ts +21 -0
  408. package/packages/gsd-agent-modes/dist/cli/list-models.d.ts.map +1 -0
  409. package/packages/gsd-agent-modes/dist/cli/list-models.js +114 -0
  410. package/packages/gsd-agent-modes/dist/cli/list-models.js.map +1 -0
  411. package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts +10 -0
  412. package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts.map +1 -0
  413. package/packages/gsd-agent-modes/dist/cli/session-picker.js +37 -0
  414. package/packages/gsd-agent-modes/dist/cli/session-picker.js.map +1 -0
  415. package/packages/gsd-agent-modes/dist/index.d.ts +7 -0
  416. package/packages/gsd-agent-modes/dist/index.d.ts.map +1 -0
  417. package/packages/gsd-agent-modes/dist/index.js +7 -0
  418. package/packages/gsd-agent-modes/dist/index.js.map +1 -0
  419. package/packages/gsd-agent-modes/dist/main.d.ts +8 -0
  420. package/packages/gsd-agent-modes/dist/main.d.ts.map +1 -0
  421. package/packages/gsd-agent-modes/dist/main.js +491 -0
  422. package/packages/gsd-agent-modes/dist/main.js.map +1 -0
  423. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts +34 -0
  424. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts.map +1 -0
  425. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js +330 -0
  426. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js.map +1 -0
  427. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts +29 -0
  428. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  429. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +141 -0
  430. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +1 -0
  431. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts +36 -0
  432. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  433. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js +157 -0
  434. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js.map +1 -0
  435. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  436. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  437. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js +48 -0
  438. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  439. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  440. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  441. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js +43 -0
  442. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  443. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts +11 -0
  444. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts.map +1 -0
  445. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js +47 -0
  446. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js.map +1 -0
  447. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  448. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  449. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js +44 -0
  450. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  451. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts +71 -0
  452. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  453. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js +474 -0
  454. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js.map +1 -0
  455. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts +15 -0
  456. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  457. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js +32 -0
  458. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  459. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts +22 -0
  460. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  461. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js +70 -0
  462. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js.map +1 -0
  463. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts +20 -0
  464. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  465. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js +75 -0
  466. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js.map +1 -0
  467. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  468. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
  469. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js +140 -0
  470. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js.map +1 -0
  471. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts +12 -0
  472. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts.map +1 -0
  473. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js +133 -0
  474. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js.map +1 -0
  475. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts +33 -0
  476. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  477. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js +82 -0
  478. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  479. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts +20 -0
  480. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  481. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js +111 -0
  482. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js.map +1 -0
  483. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts +24 -0
  484. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  485. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js +63 -0
  486. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js.map +1 -0
  487. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts +33 -0
  488. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  489. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js +118 -0
  490. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js.map +1 -0
  491. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts +32 -0
  492. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts.map +1 -0
  493. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js +230 -0
  494. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js.map +1 -0
  495. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts +34 -0
  496. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts.map +1 -0
  497. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js +36 -0
  498. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js.map +1 -0
  499. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts +48 -0
  500. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  501. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js +72 -0
  502. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  503. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts +63 -0
  504. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  505. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js +213 -0
  506. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js.map +1 -0
  507. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts +86 -0
  508. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  509. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js +536 -0
  510. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js.map +1 -0
  511. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
  512. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  513. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js +93 -0
  514. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  515. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts +30 -0
  516. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts.map +1 -0
  517. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js +169 -0
  518. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js.map +1 -0
  519. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
  520. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  521. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js +267 -0
  522. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  523. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts +21 -0
  524. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  525. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js +155 -0
  526. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  527. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts +97 -0
  528. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  529. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js +810 -0
  530. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js.map +1 -0
  531. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts +71 -0
  532. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  533. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js +320 -0
  534. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js.map +1 -0
  535. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  536. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  537. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js +34 -0
  538. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  539. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  540. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  541. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js +46 -0
  542. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  543. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  544. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  545. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js +45 -0
  546. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js.map +1 -0
  547. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  548. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  549. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js +46 -0
  550. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  551. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts +15 -0
  552. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts.map +1 -0
  553. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js +40 -0
  554. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js.map +1 -0
  555. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts +111 -0
  556. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  557. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +984 -0
  558. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +1 -0
  559. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts +44 -0
  560. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts.map +1 -0
  561. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js +61 -0
  562. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js.map +1 -0
  563. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts +109 -0
  564. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  565. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js +1035 -0
  566. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js.map +1 -0
  567. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  568. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  569. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js +112 -0
  570. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  571. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts +12 -0
  572. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  573. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js +38 -0
  574. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js.map +1 -0
  575. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  576. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  577. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js +33 -0
  578. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  579. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts +27 -0
  580. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -0
  581. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +793 -0
  582. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -0
  583. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts +4 -0
  584. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts.map +1 -0
  585. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js +62 -0
  586. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js.map +1 -0
  587. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts +22 -0
  588. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -0
  589. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +118 -0
  590. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +1 -0
  591. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts +7 -0
  592. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -0
  593. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js +68 -0
  594. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js.map +1 -0
  595. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts +50 -0
  596. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -0
  597. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js +2 -0
  598. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js.map +1 -0
  599. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts +358 -0
  600. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  601. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js +3409 -0
  602. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js.map +1 -0
  603. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts +77 -0
  604. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -0
  605. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js +529 -0
  606. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js.map +1 -0
  607. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts +6 -0
  608. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts.map +1 -0
  609. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js +15 -0
  610. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js.map +1 -0
  611. package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts +28 -0
  612. package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts.map +1 -0
  613. package/packages/gsd-agent-modes/dist/modes/print-mode.js +84 -0
  614. package/packages/gsd-agent-modes/dist/modes/print-mode.js.map +1 -0
  615. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts +17 -0
  616. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts.map +1 -0
  617. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js +49 -0
  618. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js.map +1 -0
  619. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts +37 -0
  620. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts.map +1 -0
  621. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js +84 -0
  622. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js.map +1 -0
  623. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts +243 -0
  624. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  625. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js +464 -0
  626. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js.map +1 -0
  627. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts +25 -0
  628. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  629. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js +750 -0
  630. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js.map +1 -0
  631. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts +511 -0
  632. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  633. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js +8 -0
  634. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js.map +1 -0
  635. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts +19 -0
  636. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts.map +1 -0
  637. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js +45 -0
  638. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js.map +1 -0
  639. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts +22 -0
  640. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts.map +1 -0
  641. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js +21 -0
  642. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js.map +1 -0
  643. package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts +4 -0
  644. package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts.map +1 -0
  645. package/packages/gsd-agent-modes/dist/pi-tui-compat.js +3 -0
  646. package/packages/gsd-agent-modes/dist/pi-tui-compat.js.map +1 -0
  647. package/packages/gsd-agent-modes/dist/theme.d.ts +15 -0
  648. package/packages/gsd-agent-modes/dist/theme.d.ts.map +1 -0
  649. package/packages/gsd-agent-modes/dist/theme.js +23 -0
  650. package/packages/gsd-agent-modes/dist/theme.js.map +1 -0
  651. package/packages/gsd-agent-modes/dist/utils/theme.d.ts +16 -0
  652. package/packages/gsd-agent-modes/dist/utils/theme.d.ts.map +1 -0
  653. package/packages/gsd-agent-modes/dist/utils/theme.js +11 -0
  654. package/packages/gsd-agent-modes/dist/utils/theme.js.map +1 -0
  655. package/packages/gsd-agent-modes/package.json +23 -0
  656. package/packages/gsd-agent-modes/src/cli/args.ts +350 -0
  657. package/packages/gsd-agent-modes/src/cli/config-selector.ts +54 -0
  658. package/packages/gsd-agent-modes/src/cli/file-processor.ts +107 -0
  659. package/packages/gsd-agent-modes/src/cli/list-models.ts +141 -0
  660. package/packages/gsd-agent-modes/src/cli/session-picker.ts +59 -0
  661. package/packages/gsd-agent-modes/src/index.ts +6 -0
  662. package/packages/gsd-agent-modes/src/main.ts +614 -0
  663. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
  664. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/provider-display-name.test.ts +18 -0
  665. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/timestamp.test.ts +38 -0
  666. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/tool-execution.test.ts +171 -0
  667. package/packages/gsd-agent-modes/src/modes/interactive/components/armin.ts +382 -0
  668. package/packages/gsd-agent-modes/src/modes/interactive/components/assistant-message.ts +178 -0
  669. package/packages/gsd-agent-modes/src/modes/interactive/components/bash-execution.ts +212 -0
  670. package/packages/gsd-agent-modes/src/modes/interactive/components/bordered-loader.ts +66 -0
  671. package/packages/gsd-agent-modes/src/modes/interactive/components/branch-summary-message.ts +59 -0
  672. package/packages/gsd-agent-modes/src/modes/interactive/components/chat-frame.ts +67 -0
  673. package/packages/gsd-agent-modes/src/modes/interactive/components/compaction-summary-message.ts +60 -0
  674. package/packages/gsd-agent-modes/src/modes/interactive/components/config-selector.ts +597 -0
  675. package/packages/gsd-agent-modes/src/modes/interactive/components/countdown-timer.ts +41 -0
  676. package/packages/gsd-agent-modes/src/modes/interactive/components/custom-editor.ts +88 -0
  677. package/packages/gsd-agent-modes/src/modes/interactive/components/custom-message.ts +100 -0
  678. package/packages/gsd-agent-modes/src/modes/interactive/components/daxnuts.ts +165 -0
  679. package/packages/gsd-agent-modes/src/modes/interactive/components/diff.ts +147 -0
  680. package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.test.ts +73 -0
  681. package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.ts +89 -0
  682. package/packages/gsd-agent-modes/src/modes/interactive/components/extension-editor.ts +151 -0
  683. package/packages/gsd-agent-modes/src/modes/interactive/components/extension-input.ts +100 -0
  684. package/packages/gsd-agent-modes/src/modes/interactive/components/extension-selector.ts +156 -0
  685. package/packages/gsd-agent-modes/src/modes/interactive/components/footer.ts +257 -0
  686. package/packages/gsd-agent-modes/src/modes/interactive/components/index.ts +35 -0
  687. package/packages/gsd-agent-modes/src/modes/interactive/components/keybinding-hints.ts +84 -0
  688. package/packages/gsd-agent-modes/src/modes/interactive/components/login-dialog.ts +257 -0
  689. package/packages/gsd-agent-modes/src/modes/interactive/components/model-selector.ts +656 -0
  690. package/packages/gsd-agent-modes/src/modes/interactive/components/oauth-selector.ts +122 -0
  691. package/packages/gsd-agent-modes/src/modes/interactive/components/provider-manager.ts +210 -0
  692. package/packages/gsd-agent-modes/src/modes/interactive/components/scoped-models-selector.ts +342 -0
  693. package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector-search.ts +194 -0
  694. package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector.ts +1011 -0
  695. package/packages/gsd-agent-modes/src/modes/interactive/components/settings-selector.ts +452 -0
  696. package/packages/gsd-agent-modes/src/modes/interactive/components/show-images-selector.ts +45 -0
  697. package/packages/gsd-agent-modes/src/modes/interactive/components/skill-invocation-message.ts +56 -0
  698. package/packages/gsd-agent-modes/src/modes/interactive/components/theme-selector.ts +63 -0
  699. package/packages/gsd-agent-modes/src/modes/interactive/components/thinking-selector.ts +64 -0
  700. package/packages/gsd-agent-modes/src/modes/interactive/components/timestamp.ts +48 -0
  701. package/packages/gsd-agent-modes/src/modes/interactive/components/tool-execution.ts +1157 -0
  702. package/packages/gsd-agent-modes/src/modes/interactive/components/tree-render-utils.ts +81 -0
  703. package/packages/gsd-agent-modes/src/modes/interactive/components/tree-selector.ts +1208 -0
  704. package/packages/gsd-agent-modes/src/modes/interactive/components/user-message-selector.ts +145 -0
  705. package/packages/gsd-agent-modes/src/modes/interactive/components/user-message.ts +44 -0
  706. package/packages/gsd-agent-modes/src/modes/interactive/components/visual-truncate.ts +50 -0
  707. package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller-ordering.test.ts +1430 -0
  708. package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.test.ts +71 -0
  709. package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.ts +957 -0
  710. package/packages/gsd-agent-modes/src/modes/interactive/controllers/extension-ui-controller.ts +63 -0
  711. package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.test.ts +183 -0
  712. package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.ts +140 -0
  713. package/packages/gsd-agent-modes/src/modes/interactive/controllers/model-controller.ts +77 -0
  714. package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-ordering.test.ts +44 -0
  715. package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-state.ts +49 -0
  716. package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode.ts +4195 -0
  717. package/packages/gsd-agent-modes/src/modes/interactive/slash-command-handlers.ts +670 -0
  718. package/packages/gsd-agent-modes/src/modes/interactive/utils/shorten-path.ts +14 -0
  719. package/packages/gsd-agent-modes/src/modes/print-mode.ts +106 -0
  720. package/packages/gsd-agent-modes/src/modes/rpc/jsonl.ts +58 -0
  721. package/packages/gsd-agent-modes/src/modes/rpc/remote-terminal.ts +109 -0
  722. package/packages/gsd-agent-modes/src/modes/rpc/rpc-client.ts +572 -0
  723. package/packages/gsd-agent-modes/src/modes/rpc/rpc-mode.ts +902 -0
  724. package/packages/gsd-agent-modes/src/modes/rpc/rpc-protocol-v2.test.ts +971 -0
  725. package/packages/gsd-agent-modes/src/modes/rpc/rpc-types.ts +335 -0
  726. package/packages/gsd-agent-modes/src/modes/shared/command-context-actions.ts +53 -0
  727. package/packages/gsd-agent-modes/src/pi-coding-agent-compat.ts +42 -0
  728. package/packages/gsd-agent-modes/src/pi-tui-compat.ts +4 -0
  729. package/packages/gsd-agent-modes/src/theme.ts +25 -0
  730. package/packages/gsd-agent-modes/src/utils/theme.ts +24 -0
  731. package/packages/gsd-agent-modes/tsconfig.json +28 -0
  732. package/packages/gsd-agent-modes/tsconfig.tsbuildinfo +1 -0
  733. package/packages/gsd-agent-types/dist/index.d.ts +176 -0
  734. package/packages/gsd-agent-types/dist/index.d.ts.map +1 -0
  735. package/packages/gsd-agent-types/dist/index.js +24 -0
  736. package/packages/gsd-agent-types/dist/index.js.map +1 -0
  737. package/packages/gsd-agent-types/package.json +24 -0
  738. package/packages/gsd-agent-types/src/index.ts +206 -0
  739. package/packages/gsd-agent-types/tsconfig.json +25 -0
  740. package/packages/gsd-agent-types/tsconfig.tsbuildinfo +1 -0
  741. package/packages/mcp-server/dist/remote-questions.d.ts +45 -0
  742. package/packages/mcp-server/dist/remote-questions.d.ts.map +1 -0
  743. package/packages/mcp-server/dist/remote-questions.js +732 -0
  744. package/packages/mcp-server/dist/remote-questions.js.map +1 -0
  745. package/packages/mcp-server/dist/server.d.ts +7 -0
  746. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  747. package/packages/mcp-server/dist/server.js +77 -11
  748. package/packages/mcp-server/dist/server.js.map +1 -1
  749. package/packages/mcp-server/dist/session-manager.d.ts +14 -0
  750. package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
  751. package/packages/mcp-server/dist/session-manager.js +49 -1
  752. package/packages/mcp-server/dist/session-manager.js.map +1 -1
  753. package/packages/mcp-server/dist/workflow-tools.d.ts +1 -1
  754. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  755. package/packages/mcp-server/dist/workflow-tools.js +163 -25
  756. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  757. package/packages/mcp-server/package.json +4 -3
  758. package/packages/mcp-server/src/mcp-server.test.ts +67 -0
  759. package/packages/mcp-server/src/remote-questions.test.ts +294 -0
  760. package/packages/mcp-server/src/remote-questions.ts +916 -0
  761. package/packages/mcp-server/src/server.ts +94 -18
  762. package/packages/mcp-server/src/session-manager.ts +43 -1
  763. package/packages/mcp-server/src/workflow-tools.test.ts +146 -1
  764. package/packages/mcp-server/src/workflow-tools.ts +215 -43
  765. package/packages/mcp-server/tsconfig.test.json +19 -0
  766. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  767. package/packages/native/dist/tsconfig.tsbuildinfo +1 -0
  768. package/packages/native/package.json +1 -1
  769. package/packages/native/tsconfig.json +2 -1
  770. package/packages/pi-agent-core/dist/agent-loop.js +12 -0
  771. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
  772. package/packages/pi-agent-core/dist/types.d.ts +30 -0
  773. package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
  774. package/packages/pi-agent-core/dist/types.js.map +1 -1
  775. package/packages/pi-agent-core/package.json +1 -1
  776. package/packages/pi-agent-core/src/agent-loop.ts +14 -0
  777. package/packages/pi-agent-core/src/types.ts +34 -0
  778. package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
  779. package/packages/pi-ai/dist/models/custom.d.ts +38 -0
  780. package/packages/pi-ai/dist/models/custom.d.ts.map +1 -1
  781. package/packages/pi-ai/dist/models/custom.js +41 -0
  782. package/packages/pi-ai/dist/models/custom.js.map +1 -1
  783. package/packages/pi-ai/dist/providers/anthropic-auth.test.js +1 -1
  784. package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
  785. package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.d.ts +2 -0
  786. package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.d.ts.map +1 -0
  787. package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +13 -0
  788. package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -0
  789. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
  790. package/packages/pi-ai/dist/providers/anthropic-shared.js +27 -4
  791. package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
  792. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  793. package/packages/pi-ai/dist/providers/anthropic.js +13 -4
  794. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  795. package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts +2 -0
  796. package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts.map +1 -0
  797. package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +80 -0
  798. package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -0
  799. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  800. package/packages/pi-ai/dist/providers/openai-completions.js +60 -15
  801. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
  802. package/packages/pi-ai/dist/providers/simple-options.d.ts +10 -0
  803. package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
  804. package/packages/pi-ai/dist/providers/simple-options.js +16 -1
  805. package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
  806. package/packages/pi-ai/dist/providers/think-tag-parser.d.ts +17 -0
  807. package/packages/pi-ai/dist/providers/think-tag-parser.d.ts.map +1 -0
  808. package/packages/pi-ai/dist/providers/think-tag-parser.js +75 -0
  809. package/packages/pi-ai/dist/providers/think-tag-parser.js.map +1 -0
  810. package/packages/pi-ai/dist/providers/think-tag-parser.test.d.ts +2 -0
  811. package/packages/pi-ai/dist/providers/think-tag-parser.test.d.ts.map +1 -0
  812. package/packages/pi-ai/dist/providers/think-tag-parser.test.js +41 -0
  813. package/packages/pi-ai/dist/providers/think-tag-parser.test.js.map +1 -0
  814. package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  815. package/packages/pi-ai/dist/utils/oauth/github-copilot.js +12 -2
  816. package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  817. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +164 -14
  818. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
  819. package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -1
  820. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +15 -3
  821. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -1
  822. package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.d.ts +2 -0
  823. package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.d.ts.map +1 -0
  824. package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +67 -0
  825. package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -0
  826. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -1
  827. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +16 -3
  828. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -1
  829. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.d.ts +2 -0
  830. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.d.ts.map +1 -0
  831. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +67 -0
  832. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -0
  833. package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts +2 -0
  834. package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts.map +1 -0
  835. package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js +289 -0
  836. package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js.map +1 -0
  837. package/packages/pi-ai/package.json +1 -1
  838. package/packages/pi-ai/src/models/custom.ts +42 -0
  839. package/packages/pi-ai/src/providers/anthropic-auth.test.ts +1 -1
  840. package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -0
  841. package/packages/pi-ai/src/providers/anthropic-shared.ts +26 -5
  842. package/packages/pi-ai/src/providers/anthropic.ts +15 -4
  843. package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +98 -0
  844. package/packages/pi-ai/src/providers/openai-completions.ts +57 -16
  845. package/packages/pi-ai/src/providers/simple-options.ts +17 -1
  846. package/packages/pi-ai/src/providers/think-tag-parser.test.ts +44 -0
  847. package/packages/pi-ai/src/providers/think-tag-parser.ts +94 -0
  848. package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +200 -23
  849. package/packages/pi-ai/src/utils/oauth/github-copilot.ts +12 -2
  850. package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +84 -0
  851. package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +15 -5
  852. package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +84 -0
  853. package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +16 -5
  854. package/packages/pi-ai/src/utils/oauth/oauth-providers.test.ts +363 -0
  855. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  856. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +3 -2
  857. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
  858. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +2 -0
  859. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  860. package/packages/pi-coding-agent/dist/core/agent-session.js +32 -2
  861. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  862. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  863. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  864. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  865. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  866. package/packages/pi-coding-agent/dist/core/extensions/loader.js +4 -0
  867. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  868. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +35 -2
  869. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  870. package/packages/pi-coding-agent/dist/core/extensions/runner.js +233 -0
  871. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  872. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +205 -2
  873. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  874. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  875. package/packages/pi-coding-agent/dist/core/hooks-runner.d.ts +53 -0
  876. package/packages/pi-coding-agent/dist/core/hooks-runner.d.ts.map +1 -0
  877. package/packages/pi-coding-agent/dist/core/hooks-runner.js +337 -0
  878. package/packages/pi-coding-agent/dist/core/hooks-runner.js.map +1 -0
  879. package/packages/pi-coding-agent/dist/core/hooks-runner.test.d.ts +2 -0
  880. package/packages/pi-coding-agent/dist/core/hooks-runner.test.d.ts.map +1 -0
  881. package/packages/pi-coding-agent/dist/core/hooks-runner.test.js +234 -0
  882. package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -0
  883. package/packages/pi-coding-agent/dist/core/index.d.ts +1 -0
  884. package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -1
  885. package/packages/pi-coding-agent/dist/core/index.js +1 -0
  886. package/packages/pi-coding-agent/dist/core/index.js.map +1 -1
  887. package/packages/pi-coding-agent/dist/core/model-discovery.d.ts +3 -1
  888. package/packages/pi-coding-agent/dist/core/model-discovery.d.ts.map +1 -1
  889. package/packages/pi-coding-agent/dist/core/model-discovery.js +92 -12
  890. package/packages/pi-coding-agent/dist/core/model-discovery.js.map +1 -1
  891. package/packages/pi-coding-agent/dist/core/model-discovery.test.js +16 -1
  892. package/packages/pi-coding-agent/dist/core/model-discovery.test.js.map +1 -1
  893. package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.d.ts +2 -0
  894. package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.d.ts.map +1 -0
  895. package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.js +40 -0
  896. package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.js.map +1 -0
  897. package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts +2 -0
  898. package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts.map +1 -0
  899. package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js +203 -0
  900. package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js.map +1 -0
  901. package/packages/pi-coding-agent/dist/core/model-registry-discovery.test.js +61 -1
  902. package/packages/pi-coding-agent/dist/core/model-registry-discovery.test.js.map +1 -1
  903. package/packages/pi-coding-agent/dist/core/model-registry.d.ts +5 -0
  904. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  905. package/packages/pi-coding-agent/dist/core/model-registry.js +90 -10
  906. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  907. package/packages/pi-coding-agent/dist/core/redact-secrets.d.ts +2 -0
  908. package/packages/pi-coding-agent/dist/core/redact-secrets.d.ts.map +1 -0
  909. package/packages/pi-coding-agent/dist/core/redact-secrets.js +49 -0
  910. package/packages/pi-coding-agent/dist/core/redact-secrets.js.map +1 -0
  911. package/packages/pi-coding-agent/dist/core/redact-secrets.test.d.ts +2 -0
  912. package/packages/pi-coding-agent/dist/core/redact-secrets.test.d.ts.map +1 -0
  913. package/packages/pi-coding-agent/dist/core/redact-secrets.test.js +67 -0
  914. package/packages/pi-coding-agent/dist/core/redact-secrets.test.js.map +1 -0
  915. package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
  916. package/packages/pi-coding-agent/dist/core/session-manager.js +10 -6
  917. package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
  918. package/packages/pi-coding-agent/dist/core/session-manager.test.js +45 -1
  919. package/packages/pi-coding-agent/dist/core/session-manager.test.js.map +1 -1
  920. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +55 -0
  921. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  922. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  923. package/packages/pi-coding-agent/dist/index.d.ts +1 -1
  924. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  925. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  926. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts +1 -1
  927. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
  928. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +5 -4
  929. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
  930. package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.d.ts.map +1 -1
  931. package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js +13 -7
  932. package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js.map +1 -1
  933. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +7 -6
  934. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  935. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +29 -21
  936. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  937. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  938. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +13 -1
  939. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  940. package/packages/pi-coding-agent/package.json +1 -1
  941. package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +3 -2
  942. package/packages/pi-coding-agent/src/core/agent-session.ts +38 -2
  943. package/packages/pi-coding-agent/src/core/extensions/index.ts +16 -0
  944. package/packages/pi-coding-agent/src/core/extensions/loader.ts +5 -0
  945. package/packages/pi-coding-agent/src/core/extensions/runner.ts +351 -0
  946. package/packages/pi-coding-agent/src/core/extensions/types.ts +258 -0
  947. package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +269 -0
  948. package/packages/pi-coding-agent/src/core/hooks-runner.ts +460 -0
  949. package/packages/pi-coding-agent/src/core/index.ts +10 -0
  950. package/packages/pi-coding-agent/src/core/model-discovery.test.ts +19 -0
  951. package/packages/pi-coding-agent/src/core/model-discovery.ts +99 -12
  952. package/packages/pi-coding-agent/src/core/model-registry-auth-header.test.ts +44 -0
  953. package/packages/pi-coding-agent/src/core/model-registry-custom-caps.test.ts +245 -0
  954. package/packages/pi-coding-agent/src/core/model-registry-discovery.test.ts +75 -0
  955. package/packages/pi-coding-agent/src/core/model-registry.ts +102 -10
  956. package/packages/pi-coding-agent/src/core/redact-secrets.test.ts +86 -0
  957. package/packages/pi-coding-agent/src/core/redact-secrets.ts +58 -0
  958. package/packages/pi-coding-agent/src/core/session-manager.test.ts +65 -1
  959. package/packages/pi-coding-agent/src/core/session-manager.ts +10 -6
  960. package/packages/pi-coding-agent/src/core/settings-manager.ts +57 -0
  961. package/packages/pi-coding-agent/src/index.ts +16 -0
  962. package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +6 -6
  963. package/packages/pi-coding-agent/src/modes/interactive/components/provider-manager.ts +16 -7
  964. package/packages/pi-coding-agent/src/modes/interactive/components/skill-invocation-message.ts +36 -22
  965. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +13 -1
  966. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  967. package/packages/pi-tui/package.json +1 -1
  968. package/packages/rpc-client/package.json +1 -1
  969. package/pkg/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  970. package/pkg/dist/core/export-html/ansi-to-html.js +1 -0
  971. package/pkg/dist/core/export-html/ansi-to-html.js.map +1 -1
  972. package/pkg/dist/core/export-html/index.d.ts +1 -1
  973. package/pkg/dist/core/export-html/index.d.ts.map +1 -1
  974. package/pkg/dist/core/export-html/index.js +39 -5
  975. package/pkg/dist/core/export-html/index.js.map +1 -1
  976. package/pkg/dist/core/export-html/tool-renderer.d.ts +2 -2
  977. package/pkg/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  978. package/pkg/dist/core/export-html/tool-renderer.js.map +1 -1
  979. package/pkg/package.json +1 -1
  980. package/scripts/ensure-workspace-builds.cjs +2 -0
  981. package/scripts/install.js +512 -0
  982. package/scripts/link-workspace-packages.cjs +3 -0
  983. package/scripts/postinstall.js +9 -178
  984. package/src/resources/agents/researcher.md +1 -1
  985. package/src/resources/extensions/async-jobs/async-bash-tool.ts +1 -1
  986. package/src/resources/extensions/aws-auth/index.ts +2 -1
  987. package/src/resources/extensions/bg-shell/bg-shell-lifecycle.ts +4 -7
  988. package/src/resources/extensions/bg-shell/index.ts +2 -1
  989. package/src/resources/extensions/bg-shell/process-manager.ts +2 -1
  990. package/src/resources/extensions/browser-tools/index.ts +2 -1
  991. package/src/resources/extensions/claude-code-cli/index.ts +1 -1
  992. package/src/resources/extensions/claude-code-cli/partial-builder.ts +115 -23
  993. package/src/resources/extensions/claude-code-cli/readiness.ts +32 -8
  994. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +97 -26
  995. package/src/resources/extensions/claude-code-cli/tests/provider-registration.test.ts +27 -0
  996. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +176 -8
  997. package/src/resources/extensions/gsd/auto/loop-deps.ts +14 -0
  998. package/src/resources/extensions/gsd/auto/loop.ts +9 -0
  999. package/src/resources/extensions/gsd/auto/phases.ts +131 -10
  1000. package/src/resources/extensions/gsd/auto/run-unit.ts +40 -2
  1001. package/src/resources/extensions/gsd/auto/session.ts +35 -2
  1002. package/src/resources/extensions/gsd/auto-dispatch.ts +59 -16
  1003. package/src/resources/extensions/gsd/auto-model-selection.ts +71 -15
  1004. package/src/resources/extensions/gsd/auto-post-unit.ts +62 -3
  1005. package/src/resources/extensions/gsd/auto-prompts.ts +28 -1
  1006. package/src/resources/extensions/gsd/auto-recovery.ts +62 -1
  1007. package/src/resources/extensions/gsd/auto-start.ts +80 -74
  1008. package/src/resources/extensions/gsd/auto-verification.ts +33 -0
  1009. package/src/resources/extensions/gsd/auto-worktree.ts +62 -63
  1010. package/src/resources/extensions/gsd/auto.ts +73 -28
  1011. package/src/resources/extensions/gsd/blocked-models.ts +98 -0
  1012. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +120 -1
  1013. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +40 -9
  1014. package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +109 -0
  1015. package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +5 -0
  1016. package/src/resources/extensions/gsd/bootstrap/register-extension.ts +15 -0
  1017. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +54 -6
  1018. package/src/resources/extensions/gsd/bootstrap/system-context.ts +89 -26
  1019. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +35 -2
  1020. package/src/resources/extensions/gsd/clean-root-preflight.ts +111 -0
  1021. package/src/resources/extensions/gsd/commands-extract-learnings.ts +55 -90
  1022. package/src/resources/extensions/gsd/commands-prefs-wizard.ts +898 -32
  1023. package/src/resources/extensions/gsd/compaction-snapshot.ts +165 -0
  1024. package/src/resources/extensions/gsd/complexity-classifier.ts +5 -3
  1025. package/src/resources/extensions/gsd/db-writer.ts +88 -17
  1026. package/src/resources/extensions/gsd/dispatch-guard.ts +44 -2
  1027. package/src/resources/extensions/gsd/doctor-git-checks.ts +23 -27
  1028. package/src/resources/extensions/gsd/doctor-providers.ts +59 -6
  1029. package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +2 -0
  1030. package/src/resources/extensions/gsd/error-classifier.ts +36 -3
  1031. package/src/resources/extensions/gsd/exec-history.ts +153 -0
  1032. package/src/resources/extensions/gsd/exec-sandbox.ts +326 -0
  1033. package/src/resources/extensions/gsd/gitignore.ts +1 -1
  1034. package/src/resources/extensions/gsd/gsd-db.ts +186 -23
  1035. package/src/resources/extensions/gsd/guided-flow.ts +223 -2
  1036. package/src/resources/extensions/gsd/health-widget.ts +3 -1
  1037. package/src/resources/extensions/gsd/hook-emitter.ts +188 -0
  1038. package/src/resources/extensions/gsd/init-wizard.ts +15 -1
  1039. package/src/resources/extensions/gsd/journal.ts +2 -1
  1040. package/src/resources/extensions/gsd/key-manager.ts +28 -0
  1041. package/src/resources/extensions/gsd/memory-backfill.ts +140 -0
  1042. package/src/resources/extensions/gsd/memory-store.ts +26 -0
  1043. package/src/resources/extensions/gsd/model-router.ts +42 -1
  1044. package/src/resources/extensions/gsd/pre-execution-checks.ts +46 -10
  1045. package/src/resources/extensions/gsd/preferences-types.ts +46 -0
  1046. package/src/resources/extensions/gsd/preferences-validation.ts +79 -0
  1047. package/src/resources/extensions/gsd/preferences.ts +17 -17
  1048. package/src/resources/extensions/gsd/prompt-loader.ts +30 -7
  1049. package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  1050. package/src/resources/extensions/gsd/prompts/complete-slice.md +2 -2
  1051. package/src/resources/extensions/gsd/prompts/debug-diagnose.md +2 -0
  1052. package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -0
  1053. package/src/resources/extensions/gsd/prompts/discuss.md +29 -2
  1054. package/src/resources/extensions/gsd/prompts/execute-task.md +3 -2
  1055. package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
  1056. package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -0
  1057. package/src/resources/extensions/gsd/prompts/research-slice.md +1 -0
  1058. package/src/resources/extensions/gsd/prompts/system.md +1 -0
  1059. package/src/resources/extensions/gsd/safety/evidence-collector.ts +119 -0
  1060. package/src/resources/extensions/gsd/safety/file-change-validator.ts +17 -4
  1061. package/src/resources/extensions/gsd/safety/safety-harness.ts +9 -0
  1062. package/src/resources/extensions/gsd/state.ts +45 -4
  1063. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +188 -2
  1064. package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +95 -1
  1065. package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +12 -0
  1066. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +122 -0
  1067. package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +141 -0
  1068. package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +63 -0
  1069. package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +33 -3
  1070. package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +38 -0
  1071. package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +23 -0
  1072. package/src/resources/extensions/gsd/tests/blocked-models.test.ts +98 -0
  1073. package/src/resources/extensions/gsd/tests/bundled-skill-triggers.test.ts +54 -0
  1074. package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +186 -0
  1075. package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +68 -66
  1076. package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +123 -0
  1077. package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +15 -0
  1078. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +61 -1
  1079. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
  1080. package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
  1081. package/src/resources/extensions/gsd/tests/complexity-classifier.test.ts +3 -3
  1082. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
  1083. package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +42 -0
  1084. package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +8 -4
  1085. package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +9 -9
  1086. package/src/resources/extensions/gsd/tests/dispatch-guard-summary-db-mismatch.test.ts +77 -0
  1087. package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +148 -3
  1088. package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +1 -1
  1089. package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +306 -1
  1090. package/src/resources/extensions/gsd/tests/escalation.test.ts +1 -1
  1091. package/src/resources/extensions/gsd/tests/exec-history.test.ts +237 -0
  1092. package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +210 -0
  1093. package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +58 -0
  1094. package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +40 -9
  1095. package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +62 -0
  1096. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +447 -1
  1097. package/src/resources/extensions/gsd/tests/init-wizard.test.ts +27 -0
  1098. package/src/resources/extensions/gsd/tests/integration/doctor-git-symlink-cwd.test.ts +11 -0
  1099. package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +78 -0
  1100. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +1 -0
  1101. package/src/resources/extensions/gsd/tests/integration/gitignore-tracked-gsd.test.ts +1 -0
  1102. package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +30 -0
  1103. package/src/resources/extensions/gsd/tests/integration/worktree-e2e.test.ts +11 -0
  1104. package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +1 -1
  1105. package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +1 -1
  1106. package/src/resources/extensions/gsd/tests/issue-4540-regressions.test.ts +288 -0
  1107. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +37 -0
  1108. package/src/resources/extensions/gsd/tests/key-manager.test.ts +9 -0
  1109. package/src/resources/extensions/gsd/tests/load-memory-block.test.ts +36 -0
  1110. package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
  1111. package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +12 -0
  1112. package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
  1113. package/src/resources/extensions/gsd/tests/milestone-status-authoritative.test.ts +3 -3
  1114. package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +19 -0
  1115. package/src/resources/extensions/gsd/tests/plan-gate-failed-doctor-heal-hint.test.ts +37 -0
  1116. package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +14 -0
  1117. package/src/resources/extensions/gsd/tests/pre-exec-gate-loop.test.ts +272 -0
  1118. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +356 -0
  1119. package/src/resources/extensions/gsd/tests/preferences.test.ts +110 -0
  1120. package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +44 -0
  1121. package/src/resources/extensions/gsd/tests/prompt-loader-extension-dir.test.ts +49 -0
  1122. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +103 -4
  1123. package/src/resources/extensions/gsd/tests/ready-phrase-no-files-4573.test.ts +388 -0
  1124. package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +9 -3
  1125. package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +230 -0
  1126. package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +205 -0
  1127. package/src/resources/extensions/gsd/tests/save-gate-result-render.test.ts +95 -0
  1128. package/src/resources/extensions/gsd/tests/schema-v21-sequence.test.ts +413 -0
  1129. package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +32 -40
  1130. package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +56 -0
  1131. package/src/resources/extensions/gsd/tests/token-counter.test.ts +105 -1
  1132. package/src/resources/extensions/gsd/tests/tool-compatibility.test.ts +107 -0
  1133. package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +23 -0
  1134. package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +136 -8
  1135. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +65 -2
  1136. package/src/resources/extensions/gsd/tests/worktree-db.test.ts +35 -0
  1137. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +6 -1
  1138. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +78 -5
  1139. package/src/resources/extensions/gsd/tests/write-gate.test.ts +64 -0
  1140. package/src/resources/extensions/gsd/tests/zombie-gsd-state.test.ts +3 -1
  1141. package/src/resources/extensions/gsd/token-counter.ts +22 -5
  1142. package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
  1143. package/src/resources/extensions/gsd/tools/exec-search-tool.ts +81 -0
  1144. package/src/resources/extensions/gsd/tools/exec-tool.ts +183 -0
  1145. package/src/resources/extensions/gsd/tools/memory-tools.ts +31 -1
  1146. package/src/resources/extensions/gsd/tools/resume-tool.ts +40 -0
  1147. package/src/resources/extensions/gsd/uok/plan-v2.ts +26 -3
  1148. package/src/resources/extensions/gsd/workflow-logger.ts +4 -1
  1149. package/src/resources/extensions/gsd/workflow-mcp.ts +3 -0
  1150. package/src/resources/extensions/gsd/workflow-templates/spike.md +6 -0
  1151. package/src/resources/extensions/gsd/worktree-resolver.ts +54 -9
  1152. package/src/resources/extensions/mcp-client/index.ts +1 -1
  1153. package/src/resources/extensions/ollama/index.ts +3 -3
  1154. package/src/resources/extensions/ollama/ollama-chat-provider.ts +6 -18
  1155. package/src/resources/extensions/remote-questions/config.ts +15 -4
  1156. package/src/resources/extensions/search-the-web/command-search-provider.ts +5 -4
  1157. package/src/resources/extensions/search-the-web/index.ts +2 -1
  1158. package/src/resources/extensions/search-the-web/native-search.ts +48 -12
  1159. package/src/resources/extensions/shared/tests/format-utils.test.ts +5 -3
  1160. package/src/resources/extensions/universal-config/index.ts +1 -1
  1161. package/src/resources/skills/api-design/SKILL.md +190 -0
  1162. package/src/resources/skills/create-mcp-server/SKILL.md +121 -0
  1163. package/src/resources/skills/decompose-into-slices/SKILL.md +139 -0
  1164. package/src/resources/skills/dependency-upgrade/SKILL.md +158 -0
  1165. package/src/resources/skills/design-an-interface/SKILL.md +102 -0
  1166. package/src/resources/skills/forensics/SKILL.md +153 -0
  1167. package/src/resources/skills/grill-me/SKILL.md +93 -0
  1168. package/src/resources/skills/handoff/SKILL.md +121 -0
  1169. package/src/resources/skills/observability/SKILL.md +174 -0
  1170. package/src/resources/skills/security-review/SKILL.md +181 -0
  1171. package/src/resources/skills/spike-wrap-up/SKILL.md +138 -0
  1172. package/src/resources/skills/tdd/SKILL.md +112 -0
  1173. package/src/resources/skills/verify-before-complete/SKILL.md +98 -0
  1174. package/src/resources/skills/write-docs/SKILL.md +82 -0
  1175. package/src/resources/skills/write-milestone-brief/SKILL.md +135 -0
  1176. package/dist/web/standalone/.next/static/chunks/2826.e59e8578e2e28639.js +0 -9
  1177. package/dist/web/standalone/.next/static/chunks/app/page-151349214571e2b6.js +0 -1
  1178. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  1179. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  1180. package/packages/native/tsconfig.tsbuildinfo +0 -1
  1181. /package/dist/web/standalone/.next/static/{ssX7BLv3Dw9Fb4CtrCGeR → gy6_foLMsEzdGBT19c3hr}/_buildManifest.js +0 -0
  1182. /package/dist/web/standalone/.next/static/{ssX7BLv3Dw9Fb4CtrCGeR → gy6_foLMsEzdGBT19c3hr}/_ssgManifest.js +0 -0
@@ -0,0 +1,267 @@
1
+ import { providerDisplayName } from "./model-selector.js";
2
+ import { Container, fuzzyFilter, Input, Key, matchesKey, Spacer, Text, } from "@gsd/pi-tui";
3
+ import { getKeybindings } from "../../../pi-tui-compat.js";
4
+ import { theme } from "../../../theme.js";
5
+ import { DynamicBorder } from "./dynamic-border.js";
6
+ function isEnabled(enabledIds, id) {
7
+ return enabledIds === null || enabledIds.includes(id);
8
+ }
9
+ function toggle(enabledIds, id) {
10
+ if (enabledIds === null)
11
+ return [id]; // First toggle: start with only this one
12
+ const index = enabledIds.indexOf(id);
13
+ if (index >= 0)
14
+ return [...enabledIds.slice(0, index), ...enabledIds.slice(index + 1)];
15
+ return [...enabledIds, id];
16
+ }
17
+ function enableAll(enabledIds, allIds, targetIds) {
18
+ if (enabledIds === null)
19
+ return null; // Already all enabled
20
+ const targets = targetIds ?? allIds;
21
+ const result = [...enabledIds];
22
+ for (const id of targets) {
23
+ if (!result.includes(id))
24
+ result.push(id);
25
+ }
26
+ return result.length === allIds.length ? null : result;
27
+ }
28
+ function clearAll(enabledIds, allIds, targetIds) {
29
+ if (enabledIds === null) {
30
+ return targetIds ? allIds.filter((id) => !targetIds.includes(id)) : [];
31
+ }
32
+ const targets = new Set(targetIds ?? enabledIds);
33
+ return enabledIds.filter((id) => !targets.has(id));
34
+ }
35
+ function move(enabledIds, allIds, id, delta) {
36
+ const list = enabledIds ?? [...allIds];
37
+ const index = list.indexOf(id);
38
+ if (index < 0)
39
+ return list;
40
+ const newIndex = index + delta;
41
+ if (newIndex < 0 || newIndex >= list.length)
42
+ return list;
43
+ const result = [...list];
44
+ [result[index], result[newIndex]] = [result[newIndex], result[index]];
45
+ return result;
46
+ }
47
+ function getSortedIds(enabledIds, allIds) {
48
+ if (enabledIds === null)
49
+ return allIds;
50
+ const enabledSet = new Set(enabledIds);
51
+ return [...enabledIds, ...allIds.filter((id) => !enabledSet.has(id))];
52
+ }
53
+ /**
54
+ * Component for enabling/disabling models for Ctrl+P cycling.
55
+ * Changes are session-only until explicitly persisted with Ctrl+S.
56
+ */
57
+ export class ScopedModelsSelectorComponent extends Container {
58
+ get focused() {
59
+ return this._focused;
60
+ }
61
+ set focused(value) {
62
+ this._focused = value;
63
+ this.searchInput.focused = value;
64
+ }
65
+ constructor(config, callbacks) {
66
+ super();
67
+ this.modelsById = new Map();
68
+ this.allIds = [];
69
+ this.enabledIds = null;
70
+ this.filteredItems = [];
71
+ this.selectedIndex = 0;
72
+ // Focusable implementation - propagate to searchInput for IME cursor positioning
73
+ this._focused = false;
74
+ this.maxVisible = 15;
75
+ this.isDirty = false;
76
+ this.callbacks = callbacks;
77
+ for (const model of config.allModels) {
78
+ const fullId = `${model.provider}/${model.id}`;
79
+ this.modelsById.set(fullId, model);
80
+ this.allIds.push(fullId);
81
+ }
82
+ this.enabledIds = config.hasEnabledModelsFilter ? [...config.enabledModelIds] : null;
83
+ this.filteredItems = this.buildItems();
84
+ // Header
85
+ this.addChild(new DynamicBorder());
86
+ this.addChild(new Spacer(1));
87
+ this.addChild(new Text(theme.fg("accent", theme.bold("Model Configuration")), 0, 0));
88
+ this.addChild(new Text(theme.fg("muted", "Session-only. Ctrl+S to save to settings."), 0, 0));
89
+ this.addChild(new Spacer(1));
90
+ // Search input
91
+ this.searchInput = new Input();
92
+ this.addChild(this.searchInput);
93
+ this.addChild(new Spacer(1));
94
+ // List container
95
+ this.listContainer = new Container();
96
+ this.addChild(this.listContainer);
97
+ // Footer hint
98
+ this.addChild(new Spacer(1));
99
+ this.footerText = new Text(this.getFooterText(), 0, 0);
100
+ this.addChild(this.footerText);
101
+ this.addChild(new DynamicBorder());
102
+ this.updateList();
103
+ }
104
+ buildItems() {
105
+ // Filter out IDs that no longer have a corresponding model (e.g., after logout)
106
+ return getSortedIds(this.enabledIds, this.allIds)
107
+ .filter((id) => this.modelsById.has(id))
108
+ .map((id) => ({
109
+ fullId: id,
110
+ model: this.modelsById.get(id),
111
+ enabled: isEnabled(this.enabledIds, id),
112
+ }));
113
+ }
114
+ getFooterText() {
115
+ const enabledCount = this.enabledIds?.length ?? this.allIds.length;
116
+ const allEnabled = this.enabledIds === null;
117
+ const countText = allEnabled ? "all enabled" : `${enabledCount}/${this.allIds.length} enabled`;
118
+ const parts = ["Enter toggle", "^A all", "^X clear", "^P provider", `${process.platform === "darwin" ? "⌥↑↓" : "Alt+↑↓"} reorder`, "^S save", countText];
119
+ return this.isDirty
120
+ ? theme.fg("dim", ` ${parts.join(" · ")} `) + theme.fg("warning", "(unsaved)")
121
+ : theme.fg("dim", ` ${parts.join(" · ")}`);
122
+ }
123
+ refresh() {
124
+ const query = this.searchInput.getValue();
125
+ const items = this.buildItems();
126
+ this.filteredItems = query ? fuzzyFilter(items, query, (i) => `${i.model.id} ${i.model.provider}`) : items;
127
+ this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredItems.length - 1));
128
+ this.updateList();
129
+ this.footerText.setText(this.getFooterText());
130
+ }
131
+ updateList() {
132
+ this.listContainer.clear();
133
+ if (this.filteredItems.length === 0) {
134
+ this.listContainer.addChild(new Text(theme.fg("muted", " No matching models"), 0, 0));
135
+ return;
136
+ }
137
+ const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(this.maxVisible / 2), this.filteredItems.length - this.maxVisible));
138
+ const endIndex = Math.min(startIndex + this.maxVisible, this.filteredItems.length);
139
+ const allEnabled = this.enabledIds === null;
140
+ for (let i = startIndex; i < endIndex; i++) {
141
+ const item = this.filteredItems[i];
142
+ const isSelected = i === this.selectedIndex;
143
+ const prefix = isSelected ? theme.fg("accent", "→ ") : " ";
144
+ const modelText = isSelected ? theme.fg("accent", item.model.id) : item.model.id;
145
+ const providerBadge = theme.fg("muted", ` [${providerDisplayName(item.model.provider)}]`);
146
+ const status = allEnabled ? "" : item.enabled ? theme.fg("success", " ✓") : theme.fg("dim", " ✗");
147
+ this.listContainer.addChild(new Text(`${prefix}${modelText}${providerBadge}${status}`, 0, 0));
148
+ }
149
+ // Add scroll indicator if needed
150
+ if (startIndex > 0 || endIndex < this.filteredItems.length) {
151
+ this.listContainer.addChild(new Text(theme.fg("muted", ` (${this.selectedIndex + 1}/${this.filteredItems.length})`), 0, 0));
152
+ }
153
+ if (this.filteredItems.length > 0) {
154
+ const selected = this.filteredItems[this.selectedIndex];
155
+ this.listContainer.addChild(new Spacer(1));
156
+ this.listContainer.addChild(new Text(theme.fg("muted", ` Model Name: ${selected.model.name}`), 0, 0));
157
+ }
158
+ }
159
+ handleInput(data) {
160
+ const kb = getKeybindings();
161
+ // Navigation
162
+ if (kb.matches(data, "selectUp")) {
163
+ if (this.filteredItems.length === 0)
164
+ return;
165
+ this.selectedIndex = this.selectedIndex === 0 ? this.filteredItems.length - 1 : this.selectedIndex - 1;
166
+ this.updateList();
167
+ return;
168
+ }
169
+ if (kb.matches(data, "selectDown")) {
170
+ if (this.filteredItems.length === 0)
171
+ return;
172
+ this.selectedIndex = this.selectedIndex === this.filteredItems.length - 1 ? 0 : this.selectedIndex + 1;
173
+ this.updateList();
174
+ return;
175
+ }
176
+ // Alt+Up/Down - Reorder enabled models
177
+ if (matchesKey(data, Key.alt("up")) || matchesKey(data, Key.alt("down"))) {
178
+ const item = this.filteredItems[this.selectedIndex];
179
+ if (item && isEnabled(this.enabledIds, item.fullId)) {
180
+ const delta = matchesKey(data, Key.alt("up")) ? -1 : 1;
181
+ const enabledList = this.enabledIds ?? this.allIds;
182
+ const currentIndex = enabledList.indexOf(item.fullId);
183
+ const newIndex = currentIndex + delta;
184
+ // Only move if within bounds
185
+ if (newIndex >= 0 && newIndex < enabledList.length) {
186
+ this.enabledIds = move(this.enabledIds, this.allIds, item.fullId, delta);
187
+ this.isDirty = true;
188
+ this.selectedIndex += delta;
189
+ this.refresh();
190
+ }
191
+ }
192
+ return;
193
+ }
194
+ // Toggle on Enter
195
+ if (matchesKey(data, Key.enter)) {
196
+ const item = this.filteredItems[this.selectedIndex];
197
+ if (item) {
198
+ const wasAllEnabled = this.enabledIds === null;
199
+ this.enabledIds = toggle(this.enabledIds, item.fullId);
200
+ this.isDirty = true;
201
+ if (wasAllEnabled)
202
+ this.callbacks.onClearAll();
203
+ this.callbacks.onModelToggle(item.fullId, isEnabled(this.enabledIds, item.fullId));
204
+ this.refresh();
205
+ }
206
+ return;
207
+ }
208
+ // Ctrl+A - Enable all (filtered if search active, otherwise all)
209
+ if (matchesKey(data, Key.ctrl("a"))) {
210
+ const targetIds = this.searchInput.getValue() ? this.filteredItems.map((i) => i.fullId) : undefined;
211
+ this.enabledIds = enableAll(this.enabledIds, this.allIds, targetIds);
212
+ this.isDirty = true;
213
+ this.callbacks.onEnableAll(targetIds ?? this.allIds);
214
+ this.refresh();
215
+ return;
216
+ }
217
+ // Ctrl+X - Clear all (filtered if search active, otherwise all)
218
+ if (matchesKey(data, Key.ctrl("x"))) {
219
+ const targetIds = this.searchInput.getValue() ? this.filteredItems.map((i) => i.fullId) : undefined;
220
+ this.enabledIds = clearAll(this.enabledIds, this.allIds, targetIds);
221
+ this.isDirty = true;
222
+ this.callbacks.onClearAll();
223
+ this.refresh();
224
+ return;
225
+ }
226
+ // Ctrl+P - Toggle provider of current item
227
+ if (matchesKey(data, Key.ctrl("p"))) {
228
+ const item = this.filteredItems[this.selectedIndex];
229
+ if (item) {
230
+ const provider = item.model.provider;
231
+ const providerIds = this.allIds.filter((id) => this.modelsById.get(id).provider === provider);
232
+ const allEnabled = providerIds.every((id) => isEnabled(this.enabledIds, id));
233
+ this.enabledIds = allEnabled
234
+ ? clearAll(this.enabledIds, this.allIds, providerIds)
235
+ : enableAll(this.enabledIds, this.allIds, providerIds);
236
+ this.isDirty = true;
237
+ this.callbacks.onToggleProvider(provider, providerIds, !allEnabled);
238
+ this.refresh();
239
+ }
240
+ return;
241
+ }
242
+ // Ctrl+S - Save/persist to settings
243
+ if (matchesKey(data, Key.ctrl("s"))) {
244
+ this.callbacks.onPersist(this.enabledIds ?? [...this.allIds]);
245
+ this.isDirty = false;
246
+ this.footerText.setText(this.getFooterText());
247
+ return;
248
+ }
249
+ // Ctrl+C - always cancel immediately
250
+ if (matchesKey(data, Key.ctrl("c"))) {
251
+ this.callbacks.onCancel();
252
+ return;
253
+ }
254
+ // Escape - cancel
255
+ if (matchesKey(data, Key.escape)) {
256
+ this.callbacks.onCancel();
257
+ return;
258
+ }
259
+ // Pass everything else to search input
260
+ this.searchInput.handleInput(data);
261
+ this.refresh();
262
+ }
263
+ getSearchInput() {
264
+ return this.searchInput;
265
+ }
266
+ }
267
+ //# sourceMappingURL=scoped-models-selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoped-models-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/scoped-models-selector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACN,SAAS,EAET,WAAW,EACX,KAAK,EACL,GAAG,EACH,UAAU,EACV,MAAM,EACN,IAAI,GACJ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKpD,SAAS,SAAS,CAAC,UAAsB,EAAE,EAAU;IACpD,OAAO,UAAU,KAAK,IAAI,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,MAAM,CAAC,UAAsB,EAAE,EAAU;IACjD,IAAI,UAAU,KAAK,IAAI;QAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,yCAAyC;IAC/E,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,SAAS,CAAC,UAAsB,EAAE,MAAgB,EAAE,SAAoB;IAChF,IAAI,UAAU,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC,CAAC,sBAAsB;IAC5D,MAAM,OAAO,GAAG,SAAS,IAAI,MAAM,CAAC;IACpC,MAAM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IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACrC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YAC9D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;YAC9C,OAAO;QACR,CAAC;QAED,qCAAqC;QACrC,IAAI,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACrC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;YAC1B,OAAO;QACR,CAAC;QAED,kBAAkB;QAClB,IAAI,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;YAC1B,OAAO;QACR,CAAC;QAED,uCAAuC;QACvC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IAED,cAAc;QACb,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;CACD","sourcesContent":["import type { Api, Model } from \"@gsd/pi-ai\";\nimport { providerDisplayName } from \"./model-selector.js\";\nimport {\n\tContainer,\n\ttype Focusable,\n\tfuzzyFilter,\n\tInput,\n\tKey,\n\tmatchesKey,\n\tSpacer,\n\tText,\n} from \"@gsd/pi-tui\";\nimport { getKeybindings } from \"../../../pi-tui-compat.js\";\nimport { theme } from \"../../../theme.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\n\n// EnabledIds: null = all enabled (no filter), string[] = explicit ordered list\ntype EnabledIds = string[] | null;\n\nfunction isEnabled(enabledIds: EnabledIds, id: string): boolean {\n\treturn enabledIds === null || enabledIds.includes(id);\n}\n\nfunction toggle(enabledIds: EnabledIds, id: string): EnabledIds {\n\tif (enabledIds === null) return [id]; // First toggle: start with only this one\n\tconst index = enabledIds.indexOf(id);\n\tif (index >= 0) return [...enabledIds.slice(0, index), ...enabledIds.slice(index + 1)];\n\treturn [...enabledIds, id];\n}\n\nfunction enableAll(enabledIds: EnabledIds, allIds: string[], targetIds?: string[]): EnabledIds {\n\tif (enabledIds === null) return null; // Already all enabled\n\tconst targets = targetIds ?? allIds;\n\tconst result = [...enabledIds];\n\tfor (const id of targets) {\n\t\tif (!result.includes(id)) result.push(id);\n\t}\n\treturn result.length === allIds.length ? null : result;\n}\n\nfunction clearAll(enabledIds: EnabledIds, allIds: string[], targetIds?: string[]): EnabledIds {\n\tif (enabledIds === null) {\n\t\treturn targetIds ? allIds.filter((id) => !targetIds.includes(id)) : [];\n\t}\n\tconst targets = new Set(targetIds ?? enabledIds);\n\treturn enabledIds.filter((id) => !targets.has(id));\n}\n\nfunction move(enabledIds: EnabledIds, allIds: string[], id: string, delta: number): EnabledIds {\n\tconst list = enabledIds ?? [...allIds];\n\tconst index = list.indexOf(id);\n\tif (index < 0) return list;\n\tconst newIndex = index + delta;\n\tif (newIndex < 0 || newIndex >= list.length) return list;\n\tconst result = [...list];\n\t[result[index], result[newIndex]] = [result[newIndex], result[index]];\n\treturn result;\n}\n\nfunction getSortedIds(enabledIds: EnabledIds, allIds: string[]): string[] {\n\tif (enabledIds === null) return allIds;\n\tconst enabledSet = new Set(enabledIds);\n\treturn [...enabledIds, ...allIds.filter((id) => !enabledSet.has(id))];\n}\n\ninterface ModelItem {\n\tfullId: string;\n\tmodel: Model<Api>;\n\tenabled: boolean;\n}\n\nexport interface ModelsConfig {\n\tallModels: Model<Api>[];\n\tenabledModelIds: Set<string>;\n\t/** true if enabledModels setting is defined (empty = all enabled) */\n\thasEnabledModelsFilter: boolean;\n}\n\nexport interface ModelsCallbacks {\n\t/** Called when a model is toggled (session-only, no persist) */\n\tonModelToggle: (modelId: string, enabled: boolean) => void;\n\t/** Called when user wants to persist current selection to settings */\n\tonPersist: (enabledModelIds: string[]) => void;\n\t/** Called when user enables all models. Returns list of all model IDs. */\n\tonEnableAll: (allModelIds: string[]) => void;\n\t/** Called when user clears all models */\n\tonClearAll: () => void;\n\t/** Called when user toggles all models for a provider. Returns affected model IDs. */\n\tonToggleProvider: (provider: string, modelIds: string[], enabled: boolean) => void;\n\tonCancel: () => void;\n}\n\n/**\n * Component for enabling/disabling models for Ctrl+P cycling.\n * Changes are session-only until explicitly persisted with Ctrl+S.\n */\nexport class ScopedModelsSelectorComponent extends Container implements Focusable {\n\tprivate modelsById: Map<string, Model<Api>> = new Map();\n\tprivate allIds: string[] = [];\n\tprivate enabledIds: EnabledIds = null;\n\tprivate filteredItems: ModelItem[] = [];\n\tprivate selectedIndex = 0;\n\tprivate searchInput: Input;\n\n\t// Focusable implementation - propagate to searchInput for IME cursor positioning\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.searchInput.focused = value;\n\t}\n\tprivate listContainer: Container;\n\tprivate footerText: Text;\n\tprivate callbacks: ModelsCallbacks;\n\tprivate maxVisible = 15;\n\tprivate isDirty = false;\n\n\tconstructor(config: ModelsConfig, callbacks: ModelsCallbacks) {\n\t\tsuper();\n\t\tthis.callbacks = callbacks;\n\n\t\tfor (const model of config.allModels) {\n\t\t\tconst fullId = `${model.provider}/${model.id}`;\n\t\t\tthis.modelsById.set(fullId, model);\n\t\t\tthis.allIds.push(fullId);\n\t\t}\n\n\t\tthis.enabledIds = config.hasEnabledModelsFilter ? [...config.enabledModelIds] : null;\n\t\tthis.filteredItems = this.buildItems();\n\n\t\t// Header\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(theme.fg(\"accent\", theme.bold(\"Model Configuration\")), 0, 0));\n\t\tthis.addChild(new Text(theme.fg(\"muted\", \"Session-only. Ctrl+S to save to settings.\"), 0, 0));\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Search input\n\t\tthis.searchInput = new Input();\n\t\tthis.addChild(this.searchInput);\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// List container\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\n\t\t// Footer hint\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.footerText = new Text(this.getFooterText(), 0, 0);\n\t\tthis.addChild(this.footerText);\n\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.updateList();\n\t}\n\n\tprivate buildItems(): ModelItem[] {\n\t\t// Filter out IDs that no longer have a corresponding model (e.g., after logout)\n\t\treturn getSortedIds(this.enabledIds, this.allIds)\n\t\t\t.filter((id) => this.modelsById.has(id))\n\t\t\t.map((id) => ({\n\t\t\t\tfullId: id,\n\t\t\t\tmodel: this.modelsById.get(id)!,\n\t\t\t\tenabled: isEnabled(this.enabledIds, id),\n\t\t\t}));\n\t}\n\n\tprivate getFooterText(): string {\n\t\tconst enabledCount = this.enabledIds?.length ?? this.allIds.length;\n\t\tconst allEnabled = this.enabledIds === null;\n\t\tconst countText = allEnabled ? \"all enabled\" : `${enabledCount}/${this.allIds.length} enabled`;\n\t\tconst parts = [\"Enter toggle\", \"^A all\", \"^X clear\", \"^P provider\", `${process.platform === \"darwin\" ? \"⌥↑↓\" : \"Alt+↑↓\"} reorder`, \"^S save\", countText];\n\t\treturn this.isDirty\n\t\t\t? theme.fg(\"dim\", ` ${parts.join(\" · \")} `) + theme.fg(\"warning\", \"(unsaved)\")\n\t\t\t: theme.fg(\"dim\", ` ${parts.join(\" · \")}`);\n\t}\n\n\tprivate refresh(): void {\n\t\tconst query = this.searchInput.getValue();\n\t\tconst items = this.buildItems();\n\t\tthis.filteredItems = query ? fuzzyFilter(items, query, (i) => `${i.model.id} ${i.model.provider}`) : items;\n\t\tthis.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredItems.length - 1));\n\t\tthis.updateList();\n\t\tthis.footerText.setText(this.getFooterText());\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\n\t\tif (this.filteredItems.length === 0) {\n\t\t\tthis.listContainer.addChild(new Text(theme.fg(\"muted\", \" No matching models\"), 0, 0));\n\t\t\treturn;\n\t\t}\n\n\t\tconst startIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.selectedIndex - Math.floor(this.maxVisible / 2), this.filteredItems.length - this.maxVisible),\n\t\t);\n\t\tconst endIndex = Math.min(startIndex + this.maxVisible, this.filteredItems.length);\n\t\tconst allEnabled = this.enabledIds === null;\n\n\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\tconst item = this.filteredItems[i]!;\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst prefix = isSelected ? theme.fg(\"accent\", \"→ \") : \" \";\n\t\t\tconst modelText = isSelected ? theme.fg(\"accent\", item.model.id) : item.model.id;\n\t\t\tconst providerBadge = theme.fg(\"muted\", ` [${providerDisplayName(item.model.provider)}]`);\n\t\t\tconst status = allEnabled ? \"\" : item.enabled ? theme.fg(\"success\", \" ✓\") : theme.fg(\"dim\", \" ✗\");\n\t\t\tthis.listContainer.addChild(new Text(`${prefix}${modelText}${providerBadge}${status}`, 0, 0));\n\t\t}\n\n\t\t// Add scroll indicator if needed\n\t\tif (startIndex > 0 || endIndex < this.filteredItems.length) {\n\t\t\tthis.listContainer.addChild(\n\t\t\t\tnew Text(theme.fg(\"muted\", ` (${this.selectedIndex + 1}/${this.filteredItems.length})`), 0, 0),\n\t\t\t);\n\t\t}\n\n\t\tif (this.filteredItems.length > 0) {\n\t\t\tconst selected = this.filteredItems[this.selectedIndex];\n\t\t\tthis.listContainer.addChild(new Spacer(1));\n\t\t\tthis.listContainer.addChild(new Text(theme.fg(\"muted\", ` Model Name: ${selected.model.name}`), 0, 0));\n\t\t}\n\t}\n\n\thandleInput(data: string): void {\n\t\tconst kb = getKeybindings();\n\n\t\t// Navigation\n\t\tif (kb.matches(data, \"selectUp\")) {\n\t\t\tif (this.filteredItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === 0 ? this.filteredItems.length - 1 : this.selectedIndex - 1;\n\t\t\tthis.updateList();\n\t\t\treturn;\n\t\t}\n\t\tif (kb.matches(data, \"selectDown\")) {\n\t\t\tif (this.filteredItems.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === this.filteredItems.length - 1 ? 0 : this.selectedIndex + 1;\n\t\t\tthis.updateList();\n\t\t\treturn;\n\t\t}\n\n\t\t// Alt+Up/Down - Reorder enabled models\n\t\tif (matchesKey(data, Key.alt(\"up\")) || matchesKey(data, Key.alt(\"down\"))) {\n\t\t\tconst item = this.filteredItems[this.selectedIndex];\n\t\t\tif (item && isEnabled(this.enabledIds, item.fullId)) {\n\t\t\t\tconst delta = matchesKey(data, Key.alt(\"up\")) ? -1 : 1;\n\t\t\t\tconst enabledList = this.enabledIds ?? this.allIds;\n\t\t\t\tconst currentIndex = enabledList.indexOf(item.fullId);\n\t\t\t\tconst newIndex = currentIndex + delta;\n\t\t\t\t// Only move if within bounds\n\t\t\t\tif (newIndex >= 0 && newIndex < enabledList.length) {\n\t\t\t\t\tthis.enabledIds = move(this.enabledIds, this.allIds, item.fullId, delta);\n\t\t\t\t\tthis.isDirty = true;\n\t\t\t\t\tthis.selectedIndex += delta;\n\t\t\t\t\tthis.refresh();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Toggle on Enter\n\t\tif (matchesKey(data, Key.enter)) {\n\t\t\tconst item = this.filteredItems[this.selectedIndex];\n\t\t\tif (item) {\n\t\t\t\tconst wasAllEnabled = this.enabledIds === null;\n\t\t\t\tthis.enabledIds = toggle(this.enabledIds, item.fullId);\n\t\t\t\tthis.isDirty = true;\n\t\t\t\tif (wasAllEnabled) this.callbacks.onClearAll();\n\t\t\t\tthis.callbacks.onModelToggle(item.fullId, isEnabled(this.enabledIds, item.fullId));\n\t\t\t\tthis.refresh();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Ctrl+A - Enable all (filtered if search active, otherwise all)\n\t\tif (matchesKey(data, Key.ctrl(\"a\"))) {\n\t\t\tconst targetIds = this.searchInput.getValue() ? this.filteredItems.map((i) => i.fullId) : undefined;\n\t\t\tthis.enabledIds = enableAll(this.enabledIds, this.allIds, targetIds);\n\t\t\tthis.isDirty = true;\n\t\t\tthis.callbacks.onEnableAll(targetIds ?? this.allIds);\n\t\t\tthis.refresh();\n\t\t\treturn;\n\t\t}\n\n\t\t// Ctrl+X - Clear all (filtered if search active, otherwise all)\n\t\tif (matchesKey(data, Key.ctrl(\"x\"))) {\n\t\t\tconst targetIds = this.searchInput.getValue() ? this.filteredItems.map((i) => i.fullId) : undefined;\n\t\t\tthis.enabledIds = clearAll(this.enabledIds, this.allIds, targetIds);\n\t\t\tthis.isDirty = true;\n\t\t\tthis.callbacks.onClearAll();\n\t\t\tthis.refresh();\n\t\t\treturn;\n\t\t}\n\n\t\t// Ctrl+P - Toggle provider of current item\n\t\tif (matchesKey(data, Key.ctrl(\"p\"))) {\n\t\t\tconst item = this.filteredItems[this.selectedIndex];\n\t\t\tif (item) {\n\t\t\t\tconst provider = item.model.provider;\n\t\t\t\tconst providerIds = this.allIds.filter((id) => this.modelsById.get(id)!.provider === provider);\n\t\t\t\tconst allEnabled = providerIds.every((id) => isEnabled(this.enabledIds, id));\n\t\t\t\tthis.enabledIds = allEnabled\n\t\t\t\t\t? clearAll(this.enabledIds, this.allIds, providerIds)\n\t\t\t\t\t: enableAll(this.enabledIds, this.allIds, providerIds);\n\t\t\t\tthis.isDirty = true;\n\t\t\t\tthis.callbacks.onToggleProvider(provider, providerIds, !allEnabled);\n\t\t\t\tthis.refresh();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Ctrl+S - Save/persist to settings\n\t\tif (matchesKey(data, Key.ctrl(\"s\"))) {\n\t\t\tthis.callbacks.onPersist(this.enabledIds ?? [...this.allIds]);\n\t\t\tthis.isDirty = false;\n\t\t\tthis.footerText.setText(this.getFooterText());\n\t\t\treturn;\n\t\t}\n\n\t\t// Ctrl+C - always cancel immediately\n\t\tif (matchesKey(data, Key.ctrl(\"c\"))) {\n\t\t\tthis.callbacks.onCancel();\n\t\t\treturn;\n\t\t}\n\n\t\t// Escape - cancel\n\t\tif (matchesKey(data, Key.escape)) {\n\t\t\tthis.callbacks.onCancel();\n\t\t\treturn;\n\t\t}\n\n\t\t// Pass everything else to search input\n\t\tthis.searchInput.handleInput(data);\n\t\tthis.refresh();\n\t}\n\n\tgetSearchInput(): Input {\n\t\treturn this.searchInput;\n\t}\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import type { SessionInfo } from "@gsd/agent-types";
2
+ export type SortMode = "threaded" | "recent" | "relevance";
3
+ export type NameFilter = "all" | "named";
4
+ export interface ParsedSearchQuery {
5
+ mode: "tokens" | "regex";
6
+ tokens: {
7
+ kind: "fuzzy" | "phrase";
8
+ value: string;
9
+ }[];
10
+ regex: RegExp | null;
11
+ /** If set, parsing failed and we should treat query as non-matching. */
12
+ error?: string;
13
+ }
14
+ export interface MatchResult {
15
+ matches: boolean;
16
+ /** Lower is better; only meaningful when matches === true */
17
+ score: number;
18
+ }
19
+ export declare function hasSessionName(session: SessionInfo): boolean;
20
+ export declare function filterAndSortSessions(sessions: SessionInfo[], query: string, sortMode: SortMode, nameFilter?: NameFilter): SessionInfo[];
21
+ //# sourceMappingURL=session-selector-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-selector-search.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-selector-search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE3D,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,CAAC;AAEzC,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,EAAE;QAAE,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;CACd;AAUD,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAE5D;AA4HD,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,EAClB,UAAU,GAAE,UAAkB,GAC5B,WAAW,EAAE,CAiCf"}
@@ -0,0 +1,155 @@
1
+ import { fuzzyMatch } from "@gsd/pi-tui";
2
+ function normalizeWhitespaceLower(text) {
3
+ return text.toLowerCase().replace(/\s+/g, " ").trim();
4
+ }
5
+ function getSessionSearchText(session) {
6
+ return `${session.id} ${session.name ?? ""} ${session.allMessagesText} ${session.cwd}`;
7
+ }
8
+ export function hasSessionName(session) {
9
+ return Boolean(session.name?.trim());
10
+ }
11
+ function matchesNameFilter(session, filter) {
12
+ if (filter === "all")
13
+ return true;
14
+ return hasSessionName(session);
15
+ }
16
+ function parseSearchQuery(query) {
17
+ const trimmed = query.trim();
18
+ if (!trimmed) {
19
+ return { mode: "tokens", tokens: [], regex: null };
20
+ }
21
+ // Regex mode: re:<pattern>
22
+ if (trimmed.startsWith("re:")) {
23
+ const pattern = trimmed.slice(3).trim();
24
+ if (!pattern) {
25
+ return { mode: "regex", tokens: [], regex: null, error: "Empty regex" };
26
+ }
27
+ try {
28
+ return { mode: "regex", tokens: [], regex: new RegExp(pattern, "i") };
29
+ }
30
+ catch (err) {
31
+ const msg = err instanceof Error ? err.message : String(err);
32
+ return { mode: "regex", tokens: [], regex: null, error: msg };
33
+ }
34
+ }
35
+ // Token mode with quote support.
36
+ // Example: foo "node cve" bar
37
+ const tokens = [];
38
+ let buf = "";
39
+ let inQuote = false;
40
+ let hadUnclosedQuote = false;
41
+ const flush = (kind) => {
42
+ const v = buf.trim();
43
+ buf = "";
44
+ if (!v)
45
+ return;
46
+ tokens.push({ kind, value: v });
47
+ };
48
+ for (let i = 0; i < trimmed.length; i++) {
49
+ const ch = trimmed[i];
50
+ if (ch === '"') {
51
+ if (inQuote) {
52
+ flush("phrase");
53
+ inQuote = false;
54
+ }
55
+ else {
56
+ flush("fuzzy");
57
+ inQuote = true;
58
+ }
59
+ continue;
60
+ }
61
+ if (!inQuote && /\s/.test(ch)) {
62
+ flush("fuzzy");
63
+ continue;
64
+ }
65
+ buf += ch;
66
+ }
67
+ if (inQuote) {
68
+ hadUnclosedQuote = true;
69
+ }
70
+ // If quotes were unbalanced, fall back to plain whitespace tokenization.
71
+ if (hadUnclosedQuote) {
72
+ return {
73
+ mode: "tokens",
74
+ tokens: trimmed
75
+ .split(/\s+/)
76
+ .map((t) => t.trim())
77
+ .filter((t) => t.length > 0)
78
+ .map((t) => ({ kind: "fuzzy", value: t })),
79
+ regex: null,
80
+ };
81
+ }
82
+ flush(inQuote ? "phrase" : "fuzzy");
83
+ return { mode: "tokens", tokens, regex: null };
84
+ }
85
+ function matchSession(session, parsed) {
86
+ const text = getSessionSearchText(session);
87
+ if (parsed.mode === "regex") {
88
+ if (!parsed.regex) {
89
+ return { matches: false, score: 0 };
90
+ }
91
+ const idx = text.search(parsed.regex);
92
+ if (idx < 0)
93
+ return { matches: false, score: 0 };
94
+ return { matches: true, score: idx * 0.1 };
95
+ }
96
+ if (parsed.tokens.length === 0) {
97
+ return { matches: true, score: 0 };
98
+ }
99
+ let totalScore = 0;
100
+ let normalizedText = null;
101
+ for (const token of parsed.tokens) {
102
+ if (token.kind === "phrase") {
103
+ if (normalizedText === null) {
104
+ normalizedText = normalizeWhitespaceLower(text);
105
+ }
106
+ const phrase = normalizeWhitespaceLower(token.value);
107
+ if (!phrase)
108
+ continue;
109
+ const idx = normalizedText.indexOf(phrase);
110
+ if (idx < 0)
111
+ return { matches: false, score: 0 };
112
+ totalScore += idx * 0.1;
113
+ continue;
114
+ }
115
+ const m = fuzzyMatch(token.value, text);
116
+ if (!m.matches)
117
+ return { matches: false, score: 0 };
118
+ totalScore += m.score;
119
+ }
120
+ return { matches: true, score: totalScore };
121
+ }
122
+ export function filterAndSortSessions(sessions, query, sortMode, nameFilter = "all") {
123
+ const nameFiltered = nameFilter === "all" ? sessions : sessions.filter((session) => matchesNameFilter(session, nameFilter));
124
+ const trimmed = query.trim();
125
+ if (!trimmed)
126
+ return nameFiltered;
127
+ const parsed = parseSearchQuery(query);
128
+ if (parsed.error)
129
+ return [];
130
+ // Recent mode: filter only, keep incoming order.
131
+ if (sortMode === "recent") {
132
+ const filtered = [];
133
+ for (const s of nameFiltered) {
134
+ const res = matchSession(s, parsed);
135
+ if (res.matches)
136
+ filtered.push(s);
137
+ }
138
+ return filtered;
139
+ }
140
+ // Relevance mode: sort by score, tie-break by modified desc.
141
+ const scored = [];
142
+ for (const s of nameFiltered) {
143
+ const res = matchSession(s, parsed);
144
+ if (!res.matches)
145
+ continue;
146
+ scored.push({ session: s, score: res.score });
147
+ }
148
+ scored.sort((a, b) => {
149
+ if (a.score !== b.score)
150
+ return a.score - b.score;
151
+ return b.session.modified.getTime() - a.session.modified.getTime();
152
+ });
153
+ return scored.map((r) => r.session);
154
+ }
155
+ //# sourceMappingURL=session-selector-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-selector-search.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-selector-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAqBzC,SAAS,wBAAwB,CAAC,IAAY;IAC7C,OAAO,IAAI,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CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACpB,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;YAAE,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;QAClD,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import { fuzzyMatch } from \"@gsd/pi-tui\";\nimport type { SessionInfo } from \"@gsd/agent-types\";\n\nexport type SortMode = \"threaded\" | \"recent\" | \"relevance\";\n\nexport type NameFilter = \"all\" | \"named\";\n\nexport interface ParsedSearchQuery {\n\tmode: \"tokens\" | \"regex\";\n\ttokens: { kind: \"fuzzy\" | \"phrase\"; value: string }[];\n\tregex: RegExp | null;\n\t/** If set, parsing failed and we should treat query as non-matching. */\n\terror?: string;\n}\n\nexport interface MatchResult {\n\tmatches: boolean;\n\t/** Lower is better; only meaningful when matches === true */\n\tscore: number;\n}\n\nfunction normalizeWhitespaceLower(text: string): string {\n\treturn text.toLowerCase().replace(/\\s+/g, \" \").trim();\n}\n\nfunction getSessionSearchText(session: SessionInfo): string {\n\treturn `${session.id} ${session.name ?? \"\"} ${session.allMessagesText} ${session.cwd}`;\n}\n\nexport function hasSessionName(session: SessionInfo): boolean {\n\treturn Boolean(session.name?.trim());\n}\n\nfunction matchesNameFilter(session: SessionInfo, filter: NameFilter): boolean {\n\tif (filter === \"all\") return true;\n\treturn hasSessionName(session);\n}\n\nfunction parseSearchQuery(query: string): ParsedSearchQuery {\n\tconst trimmed = query.trim();\n\tif (!trimmed) {\n\t\treturn { mode: \"tokens\", tokens: [], regex: null };\n\t}\n\n\t// Regex mode: re:<pattern>\n\tif (trimmed.startsWith(\"re:\")) {\n\t\tconst pattern = trimmed.slice(3).trim();\n\t\tif (!pattern) {\n\t\t\treturn { mode: \"regex\", tokens: [], regex: null, error: \"Empty regex\" };\n\t\t}\n\t\ttry {\n\t\t\treturn { mode: \"regex\", tokens: [], regex: new RegExp(pattern, \"i\") };\n\t\t} catch (err) {\n\t\t\tconst msg = err instanceof Error ? err.message : String(err);\n\t\t\treturn { mode: \"regex\", tokens: [], regex: null, error: msg };\n\t\t}\n\t}\n\n\t// Token mode with quote support.\n\t// Example: foo \"node cve\" bar\n\tconst tokens: { kind: \"fuzzy\" | \"phrase\"; value: string }[] = [];\n\tlet buf = \"\";\n\tlet inQuote = false;\n\tlet hadUnclosedQuote = false;\n\n\tconst flush = (kind: \"fuzzy\" | \"phrase\"): void => {\n\t\tconst v = buf.trim();\n\t\tbuf = \"\";\n\t\tif (!v) return;\n\t\ttokens.push({ kind, value: v });\n\t};\n\n\tfor (let i = 0; i < trimmed.length; i++) {\n\t\tconst ch = trimmed[i]!;\n\t\tif (ch === '\"') {\n\t\t\tif (inQuote) {\n\t\t\t\tflush(\"phrase\");\n\t\t\t\tinQuote = false;\n\t\t\t} else {\n\t\t\t\tflush(\"fuzzy\");\n\t\t\t\tinQuote = true;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!inQuote && /\\s/.test(ch)) {\n\t\t\tflush(\"fuzzy\");\n\t\t\tcontinue;\n\t\t}\n\n\t\tbuf += ch;\n\t}\n\n\tif (inQuote) {\n\t\thadUnclosedQuote = true;\n\t}\n\n\t// If quotes were unbalanced, fall back to plain whitespace tokenization.\n\tif (hadUnclosedQuote) {\n\t\treturn {\n\t\t\tmode: \"tokens\",\n\t\t\ttokens: trimmed\n\t\t\t\t.split(/\\s+/)\n\t\t\t\t.map((t) => t.trim())\n\t\t\t\t.filter((t) => t.length > 0)\n\t\t\t\t.map((t) => ({ kind: \"fuzzy\" as const, value: t })),\n\t\t\tregex: null,\n\t\t};\n\t}\n\n\tflush(inQuote ? \"phrase\" : \"fuzzy\");\n\n\treturn { mode: \"tokens\", tokens, regex: null };\n}\n\nfunction matchSession(session: SessionInfo, parsed: ParsedSearchQuery): MatchResult {\n\tconst text = getSessionSearchText(session);\n\n\tif (parsed.mode === \"regex\") {\n\t\tif (!parsed.regex) {\n\t\t\treturn { matches: false, score: 0 };\n\t\t}\n\t\tconst idx = text.search(parsed.regex);\n\t\tif (idx < 0) return { matches: false, score: 0 };\n\t\treturn { matches: true, score: idx * 0.1 };\n\t}\n\n\tif (parsed.tokens.length === 0) {\n\t\treturn { matches: true, score: 0 };\n\t}\n\n\tlet totalScore = 0;\n\tlet normalizedText: string | null = null;\n\n\tfor (const token of parsed.tokens) {\n\t\tif (token.kind === \"phrase\") {\n\t\t\tif (normalizedText === null) {\n\t\t\t\tnormalizedText = normalizeWhitespaceLower(text);\n\t\t\t}\n\t\t\tconst phrase = normalizeWhitespaceLower(token.value);\n\t\t\tif (!phrase) continue;\n\t\t\tconst idx = normalizedText.indexOf(phrase);\n\t\t\tif (idx < 0) return { matches: false, score: 0 };\n\t\t\ttotalScore += idx * 0.1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst m = fuzzyMatch(token.value, text);\n\t\tif (!m.matches) return { matches: false, score: 0 };\n\t\ttotalScore += m.score;\n\t}\n\n\treturn { matches: true, score: totalScore };\n}\n\nexport function filterAndSortSessions(\n\tsessions: SessionInfo[],\n\tquery: string,\n\tsortMode: SortMode,\n\tnameFilter: NameFilter = \"all\",\n): SessionInfo[] {\n\tconst nameFiltered =\n\t\tnameFilter === \"all\" ? sessions : sessions.filter((session) => matchesNameFilter(session, nameFilter));\n\tconst trimmed = query.trim();\n\tif (!trimmed) return nameFiltered;\n\n\tconst parsed = parseSearchQuery(query);\n\tif (parsed.error) return [];\n\n\t// Recent mode: filter only, keep incoming order.\n\tif (sortMode === \"recent\") {\n\t\tconst filtered: SessionInfo[] = [];\n\t\tfor (const s of nameFiltered) {\n\t\t\tconst res = matchSession(s, parsed);\n\t\t\tif (res.matches) filtered.push(s);\n\t\t}\n\t\treturn filtered;\n\t}\n\n\t// Relevance mode: sort by score, tie-break by modified desc.\n\tconst scored: { session: SessionInfo; score: number }[] = [];\n\tfor (const s of nameFiltered) {\n\t\tconst res = matchSession(s, parsed);\n\t\tif (!res.matches) continue;\n\t\tscored.push({ session: s, score: res.score });\n\t}\n\n\tscored.sort((a, b) => {\n\t\tif (a.score !== b.score) return a.score - b.score;\n\t\treturn b.session.modified.getTime() - a.session.modified.getTime();\n\t});\n\n\treturn scored.map((r) => r.session);\n}\n"]}
@@ -0,0 +1,97 @@
1
+ import { type Component, Container, type Focusable } from "@gsd/pi-tui";
2
+ import { KeybindingsManager } from "@gsd/agent-core";
3
+ import type { SessionInfo } from "@gsd/agent-types";
4
+ /** Progress callback for session list loading (not exported from pi-coding-agent index). */
5
+ type SessionListProgress = (loaded: number, total: number) => void;
6
+ import { type NameFilter, type SortMode } from "./session-selector-search.js";
7
+ /**
8
+ * Custom session list component with multi-line items and search
9
+ */
10
+ declare class SessionList implements Component, Focusable {
11
+ getSelectedSessionPath(): string | undefined;
12
+ private allSessions;
13
+ private filteredSessions;
14
+ private selectedIndex;
15
+ private searchInput;
16
+ private showCwd;
17
+ private sortMode;
18
+ private nameFilter;
19
+ private keybindings;
20
+ private showPath;
21
+ private confirmingDeletePath;
22
+ private currentSessionFilePath?;
23
+ onSelect?: (sessionPath: string) => void;
24
+ onCancel?: () => void;
25
+ onExit: () => void;
26
+ onToggleScope?: () => void;
27
+ onToggleSort?: () => void;
28
+ onToggleNameFilter?: () => void;
29
+ onTogglePath?: (showPath: boolean) => void;
30
+ onDeleteConfirmationChange?: (path: string | null) => void;
31
+ onDeleteSession?: (sessionPath: string) => Promise<void>;
32
+ onRenameSession?: (sessionPath: string) => void;
33
+ onError?: (message: string) => void;
34
+ private maxVisible;
35
+ private _focused;
36
+ get focused(): boolean;
37
+ set focused(value: boolean);
38
+ constructor(sessions: SessionInfo[], showCwd: boolean, sortMode: SortMode, nameFilter: NameFilter, keybindings: KeybindingsManager, currentSessionFilePath?: string);
39
+ setSortMode(sortMode: SortMode): void;
40
+ setNameFilter(nameFilter: NameFilter): void;
41
+ setSessions(sessions: SessionInfo[], showCwd: boolean): void;
42
+ private filterSessions;
43
+ private setConfirmingDeletePath;
44
+ private startDeleteConfirmationForSelectedSession;
45
+ invalidate(): void;
46
+ render(width: number): string[];
47
+ private buildNodeTreePrefix;
48
+ handleInput(keyData: string): void;
49
+ }
50
+ type SessionsLoader = (onProgress?: SessionListProgress) => Promise<SessionInfo[]>;
51
+ /**
52
+ * Component that renders a session selector
53
+ */
54
+ export declare class SessionSelectorComponent extends Container implements Focusable {
55
+ handleInput(data: string): void;
56
+ private canRename;
57
+ private sessionList;
58
+ private header;
59
+ private keybindings;
60
+ private scope;
61
+ private sortMode;
62
+ private nameFilter;
63
+ private currentSessions;
64
+ private allSessions;
65
+ private currentSessionsLoader;
66
+ private allSessionsLoader;
67
+ private onCancel;
68
+ private requestRender;
69
+ private renameSession?;
70
+ private currentLoading;
71
+ private allLoading;
72
+ private allLoadSeq;
73
+ private mode;
74
+ private renameInput;
75
+ private renameTargetPath;
76
+ private _focused;
77
+ get focused(): boolean;
78
+ set focused(value: boolean);
79
+ private buildBaseLayout;
80
+ constructor(currentSessionsLoader: SessionsLoader, allSessionsLoader: SessionsLoader, onSelect: (sessionPath: string) => void, onCancel: () => void, onExit: () => void, requestRender: () => void, options?: {
81
+ renameSession?: (sessionPath: string, currentName: string | undefined) => Promise<void>;
82
+ showRenameHint?: boolean;
83
+ keybindings?: KeybindingsManager;
84
+ }, currentSessionFilePath?: string);
85
+ private loadCurrentSessions;
86
+ private enterRenameMode;
87
+ private exitRenameMode;
88
+ private confirmRename;
89
+ private loadScope;
90
+ private toggleSortMode;
91
+ private toggleNameFilter;
92
+ private refreshSessionsAfterMutation;
93
+ private toggleScope;
94
+ getSessionList(): SessionList;
95
+ }
96
+ export {};
97
+ //# sourceMappingURL=session-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-selector.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,SAAS,EACd,SAAS,EACT,KAAK,SAAS,EAOd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,4FAA4F;AAC5F,KAAK,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAInE,OAAO,EAAyC,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAiPrH;;GAEG;AACH,cAAM,WAAY,YAAW,SAAS,EAAE,SAAS;IACzC,sBAAsB,IAAI,MAAM,GAAG,SAAS;IAInD,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,sBAAsB,CAAC,CAAS;IACjC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAY;IAC9B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,IAAI,CAA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