@diffra-ai/cli 0.0.0-stage → 0.1.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 (1329) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +22 -0
  3. package/README.md +61 -2
  4. package/dist/bun/cli.d.ts +5 -0
  5. package/dist/bun/cli.d.ts.map +1 -0
  6. package/dist/bun/cli.js +5 -0
  7. package/dist/bun/cli.js.map +1 -0
  8. package/dist/bun/restore-sandbox-env.d.ts +17 -0
  9. package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
  10. package/dist/bun/restore-sandbox-env.js +36 -0
  11. package/dist/bun/restore-sandbox-env.js.map +1 -0
  12. package/dist/bun/runtime-setup.d.ts +2 -0
  13. package/dist/bun/runtime-setup.d.ts.map +1 -0
  14. package/dist/bun/runtime-setup.js +12 -0
  15. package/dist/bun/runtime-setup.js.map +1 -0
  16. package/dist/bun/sandbox-env-setup.d.ts +2 -0
  17. package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
  18. package/dist/bun/sandbox-env-setup.js +4 -0
  19. package/dist/bun/sandbox-env-setup.js.map +1 -0
  20. package/dist/bundle/chunks/anthropic-messages-RDYSW7WM.js +6 -0
  21. package/dist/bundle/chunks/anthropic.js +75 -0
  22. package/dist/bundle/chunks/azure-openai-responses-HB77OIU4.js +2 -0
  23. package/dist/bundle/chunks/bedrock-converse-stream.js +89 -0
  24. package/dist/bundle/chunks/chunk-4KBADZRL.js +8 -0
  25. package/dist/bundle/chunks/chunk-5AGIVGSV.js +6 -0
  26. package/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
  27. package/dist/bundle/chunks/chunk-6S2AQWGR.js +55 -0
  28. package/dist/bundle/chunks/chunk-762GZFUO.js +9 -0
  29. package/dist/bundle/chunks/chunk-7CBJINYJ.js +20 -0
  30. package/dist/bundle/chunks/chunk-7DDKXS2Q.js +2 -0
  31. package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
  32. package/dist/bundle/chunks/chunk-B3FUE2LF.js +2 -0
  33. package/dist/bundle/chunks/chunk-B4DODQSC.js +2 -0
  34. package/dist/bundle/chunks/chunk-DWKLYVGO.js +2 -0
  35. package/dist/bundle/chunks/chunk-EIL6ZC3J.js +1240 -0
  36. package/dist/bundle/chunks/chunk-FFMDRXC4.js +10 -0
  37. package/dist/bundle/chunks/chunk-GCKVPVMH.js +2 -0
  38. package/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
  39. package/dist/bundle/chunks/chunk-INODY4DR.js +2 -0
  40. package/dist/bundle/chunks/chunk-INTHKDF2.js +20 -0
  41. package/dist/bundle/chunks/chunk-JJOJ6QJX.js +16 -0
  42. package/dist/bundle/chunks/chunk-JXWJOIH4.js +2 -0
  43. package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
  44. package/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
  45. package/dist/bundle/chunks/chunk-LVVZS2NO.js +12 -0
  46. package/dist/bundle/chunks/chunk-LWG2CUTI.js +31 -0
  47. package/dist/bundle/chunks/chunk-OYSUJGUM.js +2 -0
  48. package/dist/bundle/chunks/chunk-P7FPUEYA.js +2 -0
  49. package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
  50. package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
  51. package/dist/bundle/chunks/chunk-PMRZO46Y.js +2 -0
  52. package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
  53. package/dist/bundle/chunks/chunk-QRII7KJY.js +4 -0
  54. package/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
  55. package/dist/bundle/chunks/chunk-RJRIMI6M.js +13 -0
  56. package/dist/bundle/chunks/chunk-TMTOQ7H7.js +2 -0
  57. package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
  58. package/dist/bundle/chunks/chunk-V5GJW5IX.js +2 -0
  59. package/dist/bundle/chunks/chunk-VJQ6ZYW4.js +130 -0
  60. package/dist/bundle/chunks/chunk-VSFRR6IC.js +82 -0
  61. package/dist/bundle/chunks/chunk-Z36XYVPO.js +30 -0
  62. package/dist/bundle/chunks/chunk-Z72M6UD7.js +44 -0
  63. package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
  64. package/dist/bundle/chunks/chunk-ZVEA4XD4.js +2 -0
  65. package/dist/bundle/chunks/cli-SYWCWCZU.js +53 -0
  66. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-AASXI4DD.js +2 -0
  67. package/dist/bundle/chunks/codemode-worker.js +480 -0
  68. package/dist/bundle/chunks/easter-egg-3d-QN5RJMZR.js +2 -0
  69. package/dist/bundle/chunks/execute-3J63CQJG.js +507 -0
  70. package/dist/bundle/chunks/github-copilot.js +2 -0
  71. package/dist/bundle/chunks/google-generative-ai-6HC6JYFU.js +2 -0
  72. package/dist/bundle/chunks/google-vertex-UJFQATKN.js +2 -0
  73. package/dist/bundle/chunks/https-proxy-agent-LVOO5TPL.js +13 -0
  74. package/dist/bundle/chunks/image-resize-worker.js +2 -0
  75. package/dist/bundle/chunks/jiti-loader-GL4HJFAD.js +21 -0
  76. package/dist/bundle/chunks/jiti-static-loader-2RCDI6B4.js +2 -0
  77. package/dist/bundle/chunks/kimi-coding.js +2 -0
  78. package/dist/bundle/chunks/lib-4AVRLBHM.js +9 -0
  79. package/dist/bundle/chunks/llama-cpp-classify-GCDAR6VP.js +22 -0
  80. package/dist/bundle/chunks/meta.js +2 -0
  81. package/dist/bundle/chunks/mistral-conversations-CF3OZSLK.js +5 -0
  82. package/dist/bundle/chunks/multipart-parser-FMGQ7342.js +3 -0
  83. package/dist/bundle/chunks/node-AUOGOBCN.js +2 -0
  84. package/dist/bundle/chunks/node-KCMANYC2.js +16 -0
  85. package/dist/bundle/chunks/openai-chatgpt.js +75 -0
  86. package/dist/bundle/chunks/openai-codex-responses-L3IPEYDP.js +10 -0
  87. package/dist/bundle/chunks/openai-codex.js +75 -0
  88. package/dist/bundle/chunks/openai-completions-UXPSYQS7.js +7 -0
  89. package/dist/bundle/chunks/openai-decisions-DML6VHFQ.js +5 -0
  90. package/dist/bundle/chunks/openai-responses-46Z64FIE.js +4 -0
  91. package/dist/bundle/chunks/openrouter-images-EI7VO7CT.js +2 -0
  92. package/dist/bundle/chunks/openrouter.js +75 -0
  93. package/dist/bundle/chunks/pi-messages-4MV3SCQE.js +8 -0
  94. package/dist/bundle/chunks/radius.js +75 -0
  95. package/dist/bundle/chunks/runtime-KEVIZBAR.js +2 -0
  96. package/dist/bundle/chunks/src-QKGKDFSU.js +4 -0
  97. package/dist/bundle/chunks/typesafe-system-one-FZU6TH2G.js +2 -0
  98. package/dist/bundle/chunks/virtual-modules-RGWFZDWP.js +2 -0
  99. package/dist/bundle/chunks/xai.js +2 -0
  100. package/dist/bundle/cli-runtime.js +3 -0
  101. package/dist/bundle/cli.js +5 -0
  102. package/dist/bundle/index.js +2 -0
  103. package/dist/bundle/rpc-entry.js +3 -0
  104. package/dist/cli/args.d.ts +62 -0
  105. package/dist/cli/args.d.ts.map +1 -0
  106. package/dist/cli/args.js +476 -0
  107. package/dist/cli/args.js.map +1 -0
  108. package/dist/cli/auth-check.d.ts +19 -0
  109. package/dist/cli/auth-check.d.ts.map +1 -0
  110. package/dist/cli/auth-check.js +50 -0
  111. package/dist/cli/auth-check.js.map +1 -0
  112. package/dist/cli/auth-command.d.ts +24 -0
  113. package/dist/cli/auth-command.d.ts.map +1 -0
  114. package/dist/cli/auth-command.js +127 -0
  115. package/dist/cli/auth-command.js.map +1 -0
  116. package/dist/cli/auth-login.d.ts +15 -0
  117. package/dist/cli/auth-login.d.ts.map +1 -0
  118. package/dist/cli/auth-login.js +232 -0
  119. package/dist/cli/auth-login.js.map +1 -0
  120. package/dist/cli/auth-logout.d.ts +14 -0
  121. package/dist/cli/auth-logout.d.ts.map +1 -0
  122. package/dist/cli/auth-logout.js +57 -0
  123. package/dist/cli/auth-logout.js.map +1 -0
  124. package/dist/cli/auth-terminal.d.ts +17 -0
  125. package/dist/cli/auth-terminal.d.ts.map +1 -0
  126. package/dist/cli/auth-terminal.js +63 -0
  127. package/dist/cli/auth-terminal.js.map +1 -0
  128. package/dist/cli/config-selector.d.ts +16 -0
  129. package/dist/cli/config-selector.d.ts.map +1 -0
  130. package/dist/cli/config-selector.js +37 -0
  131. package/dist/cli/config-selector.js.map +1 -0
  132. package/dist/cli/credential-print.d.ts +13 -0
  133. package/dist/cli/credential-print.d.ts.map +1 -0
  134. package/dist/cli/credential-print.js +76 -0
  135. package/dist/cli/credential-print.js.map +1 -0
  136. package/dist/cli/file-processor.d.ts +15 -0
  137. package/dist/cli/file-processor.d.ts.map +1 -0
  138. package/dist/cli/file-processor.js +71 -0
  139. package/dist/cli/file-processor.js.map +1 -0
  140. package/dist/cli/initial-message.d.ts +18 -0
  141. package/dist/cli/initial-message.d.ts.map +1 -0
  142. package/dist/cli/initial-message.js +22 -0
  143. package/dist/cli/initial-message.js.map +1 -0
  144. package/dist/cli/list-models.d.ts +9 -0
  145. package/dist/cli/list-models.d.ts.map +1 -0
  146. package/dist/cli/list-models.js +98 -0
  147. package/dist/cli/list-models.js.map +1 -0
  148. package/dist/cli/project-trust.d.ts +10 -0
  149. package/dist/cli/project-trust.d.ts.map +1 -0
  150. package/dist/cli/project-trust.js +48 -0
  151. package/dist/cli/project-trust.js.map +1 -0
  152. package/dist/cli/session-picker.d.ts +10 -0
  153. package/dist/cli/session-picker.d.ts.map +1 -0
  154. package/dist/cli/session-picker.js +39 -0
  155. package/dist/cli/session-picker.js.map +1 -0
  156. package/dist/cli/setup.d.ts +2 -0
  157. package/dist/cli/setup.d.ts.map +1 -0
  158. package/dist/cli/setup.js +12 -0
  159. package/dist/cli/setup.js.map +1 -0
  160. package/dist/cli/startup-ui.d.ts +20 -0
  161. package/dist/cli/startup-ui.d.ts.map +1 -0
  162. package/dist/cli/startup-ui.js +197 -0
  163. package/dist/cli/startup-ui.js.map +1 -0
  164. package/dist/cli.d.ts +3 -0
  165. package/dist/cli.d.ts.map +1 -0
  166. package/dist/cli.js +6 -0
  167. package/dist/cli.js.map +1 -0
  168. package/dist/config.d.ts +136 -0
  169. package/dist/config.d.ts.map +1 -0
  170. package/dist/config.js +553 -0
  171. package/dist/config.js.map +1 -0
  172. package/dist/core/agent-session-runtime.d.ts +135 -0
  173. package/dist/core/agent-session-runtime.d.ts.map +1 -0
  174. package/dist/core/agent-session-runtime.js +351 -0
  175. package/dist/core/agent-session-runtime.js.map +1 -0
  176. package/dist/core/agent-session-services.d.ts +86 -0
  177. package/dist/core/agent-session-services.d.ts.map +1 -0
  178. package/dist/core/agent-session-services.js +147 -0
  179. package/dist/core/agent-session-services.js.map +1 -0
  180. package/dist/core/agent-session.d.ts +962 -0
  181. package/dist/core/agent-session.d.ts.map +1 -0
  182. package/dist/core/agent-session.js +3751 -0
  183. package/dist/core/agent-session.js.map +1 -0
  184. package/dist/core/auth-guidance.d.ts +5 -0
  185. package/dist/core/auth-guidance.d.ts.map +1 -0
  186. package/dist/core/auth-guidance.js +21 -0
  187. package/dist/core/auth-guidance.js.map +1 -0
  188. package/dist/core/auth-storage.d.ts +72 -0
  189. package/dist/core/auth-storage.d.ts.map +1 -0
  190. package/dist/core/auth-storage.js +434 -0
  191. package/dist/core/auth-storage.js.map +1 -0
  192. package/dist/core/bash-executor.d.ts +32 -0
  193. package/dist/core/bash-executor.d.ts.map +1 -0
  194. package/dist/core/bash-executor.js +103 -0
  195. package/dist/core/bash-executor.js.map +1 -0
  196. package/dist/core/bug-report-upload.d.ts +12 -0
  197. package/dist/core/bug-report-upload.d.ts.map +1 -0
  198. package/dist/core/bug-report-upload.js +22 -0
  199. package/dist/core/bug-report-upload.js.map +1 -0
  200. package/dist/core/bug-report.d.ts +184 -0
  201. package/dist/core/bug-report.d.ts.map +1 -0
  202. package/dist/core/bug-report.js +292 -0
  203. package/dist/core/bug-report.js.map +1 -0
  204. package/dist/core/cache-stats.d.ts +49 -0
  205. package/dist/core/cache-stats.d.ts.map +1 -0
  206. package/dist/core/cache-stats.js +112 -0
  207. package/dist/core/cache-stats.js.map +1 -0
  208. package/dist/core/cache-warmer.d.ts +70 -0
  209. package/dist/core/cache-warmer.d.ts.map +1 -0
  210. package/dist/core/cache-warmer.js +278 -0
  211. package/dist/core/cache-warmer.js.map +1 -0
  212. package/dist/core/client-identity.d.ts +8 -0
  213. package/dist/core/client-identity.d.ts.map +1 -0
  214. package/dist/core/client-identity.js +15 -0
  215. package/dist/core/client-identity.js.map +1 -0
  216. package/dist/core/compaction/branch-summarization.d.ts +100 -0
  217. package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  218. package/dist/core/compaction/branch-summarization.js +262 -0
  219. package/dist/core/compaction/branch-summarization.js.map +1 -0
  220. package/dist/core/compaction/compaction.d.ts +145 -0
  221. package/dist/core/compaction/compaction.d.ts.map +1 -0
  222. package/dist/core/compaction/compaction.js +749 -0
  223. package/dist/core/compaction/compaction.js.map +1 -0
  224. package/dist/core/compaction/index.d.ts +7 -0
  225. package/dist/core/compaction/index.d.ts.map +1 -0
  226. package/dist/core/compaction/index.js +7 -0
  227. package/dist/core/compaction/index.js.map +1 -0
  228. package/dist/core/compaction/utils.d.ts +45 -0
  229. package/dist/core/compaction/utils.d.ts.map +1 -0
  230. package/dist/core/compaction/utils.js +149 -0
  231. package/dist/core/compaction/utils.js.map +1 -0
  232. package/dist/core/crash-log.d.ts +27 -0
  233. package/dist/core/crash-log.d.ts.map +1 -0
  234. package/dist/core/crash-log.js +140 -0
  235. package/dist/core/crash-log.js.map +1 -0
  236. package/dist/core/defaults.d.ts +4 -0
  237. package/dist/core/defaults.d.ts.map +1 -0
  238. package/dist/core/defaults.js +11 -0
  239. package/dist/core/defaults.js.map +1 -0
  240. package/dist/core/diagnostics.d.ts +15 -0
  241. package/dist/core/diagnostics.d.ts.map +1 -0
  242. package/dist/core/diagnostics.js +2 -0
  243. package/dist/core/diagnostics.js.map +1 -0
  244. package/dist/core/diffra-ai-schemas.d.ts +167 -0
  245. package/dist/core/diffra-ai-schemas.d.ts.map +1 -0
  246. package/dist/core/diffra-ai-schemas.js +21 -0
  247. package/dist/core/diffra-ai-schemas.js.map +1 -0
  248. package/dist/core/diffra-manifest.d.ts +9 -0
  249. package/dist/core/diffra-manifest.d.ts.map +1 -0
  250. package/dist/core/diffra-manifest.js +30 -0
  251. package/dist/core/diffra-manifest.js.map +1 -0
  252. package/dist/core/event-bus.d.ts +9 -0
  253. package/dist/core/event-bus.d.ts.map +1 -0
  254. package/dist/core/event-bus.js +25 -0
  255. package/dist/core/event-bus.js.map +1 -0
  256. package/dist/core/exec.d.ts +38 -0
  257. package/dist/core/exec.d.ts.map +1 -0
  258. package/dist/core/exec.js +122 -0
  259. package/dist/core/exec.js.map +1 -0
  260. package/dist/core/experimental.d.ts +2 -0
  261. package/dist/core/experimental.d.ts.map +1 -0
  262. package/dist/core/experimental.js +4 -0
  263. package/dist/core/experimental.js.map +1 -0
  264. package/dist/core/export-html/ansi-to-html.d.ts +27 -0
  265. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  266. package/dist/core/export-html/ansi-to-html.js +286 -0
  267. package/dist/core/export-html/ansi-to-html.js.map +1 -0
  268. package/dist/core/export-html/index.d.ts +37 -0
  269. package/dist/core/export-html/index.d.ts.map +1 -0
  270. package/dist/core/export-html/index.js +228 -0
  271. package/dist/core/export-html/index.js.map +1 -0
  272. package/dist/core/export-html/template.css +1085 -0
  273. package/dist/core/export-html/template.html +56 -0
  274. package/dist/core/export-html/template.js +2044 -0
  275. package/dist/core/export-html/tool-renderer.d.ts +34 -0
  276. package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  277. package/dist/core/export-html/tool-renderer.js +112 -0
  278. package/dist/core/export-html/tool-renderer.js.map +1 -0
  279. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  280. package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
  281. package/dist/core/export-html/vendor/marked.min.js +79 -0
  282. package/dist/core/extensions/diffra-ai-extension-view.d.ts +19 -0
  283. package/dist/core/extensions/diffra-ai-extension-view.d.ts.map +1 -0
  284. package/dist/core/extensions/diffra-ai-extension-view.js +22 -0
  285. package/dist/core/extensions/diffra-ai-extension-view.js.map +1 -0
  286. package/dist/core/extensions/index.d.ts +12 -0
  287. package/dist/core/extensions/index.d.ts.map +1 -0
  288. package/dist/core/extensions/index.js +9 -0
  289. package/dist/core/extensions/index.js.map +1 -0
  290. package/dist/core/extensions/jiti-loader.d.ts +2 -0
  291. package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
  292. package/dist/core/extensions/jiti-loader.js +4 -0
  293. package/dist/core/extensions/jiti-loader.js.map +1 -0
  294. package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
  295. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
  296. package/dist/core/extensions/jiti-static-loader.js +4 -0
  297. package/dist/core/extensions/jiti-static-loader.js.map +1 -0
  298. package/dist/core/extensions/loader.d.ts +23 -0
  299. package/dist/core/extensions/loader.d.ts.map +1 -0
  300. package/dist/core/extensions/loader.js +719 -0
  301. package/dist/core/extensions/loader.js.map +1 -0
  302. package/dist/core/extensions/runner.d.ts +216 -0
  303. package/dist/core/extensions/runner.d.ts.map +1 -0
  304. package/dist/core/extensions/runner.js +1251 -0
  305. package/dist/core/extensions/runner.js.map +1 -0
  306. package/dist/core/extensions/types.d.ts +1807 -0
  307. package/dist/core/extensions/types.d.ts.map +1 -0
  308. package/dist/core/extensions/types.js +48 -0
  309. package/dist/core/extensions/types.js.map +1 -0
  310. package/dist/core/extensions/virtual-modules.d.ts +3 -0
  311. package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
  312. package/dist/core/extensions/virtual-modules.js +34 -0
  313. package/dist/core/extensions/virtual-modules.js.map +1 -0
  314. package/dist/core/extensions/wrapper.d.ts +20 -0
  315. package/dist/core/extensions/wrapper.d.ts.map +1 -0
  316. package/dist/core/extensions/wrapper.js +22 -0
  317. package/dist/core/extensions/wrapper.js.map +1 -0
  318. package/dist/core/footer-data-provider.d.ts +64 -0
  319. package/dist/core/footer-data-provider.d.ts.map +1 -0
  320. package/dist/core/footer-data-provider.js +338 -0
  321. package/dist/core/footer-data-provider.js.map +1 -0
  322. package/dist/core/http-dispatcher.d.ts +22 -0
  323. package/dist/core/http-dispatcher.d.ts.map +1 -0
  324. package/dist/core/http-dispatcher.js +98 -0
  325. package/dist/core/http-dispatcher.js.map +1 -0
  326. package/dist/core/index.d.ts +14 -0
  327. package/dist/core/index.d.ts.map +1 -0
  328. package/dist/core/index.js +13 -0
  329. package/dist/core/index.js.map +1 -0
  330. package/dist/core/key-id-schema.d.ts +6 -0
  331. package/dist/core/key-id-schema.d.ts.map +1 -0
  332. package/dist/core/key-id-schema.js +16 -0
  333. package/dist/core/key-id-schema.js.map +1 -0
  334. package/dist/core/keybindings-schema.d.ts +4 -0
  335. package/dist/core/keybindings-schema.d.ts.map +1 -0
  336. package/dist/core/keybindings-schema.js +16 -0
  337. package/dist/core/keybindings-schema.js.map +1 -0
  338. package/dist/core/keybindings.d.ts +560 -0
  339. package/dist/core/keybindings.d.ts.map +1 -0
  340. package/dist/core/keybindings.js +324 -0
  341. package/dist/core/keybindings.js.map +1 -0
  342. package/dist/core/mcp-servers.d.ts +121 -0
  343. package/dist/core/mcp-servers.d.ts.map +1 -0
  344. package/dist/core/mcp-servers.js +163 -0
  345. package/dist/core/mcp-servers.js.map +1 -0
  346. package/dist/core/messages.d.ts +77 -0
  347. package/dist/core/messages.d.ts.map +1 -0
  348. package/dist/core/messages.js +124 -0
  349. package/dist/core/messages.js.map +1 -0
  350. package/dist/core/model-config.d.ts +2013 -0
  351. package/dist/core/model-config.d.ts.map +1 -0
  352. package/dist/core/model-config.js +167 -0
  353. package/dist/core/model-config.js.map +1 -0
  354. package/dist/core/model-registry.d.ts +63 -0
  355. package/dist/core/model-registry.d.ts.map +1 -0
  356. package/dist/core/model-registry.js +144 -0
  357. package/dist/core/model-registry.js.map +1 -0
  358. package/dist/core/model-resolver.d.ts +129 -0
  359. package/dist/core/model-resolver.d.ts.map +1 -0
  360. package/dist/core/model-resolver.js +428 -0
  361. package/dist/core/model-resolver.js.map +1 -0
  362. package/dist/core/model-runtime.d.ts +150 -0
  363. package/dist/core/model-runtime.d.ts.map +1 -0
  364. package/dist/core/model-runtime.js +774 -0
  365. package/dist/core/model-runtime.js.map +1 -0
  366. package/dist/core/models-store.d.ts +22 -0
  367. package/dist/core/models-store.d.ts.map +1 -0
  368. package/dist/core/models-store.js +115 -0
  369. package/dist/core/models-store.js.map +1 -0
  370. package/dist/core/nested-tool-calls.d.ts +103 -0
  371. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  372. package/dist/core/nested-tool-calls.js +179 -0
  373. package/dist/core/nested-tool-calls.js.map +1 -0
  374. package/dist/core/output-guard.d.ts +7 -0
  375. package/dist/core/output-guard.d.ts.map +1 -0
  376. package/dist/core/output-guard.js +89 -0
  377. package/dist/core/output-guard.js.map +1 -0
  378. package/dist/core/package-manager.d.ts +256 -0
  379. package/dist/core/package-manager.d.ts.map +1 -0
  380. package/dist/core/package-manager.js +2426 -0
  381. package/dist/core/package-manager.js.map +1 -0
  382. package/dist/core/preferred-providers.d.ts +17 -0
  383. package/dist/core/preferred-providers.d.ts.map +1 -0
  384. package/dist/core/preferred-providers.js +24 -0
  385. package/dist/core/preferred-providers.js.map +1 -0
  386. package/dist/core/project-trust.d.ts +15 -0
  387. package/dist/core/project-trust.d.ts.map +1 -0
  388. package/dist/core/project-trust.js +60 -0
  389. package/dist/core/project-trust.js.map +1 -0
  390. package/dist/core/prompt-templates.d.ts +59 -0
  391. package/dist/core/prompt-templates.d.ts.map +1 -0
  392. package/dist/core/prompt-templates.js +283 -0
  393. package/dist/core/prompt-templates.js.map +1 -0
  394. package/dist/core/provider-composer.d.ts +81 -0
  395. package/dist/core/provider-composer.d.ts.map +1 -0
  396. package/dist/core/provider-composer.js +494 -0
  397. package/dist/core/provider-composer.js.map +1 -0
  398. package/dist/core/provider-matching.d.ts +6 -0
  399. package/dist/core/provider-matching.d.ts.map +1 -0
  400. package/dist/core/provider-matching.js +8 -0
  401. package/dist/core/provider-matching.js.map +1 -0
  402. package/dist/core/radius-mcp.d.ts +13 -0
  403. package/dist/core/radius-mcp.d.ts.map +1 -0
  404. package/dist/core/radius-mcp.js +29 -0
  405. package/dist/core/radius-mcp.js.map +1 -0
  406. package/dist/core/radius.d.ts +7 -0
  407. package/dist/core/radius.d.ts.map +1 -0
  408. package/dist/core/radius.js +10 -0
  409. package/dist/core/radius.js.map +1 -0
  410. package/dist/core/remote-catalog-provider.d.ts +23 -0
  411. package/dist/core/remote-catalog-provider.d.ts.map +1 -0
  412. package/dist/core/remote-catalog-provider.js +199 -0
  413. package/dist/core/remote-catalog-provider.js.map +1 -0
  414. package/dist/core/resolve-config-value.d.ts +30 -0
  415. package/dist/core/resolve-config-value.d.ts.map +1 -0
  416. package/dist/core/resolve-config-value.js +247 -0
  417. package/dist/core/resolve-config-value.js.map +1 -0
  418. package/dist/core/resource-loader.d.ts +237 -0
  419. package/dist/core/resource-loader.d.ts.map +1 -0
  420. package/dist/core/resource-loader.js +1023 -0
  421. package/dist/core/resource-loader.js.map +1 -0
  422. package/dist/core/runtime-credentials.d.ts +23 -0
  423. package/dist/core/runtime-credentials.d.ts.map +1 -0
  424. package/dist/core/runtime-credentials.js +53 -0
  425. package/dist/core/runtime-credentials.js.map +1 -0
  426. package/dist/core/sdk.d.ts +117 -0
  427. package/dist/core/sdk.d.ts.map +1 -0
  428. package/dist/core/sdk.js +329 -0
  429. package/dist/core/sdk.js.map +1 -0
  430. package/dist/core/session-cwd.d.ts +26 -0
  431. package/dist/core/session-cwd.d.ts.map +1 -0
  432. package/dist/core/session-cwd.js +46 -0
  433. package/dist/core/session-cwd.js.map +1 -0
  434. package/dist/core/session-export.d.ts +8 -0
  435. package/dist/core/session-export.d.ts.map +1 -0
  436. package/dist/core/session-export.js +33 -0
  437. package/dist/core/session-export.js.map +1 -0
  438. package/dist/core/session-manager.d.ts +423 -0
  439. package/dist/core/session-manager.d.ts.map +1 -0
  440. package/dist/core/session-manager.js +1553 -0
  441. package/dist/core/session-manager.js.map +1 -0
  442. package/dist/core/settings-defaults.d.ts +66 -0
  443. package/dist/core/settings-defaults.d.ts.map +1 -0
  444. package/dist/core/settings-defaults.js +67 -0
  445. package/dist/core/settings-defaults.js.map +1 -0
  446. package/dist/core/settings-diagnostics.d.ts +9 -0
  447. package/dist/core/settings-diagnostics.d.ts.map +1 -0
  448. package/dist/core/settings-diagnostics.js +21 -0
  449. package/dist/core/settings-diagnostics.js.map +1 -0
  450. package/dist/core/settings-manager.d.ts +253 -0
  451. package/dist/core/settings-manager.d.ts.map +1 -0
  452. package/dist/core/settings-manager.js +1154 -0
  453. package/dist/core/settings-manager.js.map +1 -0
  454. package/dist/core/settings-schema.d.ts +232 -0
  455. package/dist/core/settings-schema.d.ts.map +1 -0
  456. package/dist/core/settings-schema.js +298 -0
  457. package/dist/core/settings-schema.js.map +1 -0
  458. package/dist/core/skills.d.ts +63 -0
  459. package/dist/core/skills.d.ts.map +1 -0
  460. package/dist/core/skills.js +404 -0
  461. package/dist/core/skills.js.map +1 -0
  462. package/dist/core/slash-commands.d.ts +15 -0
  463. package/dist/core/slash-commands.d.ts.map +1 -0
  464. package/dist/core/slash-commands.js +28 -0
  465. package/dist/core/slash-commands.js.map +1 -0
  466. package/dist/core/source-info.d.ts +35 -0
  467. package/dist/core/source-info.d.ts.map +1 -0
  468. package/dist/core/source-info.js +48 -0
  469. package/dist/core/source-info.js.map +1 -0
  470. package/dist/core/system-prompt.d.ts +77 -0
  471. package/dist/core/system-prompt.d.ts.map +1 -0
  472. package/dist/core/system-prompt.js +151 -0
  473. package/dist/core/system-prompt.js.map +1 -0
  474. package/dist/core/telemetry.d.ts +3 -0
  475. package/dist/core/telemetry.d.ts.map +1 -0
  476. package/dist/core/telemetry.js +9 -0
  477. package/dist/core/telemetry.js.map +1 -0
  478. package/dist/core/timings.d.ts +10 -0
  479. package/dist/core/timings.d.ts.map +1 -0
  480. package/dist/core/timings.js +41 -0
  481. package/dist/core/timings.js.map +1 -0
  482. package/dist/core/tools/bash.d.ts +100 -0
  483. package/dist/core/tools/bash.d.ts.map +1 -0
  484. package/dist/core/tools/bash.js +363 -0
  485. package/dist/core/tools/bash.js.map +1 -0
  486. package/dist/core/tools/edit-diff.d.ts +110 -0
  487. package/dist/core/tools/edit-diff.d.ts.map +1 -0
  488. package/dist/core/tools/edit-diff.js +562 -0
  489. package/dist/core/tools/edit-diff.js.map +1 -0
  490. package/dist/core/tools/edit.d.ts +44 -0
  491. package/dist/core/tools/edit.d.ts.map +1 -0
  492. package/dist/core/tools/edit.js +146 -0
  493. package/dist/core/tools/edit.js.map +1 -0
  494. package/dist/core/tools/file-mutation-queue.d.ts +6 -0
  495. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
  496. package/dist/core/tools/file-mutation-queue.js +52 -0
  497. package/dist/core/tools/file-mutation-queue.js.map +1 -0
  498. package/dist/core/tools/find.d.ts +42 -0
  499. package/dist/core/tools/find.d.ts.map +1 -0
  500. package/dist/core/tools/find.js +308 -0
  501. package/dist/core/tools/find.js.map +1 -0
  502. package/dist/core/tools/grep.d.ts +43 -0
  503. package/dist/core/tools/grep.d.ts.map +1 -0
  504. package/dist/core/tools/grep.js +266 -0
  505. package/dist/core/tools/grep.js.map +1 -0
  506. package/dist/core/tools/index.d.ts +43 -0
  507. package/dist/core/tools/index.d.ts.map +1 -0
  508. package/dist/core/tools/index.js +129 -0
  509. package/dist/core/tools/index.js.map +1 -0
  510. package/dist/core/tools/ls.d.ts +41 -0
  511. package/dist/core/tools/ls.d.ts.map +1 -0
  512. package/dist/core/tools/ls.js +127 -0
  513. package/dist/core/tools/ls.js.map +1 -0
  514. package/dist/core/tools/output-accumulator.d.ts +63 -0
  515. package/dist/core/tools/output-accumulator.d.ts.map +1 -0
  516. package/dist/core/tools/output-accumulator.js +218 -0
  517. package/dist/core/tools/output-accumulator.js.map +1 -0
  518. package/dist/core/tools/path-utils.d.ts +10 -0
  519. package/dist/core/tools/path-utils.d.ts.map +1 -0
  520. package/dist/core/tools/path-utils.js +99 -0
  521. package/dist/core/tools/path-utils.js.map +1 -0
  522. package/dist/core/tools/powershell.d.ts +16 -0
  523. package/dist/core/tools/powershell.d.ts.map +1 -0
  524. package/dist/core/tools/powershell.js +52 -0
  525. package/dist/core/tools/powershell.js.map +1 -0
  526. package/dist/core/tools/read.d.ts +68 -0
  527. package/dist/core/tools/read.d.ts.map +1 -0
  528. package/dist/core/tools/read.js +297 -0
  529. package/dist/core/tools/read.js.map +1 -0
  530. package/dist/core/tools/render-utils.d.ts +50 -0
  531. package/dist/core/tools/render-utils.d.ts.map +1 -0
  532. package/dist/core/tools/render-utils.js +153 -0
  533. package/dist/core/tools/render-utils.js.map +1 -0
  534. package/dist/core/tools/renderers/bash.d.ts +12 -0
  535. package/dist/core/tools/renderers/bash.d.ts.map +1 -0
  536. package/dist/core/tools/renderers/bash.js +89 -0
  537. package/dist/core/tools/renderers/bash.js.map +1 -0
  538. package/dist/core/tools/renderers/edit.d.ts +23 -0
  539. package/dist/core/tools/renderers/edit.d.ts.map +1 -0
  540. package/dist/core/tools/renderers/edit.js +168 -0
  541. package/dist/core/tools/renderers/edit.js.map +1 -0
  542. package/dist/core/tools/renderers/find.d.ts +10 -0
  543. package/dist/core/tools/renderers/find.d.ts.map +1 -0
  544. package/dist/core/tools/renderers/find.js +64 -0
  545. package/dist/core/tools/renderers/find.js.map +1 -0
  546. package/dist/core/tools/renderers/grep.d.ts +10 -0
  547. package/dist/core/tools/renderers/grep.d.ts.map +1 -0
  548. package/dist/core/tools/renderers/grep.js +69 -0
  549. package/dist/core/tools/renderers/grep.js.map +1 -0
  550. package/dist/core/tools/renderers/index.d.ts +28 -0
  551. package/dist/core/tools/renderers/index.d.ts.map +1 -0
  552. package/dist/core/tools/renderers/index.js +47 -0
  553. package/dist/core/tools/renderers/index.js.map +1 -0
  554. package/dist/core/tools/renderers/ls.d.ts +10 -0
  555. package/dist/core/tools/renderers/ls.d.ts.map +1 -0
  556. package/dist/core/tools/renderers/ls.js +58 -0
  557. package/dist/core/tools/renderers/ls.js.map +1 -0
  558. package/dist/core/tools/renderers/read.d.ts +11 -0
  559. package/dist/core/tools/renderers/read.d.ts.map +1 -0
  560. package/dist/core/tools/renderers/read.js +130 -0
  561. package/dist/core/tools/renderers/read.js.map +1 -0
  562. package/dist/core/tools/renderers/write.d.ts +10 -0
  563. package/dist/core/tools/renderers/write.d.ts.map +1 -0
  564. package/dist/core/tools/renderers/write.js +153 -0
  565. package/dist/core/tools/renderers/write.js.map +1 -0
  566. package/dist/core/tools/tool-definition-wrapper.d.ts +26 -0
  567. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  568. package/dist/core/tools/tool-definition-wrapper.js +38 -0
  569. package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
  570. package/dist/core/tools/truncate.d.ts +74 -0
  571. package/dist/core/tools/truncate.d.ts.map +1 -0
  572. package/dist/core/tools/truncate.js +244 -0
  573. package/dist/core/tools/truncate.js.map +1 -0
  574. package/dist/core/tools/write.d.ts +30 -0
  575. package/dist/core/tools/write.d.ts.map +1 -0
  576. package/dist/core/tools/write.js +61 -0
  577. package/dist/core/tools/write.js.map +1 -0
  578. package/dist/core/trust-manager.d.ts +36 -0
  579. package/dist/core/trust-manager.d.ts.map +1 -0
  580. package/dist/core/trust-manager.js +210 -0
  581. package/dist/core/trust-manager.js.map +1 -0
  582. package/dist/core/usage-totals.d.ts +21 -0
  583. package/dist/core/usage-totals.d.ts.map +1 -0
  584. package/dist/core/usage-totals.js +81 -0
  585. package/dist/core/usage-totals.js.map +1 -0
  586. package/dist/core/virtual-models.d.ts +117 -0
  587. package/dist/core/virtual-models.d.ts.map +1 -0
  588. package/dist/core/virtual-models.js +124 -0
  589. package/dist/core/virtual-models.js.map +1 -0
  590. package/dist/extensions/codemode/execute.d.ts +16 -0
  591. package/dist/extensions/codemode/execute.d.ts.map +1 -0
  592. package/dist/extensions/codemode/execute.js +740 -0
  593. package/dist/extensions/codemode/execute.js.map +1 -0
  594. package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
  595. package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
  596. package/dist/extensions/codemode/execute.lazy.js +3 -0
  597. package/dist/extensions/codemode/execute.lazy.js.map +1 -0
  598. package/dist/extensions/codemode/index.d.ts +21 -0
  599. package/dist/extensions/codemode/index.d.ts.map +1 -0
  600. package/dist/extensions/codemode/index.js +33 -0
  601. package/dist/extensions/codemode/index.js.map +1 -0
  602. package/dist/extensions/codemode/renderer.d.ts +12 -0
  603. package/dist/extensions/codemode/renderer.d.ts.map +1 -0
  604. package/dist/extensions/codemode/renderer.js +147 -0
  605. package/dist/extensions/codemode/renderer.js.map +1 -0
  606. package/dist/extensions/codemode/tool.d.ts +125 -0
  607. package/dist/extensions/codemode/tool.d.ts.map +1 -0
  608. package/dist/extensions/codemode/tool.js +335 -0
  609. package/dist/extensions/codemode/tool.js.map +1 -0
  610. package/dist/extensions/codemode/worker.d.ts +7 -0
  611. package/dist/extensions/codemode/worker.d.ts.map +1 -0
  612. package/dist/extensions/codemode/worker.js +7 -0
  613. package/dist/extensions/codemode/worker.js.map +1 -0
  614. package/dist/extensions/index.d.ts +3 -0
  615. package/dist/extensions/index.d.ts.map +1 -0
  616. package/dist/extensions/index.js +13 -0
  617. package/dist/extensions/index.js.map +1 -0
  618. package/dist/extensions/llama/client.d.ts +71 -0
  619. package/dist/extensions/llama/client.d.ts.map +1 -0
  620. package/dist/extensions/llama/client.js +334 -0
  621. package/dist/extensions/llama/client.js.map +1 -0
  622. package/dist/extensions/llama/huggingface.d.ts +23 -0
  623. package/dist/extensions/llama/huggingface.d.ts.map +1 -0
  624. package/dist/extensions/llama/huggingface.js +141 -0
  625. package/dist/extensions/llama/huggingface.js.map +1 -0
  626. package/dist/extensions/llama/index.d.ts +3 -0
  627. package/dist/extensions/llama/index.d.ts.map +1 -0
  628. package/dist/extensions/llama/index.js +219 -0
  629. package/dist/extensions/llama/index.js.map +1 -0
  630. package/dist/extensions/llama/provider.d.ts +12 -0
  631. package/dist/extensions/llama/provider.d.ts.map +1 -0
  632. package/dist/extensions/llama/provider.js +238 -0
  633. package/dist/extensions/llama/provider.js.map +1 -0
  634. package/dist/extensions/llama/ui.d.ts +42 -0
  635. package/dist/extensions/llama/ui.d.ts.map +1 -0
  636. package/dist/extensions/llama/ui.js +440 -0
  637. package/dist/extensions/llama/ui.js.map +1 -0
  638. package/dist/extensions/mcp/cli.d.ts +23 -0
  639. package/dist/extensions/mcp/cli.d.ts.map +1 -0
  640. package/dist/extensions/mcp/cli.js +555 -0
  641. package/dist/extensions/mcp/cli.js.map +1 -0
  642. package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
  643. package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
  644. package/dist/extensions/mcp/cli.lazy.js +3 -0
  645. package/dist/extensions/mcp/cli.lazy.js.map +1 -0
  646. package/dist/extensions/mcp/config.d.ts +84 -0
  647. package/dist/extensions/mcp/config.d.ts.map +1 -0
  648. package/dist/extensions/mcp/config.js +192 -0
  649. package/dist/extensions/mcp/config.js.map +1 -0
  650. package/dist/extensions/mcp/index.d.ts +79 -0
  651. package/dist/extensions/mcp/index.d.ts.map +1 -0
  652. package/dist/extensions/mcp/index.js +1203 -0
  653. package/dist/extensions/mcp/index.js.map +1 -0
  654. package/dist/extensions/mcp/log.d.ts +16 -0
  655. package/dist/extensions/mcp/log.d.ts.map +1 -0
  656. package/dist/extensions/mcp/log.js +66 -0
  657. package/dist/extensions/mcp/log.js.map +1 -0
  658. package/dist/extensions/mcp/oauth.d.ts +64 -0
  659. package/dist/extensions/mcp/oauth.d.ts.map +1 -0
  660. package/dist/extensions/mcp/oauth.js +188 -0
  661. package/dist/extensions/mcp/oauth.js.map +1 -0
  662. package/dist/extensions/mcp/resources.d.ts +36 -0
  663. package/dist/extensions/mcp/resources.d.ts.map +1 -0
  664. package/dist/extensions/mcp/resources.js +262 -0
  665. package/dist/extensions/mcp/resources.js.map +1 -0
  666. package/dist/extensions/mcp/runtime.d.ts +99 -0
  667. package/dist/extensions/mcp/runtime.d.ts.map +1 -0
  668. package/dist/extensions/mcp/runtime.js +380 -0
  669. package/dist/extensions/mcp/runtime.js.map +1 -0
  670. package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
  671. package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
  672. package/dist/extensions/mcp/runtime.lazy.js +3 -0
  673. package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
  674. package/dist/extensions/mcp/tools.d.ts +57 -0
  675. package/dist/extensions/mcp/tools.d.ts.map +1 -0
  676. package/dist/extensions/mcp/tools.js +141 -0
  677. package/dist/extensions/mcp/tools.js.map +1 -0
  678. package/dist/extensions/mcp/ui.d.ts +61 -0
  679. package/dist/extensions/mcp/ui.d.ts.map +1 -0
  680. package/dist/extensions/mcp/ui.js +195 -0
  681. package/dist/extensions/mcp/ui.js.map +1 -0
  682. package/dist/extensions/tool-search/index.d.ts +12 -0
  683. package/dist/extensions/tool-search/index.d.ts.map +1 -0
  684. package/dist/extensions/tool-search/index.js +15 -0
  685. package/dist/extensions/tool-search/index.js.map +1 -0
  686. package/dist/extensions/tool-search/tool.d.ts +86 -0
  687. package/dist/extensions/tool-search/tool.d.ts.map +1 -0
  688. package/dist/extensions/tool-search/tool.js +267 -0
  689. package/dist/extensions/tool-search/tool.js.map +1 -0
  690. package/dist/index.d.ts +45 -0
  691. package/dist/index.d.ts.map +1 -0
  692. package/dist/index.js +54 -0
  693. package/dist/index.js.map +1 -0
  694. package/dist/main.d.ts +16 -0
  695. package/dist/main.d.ts.map +1 -0
  696. package/dist/main.js +904 -0
  697. package/dist/main.js.map +1 -0
  698. package/dist/migrations.d.ts +33 -0
  699. package/dist/migrations.d.ts.map +1 -0
  700. package/dist/migrations.js +282 -0
  701. package/dist/migrations.js.map +1 -0
  702. package/dist/modes/diagnostics-stderr.d.ts +4 -0
  703. package/dist/modes/diagnostics-stderr.d.ts.map +1 -0
  704. package/dist/modes/diagnostics-stderr.js +11 -0
  705. package/dist/modes/diagnostics-stderr.js.map +1 -0
  706. package/dist/modes/index.d.ts +10 -0
  707. package/dist/modes/index.d.ts.map +1 -0
  708. package/dist/modes/index.js +8 -0
  709. package/dist/modes/index.js.map +1 -0
  710. package/dist/modes/interactive/assets/clankolas.png +0 -0
  711. package/dist/modes/interactive/bug-report.d.ts +16 -0
  712. package/dist/modes/interactive/bug-report.d.ts.map +1 -0
  713. package/dist/modes/interactive/bug-report.js +210 -0
  714. package/dist/modes/interactive/bug-report.js.map +1 -0
  715. package/dist/modes/interactive/chat-viewport.d.ts +20 -0
  716. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
  717. package/dist/modes/interactive/chat-viewport.js +28 -0
  718. package/dist/modes/interactive/chat-viewport.js.map +1 -0
  719. package/dist/modes/interactive/components/armin.d.ts +37 -0
  720. package/dist/modes/interactive/components/armin.d.ts.map +1 -0
  721. package/dist/modes/interactive/components/armin.js +335 -0
  722. package/dist/modes/interactive/components/armin.js.map +1 -0
  723. package/dist/modes/interactive/components/assistant-message.d.ts +30 -0
  724. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  725. package/dist/modes/interactive/components/assistant-message.js +188 -0
  726. package/dist/modes/interactive/components/assistant-message.js.map +1 -0
  727. package/dist/modes/interactive/components/auth-url.d.ts +14 -0
  728. package/dist/modes/interactive/components/auth-url.d.ts.map +1 -0
  729. package/dist/modes/interactive/components/auth-url.js +37 -0
  730. package/dist/modes/interactive/components/auth-url.js.map +1 -0
  731. package/dist/modes/interactive/components/bash-execution.d.ts +38 -0
  732. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  733. package/dist/modes/interactive/components/bash-execution.js +178 -0
  734. package/dist/modes/interactive/components/bash-execution.js.map +1 -0
  735. package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  736. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  737. package/dist/modes/interactive/components/bordered-loader.js +54 -0
  738. package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  739. package/dist/modes/interactive/components/branch-summary-message.d.ts +21 -0
  740. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  741. package/dist/modes/interactive/components/branch-summary-message.js +62 -0
  742. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  743. package/dist/modes/interactive/components/compaction-summary-message.d.ts +21 -0
  744. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  745. package/dist/modes/interactive/components/compaction-summary-message.js +63 -0
  746. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  747. package/dist/modes/interactive/components/config-selector.d.ts +102 -0
  748. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  749. package/dist/modes/interactive/components/config-selector.js +761 -0
  750. package/dist/modes/interactive/components/config-selector.js.map +1 -0
  751. package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  752. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  753. package/dist/modes/interactive/components/countdown-timer.js +33 -0
  754. package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  755. package/dist/modes/interactive/components/custom-editor.d.ts +30 -0
  756. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  757. package/dist/modes/interactive/components/custom-editor.js +122 -0
  758. package/dist/modes/interactive/components/custom-editor.js.map +1 -0
  759. package/dist/modes/interactive/components/custom-entry.d.ts +21 -0
  760. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
  761. package/dist/modes/interactive/components/custom-entry.js +59 -0
  762. package/dist/modes/interactive/components/custom-entry.js.map +1 -0
  763. package/dist/modes/interactive/components/custom-message.d.ts +25 -0
  764. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  765. package/dist/modes/interactive/components/custom-message.js +96 -0
  766. package/dist/modes/interactive/components/custom-message.js.map +1 -0
  767. package/dist/modes/interactive/components/diff.d.ts +12 -0
  768. package/dist/modes/interactive/components/diff.d.ts.map +1 -0
  769. package/dist/modes/interactive/components/diff.js +139 -0
  770. package/dist/modes/interactive/components/diff.js.map +1 -0
  771. package/dist/modes/interactive/components/diffra-logo.d.ts +28 -0
  772. package/dist/modes/interactive/components/diffra-logo.d.ts.map +1 -0
  773. package/dist/modes/interactive/components/diffra-logo.js +110 -0
  774. package/dist/modes/interactive/components/diffra-logo.js.map +1 -0
  775. package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  776. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  777. package/dist/modes/interactive/components/dynamic-border.js +21 -0
  778. package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  779. package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
  780. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
  781. package/dist/modes/interactive/components/earendil-announcement.js +40 -0
  782. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
  783. package/dist/modes/interactive/components/easter-egg-3d.d.ts +104 -0
  784. package/dist/modes/interactive/components/easter-egg-3d.d.ts.map +1 -0
  785. package/dist/modes/interactive/components/easter-egg-3d.js +1145 -0
  786. package/dist/modes/interactive/components/easter-egg-3d.js.map +1 -0
  787. package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts +6 -0
  788. package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts.map +1 -0
  789. package/dist/modes/interactive/components/easter-egg-3d.lazy.js +23 -0
  790. package/dist/modes/interactive/components/easter-egg-3d.lazy.js.map +1 -0
  791. package/dist/modes/interactive/components/extension-editor.d.ts +26 -0
  792. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  793. package/dist/modes/interactive/components/extension-editor.js +107 -0
  794. package/dist/modes/interactive/components/extension-editor.js.map +1 -0
  795. package/dist/modes/interactive/components/extension-input.d.ts +25 -0
  796. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  797. package/dist/modes/interactive/components/extension-input.js +67 -0
  798. package/dist/modes/interactive/components/extension-input.js.map +1 -0
  799. package/dist/modes/interactive/components/extension-selector.d.ts +27 -0
  800. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  801. package/dist/modes/interactive/components/extension-selector.js +95 -0
  802. package/dist/modes/interactive/components/extension-selector.js.map +1 -0
  803. package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
  804. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
  805. package/dist/modes/interactive/components/first-time-setup.js +109 -0
  806. package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
  807. package/dist/modes/interactive/components/footer.d.ts +39 -0
  808. package/dist/modes/interactive/components/footer.d.ts.map +1 -0
  809. package/dist/modes/interactive/components/footer.js +265 -0
  810. package/dist/modes/interactive/components/footer.js.map +1 -0
  811. package/dist/modes/interactive/components/index.d.ts +33 -0
  812. package/dist/modes/interactive/components/index.d.ts.map +1 -0
  813. package/dist/modes/interactive/components/index.js +34 -0
  814. package/dist/modes/interactive/components/index.js.map +1 -0
  815. package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
  816. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  817. package/dist/modes/interactive/components/keybinding-hints.js +36 -0
  818. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  819. package/dist/modes/interactive/components/login-dialog.d.ts +59 -0
  820. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  821. package/dist/modes/interactive/components/login-dialog.js +272 -0
  822. package/dist/modes/interactive/components/login-dialog.js.map +1 -0
  823. package/dist/modes/interactive/components/markdown-transform.d.ts +4 -0
  824. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
  825. package/dist/modes/interactive/components/markdown-transform.js +20 -0
  826. package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
  827. package/dist/modes/interactive/components/mermaid.d.ts +12 -0
  828. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
  829. package/dist/modes/interactive/components/mermaid.js +80 -0
  830. package/dist/modes/interactive/components/mermaid.js.map +1 -0
  831. package/dist/modes/interactive/components/model-selector.d.ts +61 -0
  832. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  833. package/dist/modes/interactive/components/model-selector.js +383 -0
  834. package/dist/modes/interactive/components/model-selector.js.map +1 -0
  835. package/dist/modes/interactive/components/oauth-selector.d.ts +47 -0
  836. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  837. package/dist/modes/interactive/components/oauth-selector.js +206 -0
  838. package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  839. package/dist/modes/interactive/components/provider-brand.d.ts +14 -0
  840. package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
  841. package/dist/modes/interactive/components/provider-brand.js +66 -0
  842. package/dist/modes/interactive/components/provider-brand.js.map +1 -0
  843. package/dist/modes/interactive/components/radius-login-selector.d.ts +14 -0
  844. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -0
  845. package/dist/modes/interactive/components/radius-login-selector.js +55 -0
  846. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -0
  847. package/dist/modes/interactive/components/scoped-models-selector.d.ts +47 -0
  848. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  849. package/dist/modes/interactive/components/scoped-models-selector.js +345 -0
  850. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  851. package/dist/modes/interactive/components/session-selector-search.d.ts +27 -0
  852. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  853. package/dist/modes/interactive/components/session-selector-search.js +219 -0
  854. package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  855. package/dist/modes/interactive/components/session-selector.d.ts +103 -0
  856. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  857. package/dist/modes/interactive/components/session-selector.js +917 -0
  858. package/dist/modes/interactive/components/session-selector.js.map +1 -0
  859. package/dist/modes/interactive/components/settings-selector.d.ts +98 -0
  860. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  861. package/dist/modes/interactive/components/settings-selector.js +753 -0
  862. package/dist/modes/interactive/components/settings-selector.js.map +1 -0
  863. package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
  864. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
  865. package/dist/modes/interactive/components/settings-submenu.js +171 -0
  866. package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
  867. package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  868. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  869. package/dist/modes/interactive/components/show-images-selector.js +39 -0
  870. package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  871. package/dist/modes/interactive/components/skill-invocation-message.d.ts +22 -0
  872. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  873. package/dist/modes/interactive/components/skill-invocation-message.js +65 -0
  874. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  875. package/dist/modes/interactive/components/status-indicator.d.ts +30 -0
  876. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
  877. package/dist/modes/interactive/components/status-indicator.js +67 -0
  878. package/dist/modes/interactive/components/status-indicator.js.map +1 -0
  879. package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  880. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  881. package/dist/modes/interactive/components/theme-selector.js +50 -0
  882. package/dist/modes/interactive/components/theme-selector.js.map +1 -0
  883. package/dist/modes/interactive/components/themed-text.d.ts +17 -0
  884. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
  885. package/dist/modes/interactive/components/themed-text.js +29 -0
  886. package/dist/modes/interactive/components/themed-text.js.map +1 -0
  887. package/dist/modes/interactive/components/thinking-selector.d.ts +23 -0
  888. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  889. package/dist/modes/interactive/components/thinking-selector.js +113 -0
  890. package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  891. package/dist/modes/interactive/components/tool-execution.d.ts +79 -0
  892. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  893. package/dist/modes/interactive/components/tool-execution.js +338 -0
  894. package/dist/modes/interactive/components/tool-execution.js.map +1 -0
  895. package/dist/modes/interactive/components/tree-selector.d.ts +96 -0
  896. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  897. package/dist/modes/interactive/components/tree-selector.js +1255 -0
  898. package/dist/modes/interactive/components/tree-selector.js.map +1 -0
  899. package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
  900. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  901. package/dist/modes/interactive/components/trust-selector.js +91 -0
  902. package/dist/modes/interactive/components/trust-selector.js.map +1 -0
  903. package/dist/modes/interactive/components/user-message-selector.d.ts +31 -0
  904. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  905. package/dist/modes/interactive/components/user-message-selector.js +122 -0
  906. package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  907. package/dist/modes/interactive/components/user-message.d.ts +19 -0
  908. package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  909. package/dist/modes/interactive/components/user-message.js +60 -0
  910. package/dist/modes/interactive/components/user-message.js.map +1 -0
  911. package/dist/modes/interactive/components/visual-truncate.d.ts +48 -0
  912. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  913. package/dist/modes/interactive/components/visual-truncate.js +66 -0
  914. package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  915. package/dist/modes/interactive/external-editor.d.ts +13 -0
  916. package/dist/modes/interactive/external-editor.d.ts.map +1 -0
  917. package/dist/modes/interactive/external-editor.js +50 -0
  918. package/dist/modes/interactive/external-editor.js.map +1 -0
  919. package/dist/modes/interactive/interactive-mode.d.ts +542 -0
  920. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  921. package/dist/modes/interactive/interactive-mode.js +6193 -0
  922. package/dist/modes/interactive/interactive-mode.js.map +1 -0
  923. package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
  924. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
  925. package/dist/modes/interactive/model-catalog-refresh.js +34 -0
  926. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
  927. package/dist/modes/interactive/model-search.d.ts +22 -0
  928. package/dist/modes/interactive/model-search.d.ts.map +1 -0
  929. package/dist/modes/interactive/model-search.js +36 -0
  930. package/dist/modes/interactive/model-search.js.map +1 -0
  931. package/dist/modes/interactive/program-status-reporter.d.ts +34 -0
  932. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
  933. package/dist/modes/interactive/program-status-reporter.js +110 -0
  934. package/dist/modes/interactive/program-status-reporter.js.map +1 -0
  935. package/dist/modes/interactive/session-share.d.ts +18 -0
  936. package/dist/modes/interactive/session-share.d.ts.map +1 -0
  937. package/dist/modes/interactive/session-share.js +197 -0
  938. package/dist/modes/interactive/session-share.js.map +1 -0
  939. package/dist/modes/interactive/theme/dark.json +78 -0
  940. package/dist/modes/interactive/theme/light.json +78 -0
  941. package/dist/modes/interactive/theme/system-theme.d.ts +55 -0
  942. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  943. package/dist/modes/interactive/theme/system-theme.js +546 -0
  944. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  945. package/dist/modes/interactive/theme/theme-controller.d.ts +81 -0
  946. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
  947. package/dist/modes/interactive/theme/theme-controller.js +210 -0
  948. package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
  949. package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
  950. package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  951. package/dist/modes/interactive/theme/theme-schema.js +105 -0
  952. package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  953. package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
  954. package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
  955. package/dist/modes/interactive/theme/theme-tokens.js +94 -0
  956. package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
  957. package/dist/modes/interactive/theme/theme.d.ts +167 -0
  958. package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  959. package/dist/modes/interactive/theme/theme.js +920 -0
  960. package/dist/modes/interactive/theme/theme.js.map +1 -0
  961. package/dist/modes/interactive/tui-renderer.d.ts +22 -0
  962. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
  963. package/dist/modes/interactive/tui-renderer.js +67 -0
  964. package/dist/modes/interactive/tui-renderer.js.map +1 -0
  965. package/dist/modes/json-event.d.ts +34 -0
  966. package/dist/modes/json-event.d.ts.map +1 -0
  967. package/dist/modes/json-event.js +29 -0
  968. package/dist/modes/json-event.js.map +1 -0
  969. package/dist/modes/print-mode.d.ts +28 -0
  970. package/dist/modes/print-mode.d.ts.map +1 -0
  971. package/dist/modes/print-mode.js +155 -0
  972. package/dist/modes/print-mode.js.map +1 -0
  973. package/dist/modes/rpc/jsonl.d.ts +17 -0
  974. package/dist/modes/rpc/jsonl.d.ts.map +1 -0
  975. package/dist/modes/rpc/jsonl.js +49 -0
  976. package/dist/modes/rpc/jsonl.js.map +1 -0
  977. package/dist/modes/rpc/rpc-client.d.ts +254 -0
  978. package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  979. package/dist/modes/rpc/rpc-client.js +499 -0
  980. package/dist/modes/rpc/rpc-client.js.map +1 -0
  981. package/dist/modes/rpc/rpc-mode.d.ts +20 -0
  982. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  983. package/dist/modes/rpc/rpc-mode.js +677 -0
  984. package/dist/modes/rpc/rpc-mode.js.map +1 -0
  985. package/dist/modes/rpc/rpc-types.d.ts +478 -0
  986. package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  987. package/dist/modes/rpc/rpc-types.js +8 -0
  988. package/dist/modes/rpc/rpc-types.js.map +1 -0
  989. package/dist/package-manager-cli.d.ts +8 -0
  990. package/dist/package-manager-cli.d.ts.map +1 -0
  991. package/dist/package-manager-cli.js +812 -0
  992. package/dist/package-manager-cli.js.map +1 -0
  993. package/dist/rpc-entry.d.ts +3 -0
  994. package/dist/rpc-entry.d.ts.map +1 -0
  995. package/dist/rpc-entry.js +11 -0
  996. package/dist/rpc-entry.js.map +1 -0
  997. package/dist/utils/abort.d.ts +5 -0
  998. package/dist/utils/abort.d.ts.map +1 -0
  999. package/dist/utils/abort.js +48 -0
  1000. package/dist/utils/abort.js.map +1 -0
  1001. package/dist/utils/ansi.d.ts +10 -0
  1002. package/dist/utils/ansi.d.ts.map +1 -0
  1003. package/dist/utils/ansi.js +74 -0
  1004. package/dist/utils/ansi.js.map +1 -0
  1005. package/dist/utils/changelog.d.ts +22 -0
  1006. package/dist/utils/changelog.d.ts.map +1 -0
  1007. package/dist/utils/changelog.js +174 -0
  1008. package/dist/utils/changelog.js.map +1 -0
  1009. package/dist/utils/child-process.d.ts +18 -0
  1010. package/dist/utils/child-process.d.ts.map +1 -0
  1011. package/dist/utils/child-process.js +106 -0
  1012. package/dist/utils/child-process.js.map +1 -0
  1013. package/dist/utils/clipboard-command.d.ts +7 -0
  1014. package/dist/utils/clipboard-command.d.ts.map +1 -0
  1015. package/dist/utils/clipboard-command.js +52 -0
  1016. package/dist/utils/clipboard-command.js.map +1 -0
  1017. package/dist/utils/clipboard-image.d.ts +11 -0
  1018. package/dist/utils/clipboard-image.d.ts.map +1 -0
  1019. package/dist/utils/clipboard-image.js +214 -0
  1020. package/dist/utils/clipboard-image.js.map +1 -0
  1021. package/dist/utils/clipboard.d.ts +6 -0
  1022. package/dist/utils/clipboard.d.ts.map +1 -0
  1023. package/dist/utils/clipboard.js +162 -0
  1024. package/dist/utils/clipboard.js.map +1 -0
  1025. package/dist/utils/diffra-user-agent.d.ts +3 -0
  1026. package/dist/utils/diffra-user-agent.d.ts.map +1 -0
  1027. package/dist/utils/diffra-user-agent.js +6 -0
  1028. package/dist/utils/diffra-user-agent.js.map +1 -0
  1029. package/dist/utils/exif-orientation.d.ts +5 -0
  1030. package/dist/utils/exif-orientation.d.ts.map +1 -0
  1031. package/dist/utils/exif-orientation.js +157 -0
  1032. package/dist/utils/exif-orientation.js.map +1 -0
  1033. package/dist/utils/flush-stdout.d.ts +8 -0
  1034. package/dist/utils/flush-stdout.d.ts.map +1 -0
  1035. package/dist/utils/flush-stdout.js +23 -0
  1036. package/dist/utils/flush-stdout.js.map +1 -0
  1037. package/dist/utils/frontmatter.d.ts +8 -0
  1038. package/dist/utils/frontmatter.d.ts.map +1 -0
  1039. package/dist/utils/frontmatter.js +27 -0
  1040. package/dist/utils/frontmatter.js.map +1 -0
  1041. package/dist/utils/fs-watch.d.ts +5 -0
  1042. package/dist/utils/fs-watch.d.ts.map +1 -0
  1043. package/dist/utils/fs-watch.js +25 -0
  1044. package/dist/utils/fs-watch.js.map +1 -0
  1045. package/dist/utils/git.d.ts +26 -0
  1046. package/dist/utils/git.d.ts.map +1 -0
  1047. package/dist/utils/git.js +195 -0
  1048. package/dist/utils/git.js.map +1 -0
  1049. package/dist/utils/html.d.ts +7 -0
  1050. package/dist/utils/html.d.ts.map +1 -0
  1051. package/dist/utils/html.js +40 -0
  1052. package/dist/utils/html.js.map +1 -0
  1053. package/dist/utils/image-convert.d.ts +22 -0
  1054. package/dist/utils/image-convert.d.ts.map +1 -0
  1055. package/dist/utils/image-convert.js +84 -0
  1056. package/dist/utils/image-convert.js.map +1 -0
  1057. package/dist/utils/image-process.d.ts +18 -0
  1058. package/dist/utils/image-process.d.ts.map +1 -0
  1059. package/dist/utils/image-process.js +83 -0
  1060. package/dist/utils/image-process.js.map +1 -0
  1061. package/dist/utils/image-resize-core.d.ts +42 -0
  1062. package/dist/utils/image-resize-core.d.ts.map +1 -0
  1063. package/dist/utils/image-resize-core.js +131 -0
  1064. package/dist/utils/image-resize-core.js.map +1 -0
  1065. package/dist/utils/image-resize-worker.d.ts +2 -0
  1066. package/dist/utils/image-resize-worker.d.ts.map +1 -0
  1067. package/dist/utils/image-resize-worker.js +32 -0
  1068. package/dist/utils/image-resize-worker.js.map +1 -0
  1069. package/dist/utils/image-resize.d.ts +16 -0
  1070. package/dist/utils/image-resize.d.ts.map +1 -0
  1071. package/dist/utils/image-resize.js +98 -0
  1072. package/dist/utils/image-resize.js.map +1 -0
  1073. package/dist/utils/json.d.ts +3 -0
  1074. package/dist/utils/json.d.ts.map +1 -0
  1075. package/dist/utils/json.js +7 -0
  1076. package/dist/utils/json.js.map +1 -0
  1077. package/dist/utils/management-http.d.ts +25 -0
  1078. package/dist/utils/management-http.d.ts.map +1 -0
  1079. package/dist/utils/management-http.js +54 -0
  1080. package/dist/utils/management-http.js.map +1 -0
  1081. package/dist/utils/mime.d.ts +3 -0
  1082. package/dist/utils/mime.d.ts.map +1 -0
  1083. package/dist/utils/mime.js +110 -0
  1084. package/dist/utils/mime.js.map +1 -0
  1085. package/dist/utils/open-browser.d.ts +9 -0
  1086. package/dist/utils/open-browser.d.ts.map +1 -0
  1087. package/dist/utils/open-browser.js +25 -0
  1088. package/dist/utils/open-browser.js.map +1 -0
  1089. package/dist/utils/output-files.d.ts +15 -0
  1090. package/dist/utils/output-files.d.ts.map +1 -0
  1091. package/dist/utils/output-files.js +30 -0
  1092. package/dist/utils/output-files.js.map +1 -0
  1093. package/dist/utils/paths.d.ts +51 -0
  1094. package/dist/utils/paths.d.ts.map +1 -0
  1095. package/dist/utils/paths.js +156 -0
  1096. package/dist/utils/paths.js.map +1 -0
  1097. package/dist/utils/photon.d.ts +21 -0
  1098. package/dist/utils/photon.d.ts.map +1 -0
  1099. package/dist/utils/photon.js +121 -0
  1100. package/dist/utils/photon.js.map +1 -0
  1101. package/dist/utils/shell.d.ts +33 -0
  1102. package/dist/utils/shell.d.ts.map +1 -0
  1103. package/dist/utils/shell.js +254 -0
  1104. package/dist/utils/shell.js.map +1 -0
  1105. package/dist/utils/sleep.d.ts +5 -0
  1106. package/dist/utils/sleep.d.ts.map +1 -0
  1107. package/dist/utils/sleep.js +17 -0
  1108. package/dist/utils/sleep.js.map +1 -0
  1109. package/dist/utils/syntax-highlight.d.ts +18 -0
  1110. package/dist/utils/syntax-highlight.d.ts.map +1 -0
  1111. package/dist/utils/syntax-highlight.js +191 -0
  1112. package/dist/utils/syntax-highlight.js.map +1 -0
  1113. package/dist/utils/terminal-question.d.ts +8 -0
  1114. package/dist/utils/terminal-question.d.ts.map +1 -0
  1115. package/dist/utils/terminal-question.js +24 -0
  1116. package/dist/utils/terminal-question.js.map +1 -0
  1117. package/dist/utils/text.d.ts +8 -0
  1118. package/dist/utils/text.d.ts.map +1 -0
  1119. package/dist/utils/text.js +9 -0
  1120. package/dist/utils/text.js.map +1 -0
  1121. package/dist/utils/tool-result-images.d.ts +21 -0
  1122. package/dist/utils/tool-result-images.d.ts.map +1 -0
  1123. package/dist/utils/tool-result-images.js +48 -0
  1124. package/dist/utils/tool-result-images.js.map +1 -0
  1125. package/dist/utils/tools-manager.d.ts +13 -0
  1126. package/dist/utils/tools-manager.d.ts.map +1 -0
  1127. package/dist/utils/tools-manager.js +339 -0
  1128. package/dist/utils/tools-manager.js.map +1 -0
  1129. package/dist/utils/version-check.d.ts +17 -0
  1130. package/dist/utils/version-check.d.ts.map +1 -0
  1131. package/dist/utils/version-check.js +75 -0
  1132. package/dist/utils/version-check.js.map +1 -0
  1133. package/dist/utils/web-url.d.ts +12 -0
  1134. package/dist/utils/web-url.d.ts.map +1 -0
  1135. package/dist/utils/web-url.js +20 -0
  1136. package/dist/utils/web-url.js.map +1 -0
  1137. package/dist/utils/windows-self-update.d.ts +3 -0
  1138. package/dist/utils/windows-self-update.d.ts.map +1 -0
  1139. package/dist/utils/windows-self-update.js +77 -0
  1140. package/dist/utils/windows-self-update.js.map +1 -0
  1141. package/dist/utils/wsl.d.ts +3 -0
  1142. package/dist/utils/wsl.d.ts.map +1 -0
  1143. package/dist/utils/wsl.js +15 -0
  1144. package/dist/utils/wsl.js.map +1 -0
  1145. package/dist/utils/zip.d.ts +7 -0
  1146. package/dist/utils/zip.d.ts.map +1 -0
  1147. package/dist/utils/zip.js +60 -0
  1148. package/dist/utils/zip.js.map +1 -0
  1149. package/docs/cli-integration.md +106 -0
  1150. package/docs/cli.md +356 -0
  1151. package/docs/codemode.md +230 -0
  1152. package/docs/compaction.md +463 -0
  1153. package/docs/configuration.md +47 -0
  1154. package/docs/containerization.md +183 -0
  1155. package/docs/custom-provider.md +227 -0
  1156. package/docs/docs.json +220 -0
  1157. package/docs/environment-variables.md +103 -0
  1158. package/docs/extensions.md +3367 -0
  1159. package/docs/how-diffra-works.md +49 -0
  1160. package/docs/images/doom-extension.png +0 -0
  1161. package/docs/images/exy.png +0 -0
  1162. package/docs/images/interactive-mode.png +0 -0
  1163. package/docs/images/tree-view.png +0 -0
  1164. package/docs/index.md +39 -0
  1165. package/docs/json.md +226 -0
  1166. package/docs/keybindings.md +195 -0
  1167. package/docs/llama-cpp.md +129 -0
  1168. package/docs/mcp.md +274 -0
  1169. package/docs/message-types.md +279 -0
  1170. package/docs/models-configuration.md +210 -0
  1171. package/docs/models.md +226 -0
  1172. package/docs/nvidia-rtx-llama-cpp.md +96 -0
  1173. package/docs/packages.md +153 -0
  1174. package/docs/prompt-templates.md +59 -0
  1175. package/docs/providers.md +249 -0
  1176. package/docs/quickstart.md +112 -0
  1177. package/docs/rpc-commands.md +860 -0
  1178. package/docs/rpc-extension-ui.md +200 -0
  1179. package/docs/rpc.md +195 -0
  1180. package/docs/sdk.md +147 -0
  1181. package/docs/security.md +99 -0
  1182. package/docs/session-format.md +293 -0
  1183. package/docs/sessions.md +80 -0
  1184. package/docs/settings.md +173 -0
  1185. package/docs/shell-aliases.md +93 -0
  1186. package/docs/skills.md +93 -0
  1187. package/docs/slash-commands.md +61 -0
  1188. package/docs/terminal-setup.md +235 -0
  1189. package/docs/termux.md +117 -0
  1190. package/docs/themes.md +138 -0
  1191. package/docs/tmux.md +61 -0
  1192. package/docs/tui.md +199 -0
  1193. package/docs/usage.md +94 -0
  1194. package/docs/virtual-models.md +114 -0
  1195. package/docs/windows.md +108 -0
  1196. package/examples/README.md +36 -0
  1197. package/examples/extensions/README.md +215 -0
  1198. package/examples/extensions/auto-commit-on-exit.ts +49 -0
  1199. package/examples/extensions/bash-spawn-hook.ts +30 -0
  1200. package/examples/extensions/bookmark.ts +50 -0
  1201. package/examples/extensions/border-status-editor.ts +145 -0
  1202. package/examples/extensions/built-in-tool-renderer.ts +225 -0
  1203. package/examples/extensions/claude-rules.ts +86 -0
  1204. package/examples/extensions/commands.ts +72 -0
  1205. package/examples/extensions/confirm-destructive.ts +59 -0
  1206. package/examples/extensions/custom-compaction.ts +117 -0
  1207. package/examples/extensions/custom-footer.ts +64 -0
  1208. package/examples/extensions/custom-header.ts +73 -0
  1209. package/examples/extensions/custom-provider-anthropic/index.ts +613 -0
  1210. package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  1211. package/examples/extensions/custom-provider-anthropic/package.json +19 -0
  1212. package/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
  1213. package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  1214. package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
  1215. package/examples/extensions/debug-provider.ts +90 -0
  1216. package/examples/extensions/dirty-repo-guard.ts +56 -0
  1217. package/examples/extensions/doom-overlay/README.md +46 -0
  1218. package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
  1219. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  1220. package/examples/extensions/doom-overlay/doom/build.sh +152 -0
  1221. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  1222. package/examples/extensions/doom-overlay/doom-component.ts +132 -0
  1223. package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
  1224. package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
  1225. package/examples/extensions/doom-overlay/index.ts +74 -0
  1226. package/examples/extensions/doom-overlay/wad-finder.ts +55 -0
  1227. package/examples/extensions/dynamic-resources/SKILL.md +8 -0
  1228. package/examples/extensions/dynamic-resources/dynamic.json +81 -0
  1229. package/examples/extensions/dynamic-resources/dynamic.md +5 -0
  1230. package/examples/extensions/dynamic-resources/index.ts +15 -0
  1231. package/examples/extensions/dynamic-tools.ts +74 -0
  1232. package/examples/extensions/entry-renderer.ts +41 -0
  1233. package/examples/extensions/event-bus.ts +43 -0
  1234. package/examples/extensions/file-trigger.ts +41 -0
  1235. package/examples/extensions/git-checkpoint.ts +53 -0
  1236. package/examples/extensions/git-merge-and-resolve.ts +115 -0
  1237. package/examples/extensions/github-issue-autocomplete.ts +185 -0
  1238. package/examples/extensions/gondolin/index.ts +528 -0
  1239. package/examples/extensions/gondolin/package-lock.json +175 -0
  1240. package/examples/extensions/gondolin/package.json +19 -0
  1241. package/examples/extensions/handoff.ts +190 -0
  1242. package/examples/extensions/hello.ts +26 -0
  1243. package/examples/extensions/hidden-thinking-label.ts +53 -0
  1244. package/examples/extensions/inline-bash.ts +94 -0
  1245. package/examples/extensions/input-transform-streaming.ts +39 -0
  1246. package/examples/extensions/input-transform.ts +43 -0
  1247. package/examples/extensions/interactive-shell.ts +196 -0
  1248. package/examples/extensions/jev-router.ts +113 -0
  1249. package/examples/extensions/mac-system-theme.ts +47 -0
  1250. package/examples/extensions/message-renderer.ts +59 -0
  1251. package/examples/extensions/minimal-mode.ts +353 -0
  1252. package/examples/extensions/modal-editor.ts +85 -0
  1253. package/examples/extensions/model-status.ts +31 -0
  1254. package/examples/extensions/notify.ts +57 -0
  1255. package/examples/extensions/overlay-qa-tests.ts +1450 -0
  1256. package/examples/extensions/overlay-test.ts +153 -0
  1257. package/examples/extensions/permission-gate.ts +34 -0
  1258. package/examples/extensions/pirate.ts +47 -0
  1259. package/examples/extensions/plan-mode/README.md +66 -0
  1260. package/examples/extensions/plan-mode/index.ts +404 -0
  1261. package/examples/extensions/plan-mode/utils.ts +194 -0
  1262. package/examples/extensions/preset.ts +438 -0
  1263. package/examples/extensions/project-trust.ts +64 -0
  1264. package/examples/extensions/prompt-customizer.ts +49 -0
  1265. package/examples/extensions/protected-paths.ts +30 -0
  1266. package/examples/extensions/provider-payload.ts +18 -0
  1267. package/examples/extensions/qna.ts +118 -0
  1268. package/examples/extensions/question.ts +278 -0
  1269. package/examples/extensions/questionnaire.ts +440 -0
  1270. package/examples/extensions/rainbow-editor.ts +88 -0
  1271. package/examples/extensions/reload-runtime.ts +49 -0
  1272. package/examples/extensions/rpc-demo.ts +118 -0
  1273. package/examples/extensions/send-user-message.ts +97 -0
  1274. package/examples/extensions/session-name.ts +27 -0
  1275. package/examples/extensions/shutdown-command.ts +63 -0
  1276. package/examples/extensions/snake.ts +343 -0
  1277. package/examples/extensions/space-invaders.ts +560 -0
  1278. package/examples/extensions/ssh.ts +220 -0
  1279. package/examples/extensions/status-line.ts +32 -0
  1280. package/examples/extensions/structured-output.ts +65 -0
  1281. package/examples/extensions/subagent/README.md +180 -0
  1282. package/examples/extensions/subagent/agents/planner.md +37 -0
  1283. package/examples/extensions/subagent/agents/reviewer.md +35 -0
  1284. package/examples/extensions/subagent/agents/scout.md +50 -0
  1285. package/examples/extensions/subagent/agents/worker.md +24 -0
  1286. package/examples/extensions/subagent/agents.ts +157 -0
  1287. package/examples/extensions/subagent/index.ts +1257 -0
  1288. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  1289. package/examples/extensions/subagent/prompts/implement.md +10 -0
  1290. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  1291. package/examples/extensions/summarize.ts +199 -0
  1292. package/examples/extensions/system-prompt-header.ts +17 -0
  1293. package/examples/extensions/tic-tac-toe.ts +1008 -0
  1294. package/examples/extensions/timed-confirm.ts +70 -0
  1295. package/examples/extensions/titlebar-spinner.ts +58 -0
  1296. package/examples/extensions/todo.ts +304 -0
  1297. package/examples/extensions/tool-override.ts +144 -0
  1298. package/examples/extensions/tools.ts +148 -0
  1299. package/examples/extensions/trigger-compact.ts +50 -0
  1300. package/examples/extensions/truncated-tool.ts +195 -0
  1301. package/examples/extensions/widget-placement.ts +9 -0
  1302. package/examples/extensions/with-deps/index.ts +32 -0
  1303. package/examples/extensions/with-deps/package-lock.json +31 -0
  1304. package/examples/extensions/with-deps/package.json +22 -0
  1305. package/examples/extensions/working-indicator.ts +123 -0
  1306. package/examples/extensions/working-message-test.ts +25 -0
  1307. package/examples/rpc-client.ts +35 -0
  1308. package/examples/rpc-extension-ui.ts +661 -0
  1309. package/examples/sdk/01-minimal.ts +26 -0
  1310. package/examples/sdk/02-custom-model.ts +49 -0
  1311. package/examples/sdk/03-custom-prompt.ts +70 -0
  1312. package/examples/sdk/04-skills.ts +55 -0
  1313. package/examples/sdk/05-tools.ts +48 -0
  1314. package/examples/sdk/06-extensions.ts +94 -0
  1315. package/examples/sdk/07-context-files.ts +42 -0
  1316. package/examples/sdk/08-prompt-templates.ts +51 -0
  1317. package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
  1318. package/examples/sdk/10-settings.ts +53 -0
  1319. package/examples/sdk/11-sessions.ts +52 -0
  1320. package/examples/sdk/12-full-control.ts +74 -0
  1321. package/examples/sdk/13-session-runtime.ts +67 -0
  1322. package/examples/sdk/14-codemode-mcp.ts +61 -0
  1323. package/examples/sdk/README.md +141 -0
  1324. package/examples/tsconfig.json +205 -0
  1325. package/package.json +96 -5
  1326. package/schemas/keybindings.schema.json +393 -0
  1327. package/schemas/models.schema.json +1240 -0
  1328. package/schemas/settings.schema.json +800 -0
  1329. package/schemas/theme.schema.json +365 -0
