@vascend/talos 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 (620) hide show
  1. package/README.md +202 -0
  2. package/dist/backend/asset-events.d.ts +31 -0
  3. package/dist/backend/asset-events.js +149 -0
  4. package/dist/backend/assets.d.ts +31 -0
  5. package/dist/backend/assets.js +210 -0
  6. package/dist/backend/auth.d.ts +18 -0
  7. package/dist/backend/auth.js +59 -0
  8. package/dist/backend/config.d.ts +14 -0
  9. package/dist/backend/config.js +41 -0
  10. package/dist/backend/conversations.d.ts +21 -0
  11. package/dist/backend/conversations.js +141 -0
  12. package/dist/backend/crypto.d.ts +9 -0
  13. package/dist/backend/crypto.js +68 -0
  14. package/dist/backend/engine.d.ts +13 -0
  15. package/dist/backend/engine.js +78 -0
  16. package/dist/backend/http.d.ts +25 -0
  17. package/dist/backend/http.js +112 -0
  18. package/dist/backend/index.d.ts +1 -0
  19. package/dist/backend/index.js +24 -0
  20. package/dist/backend/routes.d.ts +14 -0
  21. package/dist/backend/routes.js +169 -0
  22. package/dist/backend/sdk.d.ts +12 -0
  23. package/dist/backend/sdk.js +11 -0
  24. package/dist/backend/server.d.ts +12 -0
  25. package/dist/backend/server.js +91 -0
  26. package/dist/backend/temp-image-store.d.ts +46 -0
  27. package/dist/backend/temp-image-store.js +197 -0
  28. package/dist/backend/types.d.ts +103 -0
  29. package/dist/backend/types.js +29 -0
  30. package/dist/backend/users.d.ts +13 -0
  31. package/dist/backend/users.js +76 -0
  32. package/dist/backend/ws-handler.d.ts +14 -0
  33. package/dist/backend/ws-handler.js +72 -0
  34. package/dist/backend/ws.d.ts +19 -0
  35. package/dist/backend/ws.js +146 -0
  36. package/dist/core/agent.d.ts +56 -0
  37. package/dist/core/agent.js +1783 -0
  38. package/dist/core/background.d.ts +45 -0
  39. package/dist/core/background.js +140 -0
  40. package/dist/core/bootstrap.d.ts +45 -0
  41. package/dist/core/bootstrap.js +294 -0
  42. package/dist/core/cli-args.d.ts +41 -0
  43. package/dist/core/cli-args.js +282 -0
  44. package/dist/core/collapsible-output.d.ts +38 -0
  45. package/dist/core/collapsible-output.js +143 -0
  46. package/dist/core/compaction-checkpoint.d.ts +9 -0
  47. package/dist/core/compaction-checkpoint.js +58 -0
  48. package/dist/core/compaction.d.ts +42 -0
  49. package/dist/core/compaction.js +270 -0
  50. package/dist/core/config.d.ts +49 -0
  51. package/dist/core/config.js +417 -0
  52. package/dist/core/context-ledger.d.ts +99 -0
  53. package/dist/core/context-ledger.js +222 -0
  54. package/dist/core/context-policy.d.ts +17 -0
  55. package/dist/core/context-policy.js +81 -0
  56. package/dist/core/continuation-review.d.ts +23 -0
  57. package/dist/core/continuation-review.js +64 -0
  58. package/dist/core/crash-report.d.ts +3 -0
  59. package/dist/core/crash-report.js +27 -0
  60. package/dist/core/credentials.d.ts +11 -0
  61. package/dist/core/credentials.js +183 -0
  62. package/dist/core/doctor.d.ts +24 -0
  63. package/dist/core/doctor.js +125 -0
  64. package/dist/core/effort.d.ts +5 -0
  65. package/dist/core/effort.js +42 -0
  66. package/dist/core/env-paths.d.ts +3 -0
  67. package/dist/core/env-paths.js +38 -0
  68. package/dist/core/execution-guidance.d.ts +9 -0
  69. package/dist/core/execution-guidance.js +73 -0
  70. package/dist/core/execution-target.d.ts +41 -0
  71. package/dist/core/execution-target.js +69 -0
  72. package/dist/core/file-coordination.d.ts +66 -0
  73. package/dist/core/file-coordination.js +176 -0
  74. package/dist/core/file-lease-store.d.ts +14 -0
  75. package/dist/core/file-lease-store.js +89 -0
  76. package/dist/core/image-limits.d.ts +26 -0
  77. package/dist/core/image-limits.js +205 -0
  78. package/dist/core/interruptible-completion.d.ts +3 -0
  79. package/dist/core/interruptible-completion.js +42 -0
  80. package/dist/core/kingdoms-mode-state.d.ts +24 -0
  81. package/dist/core/kingdoms-mode-state.js +139 -0
  82. package/dist/core/licenza.d.ts +38 -0
  83. package/dist/core/licenza.js +125 -0
  84. package/dist/core/model-limits.d.ts +2 -0
  85. package/dist/core/model-limits.js +36 -0
  86. package/dist/core/output-lifecycle.d.ts +44 -0
  87. package/dist/core/output-lifecycle.js +190 -0
  88. package/dist/core/package-update.d.ts +15 -0
  89. package/dist/core/package-update.js +121 -0
  90. package/dist/core/permission-queue.d.ts +2 -0
  91. package/dist/core/permission-queue.js +20 -0
  92. package/dist/core/prompt-attachment.d.ts +21 -0
  93. package/dist/core/prompt-attachment.js +123 -0
  94. package/dist/core/request-plan.d.ts +16 -0
  95. package/dist/core/request-plan.js +36 -0
  96. package/dist/core/run-timing.d.ts +17 -0
  97. package/dist/core/run-timing.js +123 -0
  98. package/dist/core/self-update.d.ts +17 -0
  99. package/dist/core/self-update.js +54 -0
  100. package/dist/core/session-refs.d.ts +27 -0
  101. package/dist/core/session-refs.js +126 -0
  102. package/dist/core/session-storage.d.ts +4 -0
  103. package/dist/core/session-storage.js +48 -0
  104. package/dist/core/session-title.d.ts +1 -0
  105. package/dist/core/session-title.js +21 -0
  106. package/dist/core/session-usage.d.ts +17 -0
  107. package/dist/core/session-usage.js +74 -0
  108. package/dist/core/session.d.ts +58 -0
  109. package/dist/core/session.js +296 -0
  110. package/dist/core/settings.d.ts +17 -0
  111. package/dist/core/settings.js +107 -0
  112. package/dist/core/storage-retention.d.ts +21 -0
  113. package/dist/core/storage-retention.js +227 -0
  114. package/dist/core/text-sanitize.d.ts +1 -0
  115. package/dist/core/text-sanitize.js +35 -0
  116. package/dist/core/tool-artifacts.d.ts +6 -0
  117. package/dist/core/tool-artifacts.js +51 -0
  118. package/dist/core/tool-compress.d.ts +8 -0
  119. package/dist/core/tool-compress.js +111 -0
  120. package/dist/core/tool-executor.d.ts +16 -0
  121. package/dist/core/tool-executor.js +97 -0
  122. package/dist/core/tool-result-index.d.ts +52 -0
  123. package/dist/core/tool-result-index.js +327 -0
  124. package/dist/core/tool-result-store.d.ts +38 -0
  125. package/dist/core/tool-result-store.js +190 -0
  126. package/dist/core/tool-scheduler.d.ts +16 -0
  127. package/dist/core/tool-scheduler.js +35 -0
  128. package/dist/core/trust.d.ts +21 -0
  129. package/dist/core/trust.js +95 -0
  130. package/dist/core/types.d.ts +402 -0
  131. package/dist/core/types.js +1 -0
  132. package/dist/core/update-check.d.ts +26 -0
  133. package/dist/core/update-check.js +89 -0
  134. package/dist/core/update-process.d.ts +10 -0
  135. package/dist/core/update-process.js +31 -0
  136. package/dist/core/user-inbox.d.ts +23 -0
  137. package/dist/core/user-inbox.js +56 -0
  138. package/dist/core/user-input.d.ts +10 -0
  139. package/dist/core/user-input.js +35 -0
  140. package/dist/core/version.d.ts +1 -0
  141. package/dist/core/version.js +10 -0
  142. package/dist/core/vibe-modes.d.ts +38 -0
  143. package/dist/core/vibe-modes.js +383 -0
  144. package/dist/core/workspace-roots.d.ts +13 -0
  145. package/dist/core/workspace-roots.js +91 -0
  146. package/dist/core/workspace-sessions.d.ts +51 -0
  147. package/dist/core/workspace-sessions.js +243 -0
  148. package/dist/cowork/client.d.ts +29 -0
  149. package/dist/cowork/client.js +49 -0
  150. package/dist/cowork/engine-bridge.d.ts +22 -0
  151. package/dist/cowork/engine-bridge.js +98 -0
  152. package/dist/cowork/index.d.ts +11 -0
  153. package/dist/cowork/index.js +16 -0
  154. package/dist/cowork/ipc.d.ts +97 -0
  155. package/dist/cowork/ipc.js +96 -0
  156. package/dist/cowork/manager.d.ts +66 -0
  157. package/dist/cowork/manager.js +325 -0
  158. package/dist/cowork/store.d.ts +23 -0
  159. package/dist/cowork/store.js +182 -0
  160. package/dist/cowork/sync.d.ts +20 -0
  161. package/dist/cowork/sync.js +164 -0
  162. package/dist/cowork/types.d.ts +78 -0
  163. package/dist/cowork/types.js +21 -0
  164. package/dist/extensions/ext-tools.d.ts +3 -0
  165. package/dist/extensions/ext-tools.js +73 -0
  166. package/dist/extensions/loader.d.ts +91 -0
  167. package/dist/extensions/loader.js +474 -0
  168. package/dist/extensions/settings.d.ts +20 -0
  169. package/dist/extensions/settings.js +86 -0
  170. package/dist/extensions/types.d.ts +219 -0
  171. package/dist/extensions/types.js +1 -0
  172. package/dist/horizon/async-queue.d.ts +9 -0
  173. package/dist/horizon/async-queue.js +46 -0
  174. package/dist/horizon/engine.d.ts +85 -0
  175. package/dist/horizon/engine.js +603 -0
  176. package/dist/horizon/index.d.ts +4 -0
  177. package/dist/horizon/index.js +2 -0
  178. package/dist/horizon/main-team.d.ts +163 -0
  179. package/dist/horizon/main-team.js +774 -0
  180. package/dist/horizon/types.d.ts +233 -0
  181. package/dist/horizon/types.js +1 -0
  182. package/dist/index.d.ts +2 -0
  183. package/dist/index.js +233 -0
  184. package/dist/mcp/protocol.d.ts +81 -0
  185. package/dist/mcp/protocol.js +122 -0
  186. package/dist/package.json +1 -0
  187. package/dist/packages/packages.d.ts +12 -0
  188. package/dist/packages/packages.js +323 -0
  189. package/dist/prompts/templates.d.ts +13 -0
  190. package/dist/prompts/templates.js +139 -0
  191. package/dist/providers/anthropic-oauth.d.ts +13 -0
  192. package/dist/providers/anthropic-oauth.js +124 -0
  193. package/dist/providers/anthropic.d.ts +27 -0
  194. package/dist/providers/anthropic.js +526 -0
  195. package/dist/providers/catalog.d.ts +15 -0
  196. package/dist/providers/catalog.js +166 -0
  197. package/dist/providers/effort.d.ts +12 -0
  198. package/dist/providers/effort.js +102 -0
  199. package/dist/providers/model-catalog.d.ts +43 -0
  200. package/dist/providers/model-catalog.js +70 -0
  201. package/dist/providers/model-effort.d.ts +5 -0
  202. package/dist/providers/model-effort.js +43 -0
  203. package/dist/providers/model-registry.d.ts +39 -0
  204. package/dist/providers/model-registry.js +142 -0
  205. package/dist/providers/models-dev.d.ts +9 -0
  206. package/dist/providers/models-dev.js +97 -0
  207. package/dist/providers/oauth-callback-server.d.ts +28 -0
  208. package/dist/providers/oauth-callback-server.js +184 -0
  209. package/dist/providers/oauth-orchestrator.d.ts +58 -0
  210. package/dist/providers/oauth-orchestrator.js +159 -0
  211. package/dist/providers/oauth-store.d.ts +12 -0
  212. package/dist/providers/oauth-store.js +139 -0
  213. package/dist/providers/open-browser.d.ts +20 -0
  214. package/dist/providers/open-browser.js +92 -0
  215. package/dist/providers/openai-compat.d.ts +14 -0
  216. package/dist/providers/openai-compat.js +523 -0
  217. package/dist/providers/openai-oauth.d.ts +15 -0
  218. package/dist/providers/openai-oauth.js +382 -0
  219. package/dist/providers/openrouter-auth.d.ts +73 -0
  220. package/dist/providers/openrouter-auth.js +321 -0
  221. package/dist/providers/openrouter-manual-fallback.d.ts +25 -0
  222. package/dist/providers/openrouter-manual-fallback.js +161 -0
  223. package/dist/providers/openrouter.d.ts +15 -0
  224. package/dist/providers/openrouter.js +107 -0
  225. package/dist/providers/plan-limits.d.ts +6 -0
  226. package/dist/providers/plan-limits.js +175 -0
  227. package/dist/providers/provider-reset.d.ts +4 -0
  228. package/dist/providers/provider-reset.js +83 -0
  229. package/dist/providers/quota-limits.d.ts +4 -0
  230. package/dist/providers/quota-limits.js +33 -0
  231. package/dist/providers/registry.d.ts +33 -0
  232. package/dist/providers/registry.js +213 -0
  233. package/dist/providers/retry.d.ts +37 -0
  234. package/dist/providers/retry.js +347 -0
  235. package/dist/rpc/server.d.ts +23 -0
  236. package/dist/rpc/server.js +222 -0
  237. package/dist/sdk.d.ts +67 -0
  238. package/dist/sdk.js +64 -0
  239. package/dist/skills/skills.d.ts +17 -0
  240. package/dist/skills/skills.js +155 -0
  241. package/dist/text-sanitize.js +28 -0
  242. package/dist/tools/ask-user.d.ts +2 -0
  243. package/dist/tools/ask-user.js +60 -0
  244. package/dist/tools/builtin.d.ts +48 -0
  245. package/dist/tools/builtin.js +2494 -0
  246. package/dist/tools/capabilities.d.ts +5 -0
  247. package/dist/tools/capabilities.js +55 -0
  248. package/dist/tools/computer-capture.d.ts +2 -0
  249. package/dist/tools/computer-capture.js +91 -0
  250. package/dist/tools/computer-posix.d.ts +5 -0
  251. package/dist/tools/computer-posix.js +136 -0
  252. package/dist/tools/computer-use.d.ts +14 -0
  253. package/dist/tools/computer-use.js +108 -0
  254. package/dist/tools/discovery.d.ts +12 -0
  255. package/dist/tools/discovery.js +205 -0
  256. package/dist/tools/execute.d.ts +2 -0
  257. package/dist/tools/execute.js +73 -0
  258. package/dist/tools/normalize-input.d.ts +17 -0
  259. package/dist/tools/normalize-input.js +174 -0
  260. package/dist/tools/output-artifact.d.ts +3 -0
  261. package/dist/tools/output-artifact.js +80 -0
  262. package/dist/tools/pagination.d.ts +15 -0
  263. package/dist/tools/pagination.js +93 -0
  264. package/dist/tools/plan-status.d.ts +2 -0
  265. package/dist/tools/plan-status.js +109 -0
  266. package/dist/tools/program-input.d.ts +3 -0
  267. package/dist/tools/program-input.js +19 -0
  268. package/dist/tools/program.d.ts +3 -0
  269. package/dist/tools/program.js +567 -0
  270. package/dist/tools/protocol-catalog.d.ts +12 -0
  271. package/dist/tools/protocol-catalog.js +46 -0
  272. package/dist/tools/ramification-tools.d.ts +12 -0
  273. package/dist/tools/ramification-tools.js +528 -0
  274. package/dist/tools/regex-compat.d.ts +9 -0
  275. package/dist/tools/regex-compat.js +96 -0
  276. package/dist/tools/registry.d.ts +51 -0
  277. package/dist/tools/registry.js +185 -0
  278. package/dist/tools/resolve.d.ts +2 -0
  279. package/dist/tools/resolve.js +107 -0
  280. package/dist/tools/shell-env.d.ts +2 -0
  281. package/dist/tools/shell-env.js +7 -0
  282. package/dist/tools/team-input.d.ts +3 -0
  283. package/dist/tools/team-input.js +129 -0
  284. package/dist/tools/team-tools.d.ts +7 -0
  285. package/dist/tools/team-tools.js +348 -0
  286. package/dist/tools/workspace-sessions.d.ts +2 -0
  287. package/dist/tools/workspace-sessions.js +35 -0
  288. package/dist/tui/account-entry.d.ts +1 -0
  289. package/dist/tui/account-entry.js +93 -0
  290. package/dist/tui/attachment-highlight.d.ts +1 -0
  291. package/dist/tui/attachment-highlight.js +24 -0
  292. package/dist/tui/attachment-refs.d.ts +2 -0
  293. package/dist/tui/attachment-refs.js +3 -0
  294. package/dist/tui/bottom-input.d.ts +219 -0
  295. package/dist/tui/bottom-input.js +1958 -0
  296. package/dist/tui/branding.d.ts +107 -0
  297. package/dist/tui/branding.js +750 -0
  298. package/dist/tui/clipboard-image.d.ts +10 -0
  299. package/dist/tui/clipboard-image.js +163 -0
  300. package/dist/tui/clipboard-text.d.ts +9 -0
  301. package/dist/tui/clipboard-text.js +51 -0
  302. package/dist/tui/clipboard-windows.d.ts +8 -0
  303. package/dist/tui/clipboard-windows.js +84 -0
  304. package/dist/tui/collapsible-command.d.ts +15 -0
  305. package/dist/tui/collapsible-command.js +48 -0
  306. package/dist/tui/command-feedback.d.ts +10 -0
  307. package/dist/tui/command-feedback.js +46 -0
  308. package/dist/tui/command-output-registry.d.ts +28 -0
  309. package/dist/tui/command-output-registry.js +103 -0
  310. package/dist/tui/command-transcript.d.ts +12 -0
  311. package/dist/tui/command-transcript.js +90 -0
  312. package/dist/tui/commands.d.ts +20 -0
  313. package/dist/tui/commands.js +131 -0
  314. package/dist/tui/context-bar.d.ts +4 -0
  315. package/dist/tui/context-bar.js +74 -0
  316. package/dist/tui/context-meter.d.ts +25 -0
  317. package/dist/tui/context-meter.js +81 -0
  318. package/dist/tui/cost-binding.d.ts +8 -0
  319. package/dist/tui/cost-binding.js +43 -0
  320. package/dist/tui/cost-tracker.d.ts +49 -0
  321. package/dist/tui/cost-tracker.js +122 -0
  322. package/dist/tui/diff.d.ts +9 -0
  323. package/dist/tui/diff.js +119 -0
  324. package/dist/tui/i18n-catalog.d.ts +5 -0
  325. package/dist/tui/i18n-catalog.js +184 -0
  326. package/dist/tui/i18n.d.ts +6 -0
  327. package/dist/tui/i18n.js +10 -0
  328. package/dist/tui/image-attachments.d.ts +46 -0
  329. package/dist/tui/image-attachments.js +167 -0
  330. package/dist/tui/images.d.ts +12 -0
  331. package/dist/tui/images.js +87 -0
  332. package/dist/tui/intro.d.ts +13 -0
  333. package/dist/tui/intro.js +109 -0
  334. package/dist/tui/language-preference.d.ts +6 -0
  335. package/dist/tui/language-preference.js +24 -0
  336. package/dist/tui/live-output.d.ts +2 -0
  337. package/dist/tui/live-output.js +18 -0
  338. package/dist/tui/locales.d.ts +19 -0
  339. package/dist/tui/locales.js +22 -0
  340. package/dist/tui/login-menu.d.ts +17 -0
  341. package/dist/tui/login-menu.js +58 -0
  342. package/dist/tui/logo.d.ts +8 -0
  343. package/dist/tui/logo.js +305 -0
  344. package/dist/tui/markdown-inline.d.ts +3 -0
  345. package/dist/tui/markdown-inline.js +99 -0
  346. package/dist/tui/markdown-table.d.ts +4 -0
  347. package/dist/tui/markdown-table.js +63 -0
  348. package/dist/tui/markdown.d.ts +11 -0
  349. package/dist/tui/markdown.js +257 -0
  350. package/dist/tui/mcp-transcript.d.ts +7 -0
  351. package/dist/tui/mcp-transcript.js +40 -0
  352. package/dist/tui/model-details.d.ts +2 -0
  353. package/dist/tui/model-details.js +21 -0
  354. package/dist/tui/model-selection.d.ts +7 -0
  355. package/dist/tui/model-selection.js +41 -0
  356. package/dist/tui/native-scrollback.d.ts +27 -0
  357. package/dist/tui/native-scrollback.js +134 -0
  358. package/dist/tui/onboarding.d.ts +72 -0
  359. package/dist/tui/onboarding.js +207 -0
  360. package/dist/tui/paste-collapse.d.ts +39 -0
  361. package/dist/tui/paste-collapse.js +117 -0
  362. package/dist/tui/perm-mode.d.ts +8 -0
  363. package/dist/tui/perm-mode.js +41 -0
  364. package/dist/tui/prompt-queue-store.d.ts +26 -0
  365. package/dist/tui/prompt-queue-store.js +87 -0
  366. package/dist/tui/prompt-queue.d.ts +47 -0
  367. package/dist/tui/prompt-queue.js +187 -0
  368. package/dist/tui/provider-menu.d.ts +33 -0
  369. package/dist/tui/provider-menu.js +175 -0
  370. package/dist/tui/question.d.ts +24 -0
  371. package/dist/tui/question.js +32 -0
  372. package/dist/tui/queue-screen.d.ts +25 -0
  373. package/dist/tui/queue-screen.js +152 -0
  374. package/dist/tui/queue-team.d.ts +3 -0
  375. package/dist/tui/queue-team.js +28 -0
  376. package/dist/tui/queued-questions.d.ts +20 -0
  377. package/dist/tui/queued-questions.js +163 -0
  378. package/dist/tui/quick-help.d.ts +1 -0
  379. package/dist/tui/quick-help.js +53 -0
  380. package/dist/tui/repl.d.ts +78 -0
  381. package/dist/tui/repl.js +4130 -0
  382. package/dist/tui/restore-queued-input.d.ts +3 -0
  383. package/dist/tui/restore-queued-input.js +20 -0
  384. package/dist/tui/review-detail.d.ts +6 -0
  385. package/dist/tui/review-detail.js +56 -0
  386. package/dist/tui/review-files.d.ts +3 -0
  387. package/dist/tui/review-files.js +22 -0
  388. package/dist/tui/review-render.d.ts +22 -0
  389. package/dist/tui/review-render.js +98 -0
  390. package/dist/tui/review-screen.d.ts +38 -0
  391. package/dist/tui/review-screen.js +358 -0
  392. package/dist/tui/review-store.d.ts +60 -0
  393. package/dist/tui/review-store.js +270 -0
  394. package/dist/tui/review-team.d.ts +2 -0
  395. package/dist/tui/review-team.js +27 -0
  396. package/dist/tui/selector-mouse.d.ts +26 -0
  397. package/dist/tui/selector-mouse.js +65 -0
  398. package/dist/tui/selector.d.ts +51 -0
  399. package/dist/tui/selector.js +299 -0
  400. package/dist/tui/session-replay.d.ts +10 -0
  401. package/dist/tui/session-replay.js +78 -0
  402. package/dist/tui/session-usage.d.ts +22 -0
  403. package/dist/tui/session-usage.js +55 -0
  404. package/dist/tui/skill-transcript.d.ts +5 -0
  405. package/dist/tui/skill-transcript.js +31 -0
  406. package/dist/tui/startup.d.ts +5 -0
  407. package/dist/tui/startup.js +61 -0
  408. package/dist/tui/status-line-loader.d.ts +8 -0
  409. package/dist/tui/status-line-loader.js +33 -0
  410. package/dist/tui/status-line.d.ts +38 -0
  411. package/dist/tui/status-line.js +213 -0
  412. package/dist/tui/system-language.d.ts +8 -0
  413. package/dist/tui/system-language.js +41 -0
  414. package/dist/tui/task-labels.d.ts +2 -0
  415. package/dist/tui/task-labels.js +7 -0
  416. package/dist/tui/term-bg.d.ts +4 -0
  417. package/dist/tui/term-bg.js +67 -0
  418. package/dist/tui/terminal-screen.d.ts +12 -0
  419. package/dist/tui/terminal-screen.js +1 -0
  420. package/dist/tui/terminal-text.d.ts +7 -0
  421. package/dist/tui/terminal-text.js +123 -0
  422. package/dist/tui/theme.d.ts +25 -0
  423. package/dist/tui/theme.js +383 -0
  424. package/dist/tui/tool-style.d.ts +7 -0
  425. package/dist/tui/tool-style.js +119 -0
  426. package/dist/tui/update-prompt.d.ts +14 -0
  427. package/dist/tui/update-prompt.js +104 -0
  428. package/dist/tui/usage-footer.d.ts +9 -0
  429. package/dist/tui/usage-footer.js +123 -0
  430. package/dist/tui/vascend-login.d.ts +68 -0
  431. package/dist/tui/vascend-login.js +355 -0
  432. package/dist/tui/web-login.d.ts +28 -0
  433. package/dist/tui/web-login.js +115 -0
  434. package/dist/vascend/activity-status.d.ts +12 -0
  435. package/dist/vascend/activity-status.js +68 -0
  436. package/dist/vascend/architecture-map.d.ts +73 -0
  437. package/dist/vascend/architecture-map.js +424 -0
  438. package/dist/vascend/attention-layout.d.ts +19 -0
  439. package/dist/vascend/attention-layout.js +141 -0
  440. package/dist/vascend/budget-allocator.d.ts +31 -0
  441. package/dist/vascend/budget-allocator.js +79 -0
  442. package/dist/vascend/candidate-collector.d.ts +20 -0
  443. package/dist/vascend/candidate-collector.js +220 -0
  444. package/dist/vascend/code-events.d.ts +24 -0
  445. package/dist/vascend/code-events.js +304 -0
  446. package/dist/vascend/code-graph-memory.d.ts +38 -0
  447. package/dist/vascend/code-graph-memory.js +334 -0
  448. package/dist/vascend/code-graph-runtime.d.ts +19 -0
  449. package/dist/vascend/code-graph-runtime.js +190 -0
  450. package/dist/vascend/code-graph-types.d.ts +58 -0
  451. package/dist/vascend/code-graph-types.js +50 -0
  452. package/dist/vascend/code-parser.d.ts +4 -0
  453. package/dist/vascend/code-parser.js +257 -0
  454. package/dist/vascend/competitor-knowledge.d.ts +53 -0
  455. package/dist/vascend/competitor-knowledge.js +262 -0
  456. package/dist/vascend/completeness.d.ts +16 -0
  457. package/dist/vascend/completeness.js +90 -0
  458. package/dist/vascend/context-autotuner.d.ts +45 -0
  459. package/dist/vascend/context-autotuner.js +231 -0
  460. package/dist/vascend/context-candidate.d.ts +45 -0
  461. package/dist/vascend/context-candidate.js +150 -0
  462. package/dist/vascend/context-capsule.d.ts +51 -0
  463. package/dist/vascend/context-capsule.js +133 -0
  464. package/dist/vascend/context-fabric.d.ts +108 -0
  465. package/dist/vascend/context-fabric.js +480 -0
  466. package/dist/vascend/context-feedback-loop.d.ts +56 -0
  467. package/dist/vascend/context-feedback-loop.js +204 -0
  468. package/dist/vascend/context-learning-identity.d.ts +4 -0
  469. package/dist/vascend/context-learning-identity.js +8 -0
  470. package/dist/vascend/context-links.d.ts +14 -0
  471. package/dist/vascend/context-links.js +83 -0
  472. package/dist/vascend/context-lint.d.ts +22 -0
  473. package/dist/vascend/context-lint.js +91 -0
  474. package/dist/vascend/context-market-selection.d.ts +17 -0
  475. package/dist/vascend/context-market-selection.js +50 -0
  476. package/dist/vascend/context-metrics.d.ts +25 -0
  477. package/dist/vascend/context-metrics.js +57 -0
  478. package/dist/vascend/context-pack-render.d.ts +16 -0
  479. package/dist/vascend/context-pack-render.js +52 -0
  480. package/dist/vascend/context-pareto.d.ts +33 -0
  481. package/dist/vascend/context-pareto.js +165 -0
  482. package/dist/vascend/context-pattern-explorer.d.ts +41 -0
  483. package/dist/vascend/context-pattern-explorer.js +276 -0
  484. package/dist/vascend/context-regret.d.ts +32 -0
  485. package/dist/vascend/context-regret.js +93 -0
  486. package/dist/vascend/context-retriever.d.ts +22 -0
  487. package/dist/vascend/context-retriever.js +243 -0
  488. package/dist/vascend/context-scope-index.d.ts +5 -0
  489. package/dist/vascend/context-scope-index.js +96 -0
  490. package/dist/vascend/context-scorer.d.ts +35 -0
  491. package/dist/vascend/context-scorer.js +162 -0
  492. package/dist/vascend/context-search-index.d.ts +12 -0
  493. package/dist/vascend/context-search-index.js +25 -0
  494. package/dist/vascend/context-snapshot.d.ts +22 -0
  495. package/dist/vascend/context-snapshot.js +135 -0
  496. package/dist/vascend/context-window-compiler.d.ts +42 -0
  497. package/dist/vascend/context-window-compiler.js +237 -0
  498. package/dist/vascend/contract-memory.d.ts +61 -0
  499. package/dist/vascend/contract-memory.js +435 -0
  500. package/dist/vascend/council.d.ts +58 -0
  501. package/dist/vascend/council.js +337 -0
  502. package/dist/vascend/decision-promotion.d.ts +48 -0
  503. package/dist/vascend/decision-promotion.js +410 -0
  504. package/dist/vascend/delta-context.d.ts +12 -0
  505. package/dist/vascend/delta-context.js +36 -0
  506. package/dist/vascend/dev-context-compiler.d.ts +27 -0
  507. package/dist/vascend/dev-context-compiler.js +133 -0
  508. package/dist/vascend/dev-context-layout.d.ts +30 -0
  509. package/dist/vascend/dev-context-layout.js +262 -0
  510. package/dist/vascend/evidence-slots.d.ts +14 -0
  511. package/dist/vascend/evidence-slots.js +55 -0
  512. package/dist/vascend/expansion-levels.d.ts +15 -0
  513. package/dist/vascend/expansion-levels.js +178 -0
  514. package/dist/vascend/file-lock.d.ts +7 -0
  515. package/dist/vascend/file-lock.js +95 -0
  516. package/dist/vascend/granular-kingdom.d.ts +25 -0
  517. package/dist/vascend/granular-kingdom.js +259 -0
  518. package/dist/vascend/granular-launcher.d.ts +48 -0
  519. package/dist/vascend/granular-launcher.js +202 -0
  520. package/dist/vascend/kingdom-bus.d.ts +25 -0
  521. package/dist/vascend/kingdom-bus.js +54 -0
  522. package/dist/vascend/kingdom-channel.d.ts +22 -0
  523. package/dist/vascend/kingdom-channel.js +180 -0
  524. package/dist/vascend/kingdom-kpi.d.ts +48 -0
  525. package/dist/vascend/kingdom-kpi.js +172 -0
  526. package/dist/vascend/kingdom-live.d.ts +28 -0
  527. package/dist/vascend/kingdom-live.js +61 -0
  528. package/dist/vascend/kingdom-run.d.ts +18 -0
  529. package/dist/vascend/kingdom-run.js +506 -0
  530. package/dist/vascend/kingdom-scribe.d.ts +20 -0
  531. package/dist/vascend/kingdom-scribe.js +52 -0
  532. package/dist/vascend/kingdom.d.ts +79 -0
  533. package/dist/vascend/kingdom.js +870 -0
  534. package/dist/vascend/lexical-index.d.ts +10 -0
  535. package/dist/vascend/lexical-index.js +99 -0
  536. package/dist/vascend/lexical-search.d.ts +29 -0
  537. package/dist/vascend/lexical-search.js +262 -0
  538. package/dist/vascend/long-term-context.d.ts +51 -0
  539. package/dist/vascend/long-term-context.js +194 -0
  540. package/dist/vascend/mandate.d.ts +33 -0
  541. package/dist/vascend/mandate.js +107 -0
  542. package/dist/vascend/memory-packet.d.ts +13 -0
  543. package/dist/vascend/memory-packet.js +155 -0
  544. package/dist/vascend/memory-status.d.ts +22 -0
  545. package/dist/vascend/memory-status.js +73 -0
  546. package/dist/vascend/memory-store.d.ts +62 -0
  547. package/dist/vascend/memory-store.js +273 -0
  548. package/dist/vascend/objective-revision.d.ts +69 -0
  549. package/dist/vascend/objective-revision.js +319 -0
  550. package/dist/vascend/patch-plan-store.d.ts +33 -0
  551. package/dist/vascend/patch-plan-store.js +240 -0
  552. package/dist/vascend/patch-plan.d.ts +97 -0
  553. package/dist/vascend/patch-plan.js +345 -0
  554. package/dist/vascend/plan-progress.d.ts +11 -0
  555. package/dist/vascend/plan-progress.js +68 -0
  556. package/dist/vascend/plan-store.d.ts +64 -0
  557. package/dist/vascend/plan-store.js +460 -0
  558. package/dist/vascend/proof-chains.d.ts +19 -0
  559. package/dist/vascend/proof-chains.js +120 -0
  560. package/dist/vascend/ramification-store.d.ts +25 -0
  561. package/dist/vascend/ramification-store.js +94 -0
  562. package/dist/vascend/ramification.d.ts +193 -0
  563. package/dist/vascend/ramification.js +583 -0
  564. package/dist/vascend/recall-planner.d.ts +17 -0
  565. package/dist/vascend/recall-planner.js +109 -0
  566. package/dist/vascend/requirements.d.ts +31 -0
  567. package/dist/vascend/requirements.js +151 -0
  568. package/dist/vascend/reviewer.d.ts +9 -0
  569. package/dist/vascend/reviewer.js +93 -0
  570. package/dist/vascend/room-graph.d.ts +29 -0
  571. package/dist/vascend/room-graph.js +242 -0
  572. package/dist/vascend/room-memory.d.ts +57 -0
  573. package/dist/vascend/room-memory.js +631 -0
  574. package/dist/vascend/runtime.d.ts +84 -0
  575. package/dist/vascend/runtime.js +286 -0
  576. package/dist/vascend/self-improve.d.ts +104 -0
  577. package/dist/vascend/self-improve.js +396 -0
  578. package/dist/vascend/session-search.d.ts +52 -0
  579. package/dist/vascend/session-search.js +349 -0
  580. package/dist/vascend/supersession-graph.d.ts +14 -0
  581. package/dist/vascend/supersession-graph.js +70 -0
  582. package/dist/vascend/team-areas.d.ts +9 -0
  583. package/dist/vascend/team-areas.js +28 -0
  584. package/dist/vascend/team-handoff.d.ts +24 -0
  585. package/dist/vascend/team-handoff.js +37 -0
  586. package/dist/vascend/team-scheduler.d.ts +13 -0
  587. package/dist/vascend/team-scheduler.js +74 -0
  588. package/dist/vascend/team-session.d.ts +42 -0
  589. package/dist/vascend/team-session.js +142 -0
  590. package/dist/vascend/test-failure-memory.d.ts +76 -0
  591. package/dist/vascend/test-failure-memory.js +354 -0
  592. package/dist/vascend/token-market.d.ts +42 -0
  593. package/dist/vascend/token-market.js +144 -0
  594. package/dist/vascend/tuner-baseline-store.d.ts +52 -0
  595. package/dist/vascend/tuner-baseline-store.js +446 -0
  596. package/dist/vascend/user-profile.d.ts +44 -0
  597. package/dist/vascend/user-profile.js +131 -0
  598. package/dist/vascend/vision.d.ts +94 -0
  599. package/dist/vascend/vision.js +375 -0
  600. package/dist/vascend/work-agent.d.ts +12 -0
  601. package/dist/vascend/work-agent.js +83 -0
  602. package/dist/vascend/work-queue.d.ts +62 -0
  603. package/dist/vascend/work-queue.js +255 -0
  604. package/dist/vascend/work-runner.d.ts +64 -0
  605. package/dist/vascend/work-runner.js +137 -0
  606. package/dist/vascend/worktree.d.ts +38 -0
  607. package/dist/vascend/worktree.js +206 -0
  608. package/dist/vendor/computer-use/README.md +7 -0
  609. package/dist/vendor/computer-use/computer-desktop.js +211 -0
  610. package/dist/vendor/computer-use/computer-observe.js +315 -0
  611. package/dist/vendor/computer-use/computer-scripts.js +1230 -0
  612. package/dist/vendor/computer-use/computer-tools.js +2136 -0
  613. package/dist/vendor/computer-use/package.json +1 -0
  614. package/dist/vendor/computer-use/rac/atomic-input.js +91 -0
  615. package/dist/vendor/computer-use/rac/grammatica.js +101 -0
  616. package/dist/vendor/computer-use/rac/parser.js +185 -0
  617. package/dist/vendor/computer-use/rac/protocol.js +136 -0
  618. package/install.ps1 +30 -0
  619. package/install.sh +50 -0
  620. package/package.json +56 -0
