@draht/coding-agent 2026.11.5 → 2026.11.14-1

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 (328) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/bundle/chunks/anthropic-messages-C5ZJVCKX.js +6 -0
  3. package/dist/bundle/chunks/{azure-openai-responses-5YLWRJ4E.js → azure-openai-responses-TNRID5YC.js} +1 -1
  4. package/dist/bundle/chunks/bedrock-converse-stream.js +22 -22
  5. package/dist/bundle/chunks/chunk-2CHTECAU.js +2 -0
  6. package/dist/bundle/chunks/{chunk-MKVW4KK2.js → chunk-2IQVBLH6.js} +1 -1
  7. package/dist/bundle/chunks/chunk-2JZLKNZ4.js +3 -0
  8. package/dist/bundle/chunks/{chunk-LJ3SEGWI.js → chunk-4FPBO5KP.js} +6 -2
  9. package/dist/bundle/chunks/{chunk-3LFBXSCO.js → chunk-5C4MAPF6.js} +1 -1
  10. package/dist/bundle/chunks/chunk-5WEOWREV.js +82 -0
  11. package/dist/bundle/chunks/chunk-6M3D4XVD.js +2 -0
  12. package/dist/bundle/chunks/{chunk-KVH4HR57.js → chunk-6WESOD4H.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-UQSONZLL.js → chunk-ATYP3OSV.js} +3 -1
  14. package/dist/bundle/chunks/chunk-B6S2UR4T.js +2 -0
  15. package/dist/bundle/chunks/chunk-EBTEI43G.js +20 -0
  16. package/dist/bundle/chunks/{chunk-EXZUXBS5.js → chunk-GAABJAG4.js} +13 -16
  17. package/dist/bundle/chunks/chunk-GBFVS2SF.js +12 -0
  18. package/dist/bundle/chunks/{chunk-ITP6IDBA.js → chunk-GQXRTK54.js} +2 -2
  19. package/dist/bundle/chunks/{chunk-YUBUKEPQ.js → chunk-JHKMYVPC.js} +187 -148
  20. package/dist/bundle/chunks/{chunk-QVGSXIKT.js → chunk-KFREX3FS.js} +1 -1
  21. package/dist/bundle/chunks/{chunk-PRT3JHOZ.js → chunk-LCTFXH4P.js} +1 -1
  22. package/dist/bundle/chunks/chunk-LO6CVU2L.js +6 -0
  23. package/dist/bundle/chunks/{chunk-ABW2JATG.js → chunk-MPJIXESS.js} +1 -1
  24. package/dist/bundle/chunks/{chunk-PZKD35UB.js → chunk-MXA4WY3C.js} +1 -1
  25. package/dist/bundle/chunks/chunk-O2XYFH2E.js +30 -0
  26. package/dist/bundle/chunks/{chunk-CLNF6E5P.js → chunk-OUXJRC2W.js} +1 -1
  27. package/dist/bundle/chunks/{chunk-SKQFE2GA.js → chunk-RI7HJ6AF.js} +10 -10
  28. package/dist/bundle/chunks/chunk-RVXTPNXQ.js +44 -0
  29. package/dist/bundle/chunks/{chunk-SPVE2GM7.js → chunk-SXHVGWCU.js} +1 -1
  30. package/dist/bundle/chunks/chunk-WNZ64GW3.js +2 -0
  31. package/dist/bundle/chunks/chunk-XWZLYE4L.js +9 -0
  32. package/dist/bundle/chunks/{chunk-JAT7HEFU.js → chunk-YSE3VKKB.js} +2 -2
  33. package/dist/bundle/chunks/{cli-7AMCJ2UG.js → cli-2QKCAPPD.js} +3 -3
  34. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-QBCV2OWJ.js → cloudflare-workers-ai-system-one-UCG6T3XP.js} +1 -1
  35. package/dist/bundle/chunks/codemode-worker.js +2 -0
  36. package/dist/bundle/chunks/{execute-VOIPQMCI.js → execute-KGJOWTPG.js} +2 -2
  37. package/dist/bundle/chunks/github-copilot.js +1 -1
  38. package/dist/bundle/chunks/google-generative-ai-GPBKPOXA.js +2 -0
  39. package/dist/bundle/chunks/google-vertex-USZY53NF.js +2 -0
  40. package/dist/bundle/chunks/https-proxy-agent-WQIRL24U.js +13 -0
  41. package/dist/bundle/chunks/lib-ULKZYRGD.js +9 -0
  42. package/dist/bundle/chunks/{llama-cpp-classify-WGVYEPG2.js → llama-cpp-classify-7DEQ4ZUF.js} +1 -1
  43. package/dist/bundle/chunks/{mistral-conversations-PV6RDK65.js → mistral-conversations-UOGXPDZ3.js} +1 -1
  44. package/dist/bundle/chunks/{multipart-parser-AZP5BX2W.js → multipart-parser-HMCXZ4BD.js} +1 -1
  45. package/dist/bundle/chunks/{node-BZAVEWJ3.js → node-DXZFQBEO.js} +1 -1
  46. package/dist/bundle/chunks/{node-C2JGH2OB.js → node-LBZLUIBE.js} +1 -1
  47. package/dist/bundle/chunks/{openai-codex-responses-SEOL3EDF.js → openai-codex-responses-VUDXQ3EU.js} +1 -1
  48. package/dist/bundle/chunks/{openai-completions-U32QPS37.js → openai-completions-UQOOS7NM.js} +3 -3
  49. package/dist/bundle/chunks/{openai-decisions-ULSYFV2A.js → openai-decisions-24WNXO2R.js} +1 -1
  50. package/dist/bundle/chunks/{openai-responses-5MYZJYPK.js → openai-responses-5AF6MZ5L.js} +1 -1
  51. package/dist/bundle/chunks/{openrouter-images-SGOP5SDW.js → openrouter-images-OUXVVTYQ.js} +1 -1
  52. package/dist/bundle/chunks/{pi-messages-QALFE2BD.js → pi-messages-DRMOEO6B.js} +1 -1
  53. package/dist/bundle/chunks/{runtime-Z74VFUDD.js → runtime-FZKS2BWI.js} +1 -1
  54. package/dist/bundle/chunks/{runtime-GDH3ZURV.js → runtime-L23MZBKL.js} +1 -1
  55. package/dist/bundle/chunks/{settings-manager-T6UJFO2F.js → settings-manager-CWRQW6PZ.js} +1 -1
  56. package/dist/bundle/chunks/src-KDGO7EGF.js +4 -0
  57. package/dist/bundle/chunks/{typesafe-system-one-GTGS5MG6.js → typesafe-system-one-K63EBJDD.js} +1 -1
  58. package/dist/bundle/chunks/virtual-modules-JZV35VDE.js +2 -0
  59. package/dist/bundle/cli-runtime.js +1 -1
  60. package/dist/bundle/index.js +1 -1
  61. package/dist/bundle/rpc-entry.js +1 -1
  62. package/dist/cli/args.d.ts.map +1 -1
  63. package/dist/cli/args.js +5 -3
  64. package/dist/cli/args.js.map +1 -1
  65. package/dist/cli/auth-command.d.ts.map +1 -1
  66. package/dist/cli/auth-command.js +30 -6
  67. package/dist/cli/auth-command.js.map +1 -1
  68. package/dist/cli/auth-login.d.ts +15 -0
  69. package/dist/cli/auth-login.d.ts.map +1 -0
  70. package/dist/cli/auth-login.js +232 -0
  71. package/dist/cli/auth-login.js.map +1 -0
  72. package/dist/cli/auth-logout.d.ts +14 -0
  73. package/dist/cli/auth-logout.d.ts.map +1 -0
  74. package/dist/cli/auth-logout.js +57 -0
  75. package/dist/cli/auth-logout.js.map +1 -0
  76. package/dist/cli/auth-terminal.d.ts +17 -0
  77. package/dist/cli/auth-terminal.d.ts.map +1 -0
  78. package/dist/cli/auth-terminal.js +63 -0
  79. package/dist/cli/auth-terminal.js.map +1 -0
  80. package/dist/core/agent-session-runtime.d.ts +5 -0
  81. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  82. package/dist/core/agent-session-runtime.js +16 -2
  83. package/dist/core/agent-session-runtime.js.map +1 -1
  84. package/dist/core/agent-session.d.ts +20 -9
  85. package/dist/core/agent-session.d.ts.map +1 -1
  86. package/dist/core/agent-session.js +71 -29
  87. package/dist/core/agent-session.js.map +1 -1
  88. package/dist/core/ai-schemas.d.ts +1 -0
  89. package/dist/core/ai-schemas.d.ts.map +1 -1
  90. package/dist/core/builtins/budgets.d.ts.map +1 -1
  91. package/dist/core/builtins/budgets.js +6 -3
  92. package/dist/core/builtins/budgets.js.map +1 -1
  93. package/dist/core/cache-warmer.d.ts +4 -37
  94. package/dist/core/cache-warmer.d.ts.map +1 -1
  95. package/dist/core/cache-warmer.js +11 -91
  96. package/dist/core/cache-warmer.js.map +1 -1
  97. package/dist/core/compaction/utils.d.ts.map +1 -1
  98. package/dist/core/compaction/utils.js +2 -1
  99. package/dist/core/compaction/utils.js.map +1 -1
  100. package/dist/core/exec.d.ts +1 -0
  101. package/dist/core/exec.d.ts.map +1 -1
  102. package/dist/core/exec.js +4 -1
  103. package/dist/core/exec.js.map +1 -1
  104. package/dist/core/export-html/ansi-to-html.d.ts +5 -0
  105. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  106. package/dist/core/export-html/ansi-to-html.js +57 -20
  107. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  108. package/dist/core/export-html/template.js +1 -1
  109. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  110. package/dist/core/export-html/tool-renderer.js +2 -3
  111. package/dist/core/export-html/tool-renderer.js.map +1 -1
  112. package/dist/core/extensions/types.d.ts +3 -2
  113. package/dist/core/extensions/types.d.ts.map +1 -1
  114. package/dist/core/extensions/types.js.map +1 -1
  115. package/dist/core/model-config.d.ts +13 -0
  116. package/dist/core/model-config.d.ts.map +1 -1
  117. package/dist/core/model-resolver.d.ts +0 -1
  118. package/dist/core/model-resolver.d.ts.map +1 -1
  119. package/dist/core/model-resolver.js +17 -24
  120. package/dist/core/model-resolver.js.map +1 -1
  121. package/dist/core/model-runtime.d.ts +5 -0
  122. package/dist/core/model-runtime.d.ts.map +1 -1
  123. package/dist/core/model-runtime.js +7 -0
  124. package/dist/core/model-runtime.js.map +1 -1
  125. package/dist/core/polyphase/render/format.d.ts +2 -0
  126. package/dist/core/polyphase/render/format.d.ts.map +1 -1
  127. package/dist/core/polyphase/render/format.js +6 -0
  128. package/dist/core/polyphase/render/format.js.map +1 -1
  129. package/dist/core/polyphase/render/run-block.d.ts +4 -0
  130. package/dist/core/polyphase/render/run-block.d.ts.map +1 -1
  131. package/dist/core/polyphase/render/run-block.js +71 -12
  132. package/dist/core/polyphase/render/run-block.js.map +1 -1
  133. package/dist/core/polyphase/render/snapshot.d.ts +1 -1
  134. package/dist/core/polyphase/render/snapshot.d.ts.map +1 -1
  135. package/dist/core/polyphase/render/snapshot.js +22 -7
  136. package/dist/core/polyphase/render/snapshot.js.map +1 -1
  137. package/dist/core/polyphase/ui/dock.d.ts.map +1 -1
  138. package/dist/core/polyphase/ui/dock.js +34 -2
  139. package/dist/core/polyphase/ui/dock.js.map +1 -1
  140. package/dist/core/polyphase/ui/inspector.d.ts +18 -6
  141. package/dist/core/polyphase/ui/inspector.d.ts.map +1 -1
  142. package/dist/core/polyphase/ui/inspector.js +125 -44
  143. package/dist/core/polyphase/ui/inspector.js.map +1 -1
  144. package/dist/core/polyphase/ui/transcript-layout.d.ts.map +1 -1
  145. package/dist/core/polyphase/ui/transcript-layout.js +5 -1
  146. package/dist/core/polyphase/ui/transcript-layout.js.map +1 -1
  147. package/dist/core/preferred-providers.d.ts +17 -0
  148. package/dist/core/preferred-providers.d.ts.map +1 -0
  149. package/dist/core/preferred-providers.js +24 -0
  150. package/dist/core/preferred-providers.js.map +1 -0
  151. package/dist/core/prompt-templates.d.ts.map +1 -1
  152. package/dist/core/prompt-templates.js +18 -2
  153. package/dist/core/prompt-templates.js.map +1 -1
  154. package/dist/core/provider-composer.d.ts.map +1 -1
  155. package/dist/core/provider-composer.js +2 -0
  156. package/dist/core/provider-composer.js.map +1 -1
  157. package/dist/core/provider-matching.d.ts +6 -0
  158. package/dist/core/provider-matching.d.ts.map +1 -0
  159. package/dist/core/provider-matching.js +8 -0
  160. package/dist/core/provider-matching.js.map +1 -0
  161. package/dist/core/radius-mcp.d.ts +13 -0
  162. package/dist/core/radius-mcp.d.ts.map +1 -0
  163. package/dist/core/radius-mcp.js +29 -0
  164. package/dist/core/radius-mcp.js.map +1 -0
  165. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  166. package/dist/core/remote-catalog-provider.js +2 -0
  167. package/dist/core/remote-catalog-provider.js.map +1 -1
  168. package/dist/core/runtime-credentials.d.ts +8 -0
  169. package/dist/core/runtime-credentials.d.ts.map +1 -1
  170. package/dist/core/runtime-credentials.js +15 -1
  171. package/dist/core/runtime-credentials.js.map +1 -1
  172. package/dist/core/session-cwd.d.ts +7 -0
  173. package/dist/core/session-cwd.d.ts.map +1 -1
  174. package/dist/core/session-cwd.js +9 -1
  175. package/dist/core/session-cwd.js.map +1 -1
  176. package/dist/core/session-manager.d.ts.map +1 -1
  177. package/dist/core/session-manager.js +45 -36
  178. package/dist/core/session-manager.js.map +1 -1
  179. package/dist/core/settings-defaults.d.ts +1 -1
  180. package/dist/core/settings-defaults.d.ts.map +1 -1
  181. package/dist/core/settings-defaults.js +1 -1
  182. package/dist/core/settings-defaults.js.map +1 -1
  183. package/dist/core/tools/bash.d.ts.map +1 -1
  184. package/dist/core/tools/bash.js +35 -5
  185. package/dist/core/tools/bash.js.map +1 -1
  186. package/dist/core/tools/edit-diff.d.ts +23 -14
  187. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  188. package/dist/core/tools/edit-diff.js +182 -41
  189. package/dist/core/tools/edit-diff.js.map +1 -1
  190. package/dist/core/tools/edit.d.ts.map +1 -1
  191. package/dist/core/tools/edit.js +8 -7
  192. package/dist/core/tools/edit.js.map +1 -1
  193. package/dist/core/tools/find.d.ts.map +1 -1
  194. package/dist/core/tools/find.js +57 -16
  195. package/dist/core/tools/find.js.map +1 -1
  196. package/dist/core/tools/grep.d.ts +4 -0
  197. package/dist/core/tools/grep.d.ts.map +1 -1
  198. package/dist/core/tools/grep.js +20 -8
  199. package/dist/core/tools/grep.js.map +1 -1
  200. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  201. package/dist/core/tools/output-accumulator.js +4 -1
  202. package/dist/core/tools/output-accumulator.js.map +1 -1
  203. package/dist/core/tools/powershell.d.ts.map +1 -1
  204. package/dist/core/tools/powershell.js +15 -2
  205. package/dist/core/tools/powershell.js.map +1 -1
  206. package/dist/core/tools/read.d.ts +13 -0
  207. package/dist/core/tools/read.d.ts.map +1 -1
  208. package/dist/core/tools/read.js +146 -35
  209. package/dist/core/tools/read.js.map +1 -1
  210. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  211. package/dist/core/tools/renderers/read.js +6 -2
  212. package/dist/core/tools/renderers/read.js.map +1 -1
  213. package/dist/core/tools/truncate.d.ts +4 -0
  214. package/dist/core/tools/truncate.d.ts.map +1 -1
  215. package/dist/core/tools/truncate.js +24 -1
  216. package/dist/core/tools/truncate.js.map +1 -1
  217. package/dist/extensions/codemode/execute.js +4 -4
  218. package/dist/extensions/codemode/execute.js.map +1 -1
  219. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  220. package/dist/extensions/codemode/tool.js +34 -12
  221. package/dist/extensions/codemode/tool.js.map +1 -1
  222. package/dist/extensions/llama/provider.d.ts +1 -1
  223. package/dist/extensions/llama/provider.js +1 -1
  224. package/dist/extensions/llama/provider.js.map +1 -1
  225. package/dist/extensions/llama/ui.d.ts.map +1 -1
  226. package/dist/extensions/llama/ui.js +15 -3
  227. package/dist/extensions/llama/ui.js.map +1 -1
  228. package/dist/extensions/mcp/cli.js +5 -8
  229. package/dist/extensions/mcp/cli.js.map +1 -1
  230. package/dist/extensions/mcp/index.d.ts.map +1 -1
  231. package/dist/extensions/mcp/index.js +2 -1
  232. package/dist/extensions/mcp/index.js.map +1 -1
  233. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  234. package/dist/extensions/mcp/runtime.js +3 -2
  235. package/dist/extensions/mcp/runtime.js.map +1 -1
  236. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  237. package/dist/extensions/tool-search/tool.js +18 -6
  238. package/dist/extensions/tool-search/tool.js.map +1 -1
  239. package/dist/main.d.ts.map +1 -1
  240. package/dist/main.js +67 -15
  241. package/dist/main.js.map +1 -1
  242. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  243. package/dist/modes/interactive/components/login-dialog.js +2 -19
  244. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  245. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  246. package/dist/modes/interactive/components/model-selector.js +14 -6
  247. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  248. package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
  249. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  250. package/dist/modes/interactive/components/oauth-selector.js +32 -5
  251. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  252. package/dist/modes/interactive/components/provider-brand.d.ts +14 -0
  253. package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
  254. package/dist/modes/interactive/components/provider-brand.js +66 -0
  255. package/dist/modes/interactive/components/provider-brand.js.map +1 -0
  256. package/dist/modes/interactive/components/radius-login-selector.d.ts +1 -2
  257. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
  258. package/dist/modes/interactive/components/radius-login-selector.js +6 -37
  259. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
  260. package/dist/modes/interactive/components/session-selector.d.ts +6 -1
  261. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  262. package/dist/modes/interactive/components/session-selector.js +23 -5
  263. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  264. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  265. package/dist/modes/interactive/components/tool-execution.js +3 -1
  266. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  267. package/dist/modes/interactive/interactive-mode.d.ts +11 -1
  268. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  269. package/dist/modes/interactive/interactive-mode.js +133 -78
  270. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  271. package/dist/modes/interactive/session-share.js +2 -0
  272. package/dist/modes/interactive/session-share.js.map +1 -1
  273. package/dist/package-manager-cli.d.ts.map +1 -1
  274. package/dist/package-manager-cli.js +27 -4
  275. package/dist/package-manager-cli.js.map +1 -1
  276. package/dist/prompts/commands/test-audit.md +84 -0
  277. package/dist/utils/image-resize.d.ts.map +1 -1
  278. package/dist/utils/image-resize.js +3 -1
  279. package/dist/utils/image-resize.js.map +1 -1
  280. package/dist/utils/terminal-question.d.ts +8 -0
  281. package/dist/utils/terminal-question.d.ts.map +1 -0
  282. package/dist/utils/terminal-question.js +24 -0
  283. package/dist/utils/terminal-question.js.map +1 -0
  284. package/dist/utils/web-url.d.ts +12 -0
  285. package/dist/utils/web-url.d.ts.map +1 -0
  286. package/dist/utils/web-url.js +20 -0
  287. package/dist/utils/web-url.js.map +1 -0
  288. package/docs/cli.md +14 -1
  289. package/docs/extensions.md +6 -4
  290. package/docs/llama-cpp.md +5 -5
  291. package/docs/models-configuration.md +2 -1
  292. package/docs/nvidia-rtx-llama-cpp.md +5 -5
  293. package/docs/polyphase.md +13 -1
  294. package/docs/prompt-templates.md +1 -1
  295. package/docs/providers.md +4 -2
  296. package/docs/quickstart.md +1 -1
  297. package/docs/rpc-commands.md +1 -1
  298. package/docs/rpc.md +1 -1
  299. package/docs/sessions.md +7 -1
  300. package/docs/settings.md +1 -1
  301. package/docs/tui.md +1 -1
  302. package/examples/extensions/gondolin/index.ts +4 -7
  303. package/examples/extensions/subagent/index.ts +5 -1
  304. package/package.json +10 -10
  305. package/prompts/commands/test-audit.md +84 -0
  306. package/schemas/models.schema.json +5 -1
  307. package/schemas/settings.schema.json +1 -1
  308. package/dist/bundle/chunks/anthropic-messages-TXQXPH4S.js +0 -6
  309. package/dist/bundle/chunks/chunk-6MSE6LZ3.js +0 -6
  310. package/dist/bundle/chunks/chunk-736QBNUZ.js +0 -12
  311. package/dist/bundle/chunks/chunk-AOCWORXE.js +0 -2
  312. package/dist/bundle/chunks/chunk-BIBUE2PO.js +0 -2
  313. package/dist/bundle/chunks/chunk-DQ4G4IS4.js +0 -20
  314. package/dist/bundle/chunks/chunk-J7QTCDIN.js +0 -2
  315. package/dist/bundle/chunks/chunk-NNYZSIKR.js +0 -9
  316. package/dist/bundle/chunks/chunk-SUVMF4W5.js +0 -2
  317. package/dist/bundle/chunks/chunk-THDNEOXP.js +0 -44
  318. package/dist/bundle/chunks/chunk-TIA2T6EO.js +0 -3
  319. package/dist/bundle/chunks/chunk-TK3LS5QZ.js +0 -82
  320. package/dist/bundle/chunks/chunk-TYAEYYRA.js +0 -30
  321. package/dist/bundle/chunks/google-generative-ai-NC5KHHW3.js +0 -2
  322. package/dist/bundle/chunks/google-vertex-GAPUJEF7.js +0 -2
  323. package/dist/bundle/chunks/https-proxy-agent-O2PVUIOI.js +0 -13
  324. package/dist/bundle/chunks/lib-XOG5PI3Y.js +0 -9
  325. package/dist/bundle/chunks/src-TIBHS42X.js +0 -4
  326. package/dist/bundle/chunks/virtual-modules-ZUI2T3XR.js +0 -2
  327. /package/dist/bundle/chunks/{chunk-PX3CDFUB.js → chunk-ITKDPD4D.js} +0 -0
  328. /package/dist/bundle/chunks/{chunk-ZZD35WKM.js → chunk-MOOADNVS.js} +0 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Animated brand styles for the names of preferred partner providers in selectors: Radius shimmers in its logo
