gsd-pi 2.6.0 → 2.7.0

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 (1002) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/onboarding.d.ts +1 -1
  3. package/dist/pi-migration.d.ts +1 -1
  4. package/dist/resource-loader.d.ts +1 -1
  5. package/dist/resource-loader.js +1 -1
  6. package/dist/wizard.d.ts +1 -1
  7. package/package.json +12 -6
  8. package/packages/pi-agent-core/dist/agent-loop.d.ts +21 -0
  9. package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -0
  10. package/packages/pi-agent-core/dist/agent-loop.js +308 -0
  11. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -0
  12. package/packages/pi-agent-core/dist/agent.d.ts +162 -0
  13. package/packages/pi-agent-core/dist/agent.d.ts.map +1 -0
  14. package/packages/pi-agent-core/dist/agent.js +399 -0
  15. package/packages/pi-agent-core/dist/agent.js.map +1 -0
  16. package/packages/pi-agent-core/dist/index.d.ts +5 -0
  17. package/packages/pi-agent-core/dist/index.d.ts.map +1 -0
  18. package/packages/pi-agent-core/dist/index.js +9 -0
  19. package/packages/pi-agent-core/dist/index.js.map +1 -0
  20. package/packages/pi-agent-core/dist/proxy.d.ts +85 -0
  21. package/packages/pi-agent-core/dist/proxy.d.ts.map +1 -0
  22. package/packages/pi-agent-core/dist/proxy.js +268 -0
  23. package/packages/pi-agent-core/dist/proxy.js.map +1 -0
  24. package/packages/pi-agent-core/dist/types.d.ts +178 -0
  25. package/packages/pi-agent-core/dist/types.d.ts.map +1 -0
  26. package/packages/pi-agent-core/dist/types.js +2 -0
  27. package/packages/pi-agent-core/dist/types.js.map +1 -0
  28. package/packages/pi-agent-core/package.json +14 -0
  29. package/packages/pi-agent-core/src/agent-loop.ts +417 -0
  30. package/packages/pi-agent-core/src/agent.ts +568 -0
  31. package/packages/pi-agent-core/src/index.ts +8 -0
  32. package/packages/pi-agent-core/src/proxy.ts +340 -0
  33. package/packages/pi-agent-core/src/types.ts +194 -0
  34. package/packages/pi-agent-core/tsconfig.json +27 -0
  35. package/packages/pi-ai/bedrock-provider.d.ts +1 -0
  36. package/packages/pi-ai/bedrock-provider.js +1 -0
  37. package/packages/pi-ai/dist/api-registry.d.ts +20 -0
  38. package/packages/pi-ai/dist/api-registry.d.ts.map +1 -0
  39. package/packages/pi-ai/dist/api-registry.js +44 -0
  40. package/packages/pi-ai/dist/api-registry.js.map +1 -0
  41. package/packages/pi-ai/dist/bedrock-provider.d.ts +5 -0
  42. package/packages/pi-ai/dist/bedrock-provider.d.ts.map +1 -0
  43. package/packages/pi-ai/dist/bedrock-provider.js +6 -0
  44. package/packages/pi-ai/dist/bedrock-provider.js.map +1 -0
  45. package/packages/pi-ai/dist/cli.d.ts +3 -0
  46. package/packages/pi-ai/dist/cli.d.ts.map +1 -0
  47. package/packages/pi-ai/dist/cli.js +116 -0
  48. package/packages/pi-ai/dist/cli.js.map +1 -0
  49. package/packages/pi-ai/dist/env-api-keys.d.ts +9 -0
  50. package/packages/pi-ai/dist/env-api-keys.d.ts.map +1 -0
  51. package/packages/pi-ai/dist/env-api-keys.js +104 -0
  52. package/packages/pi-ai/dist/env-api-keys.js.map +1 -0
  53. package/packages/pi-ai/dist/index.d.ts +23 -0
  54. package/packages/pi-ai/dist/index.d.ts.map +1 -0
  55. package/packages/pi-ai/dist/index.js +21 -0
  56. package/packages/pi-ai/dist/index.js.map +1 -0
  57. package/packages/pi-ai/dist/models.d.ts +24 -0
  58. package/packages/pi-ai/dist/models.d.ts.map +1 -0
  59. package/packages/pi-ai/dist/models.generated.d.ts +13572 -0
  60. package/packages/pi-ai/dist/models.generated.d.ts.map +1 -0
  61. package/packages/pi-ai/dist/models.generated.js +13368 -0
  62. package/packages/pi-ai/dist/models.generated.js.map +1 -0
  63. package/packages/pi-ai/dist/models.js +55 -0
  64. package/packages/pi-ai/dist/models.js.map +1 -0
  65. package/packages/pi-ai/dist/oauth.d.ts +2 -0
  66. package/packages/pi-ai/dist/oauth.d.ts.map +1 -0
  67. package/packages/pi-ai/dist/oauth.js +2 -0
  68. package/packages/pi-ai/dist/oauth.js.map +1 -0
  69. package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts +15 -0
  70. package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
  71. package/packages/pi-ai/dist/providers/amazon-bedrock.js +600 -0
  72. package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -0
  73. package/packages/pi-ai/dist/providers/anthropic.d.ts +33 -0
  74. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -0
  75. package/packages/pi-ai/dist/providers/anthropic.js +732 -0
  76. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -0
  77. package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts +15 -0
  78. package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
  79. package/packages/pi-ai/dist/providers/azure-openai-responses.js +187 -0
  80. package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -0
  81. package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts +8 -0
  82. package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
  83. package/packages/pi-ai/dist/providers/github-copilot-headers.js +29 -0
  84. package/packages/pi-ai/dist/providers/github-copilot-headers.js.map +1 -0
  85. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts +74 -0
  86. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -0
  87. package/packages/pi-ai/dist/providers/google-gemini-cli.js +757 -0
  88. package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -0
  89. package/packages/pi-ai/dist/providers/google-shared.d.ts +65 -0
  90. package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -0
  91. package/packages/pi-ai/dist/providers/google-shared.js +300 -0
  92. package/packages/pi-ai/dist/providers/google-shared.js.map +1 -0
  93. package/packages/pi-ai/dist/providers/google-vertex.d.ts +15 -0
  94. package/packages/pi-ai/dist/providers/google-vertex.d.ts.map +1 -0
  95. package/packages/pi-ai/dist/providers/google-vertex.js +374 -0
  96. package/packages/pi-ai/dist/providers/google-vertex.js.map +1 -0
  97. package/packages/pi-ai/dist/providers/google.d.ts +13 -0
  98. package/packages/pi-ai/dist/providers/google.d.ts.map +1 -0
  99. package/packages/pi-ai/dist/providers/google.js +355 -0
  100. package/packages/pi-ai/dist/providers/google.js.map +1 -0
  101. package/packages/pi-ai/dist/providers/mistral.d.ts +22 -0
  102. package/packages/pi-ai/dist/providers/mistral.d.ts.map +1 -0
  103. package/packages/pi-ai/dist/providers/mistral.js +498 -0
  104. package/packages/pi-ai/dist/providers/mistral.js.map +1 -0
  105. package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts +9 -0
  106. package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
  107. package/packages/pi-ai/dist/providers/openai-codex-responses.js +704 -0
  108. package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -0
  109. package/packages/pi-ai/dist/providers/openai-completions.d.ts +15 -0
  110. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -0
  111. package/packages/pi-ai/dist/providers/openai-completions.js +705 -0
  112. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -0
  113. package/packages/pi-ai/dist/providers/openai-responses-shared.d.ts +17 -0
  114. package/packages/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
  115. package/packages/pi-ai/dist/providers/openai-responses-shared.js +442 -0
  116. package/packages/pi-ai/dist/providers/openai-responses-shared.js.map +1 -0
  117. package/packages/pi-ai/dist/providers/openai-responses.d.ts +13 -0
  118. package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -0
  119. package/packages/pi-ai/dist/providers/openai-responses.js +201 -0
  120. package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -0
  121. package/packages/pi-ai/dist/providers/register-builtins.d.ts +11 -0
  122. package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -0
  123. package/packages/pi-ai/dist/providers/register-builtins.js +138 -0
  124. package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -0
  125. package/packages/pi-ai/dist/providers/simple-options.d.ts +8 -0
  126. package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -0
  127. package/packages/pi-ai/dist/providers/simple-options.js +35 -0
  128. package/packages/pi-ai/dist/providers/simple-options.js.map +1 -0
  129. package/packages/pi-ai/dist/providers/transform-messages.d.ts +8 -0
  130. package/packages/pi-ai/dist/providers/transform-messages.d.ts.map +1 -0
  131. package/packages/pi-ai/dist/providers/transform-messages.js +155 -0
  132. package/packages/pi-ai/dist/providers/transform-messages.js.map +1 -0
  133. package/packages/pi-ai/dist/stream.d.ts +8 -0
  134. package/packages/pi-ai/dist/stream.d.ts.map +1 -0
  135. package/packages/pi-ai/dist/stream.js +27 -0
  136. package/packages/pi-ai/dist/stream.js.map +1 -0
  137. package/packages/pi-ai/dist/types.d.ts +285 -0
  138. package/packages/pi-ai/dist/types.d.ts.map +1 -0
  139. package/packages/pi-ai/dist/types.js +2 -0
  140. package/packages/pi-ai/dist/types.js.map +1 -0
  141. package/packages/pi-ai/dist/utils/event-stream.d.ts +21 -0
  142. package/packages/pi-ai/dist/utils/event-stream.d.ts.map +1 -0
  143. package/packages/pi-ai/dist/utils/event-stream.js +77 -0
  144. package/packages/pi-ai/dist/utils/event-stream.js.map +1 -0
  145. package/packages/pi-ai/dist/utils/hash.d.ts +3 -0
  146. package/packages/pi-ai/dist/utils/hash.d.ts.map +1 -0
  147. package/packages/pi-ai/dist/utils/hash.js +14 -0
  148. package/packages/pi-ai/dist/utils/hash.js.map +1 -0
  149. package/packages/pi-ai/dist/utils/json-parse.d.ts +9 -0
  150. package/packages/pi-ai/dist/utils/json-parse.d.ts.map +1 -0
  151. package/packages/pi-ai/dist/utils/json-parse.js +29 -0
  152. package/packages/pi-ai/dist/utils/json-parse.js.map +1 -0
  153. package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts +17 -0
  154. package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
  155. package/packages/pi-ai/dist/utils/oauth/anthropic.js +104 -0
  156. package/packages/pi-ai/dist/utils/oauth/anthropic.js.map +1 -0
  157. package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts +30 -0
  158. package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
  159. package/packages/pi-ai/dist/utils/oauth/github-copilot.js +281 -0
  160. package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -0
  161. package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts +26 -0
  162. package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -0
  163. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +373 -0
  164. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -0
  165. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts +26 -0
  166. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -0
  167. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +478 -0
  168. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -0
  169. package/packages/pi-ai/dist/utils/oauth/index.d.ts +61 -0
  170. package/packages/pi-ai/dist/utils/oauth/index.d.ts.map +1 -0
  171. package/packages/pi-ai/dist/utils/oauth/index.js +131 -0
  172. package/packages/pi-ai/dist/utils/oauth/index.js.map +1 -0
  173. package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts +34 -0
  174. package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
  175. package/packages/pi-ai/dist/utils/oauth/openai-codex.js +380 -0
  176. package/packages/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -0
  177. package/packages/pi-ai/dist/utils/oauth/pkce.d.ts +13 -0
  178. package/packages/pi-ai/dist/utils/oauth/pkce.d.ts.map +1 -0
  179. package/packages/pi-ai/dist/utils/oauth/pkce.js +31 -0
  180. package/packages/pi-ai/dist/utils/oauth/pkce.js.map +1 -0
  181. package/packages/pi-ai/dist/utils/oauth/types.d.ts +47 -0
  182. package/packages/pi-ai/dist/utils/oauth/types.d.ts.map +1 -0
  183. package/packages/pi-ai/dist/utils/oauth/types.js +2 -0
  184. package/packages/pi-ai/dist/utils/oauth/types.js.map +1 -0
  185. package/packages/pi-ai/dist/utils/overflow.d.ts +52 -0
  186. package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -0
  187. package/packages/pi-ai/dist/utils/overflow.js +117 -0
  188. package/packages/pi-ai/dist/utils/overflow.js.map +1 -0
  189. package/packages/pi-ai/dist/utils/sanitize-unicode.d.ts +22 -0
  190. package/packages/pi-ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
  191. package/packages/pi-ai/dist/utils/sanitize-unicode.js +26 -0
  192. package/packages/pi-ai/dist/utils/sanitize-unicode.js.map +1 -0
  193. package/packages/pi-ai/dist/utils/typebox-helpers.d.ts +17 -0
  194. package/packages/pi-ai/dist/utils/typebox-helpers.d.ts.map +1 -0
  195. package/packages/pi-ai/dist/utils/typebox-helpers.js +21 -0
  196. package/packages/pi-ai/dist/utils/typebox-helpers.js.map +1 -0
  197. package/packages/pi-ai/dist/utils/validation.d.ts +18 -0
  198. package/packages/pi-ai/dist/utils/validation.d.ts.map +1 -0
  199. package/packages/pi-ai/dist/utils/validation.js +72 -0
  200. package/packages/pi-ai/dist/utils/validation.js.map +1 -0
  201. package/packages/pi-ai/package.json +40 -0
  202. package/packages/pi-ai/src/api-registry.ts +98 -0
  203. package/packages/pi-ai/src/bedrock-provider.ts +6 -0
  204. package/packages/pi-ai/src/cli.ts +133 -0
  205. package/packages/pi-ai/src/env-api-keys.ts +129 -0
  206. package/packages/pi-ai/src/index.ts +32 -0
  207. package/packages/pi-ai/src/models.generated.ts +13370 -0
  208. package/packages/pi-ai/src/models.ts +77 -0
  209. package/packages/pi-ai/src/oauth.ts +1 -0
  210. package/packages/pi-ai/src/providers/amazon-bedrock.ts +751 -0
  211. package/packages/pi-ai/src/providers/anthropic.ts +883 -0
  212. package/packages/pi-ai/src/providers/azure-openai-responses.ts +259 -0
  213. package/packages/pi-ai/src/providers/github-copilot-headers.ts +37 -0
  214. package/packages/pi-ai/src/providers/google-gemini-cli.ts +967 -0
  215. package/packages/pi-ai/src/providers/google-shared.ts +313 -0
  216. package/packages/pi-ai/src/providers/google-vertex.ts +485 -0
  217. package/packages/pi-ai/src/providers/google.ts +455 -0
  218. package/packages/pi-ai/src/providers/mistral.ts +582 -0
  219. package/packages/pi-ai/src/providers/openai-codex-responses.ts +875 -0
  220. package/packages/pi-ai/src/providers/openai-completions.ts +820 -0
  221. package/packages/pi-ai/src/providers/openai-responses-shared.ts +496 -0
  222. package/packages/pi-ai/src/providers/openai-responses.ts +262 -0
  223. package/packages/pi-ai/src/providers/register-builtins.ts +186 -0
  224. package/packages/pi-ai/src/providers/simple-options.ts +46 -0
  225. package/packages/pi-ai/src/providers/transform-messages.ts +172 -0
  226. package/packages/pi-ai/src/stream.ts +59 -0
  227. package/packages/pi-ai/src/types.ts +321 -0
  228. package/packages/pi-ai/src/utils/event-stream.ts +87 -0
  229. package/packages/pi-ai/src/utils/hash.ts +13 -0
  230. package/packages/pi-ai/src/utils/json-parse.ts +28 -0
  231. package/packages/pi-ai/src/utils/oauth/anthropic.ts +138 -0
  232. package/packages/pi-ai/src/utils/oauth/github-copilot.ts +381 -0
  233. package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +457 -0
  234. package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +599 -0
  235. package/packages/pi-ai/src/utils/oauth/index.ts +162 -0
  236. package/packages/pi-ai/src/utils/oauth/openai-codex.ts +455 -0
  237. package/packages/pi-ai/src/utils/oauth/pkce.ts +34 -0
  238. package/packages/pi-ai/src/utils/oauth/types.ts +59 -0
  239. package/packages/pi-ai/src/utils/overflow.ts +123 -0
  240. package/packages/pi-ai/src/utils/sanitize-unicode.ts +25 -0
  241. package/packages/pi-ai/src/utils/typebox-helpers.ts +24 -0
  242. package/packages/pi-ai/src/utils/validation.ts +84 -0
  243. package/packages/pi-ai/tsconfig.json +27 -0
  244. package/packages/pi-coding-agent/dist/cli/args.d.ts +48 -0
  245. package/packages/pi-coding-agent/dist/cli/args.d.ts.map +1 -0
  246. package/packages/pi-coding-agent/dist/cli/args.js +299 -0
  247. package/packages/pi-coding-agent/dist/cli/args.js.map +1 -0
  248. package/packages/pi-coding-agent/dist/cli/config-selector.d.ts +14 -0
  249. package/packages/pi-coding-agent/dist/cli/config-selector.d.ts.map +1 -0
  250. package/packages/pi-coding-agent/dist/cli/config-selector.js +31 -0
  251. package/packages/pi-coding-agent/dist/cli/config-selector.js.map +1 -0
  252. package/packages/pi-coding-agent/dist/cli/file-processor.d.ts +15 -0
  253. package/packages/pi-coding-agent/dist/cli/file-processor.d.ts.map +1 -0
  254. package/packages/pi-coding-agent/dist/cli/file-processor.js +79 -0
  255. package/packages/pi-coding-agent/dist/cli/file-processor.js.map +1 -0
  256. package/packages/pi-coding-agent/dist/cli/list-models.d.ts +9 -0
  257. package/packages/pi-coding-agent/dist/cli/list-models.d.ts.map +1 -0
  258. package/packages/pi-coding-agent/dist/cli/list-models.js +92 -0
  259. package/packages/pi-coding-agent/dist/cli/list-models.js.map +1 -0
  260. package/packages/pi-coding-agent/dist/cli/session-picker.d.ts +9 -0
  261. package/packages/pi-coding-agent/dist/cli/session-picker.d.ts.map +1 -0
  262. package/packages/pi-coding-agent/dist/cli/session-picker.js +34 -0
  263. package/packages/pi-coding-agent/dist/cli/session-picker.js.map +1 -0
  264. package/packages/pi-coding-agent/dist/cli.d.ts +3 -0
  265. package/packages/pi-coding-agent/dist/cli.d.ts.map +1 -0
  266. package/packages/pi-coding-agent/dist/cli.js +16 -0
  267. package/packages/pi-coding-agent/dist/cli.js.map +1 -0
  268. package/packages/pi-coding-agent/dist/config.d.ts +68 -0
  269. package/packages/pi-coding-agent/dist/config.d.ts.map +1 -0
  270. package/packages/pi-coding-agent/dist/config.js +203 -0
  271. package/packages/pi-coding-agent/dist/config.js.map +1 -0
  272. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +618 -0
  273. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -0
  274. package/packages/pi-coding-agent/dist/core/agent-session.js +2481 -0
  275. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -0
  276. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +134 -0
  277. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -0
  278. package/packages/pi-coding-agent/dist/core/auth-storage.js +415 -0
  279. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -0
  280. package/packages/pi-coding-agent/dist/core/bash-executor.d.ts +47 -0
  281. package/packages/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -0
  282. package/packages/pi-coding-agent/dist/core/bash-executor.js +212 -0
  283. package/packages/pi-coding-agent/dist/core/bash-executor.js.map +1 -0
  284. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts +86 -0
  285. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  286. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js +242 -0
  287. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -0
  288. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +121 -0
  289. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -0
  290. package/packages/pi-coding-agent/dist/core/compaction/compaction.js +610 -0
  291. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -0
  292. package/packages/pi-coding-agent/dist/core/compaction/index.d.ts +7 -0
  293. package/packages/pi-coding-agent/dist/core/compaction/index.d.ts.map +1 -0
  294. package/packages/pi-coding-agent/dist/core/compaction/index.js +7 -0
  295. package/packages/pi-coding-agent/dist/core/compaction/index.js.map +1 -0
  296. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +38 -0
  297. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -0
  298. package/packages/pi-coding-agent/dist/core/compaction/utils.js +153 -0
  299. package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -0
  300. package/packages/pi-coding-agent/dist/core/defaults.d.ts +3 -0
  301. package/packages/pi-coding-agent/dist/core/defaults.d.ts.map +1 -0
  302. package/packages/pi-coding-agent/dist/core/defaults.js +2 -0
  303. package/packages/pi-coding-agent/dist/core/defaults.js.map +1 -0
  304. package/packages/pi-coding-agent/dist/core/diagnostics.d.ts +15 -0
  305. package/packages/pi-coding-agent/dist/core/diagnostics.d.ts.map +1 -0
  306. package/packages/pi-coding-agent/dist/core/diagnostics.js +2 -0
  307. package/packages/pi-coding-agent/dist/core/diagnostics.js.map +1 -0
  308. package/packages/pi-coding-agent/dist/core/event-bus.d.ts +9 -0
  309. package/packages/pi-coding-agent/dist/core/event-bus.d.ts.map +1 -0
  310. package/packages/pi-coding-agent/dist/core/event-bus.js +25 -0
  311. package/packages/pi-coding-agent/dist/core/event-bus.js.map +1 -0
  312. package/packages/pi-coding-agent/dist/core/exec.d.ts +29 -0
  313. package/packages/pi-coding-agent/dist/core/exec.d.ts.map +1 -0
  314. package/packages/pi-coding-agent/dist/core/exec.js +71 -0
  315. package/packages/pi-coding-agent/dist/core/exec.js.map +1 -0
  316. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts +22 -0
  317. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  318. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js +249 -0
  319. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -0
  320. package/packages/pi-coding-agent/dist/core/export-html/index.d.ts +37 -0
  321. package/packages/pi-coding-agent/dist/core/export-html/index.d.ts.map +1 -0
  322. package/packages/pi-coding-agent/dist/core/export-html/index.js +223 -0
  323. package/packages/pi-coding-agent/dist/core/export-html/index.js.map +1 -0
  324. package/packages/pi-coding-agent/dist/core/export-html/template.css +971 -0
  325. package/packages/pi-coding-agent/dist/core/export-html/template.html +54 -0
  326. package/packages/pi-coding-agent/dist/core/export-html/template.js +1583 -0
  327. package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts +38 -0
  328. package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  329. package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.js +70 -0
  330. package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.js.map +1 -0
  331. package/packages/pi-coding-agent/dist/core/export-html/vendor/highlight.min.js +1213 -0
  332. package/packages/pi-coding-agent/dist/core/export-html/vendor/marked.min.js +6 -0
  333. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +11 -0
  334. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -0
  335. package/packages/pi-coding-agent/dist/core/extensions/index.js +9 -0
  336. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -0
  337. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +25 -0
  338. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -0
  339. package/packages/pi-coding-agent/dist/core/extensions/loader.js +426 -0
  340. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -0
  341. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +147 -0
  342. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -0
  343. package/packages/pi-coding-agent/dist/core/extensions/runner.js +672 -0
  344. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -0
  345. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +1040 -0
  346. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -0
  347. package/packages/pi-coding-agent/dist/core/extensions/types.js +35 -0
  348. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -0
  349. package/packages/pi-coding-agent/dist/core/extensions/wrapper.d.ts +27 -0
  350. package/packages/pi-coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -0
  351. package/packages/pi-coding-agent/dist/core/extensions/wrapper.js +102 -0
  352. package/packages/pi-coding-agent/dist/core/extensions/wrapper.js.map +1 -0
  353. package/packages/pi-coding-agent/dist/core/footer-data-provider.d.ts +32 -0
  354. package/packages/pi-coding-agent/dist/core/footer-data-provider.d.ts.map +1 -0
  355. package/packages/pi-coding-agent/dist/core/footer-data-provider.js +134 -0
  356. package/packages/pi-coding-agent/dist/core/footer-data-provider.js.map +1 -0
  357. package/packages/pi-coding-agent/dist/core/index.d.ts +9 -0
  358. package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -0
  359. package/packages/pi-coding-agent/dist/core/index.js +9 -0
  360. package/packages/pi-coding-agent/dist/core/index.js.map +1 -0
  361. package/packages/pi-coding-agent/dist/core/keybindings.d.ts +55 -0
  362. package/packages/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -0
  363. package/packages/pi-coding-agent/dist/core/keybindings.js +151 -0
  364. package/packages/pi-coding-agent/dist/core/keybindings.js.map +1 -0
  365. package/packages/pi-coding-agent/dist/core/messages.d.ts +77 -0
  366. package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -0
  367. package/packages/pi-coding-agent/dist/core/messages.js +123 -0
  368. package/packages/pi-coding-agent/dist/core/messages.js.map +1 -0
  369. package/packages/pi-coding-agent/dist/core/model-registry.d.ts +113 -0
  370. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -0
  371. package/packages/pi-coding-agent/dist/core/model-registry.js +537 -0
  372. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -0
  373. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts +104 -0
  374. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -0
  375. package/packages/pi-coding-agent/dist/core/model-resolver.js +462 -0
  376. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -0
  377. package/packages/pi-coding-agent/dist/core/package-manager.d.ts +156 -0
  378. package/packages/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -0
  379. package/packages/pi-coding-agent/dist/core/package-manager.js +1442 -0
  380. package/packages/pi-coding-agent/dist/core/package-manager.js.map +1 -0
  381. package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts +50 -0
  382. package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts.map +1 -0
  383. package/packages/pi-coding-agent/dist/core/prompt-templates.js +251 -0
  384. package/packages/pi-coding-agent/dist/core/prompt-templates.js.map +1 -0
  385. package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts +17 -0
  386. package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts.map +1 -0
  387. package/packages/pi-coding-agent/dist/core/resolve-config-value.js +59 -0
  388. package/packages/pi-coding-agent/dist/core/resolve-config-value.js.map +1 -0
  389. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +184 -0
  390. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -0
  391. package/packages/pi-coding-agent/dist/core/resource-loader.js +633 -0
  392. package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -0
  393. package/packages/pi-coding-agent/dist/core/sdk.d.ts +90 -0
  394. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -0
  395. package/packages/pi-coding-agent/dist/core/sdk.js +242 -0
  396. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -0
  397. package/packages/pi-coding-agent/dist/core/session-manager.d.ts +323 -0
  398. package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -0
  399. package/packages/pi-coding-agent/dist/core/session-manager.js +1094 -0
  400. package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -0
  401. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +232 -0
  402. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -0
  403. package/packages/pi-coding-agent/dist/core/settings-manager.js +682 -0
  404. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -0
  405. package/packages/pi-coding-agent/dist/core/skills.d.ts +58 -0
  406. package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -0
  407. package/packages/pi-coding-agent/dist/core/skills.js +364 -0
  408. package/packages/pi-coding-agent/dist/core/skills.js.map +1 -0
  409. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts +15 -0
  410. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -0
  411. package/packages/pi-coding-agent/dist/core/slash-commands.js +22 -0
  412. package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -0
  413. package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +28 -0
  414. package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -0
  415. package/packages/pi-coding-agent/dist/core/system-prompt.js +159 -0
  416. package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -0
  417. package/packages/pi-coding-agent/dist/core/timings.d.ts +7 -0
  418. package/packages/pi-coding-agent/dist/core/timings.d.ts.map +1 -0
  419. package/packages/pi-coding-agent/dist/core/timings.js +25 -0
  420. package/packages/pi-coding-agent/dist/core/timings.js.map +1 -0
  421. package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +55 -0
  422. package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -0
  423. package/packages/pi-coding-agent/dist/core/tools/bash.js +269 -0
  424. package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -0
  425. package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts +63 -0
  426. package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -0
  427. package/packages/pi-coding-agent/dist/core/tools/edit-diff.js +243 -0
  428. package/packages/pi-coding-agent/dist/core/tools/edit-diff.js.map +1 -0
  429. package/packages/pi-coding-agent/dist/core/tools/edit.d.ts +39 -0
  430. package/packages/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -0
  431. package/packages/pi-coding-agent/dist/core/tools/edit.js +146 -0
  432. package/packages/pi-coding-agent/dist/core/tools/edit.js.map +1 -0
  433. package/packages/pi-coding-agent/dist/core/tools/find.d.ts +39 -0
  434. package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -0
  435. package/packages/pi-coding-agent/dist/core/tools/find.js +206 -0
  436. package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -0
  437. package/packages/pi-coding-agent/dist/core/tools/grep.d.ts +45 -0
  438. package/packages/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -0
  439. package/packages/pi-coding-agent/dist/core/tools/grep.js +239 -0
  440. package/packages/pi-coding-agent/dist/core/tools/grep.js.map +1 -0
  441. package/packages/pi-coding-agent/dist/core/tools/index.d.ts +73 -0
  442. package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -0
  443. package/packages/pi-coding-agent/dist/core/tools/index.js +61 -0
  444. package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -0
  445. package/packages/pi-coding-agent/dist/core/tools/ls.d.ts +40 -0
  446. package/packages/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -0
  447. package/packages/pi-coding-agent/dist/core/tools/ls.js +118 -0
  448. package/packages/pi-coding-agent/dist/core/tools/ls.js.map +1 -0
  449. package/packages/pi-coding-agent/dist/core/tools/path-utils.d.ts +8 -0
  450. package/packages/pi-coding-agent/dist/core/tools/path-utils.d.ts.map +1 -0
  451. package/packages/pi-coding-agent/dist/core/tools/path-utils.js +81 -0
  452. package/packages/pi-coding-agent/dist/core/tools/path-utils.js.map +1 -0
  453. package/packages/pi-coding-agent/dist/core/tools/read.d.ts +39 -0
  454. package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -0
  455. package/packages/pi-coding-agent/dist/core/tools/read.js +166 -0
  456. package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -0
  457. package/packages/pi-coding-agent/dist/core/tools/truncate.d.ts +70 -0
  458. package/packages/pi-coding-agent/dist/core/tools/truncate.d.ts.map +1 -0
  459. package/packages/pi-coding-agent/dist/core/tools/truncate.js +205 -0
  460. package/packages/pi-coding-agent/dist/core/tools/truncate.js.map +1 -0
  461. package/packages/pi-coding-agent/dist/core/tools/write.d.ts +29 -0
  462. package/packages/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -0
  463. package/packages/pi-coding-agent/dist/core/tools/write.js +78 -0
  464. package/packages/pi-coding-agent/dist/core/tools/write.js.map +1 -0
  465. package/packages/pi-coding-agent/dist/index.d.ts +27 -0
  466. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -0
  467. package/packages/pi-coding-agent/dist/index.js +42 -0
  468. package/packages/pi-coding-agent/dist/index.js.map +1 -0
  469. package/packages/pi-coding-agent/dist/main.d.ts +8 -0
  470. package/packages/pi-coding-agent/dist/main.d.ts.map +1 -0
  471. package/packages/pi-coding-agent/dist/main.js +691 -0
  472. package/packages/pi-coding-agent/dist/main.js.map +1 -0
  473. package/packages/pi-coding-agent/dist/migrations.d.ts +33 -0
  474. package/packages/pi-coding-agent/dist/migrations.d.ts.map +1 -0
  475. package/packages/pi-coding-agent/dist/migrations.js +261 -0
  476. package/packages/pi-coding-agent/dist/migrations.js.map +1 -0
  477. package/packages/pi-coding-agent/dist/modes/index.d.ts +9 -0
  478. package/packages/pi-coding-agent/dist/modes/index.d.ts.map +1 -0
  479. package/packages/pi-coding-agent/dist/modes/index.js +8 -0
  480. package/packages/pi-coding-agent/dist/modes/index.js.map +1 -0
  481. package/packages/pi-coding-agent/dist/modes/interactive/components/armin.d.ts +34 -0
  482. package/packages/pi-coding-agent/dist/modes/interactive/components/armin.d.ts.map +1 -0
  483. package/packages/pi-coding-agent/dist/modes/interactive/components/armin.js +329 -0
  484. package/packages/pi-coding-agent/dist/modes/interactive/components/armin.js.map +1 -0
  485. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +16 -0
  486. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  487. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +92 -0
  488. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -0
  489. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +35 -0
  490. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  491. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +156 -0
  492. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -0
  493. package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  494. package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  495. package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js +48 -0
  496. package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  497. package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  498. package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  499. package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +42 -0
  500. package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  501. package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  502. package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  503. package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +43 -0
  504. package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  505. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts +71 -0
  506. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  507. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js +470 -0
  508. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -0
  509. package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  510. package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  511. package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js +28 -0
  512. package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  513. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.d.ts +21 -0
  514. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  515. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.js +63 -0
  516. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.js.map +1 -0
  517. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts +20 -0
  518. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  519. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.js +74 -0
  520. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -0
  521. package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  522. package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
  523. package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.js +138 -0
  524. package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.js.map +1 -0
  525. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +12 -0
  526. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -0
  527. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +133 -0
  528. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -0
  529. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  530. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  531. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +20 -0
  532. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  533. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.d.ts +20 -0
  534. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  535. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +106 -0
  536. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.js.map +1 -0
  537. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts +23 -0
  538. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  539. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js +55 -0
  540. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -0
  541. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts +24 -0
  542. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  543. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +71 -0
  544. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -0
  545. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts +26 -0
  546. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -0
  547. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +196 -0
  548. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -0
  549. package/packages/pi-coding-agent/dist/modes/interactive/components/index.d.ts +32 -0
  550. package/packages/pi-coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -0
  551. package/packages/pi-coding-agent/dist/modes/interactive/components/index.js +33 -0
  552. package/packages/pi-coding-agent/dist/modes/interactive/components/index.js.map +1 -0
  553. package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts +41 -0
  554. package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  555. package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js +61 -0
  556. package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  557. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +42 -0
  558. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  559. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +139 -0
  560. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -0
  561. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts +47 -0
  562. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  563. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +259 -0
  564. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -0
  565. package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
  566. package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  567. package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js +92 -0
  568. package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  569. package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
  570. package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  571. package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js +271 -0
  572. package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  573. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  574. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  575. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js +155 -0
  576. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  577. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts +95 -0
  578. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  579. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js +825 -0
  580. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -0
  581. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +58 -0
  582. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  583. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +295 -0
  584. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -0
  585. package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  586. package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  587. package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.js +34 -0
  588. package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  589. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  590. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  591. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +45 -0
  592. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  593. package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  594. package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  595. package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.js +44 -0
  596. package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.js.map +1 -0
  597. package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  598. package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  599. package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js +46 -0
  600. package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  601. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +77 -0
  602. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  603. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +773 -0
  604. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -0
  605. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts +87 -0
  606. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  607. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +1026 -0
  608. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -0
  609. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  610. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  611. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.js +110 -0
  612. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  613. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +9 -0
  614. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  615. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +27 -0
  616. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -0
  617. package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  618. package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  619. package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.js +33 -0
  620. package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  621. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +330 -0
  622. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  623. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +3755 -0
  624. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -0
  625. package/packages/pi-coding-agent/dist/modes/interactive/theme/dark.json +85 -0
  626. package/packages/pi-coding-agent/dist/modes/interactive/theme/light.json +84 -0
  627. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +335 -0
  628. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +78 -0
  629. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  630. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +944 -0
  631. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -0
  632. package/packages/pi-coding-agent/dist/modes/print-mode.d.ts +28 -0
  633. package/packages/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -0
  634. package/packages/pi-coding-agent/dist/modes/print-mode.js +101 -0
  635. package/packages/pi-coding-agent/dist/modes/print-mode.js.map +1 -0
  636. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.d.ts +17 -0
  637. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -0
  638. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.js +49 -0
  639. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.js.map +1 -0
  640. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +217 -0
  641. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  642. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js +400 -0
  643. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -0
  644. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts +20 -0
  645. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  646. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +509 -0
  647. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -0
  648. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +409 -0
  649. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  650. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js +8 -0
  651. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -0
  652. package/packages/pi-coding-agent/dist/utils/changelog.d.ts +21 -0
  653. package/packages/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -0
  654. package/packages/pi-coding-agent/dist/utils/changelog.js +87 -0
  655. package/packages/pi-coding-agent/dist/utils/changelog.js.map +1 -0
  656. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts +11 -0
  657. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -0
  658. package/packages/pi-coding-agent/dist/utils/clipboard-image.js +162 -0
  659. package/packages/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -0
  660. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts +7 -0
  661. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -0
  662. package/packages/pi-coding-agent/dist/utils/clipboard-native.js +14 -0
  663. package/packages/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -0
  664. package/packages/pi-coding-agent/dist/utils/clipboard.d.ts +2 -0
  665. package/packages/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -0
  666. package/packages/pi-coding-agent/dist/utils/clipboard.js +67 -0
  667. package/packages/pi-coding-agent/dist/utils/clipboard.js.map +1 -0
  668. package/packages/pi-coding-agent/dist/utils/frontmatter.d.ts +8 -0
  669. package/packages/pi-coding-agent/dist/utils/frontmatter.d.ts.map +1 -0
  670. package/packages/pi-coding-agent/dist/utils/frontmatter.js +26 -0
  671. package/packages/pi-coding-agent/dist/utils/frontmatter.js.map +1 -0
  672. package/packages/pi-coding-agent/dist/utils/git.d.ts +26 -0
  673. package/packages/pi-coding-agent/dist/utils/git.d.ts.map +1 -0
  674. package/packages/pi-coding-agent/dist/utils/git.js +163 -0
  675. package/packages/pi-coding-agent/dist/utils/git.js.map +1 -0
  676. package/packages/pi-coding-agent/dist/utils/image-convert.d.ts +9 -0
  677. package/packages/pi-coding-agent/dist/utils/image-convert.d.ts.map +1 -0
  678. package/packages/pi-coding-agent/dist/utils/image-convert.js +35 -0
  679. package/packages/pi-coding-agent/dist/utils/image-convert.js.map +1 -0
  680. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts +36 -0
  681. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -0
  682. package/packages/pi-coding-agent/dist/utils/image-resize.js +181 -0
  683. package/packages/pi-coding-agent/dist/utils/image-resize.js.map +1 -0
  684. package/packages/pi-coding-agent/dist/utils/mime.d.ts +2 -0
  685. package/packages/pi-coding-agent/dist/utils/mime.d.ts.map +1 -0
  686. package/packages/pi-coding-agent/dist/utils/mime.js +26 -0
  687. package/packages/pi-coding-agent/dist/utils/mime.js.map +1 -0
  688. package/packages/pi-coding-agent/dist/utils/photon.d.ts +21 -0
  689. package/packages/pi-coding-agent/dist/utils/photon.d.ts.map +1 -0
  690. package/packages/pi-coding-agent/dist/utils/photon.js +121 -0
  691. package/packages/pi-coding-agent/dist/utils/photon.js.map +1 -0
  692. package/packages/pi-coding-agent/dist/utils/shell.d.ts +26 -0
  693. package/packages/pi-coding-agent/dist/utils/shell.d.ts.map +1 -0
  694. package/packages/pi-coding-agent/dist/utils/shell.js +186 -0
  695. package/packages/pi-coding-agent/dist/utils/shell.js.map +1 -0
  696. package/packages/pi-coding-agent/dist/utils/sleep.d.ts +5 -0
  697. package/packages/pi-coding-agent/dist/utils/sleep.d.ts.map +1 -0
  698. package/packages/pi-coding-agent/dist/utils/sleep.js +17 -0
  699. package/packages/pi-coding-agent/dist/utils/sleep.js.map +1 -0
  700. package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts +3 -0
  701. package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts.map +1 -0
  702. package/packages/pi-coding-agent/dist/utils/tools-manager.js +251 -0
  703. package/packages/pi-coding-agent/dist/utils/tools-manager.js.map +1 -0
  704. package/packages/pi-coding-agent/package.json +55 -0
  705. package/packages/pi-coding-agent/src/cli/args.ts +316 -0
  706. package/packages/pi-coding-agent/src/cli/config-selector.ts +52 -0
  707. package/packages/pi-coding-agent/src/cli/file-processor.ts +96 -0
  708. package/packages/pi-coding-agent/src/cli/list-models.ts +104 -0
  709. package/packages/pi-coding-agent/src/cli/session-picker.ts +51 -0
  710. package/packages/pi-coding-agent/src/cli.ts +18 -0
  711. package/packages/pi-coding-agent/src/config.ts +241 -0
  712. package/packages/pi-coding-agent/src/core/agent-session.ts +3050 -0
  713. package/packages/pi-coding-agent/src/core/auth-storage.ts +489 -0
  714. package/packages/pi-coding-agent/src/core/bash-executor.ts +278 -0
  715. package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +352 -0
  716. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +813 -0
  717. package/packages/pi-coding-agent/src/core/compaction/index.ts +7 -0
  718. package/packages/pi-coding-agent/src/core/compaction/utils.ts +170 -0
  719. package/packages/pi-coding-agent/src/core/defaults.ts +3 -0
  720. package/packages/pi-coding-agent/src/core/diagnostics.ts +15 -0
  721. package/packages/pi-coding-agent/src/core/event-bus.ts +33 -0
  722. package/packages/pi-coding-agent/src/core/exec.ts +104 -0
  723. package/packages/pi-coding-agent/src/core/export-html/ansi-to-html.ts +258 -0
  724. package/packages/pi-coding-agent/src/core/export-html/index.ts +306 -0
  725. package/packages/pi-coding-agent/src/core/export-html/template.css +971 -0
  726. package/packages/pi-coding-agent/src/core/export-html/template.html +54 -0
  727. package/packages/pi-coding-agent/src/core/export-html/template.js +1583 -0
  728. package/packages/pi-coding-agent/src/core/export-html/tool-renderer.ts +114 -0
  729. package/packages/pi-coding-agent/src/core/export-html/vendor/highlight.min.js +1213 -0
  730. package/packages/pi-coding-agent/src/core/export-html/vendor/marked.min.js +6 -0
  731. package/packages/pi-coding-agent/src/core/extensions/index.ts +171 -0
  732. package/packages/pi-coding-agent/src/core/extensions/loader.ts +545 -0
  733. package/packages/pi-coding-agent/src/core/extensions/runner.ts +884 -0
  734. package/packages/pi-coding-agent/src/core/extensions/types.ts +1411 -0
  735. package/packages/pi-coding-agent/src/core/extensions/wrapper.ts +118 -0
  736. package/packages/pi-coding-agent/src/core/footer-data-provider.ts +144 -0
  737. package/packages/pi-coding-agent/src/core/index.ts +61 -0
  738. package/packages/pi-coding-agent/src/core/keybindings.ts +211 -0
  739. package/packages/pi-coding-agent/src/core/messages.ts +195 -0
  740. package/packages/pi-coding-agent/src/core/model-registry.ts +694 -0
  741. package/packages/pi-coding-agent/src/core/model-resolver.ts +594 -0
  742. package/packages/pi-coding-agent/src/core/package-manager.ts +1794 -0
  743. package/packages/pi-coding-agent/src/core/prompt-templates.ts +299 -0
  744. package/packages/pi-coding-agent/src/core/resolve-config-value.ts +64 -0
  745. package/packages/pi-coding-agent/src/core/resource-loader.ts +868 -0
  746. package/packages/pi-coding-agent/src/core/sdk.ts +373 -0
  747. package/packages/pi-coding-agent/src/core/session-manager.ts +1410 -0
  748. package/packages/pi-coding-agent/src/core/settings-manager.ts +942 -0
  749. package/packages/pi-coding-agent/src/core/skills.ts +459 -0
  750. package/packages/pi-coding-agent/src/core/slash-commands.ts +38 -0
  751. package/packages/pi-coding-agent/src/core/system-prompt.ts +218 -0
  752. package/packages/pi-coding-agent/src/core/timings.ts +25 -0
  753. package/packages/pi-coding-agent/src/core/tools/bash.ts +347 -0
  754. package/packages/pi-coding-agent/src/core/tools/edit-diff.ts +308 -0
  755. package/packages/pi-coding-agent/src/core/tools/edit.ts +227 -0
  756. package/packages/pi-coding-agent/src/core/tools/find.ts +273 -0
  757. package/packages/pi-coding-agent/src/core/tools/grep.ts +346 -0
  758. package/packages/pi-coding-agent/src/core/tools/index.ts +139 -0
  759. package/packages/pi-coding-agent/src/core/tools/ls.ts +170 -0
  760. package/packages/pi-coding-agent/src/core/tools/path-utils.ts +94 -0
  761. package/packages/pi-coding-agent/src/core/tools/read.ts +222 -0
  762. package/packages/pi-coding-agent/src/core/tools/truncate.ts +265 -0
  763. package/packages/pi-coding-agent/src/core/tools/write.ts +118 -0
  764. package/packages/pi-coding-agent/src/index.ts +333 -0
  765. package/packages/pi-coding-agent/src/main.ts +821 -0
  766. package/packages/pi-coding-agent/src/migrations.ts +295 -0
  767. package/packages/pi-coding-agent/src/modes/index.ts +9 -0
  768. package/packages/pi-coding-agent/src/modes/interactive/components/armin.ts +382 -0
  769. package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +115 -0
  770. package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +210 -0
  771. package/packages/pi-coding-agent/src/modes/interactive/components/bordered-loader.ts +66 -0
  772. package/packages/pi-coding-agent/src/modes/interactive/components/branch-summary-message.ts +58 -0
  773. package/packages/pi-coding-agent/src/modes/interactive/components/compaction-summary-message.ts +59 -0
  774. package/packages/pi-coding-agent/src/modes/interactive/components/config-selector.ts +592 -0
  775. package/packages/pi-coding-agent/src/modes/interactive/components/countdown-timer.ts +38 -0
  776. package/packages/pi-coding-agent/src/modes/interactive/components/custom-editor.ts +80 -0
  777. package/packages/pi-coding-agent/src/modes/interactive/components/custom-message.ts +99 -0
  778. package/packages/pi-coding-agent/src/modes/interactive/components/daxnuts.ts +164 -0
  779. package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +147 -0
  780. package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +25 -0
  781. package/packages/pi-coding-agent/src/modes/interactive/components/extension-editor.ts +147 -0
  782. package/packages/pi-coding-agent/src/modes/interactive/components/extension-input.ts +85 -0
  783. package/packages/pi-coding-agent/src/modes/interactive/components/extension-selector.ts +107 -0
  784. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +216 -0
  785. package/packages/pi-coding-agent/src/modes/interactive/components/index.ts +32 -0
  786. package/packages/pi-coding-agent/src/modes/interactive/components/keybinding-hints.ts +66 -0
  787. package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +174 -0
  788. package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +329 -0
  789. package/packages/pi-coding-agent/src/modes/interactive/components/oauth-selector.ts +121 -0
  790. package/packages/pi-coding-agent/src/modes/interactive/components/scoped-models-selector.ts +346 -0
  791. package/packages/pi-coding-agent/src/modes/interactive/components/session-selector-search.ts +194 -0
  792. package/packages/pi-coding-agent/src/modes/interactive/components/session-selector.ts +1019 -0
  793. package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +421 -0
  794. package/packages/pi-coding-agent/src/modes/interactive/components/show-images-selector.ts +45 -0
  795. package/packages/pi-coding-agent/src/modes/interactive/components/skill-invocation-message.ts +55 -0
  796. package/packages/pi-coding-agent/src/modes/interactive/components/theme-selector.ts +62 -0
  797. package/packages/pi-coding-agent/src/modes/interactive/components/thinking-selector.ts +64 -0
  798. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +916 -0
  799. package/packages/pi-coding-agent/src/modes/interactive/components/tree-selector.ts +1184 -0
  800. package/packages/pi-coding-agent/src/modes/interactive/components/user-message-selector.ts +143 -0
  801. package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +32 -0
  802. package/packages/pi-coding-agent/src/modes/interactive/components/visual-truncate.ts +50 -0
  803. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4464 -0
  804. package/packages/pi-coding-agent/src/modes/interactive/theme/dark.json +85 -0
  805. package/packages/pi-coding-agent/src/modes/interactive/theme/light.json +84 -0
  806. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.json +335 -0
  807. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +1105 -0
  808. package/packages/pi-coding-agent/src/modes/print-mode.ts +124 -0
  809. package/packages/pi-coding-agent/src/modes/rpc/jsonl.ts +58 -0
  810. package/packages/pi-coding-agent/src/modes/rpc/rpc-client.ts +505 -0
  811. package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +638 -0
  812. package/packages/pi-coding-agent/src/modes/rpc/rpc-types.ts +263 -0
  813. package/packages/pi-coding-agent/src/utils/changelog.ts +99 -0
  814. package/packages/pi-coding-agent/src/utils/clipboard-image.ts +207 -0
  815. package/packages/pi-coding-agent/src/utils/clipboard-native.ts +21 -0
  816. package/packages/pi-coding-agent/src/utils/clipboard.ts +62 -0
  817. package/packages/pi-coding-agent/src/utils/frontmatter.ts +39 -0
  818. package/packages/pi-coding-agent/src/utils/git.ts +192 -0
  819. package/packages/pi-coding-agent/src/utils/image-convert.ts +38 -0
  820. package/packages/pi-coding-agent/src/utils/image-resize.ts +231 -0
  821. package/packages/pi-coding-agent/src/utils/mime.ts +30 -0
  822. package/packages/pi-coding-agent/src/utils/photon.ts +139 -0
  823. package/packages/pi-coding-agent/src/utils/shell.ts +202 -0
  824. package/packages/pi-coding-agent/src/utils/sleep.ts +18 -0
  825. package/packages/pi-coding-agent/src/utils/tools-manager.ts +286 -0
  826. package/packages/pi-coding-agent/tsconfig.json +27 -0
  827. package/packages/pi-tui/dist/autocomplete.d.ts +50 -0
  828. package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -0
  829. package/packages/pi-tui/dist/autocomplete.js +593 -0
  830. package/packages/pi-tui/dist/autocomplete.js.map +1 -0
  831. package/packages/pi-tui/dist/components/box.d.ts +22 -0
  832. package/packages/pi-tui/dist/components/box.d.ts.map +1 -0
  833. package/packages/pi-tui/dist/components/box.js +99 -0
  834. package/packages/pi-tui/dist/components/box.js.map +1 -0
  835. package/packages/pi-tui/dist/components/cancellable-loader.d.ts +22 -0
  836. package/packages/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -0
  837. package/packages/pi-tui/dist/components/cancellable-loader.js +36 -0
  838. package/packages/pi-tui/dist/components/cancellable-loader.js.map +1 -0
  839. package/packages/pi-tui/dist/components/editor.d.ts +219 -0
  840. package/packages/pi-tui/dist/components/editor.d.ts.map +1 -0
  841. package/packages/pi-tui/dist/components/editor.js +1693 -0
  842. package/packages/pi-tui/dist/components/editor.js.map +1 -0
  843. package/packages/pi-tui/dist/components/image.d.ts +28 -0
  844. package/packages/pi-tui/dist/components/image.d.ts.map +1 -0
  845. package/packages/pi-tui/dist/components/image.js +61 -0
  846. package/packages/pi-tui/dist/components/image.js.map +1 -0
  847. package/packages/pi-tui/dist/components/input.d.ts +37 -0
  848. package/packages/pi-tui/dist/components/input.d.ts.map +1 -0
  849. package/packages/pi-tui/dist/components/input.js +443 -0
  850. package/packages/pi-tui/dist/components/input.js.map +1 -0
  851. package/packages/pi-tui/dist/components/loader.d.ts +21 -0
  852. package/packages/pi-tui/dist/components/loader.d.ts.map +1 -0
  853. package/packages/pi-tui/dist/components/loader.js +46 -0
  854. package/packages/pi-tui/dist/components/loader.js.map +1 -0
  855. package/packages/pi-tui/dist/components/markdown.d.ts +95 -0
  856. package/packages/pi-tui/dist/components/markdown.d.ts.map +1 -0
  857. package/packages/pi-tui/dist/components/markdown.js +641 -0
  858. package/packages/pi-tui/dist/components/markdown.js.map +1 -0
  859. package/packages/pi-tui/dist/components/select-list.d.ts +32 -0
  860. package/packages/pi-tui/dist/components/select-list.d.ts.map +1 -0
  861. package/packages/pi-tui/dist/components/select-list.js +148 -0
  862. package/packages/pi-tui/dist/components/select-list.js.map +1 -0
  863. package/packages/pi-tui/dist/components/settings-list.d.ts +50 -0
  864. package/packages/pi-tui/dist/components/settings-list.d.ts.map +1 -0
  865. package/packages/pi-tui/dist/components/settings-list.js +177 -0
  866. package/packages/pi-tui/dist/components/settings-list.js.map +1 -0
  867. package/packages/pi-tui/dist/components/spacer.d.ts +12 -0
  868. package/packages/pi-tui/dist/components/spacer.d.ts.map +1 -0
  869. package/packages/pi-tui/dist/components/spacer.js +22 -0
  870. package/packages/pi-tui/dist/components/spacer.js.map +1 -0
  871. package/packages/pi-tui/dist/components/text.d.ts +19 -0
  872. package/packages/pi-tui/dist/components/text.d.ts.map +1 -0
  873. package/packages/pi-tui/dist/components/text.js +81 -0
  874. package/packages/pi-tui/dist/components/text.js.map +1 -0
  875. package/packages/pi-tui/dist/components/truncated-text.d.ts +13 -0
  876. package/packages/pi-tui/dist/components/truncated-text.d.ts.map +1 -0
  877. package/packages/pi-tui/dist/components/truncated-text.js +48 -0
  878. package/packages/pi-tui/dist/components/truncated-text.js.map +1 -0
  879. package/packages/pi-tui/dist/editor-component.d.ts +39 -0
  880. package/packages/pi-tui/dist/editor-component.d.ts.map +1 -0
  881. package/packages/pi-tui/dist/editor-component.js +2 -0
  882. package/packages/pi-tui/dist/editor-component.js.map +1 -0
  883. package/packages/pi-tui/dist/fuzzy.d.ts +16 -0
  884. package/packages/pi-tui/dist/fuzzy.d.ts.map +1 -0
  885. package/packages/pi-tui/dist/fuzzy.js +107 -0
  886. package/packages/pi-tui/dist/fuzzy.js.map +1 -0
  887. package/packages/pi-tui/dist/index.d.ts +23 -0
  888. package/packages/pi-tui/dist/index.d.ts.map +1 -0
  889. package/packages/pi-tui/dist/index.js +32 -0
  890. package/packages/pi-tui/dist/index.js.map +1 -0
  891. package/packages/pi-tui/dist/keybindings.d.ts +39 -0
  892. package/packages/pi-tui/dist/keybindings.d.ts.map +1 -0
  893. package/packages/pi-tui/dist/keybindings.js +116 -0
  894. package/packages/pi-tui/dist/keybindings.js.map +1 -0
  895. package/packages/pi-tui/dist/keys.d.ts +170 -0
  896. package/packages/pi-tui/dist/keys.d.ts.map +1 -0
  897. package/packages/pi-tui/dist/keys.js +1046 -0
  898. package/packages/pi-tui/dist/keys.js.map +1 -0
  899. package/packages/pi-tui/dist/kill-ring.d.ts +28 -0
  900. package/packages/pi-tui/dist/kill-ring.d.ts.map +1 -0
  901. package/packages/pi-tui/dist/kill-ring.js +46 -0
  902. package/packages/pi-tui/dist/kill-ring.js.map +1 -0
  903. package/packages/pi-tui/dist/stdin-buffer.d.ts +48 -0
  904. package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -0
  905. package/packages/pi-tui/dist/stdin-buffer.js +316 -0
  906. package/packages/pi-tui/dist/stdin-buffer.js.map +1 -0
  907. package/packages/pi-tui/dist/terminal-image.d.ts +68 -0
  908. package/packages/pi-tui/dist/terminal-image.d.ts.map +1 -0
  909. package/packages/pi-tui/dist/terminal-image.js +288 -0
  910. package/packages/pi-tui/dist/terminal-image.js.map +1 -0
  911. package/packages/pi-tui/dist/terminal.d.ts +85 -0
  912. package/packages/pi-tui/dist/terminal.d.ts.map +1 -0
  913. package/packages/pi-tui/dist/terminal.js +271 -0
  914. package/packages/pi-tui/dist/terminal.js.map +1 -0
  915. package/packages/pi-tui/dist/tui.d.ts +220 -0
  916. package/packages/pi-tui/dist/tui.d.ts.map +1 -0
  917. package/packages/pi-tui/dist/tui.js +976 -0
  918. package/packages/pi-tui/dist/tui.js.map +1 -0
  919. package/packages/pi-tui/dist/undo-stack.d.ts +17 -0
  920. package/packages/pi-tui/dist/undo-stack.d.ts.map +1 -0
  921. package/packages/pi-tui/dist/undo-stack.js +27 -0
  922. package/packages/pi-tui/dist/undo-stack.js.map +1 -0
  923. package/packages/pi-tui/dist/utils.d.ts +78 -0
  924. package/packages/pi-tui/dist/utils.d.ts.map +1 -0
  925. package/packages/pi-tui/dist/utils.js +817 -0
  926. package/packages/pi-tui/dist/utils.js.map +1 -0
  927. package/packages/pi-tui/package.json +21 -0
  928. package/packages/pi-tui/src/autocomplete.ts +736 -0
  929. package/packages/pi-tui/src/components/box.ts +137 -0
  930. package/packages/pi-tui/src/components/cancellable-loader.ts +40 -0
  931. package/packages/pi-tui/src/components/editor.ts +2035 -0
  932. package/packages/pi-tui/src/components/image.ts +104 -0
  933. package/packages/pi-tui/src/components/input.ts +521 -0
  934. package/packages/pi-tui/src/components/loader.ts +55 -0
  935. package/packages/pi-tui/src/components/markdown.ts +806 -0
  936. package/packages/pi-tui/src/components/select-list.ts +188 -0
  937. package/packages/pi-tui/src/components/settings-list.ts +250 -0
  938. package/packages/pi-tui/src/components/spacer.ts +28 -0
  939. package/packages/pi-tui/src/components/text.ts +106 -0
  940. package/packages/pi-tui/src/components/truncated-text.ts +65 -0
  941. package/packages/pi-tui/src/editor-component.ts +74 -0
  942. package/packages/pi-tui/src/fuzzy.ts +133 -0
  943. package/packages/pi-tui/src/index.ts +93 -0
  944. package/packages/pi-tui/src/keybindings.ts +189 -0
  945. package/packages/pi-tui/src/keys.ts +1255 -0
  946. package/packages/pi-tui/src/kill-ring.ts +46 -0
  947. package/packages/pi-tui/src/stdin-buffer.ts +386 -0
  948. package/packages/pi-tui/src/terminal-image.ts +381 -0
  949. package/packages/pi-tui/src/terminal.ts +349 -0
  950. package/packages/pi-tui/src/tui.ts +1212 -0
  951. package/packages/pi-tui/src/undo-stack.ts +28 -0
  952. package/packages/pi-tui/src/utils.ts +905 -0
  953. package/packages/pi-tui/tsconfig.json +27 -0
  954. package/pkg/dist/modes/interactive/theme/theme.d.ts +2 -2
  955. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  956. package/pkg/dist/modes/interactive/theme/theme.js +1 -6
  957. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  958. package/scripts/postinstall.js +1 -16
  959. package/src/resources/extensions/ask-user-questions.ts +2 -2
  960. package/src/resources/extensions/bg-shell/index.ts +4 -4
  961. package/src/resources/extensions/browser-tools/index.ts +3 -3
  962. package/src/resources/extensions/context7/index.ts +3 -3
  963. package/src/resources/extensions/get-secrets-from-user.ts +2 -2
  964. package/src/resources/extensions/google-search/index.ts +3 -3
  965. package/src/resources/extensions/gsd/activity-log.ts +1 -1
  966. package/src/resources/extensions/gsd/auto.ts +2 -2
  967. package/src/resources/extensions/gsd/commands.ts +2 -2
  968. package/src/resources/extensions/gsd/dashboard-overlay.ts +2 -2
  969. package/src/resources/extensions/gsd/guided-flow.ts +1 -1
  970. package/src/resources/extensions/gsd/index.ts +4 -4
  971. package/src/resources/extensions/gsd/metrics.ts +1 -1
  972. package/src/resources/extensions/gsd/migrate/command.ts +1 -1
  973. package/src/resources/extensions/gsd/preferences.ts +1 -1
  974. package/src/resources/extensions/gsd/skill-discovery.ts +1 -1
  975. package/src/resources/extensions/gsd/tests/resolve-ts-hooks.mjs +2 -1
  976. package/src/resources/extensions/gsd/worktree-command.ts +1 -1
  977. package/src/resources/extensions/mac-tools/index.ts +2 -2
  978. package/src/resources/extensions/mcporter/index.ts +3 -3
  979. package/src/resources/extensions/remote-questions/remote-command.ts +3 -3
  980. package/src/resources/extensions/search-the-web/command-search-provider.ts +2 -2
  981. package/src/resources/extensions/search-the-web/index.ts +1 -1
  982. package/src/resources/extensions/search-the-web/provider.ts +1 -1
  983. package/src/resources/extensions/search-the-web/tool-fetch-page.ts +3 -3
  984. package/src/resources/extensions/search-the-web/tool-llm-context.ts +4 -4
  985. package/src/resources/extensions/search-the-web/tool-search.ts +4 -4
  986. package/src/resources/extensions/shared/confirm-ui.ts +3 -3
  987. package/src/resources/extensions/shared/interview-ui.ts +3 -3
  988. package/src/resources/extensions/shared/next-action-ui.ts +3 -3
  989. package/src/resources/extensions/shared/progress-widget.ts +2 -2
  990. package/src/resources/extensions/shared/thinking-widget.ts +3 -3
  991. package/src/resources/extensions/shared/ui.ts +4 -4
  992. package/src/resources/extensions/shared/wizard-ui.ts +4 -4
  993. package/src/resources/extensions/slash-commands/audit.ts +1 -1
  994. package/src/resources/extensions/slash-commands/clear.ts +1 -1
  995. package/src/resources/extensions/slash-commands/create-extension.ts +2 -2
  996. package/src/resources/extensions/slash-commands/create-slash-command.ts +2 -2
  997. package/src/resources/extensions/slash-commands/index.ts +1 -1
  998. package/src/resources/extensions/subagent/agents.ts +1 -1
  999. package/src/resources/extensions/subagent/index.ts +5 -5
  1000. package/src/resources/extensions/voice/index.ts +3 -3
  1001. package/patches/@mariozechner+pi-coding-agent+0.57.1.patch +0 -108
  1002. package/patches/@mariozechner+pi-tui+0.57.1.patch +0 -47