@@ -0,0 +1,257 @@
1
+ import { fileLink, highlightDanilov, isDanilovLine } from "./branding.js";
2
+ import { isImagePath, renderImageFile } from "./images.js";
3
+ import { isAbsolute, resolve } from "node:path";
4
+ import { wrapInline } from "./markdown-inline.js";
5
+ import { isTableSeparator, renderTable, tableCells } from "./markdown-table.js";
6
+ import { terminalWidth, wrapText } from "./terminal-text.js";
7
+ export function renderMarkdown(text, opts) {
8
+ const lines = text.replace(/\r\n/g, "\n").split("\n");
9
+ const out = [];
10
+ let codeLang = null;
11
+ let codeLines = [];
12
+ const flushCode = () => {
13
+ if (codeLang === null)
14
+ return;
15
+ out.push(...renderCodeBlock(codeLines, codeLang, opts));
16
+ codeLang = null;
17
+ codeLines = [];
18
+ };
19
+ for (let index = 0; index < lines.length; index++) {
20
+ const raw = lines[index];
21
+ const fence = /^```\s*([\w-]+)?\s*$/.exec(raw);
22
+ if (fence) {
23
+ if (codeLang !== null) {
24
+ flushCode();
25
+ }
26
+ else {
27
+ codeLang = fence[1] ?? "text";
28
+ codeLines = [];
29
+ }
30
+ continue;
31
+ }
32
+ if (codeLang !== null) {
33
+ codeLines.push(raw);
34
+ continue;
35
+ }
36
+ if (raw.includes("|") && isTableSeparator(lines[index + 1] ?? "")) {
37
+ const header = tableCells(raw);
38
+ const separator = tableCells(lines[index + 1]);
39
+ if (header.length === separator.length) {
40
+ const rows = [];
41
+ index += 1;
42
+ while (lines[index + 1]?.trim() && lines[index + 1].includes("|")) {
43
+ rows.push(tableCells(lines[++index]));
44
+ }
45
+ out.push(...renderTable(header, separator, rows, opts.width, opts.theme));
46
+ continue;
47
+ }
48
+ }
49
+ out.push(...renderMarkdownLine(raw, opts));
50
+ }
51
+ flushCode();
52
+ return out.length ? out : [""];
53
+ }
54
+ function renderMarkdownLine(raw, opts) {
55
+ const line = raw.trimEnd();
56
+ if (!line.trim())
57
+ return [""];
58
+ // Immagine markdown ![alt](path): se locale e il terminale supporta grafica,
59
+ // la disegna inline; altrimenti mostra una didascalia con link al file.
60
+ const image = /^!\[([^\]]*)]\(([^)]+)\)\s*$/.exec(line);
61
+ if (image) {
62
+ const alt = (image[1] ?? "").trim();
63
+ const src = (image[2] ?? "").trim();
64
+ const caption = opts.theme.dark(`[immagine]${alt ? ` ${alt}` : ""}`);
65
+ const ctx = opts.imageCtx;
66
+ const isRemote = /^https?:\/\//i.test(src);
67
+ if (ctx && !isRemote && isImagePath(src)) {
68
+ const abs = isAbsolute(src) ? src : resolve(ctx.cwd, src);
69
+ const seq = renderImageFile(abs, ctx.env);
70
+ if (seq)
71
+ return [caption, seq];
72
+ return [caption + opts.theme.dim(` ${fileLink(abs, src)}`)];
73
+ }
74
+ return [caption + opts.theme.dim(` ${src}`)];
75
+ }
76
+ const heading = /^(#{1,6})\s+(.+)$/.exec(line);
77
+ if (heading) {
78
+ const text = heading[2] ?? "";
79
+ return wrapInline(text, opts.width, opts.theme, 0, s => opts.theme.bold((opts.theme.markdownHeading ?? opts.theme.silver)(s)));
80
+ }
81
+ const quote = /^>\s?(.*)$/.exec(line);
82
+ if (quote) {
83
+ return wrapStyled(quote[1] ?? "", Math.max(8, opts.width - 2), (s) => opts.theme.dark(`│ ${s}`));
84
+ }
85
+ const task = /^\s*[-*+] \[([ xX])]\s+(.*)$/.exec(line);
86
+ if (task) {
87
+ const mark = task[1]?.toLowerCase() === "x" ? "[x] " : "[ ] ";
88
+ return wrapInline(`${mark}${task[2] ?? ""}`, opts.width, opts.theme, 4);
89
+ }
90
+ const list = /^(\s*)([-*+] |\d+[.)] )(.*)$/.exec(line);
91
+ if (list) {
92
+ const marker = (list[2] ?? "- ").trim();
93
+ const text = list[3] ?? "";
94
+ const bullet = /^\d/.test(marker) ? `${marker} ` : "• ";
95
+ const indent = " ".repeat(Math.min(list[1].length, Math.max(0, opts.width - 6)));
96
+ const prefix = indent + bullet;
97
+ return wrapInline(text, Math.max(2, opts.width - terminalWidth(prefix)), opts.theme).map((row, index) => (index === 0 ? (opts.theme.markdownBullet ?? opts.theme.accent)(prefix) : " ".repeat(terminalWidth(prefix))) + row);
98
+ }
99
+ const hr = /^\s*(-{3,}|_{3,}|\*{3,})\s*$/.exec(line);
100
+ if (hr)
101
+ return [opts.theme.dark("─".repeat(Math.min(opts.width, 60)))];
102
+ // Notazione Danilov (riga di sezione INDICE/.../OUTPUT, @tag, relazione ->):
103
+ // la coloriamo QUI con i ruoli cromatici del formato, PRIMA che renderInline
104
+ // la avvolga in ANSI (che disattiverebbe highlightDanilov a valle). Wrappa
105
+ // sul PLAIN (highlightDanilov inserisce ANSI che non si possono spezzare),
106
+ // poi colora ogni riga risultante. Le continuazioni hanno un hanging indent.
107
+ if (isDanilovLine(line)) {
108
+ const parts = wrapPlain(line, opts.width);
109
+ if (parts.length <= 1)
110
+ return [highlightDanilov(line, opts.theme)];
111
+ return parts.map((part, index) => index === 0
112
+ ? highlightDanilov(part, opts.theme)
113
+ : opts.theme.dark(" ") + highlightDanilov(part, opts.theme));
114
+ }
115
+ return wrapInline(line, opts.width, opts.theme, 0);
116
+ }
117
+ function renderCodeBlock(lines, lang, opts) {
118
+ if (lang.toLowerCase() === "mermaid")
119
+ return renderMermaid(lines, opts);
120
+ const label = lang && lang !== "text" ? ` ${lang} ` : " code ";
121
+ const width = opts.width;
122
+ const top = opts.theme.dark(`╭─${label}${"─".repeat(Math.max(0, width - visibleLength(label) - 2))}`);
123
+ const body = lines.length ? lines : [""];
124
+ return [
125
+ top,
126
+ ...body.flatMap((line) => wrapPlain(line || " ", Math.max(8, width - 2)).map((part) => opts.theme.dark("│ ") + opts.theme.silver(part))),
127
+ opts.theme.dark(`╰${"─".repeat(Math.max(0, width - 1))}`),
128
+ ];
129
+ }
130
+ function renderMermaid(lines, opts) {
131
+ const kind = detectMermaidKind(lines);
132
+ const width = opts.width;
133
+ const title = ` mermaid · ${kind} `;
134
+ // View renderizzata per i tipi supportati; altrimenti sorgente pulito.
135
+ const view = kind === "flowchart" ? renderFlowchartView(lines, opts) :
136
+ kind === "sequence" ? renderSequenceView(lines, opts) :
137
+ kind === "pie" ? renderPieView(lines, opts) :
138
+ null;
139
+ const body = view && view.length ? view : (lines.length ? lines.map((l) => opts.theme.accent(l)) : [opts.theme.dim("(vuoto)")]);
140
+ return [
141
+ opts.theme.dark(`╭─${title}${"─".repeat(Math.max(0, width - visibleLength(title) - 2))}`),
142
+ ...body.flatMap((line) => wrapPlain(line, Math.max(8, width - 4)).map((part) => opts.theme.dark("│ ") + part)),
143
+ opts.theme.dark(`╰${"─".repeat(Math.max(0, width - 1))}`),
144
+ ];
145
+ }
146
+ // --- Mermaid view (ASCII) ---------------------------------------------------
147
+ // Estrae l'etichetta da una definizione nodo: A[Testo] / A(Testo) / A{Testo}
148
+ // / A((Testo)). Aggiorna la mappa etichette.
149
+ function harvestNodeLabels(token, labels) {
150
+ const m = /^([A-Za-z0-9_]+)\s*(?:\[([^\]]*)\]|\(\(([^)]*)\)\)|\(([^)]*)\)|\{([^}]*)\})?/.exec(token.trim());
151
+ if (!m)
152
+ return token.trim();
153
+ const id = m[1] ?? token.trim();
154
+ const label = (m[2] ?? m[3] ?? m[4] ?? m[5] ?? "").trim();
155
+ if (label)
156
+ labels.set(id, label);
157
+ return id;
158
+ }
159
+ function nodeLabel(id, labels) {
160
+ return labels.get(id) ?? id;
161
+ }
162
+ function renderFlowchartView(lines, opts) {
163
+ const labels = new Map();
164
+ const edges = [];
165
+ const edgeRe = /^(.+?)\s*(-->|---|-\.->|==>)\s*(?:\|([^|]*)\|\s*)?(.+)$/;
166
+ for (const raw of lines) {
167
+ const line = raw.trim();
168
+ if (!line || /^(graph|flowchart)\b/i.test(line) || line.startsWith("%%"))
169
+ continue;
170
+ const m = edgeRe.exec(line);
171
+ if (m) {
172
+ const from = harvestNodeLabels(m[1] ?? "", labels);
173
+ const label = (m[3] ?? "").trim();
174
+ const to = harvestNodeLabels(m[4] ?? "", labels);
175
+ edges.push({ from, to, label });
176
+ }
177
+ else {
178
+ harvestNodeLabels(line, labels);
179
+ }
180
+ }
181
+ if (!edges.length)
182
+ return [];
183
+ return edges.map(({ from, to, label }) => {
184
+ const arrow = label ? opts.theme.dim(` ──(${label})──▶ `) : opts.theme.dim(" ──▶ ");
185
+ return opts.theme.accent(`[${nodeLabel(from, labels)}]`) + arrow + opts.theme.accent(`[${nodeLabel(to, labels)}]`);
186
+ });
187
+ }
188
+ function renderSequenceView(lines, opts) {
189
+ const out = [];
190
+ const msgRe = /^(.+?)\s*(->>|-->>|->|-->|-x|--x)\s*(.+?)\s*:\s*(.*)$/;
191
+ for (const raw of lines) {
192
+ const line = raw.trim();
193
+ if (!line || /^sequenceDiagram\b/i.test(line) || line.startsWith("%%"))
194
+ continue;
195
+ const part = /^(participant|actor)\s+(.+)$/i.exec(line);
196
+ if (part) {
197
+ out.push(opts.theme.dim("• ") + opts.theme.accent((part[2] ?? "").trim()));
198
+ continue;
199
+ }
200
+ const m = msgRe.exec(line);
201
+ if (m) {
202
+ const dashed = (m[2] ?? "").includes("--");
203
+ const arrow = dashed ? " ┈┈▶ " : " ──▶ ";
204
+ out.push(opts.theme.accent((m[1] ?? "").trim()) + opts.theme.dim(arrow) + opts.theme.accent((m[3] ?? "").trim()) +
205
+ opts.theme.dim(` : ${(m[4] ?? "").trim()}`));
206
+ }
207
+ }
208
+ return out;
209
+ }
210
+ function renderPieView(lines, opts) {
211
+ const slices = [];
212
+ for (const raw of lines) {
213
+ const line = raw.trim();
214
+ const m = /^"([^"]+)"\s*:\s*([\d.]+)$/.exec(line);
215
+ if (m)
216
+ slices.push({ label: m[1] ?? "", value: Number(m[2] ?? 0) });
217
+ }
218
+ if (!slices.length)
219
+ return [];
220
+ const total = slices.reduce((a, s) => a + s.value, 0) || 1;
221
+ const labelWidth = Math.min(20, Math.max(...slices.map((s) => s.label.length)));
222
+ return slices.map((s) => {
223
+ const pct = s.value / total;
224
+ const bars = Math.round(pct * 24);
225
+ const label = s.label.padEnd(labelWidth).slice(0, labelWidth);
226
+ return opts.theme.accent(label) + " " + opts.theme.silver("█".repeat(bars)) + opts.theme.dim(` ${Math.round(pct * 100)}%`);
227
+ });
228
+ }
229
+ function detectMermaidKind(lines) {
230
+ const first = lines.map((line) => line.trim()).find(Boolean) ?? "diagram";
231
+ if (/^(graph|flowchart)\b/i.test(first))
232
+ return "flowchart";
233
+ if (/^sequenceDiagram\b/i.test(first))
234
+ return "sequence";
235
+ if (/^classDiagram\b/i.test(first))
236
+ return "class";
237
+ if (/^stateDiagram/i.test(first))
238
+ return "state";
239
+ if (/^erDiagram\b/i.test(first))
240
+ return "er";
241
+ if (/^gantt\b/i.test(first))
242
+ return "gantt";
243
+ if (/^pie\b/i.test(first))
244
+ return "pie";
245
+ return "diagram";
246
+ }
247
+ function wrapStyled(text, width, style) {
248
+ return wrapPlain(text, width).map(style);
249
+ }
250
+ export function wrapPlain(text, width) {
251
+ if (width <= 0)
252
+ return [text];
253
+ return wrapText(text, width, true);
254
+ }
255
+ function visibleLength(value) {
256
+ return value.replace(/\x1b\[[0-9;]*m/g, "").length;
257
+ }
@@ -0,0 +1,7 @@
1
+ import type { ToolCallPart } from "../core/types.js";
2
+ import type { TuiTheme } from "./branding.js";
3
+ export declare function mcpName(name: string): string | undefined;
4
+ export type McpState = "running" | "ok" | "error" | "stopped";
5
+ export declare function mcpHeader(state: McpState, t: TuiTheme, columns: number): string;
6
+ export declare function mcpPreview(call: ToolCallPart, t: TuiTheme, columns: number, state?: McpState): string[];
7
+ export declare function mcpOutput(output: string, isError: boolean | undefined, t: TuiTheme, columns: number): string[];
@@ -0,0 +1,40 @@
1
+ import { fitLine, plainText, wrapText } from "./terminal-text.js";
2
+ import { tr } from "./i18n.js";
3
+ // MCP clients expose either mcp__server__tool or server.tool names.
4
+ export function mcpName(name) {
5
+ const prefixed = /^mcp__(.+?)__(.+)$/.exec(name);
6
+ if (prefixed)
7
+ return `${prefixed[1]}.${prefixed[2]}`;
8
+ return /^[\w-]+\.[\w.-]+$/.test(name) ? name : undefined;
9
+ }
10
+ export function mcpHeader(state, t, columns) {
11
+ const color = state === "ok" ? t.green : state === "error" ? t.red : t.yellow;
12
+ const label = { running: tr("Esegue", "Calling"), ok: tr("Eseguito", "Called"),
13
+ error: tr("Errore", "Error"), stopped: tr("Fermato", "Stopped") }[state];
14
+ return fitLine(" " + color("● ") + t.bold(label), Math.max(1, columns - 1));
15
+ }
16
+ function previewRows(text, columns, limit) {
17
+ const width = Math.max(2, columns - 5);
18
+ const clean = plainText(text);
19
+ // Bound segmentation work even for multi-megabyte tool results.
20
+ const rows = wrapText(clean.slice(0, width * limit * 4), width);
21
+ const truncated = rows.length > limit || clean.length > width * limit * 4;
22
+ const visible = rows.slice(0, limit);
23
+ if (truncated)
24
+ visible.push(tr("… Ctrl+R dettagli", "… Ctrl+R details"));
25
+ return visible;
26
+ }
27
+ export function mcpPreview(call, t, columns, state = "running") {
28
+ const name = plainText(mcpName(call.name) ?? call.name);
29
+ const rows = previewRows(name + "(" + JSON.stringify(call.input) + ")", columns, 2);
30
+ let offset = 0;
31
+ return [mcpHeader(state, t, columns), ...rows.map((row, i) => {
32
+ const end = Math.max(0, Math.min(row.length, name.length - offset));
33
+ offset += row.length;
34
+ const cyan = t.markdownLink ?? t.accent;
35
+ return fitLine(t.dim(i === 0 ? " └ " : " ") + cyan(row.slice(0, end)) + t.dim(row.slice(end)), Math.max(1, columns - 1));
36
+ })];
37
+ }
38
+ export function mcpOutput(output, isError, t, columns) {
39
+ return previewRows(output || tr("(nessun output)", "(no output)"), columns, 2).map(row => fitLine(" " + (isError ? t.red : t.dim)(row), Math.max(1, columns - 1)));
40
+ }
@@ -0,0 +1,2 @@
1
+ import type { CatalogModel } from "../providers/model-catalog.js";
2
+ export declare function modelDetail(model: CatalogModel): string;
@@ -0,0 +1,21 @@
1
+ import { modelEfforts } from "../providers/model-effort.js";
2
+ export function modelDetail(model) {
3
+ const yes = (v) => v === undefined ? "?" : v ? "sì" : "no";
4
+ const count = (n) => n === undefined ? "?" : n.toLocaleString("en-US");
5
+ const efforts = modelEfforts(`${model.provider}/${model.id}`, model).filter(Boolean);
6
+ const controls = model.reasoningOptions?.map(o => o.type === "effort" ? `effort ${o.values.join(" / ")}`
7
+ : o.type === "toggle" ? "on/off" : `budget token ${o.min ?? "?"}–${o.max ?? "?"}`).join("; ");
8
+ return [model.name, model.description,
9
+ `Contesto ${count(model.context)} · output ${count(model.outputLimit)}${model.inputLimit ? ` · input ${count(model.inputLimit)}` : ""}`,
10
+ `Reasoning ${yes(model.reasoning)}${controls ? ` (${controls})` : ""}`,
11
+ `Effort in Talos: ${efforts.length ? efforts.join(" / ") : "predefinito"}`,
12
+ `Tool ${yes(model.toolCall)} · JSON strutturato ${yes(model.structuredOutput)} · temperatura ${yes(model.temperature)}`,
13
+ `Input: ${model.inputModalities.join(", ") || "?"} · output: ${model.outputModalities.join(", ") || "?"}`,
14
+ `Allegati ${yes(model.attachment)} · pesi aperti ${yes(model.openWeights)}`,
15
+ `USD/1M token: ${Object.entries(model.cost).map(([key, value]) => `${key} $${value}`).join(" · ") || "non disponibili"}`,
16
+ model.knowledge ? `Conoscenze: ${model.knowledge}` : "",
17
+ model.releaseDate ? `Rilasciato: ${model.releaseDate}` : "",
18
+ model.updatedAt ? `Dati aggiornati: ${model.updatedAt}` : "", model.status,
19
+ "Fonte: models.dev · prezzi API di base; fasce, modalità e abbonamenti possono differire",
20
+ ].filter(Boolean).join("\n");
21
+ }
@@ -0,0 +1,7 @@
1
+ import type { Harness } from "../core/bootstrap.js";
2
+ import { type ModelEffort } from "../providers/model-effort.js";
3
+ import type { InputControl } from "./repl.js";
4
+ import type { TuiTheme } from "./branding.js";
5
+ import { selectOption } from "./selector.js";
6
+ export declare function pickEffort(fullModel: string, harness: Harness, ctl: InputControl, theme: TuiTheme, terminalColumns: () => number, select?: typeof selectOption): Promise<ModelEffort | null>;
7
+ export declare function applyModelChoice(model: string, harness: Harness, ctl: InputControl, theme: TuiTheme, terminalColumns: () => number, select?: typeof selectOption): Promise<boolean>;
@@ -0,0 +1,41 @@
1
+ import { saveGlobalSettings } from "../core/settings.js";
2
+ import { cachedModelCatalog, loadModelsDev } from "../providers/models-dev.js";
3
+ import { modelEfforts } from "../providers/model-effort.js";
4
+ import { selectOption } from "./selector.js";
5
+ import { notifyStatus } from "./command-feedback.js";
6
+ const descriptions = {
7
+ "": "Impostazione predefinita del provider", none: "Reasoning disattivato", minimal: "Ragionamento minimo",
8
+ low: "Ragionamento leggero", medium: "Ragionamento intermedio", high: "Ragionamento approfondito",
9
+ xhigh: "Ragionamento molto approfondito", max: "Massimo livello disponibile per questo modello",
10
+ };
11
+ export async function pickEffort(fullModel, harness, ctl, theme, terminalColumns, select = selectOption) {
12
+ const metadata = cachedModelCatalog(harness.env).get(fullModel);
13
+ const levels = modelEfforts(fullModel, metadata);
14
+ const selected = await select({
15
+ title: `${metadata?.name ?? fullModel.split("/").pop()} · effort`,
16
+ hint: levels.length > 1 ? "Un livello maggiore può richiedere più tempo e token. Esc annulla la scelta del modello."
17
+ : metadata?.reasoning === false ? "Questo modello non supporta reasoning."
18
+ : "Nessun controllo effort verificato per questo modello e provider: usa il predefinito.",
19
+ options: levels.map(level => ({ key: level, label: level || "default", detail: descriptions[level], value: level })),
20
+ currentKey: levels.includes(harness.config.effort) ? harness.config.effort : "",
21
+ ctl, theme, terminalColumns,
22
+ });
23
+ return selected?.value ?? null;
24
+ }
25
+ export async function applyModelChoice(model, harness, ctl, theme, terminalColumns, select = selectOption) {
26
+ const resolved = harness.providers.resolve(model);
27
+ if (!resolved) {
28
+ notifyStatus(ctl, `Provider non configurato per ${model}`, true);
29
+ return false;
30
+ }
31
+ const fullModel = `${resolved.provider.id}/${resolved.modelId}`;
32
+ await loadModelsDev(harness.env);
33
+ const effort = await pickEffort(fullModel, harness, ctl, theme, terminalColumns, select);
34
+ if (effort === null)
35
+ return false;
36
+ saveGlobalSettings(harness.env, { model: fullModel, effort });
37
+ harness.setModel(fullModel);
38
+ harness.config = { ...harness.config, effort };
39
+ ctl.refresh?.();
40
+ return true;
41
+ }
@@ -0,0 +1,27 @@
1
+ export interface ScrollbackLine {
2
+ readonly id: number;
3
+ readonly text: string;
4
+ readonly through?: number;
5
+ }
6
+ export interface ScrollbackInput {
7
+ readonly lines: readonly string[];
8
+ readonly cursorRow: number;
9
+ readonly cursorCol: number;
10
+ }
11
+ export declare class NativeScrollback {
12
+ private committedThrough;
13
+ private readonly history;
14
+ private frame;
15
+ private tail;
16
+ private cursorRow;
17
+ private cursorCol;
18
+ private width;
19
+ private height;
20
+ private invalidated;
21
+ private preamble;
22
+ isCommitted(id: number): boolean;
23
+ invalidate(): void;
24
+ reset(): string;
25
+ render(log: readonly ScrollbackLine[], input: ScrollbackInput, width: number, height: number, hideCursor?: boolean, preamble?: readonly string[]): string;
26
+ release(): string;
27
+ }
@@ -0,0 +1,134 @@
1
+ import { fitLine } from "./terminal-text.js";
2
+ const RESET = "\x1b[0m\x1b]8;;\x1b\\";
3
+ const SYNC_ON = "\x1b[?2026h";
4
+ const SYNC_OFF = "\x1b[?2026l";
5
+ const move = (from, to) => from === to ? "\r"
6
+ : `\r\x1b[${Math.abs(from - to)}${to < from ? "A" : "B"}`;
7
+ // Main-buffer renderer. Completed rows are written with real newlines and
8
+ // remain in the terminal's native scrollback. Only a short recent tail and
9
+ // the composer are mutable; cursor movement never targets archived rows.
10
+ export class NativeScrollback {
11
+ committedThrough = 0;
12
+ history = [];
13
+ frame = [];
14
+ tail = [];
15
+ cursorRow = 0;
16
+ cursorCol = 1;
17
+ width = 0;
18
+ height = 0;
19
+ invalidated = false;
20
+ preamble = [];
21
+ isCommitted(id) { return id <= this.committedThrough; }
22
+ // Even a resize burst ending at the original size may have moved the frame.
23
+ invalidate() { this.invalidated = true; }
24
+ // A session change replaces both the visible frame and native scrollback.
25
+ reset() {
26
+ this.committedThrough = 0;
27
+ this.history.length = 0;
28
+ this.frame = [];
29
+ this.tail = [];
30
+ this.cursorRow = 0;
31
+ this.cursorCol = 1;
32
+ this.width = 0;
33
+ this.height = 0;
34
+ this.invalidated = false;
35
+ this.preamble = [];
36
+ return SYNC_ON + RESET + "\x1b[2J\x1b[3J\x1b[H" + SYNC_OFF;
37
+ }
38
+ render(log, input, width, height, hideCursor = false, preamble = []) {
39
+ if (width < 1 || height < 1)
40
+ return "";
41
+ const columns = Math.max(1, width);
42
+ const rows = Math.max(1, height);
43
+ const textWidth = Math.max(1, columns - 1);
44
+ const preambleChanged = preamble.length !== this.preamble.length || preamble.some((line, i) => line !== this.preamble[i]);
45
+ const resized = this.width !== 0 && (this.invalidated || this.width !== columns || this.height !== rows || preambleChanged);
46
+ // Reflow differs between xterm, ConPTY and restored/shared terminals. Once
47
+ // transient rows enter scrollback, relative cursor moves cannot erase them.
48
+ // Rebuild from the transcript instead of guessing where the old frame went.
49
+ if (resized) {
50
+ this.frame = [];
51
+ this.cursorRow = 0;
52
+ this.cursorCol = 1;
53
+ }
54
+ const capacity = Math.max(1, rows - 2);
55
+ const offset = Math.max(0, Math.min(input.cursorRow, input.lines.length - capacity));
56
+ const live = input.lines.slice(offset, offset + capacity).map(line => fitLine(line, textWidth));
57
+ // IDs are monotonic, including folded ranges. Skip archived history in
58
+ // logarithmic time instead of scanning thousands of rows every frame.
59
+ let low = 0;
60
+ let high = log.length;
61
+ while (low < high) {
62
+ const middle = low + Math.floor((high - low) / 2);
63
+ if (this.isCommitted(log[middle].id))
64
+ low = middle + 1;
65
+ else
66
+ high = middle;
67
+ }
68
+ const pending = log.slice(low);
69
+ const keep = Math.max(0, Math.min(8, rows - live.length - 1));
70
+ const split = Math.max(0, pending.length - keep);
71
+ const committed = pending.slice(0, split);
72
+ const tail = pending.slice(split);
73
+ const frame = [...tail.map(line => fitLine(line.text, textWidth)), ...live];
74
+ const row = tail.length + Math.max(0, Math.min(input.cursorRow - offset, live.length - 1));
75
+ const col = Math.max(1, Math.min(input.cursorCol, textWidth));
76
+ let start = 0;
77
+ if (!committed.length && !resized) {
78
+ while (start < frame.length && start < this.frame.length && frame[start] === this.frame[start])
79
+ start++;
80
+ }
81
+ const changed = committed.length > 0 || resized || start < Math.max(frame.length, this.frame.length);
82
+ if (!changed && row === this.cursorRow && col === this.cursorCol)
83
+ return "";
84
+ let out = SYNC_ON;
85
+ if (resized)
86
+ out += RESET + "\x1b[2J\x1b[3J\x1b[H";
87
+ if (resized || this.width === 0) {
88
+ for (const line of preamble)
89
+ out += fitLine(line, textWidth) + RESET + "\r\n";
90
+ for (const line of this.history)
91
+ out += fitLine(line.text, textWidth) + RESET + "\r\n";
92
+ }
93
+ let current = this.cursorRow;
94
+ if (changed) {
95
+ out += move(current, start) + "\x1b[J";
96
+ for (const line of committed)
97
+ out += fitLine(line.text, textWidth) + RESET + "\r\n";
98
+ out += frame.slice(start).map(line => line + RESET).join("\r\n");
99
+ current = Math.max(start, frame.length - 1);
100
+ }
101
+ out += move(current, row) + `\x1b[${col}G` + (hideCursor ? "\x1b[?25l" : "\x1b[?25h") + SYNC_OFF;
102
+ if (committed.length)
103
+ this.committedThrough = Math.max(this.committedThrough, committed.at(-1).through ?? committed.at(-1).id);
104
+ for (const line of committed)
105
+ this.history.push(line);
106
+ this.frame = frame;
107
+ this.tail = tail;
108
+ this.cursorRow = row;
109
+ this.cursorCol = col;
110
+ this.width = columns;
111
+ this.height = rows;
112
+ this.invalidated = false;
113
+ this.preamble = preamble.slice();
114
+ return out;
115
+ }
116
+ // Yield stdout to a picker or return to the shell. Keep the conversation,
117
+ // remove the transient input/status area, and leave a clean new line.
118
+ release() {
119
+ if (!this.frame.length)
120
+ return "";
121
+ const out = SYNC_ON + move(this.cursorRow, 0) + "\x1b[J"
122
+ + this.tail.map(line => fitLine(line.text, Math.max(1, this.width - 1)) + RESET + "\r\n").join("")
123
+ + "\x1b[?25h" + SYNC_OFF;
124
+ if (this.tail.length)
125
+ this.committedThrough = Math.max(this.committedThrough, this.tail.at(-1).through ?? this.tail.at(-1).id);
126
+ for (const line of this.tail)
127
+ this.history.push(line);
128
+ this.frame = [];
129
+ this.tail = [];
130
+ this.cursorRow = 0;
131
+ this.cursorCol = 1;
132
+ return out;
133
+ }
134
+ }
@@ -0,0 +1,72 @@
1
+ import { type Language, type LanguagePreference } from "./locales.js";
2
+ export type Lingua = Language;
3
+ export declare const LINGUE: readonly [{
4
+ readonly id: "it";
5
+ readonly nome: "Italiano";
6
+ }, {
7
+ readonly id: "en";
8
+ readonly nome: "English";
9
+ }, {
10
+ readonly id: "es";
11
+ readonly nome: "Español";
12
+ }, {
13
+ readonly id: "de";
14
+ readonly nome: "Deutsch";
15
+ }];
16
+ export declare const TERMINI_VERSIONE = "2026-08";
17
+ export declare const LINK_TERMINI = "https://vascend.it/terms";
18
+ export declare const LINK_PRIVACY = "https://vascend.it/privacy";
19
+ export interface StatoOnboarding {
20
+ readonly lingua?: Lingua;
21
+ readonly languagePreference?: LanguagePreference;
22
+ readonly terminiVersione?: string;
23
+ readonly terminiQuando?: string;
24
+ }
25
+ export declare function leggiOnboarding(env: NodeJS.ProcessEnv): StatoOnboarding;
26
+ export declare function salvaOnboarding(env: NodeJS.ProcessEnv, stato: StatoOnboarding): boolean;
27
+ export declare function serveLingua(stato: StatoOnboarding): boolean;
28
+ export declare function serveTermini(stato: StatoOnboarding): boolean;
29
+ export declare function consensoAffermativo(risposta: string, lingua: Lingua): boolean;
30
+ export interface TestiIngresso {
31
+ readonly byline: string;
32
+ readonly linguaTitolo: string;
33
+ readonly linguaPrompt: string;
34
+ readonly linguaNonValida: string;
35
+ readonly terminiTitolo: string;
36
+ readonly terminiCorpo: string;
37
+ readonly terminiStessiLink: string;
38
+ readonly terminiEtichetta: string;
39
+ readonly privacyEtichetta: string;
40
+ readonly terminiDomanda: string;
41
+ readonly terminiRifiutati: string;
42
+ readonly accessoTitolo: string;
43
+ readonly serveAccount: string;
44
+ readonly nessunaPassword: string;
45
+ readonly verificoAccesso: string;
46
+ readonly emailPrompt: string;
47
+ readonly serveEmail: string;
48
+ readonly contatto: (email: string) => string;
49
+ readonly accountNuovo: string;
50
+ readonly nomePrompt: string;
51
+ readonly cognomePrompt: string;
52
+ readonly registro: string;
53
+ readonly codiceInviato: string;
54
+ readonly codicePrompt: string;
55
+ readonly verifico: string;
56
+ readonly secondoFattore: string;
57
+ readonly totpPrompt: string;
58
+ readonly verifico2fa: string;
59
+ readonly identita: (chi: string) => string;
60
+ readonly tokenNonSalvabile: string;
61
+ readonly ritiroLicenza: string;
62
+ readonly licenzaPronta: string;
63
+ readonly licenzaNonDisponibile: string;
64
+ readonly benvenuto: (nome: string) => string;
65
+ readonly accessoNota: (chi: string) => string;
66
+ readonly ripartiamo: string;
67
+ readonly codiceNonValido: string;
68
+ readonly troppiTentativi: string;
69
+ readonly accessoAnnullato: string;
70
+ readonly uscireHint: string;
71
+ }
72
+ export declare const TESTI: Readonly<Record<Lingua, TestiIngresso>>;