3
+ * colors and OpenRouter glows in its brand color. Selectors apply them to the selected row only.
4
+ */
5
+ import { foregroundAnsi, mixColors, parseColor } from "@draht/tui";
6
+ import { RADIUS_PROVIDER_ID } from "../../../core/radius.js";
7
+ import { theme } from "../theme/theme.js";
8
+ /** The animated style of a provider's name, or `undefined` when the provider has none. */
9
+ export function getProviderBrandStyle(providerId) {
10
+ if (providerId === RADIUS_PROVIDER_ID)
11
+ return radiusShimmer;
12
+ if (providerId === "openrouter")
13
+ return openRouterGlow;
14
+ return undefined;
15
+ }
16
+ /** The four colors of the Radius logo, in the order they stream across the text. */
17
+ const RADIUS_COLORS = ["#4d9abf", "#83ccd2", "#f1be57", "#f09082"].map((hex) => parseColor(hex));
18
+ /** Width of each color band, in characters. */
19
+ const CHARS_PER_COLOR = 4;
20
+ const CHARS_PER_SECOND = 10;
21
+ /** Colors `text` with the Radius logo colors flowing left to right. */
22
+ export function radiusShimmer(text, elapsedMs) {
23
+ const mode = theme.getColorMode();
24
+ const cycle = RADIUS_COLORS.length * CHARS_PER_COLOR;
25
+ const offset = (elapsedMs / 1000) * CHARS_PER_SECOND;
26
+ let result = "";
27
+ let index = 0;
28
+ for (const char of text) {
29
+ const position = (((index - offset) % cycle) + cycle) % cycle;
30
+ const band = Math.floor(position / CHARS_PER_COLOR);
31
+ const t = position / CHARS_PER_COLOR - band;
32
+ // Smoothstep keeps each band recognizable while still blending into the next one.
33
+ const amount = t * t * (3 - 2 * t);
34
+ const from = RADIUS_COLORS[band];
35
+ const to = RADIUS_COLORS[(band + 1) % RADIUS_COLORS.length];
36
+ result += foregroundAnsi(mixColors(from, to, amount, "srgb"), mode) + char;
37
+ index++;
38
+ }
39
+ return `${result}\x1b[39m`;
40
+ }
41
+ /**
42
+ * OpenRouter's brand colors per theme appearance: lime on dark backgrounds, violet on light ones, where lime would
43
+ * be unreadable. The glow breathes between `base` and the brighter `peak`.
44
+ */
45
+ const OPENROUTER_GLOW = {
46
+ dark: { base: parseColor("#c6f243"), peak: parseColor("#efffb0") },
47
+ light: { base: parseColor("#5d32e1"), peak: parseColor("#8f6bff") },
48
+ };
49
+ const GLOW_PERIOD_MS = 2400;
50
+ /** Colors `text` in OpenRouter's brand color, slowly brightening and dimming. */
51
+ function openRouterGlow(text, elapsedMs) {
52
+ const { base, peak } = OPENROUTER_GLOW[theme.appearance];
53
+ const amount = (1 - Math.cos((2 * Math.PI * elapsedMs) / GLOW_PERIOD_MS)) / 2;
54
+ return `${foregroundAnsi(mixColors(base, peak, amount, "oklch"), theme.getColorMode())}${text}\x1b[39m`;
55
+ }
56
+ const ANIMATION_FRAME_MS = 50;
57
+ /** Re-renders `tui` every animation frame while `isAnimating()` holds; returns the function that stops it. */
58
+ export function startBrandAnimation(tui, isAnimating) {
59
+ const timer = setInterval(() => {
60
+ if (isAnimating())
61
+ tui.requestRender();
62
+ }, ANIMATION_FRAME_MS);
63
+ timer.unref?.();
64
+ return () => clearInterval(timer);
65
+ }
66
+ //# sourceMappingURL=provider-brand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-brand.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/provider-brand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,cAAc,EAAE,SAAS,EAAE,UAAU,EAAY,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK1C,0FAA0F;AAC1F,MAAM,UAAU,qBAAqB,CAAC,U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,EAAE;QAC9B,IAAI,WAAW,EAAE;YAAE,GAAG,CAAC,aAAa,EAAE,CAAC;IACxC,CAAC,EAAE,kBAAkB,CAAC,CAAC;IACvB,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;IAChB,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/**\n * Animated brand styles for the names of preferred partner providers in selectors: Radius shimmers in its logo\n * colors and OpenRouter glows in its brand color. Selectors apply them to the selected row only.\n */\n\nimport { type Color, foregroundAnsi, mixColors, parseColor, type TUI } from \"@draht/tui\";\nimport { RADIUS_PROVIDER_ID } from \"../../../core/radius.ts\";\nimport { theme } from \"../theme/theme.ts\";\n\n/** Colors `text` for animation time `elapsedMs`. */\nexport type ProviderBrandStyle = (text: string, elapsedMs: number) => string;\n\n/** The animated style of a provider's name, or `undefined` when the provider has none. */\nexport function getProviderBrandStyle(providerId: string): ProviderBrandStyle | undefined {\n\tif (providerId === RADIUS_PROVIDER_ID) return radiusShimmer;\n\tif (providerId === \"openrouter\") return openRouterGlow;\n\treturn undefined;\n}\n\n/** The four colors of the Radius logo, in the order they stream across the text. */\nconst RADIUS_COLORS: readonly Color[] = [\"#4d9abf\", \"#83ccd2\", \"#f1be57\", \"#f09082\"].map((hex) => parseColor(hex));\n/** Width of each color band, in characters. */\nconst CHARS_PER_COLOR = 4;\nconst CHARS_PER_SECOND = 10;\n\n/** Colors `text` with the Radius logo colors flowing left to right. */\nexport function radiusShimmer(text: string, elapsedMs: number): string {\n\tconst mode = theme.getColorMode();\n\tconst cycle = RADIUS_COLORS.length * CHARS_PER_COLOR;\n\tconst offset = (elapsedMs / 1000) * CHARS_PER_SECOND;\n\tlet result = \"\";\n\tlet index = 0;\n\tfor (const char of text) {\n\t\tconst position = (((index - offset) % cycle) + cycle) % cycle;\n\t\tconst band = Math.floor(position / CHARS_PER_COLOR);\n\t\tconst t = position / CHARS_PER_COLOR - band;\n\t\t// Smoothstep keeps each band recognizable while still blending into the next one.\n\t\tconst amount = t * t * (3 - 2 * t);\n\t\tconst from = RADIUS_COLORS[band] as Color;\n\t\tconst to = RADIUS_COLORS[(band + 1) % RADIUS_COLORS.length] as Color;\n\t\tresult += foregroundAnsi(mixColors(from, to, amount, \"srgb\"), mode) + char;\n\t\tindex++;\n\t}\n\treturn `${result}\\x1b[39m`;\n}\n\n/**\n * OpenRouter's brand colors per theme appearance: lime on dark backgrounds, violet on light ones, where lime would\n * be unreadable. The glow breathes between `base` and the brighter `peak`.\n */\nconst OPENROUTER_GLOW = {\n\tdark: { base: parseColor(\"#c6f243\"), peak: parseColor(\"#efffb0\") },\n\tlight: { base: parseColor(\"#5d32e1\"), peak: parseColor(\"#8f6bff\") },\n} as const;\nconst GLOW_PERIOD_MS = 2400;\n\n/** Colors `text` in OpenRouter's brand color, slowly brightening and dimming. */\nfunction openRouterGlow(text: string, elapsedMs: number): string {\n\tconst { base, peak } = OPENROUTER_GLOW[theme.appearance];\n\tconst amount = (1 - Math.cos((2 * Math.PI * elapsedMs) / GLOW_PERIOD_MS)) / 2;\n\treturn `${foregroundAnsi(mixColors(base, peak, amount, \"oklch\"), theme.getColorMode())}${text}\\x1b[39m`;\n}\n\nconst ANIMATION_FRAME_MS = 50;\n\n/** Re-renders `tui` every animation frame while `isAnimating()` holds; returns the function that stops it. */\nexport function startBrandAnimation(tui: TUI, isAnimating: () => boolean): () => void {\n\tconst timer = setInterval(() => {\n\t\tif (isAnimating()) tui.requestRender();\n\t}, ANIMATION_FRAME_MS);\n\ttimer.unref?.();\n\treturn () => clearInterval(timer);\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  /**
2
- * The `/login` menu with the animated "Sign in with Radius" option. Internal to the interactive mode: the shimmer
3
- * is Radius-only and is not exposed to other selectors.
2
+ * The `/login` menu with the animated "Sign in with Radius" option. Internal to the interactive mode.
4
3
  */