@@ -0,0 +1,1145 @@
1
+ import { backgroundAnsi, colorToRgb, foregroundAnsi, getKeybindings, indexedColor, rgbColor, visibleWidth, } from "@diffra-ai/tui";
2
+ import { theme } from "../theme/theme.js";
3
+ import { ARMIN_HEIGHT, ARMIN_WIDTH, isArminPixel } from "./armin.js";
4
+ import { DIFFRA_LOGO_HEIGHT, DIFFRA_LOGO_WIDTH, diffraLogoPixel } from "./diffra-logo.js";
5
+ import { formatKeyText } from "./keybinding-hints.js";
6
+ const DEPTH = 0.7;
7
+ const FLY_START = 0.1;
8
+ const FLY_DURATION = 1.3;
9
+ /** Braille dots per pixel when a model without an origin appears, growing from a speck at the center. */
10
+ const START_SCALE = 0.1;
11
+ function createModel(columns, rows, pixel, options) {
12
+ const blocks = [];
13
+ for (let row = 0; row < rows; row++) {
14
+ for (let column = 0; column < columns; column++) {
15
+ const color = pixel(column, row);
16
+ if (color)
17
+ blocks.push({ home: [column, row, 0], color });
18
+ }
19
+ }
20
+ return {
21
+ columns,
22
+ rows,
23
+ blocks,
24
+ cameraDistance: options.cameraDistance,
25
+ radius: Math.hypot(columns / 2, rows / 2, 1 + DEPTH / 2),
26
+ widthShare: options.widthShare,
27
+ puzzleMoves: (random) => options.puzzleMoves(random, blocks.length),
28
+ origin: options.origin,
29
+ };
30
+ }
31
+ function diffraLogoRgb(column, row) {
32
+ const color = diffraLogoPixel(column, row);
33
+ if (!color)
34
+ return undefined;
35
+ const { r, g, b } = colorToRgb(color);
36
+ return [Math.round(r), Math.round(g), Math.round(b)];
37
+ }
38
+ function diffraLogoModel(origin) {
39
+ return createModel(DIFFRA_LOGO_WIDTH, DIFFRA_LOGO_HEIGHT, diffraLogoRgb, {
40
+ // Far enough that the perspective stays mild for a wordmark about 47 blocks wide.
41
+ cameraDistance: 80,
42
+ widthShare: 0.6,
43
+ puzzleMoves: (random, blockCount) => Math.round(blockCount * (0.03 + random * 0.04)),
44
+ origin,
45
+ });
46
+ }
47
+ function arminModel(color) {
48
+ return createModel(ARMIN_WIDTH, ARMIN_HEIGHT, (column, row) => (isArminPixel(column, row) ? color : undefined), {
49
+ // Far enough that the perspective stays mild for a figure about 36 blocks tall.
50
+ cameraDistance: 80,
51
+ widthShare: 0.45,
52
+ puzzleMoves: (random, blockCount) => Math.round(blockCount * (0.03 + random * 0.04)),
53
+ origin: undefined,
54
+ });
55
+ }
56
+ // The sliding puzzle: after the model spun for a while, blocks slide into free neighboring cells, a few at a time.
57
+ // Each cycle shuffles, flies every block back home, and holds the model briefly.
58
+ const PUZZLE_START = FLY_START + FLY_DURATION + 3;
59
+ const PUZZLE_STEP = 0.3;
60
+ const PUZZLE_STEPS = 12;
61
+ const PUZZLE_RETURN = 1;
62
+ const PUZZLE_HOLD = 0.6;
63
+ const PUZZLE_CYCLE = PUZZLE_STEP * PUZZLE_STEPS + PUZZLE_RETURN + PUZZLE_HOLD;
64
+ const PUZZLE_MOVES = [
65
+ [1, 0, 0],
66
+ [-1, 0, 0],
67
+ [0, 1, 0],
68
+ [0, -1, 0],
69
+ [1, 0, 0],
70
+ [-1, 0, 0],
71
+ [0, 1, 0],
72
+ [0, -1, 0],
73
+ [0, 0, 1],
74
+ [0, 0, -1],
75
+ ];
76
+ /** Block positions after each step of one shuffle cycle, starting at home. Deterministic per cycle. */
77
+ function shuffleSteps(model, cycle) {
78
+ const { columns, rows } = model;
79
+ let positions = model.blocks.map((block) => block.home);
80
+ const steps = [positions];
81
+ const lastMoved = new Set();
82
+ let random = cycle * 7_919 + 1;
83
+ const next = () => hash(random++);
84
+ const key = ([x, y, z]) => ((z + 1) * rows + y) * columns + x;
85
+ for (let step = 0; step < PUZZLE_STEPS; step++) {
86
+ const occupied = new Set(positions.map(key));
87
+ const nextPositions = [...positions];
88
+ const moved = new Set();
89
+ const moveCount = model.puzzleMoves(next());
90
+ for (let move = 0; move < moveCount; move++) {
91
+ const candidates = [];
92
+ for (let block = 0; block < positions.length; block++) {
93
+ if (moved.has(block))
94
+ continue;
95
+ const [x, y, z] = positions[block];
96
+ for (const [dx, dy, dz] of PUZZLE_MOVES) {
97
+ const target = [x + dx, y + dy, z + dz];
98
+ if (target[0] < 0 || target[0] >= columns || target[1] < 0 || target[1] >= rows)
99
+ continue;
100
+ if (target[2] < -1 || target[2] > 1 || occupied.has(key(target)))
101
+ continue;
102
+ candidates.push({ block, target });
103
+ }
104
+ }
105
+ // Prefer blocks that did not just move, so the puzzle does not look like one block jittering.
106
+ const fresh = candidates.filter((candidate) => !lastMoved.has(candidate.block));
107
+ const pool = fresh.length > 0 ? fresh : candidates;
108
+ const choice = pool[Math.floor(next() * pool.length)];
109
+ if (!choice)
110
+ break;
111
+ occupied.add(key(choice.target));
112
+ nextPositions[choice.block] = choice.target;
113
+ moved.add(choice.block);
114
+ }
115
+ lastMoved.clear();
116
+ for (const block of moved)
117
+ lastMoved.add(block);
118
+ positions = nextPositions;
119
+ steps.push(positions);
120
+ }
121
+ return steps;
122
+ }
123
+ const FRAME_MS = 1000 / 30;
124
+ const DUST_DURATION = 0.35;
125
+ const WAVE_SPREAD = 0.55;
126
+ const WAVE_JITTER = 0.12;
127
+ const DISSOLVE_END = FLY_START + WAVE_SPREAD + WAVE_JITTER + DUST_DURATION;
128
+ const BACKGROUND_FADE = 0.5;
129
+ const EXIT_DURATION = 1.1;
130
+ // A faint starfield fades in behind the logo once the screen has dissolved.
131
+ const STARS_START = 2.5;
132
+ const STARS_FADE = 2;
133
+ const STAR_DENSITY = 0.018;
134
+ // Star tints: neutral, pale blue, pale gold, and pale rose, each mixed half with the terminal's foreground.
135
+ const STAR_TINTS = [
136
+ [255, 255, 255],
137
+ [170, 195, 255],
138
+ [255, 225, 170],
139
+ [255, 190, 205],
140
+ ];
141
+ const LOGO_COLOR_STEP = 5;
142
+ // On light backgrounds most of each braille cell shows the bright background, which washes the logo out. There,
143
+ // the logo gets a halo: its colors and coverage blurred into the cell backgrounds, strongest under the logo and
144
+ // fading out over HALO_RADIUS_X columns and HALO_RADIUS_Y rows (cells are about twice as tall as wide).
145
+ const LIGHT_HALO_STRENGTH = 0.3;
146
+ const HALO_RADIUS_X = 6;
147
+ const HALO_RADIUS_Y = 3;
148
+ const HALO_LEVELS = 32;
149
+ const STAR_ALPHA_LEVELS = 8;
150
+ const STAR_FLICKER_LEVELS = 3;
151
+ const HINT_FADE = 0.5;
152
+ // Braille dot bits, indexed by row * 2 + column within the 2x4 cell.
153
+ const DOT_BITS = [0x01, 0x08, 0x02, 0x10, 0x04, 0x20, 0x40, 0x80];
154
+ const BRAILLE = Array.from({ length: 256 }, (_, bits) => String.fromCharCode(0x2800 + bits));
155
+ const LIGHT = normalize([-0.45, -0.6, 0.75]);
156
+ const HALF_VECTOR = normalize([LIGHT[0], LIGHT[1], LIGHT[2] + 1]);
157
+ function normalize(v) {
158
+ const length = Math.hypot(v[0], v[1], v[2]);
159
+ return [v[0] / length, v[1] / length, v[2] / length];
160
+ }
161
+ function clamp01(value) {
162
+ return value < 0 ? 0 : value > 1 ? 1 : value;
163
+ }
164
+ /** Quintic smoothstep. */
165
+ function smooth(value) {
166
+ const t = clamp01(value);
167
+ return t * t * t * (t * (t * 6 - 15) + 10);
168
+ }
169
+ function easeOut(value) {
170
+ const t = 1 - clamp01(value);
171
+ return 1 - t * t * t;
172
+ }
173
+ function mix(a, b, amount) {
174
+ return [a[0] + (b[0] - a[0]) * amount, a[1] + (b[1] - a[1]) * amount, a[2] + (b[2] - a[2]) * amount];
175
+ }
176
+ function hash(value) {
177
+ let x = Math.imul(value ^ 0x9e3779b9, 0x85ebca6b);
178
+ x ^= x >>> 13;
179
+ x = Math.imul(x, 0xc2b2ae35);
180
+ x ^= x >>> 16;
181
+ return (x >>> 0) / 0x100000000;
182
+ }
183
+ /** Whether a background is light, by relative luminance. */
184
+ function isLight([r, g, b]) {
185
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b > 128;
186
+ }
187
+ function toRgb(color) {
188
+ const { r, g, b } = colorToRgb(color);
189
+ return [r, g, b];
190
+ }
191
+ /** Braille dots a glyph turns into, a rough measure of how much ink it has. */
192
+ function glyphInk(text, seed) {
193
+ if (text.trim() === "")
194
+ return 0;
195
+ if (/^[.,:;'`\-_·]$/.test(text))
196
+ return 2;
197
+ if (/^[\u2500-\u257f]$/.test(text))
198
+ return 3;
199
+ return 4 + Math.floor(seed * 3);
200
+ }
201
+ const segmenter = new Intl.Segmenter();
202
+ /** Parse rendered lines into cells with resolved colors. Other escape sequences (OSC, APC, cursor) are skipped. */
203
+ function parseScreen(lines, width, foreground, background) {
204
+ const palette = (index) => toRgb(indexedColor(index));
205
+ return lines.map((line) => {
206
+ const cells = [];
207
+ let fg;
208
+ let bg;
209
+ let dim = false;
210
+ let inverse = false;
211
+ const applySgr = (params) => {
212
+ const codes = params === "" ? ["0"] : params.split(";");
213
+ for (let i = 0; i < codes.length; i++) {
214
+ const parts = codes[i].split(":").map((part) => Number.parseInt(part, 10));
215
+ const code = parts[0] ?? 0;
216
+ if (code === 38 || code === 48) {
217
+ // Extended color, either as `38;5;n` / `38;2;r;g;b` or colon sub-parameters.
218
+ let args;
219
+ if (parts.length > 1) {
220
+ args = parts.slice(1).filter((part) => !Number.isNaN(part));
221
+ // `38:2::r:g:b` has an empty color space id, dropped above.
222
+ }
223
+ else {
224
+ const kind = Number.parseInt(codes[i + 1] ?? "", 10);
225
+ const count = kind === 5 ? 2 : kind === 2 ? 4 : 1;
226
+ args = codes.slice(i + 1, i + 1 + count).map((part) => Number.parseInt(part, 10));
227
+ i += count;
228
+ }
229
+ let color;
230
+ if (args[0] === 5 && args[1] !== undefined)
231
+ color = palette(args[1]);
232
+ else if (args[0] === 2 && args.length >= 4)
233
+ color = [args[1], args[2], args[3]];
234
+ if (color) {
235
+ if (code === 38)
236
+ fg = color;
237
+ else
238
+ bg = color;
239
+ }
240
+ }
241
+ else if (code === 0) {
242
+ fg = undefined;
243
+ bg = undefined;
244
+ dim = false;
245
+ inverse = false;
246
+ }
247
+ else if (code === 2)
248
+ dim = true;
249
+ else if (code === 22)
250
+ dim = false;
251
+ else if (code === 7)
252
+ inverse = true;
253
+ else if (code === 27)
254
+ inverse = false;
255
+ else if (code >= 30 && code <= 37)
256
+ fg = palette(code - 30);
257
+ else if (code >= 90 && code <= 97)
258
+ fg = palette(code - 90 + 8);
259
+ else if (code === 39)
260
+ fg = undefined;
261
+ else if (code >= 40 && code <= 47)
262
+ bg = palette(code - 40);
263
+ else if (code >= 100 && code <= 107)
264
+ bg = palette(code - 100 + 8);
265
+ else if (code === 49)
266
+ bg = undefined;
267
+ }
268
+ };
269
+ const pushText = (text) => {
270
+ for (const { segment } of segmenter.segment(text)) {
271
+ const glyphWidth = visibleWidth(segment);
272
+ if (glyphWidth === 0 || cells.length + glyphWidth > width)
273
+ continue;
274
+ let cellFg = fg ?? foreground;
275
+ let cellBg = bg;
276
+ if (inverse) {
277
+ cellFg = bg ?? background;
278
+ cellBg = fg ?? foreground;
279
+ }
280
+ if (dim)
281
+ cellFg = mix(cellFg, cellBg ?? background, 0.4);
282
+ const cell = { text: segment, width: glyphWidth, fg: cellFg, bg: cellBg, delay: 0, ink: 0, seed: 0 };
283
+ cells.push(cell);
284
+ if (glyphWidth === 2)
285
+ cells.push({ ...cell, text: "", width: 0 });
286
+ }
287
+ };
288
+ let i = 0;
289
+ while (i < line.length) {
290
+ const sequenceStart = line.indexOf("\x1b", i);
291
+ if (sequenceStart === -1) {
292
+ pushText(line.slice(i));
293
+ break;
294
+ }
295
+ if (sequenceStart > i)
296
+ pushText(line.slice(i, sequenceStart));
297
+ const kind = line[sequenceStart + 1];
298
+ if (kind === "[") {
299
+ let end = sequenceStart + 2;
300
+ while (end < line.length && (line.charCodeAt(end) < 0x40 || line.charCodeAt(end) > 0x7e))
301
+ end++;
302
+ if (line[end] === "m")
303
+ applySgr(line.slice(sequenceStart + 2, end));
304
+ i = end + 1;
305
+ }
306
+ else if (kind === "]" || kind === "_" || kind === "P" || kind === "^") {
307
+ // String sequences end at BEL or ST (ESC \).
308
+ const bell = line.indexOf("\x07", sequenceStart + 2);
309
+ const st = line.indexOf("\x1b\\", sequenceStart + 2);
310
+ if (bell === -1 && st === -1)
311
+ break;
312
+ i = bell !== -1 && (st === -1 || bell < st) ? bell + 1 : st + 2;
313
+ }
314
+ else {
315
+ i = sequenceStart + 2;
316
+ }
317
+ }
318
+ return cells;
319
+ });
320
+ }
321
+ /** Row-major 3x3 rotation matrix for yaw (y), then pitch (x), then roll (z). */
322
+ function rotation(yaw, pitch, roll) {
323
+ const [sy, cy, sx, cx, sz, cz] = [
324
+ Math.sin(yaw),
325
+ Math.cos(yaw),
326
+ Math.sin(pitch),
327
+ Math.cos(pitch),
328
+ Math.sin(roll),
329
+ Math.cos(roll),
330
+ ];
331
+ // Rz * Rx * Ry
332
+ const ry = [cy, 0, sy, 0, 1, 0, -sy, 0, cy];
333
+ const rx = [1, 0, 0, 0, cx, -sx, 0, sx, cx];
334
+ const rz = [cz, -sz, 0, sz, cz, 0, 0, 0, 1];
335
+ return multiply(rz, multiply(rx, ry));
336
+ }
337
+ function multiply(a, b) {
338
+ const result = new Array(9);
339
+ for (let row = 0; row < 3; row++) {
340
+ for (let column = 0; column < 3; column++) {
341
+ result[row * 3 + column] =
342
+ a[row * 3] * b[column] + a[row * 3 + 1] * b[3 + column] + a[row * 3 + 2] * b[6 + column];
343
+ }
344
+ }
345
+ return result;
346
+ }
347
+ // The spin is locked to the puzzle: one turn per cycle, facing the camera in the middle of each hold.
348
+ const SPIN_RAMP = 1.4;
349
+ const SPIN_SPEED = (Math.PI * 2) / PUZZLE_CYCLE;
350
+ // How much the spin slows down while facing the camera (and speeds up while facing away), from 0 to 1.
351
+ const SPIN_LINGER = 0.6;
352
+ const FIRST_FRONT_VIEW = PUZZLE_START + PUZZLE_STEP * PUZZLE_STEPS + PUZZLE_RETURN + PUZZLE_HOLD / 2;
353
+ /** Uniform spin that accelerates from rest over SPIN_RAMP, then turns at SPIN_SPEED. */
354
+ function baseSpinPhase(time) {
355
+ const elapsed = time - FLY_START;
356
+ if (elapsed <= 0)
357
+ return 0;
358
+ const u = elapsed / SPIN_RAMP;
359
+ // Integral of the quintic smoothstep ramp.
360
+ if (u < 1)
361
+ return SPIN_SPEED * SPIN_RAMP * (u ** 6 - 3 * u ** 5 + 2.5 * u ** 4);
362
+ return SPIN_SPEED * (SPIN_RAMP * 0.5 + elapsed - SPIN_RAMP);
363
+ }
364
+ // Extra rotation added during the flight, so the phase is a whole number of turns at every assembled front view.
365
+ const SPIN_ALIGNMENT = Math.PI * 2 - (baseSpinPhase(FIRST_FRONT_VIEW) % (Math.PI * 2));
366
+ /** Spin phase: whole turns exactly when the reassembled logo faces the camera. */
367
+ function spinPhase(time) {
368
+ return baseSpinPhase(time) + SPIN_ALIGNMENT * smooth((time - FLY_START) / FLY_DURATION);
369
+ }
370
+ /** Yaw of the logo. It matches the phase at whole turns but lingers there, so the logo reads from the front. */
371
+ function spinAngle(time) {
372
+ const phase = spinPhase(time);
373
+ return phase - SPIN_LINGER * Math.sin(phase);
374
+ }
375
+ /**
376
+ * Renders the model's blocks into braille cells. Only faces that point at the camera and are not covered by a
377
+ * touching block are drawn. Each face is rasterized over its projected bounds by intersecting each dot's ray
378
+ * with the face's plane, with a depth buffer resolving overlaps. Buffers are reused between frames.
379
+ */
380
+ class BlockRaster {
381
+ /** Braille dot bits per cell. */
382
+ bits = new Uint8Array(0);
383
+ /** Lit dots per cell. */
384
+ counts = new Uint8Array(0);
385
+ /** Summed RGB of the lit dots per cell. */
386
+ rgb = new Float32Array(0);
387
+ /** Halo tint strength per cell, from 0 to 1. Only set when a halo was requested. */
388
+ haloAmount = new Float32Array(0);
389
+ /** Halo color per cell. */
390
+ haloRgb = new Float32Array(0);
391
+ width = 0;
392
+ height = 0;
393
+ /** Ray parameter of the nearest hit per dot; smaller is nearer. */
394
+ depth = new Float32Array(0);
395
+ /** Face index + 1 of the nearest hit per dot, 0 for none. */
396
+ faceIds = new Uint16Array(0);
397
+ /** Cells written by the previous frame, cleared before the next one. */
398
+ dirty;
399
+ /** Cells with a halo from the previous frame, cleared before the next one. */
400
+ haloDirty;
401
+ cameraDistance;
402
+ constructor(cameraDistance) {
403
+ this.cameraDistance = cameraDistance;
404
+ }
405
+ render(width, height, pose, boxes, background, haloStrength) {
406
+ const dotWidth = width * 2;
407
+ const dotHeight = height * 4;
408
+ if (width !== this.width || height !== this.height) {
409
+ this.width = width;
410
+ this.height = height;
411
+ this.bits = new Uint8Array(width * height);
412
+ this.counts = new Uint8Array(width * height);
413
+ this.rgb = new Float32Array(width * height * 3);
414
+ this.haloAmount = new Float32Array(width * height);
415
+ this.haloRgb = new Float32Array(width * height * 3);
416
+ this.haloDirty = undefined;
417
+ this.depth = new Float32Array(dotWidth * dotHeight).fill(Infinity);
418
+ this.faceIds = new Uint16Array(dotWidth * dotHeight);
419
+ this.dirty = undefined;
420
+ }
421
+ else if (this.dirty) {
422
+ const { minX, minY, maxX, maxY } = this.dirty;
423
+ for (let row = minY; row <= maxY; row++) {
424
+ this.bits.fill(0, row * width + minX, row * width + maxX + 1);
425
+ this.counts.fill(0, row * width + minX, row * width + maxX + 1);
426
+ this.rgb.fill(0, (row * width + minX) * 3, (row * width + maxX + 1) * 3);
427
+ }
428
+ this.dirty = undefined;
429
+ }
430
+ if (this.haloDirty) {
431
+ const { minX, minY, maxX, maxY } = this.haloDirty;
432
+ for (let row = minY; row <= maxY; row++) {
433
+ this.haloAmount.fill(0, row * width + minX, row * width + maxX + 1);
434
+ this.haloRgb.fill(0, (row * width + minX) * 3, (row * width + maxX + 1) * 3);
435
+ }
436
+ this.haloDirty = undefined;
437
+ }
438
+ const m = rotation(pose.yaw, pose.pitch, pose.roll);
439
+ const { centerX, centerY, scale } = pose;
440
+ const cameraDistance = this.cameraDistance;
441
+ // The camera sits at (0, 0, cameraDistance) in camera space; object space is the transpose rotation.
442
+ const origin = [m[6] * cameraDistance, m[7] * cameraDistance, m[8] * cameraDistance];
443
+ const light = isLight(background);
444
+ const faces = this.visibleFaces(m, origin, pose, boxes, dotWidth, dotHeight, light);
445
+ if (faces.length === 0)
446
+ return;
447
+ let minX = dotWidth;
448
+ let minY = dotHeight;
449
+ let maxX = -1;
450
+ let maxY = -1;
451
+ for (const face of faces) {
452
+ minX = Math.min(minX, face.minX);
453
+ minY = Math.min(minY, face.minY);
454
+ maxX = Math.max(maxX, face.maxX);
455
+ maxY = Math.max(maxY, face.maxY);
456
+ }
457
+ if (maxX < minX || maxY < minY)
458
+ return;
459
+ const depth = this.depth;
460
+ const faceIds = this.faceIds;
461
+ for (let faceIndex = 0; faceIndex < faces.length; faceIndex++) {
462
+ const face = faces[faceIndex];
463
+ const a = face.axis;
464
+ const u = (a + 1) % 3;
465
+ const v = (a + 2) % 3;
466
+ const originA = origin[a];
467
+ const originU = origin[u];
468
+ const originV = origin[v];
469
+ // The ray direction in object space is linear in the dot position, so it is stepped per dot.
470
+ const stepA = m[a] / scale;
471
+ const stepU = m[u] / scale;
472
+ const stepV = m[v] / scale;
473
+ const sx = (face.minX + 0.5 - centerX) / scale;
474
+ for (let dotY = face.minY; dotY <= face.maxY; dotY++) {
475
+ const sy = (dotY + 0.5 - centerY) / scale;
476
+ let directionA = m[a] * sx + m[3 + a] * sy - m[6 + a] * cameraDistance;
477
+ let directionU = m[u] * sx + m[3 + u] * sy - m[6 + u] * cameraDistance;
478
+ let directionV = m[v] * sx + m[3 + v] * sy - m[6 + v] * cameraDistance;
479
+ let index = dotY * dotWidth + face.minX;
480
+ for (let dotX = face.minX; dotX <= face.maxX; dotX++, index++) {
481
+ const t = (face.plane - originA) / directionA;
482
+ if (t > 0 && t < depth[index]) {
483
+ const hitU = originU + t * directionU;
484
+ const hitV = originV + t * directionV;
485
+ if (hitU >= face.uMin && hitU <= face.uMax && hitV >= face.vMin && hitV <= face.vMax) {
486
+ depth[index] = t;
487
+ faceIds[index] = faceIndex + 1;
488
+ }
489
+ }
490
+ directionA += stepA;
491
+ directionU += stepU;
492
+ directionV += stepV;
493
+ }
494
+ }
495
+ }
496
+ // Shade the hit dots, pack them into braille cells, and reset the dot buffers for the next frame.
497
+ const bits = this.bits;
498
+ const counts = this.counts;
499
+ const rgb = this.rgb;
500
+ let cellMinX = width;
501
+ let cellMinY = height;
502
+ let cellMaxX = -1;
503
+ let cellMaxY = -1;
504
+ for (let dotY = minY; dotY <= maxY; dotY++) {
505
+ let index = dotY * dotWidth + minX;
506
+ for (let dotX = minX; dotX <= maxX; dotX++, index++) {
507
+ const id = faceIds[index];
508
+ if (id === 0)
509
+ continue;
510
+ const face = faces[id - 1];
511
+ // Points farther from the camera fade slightly toward the background for depth.
512
+ const fog = clamp01(0.15 - cameraDistance * (1 - depth[index]) * 0.12) * (light ? 0.5 : 1);
513
+ faceIds[index] = 0;
514
+ depth[index] = Infinity;
515
+ const cellX = dotX >> 1;
516
+ const cellY = dotY >> 2;
517
+ const cell = cellY * width + cellX;
518
+ bits[cell] |= DOT_BITS[(dotY & 3) * 2 + (dotX & 1)];
519
+ counts[cell]++;
520
+ rgb[cell * 3] += face.red + (background[0] - face.red) * fog;
521
+ rgb[cell * 3 + 1] += face.green + (background[1] - face.green) * fog;
522
+ rgb[cell * 3 + 2] += face.blue + (background[2] - face.blue) * fog;
523
+ if (cellX < cellMinX)
524
+ cellMinX = cellX;
525
+ if (cellX > cellMaxX)
526
+ cellMaxX = cellX;
527
+ if (cellY < cellMinY)
528
+ cellMinY = cellY;
529
+ if (cellY > cellMaxY)
530
+ cellMaxY = cellY;
531
+ }
532
+ }
533
+ if (cellMaxX >= 0)
534
+ this.dirty = { minX: cellMinX, minY: cellMinY, maxX: cellMaxX, maxY: cellMaxY };
535
+ if (haloStrength > 0)
536
+ this.renderHalo(haloStrength);
537
+ }
538
+ /**
539
+ * Blur the logo's coverage and color over neighboring cells with a separable tent filter, so the tint falls
540
+ * off smoothly past the logo's edges.
541
+ */
542
+ renderHalo(strength) {
543
+ const cells = this.dirty;
544
+ if (!cells)
545
+ return;
546
+ const { width, height, counts, rgb } = this;
547
+ const minX = Math.max(0, cells.minX - HALO_RADIUS_X);
548
+ const maxX = Math.min(width - 1, cells.maxX + HALO_RADIUS_X);
549
+ const minY = Math.max(0, cells.minY - HALO_RADIUS_Y);
550
+ const maxY = Math.min(height - 1, cells.maxY + HALO_RADIUS_Y);
551
+ const regionWidth = maxX - minX + 1;
552
+ const tent = (radius) => {
553
+ const weights = Array.from({ length: radius * 2 + 1 }, (_, i) => radius + 1 - Math.abs(i - radius));
554
+ const total = weights.reduce((sum, weight) => sum + weight, 0);
555
+ return weights.map((weight) => weight / total);
556
+ };
557
+ const weightsX = tent(HALO_RADIUS_X);
558
+ const weightsY = tent(HALO_RADIUS_Y);
559
+ // Horizontal pass over the rows that contain the logo: coverage and premultiplied color per cell.
560
+ const rows = cells.maxY - cells.minY + 1;
561
+ const horizontal = new Float32Array(rows * regionWidth * 4);
562
+ for (let y = cells.minY; y <= cells.maxY; y++) {
563
+ for (let x = minX; x <= maxX; x++) {
564
+ let coverage = 0;
565
+ let red = 0;
566
+ let green = 0;
567
+ let blue = 0;
568
+ for (let dx = -HALO_RADIUS_X; dx <= HALO_RADIUS_X; dx++) {
569
+ const sourceX = x + dx;
570
+ if (sourceX < cells.minX || sourceX > cells.maxX)
571
+ continue;
572
+ const source = y * width + sourceX;
573
+ const count = counts[source];
574
+ if (count === 0)
575
+ continue;
576
+ const weight = weightsX[dx + HALO_RADIUS_X] / 8;
577
+ coverage += count * weight;
578
+ red += rgb[source * 3] * weight;
579
+ green += rgb[source * 3 + 1] * weight;
580
+ blue += rgb[source * 3 + 2] * weight;
581
+ }
582
+ const target = ((y - cells.minY) * regionWidth + (x - minX)) * 4;
583
+ horizontal[target] = coverage;
584
+ horizontal[target + 1] = red;
585
+ horizontal[target + 2] = green;
586
+ horizontal[target + 3] = blue;
587
+ }
588
+ }
589
+ // Vertical pass into the halo buffers.
590
+ for (let y = minY; y <= maxY; y++) {
591
+ for (let x = minX; x <= maxX; x++) {
592
+ let coverage = 0;
593
+ let red = 0;
594
+ let green = 0;
595
+ let blue = 0;
596
+ for (let dy = -HALO_RADIUS_Y; dy <= HALO_RADIUS_Y; dy++) {
597
+ const sourceY = y + dy;
598
+ if (sourceY < cells.minY || sourceY > cells.maxY)
599
+ continue;
600
+ const weight = weightsY[dy + HALO_RADIUS_Y];
601
+ const source = ((sourceY - cells.minY) * regionWidth + (x - minX)) * 4;
602
+ coverage += horizontal[source] * weight;
603
+ red += horizontal[source + 1] * weight;
604
+ green += horizontal[source + 2] * weight;
605
+ blue += horizontal[source + 3] * weight;
606
+ }
607
+ const target = y * width + x;
608
+ // Cells under the logo keep at least their own coverage, so faces stay solidly tinted.
609
+ const count = counts[target];
610
+ if (count > 0 && count / 8 > coverage) {
611
+ coverage = count / 8;
612
+ red = (rgb[target * 3] / count) * coverage;
613
+ green = (rgb[target * 3 + 1] / count) * coverage;
614
+ blue = (rgb[target * 3 + 2] / count) * coverage;
615
+ }
616
+ if (coverage <= 0)
617
+ continue;
618
+ // Quantized so neighboring cells usually share a background and its escape sequence.
619
+ const amount = Math.round(strength * Math.min(1, coverage) ** 0.7 * HALO_LEVELS) / HALO_LEVELS;
620
+ if (amount <= 0)
621
+ continue;
622
+ this.haloAmount[target] = amount;
623
+ this.haloRgb[target * 3] = Math.round(red / coverage / LOGO_COLOR_STEP) * LOGO_COLOR_STEP;
624
+ this.haloRgb[target * 3 + 1] = Math.round(green / coverage / LOGO_COLOR_STEP) * LOGO_COLOR_STEP;
625
+ this.haloRgb[target * 3 + 2] = Math.round(blue / coverage / LOGO_COLOR_STEP) * LOGO_COLOR_STEP;
626
+ }
627
+ }
628
+ this.haloDirty = { minX, minY, maxX, maxY };
629
+ }
630
+ visibleFaces(m, origin, pose, boxes, dotWidth, dotHeight, lightBackground) {
631
+ const faces = [];
632
+ const cameraDistance = this.cameraDistance;
633
+ for (const box of boxes) {
634
+ for (let a = 0; a < 3; a++) {
635
+ const u = (a + 1) % 3;
636
+ const v = (a + 2) % 3;
637
+ for (const side of [-1, 1]) {
638
+ const plane = side > 0 ? box.max[a] : box.min[a];
639
+ // Back faces point away from the camera.
640
+ if ((origin[a] - plane) * side <= 0)
641
+ continue;
642
+ // Faces pressed against a neighboring block are hidden. Positions are exact while blocks rest.
643
+ const covered = boxes.some((other) => other !== box &&
644
+ (side > 0 ? other.min[a] : other.max[a]) === plane &&
645
+ other.min[u] <= box.min[u] &&
646
+ other.max[u] >= box.max[u] &&
647
+ other.min[v] <= box.min[v] &&
648
+ other.max[v] >= box.max[v]);
649
+ if (covered)
650
+ continue;
651
+ let minX = Infinity;
652
+ let minY = Infinity;
653
+ let maxX = -Infinity;
654
+ let maxY = -Infinity;
655
+ const corner = [0, 0, 0];
656
+ for (const cornerU of [box.min[u], box.max[u]]) {
657
+ for (const cornerV of [box.min[v], box.max[v]]) {
658
+ corner[a] = plane;
659
+ corner[u] = cornerU;
660
+ corner[v] = cornerV;
661
+ const x = m[0] * corner[0] + m[1] * corner[1] + m[2] * corner[2];
662
+ const y = m[3] * corner[0] + m[4] * corner[1] + m[5] * corner[2];
663
+ const z = m[6] * corner[0] + m[7] * corner[1] + m[8] * corner[2];
664
+ const perspective = (pose.scale * cameraDistance) / (cameraDistance - z);
665
+ const screenX = pose.centerX + x * perspective;
666
+ const screenY = pose.centerY + y * perspective;
667
+ minX = Math.min(minX, screenX);
668
+ minY = Math.min(minY, screenY);
669
+ maxX = Math.max(maxX, screenX);
670
+ maxY = Math.max(maxY, screenY);
671
+ }
672
+ }
673
+ const face = {
674
+ minX: Math.max(0, Math.floor(minX)),
675
+ minY: Math.max(0, Math.floor(minY)),
676
+ maxX: Math.min(dotWidth - 1, Math.ceil(maxX)),
677
+ maxY: Math.min(dotHeight - 1, Math.ceil(maxY)),
678
+ };
679
+ if (face.maxX < face.minX || face.maxY < face.minY)
680
+ continue;
681
+ // Faces are flat, so lighting is computed once per face. The normal in camera space is a
682
+ // column of the rotation matrix.
683
+ const nx = m[a] * side;
684
+ const ny = m[3 + a] * side;
685
+ const nz = m[6 + a] * side;
686
+ const diffuse = Math.max(0, nx * LIGHT[0] + ny * LIGHT[1] + nz * LIGHT[2]);
687
+ const rim = Math.max(0, nx * 0.8 - nz * 0.3);
688
+ // On light backgrounds, highlights toward white would vanish, so faces only get darker than
689
+ // the brand colors there.
690
+ const specular = lightBackground
691
+ ? 0
692
+ : Math.max(0, nx * HALF_VECTOR[0] + ny * HALF_VECTOR[1] + nz * HALF_VECTOR[2]) ** 24 * 0.6 * 255;
693
+ const light = lightBackground
694
+ ? Math.min(1, 0.55 + diffuse * 0.45 + rim * 0.1)
695
+ : 0.45 + diffuse * 0.78 + rim * 0.25;
696
+ faces.push({
697
+ axis: a,
698
+ plane,
699
+ uMin: box.min[u],
700
+ uMax: box.max[u],
701
+ vMin: box.min[v],
702
+ vMax: box.max[v],
703
+ ...face,
704
+ red: Math.min(255, box.color[0] * light + specular),
705
+ green: Math.min(255, box.color[1] * light + specular),
706
+ blue: Math.min(255, box.color[2] * light + specular),
707
+ });
708
+ }
709
+ }
710
+ }
711
+ return faces;
712
+ }
713
+ }
714
+ let playing = false;
715
+ /**
716
+ * Show the animation as a fullscreen overlay until it is dismissed. The overlay takes focus and mouse input and
717
+ * returns focus when hidden, so the rest of the UI keeps running underneath untouched.
718
+ */
719
+ export async function playEasterEgg3d(tui, screen, egg) {
720
+ if (playing)
721
+ return;
722
+ playing = true;
723
+ // Fading needs the terminal's actual default colors; the theme only knows its own.
724
+ const reported = await tui.queryTerminalColors({ timeoutMs: 100 });
725
+ const dark = theme.appearance === "dark";
726
+ const toRgbTuple = (rgb, fallback) => rgb ? [rgb.r, rgb.g, rgb.b] : fallback;
727
+ const colors = {
728
+ foreground: toRgbTuple(reported.foreground, toRgb(theme.colors.text)),
729
+ background: toRgbTuple(reported.background, dark ? [0, 0, 0] : [255, 255, 255]),
730
+ };
731
+ if (tui.hasOverlay()) {
732
+ playing = false;
733
+ return;
734
+ }
735
+ const model = egg.kind === "armin"
736
+ ? arminModel(toRgb(theme.colors.accent))
737
+ : diffraLogoModel({ column: egg.column, row: egg.row });
738
+ const animation = new EasterEgg3dAnimation(tui, screen, model, colors, () => {
739
+ playing = false;
740
+ overlay.hide();
741
+ });
742
+ const overlay = tui.showOverlay(animation, { anchor: "top-left", width: "100%", maxHeight: "100%" });
743
+ }
744
+ export class EasterEgg3dAnimation {
745
+ tui;
746
+ /** The screen to dissolve, as rendered lines. */
747
+ screen;
748
+ model;
749
+ foreground;
750
+ background;
751
+ onDone;
752
+ startTime = performance.now();
753
+ lastRender = performance.now();
754
+ timer;
755
+ exit;
756
+ shuffle;
757
+ screenWidth = -1;
758
+ screenHeight = -1;
759
+ /** Star per cell index, or undefined. */
760
+ stars = [];
761
+ cells = [];
762
+ ansiCache = new Map();
763
+ raster;
764
+ constructor(tui, screen, model, colors, onDone) {
765
+ this.tui = tui;
766
+ this.screen = screen;
767
+ this.model = model;
768
+ this.raster = new BlockRaster(model.cameraDistance);
769
+ this.foreground = colors.foreground;
770
+ this.background = colors.background;
771
+ this.onDone = onDone;
772
+ this.timer = setInterval(() => {
773
+ // Also stop when no longer rendered, e.g. when diffra hides all overlays on exit.
774
+ if ((this.exit && this.exitProgress() >= 1) || performance.now() - this.lastRender > 1000)
775
+ this.finish();
776
+ else
777
+ this.tui.requestRender();
778
+ }, FRAME_MS);
779
+ this.timer.unref?.();
780
+ }
781
+ /** Play the exit animation. A second call skips it. */
782
+ close() {
783
+ if (this.exit) {
784
+ this.finish();
785
+ return;
786
+ }
787
+ const time = this.elapsed();
788
+ const yaw = spinAngle(time);
789
+ const turn = Math.PI * 2;
790
+ this.exit = {
791
+ start: performance.now(),
792
+ time,
793
+ yaw,
794
+ targetYaw: Math.ceil(yaw / turn) * turn,
795
+ offsets: this.blockOffsets(time),
796
+ };
797
+ }
798
+ handleInput(data) {
799
+ const keybindings = getKeybindings();
800
+ if (keybindings.matches(data, "tui.select.cancel") || keybindings.matches(data, "app.clear"))
801
+ this.close();
802
+ }
803
+ handleMouse(event) {
804
+ if (event.type === "click")
805
+ this.close();
806
+ return { handled: true, render: false };
807
+ }
808
+ invalidate() {
809
+ this.screenWidth = -1;
810
+ this.screenHeight = -1;
811
+ this.ansiCache.clear();
812
+ }
813
+ render(width) {
814
+ const height = Math.max(1, this.tui.terminal.rows);
815
+ const foreground = this.foreground;
816
+ const background = this.background;
817
+ this.lastRender = performance.now();
818
+ if (width !== this.screenWidth || height !== this.screenHeight) {
819
+ this.screenWidth = width;
820
+ this.screenHeight = height;
821
+ this.cells = this.prepareCells(width, foreground);
822
+ this.stars = this.prepareStars(width, height);
823
+ }
824
+ // Dissolve time runs forward on entry and backward on exit, so the screen reassembles in reverse order.
825
+ let dissolveTime;
826
+ let pose;
827
+ let hintAlpha;
828
+ let starAlpha;
829
+ let offsets;
830
+ if (this.exit) {
831
+ const progress = this.exitProgress();
832
+ const landing = clamp01(progress / 0.8);
833
+ const settle = 1 - smooth(landing);
834
+ dissolveTime = Math.min(this.exit.time, DISSOLVE_END) * (1 - progress);
835
+ pose = this.pose(width, height, this.flyProgress(this.exit.time) * settle, this.exit.time);
836
+ pose.yaw = this.exit.yaw + (this.exit.targetYaw - this.exit.yaw) * easeOut(landing);
837
+ pose.pitch *= settle;
838
+ pose.roll *= settle;
839
+ hintAlpha = this.hintAlpha(this.exit.time) * (1 - smooth(progress / 0.2));
840
+ starAlpha = this.starAlpha(this.exit.time) * (1 - smooth(progress / 0.3));
841
+ // Blocks are home well before the logo lands.
842
+ const gather = 1 - smooth(progress / 0.5);
843
+ offsets = this.exit.offsets.map(([x, y, z]) => [x * gather, y * gather, z * gather]);
844
+ }
845
+ else {
846
+ const time = this.elapsed();
847
+ dissolveTime = time;
848
+ pose = this.pose(width, height, this.flyProgress(time), time);
849
+ hintAlpha = this.hintAlpha(time);
850
+ starAlpha = this.starAlpha(time);
851
+ offsets = this.blockOffsets(time);
852
+ }
853
+ const { columns, rows } = this.model;
854
+ const boxes = this.model.blocks.map((block, index) => {
855
+ const [dx, dy, dz] = offsets[index];
856
+ const x = block.home[0] - columns / 2 + dx;
857
+ const y = block.home[1] - rows / 2 + dy;
858
+ return { min: [x, y, dz - DEPTH / 2], max: [x + 1, y + 1, dz + DEPTH / 2], color: block.color };
859
+ });
860
+ const raster = this.raster;
861
+ raster.render(width, height, pose, boxes, background, isLight(background) ? LIGHT_HALO_STRENGTH : 0);
862
+ const halo = (index, base) => {
863
+ const amount = raster.haloAmount[index];
864
+ if (amount <= 0)
865
+ return base;
866
+ const color = raster.haloRgb;
867
+ return mix(base ?? background, [color[index * 3], color[index * 3 + 1], color[index * 3 + 2]], amount);
868
+ };
869
+ const backgroundFade = smooth(dissolveTime / BACKGROUND_FADE);
870
+ const textFade = smooth(dissolveTime / 0.6) * 0.3;
871
+ // Once the screen has fully dissolved, the text layer is empty and can be skipped.
872
+ const textActive = dissolveTime < DISSOLVE_END || backgroundFade < 1;
873
+ const hint = this.hint(width, height, hintAlpha, background);
874
+ const frame = Math.floor(dissolveTime * 14);
875
+ const now = this.elapsed();
876
+ // Star brightness is quantized, so a row only changes when one of its stars steps to another level
877
+ // instead of on every frame.
878
+ const starLevel = Math.round(starAlpha * STAR_ALPHA_LEVELS) / STAR_ALPHA_LEVELS;
879
+ const starfield = (index) => {
880
+ if (starLevel <= 0)
881
+ return undefined;
882
+ const star = this.stars[index];
883
+ if (!star)
884
+ return undefined;
885
+ const flicker = Math.round((0.5 + 0.5 * Math.sin(now * star.speed + star.phase)) * STAR_FLICKER_LEVELS) /
886
+ STAR_FLICKER_LEVELS;
887
+ return {
888
+ text: star.glyph,
889
+ fg: mix(background, mix(foreground, star.tint, 0.5), star.strength * (0.7 + 0.3 * flicker) * starLevel),
890
+ };
891
+ };
892
+ const lines = [];
893
+ for (let row = 0; row < height; row++) {
894
+ const cells = this.cells[row] ?? [];
895
+ let line = "";
896
+ let currentFg = -1;
897
+ let currentBg = -1;
898
+ const emit = (text, fg, bg) => {
899
+ const fgKey = fg ? this.pack(fg) : -1;
900
+ const bgKey = bg ? this.pack(bg) : -1;
901
+ if (fgKey !== currentFg && text !== " ") {
902
+ line += fg ? this.ansi(fgKey, false) : "\x1b[39m";
903
+ currentFg = fgKey;
904
+ }
905
+ if (bgKey !== currentBg) {
906
+ line += bg ? this.ansi(bgKey, true) : "\x1b[49m";
907
+ currentBg = bgKey;
908
+ }
909
+ line += text;
910
+ };
911
+ for (let column = 0; column < width; column++) {
912
+ const index = row * width + column;
913
+ const cell = textActive ? cells[column] : undefined;
914
+ const cellBg = halo(index, cell?.bg && backgroundFade < 1 ? mix(cell.bg, background, backgroundFade) : undefined);
915
+ if (hint && row === hint.row && column >= hint.start && column < hint.start + hint.text.length) {
916
+ const offset = column - hint.start;
917
+ emit(hint.text[offset], offset < hint.keyLength ? hint.keyColor : hint.color, cellBg);
918
+ continue;
919
+ }
920
+ const dots = raster.bits[index];
921
+ if (dots) {
922
+ // Quantized so neighboring cells on one face usually share a color and its escape sequence.
923
+ const step = LOGO_COLOR_STEP * raster.counts[index];
924
+ const rgb = raster.rgb;
925
+ const color = [
926
+ Math.round(rgb[index * 3] / step) * LOGO_COLOR_STEP,
927
+ Math.round(rgb[index * 3 + 1] / step) * LOGO_COLOR_STEP,
928
+ Math.round(rgb[index * 3 + 2] / step) * LOGO_COLOR_STEP,
929
+ ];
930
+ emit(BRAILLE[dots], color, cellBg);
931
+ continue;
932
+ }
933
+ if (!cell) {
934
+ const star = starfield(index);
935
+ emit(star?.text ?? " ", star?.fg, cellBg);
936
+ continue;
937
+ }
938
+ const dust = (dissolveTime - cell.delay) / DUST_DURATION;
939
+ if (dust < 0 && cell.width === 2 && !raster.bits[index + 1]) {
940
+ emit(cell.text, mix(cell.fg, background, textFade), cellBg);
941
+ column++;
942
+ continue;
943
+ }
944
+ if (dust < 0 && cell.width === 1) {
945
+ emit(cell.text, mix(cell.fg, background, textFade), cellBg);
946
+ continue;
947
+ }
948
+ const dotCount = dust < 0 ? cell.ink : Math.round(cell.ink * (1 - clamp01(dust)));
949
+ if (dotCount <= 0) {
950
+ const star = starfield(index);
951
+ emit(star?.text ?? " ", star?.fg, cellBg);
952
+ continue;
953
+ }
954
+ // Pick `dotCount` distinct dots; the choice changes a few times per second so the dust shimmers.
955
+ let bits = 0;
956
+ let placed = 0;
957
+ for (let attempt = 0; placed < dotCount && attempt < 32; attempt++) {
958
+ const bit = DOT_BITS[Math.floor(hash(cell.seed * 7919 + frame * 131 + attempt) * 8)];
959
+ if (bits & bit)
960
+ continue;
961
+ bits |= bit;
962
+ placed++;
963
+ }
964
+ const fade = textFade + (1 - textFade) * clamp01(dust) ** 0.8;
965
+ emit(BRAILLE[bits], mix(cell.fg, background, fade), cellBg);
966
+ }
967
+ lines.push(`${line}\x1b[0m`);
968
+ }
969
+ return lines;
970
+ }
971
+ elapsed() {
972
+ return (performance.now() - this.startTime) / 1000;
973
+ }
974
+ exitProgress() {
975
+ return this.exit ? clamp01((performance.now() - this.exit.start) / 1000 / EXIT_DURATION) : 0;
976
+ }
977
+ finish() {
978
+ if (!this.timer)
979
+ return;
980
+ clearInterval(this.timer);
981
+ this.timer = undefined;
982
+ this.onDone();
983
+ }
984
+ /** Each block's displacement from its place in the model at `time`, in grid units. */
985
+ blockOffsets(time) {
986
+ const blocks = this.model.blocks;
987
+ const home = () => blocks.map(() => [0, 0, 0]);
988
+ if (time < PUZZLE_START)
989
+ return home();
990
+ const cycle = Math.floor((time - PUZZLE_START) / PUZZLE_CYCLE);
991
+ const local = time - PUZZLE_START - cycle * PUZZLE_CYCLE;
992
+ if (this.shuffle?.cycle !== cycle)
993
+ this.shuffle = { cycle, steps: shuffleSteps(this.model, cycle) };
994
+ const steps = this.shuffle.steps;
995
+ const offset = (position, index) => {
996
+ const block = blocks[index].home;
997
+ return [position[0] - block[0], position[1] - block[1], position[2] - block[2]];
998
+ };
999
+ const shuffleEnd = PUZZLE_STEP * PUZZLE_STEPS;
1000
+ if (local < shuffleEnd) {
1001
+ const step = Math.floor(local / PUZZLE_STEP);
1002
+ const progress = smooth((local - step * PUZZLE_STEP) / PUZZLE_STEP);
1003
+ return steps[step].map((from, index) => {
1004
+ const a = offset(from, index);
1005
+ const b = offset(steps[step + 1][index], index);
1006
+ return [a[0] + (b[0] - a[0]) * progress, a[1] + (b[1] - a[1]) * progress, a[2] + (b[2] - a[2]) * progress];
1007
+ });
1008
+ }
1009
+ if (local < shuffleEnd + PUZZLE_RETURN) {
1010
+ // All blocks fly home at once. Alternating arcs in depth keep them from passing through each other.
1011
+ const u = (local - shuffleEnd) / PUZZLE_RETURN;
1012
+ const remaining = 1 - smooth(u);
1013
+ const arc = Math.sin(Math.PI * clamp01(u)) * 0.8;
1014
+ return steps[PUZZLE_STEPS].map((position, index) => {
1015
+ const [x, y, z] = offset(position, index);
1016
+ return [x * remaining, y * remaining, z * remaining + (index % 2 === 0 ? arc : -arc)];
1017
+ });
1018
+ }
1019
+ return home();
1020
+ }
1021
+ flyProgress(time) {
1022
+ return smooth((time - FLY_START) / FLY_DURATION);
1023
+ }
1024
+ starAlpha(time) {
1025
+ return smooth((time - STARS_START) / STARS_FADE);
1026
+ }
1027
+ hintAlpha(time) {
1028
+ return smooth((time - FLY_START - FLY_DURATION) / HINT_FADE);
1029
+ }
1030
+ pose(width, height, progress, time) {
1031
+ const { columns, rows, cameraDistance, radius, widthShare, origin } = this.model;
1032
+ const reach = radius * (cameraDistance / (cameraDistance - radius));
1033
+ // Lifting off, the front face must cover exactly the half-block cells (2x2 dots per pixel) despite the
1034
+ // perspective.
1035
+ const startScale = origin ? (2 * (cameraDistance - DEPTH / 2)) / cameraDistance : START_SCALE;
1036
+ const endScale = Math.max(startScale, Math.min(width * 2 * widthShare, (height * 4 - 8) * 0.48) / reach);
1037
+ const endX = width;
1038
+ const endY = height * 2 - 2;
1039
+ const startX = origin ? origin.column * 2 + columns : endX;
1040
+ const startY = origin ? origin.row * 4 + rows : endY;
1041
+ return {
1042
+ centerX: startX + (endX - startX) * progress,
1043
+ centerY: startY + (endY - startY) * progress,
1044
+ // Interpolate the zoom geometrically so it feels uniform.
1045
+ scale: startScale * (endScale / startScale) ** progress,
1046
+ yaw: spinAngle(time),
1047
+ // Tilts are zero at whole turns, so the camera looks straight at the front of the reassembled logo.
1048
+ pitch: 0.3 * Math.sin(spinPhase(time)) * progress,
1049
+ roll: 0.06 * Math.sin(2 * spinPhase(time)) * progress,
1050
+ };
1051
+ }
1052
+ hint(width, height, alpha, background) {
1053
+ if (alpha <= 0)
1054
+ return undefined;
1055
+ const key = formatKeyText(getKeybindings().getKeys("tui.select.cancel")[0] ?? "escape");
1056
+ const text = `${key} to return`;
1057
+ if (text.length > width)
1058
+ return undefined;
1059
+ return {
1060
+ row: height - 2,
1061
+ start: Math.floor((width - text.length) / 2),
1062
+ text,
1063
+ keyLength: key.length,
1064
+ keyColor: mix(background, toRgb(theme.colors.muted), alpha),
1065
+ color: mix(background, toRgb(theme.colors.dim), alpha),
1066
+ };
1067
+ }
1068
+ /** A sparse, deterministic starfield: one braille dot in about STAR_DENSITY of all cells. */
1069
+ prepareStars(width, height) {
1070
+ const stars = new Array(width * height);
1071
+ for (let index = 0; index < width * height; index++) {
1072
+ if (hash(index * 3 + 0x51ed) >= STAR_DENSITY)
1073
+ continue;
1074
+ const random = (salt) => hash(index * 7 + salt * 0x9e37);
1075
+ stars[index] = {
1076
+ glyph: BRAILLE[DOT_BITS[Math.floor(random(1) * 8)]],
1077
+ tint: STAR_TINTS[Math.floor(random(2) * STAR_TINTS.length)],
1078
+ strength: 0.1 + random(3) * 0.12,
1079
+ phase: random(4) * Math.PI * 2,
1080
+ speed: 0.4 + random(5) * 0.8,
1081
+ };
1082
+ }
1083
+ return stars;
1084
+ }
1085
+ prepareCells(width, foreground) {
1086
+ const cells = parseScreen(this.screen, width, foreground, this.background);
1087
+ const height = Math.max(1, this.tui.terminal.rows);
1088
+ const { columns, rows, origin } = this.model;
1089
+ // The dust spreads out from where the model starts.
1090
+ const centerX = origin ? origin.column + columns / 2 : width / 2;
1091
+ const centerY = origin ? origin.row + rows / 4 : height / 2;
1092
+ const farthest = Math.hypot(Math.max(centerX, width - centerX), Math.max(centerY, height - centerY) * 2);
1093
+ for (let row = 0; row < cells.length; row++) {
1094
+ const line = cells[row];
1095
+ for (let column = 0; column < line.length; column++) {
1096
+ const cell = line[column];
1097
+ // Wide graphemes share their first column's timing so both halves change together.
1098
+ const owner = cell.width === 0 ? line[column - 1] : cell;
1099
+ const seed = hash(row * 65_537 + column);
1100
+ if (cell.width !== 0) {
1101
+ const distance = Math.hypot(column - centerX, (row - centerY) * 2) / farthest;
1102
+ cell.delay = FLY_START + distance * WAVE_SPREAD + seed * WAVE_JITTER;
1103
+ }
1104
+ else {
1105
+ cell.delay = owner.delay;
1106
+ }
1107
+ cell.seed = row * 65_537 + column;
1108
+ cell.ink = glyphInk(owner.text, seed);
1109
+ }
1110
+ }
1111
+ // The 3D model replaces its half-block rendering on screen.
1112
+ if (origin) {
1113
+ for (let row = origin.row; row < origin.row + Math.ceil(rows / 2); row++) {
1114
+ const line = cells[row];
1115
+ if (!line)
1116
+ continue;
1117
+ for (let column = origin.column; column < origin.column + columns; column++) {
1118
+ const cell = line[column];
1119
+ if (cell) {
1120
+ cell.text = " ";
1121
+ cell.width = 1;
1122
+ cell.ink = 0;
1123
+ cell.bg = undefined;
1124
+ }
1125
+ }
1126
+ }
1127
+ }
1128
+ return cells;
1129
+ }
1130
+ pack(color) {
1131
+ return (Math.round(color[0]) << 16) | (Math.round(color[1]) << 8) | Math.round(color[2]);
1132
+ }
1133
+ ansi(key, isBackground) {
1134
+ const cacheKey = key * 2 + (isBackground ? 1 : 0);
1135
+ let value = this.ansiCache.get(cacheKey);
1136
+ if (value === undefined) {
1137
+ const color = rgbColor((key >> 16) & 255, (key >> 8) & 255, key & 255);
1138
+ const mode = theme.getColorMode();
1139
+ value = isBackground ? backgroundAnsi(color, mode) : foregroundAnsi(color, mode);
1140
+ this.ansiCache.set(cacheKey, value);
1141
+ }
1142
+ return value;
1143
+ }
1144
+ }
1145
+ //# sourceMappingURL=easter-egg-3d.js.map