@@ -0,0 +1,259 @@
1
+ import { modelsAreEqual } from "@gsd/pi-ai";
2
+ import { Container, fuzzyFilter, getEditorKeybindings, Input, Spacer, Text, } from "@gsd/pi-tui";
3
+ import { theme } from "../theme/theme.js";
4
+ import { DynamicBorder } from "./dynamic-border.js";
5
+ import { keyHint } from "./keybinding-hints.js";
6
+ /**
7
+ * Component that renders a model selector with search
8
+ */
9
+ export class ModelSelectorComponent extends Container {
10
+ get focused() {
11
+ return this._focused;
12
+ }
13
+ set focused(value) {
14
+ this._focused = value;
15
+ this.searchInput.focused = value;
16
+ }
17
+ constructor(tui, currentModel, settingsManager, modelRegistry, scopedModels, onSelect, onCancel, initialSearchInput) {
18
+ super();
19
+ // Focusable implementation - propagate to searchInput for IME cursor positioning
20
+ this._focused = false;
21
+ this.allModels = [];
22
+ this.scopedModelItems = [];
23
+ this.activeModels = [];
24
+ this.filteredModels = [];
25
+ this.selectedIndex = 0;
26
+ this.scope = "all";
27
+ this.tui = tui;
28
+ this.currentModel = currentModel;
29
+ this.settingsManager = settingsManager;
30
+ this.modelRegistry = modelRegistry;
31
+ this.scopedModels = scopedModels;
32
+ this.scope = scopedModels.length > 0 ? "scoped" : "all";
33
+ this.onSelectCallback = onSelect;
34
+ this.onCancelCallback = onCancel;
35
+ // Add top border
36
+ this.addChild(new DynamicBorder());
37
+ this.addChild(new Spacer(1));
38
+ // Add hint about model filtering
39
+ if (scopedModels.length > 0) {
40
+ this.scopeText = new Text(this.getScopeText(), 0, 0);
41
+ this.addChild(this.scopeText);
42
+ this.scopeHintText = new Text(this.getScopeHintText(), 0, 0);
43
+ this.addChild(this.scopeHintText);
44
+ }
45
+ else {
46
+ const hintText = "Only showing models with configured API keys (see README for details)";
47
+ this.addChild(new Text(theme.fg("warning", hintText), 0, 0));
48
+ }
49
+ this.addChild(new Spacer(1));
50
+ // Create search input
51
+ this.searchInput = new Input();
52
+ if (initialSearchInput) {
53
+ this.searchInput.setValue(initialSearchInput);
54
+ }
55
+ this.searchInput.onSubmit = () => {
56
+ // Enter on search input selects the first filtered item
57
+ if (this.filteredModels[this.selectedIndex]) {
58
+ this.handleSelect(this.filteredModels[this.selectedIndex].model);
59
+ }
60
+ };
61
+ this.addChild(this.searchInput);
62
+ this.addChild(new Spacer(1));
63
+ // Create list container
64
+ this.listContainer = new Container();
65
+ this.addChild(this.listContainer);
66
+ this.addChild(new Spacer(1));
67
+ // Add bottom border
68
+ this.addChild(new DynamicBorder());
69
+ // Load models and do initial render
70
+ this.loadModels().then(() => {
71
+ if (initialSearchInput) {
72
+ this.filterModels(initialSearchInput);
73
+ }
74
+ else {
75
+ this.updateList();
76
+ }
77
+ // Request re-render after models are loaded
78
+ this.tui.requestRender();
79
+ });
80
+ }
81
+ async loadModels() {
82
+ let models;
83
+ // Refresh to pick up any changes to models.json
84
+ this.modelRegistry.refresh();
85
+ // Check for models.json errors
86
+ const loadError = this.modelRegistry.getError();
87
+ if (loadError) {
88
+ this.errorMessage = loadError;
89
+ }
90
+ // Load available models (built-in models still work even if models.json failed)
91
+ try {
92
+ const availableModels = await this.modelRegistry.getAvailable();
93
+ models = availableModels.map((model) => ({
94
+ provider: model.provider,
95
+ id: model.id,
96
+ model,
97
+ }));
98
+ }
99
+ catch (error) {
100
+ this.allModels = [];
101
+ this.scopedModelItems = [];
102
+ this.activeModels = [];
103
+ this.filteredModels = [];
104
+ this.errorMessage = error instanceof Error ? error.message : String(error);
105
+ return;
106
+ }
107
+ this.allModels = this.sortModels(models);
108
+ this.scopedModelItems = this.sortModels(this.scopedModels.map((scoped) => ({
109
+ provider: scoped.model.provider,
110
+ id: scoped.model.id,
111
+ model: scoped.model,
112
+ })));
113
+ this.activeModels = this.scope === "scoped" ? this.scopedModelItems : this.allModels;
114
+ this.filteredModels = this.activeModels;
115
+ this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));
116
+ }
117
+ sortModels(models) {
118
+ const sorted = [...models];
119
+ // Sort: current model first, then by provider
120
+ sorted.sort((a, b) => {
121
+ const aIsCurrent = modelsAreEqual(this.currentModel, a.model);
122
+ const bIsCurrent = modelsAreEqual(this.currentModel, b.model);
123
+ if (aIsCurrent && !bIsCurrent)
124
+ return -1;
125
+ if (!aIsCurrent && bIsCurrent)
126
+ return 1;
127
+ return a.provider.localeCompare(b.provider);
128
+ });
129
+ return sorted;
130
+ }
131
+ getScopeText() {
132
+ const allText = this.scope === "all" ? theme.fg("accent", "all") : theme.fg("muted", "all");
133
+ const scopedText = this.scope === "scoped" ? theme.fg("accent", "scoped") : theme.fg("muted", "scoped");
134
+ return `${theme.fg("muted", "Scope: ")}${allText}${theme.fg("muted", " | ")}${scopedText}`;
135
+ }
136
+ getScopeHintText() {
137
+ return keyHint("tab", "scope") + theme.fg("muted", " (all/scoped)");
138
+ }
139
+ setScope(scope) {
140
+ if (this.scope === scope)
141
+ return;
142
+ this.scope = scope;
143
+ this.activeModels = this.scope === "scoped" ? this.scopedModelItems : this.allModels;
144
+ this.selectedIndex = 0;
145
+ this.filterModels(this.searchInput.getValue());
146
+ if (this.scopeText) {
147
+ this.scopeText.setText(this.getScopeText());
148
+ }
149
+ }
150
+ filterModels(query) {
151
+ this.filteredModels = query
152
+ ? fuzzyFilter(this.activeModels, query, ({ id, provider }) => `${id} ${provider}`)
153
+ : this.activeModels;
154
+ this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));
155
+ this.updateList();
156
+ }
157
+ updateList() {
158
+ this.listContainer.clear();
159
+ const maxVisible = 10;
160
+ const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(maxVisible / 2), this.filteredModels.length - maxVisible));
161
+ const endIndex = Math.min(startIndex + maxVisible, this.filteredModels.length);
162
+ // Show visible slice of filtered models
163
+ for (let i = startIndex; i < endIndex; i++) {
164
+ const item = this.filteredModels[i];
165
+ if (!item)
166
+ continue;
167
+ const isSelected = i === this.selectedIndex;
168
+ const isCurrent = modelsAreEqual(this.currentModel, item.model);
169
+ let line = "";
170
+ if (isSelected) {
171
+ const prefix = theme.fg("accent", "→ ");
172
+ const modelText = `${item.id}`;
173
+ const providerBadge = theme.fg("muted", `[${item.provider}]`);
174
+ const checkmark = isCurrent ? theme.fg("success", " ✓") : "";
175
+ line = `${prefix + theme.fg("accent", modelText)} ${providerBadge}${checkmark}`;
176
+ }
177
+ else {
178
+ const modelText = ` ${item.id}`;
179
+ const providerBadge = theme.fg("muted", `[${item.provider}]`);
180
+ const checkmark = isCurrent ? theme.fg("success", " ✓") : "";
181
+ line = `${modelText} ${providerBadge}${checkmark}`;
182
+ }
183
+ this.listContainer.addChild(new Text(line, 0, 0));
184
+ }
185
+ // Add scroll indicator if needed
186
+ if (startIndex > 0 || endIndex < this.filteredModels.length) {
187
+ const scrollInfo = theme.fg("muted", ` (${this.selectedIndex + 1}/${this.filteredModels.length})`);
188
+ this.listContainer.addChild(new Text(scrollInfo, 0, 0));
189
+ }
190
+ // Show error message or "no results" if empty
191
+ if (this.errorMessage) {
192
+ // Show error in red
193
+ const errorLines = this.errorMessage.split("\n");
194
+ for (const line of errorLines) {
195
+ this.listContainer.addChild(new Text(theme.fg("error", line), 0, 0));
196
+ }
197
+ }
198
+ else if (this.filteredModels.length === 0) {
199
+ this.listContainer.addChild(new Text(theme.fg("muted", " No matching models"), 0, 0));
200
+ }
201
+ else {
202
+ const selected = this.filteredModels[this.selectedIndex];
203
+ this.listContainer.addChild(new Spacer(1));
204
+ this.listContainer.addChild(new Text(theme.fg("muted", ` Model Name: ${selected.model.name}`), 0, 0));
205
+ }
206
+ }
207
+ handleInput(keyData) {
208
+ const kb = getEditorKeybindings();
209
+ if (kb.matches(keyData, "tab")) {
210
+ if (this.scopedModelItems.length > 0) {
211
+ const nextScope = this.scope === "all" ? "scoped" : "all";
212
+ this.setScope(nextScope);
213
+ if (this.scopeHintText) {
214
+ this.scopeHintText.setText(this.getScopeHintText());
215
+ }
216
+ }
217
+ return;
218
+ }
219
+ // Up arrow - wrap to bottom when at top
220
+ if (kb.matches(keyData, "selectUp")) {
221
+ if (this.filteredModels.length === 0)
222
+ return;
223
+ this.selectedIndex = this.selectedIndex === 0 ? this.filteredModels.length - 1 : this.selectedIndex - 1;
224
+ this.updateList();
225
+ }
226
+ // Down arrow - wrap to top when at bottom
227
+ else if (kb.matches(keyData, "selectDown")) {
228
+ if (this.filteredModels.length === 0)
229
+ return;
230
+ this.selectedIndex = this.selectedIndex === this.filteredModels.length - 1 ? 0 : this.selectedIndex + 1;
231
+ this.updateList();
232
+ }
233
+ // Enter
234
+ else if (kb.matches(keyData, "selectConfirm")) {
235
+ const selectedModel = this.filteredModels[this.selectedIndex];
236
+ if (selectedModel) {
237
+ this.handleSelect(selectedModel.model);
238
+ }
239
+ }
240
+ // Escape or Ctrl+C
241
+ else if (kb.matches(keyData, "selectCancel")) {
242
+ this.onCancelCallback();
243
+ }
244
+ // Pass everything else to search input
245
+ else {
246
+ this.searchInput.handleInput(keyData);
247
+ this.filterModels(this.searchInput.getValue());
248
+ }
249
+ }
250
+ handleSelect(model) {
251
+ // Save as new default
252
+ this.settingsManager.setDefaultModelAndProvider(model.provider, model.id);
253
+ this.onSelectCallback(model);
254
+ }
255
+ getSearchInput() {
256
+ return this.searchInput;
257
+ }
258
+ }
259
+ //# sourceMappingURL=model-selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/model-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EACN,SAAS,EAET,WAAW,EACX,oBAAoB,EACpB,KAAK,EACL,MAAM,EACN,IAAI,GAEJ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAehD;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IAKpD,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IACD,IAAI,OAAO,CAAC,KAAc;QACzB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC;IAClC,CAAC;IAmBD,YACC,GAAQ,EACR,YAAoC,EACpC,eAAgC,EAChC,aAA4B,EAC5B,YAA4C,EAC5C,QAAqC,EACrC,Q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ditorKeybindings,\n\tInput,\n\tSpacer,\n\tText,\n\ttype TUI,\n} from \"@gsd/pi-tui\";\nimport type { ModelRegistry } from \"../../../core/model-registry.js\";\nimport type { SettingsManager } from \"../../../core/settings-manager.js\";\nimport { theme } from \"../theme/theme.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { keyHint } from \"./keybinding-hints.js\";\n\ninterface ModelItem {\n\tprovider: string;\n\tid: string;\n\tmodel: Model<any>;\n}\n\ninterface ScopedModelItem {\n\tmodel: Model<any>;\n\tthinkingLevel?: string;\n}\n\ntype ModelScope = \"all\" | \"scoped\";\n\n/**\n * Component that renders a model selector with search\n */\nexport class ModelSelectorComponent extends Container implements Focusable {\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 allModels: ModelItem[] = [];\n\tprivate scopedModelItems: ModelItem[] = [];\n\tprivate activeModels: ModelItem[] = [];\n\tprivate filteredModels: ModelItem[] = [];\n\tprivate selectedIndex: number = 0;\n\tprivate currentModel?: Model<any>;\n\tprivate settingsManager: SettingsManager;\n\tprivate modelRegistry: ModelRegistry;\n\tprivate onSelectCallback: (model: Model<any>) => void;\n\tprivate onCancelCallback: () => void;\n\tprivate errorMessage?: string;\n\tprivate tui: TUI;\n\tprivate scopedModels: ReadonlyArray<ScopedModelItem>;\n\tprivate scope: ModelScope = \"all\";\n\tprivate scopeText?: Text;\n\tprivate scopeHintText?: Text;\n\n\tconstructor(\n\t\ttui: TUI,\n\t\tcurrentModel: Model<any> | undefined,\n\t\tsettingsManager: SettingsManager,\n\t\tmodelRegistry: ModelRegistry,\n\t\tscopedModels: ReadonlyArray<ScopedModelItem>,\n\t\tonSelect: (model: Model<any>) => void,\n\t\tonCancel: () => void,\n\t\tinitialSearchInput?: string,\n\t) {\n\t\tsuper();\n\n\t\tthis.tui = tui;\n\t\tthis.currentModel = currentModel;\n\t\tthis.settingsManager = settingsManager;\n\t\tthis.modelRegistry = modelRegistry;\n\t\tthis.scopedModels = scopedModels;\n\t\tthis.scope = scopedModels.length > 0 ? \"scoped\" : \"all\";\n\t\tthis.onSelectCallback = onSelect;\n\t\tthis.onCancelCallback = onCancel;\n\n\t\t// Add top border\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add hint about model filtering\n\t\tif (scopedModels.length > 0) {\n\t\t\tthis.scopeText = new Text(this.getScopeText(), 0, 0);\n\t\t\tthis.addChild(this.scopeText);\n\t\t\tthis.scopeHintText = new Text(this.getScopeHintText(), 0, 0);\n\t\t\tthis.addChild(this.scopeHintText);\n\t\t} else {\n\t\t\tconst hintText = \"Only showing models with configured API keys (see README for details)\";\n\t\t\tthis.addChild(new Text(theme.fg(\"warning\", hintText), 0, 0));\n\t\t}\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Create search input\n\t\tthis.searchInput = new Input();\n\t\tif (initialSearchInput) {\n\t\t\tthis.searchInput.setValue(initialSearchInput);\n\t\t}\n\t\tthis.searchInput.onSubmit = () => {\n\t\t\t// Enter on search input selects the first filtered item\n\t\t\tif (this.filteredModels[this.selectedIndex]) {\n\t\t\t\tthis.handleSelect(this.filteredModels[this.selectedIndex].model);\n\t\t\t}\n\t\t};\n\t\tthis.addChild(this.searchInput);\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Create list container\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add bottom border\n\t\tthis.addChild(new DynamicBorder());\n\n\t\t// Load models and do initial render\n\t\tthis.loadModels().then(() => {\n\t\t\tif (initialSearchInput) {\n\t\t\t\tthis.filterModels(initialSearchInput);\n\t\t\t} else {\n\t\t\t\tthis.updateList();\n\t\t\t}\n\t\t\t// Request re-render after models are loaded\n\t\t\tthis.tui.requestRender();\n\t\t});\n\t}\n\n\tprivate async loadModels(): Promise<void> {\n\t\tlet models: ModelItem[];\n\n\t\t// Refresh to pick up any changes to models.json\n\t\tthis.modelRegistry.refresh();\n\n\t\t// Check for models.json errors\n\t\tconst loadError = this.modelRegistry.getError();\n\t\tif (loadError) {\n\t\t\tthis.errorMessage = loadError;\n\t\t}\n\n\t\t// Load available models (built-in models still work even if models.json failed)\n\t\ttry {\n\t\t\tconst availableModels = await this.modelRegistry.getAvailable();\n\t\t\tmodels = availableModels.map((model: Model<any>) => ({\n\t\t\t\tprovider: model.provider,\n\t\t\t\tid: model.id,\n\t\t\t\tmodel,\n\t\t\t}));\n\t\t} catch (error) {\n\t\t\tthis.allModels = [];\n\t\t\tthis.scopedModelItems = [];\n\t\t\tthis.activeModels = [];\n\t\t\tthis.filteredModels = [];\n\t\t\tthis.errorMessage = error instanceof Error ? error.message : String(error);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.allModels = this.sortModels(models);\n\t\tthis.scopedModelItems = this.sortModels(\n\t\t\tthis.scopedModels.map((scoped) => ({\n\t\t\t\tprovider: scoped.model.provider,\n\t\t\t\tid: scoped.model.id,\n\t\t\t\tmodel: scoped.model,\n\t\t\t})),\n\t\t);\n\t\tthis.activeModels = this.scope === \"scoped\" ? this.scopedModelItems : this.allModels;\n\t\tthis.filteredModels = this.activeModels;\n\t\tthis.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));\n\t}\n\n\tprivate sortModels(models: ModelItem[]): ModelItem[] {\n\t\tconst sorted = [...models];\n\t\t// Sort: current model first, then by provider\n\t\tsorted.sort((a, b) => {\n\t\t\tconst aIsCurrent = modelsAreEqual(this.currentModel, a.model);\n\t\t\tconst bIsCurrent = modelsAreEqual(this.currentModel, b.model);\n\t\t\tif (aIsCurrent && !bIsCurrent) return -1;\n\t\t\tif (!aIsCurrent && bIsCurrent) return 1;\n\t\t\treturn a.provider.localeCompare(b.provider);\n\t\t});\n\t\treturn sorted;\n\t}\n\n\tprivate getScopeText(): string {\n\t\tconst allText = this.scope === \"all\" ? theme.fg(\"accent\", \"all\") : theme.fg(\"muted\", \"all\");\n\t\tconst scopedText = this.scope === \"scoped\" ? theme.fg(\"accent\", \"scoped\") : theme.fg(\"muted\", \"scoped\");\n\t\treturn `${theme.fg(\"muted\", \"Scope: \")}${allText}${theme.fg(\"muted\", \" | \")}${scopedText}`;\n\t}\n\n\tprivate getScopeHintText(): string {\n\t\treturn keyHint(\"tab\", \"scope\") + theme.fg(\"muted\", \" (all/scoped)\");\n\t}\n\n\tprivate setScope(scope: ModelScope): void {\n\t\tif (this.scope === scope) return;\n\t\tthis.scope = scope;\n\t\tthis.activeModels = this.scope === \"scoped\" ? this.scopedModelItems : this.allModels;\n\t\tthis.selectedIndex = 0;\n\t\tthis.filterModels(this.searchInput.getValue());\n\t\tif (this.scopeText) {\n\t\t\tthis.scopeText.setText(this.getScopeText());\n\t\t}\n\t}\n\n\tprivate filterModels(query: string): void {\n\t\tthis.filteredModels = query\n\t\t\t? fuzzyFilter(this.activeModels, query, ({ id, provider }) => `${id} ${provider}`)\n\t\t\t: this.activeModels;\n\t\tthis.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));\n\t\tthis.updateList();\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\n\t\tconst maxVisible = 10;\n\t\tconst startIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.selectedIndex - Math.floor(maxVisible / 2), this.filteredModels.length - maxVisible),\n\t\t);\n\t\tconst endIndex = Math.min(startIndex + maxVisible, this.filteredModels.length);\n\n\t\t// Show visible slice of filtered models\n\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\tconst item = this.filteredModels[i];\n\t\t\tif (!item) continue;\n\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst isCurrent = modelsAreEqual(this.currentModel, item.model);\n\n\t\t\tlet line = \"\";\n\t\t\tif (isSelected) {\n\t\t\t\tconst prefix = theme.fg(\"accent\", \"→ \");\n\t\t\t\tconst modelText = `${item.id}`;\n\t\t\t\tconst providerBadge = theme.fg(\"muted\", `[${item.provider}]`);\n\t\t\t\tconst checkmark = isCurrent ? theme.fg(\"success\", \" ✓\") : \"\";\n\t\t\t\tline = `${prefix + theme.fg(\"accent\", modelText)} ${providerBadge}${checkmark}`;\n\t\t\t} else {\n\t\t\t\tconst modelText = ` ${item.id}`;\n\t\t\t\tconst providerBadge = theme.fg(\"muted\", `[${item.provider}]`);\n\t\t\t\tconst checkmark = isCurrent ? theme.fg(\"success\", \" ✓\") : \"\";\n\t\t\t\tline = `${modelText} ${providerBadge}${checkmark}`;\n\t\t\t}\n\n\t\t\tthis.listContainer.addChild(new Text(line, 0, 0));\n\t\t}\n\n\t\t// Add scroll indicator if needed\n\t\tif (startIndex > 0 || endIndex < this.filteredModels.length) {\n\t\t\tconst scrollInfo = theme.fg(\"muted\", ` (${this.selectedIndex + 1}/${this.filteredModels.length})`);\n\t\t\tthis.listContainer.addChild(new Text(scrollInfo, 0, 0));\n\t\t}\n\n\t\t// Show error message or \"no results\" if empty\n\t\tif (this.errorMessage) {\n\t\t\t// Show error in red\n\t\t\tconst errorLines = this.errorMessage.split(\"\\n\");\n\t\t\tfor (const line of errorLines) {\n\t\t\t\tthis.listContainer.addChild(new Text(theme.fg(\"error\", line), 0, 0));\n\t\t\t}\n\t\t} else if (this.filteredModels.length === 0) {\n\t\t\tthis.listContainer.addChild(new Text(theme.fg(\"muted\", \" No matching models\"), 0, 0));\n\t\t} else {\n\t\t\tconst selected = this.filteredModels[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(keyData: string): void {\n\t\tconst kb = getEditorKeybindings();\n\t\tif (kb.matches(keyData, \"tab\")) {\n\t\t\tif (this.scopedModelItems.length > 0) {\n\t\t\t\tconst nextScope: ModelScope = this.scope === \"all\" ? \"scoped\" : \"all\";\n\t\t\t\tthis.setScope(nextScope);\n\t\t\t\tif (this.scopeHintText) {\n\t\t\t\t\tthis.scopeHintText.setText(this.getScopeHintText());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// Up arrow - wrap to bottom when at top\n\t\tif (kb.matches(keyData, \"selectUp\")) {\n\t\t\tif (this.filteredModels.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === 0 ? this.filteredModels.length - 1 : this.selectedIndex - 1;\n\t\t\tthis.updateList();\n\t\t}\n\t\t// Down arrow - wrap to top when at bottom\n\t\telse if (kb.matches(keyData, \"selectDown\")) {\n\t\t\tif (this.filteredModels.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === this.filteredModels.length - 1 ? 0 : this.selectedIndex + 1;\n\t\t\tthis.updateList();\n\t\t}\n\t\t// Enter\n\t\telse if (kb.matches(keyData, \"selectConfirm\")) {\n\t\t\tconst selectedModel = this.filteredModels[this.selectedIndex];\n\t\t\tif (selectedModel) {\n\t\t\t\tthis.handleSelect(selectedModel.model);\n\t\t\t}\n\t\t}\n\t\t// Escape or Ctrl+C\n\t\telse if (kb.matches(keyData, \"selectCancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t}\n\t\t// Pass everything else to search input\n\t\telse {\n\t\t\tthis.searchInput.handleInput(keyData);\n\t\t\tthis.filterModels(this.searchInput.getValue());\n\t\t}\n\t}\n\n\tprivate handleSelect(model: Model<any>): void {\n\t\t// Save as new default\n\t\tthis.settingsManager.setDefaultModelAndProvider(model.provider, model.id);\n\t\tthis.onSelectCallback(model);\n\t}\n\n\tgetSearchInput(): Input {\n\t\treturn this.searchInput;\n\t}\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { Container } from "@gsd/pi-tui";
2
+ import type { AuthStorage } from "../../../core/auth-storage.js";
3
+ /**
4
+ * Component that renders an OAuth provider selector
5
+ */
6
+ export declare class OAuthSelectorComponent extends Container {
7
+ private listContainer;
8
+ private allProviders;
9
+ private selectedIndex;
10
+ private mode;
11
+ private authStorage;
12
+ private onSelectCallback;
13
+ private onCancelCallback;
14
+ constructor(mode: "login" | "logout", authStorage: AuthStorage, onSelect: (providerId: string) => void, onCancel: () => void);
15
+ private loadProviders;
16
+ private updateList;
17
+ handleInput(keyData: string): void;
18
+ }
19
+ //# sourceMappingURL=oauth-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/oauth-selector.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAA+C,MAAM,aAAa,CAAC;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAIjE;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,YAAY,CAAgC;IACpD,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,gBAAgB,CAA+B;IACvD,OAAO,CAAC,gBAAgB,CAAa;gBAGpC,IAAI,EAAE,OAAO,GAAG,QAAQ,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,EACtC,QAAQ,EAAE,MAAM,IAAI;IAkCrB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,UAAU;IAmClB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAwBlC"}
@@ -0,0 +1,92 @@
1
+ import { getOAuthProviders } from "@gsd/pi-ai/oauth";
2
+ import { Container, getEditorKeybindings, Spacer, TruncatedText } from "@gsd/pi-tui";
3
+ import { theme } from "../theme/theme.js";
4
+ import { DynamicBorder } from "./dynamic-border.js";
5
+ /**
6
+ * Component that renders an OAuth provider selector
7
+ */
8
+ export class OAuthSelectorComponent extends Container {
9
+ constructor(mode, authStorage, onSelect, onCancel) {
10
+ super();
11
+ this.allProviders = [];
12
+ this.selectedIndex = 0;
13
+ this.mode = mode;
14
+ this.authStorage = authStorage;
15
+ this.onSelectCallback = onSelect;
16
+ this.onCancelCallback = onCancel;
17
+ // Load all OAuth providers
18
+ this.loadProviders();
19
+ // Add top border
20
+ this.addChild(new DynamicBorder());
21
+ this.addChild(new Spacer(1));
22
+ // Add title
23
+ const title = mode === "login" ? "Select provider to login:" : "Select provider to logout:";
24
+ this.addChild(new TruncatedText(theme.bold(title)));
25
+ this.addChild(new Spacer(1));
26
+ // Create list container
27
+ this.listContainer = new Container();
28
+ this.addChild(this.listContainer);
29
+ this.addChild(new Spacer(1));
30
+ // Add bottom border
31
+ this.addChild(new DynamicBorder());
32
+ // Initial render
33
+ this.updateList();
34
+ }
35
+ loadProviders() {
36
+ this.allProviders = getOAuthProviders();
37
+ }
38
+ updateList() {
39
+ this.listContainer.clear();
40
+ for (let i = 0; i < this.allProviders.length; i++) {
41
+ const provider = this.allProviders[i];
42
+ if (!provider)
43
+ continue;
44
+ const isSelected = i === this.selectedIndex;
45
+ // Check if user is logged in for this provider
46
+ const credentials = this.authStorage.get(provider.id);
47
+ const isLoggedIn = credentials?.type === "oauth";
48
+ const statusIndicator = isLoggedIn ? theme.fg("success", " ✓ logged in") : "";
49
+ let line = "";
50
+ if (isSelected) {
51
+ const prefix = theme.fg("accent", "→ ");
52
+ const text = theme.fg("accent", provider.name);
53
+ line = prefix + text + statusIndicator;
54
+ }
55
+ else {
56
+ const text = ` ${provider.name}`;
57
+ line = text + statusIndicator;
58
+ }
59
+ this.listContainer.addChild(new TruncatedText(line, 0, 0));
60
+ }
61
+ // Show "no providers" if empty
62
+ if (this.allProviders.length === 0) {
63
+ const message = this.mode === "login" ? "No OAuth providers available" : "No OAuth providers logged in. Use /login first.";
64
+ this.listContainer.addChild(new TruncatedText(theme.fg("muted", ` ${message}`), 0, 0));
65
+ }
66
+ }
67
+ handleInput(keyData) {
68
+ const kb = getEditorKeybindings();
69
+ // Up arrow
70
+ if (kb.matches(keyData, "selectUp")) {
71
+ this.selectedIndex = Math.max(0, this.selectedIndex - 1);
72
+ this.updateList();
73
+ }
74
+ // Down arrow
75
+ else if (kb.matches(keyData, "selectDown")) {
76
+ this.selectedIndex = Math.min(this.allProviders.length - 1, this.selectedIndex + 1);
77
+ this.updateList();
78
+ }
79
+ // Enter
80
+ else if (kb.matches(keyData, "selectConfirm")) {
81
+ const selectedProvider = this.allProviders[this.selectedIndex];
82
+ if (selectedProvider) {
83
+ this.onSelectCallback(selectedProvider.id);
84
+ }
85
+ }
86
+ // Escape or Ctrl+C
87
+ else if (kb.matches(keyData, "selectCancel")) {
88
+ this.onCancelCallback();
89
+ }
90
+ }
91
+ }
92
+ //# sourceMappingURL=oauth-selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/oauth-selector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAErF,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IASpD,YACC,IAAwB,EACxB,WAAwB,EACxB,QAAsC,EACtC,QAAoB;QAEpB,KAAK,EAAE,CAAC;QAbD,iBAAY,GAA6B,EAAE,CAAC;QAC5C,kBAAa,GAAW,CAAC,CAAC;QAcjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,gBAAg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O,EAAE,KAAK,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzF,CAAC;IACF,CAAC;IAED,WAAW,CAAC,OAAe;QAC1B,MAAM,EAAE,GAAG,oBAAoB,EAAE,CAAC;QAClC,WAAW;QACX,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC;YACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;YACzD,IAAI,CAAC,UAAU,EAAE,CAAC;QACnB,CAAC;QACD,aAAa;aACR,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC;YAC5C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;YACpF,IAAI,CAAC,UAAU,EAAE,CAAC;QACnB,CAAC;QACD,QAAQ;aACH,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC,EAAE,CAAC;YAC/C,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC/D,IAAI,gBAAgB,EAAE,CAAC;gBACtB,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;YAC5C,CAAC;QACF,CAAC;QACD,mBAAmB;aACd,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACzB,CAAC;IACF,CAAC;CACD","sourcesContent":["import type { OAuthProviderInterface } from \"@gsd/pi-ai\";\nimport { getOAuthProviders } from \"@gsd/pi-ai/oauth\";\nimport { Container, getEditorKeybindings, Spacer, TruncatedText } from \"@gsd/pi-tui\";\nimport type { AuthStorage } from \"../../../core/auth-storage.js\";\nimport { theme } from \"../theme/theme.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\n\n/**\n * Component that renders an OAuth provider selector\n */\nexport class OAuthSelectorComponent extends Container {\n\tprivate listContainer: Container;\n\tprivate allProviders: OAuthProviderInterface[] = [];\n\tprivate selectedIndex: number = 0;\n\tprivate mode: \"login\" | \"logout\";\n\tprivate authStorage: AuthStorage;\n\tprivate onSelectCallback: (providerId: string) => void;\n\tprivate onCancelCallback: () => void;\n\n\tconstructor(\n\t\tmode: \"login\" | \"logout\",\n\t\tauthStorage: AuthStorage,\n\t\tonSelect: (providerId: string) => void,\n\t\tonCancel: () => void,\n\t) {\n\t\tsuper();\n\n\t\tthis.mode = mode;\n\t\tthis.authStorage = authStorage;\n\t\tthis.onSelectCallback = onSelect;\n\t\tthis.onCancelCallback = onCancel;\n\n\t\t// Load all OAuth providers\n\t\tthis.loadProviders();\n\n\t\t// Add top border\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add title\n\t\tconst title = mode === \"login\" ? \"Select provider to login:\" : \"Select provider to logout:\";\n\t\tthis.addChild(new TruncatedText(theme.bold(title)));\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Create list container\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add bottom border\n\t\tthis.addChild(new DynamicBorder());\n\n\t\t// Initial render\n\t\tthis.updateList();\n\t}\n\n\tprivate loadProviders(): void {\n\t\tthis.allProviders = getOAuthProviders();\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\n\t\tfor (let i = 0; i < this.allProviders.length; i++) {\n\t\t\tconst provider = this.allProviders[i];\n\t\t\tif (!provider) continue;\n\n\t\t\tconst isSelected = i === this.selectedIndex;\n\n\t\t\t// Check if user is logged in for this provider\n\t\t\tconst credentials = this.authStorage.get(provider.id);\n\t\t\tconst isLoggedIn = credentials?.type === \"oauth\";\n\t\t\tconst statusIndicator = isLoggedIn ? theme.fg(\"success\", \" ✓ logged in\") : \"\";\n\n\t\t\tlet line = \"\";\n\t\t\tif (isSelected) {\n\t\t\t\tconst prefix = theme.fg(\"accent\", \"→ \");\n\t\t\t\tconst text = theme.fg(\"accent\", provider.name);\n\t\t\t\tline = prefix + text + statusIndicator;\n\t\t\t} else {\n\t\t\t\tconst text = ` ${provider.name}`;\n\t\t\t\tline = text + statusIndicator;\n\t\t\t}\n\n\t\t\tthis.listContainer.addChild(new TruncatedText(line, 0, 0));\n\t\t}\n\n\t\t// Show \"no providers\" if empty\n\t\tif (this.allProviders.length === 0) {\n\t\t\tconst message =\n\t\t\t\tthis.mode === \"login\" ? \"No OAuth providers available\" : \"No OAuth providers logged in. Use /login first.\";\n\t\t\tthis.listContainer.addChild(new TruncatedText(theme.fg(\"muted\", ` ${message}`), 0, 0));\n\t\t}\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getEditorKeybindings();\n\t\t// Up arrow\n\t\tif (kb.matches(keyData, \"selectUp\")) {\n\t\t\tthis.selectedIndex = Math.max(0, this.selectedIndex - 1);\n\t\t\tthis.updateList();\n\t\t}\n\t\t// Down arrow\n\t\telse if (kb.matches(keyData, \"selectDown\")) {\n\t\t\tthis.selectedIndex = Math.min(this.allProviders.length - 1, this.selectedIndex + 1);\n\t\t\tthis.updateList();\n\t\t}\n\t\t// Enter\n\t\telse if (kb.matches(keyData, \"selectConfirm\")) {\n\t\t\tconst selectedProvider = this.allProviders[this.selectedIndex];\n\t\t\tif (selectedProvider) {\n\t\t\t\tthis.onSelectCallback(selectedProvider.id);\n\t\t\t}\n\t\t}\n\t\t// Escape or Ctrl+C\n\t\telse if (kb.matches(keyData, \"selectCancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,49 @@
1
+ import type { Model } from "@gsd/pi-ai";
2
+ import { Container, type Focusable, Input } from "@gsd/pi-tui";
3
+ export interface ModelsConfig {
4
+ allModels: Model<any>[];
5
+ enabledModelIds: Set<string>;
6
+ /** true if enabledModels setting is defined (empty = all enabled) */
7
+ hasEnabledModelsFilter: boolean;
8
+ }
9
+ export interface ModelsCallbacks {
10
+ /** Called when a model is toggled (session-only, no persist) */
11
+ onModelToggle: (modelId: string, enabled: boolean) => void;
12
+ /** Called when user wants to persist current selection to settings */
13
+ onPersist: (enabledModelIds: string[]) => void;
14
+ /** Called when user enables all models. Returns list of all model IDs. */
15
+ onEnableAll: (allModelIds: string[]) => void;
16
+ /** Called when user clears all models */
17
+ onClearAll: () => void;
18
+ /** Called when user toggles all models for a provider. Returns affected model IDs. */
19
+ onToggleProvider: (provider: string, modelIds: string[], enabled: boolean) => void;
20
+ onCancel: () => void;
21
+ }
22
+ /**
23
+ * Component for enabling/disabling models for Ctrl+P cycling.
24
+ * Changes are session-only until explicitly persisted with Ctrl+S.
25
+ */
26
+ export declare class ScopedModelsSelectorComponent extends Container implements Focusable {
27
+ private modelsById;
28
+ private allIds;
29
+ private enabledIds;
30
+ private filteredItems;
31
+ private selectedIndex;
32
+ private searchInput;
33
+ private _focused;
34
+ get focused(): boolean;
35
+ set focused(value: boolean);
36
+ private listContainer;
37
+ private footerText;
38
+ private callbacks;
39
+ private maxVisible;
40
+ private isDirty;
41
+ constructor(config: ModelsConfig, callbacks: ModelsCallbacks);
42
+ private buildItems;
43
+ private getFooterText;
44
+ private refresh;
45
+ private updateList;
46
+ handleInput(data: string): void;
47
+ getSearchInput(): Input;
48
+ }
49
+ //# sourceMappingURL=scoped-models-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoped-models-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/scoped-models-selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EACN,SAAS,EACT,K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