5
4
  import { type TUI } from "@draht/tui";
6
5
  import { ExtensionSelectorComponent } from "./extension-selector.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"radius-login-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/radius-login-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAA2D,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAE/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AA8BrE,uGAAuG;AACvG,KAAK,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAiEpD,+GAA+G;AAC/G,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAClC,QAAQ,EAAE,MAAM,IAAI,GAClB,0BAA0B,CAE5B"}
1
+ {"version":3,"file":"radius-login-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/radius-login-selector.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAQ,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAGrE,uGAAuG;AACvG,KAAK,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AA6DpD,+GAA+G;AAC/G,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAClC,QAAQ,EAAE,MAAM,IAAI,GAClB,0BAA0B,CAE5B"}
@@ -1,36 +1,10 @@
1
1
  /**
2
- * The `/login` menu with the animated "Sign in with Radius" option. Internal to the interactive mode: the shimmer
3
- * is Radius-only and is not exposed to other selectors.
2
+ * The `/login` menu with the animated "Sign in with Radius" option. Internal to the interactive mode.
4
3
  */
5
- import { foregroundAnsi, mixColors, parseColor, Text } from "@draht/tui";
4
+ import { Text } from "@draht/tui";
6
5
  import { theme } from "../theme/theme.js";
7
6
  import { ExtensionSelectorComponent } from "./extension-selector.js";
8
- /** The four colors of the Radius logo, in the order they stream across the text. */
9
- const RADIUS_COLORS = ["#4d9abf", "#83ccd2", "#f1be57", "#f09082"].map((hex) => parseColor(hex));
10
- /** Width of each color band, in characters. */
11
- const CHARS_PER_COLOR = 4;
12
- const CHARS_PER_SECOND = 10;
13
- const ANIMATION_FRAME_MS = 50;
14
- /** Color `text` with the Radius logo colors flowing left to right; `elapsedMs` is the animation time. */
15
- function radiusShimmer(text, elapsedMs) {
16
- const mode = theme.getColorMode();
17
- const cycle = RADIUS_COLORS.length * CHARS_PER_COLOR;
18
- const offset = (elapsedMs / 1000) * CHARS_PER_SECOND;
19
- let result = "";
20
- let index = 0;
21
- for (const char of text) {
22
- const position = (((index - offset) % cycle) + cycle) % cycle;
23
- const band = Math.floor(position / CHARS_PER_COLOR);
24
- const t = position / CHARS_PER_COLOR - band;
25
- // Smoothstep keeps each band recognizable while still blending into the next one.
26
- const amount = t * t * (3 - 2 * t);
27
- const from = RADIUS_COLORS[band];
28
- const to = RADIUS_COLORS[(band + 1) % RADIUS_COLORS.length];
29
- result += foregroundAnsi(mixColors(from, to, amount, "srgb"), mode) + char;
30
- index++;
31
- }
32
- return `${result}\x1b[39m`;
33
- }
7
+ import { radiusShimmer, startBrandAnimation } from "./provider-brand.js";
34
8
  /**
35
9
  * Swaps the line `ExtensionSelectorComponent` draws for the selected Radius option with the animated one. When the
36
10
  * selector's row style changes or the label wraps, the line no longer matches and the option renders normally.
@@ -38,7 +12,7 @@ function radiusShimmer(text, elapsedMs) {
38
12
  class RadiusLoginMenuComponent extends ExtensionSelectorComponent {
39
13
  radiusOption;
40
14
  animationStart = performance.now();
41
- animationTimer;
15
+ stopAnimationTimer;
42
16
  animating = false;
43
17
  constructor(tui, title, options, radiusOption, onSelect, onCancel) {
44
18
  super(title, options, (option) => {
@@ -49,11 +23,7 @@ class RadiusLoginMenuComponent extends ExtensionSelectorComponent {
49
23
  onCancel();
50
24
  });
51
25
  this.radiusOption = radiusOption;
52
- this.animationTimer = setInterval(() => {
53
- if (this.animating)
54
- tui.requestRender();
55
- }, ANIMATION_FRAME_MS);
56
- this.animationTimer.unref?.();
26
+ this.stopAnimationTimer = startBrandAnimation(tui, () => this.animating);
57
27
  }
58
28
  render(width) {
59
29
  const lines = super.render(width);
@@ -69,8 +39,7 @@ class RadiusLoginMenuComponent extends ExtensionSelectorComponent {
69
39
  return lines;
70
40
  }
71
41
  stopAnimation() {
72
- clearInterval(this.animationTimer);
73
- this.animationTimer = undefined;
42
+ this.stopAnimationTimer();
74
43
  this.animating = false;
75
44
  }
76
45
  dispose() {
@@ -1 +1 @@
1
- {"version":3,"file":"radius-login-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/radius-login-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAY,MAAM,YAAY,CAAC;AAC/F,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,oFAAoF;AACpF,MAAM,aAAa,GAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACnH,+CAA+C;AAC/C,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,yGAAyG;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,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;YAC7E,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACnF,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACpE,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAEO,aAAa;QACpB,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACxB,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD;AAED,+GAA+G;AAC/G,MAAM,UAAU,uBAAuB,CACtC,GAAQ,EACR,KAAa,EACb,OAAiB,EACjB,YAA0B,EAC1B,QAAkC,EAClC,QAAoB;IAEpB,OAAO,IAAI,wBAAwB,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/**\n * The `/login` menu with the animated \"Sign in with Radius\" option. Internal to the interactive mode: the shimmer\n * is Radius-only and is not exposed to other selectors.\n */\n\nimport { type Color, foregroundAnsi, mixColors, parseColor, Text, type TUI } from \"@draht/tui\";\nimport { theme } from \"../theme/theme.ts\";\nimport { ExtensionSelectorComponent } from \"./extension-selector.ts\";\n\n/** The four colors of the Radius logo, in the order they stream across the text. */\nconst RADIUS_COLORS: readonly Color[] = [\"#4d9abf\", \"#83ccd2\", \"#f1be57\", \"#f09082\"].map((hex) => parseColor(hex));\n/** Width of each color band, in characters. */\nconst CHARS_PER_COLOR = 4;\nconst CHARS_PER_SECOND = 10;\nconst ANIMATION_FRAME_MS = 50;\n\n/** Color `text` with the Radius logo colors flowing left to right; `elapsedMs` is the animation time. */\nfunction radiusShimmer(text: string, elapsedMs: number): string {\n\tconst mode = theme.getColorMode();\n\tconst cycle = RADIUS_COLORS.length * CHARS_PER_COLOR;\n\tconst offset = (elapsedMs / 1000) * CHARS_PER_SECOND;\n\tlet result = \"\";\n\tlet index = 0;\n\tfor (const char of text) {\n\t\tconst position = (((index - offset) % cycle) + cycle) % cycle;\n\t\tconst band = Math.floor(position / CHARS_PER_COLOR);\n\t\tconst t = position / CHARS_PER_COLOR - band;\n\t\t// Smoothstep keeps each band recognizable while still blending into the next one.\n\t\tconst amount = t * t * (3 - 2 * t);\n\t\tconst from = RADIUS_COLORS[band] as Color;\n\t\tconst to = RADIUS_COLORS[(band + 1) % RADIUS_COLORS.length] as Color;\n\t\tresult += foregroundAnsi(mixColors(from, to, amount, \"srgb\"), mode) + char;\n\t\tindex++;\n\t}\n\treturn `${result}\\x1b[39m`;\n}\n\n/** The \"Sign in with Radius\" option: `label` is the full option, starting with the animated `text`. */\ntype RadiusOption = { label: string; text: string };\n\n/**\n * Swaps the line `ExtensionSelectorComponent` draws for the selected Radius option with the animated one. When the\n * selector's row style changes or the label wraps, the line no longer matches and the option renders normally.\n */\nclass RadiusLoginMenuComponent extends ExtensionSelectorComponent {\n\tprivate readonly radiusOption: RadiusOption;\n\tprivate readonly animationStart = performance.now();\n\tprivate animationTimer: ReturnType<typeof setInterval> | undefined;\n\tprivate animating = false;\n\n\tconstructor(\n\t\ttui: TUI,\n\t\ttitle: string,\n\t\toptions: string[],\n\t\tradiusOption: RadiusOption,\n\t\tonSelect: (option: string) => void,\n\t\tonCancel: () => void,\n\t) {\n\t\tsuper(\n\t\t\ttitle,\n\t\t\toptions,\n\t\t\t(option) => {\n\t\t\t\tthis.stopAnimation();\n\t\t\t\tonSelect(option);\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.stopAnimation();\n\t\t\t\tonCancel();\n\t\t\t},\n\t\t);\n\t\tthis.radiusOption = radiusOption;\n\t\tthis.animationTimer = setInterval(() => {\n\t\t\tif (this.animating) tui.requestRender();\n\t\t}, ANIMATION_FRAME_MS);\n\t\tthis.animationTimer.unref?.();\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst lines = super.render(width);\n\t\tconst { label, text } = this.radiusOption;\n\t\tconst selectedLine = new Text(theme.fg(\"accent\", \"→ \") + theme.fg(\"accent\", label), 1, 0).render(width)[0];\n\t\tconst index = selectedLine === undefined ? -1 : lines.indexOf(selectedLine);\n\t\tthis.animating = index >= 0;\n\t\tif (this.animating) {\n\t\t\tconst shimmer = radiusShimmer(text, performance.now() - this.animationStart);\n\t\t\tconst animatedLine = theme.fg(\"accent\", \"→ \") + shimmer + label.slice(text.length);\n\t\t\tlines[index] = new Text(animatedLine, 1, 0).render(width)[0] ?? \"\";\n\t\t}\n\t\treturn lines;\n\t}\n\n\tprivate stopAnimation(): void {\n\t\tclearInterval(this.animationTimer);\n\t\tthis.animationTimer = undefined;\n\t\tthis.animating = false;\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stopAnimation();\n\t\tsuper.dispose();\n\t}\n}\n\n/** Top-level `/login` selector whose Radius option shimmers in the Radius logo colors while it is selected. */\nexport function createLoginMenuSelector(\n\ttui: TUI,\n\ttitle: string,\n\toptions: string[],\n\tradiusOption: RadiusOption,\n\tonSelect: (option: string) => void,\n\tonCancel: () => void,\n): ExtensionSelectorComponent {\n\treturn new RadiusLoginMenuComponent(tui, title, options, radiusOption, onSelect, onCancel);\n}\n"]}
1
+ {"version":3,"file":"radius-login-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/radius-login-selector.ts"],"names":[],"m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with the animated \"Sign in with Radius\" option. Internal to the interactive mode.\n */\n\nimport { Text, type TUI } from \"@draht/tui\";\nimport { theme } from \"../theme/theme.ts\";\nimport { ExtensionSelectorComponent } from \"./extension-selector.ts\";\nimport { radiusShimmer, startBrandAnimation } from \"./provider-brand.ts\";\n\n/** The \"Sign in with Radius\" option: `label` is the full option, starting with the animated `text`. */\ntype RadiusOption = { label: string; text: string };\n\n/**\n * Swaps the line `ExtensionSelectorComponent` draws for the selected Radius option with the animated one. When the\n * selector's row style changes or the label wraps, the line no longer matches and the option renders normally.\n */\nclass RadiusLoginMenuComponent extends ExtensionSelectorComponent {\n\tprivate readonly radiusOption: RadiusOption;\n\tprivate readonly animationStart = performance.now();\n\tprivate readonly stopAnimationTimer: () => void;\n\tprivate animating = false;\n\n\tconstructor(\n\t\ttui: TUI,\n\t\ttitle: string,\n\t\toptions: string[],\n\t\tradiusOption: RadiusOption,\n\t\tonSelect: (option: string) => void,\n\t\tonCancel: () => void,\n\t) {\n\t\tsuper(\n\t\t\ttitle,\n\t\t\toptions,\n\t\t\t(option) => {\n\t\t\t\tthis.stopAnimation();\n\t\t\t\tonSelect(option);\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.stopAnimation();\n\t\t\t\tonCancel();\n\t\t\t},\n\t\t);\n\t\tthis.radiusOption = radiusOption;\n\t\tthis.stopAnimationTimer = startBrandAnimation(tui, () => this.animating);\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst lines = super.render(width);\n\t\tconst { label, text } = this.radiusOption;\n\t\tconst selectedLine = new Text(theme.fg(\"accent\", \"→ \") + theme.fg(\"accent\", label), 1, 0).render(width)[0];\n\t\tconst index = selectedLine === undefined ? -1 : lines.indexOf(selectedLine);\n\t\tthis.animating = index >= 0;\n\t\tif (this.animating) {\n\t\t\tconst shimmer = radiusShimmer(text, performance.now() - this.animationStart);\n\t\t\tconst animatedLine = theme.fg(\"accent\", \"→ \") + shimmer + label.slice(text.length);\n\t\t\tlines[index] = new Text(animatedLine, 1, 0).render(width)[0] ?? \"\";\n\t\t}\n\t\treturn lines;\n\t}\n\n\tprivate stopAnimation(): void {\n\t\tthis.stopAnimationTimer();\n\t\tthis.animating = false;\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stopAnimation();\n\t\tsuper.dispose();\n\t}\n}\n\n/** Top-level `/login` selector whose Radius option shimmers in the Radius logo colors while it is selected. */\nexport function createLoginMenuSelector(\n\ttui: TUI,\n\ttitle: string,\n\toptions: string[],\n\tradiusOption: RadiusOption,\n\tonSelect: (option: string) => void,\n\tonCancel: () => void,\n): ExtensionSelectorComponent {\n\treturn new RadiusLoginMenuComponent(tui, title, options, radiusOption, onSelect, onCancel);\n}\n"]}
@@ -11,6 +11,7 @@ declare class SessionList implements Component, Focusable {
11
11
  private filteredSessions;
12
12
  private selectedIndex;
13
13
  private selectionTouched;
14
+ private pendingSelectedPath?;
14
15
  private searchInput;
15
16
  private showCwd;
16
17
  private sortMode;
@@ -37,7 +38,11 @@ declare class SessionList implements Component, Focusable {
37
38
  constructor(sessions: SessionInfo[], showCwd: boolean, sortMode: SortMode, nameFilter: NameFilter, keybindings: KeybindingsManager, currentSessionFilePath?: string);
38
39
  setSortMode(sortMode: SortMode): void;
39
40
  setNameFilter(nameFilter: NameFilter): void;
40
- setSessions(sessions: SessionInfo[], showCwd: boolean): void;
41
+ /**
42
+ * @param partial true when more sessions are still loading; a selected session missing from a
43
+ * partial list stays the selection target until it arrives
44
+ */
45
+ setSessions(sessions: SessionInfo[], showCwd: boolean, partial?: boolean): void;
41
46
  private filterSessions;
42
47
  private setConfirmingDeletePath;
43
48
  private startDeleteConfirmationForSelectedSession;
@@ -1 +1 @@
1
- {"version":3,"file":"session-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-selector.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,SAAS,EACd,SAAS,EACT,KAAK,SAAS,EAOd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAA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CAAC,cAAc;IAQtB,OAAO,CAAC,gBAAgB;YAOV,4BAA4B;IAO1C,OAAO,CAAC,WAAW;IAWnB,cAAc,IAAI,WAAW,CAE5B;CACD"}
1
+ {"version":3,"file":"session-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-selector.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,SAAS,EACd,SAAS,EACT,KAAK,SAAS,EAOd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAMzF,OAAO,EAAyC,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAiQrH;;GAEG;AACH,cAAM,WAAY,YAAW,SAAS,EAAE,SAAS;IACzC,sBAAsB,IAAI,MAAM,GAAG,SAAS,CAGlD;IACD,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO,CAAC,mBAAmB,CAAC,CAAS;IACrC,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,qBAAqB,CAAC,CAAS;IAChC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAY;IAC9B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE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E,MAAM,IAAI,EACzB,OAAO,CAAC,EAAE;QACT,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QACxF,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,WAAW,CAAC,EAAE,kBAAkB,CAAC;KACjC,EACD,sBAAsB,CAAC,EAAE,MAAM,EAqG/B;IAED,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,eAAe;IAuBvB,OAAO,CAAC,cAAc;YASR,aAAa;YAwBb,SAAS;IAoEvB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,gBAAgB;YAOV,4BAA4B;IAO1C,OAAO,CAAC,WAAW;IAWnB,cAAc,IAAI,WAAW,CAE5B;CACD"}
@@ -232,6 +232,8 @@ class SessionList {
232
232
  filteredSessions = [];
233
233
  selectedIndex = 0;
234
234
  selectionTouched = false;
235
+ // Session to select once it appears, while a progressive reload has not yet delivered it
236
+ pendingSelectedPath;
235
237
  searchInput;
236
238
  showCwd = false;
237
239
  sortMode = "threaded";
@@ -289,8 +291,13 @@ class SessionList {
289
291
  this.nameFilter = nameFilter;
290
292
  this.filterSessions(this.searchInput.getValue());
291
293
  }
292
- setSessions(sessions, showCwd) {
293
- const selectedPath = this.selectionTouched ? this.getSelectedSessionPath() : undefined;
294
+ /**
295
+ * @param partial true when more sessions are still loading; a selected session missing from a
296
+ * partial list stays the selection target until it arrives
297
+ */
298
+ setSessions(sessions, showCwd, partial = false) {
299
+ const pendingPath = this.selectionTouched ? this.pendingSelectedPath : undefined;
300
+ const selectedPath = this.selectionTouched ? (pendingPath ?? this.getSelectedSessionPath()) : undefined;
294
301
  this.allSessions = sessions;
295
302
  this.showCwd = showCwd;
296
303
  this.filterSessions(this.searchInput.getValue());
@@ -299,8 +306,18 @@ class SessionList {
299
306
  }
300
307
  else if (selectedPath) {
301
308
  const selectedIndex = this.filteredSessions.findIndex((node) => node.session.path === selectedPath);
302
- if (selectedIndex >= 0)
309
+ if (selectedIndex >= 0) {
303
310
  this.selectedIndex = selectedIndex;
311
+ this.pendingSelectedPath = undefined;
312
+ }
313
+ else if (partial) {
314
+ // The selected session may not have loaded yet: keep it as the target instead of
315
+ // adopting whichever session the index now points to.
316
+ this.pendingSelectedPath = selectedPath;
317
+ }
318
+ else {
319
+ this.pendingSelectedPath = undefined;
320
+ }
304
321
  }
305
322
  }
306
323
  filterSessions(query) {
@@ -508,6 +525,7 @@ class SessionList {
508
525
  return;
509
526
  }
510
527
  this.selectionTouched = true;
528
+ this.pendingSelectedPath = undefined;
511
529
  // Up arrow
512
530
  if (kb.matches(keyData, "tui.select.up")) {
513
531
  this.selectedIndex = Math.max(0, this.selectedIndex - 1);
@@ -810,7 +828,7 @@ export class SessionSelectorComponent extends Container {
810
828
  this.allSessions = sessions;
811
829
  }
812
830
  if (scope === this.scope)
813
- this.sessionList.setSessions(sessions, showCwd);
831
+ this.sessionList.setSessions(sessions, showCwd, true);
814
832
  }
815
833
  if (scope !== this.scope)
816
834
  return;
@@ -882,7 +900,7 @@ export class SessionSelectorComponent extends Container {
882
900
  const loading = (this.scope === "current" ? this.currentLoad : this.allLoad) !== null;
883
901
  this.header.setScope(this.scope);
884
902
  this.header.setLoading(loading);
885
- this.sessionList.setSessions(sessions ?? [], this.scope === "all");
903
+ this.sessionList.setSessions(sessions ?? [], this.scope === "all", loading || sessions === null);
886
904
  this.requestRender();
887
905
  if (sessions === null && !loading)
888
906
  void this.loadScope(this.scope);