@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,10 @@
1
+ export type ClipboardImageResult = {
2
+ ok: true;
3
+ bytes: Buffer;
4
+ mime: string;
5
+ } | {
6
+ ok: false;
7
+ reason: "empty" | "unsupported" | "busy" | "timeout";
8
+ detail: string;
9
+ };
10
+ export declare function readClipboardImage(): Promise<ClipboardImageResult>;
@@ -0,0 +1,163 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { captureWindowsClipboard } from "./clipboard-windows.js";
6
+ const CLIPBOARD_TIMEOUT_MS = 3_000;
7
+ function helperOptions(deadline) {
8
+ return { timeout: Math.max(1, deadline - Date.now()), windowsHide: true, maxBuffer: 64 * 1024 * 1024 };
9
+ }
10
+ // Esegue un comando catturando stdout binario. Ritorna il Buffer o null se il
11
+ // comando non esiste / fallisce / non produce output.
12
+ function runCapture(cmd, args, deadline) {
13
+ if (Date.now() >= deadline)
14
+ return null;
15
+ try {
16
+ const res = spawnSync(cmd, args, helperOptions(deadline));
17
+ if (res.error || res.status !== 0)
18
+ return null;
19
+ const out = res.stdout;
20
+ if (!out || out.length === 0)
21
+ return null;
22
+ return Buffer.isBuffer(out) ? out : Buffer.from(out);
23
+ }
24
+ catch {
25
+ return null;
26
+ }
27
+ }
28
+ // True se un comando e' presente nel PATH (usato per distinguere "helper
29
+ // mancante" da "clipboard vuota").
30
+ function hasCommand(cmd, deadline) {
31
+ if (Date.now() >= deadline)
32
+ return false;
33
+ try {
34
+ // `command` e' un builtin POSIX, non un eseguibile nel PATH.
35
+ const res = process.platform === "win32"
36
+ ? spawnSync("where.exe", [cmd], helperOptions(deadline))
37
+ : spawnSync("/bin/sh", ["-c", 'command -v "$1"', "talos-clipboard", cmd], helperOptions(deadline));
38
+ return res.status === 0;
39
+ }
40
+ catch {
41
+ return false;
42
+ }
43
+ }
44
+ // I byte sono un'immagine plausibile? Controlla le firme (magic numbers) dei
45
+ // formati comuni per non registrare spazzatura (es. testo) come immagine.
46
+ function sniffMime(bytes) {
47
+ if (bytes.length < 4)
48
+ return null;
49
+ // PNG: 89 50 4E 47
50
+ if (bytes[0] === 0x89 && bytes[1] === 0x50 && bytes[2] === 0x4e && bytes[3] === 0x47)
51
+ return "image/png";
52
+ // JPEG: FF D8 FF
53
+ if (bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff)
54
+ return "image/jpeg";
55
+ // GIF: "GIF8"
56
+ if (bytes[0] === 0x47 && bytes[1] === 0x49 && bytes[2] === 0x46 && bytes[3] === 0x38)
57
+ return "image/gif";
58
+ // BMP: "BM"
59
+ if (bytes[0] === 0x42 && bytes[1] === 0x4d)
60
+ return "image/bmp";
61
+ // WEBP: "RIFF"...."WEBP"
62
+ if (bytes.length >= 12 && bytes.toString("ascii", 0, 4) === "RIFF" && bytes.toString("ascii", 8, 12) === "WEBP")
63
+ return "image/webp";
64
+ return null;
65
+ }
66
+ // macOS: prova pngpaste (binario dedicato, output PNG su stdout). Se assente,
67
+ // usa AppleScript via osascript scrivendo su un file temporaneo.
68
+ function captureMac(deadline) {
69
+ if (hasCommand("pngpaste", deadline)) {
70
+ const bytes = runCapture("pngpaste", ["-"], deadline);
71
+ const mime = bytes && sniffMime(bytes);
72
+ if (bytes && mime)
73
+ return { ok: true, bytes, mime };
74
+ return { ok: false, reason: "empty", detail: "nessuna immagine nella clipboard" };
75
+ }
76
+ // Fallback senza dipendenze: AppleScript scrive il PNG della clipboard su file.
77
+ const dir = mkdtempSync(join(tmpdir(), "vascend-clip-"));
78
+ const file = join(dir, "clip.png");
79
+ const script = `set theFile to (POSIX file "${file}")\n` +
80
+ `try\n set pngData to the clipboard as «class PNGf»\n set fh to open for access theFile with write permission\n write pngData to fh\n close access fh\non error\n try\n close access theFile\n end try\n return "no-image"\nend try\nreturn "ok"`;
81
+ try {
82
+ const res = spawnSync("osascript", ["-e", script], { ...helperOptions(deadline), encoding: "utf8" });
83
+ const ok = res.status === 0 && (res.stdout ?? "").trim() === "ok" && existsSync(file);
84
+ if (ok) {
85
+ const bytes = readFileSync(file);
86
+ const mime = sniffMime(bytes);
87
+ if (mime)
88
+ return { ok: true, bytes, mime };
89
+ }
90
+ return { ok: false, reason: "empty", detail: "nessuna immagine nella clipboard" };
91
+ }
92
+ finally {
93
+ rmSync(dir, { recursive: true, force: true });
94
+ }
95
+ }
96
+ // Linux: Wayland (wl-paste) o X11 (xclip). Si prova prima il display server in
97
+ // uso, poi l'altro come fallback.
98
+ function captureLinux(deadline) {
99
+ const wayland = Boolean(process.env["WAYLAND_DISPLAY"]);
100
+ const order = wayland ? ["wl", "x"] : ["x", "wl"];
101
+ let sawHelper = false;
102
+ for (const kind of order) {
103
+ if (kind === "wl") {
104
+ if (!hasCommand("wl-paste", deadline))
105
+ continue;
106
+ sawHelper = true;
107
+ // -t image/png forza il formato PNG quando disponibile.
108
+ const bytes = runCapture("wl-paste", ["-t", "image/png"], deadline) ?? runCapture("wl-paste", ["-n"], deadline);
109
+ const mime = bytes && sniffMime(bytes);
110
+ if (bytes && mime)
111
+ return { ok: true, bytes, mime };
112
+ }
113
+ else {
114
+ if (!hasCommand("xclip", deadline))
115
+ continue;
116
+ sawHelper = true;
117
+ const bytes = runCapture("xclip", ["-selection", "clipboard", "-t", "image/png", "-o"], deadline);
118
+ const mime = bytes && sniffMime(bytes);
119
+ if (bytes && mime)
120
+ return { ok: true, bytes, mime };
121
+ }
122
+ }
123
+ if (!sawHelper) {
124
+ const need = wayland ? "wl-clipboard (wl-paste)" : "xclip";
125
+ return { ok: false, reason: "unsupported", detail: `serve ${need} per leggere l'immagine dalla clipboard` };
126
+ }
127
+ return { ok: false, reason: "empty", detail: "nessuna immagine nella clipboard" };
128
+ }
129
+ async function captureWindows(deadline) {
130
+ const res = await captureWindowsClipboard(deadline - Date.now());
131
+ const mime = sniffMime(res.bytes);
132
+ if (res.status === 0 && mime)
133
+ return { ok: true, bytes: res.bytes, mime };
134
+ if (res.failure === "timeout")
135
+ return { ok: false, reason: "timeout", detail: "lettura degli appunti scaduta; riprova con Alt+V" };
136
+ if (res.status === 20)
137
+ return { ok: false, reason: "empty", detail: "nessuna immagine nella clipboard" };
138
+ if (res.status === 21)
139
+ return { ok: false, reason: "busy", detail: "appunti ancora occupati dopo i tentativi automatici; riprova con Alt+V" };
140
+ return { ok: false, reason: "unsupported", detail: res.failure === "too-large"
141
+ ? "immagine negli appunti troppo grande (massimo 64 MB)" : "impossibile leggere l'immagine dagli appunti con PowerShell" };
142
+ }
143
+ // Punto d'ingresso: legge l'immagine dalla clipboard di sistema per la
144
+ // piattaforma corrente. Il budget e' condiviso fra helper e fallback: nessun
145
+ // processo nativo della clipboard puo' tenere la TUI in attesa senza scadenza.
146
+ export async function readClipboardImage() {
147
+ // Leave room for cold PowerShell startup plus retries without blocking the UI.
148
+ const timeout = process.platform === "win32" ? 8_000 : CLIPBOARD_TIMEOUT_MS;
149
+ const deadline = Date.now() + timeout;
150
+ try {
151
+ const result = process.platform === "darwin" ? captureMac(deadline)
152
+ : process.platform === "linux" ? captureLinux(deadline)
153
+ : process.platform === "win32" ? await captureWindows(deadline)
154
+ : { ok: false, reason: "unsupported", detail: `piattaforma ${process.platform} non supportata` };
155
+ if (!result.ok && Date.now() >= deadline) {
156
+ return { ok: false, reason: "timeout", detail: `lettura clipboard interrotta dopo ${timeout} ms; riprova con Alt+V` };
157
+ }
158
+ return result;
159
+ }
160
+ catch (error) {
161
+ return { ok: false, reason: "unsupported", detail: `clipboard non disponibile: ${error.message}` };
162
+ }
163
+ }
@@ -0,0 +1,9 @@
1
+ import type { Message } from "../core/types.js";
2
+ export interface ClipboardCommand {
3
+ readonly command: string;
4
+ readonly args: readonly string[];
5
+ }
6
+ export declare function clipboardCommands(platform: NodeJS.Platform, env: NodeJS.ProcessEnv): readonly ClipboardCommand[];
7
+ export declare function lastAssistantText(messages: readonly Message[]): string | null;
8
+ export declare function runClipboardCommand(spec: ClipboardCommand, text: string): Promise<boolean>;
9
+ export declare function copyText(text: string, run?: typeof runClipboardCommand, platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): Promise<boolean>;
@@ -0,0 +1,51 @@
1
+ import { spawn } from "node:child_process";
2
+ // Il testo viaggia solo su stdin, mai come codice o argomento della shell.
3
+ export function clipboardCommands(platform, env) {
4
+ if (platform === "win32")
5
+ return [{ command: "powershell.exe", args: ["-NoProfile", "-NonInteractive", "-STA", "-Command",
6
+ "[Console]::InputEncoding = [System.Text.Encoding]::UTF8; $text = [Console]::In.ReadToEnd(); Set-Clipboard -Value $text -ErrorAction Stop"] }];
7
+ if (platform === "darwin")
8
+ return [{ command: "pbcopy", args: [] }];
9
+ if (platform === "linux")
10
+ return [
11
+ ...(env.WAYLAND_DISPLAY ? [{ command: "wl-copy", args: [] }] : []),
12
+ ...(env.DISPLAY ? [{ command: "xclip", args: ["-selection", "clipboard"] }, { command: "xsel", args: ["--clipboard", "--input"] }] : []),
13
+ ];
14
+ return [];
15
+ }
16
+ export function lastAssistantText(messages) {
17
+ for (let i = messages.length - 1; i >= 0; i--) {
18
+ const message = messages[i];
19
+ if (message.role !== "assistant")
20
+ continue;
21
+ const text = message.content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n");
22
+ if (text.trim())
23
+ return text;
24
+ }
25
+ return null;
26
+ }
27
+ export function runClipboardCommand(spec, text) {
28
+ return new Promise((resolve) => {
29
+ const child = spawn(spec.command, [...spec.args], { stdio: ["pipe", "ignore", "ignore"], windowsHide: true, shell: false });
30
+ let settled = false;
31
+ const finish = (ok) => {
32
+ if (settled)
33
+ return;
34
+ settled = true;
35
+ clearTimeout(timer);
36
+ resolve(ok);
37
+ };
38
+ const timer = setTimeout(() => { child.kill(); finish(false); }, 2000);
39
+ child.once("error", () => finish(false));
40
+ child.once("close", (code) => finish(code === 0));
41
+ child.stdin.on("error", () => { child.kill(); finish(false); });
42
+ child.stdin.end(text, "utf8");
43
+ });
44
+ }
45
+ export async function copyText(text, run = runClipboardCommand, platform = process.platform, env = process.env) {
46
+ for (const command of clipboardCommands(platform, env)) {
47
+ if (await run(command, text))
48
+ return true;
49
+ }
50
+ return false;
51
+ }
@@ -0,0 +1,8 @@
1
+ export declare const WINDOWS_CLIPBOARD_SCRIPT = "\n$ErrorActionPreference = 'Stop'\nAdd-Type -AssemblyName System.Windows.Forms,System.Drawing\n$lastReadFailed = $false\nfor ($attempt = 0; $attempt -lt 16; $attempt++) {\n $image = $null\n $png = $null\n $stream = $null\n try {\n $data = [System.Windows.Forms.Clipboard]::GetDataObject()\n $bytes = $null\n if ($null -ne $data) {\n if ($data.GetDataPresent('PNG', $false)) {\n $png = $data.GetData('PNG', $false)\n if ($png -is [System.IO.MemoryStream]) { $bytes = $png.ToArray() }\n elseif ($png -is [byte[]]) { $bytes = $png }\n }\n if ($null -eq $bytes -or $bytes.Length -lt 8) {\n $image = $data.GetData([System.Windows.Forms.DataFormats]::Bitmap, $true)\n if ($image -is [System.Drawing.Image]) {\n $stream = New-Object System.IO.MemoryStream\n $image.Save($stream, [System.Drawing.Imaging.ImageFormat]::Png)\n $bytes = $stream.ToArray()\n }\n }\n if ($null -ne $bytes -and $bytes.Length -ge 8) {\n $stdout = [Console]::OpenStandardOutput()\n $stdout.Write($bytes, 0, $bytes.Length)\n $stdout.Flush()\n exit 0\n }\n }\n $lastReadFailed = $false\n } catch { $lastReadFailed = $true }\n finally {\n if ($image -is [System.IDisposable]) { $image.Dispose() }\n if ($png -is [System.IDisposable]) { $png.Dispose() }\n if ($null -ne $stream) { $stream.Dispose() }\n }\n if ($attempt -lt 15) { Start-Sleep -Milliseconds 120 }\n}\nif ($lastReadFailed) { exit 21 }\nexit 20\n";
2
+ export interface ClipboardHelperResult {
3
+ readonly status: number | null;
4
+ readonly bytes: Buffer;
5
+ readonly failure?: "timeout" | "unavailable" | "too-large";
6
+ }
7
+ export declare function runClipboardImageHelper(command: string, args: readonly string[], timeout: number): Promise<ClipboardHelperResult>;
8
+ export declare function captureWindowsClipboard(timeout: number): Promise<ClipboardHelperResult>;
@@ -0,0 +1,84 @@
1
+ import { spawn } from "node:child_process";
2
+ // One STA process retries while the clipboard owner publishes a screenshot or
3
+ // temporarily holds the clipboard lock. PNG preserves alpha when available;
4
+ // Bitmap also covers DIB images produced by screenshot tools.
5
+ export const WINDOWS_CLIPBOARD_SCRIPT = `
6
+ $ErrorActionPreference = 'Stop'
7
+ Add-Type -AssemblyName System.Windows.Forms,System.Drawing
8
+ $lastReadFailed = $false
9
+ for ($attempt = 0; $attempt -lt 16; $attempt++) {
10
+ $image = $null
11
+ $png = $null
12
+ $stream = $null
13
+ try {
14
+ $data = [System.Windows.Forms.Clipboard]::GetDataObject()
15
+ $bytes = $null
16
+ if ($null -ne $data) {
17
+ if ($data.GetDataPresent('PNG', $false)) {
18
+ $png = $data.GetData('PNG', $false)
19
+ if ($png -is [System.IO.MemoryStream]) { $bytes = $png.ToArray() }
20
+ elseif ($png -is [byte[]]) { $bytes = $png }
21
+ }
22
+ if ($null -eq $bytes -or $bytes.Length -lt 8) {
23
+ $image = $data.GetData([System.Windows.Forms.DataFormats]::Bitmap, $true)
24
+ if ($image -is [System.Drawing.Image]) {
25
+ $stream = New-Object System.IO.MemoryStream
26
+ $image.Save($stream, [System.Drawing.Imaging.ImageFormat]::Png)
27
+ $bytes = $stream.ToArray()
28
+ }
29
+ }
30
+ if ($null -ne $bytes -and $bytes.Length -ge 8) {
31
+ $stdout = [Console]::OpenStandardOutput()
32
+ $stdout.Write($bytes, 0, $bytes.Length)
33
+ $stdout.Flush()
34
+ exit 0
35
+ }
36
+ }
37
+ $lastReadFailed = $false
38
+ } catch { $lastReadFailed = $true }
39
+ finally {
40
+ if ($image -is [System.IDisposable]) { $image.Dispose() }
41
+ if ($png -is [System.IDisposable]) { $png.Dispose() }
42
+ if ($null -ne $stream) { $stream.Dispose() }
43
+ }
44
+ if ($attempt -lt 15) { Start-Sleep -Milliseconds 120 }
45
+ }
46
+ if ($lastReadFailed) { exit 21 }
47
+ exit 20
48
+ `;
49
+ // No shell and no synchronous child process: typing, rendering and agent
50
+ // events remain responsive throughout PowerShell startup and clipboard reads.
51
+ export function runClipboardImageHelper(command, args, timeout) {
52
+ return new Promise(resolve => {
53
+ const child = spawn(command, [...args], { windowsHide: true, shell: false, stdio: ["ignore", "pipe", "ignore"] });
54
+ const chunks = [];
55
+ let size = 0;
56
+ let settled = false;
57
+ const finish = (status, failure) => {
58
+ if (settled)
59
+ return;
60
+ settled = true;
61
+ clearTimeout(timer);
62
+ resolve({ status, bytes: failure ? Buffer.alloc(0) : Buffer.concat(chunks), ...(failure ? { failure } : {}) });
63
+ };
64
+ const timer = setTimeout(() => { child.kill(); finish(null, "timeout"); }, Math.max(1, timeout));
65
+ child.stdout.on("data", (chunk) => {
66
+ if (settled)
67
+ return;
68
+ size += chunk.length;
69
+ if (size > 64 * 1024 * 1024) {
70
+ child.kill();
71
+ finish(null, "too-large");
72
+ }
73
+ else
74
+ chunks.push(chunk);
75
+ });
76
+ child.stdout.on("error", () => { child.kill(); finish(null, "unavailable"); });
77
+ child.once("error", () => finish(null, "unavailable"));
78
+ child.once("close", status => finish(status));
79
+ });
80
+ }
81
+ export function captureWindowsClipboard(timeout) {
82
+ return runClipboardImageHelper("powershell.exe", ["-NoProfile", "-NonInteractive", "-STA", "-EncodedCommand",
83
+ Buffer.from(WINDOWS_CLIPBOARD_SCRIPT, "utf16le").toString("base64")], timeout);
84
+ }
@@ -0,0 +1,15 @@
1
+ import { type CollapsibleRegistry } from "../core/collapsible-output.js";
2
+ export interface CollapsibleSink {
3
+ write(text: string): void;
4
+ logLength(): number;
5
+ fold(start: number, end: number, summary: string): number;
6
+ }
7
+ export interface WriteCollapsibleOptions {
8
+ readonly summary: string;
9
+ readonly body: string;
10
+ readonly collapseThreshold?: number;
11
+ readonly registry?: CollapsibleRegistry;
12
+ readonly command?: string;
13
+ }
14
+ export declare function writeCollapsibleOutput(sink: CollapsibleSink, opts: WriteCollapsibleOptions): string | null;
15
+ export declare function foldSummaryLine(lines: number, command?: string): string;
@@ -0,0 +1,48 @@
1
+ // Ponte fra l'OUTPUT dei comandi slash e il sistema collassabile/navigabile.
2
+ //
3
+ // I comandi "legacy" stampavano testo lungo INLINE con ctl.write: restava in
4
+ // chat per sempre, gonfiando lo scrollback. Questa utility li migra al sistema
5
+ // collassabile: l'output viene scritto, poi COLLASSATO in una riga di sintesi
6
+ // (fold della regione viva, espandibile con /expand) e registrato nel
7
+ // CollapsibleRegistry per il lifecycle (apri/chiudi + cleanup della memoria).
8
+ //
9
+ // Disaccoppiata dai singoli comandi: ognuno passa solo summary + corpo. Niente
10
+ // dipendenze a runtime oltre alle due primitive dei prerequisiti.
11
+ import { collapsibleRegistry } from "../core/collapsible-output.js";
12
+ const DEFAULT_THRESHOLD = 8;
13
+ // Scrive `body` in chat in forma COLLASSABILE: stampa la `summary`, poi il corpo,
14
+ // quindi collassa il corpo lasciando visibile la sola summary (espandibile).
15
+ // Registra il blocco nel CollapsibleRegistry per il lifecycle/cleanup e ritorna
16
+ // l'id del blocco registrato (o null se l'output era troppo corto per collassare).
17
+ export function writeCollapsibleOutput(sink, opts) {
18
+ const { summary, body } = opts;
19
+ const threshold = opts.collapseThreshold ?? DEFAULT_THRESHOLD;
20
+ const registry = opts.registry ?? collapsibleRegistry;
21
+ const bodyLines = body.replace(/\n+$/, "").split("\n");
22
+ // Output corto: nessun beneficio dal collasso, scrivi inline e basta.
23
+ if (bodyLines.length <= threshold) {
24
+ sink.write(body.endsWith("\n") ? body : body + "\n");
25
+ return null;
26
+ }
27
+ // Registra nel registry (lifecycle/cleanup). Il contenuto e' lazy: viene
28
+ // materializzato solo all'apertura e rilasciato alla chiusura.
29
+ const coId = registry.register({
30
+ summary,
31
+ content: () => body,
32
+ open: false,
33
+ });
34
+ // Scrive la riga di sintesi (sempre visibile) seguita dal corpo, poi collassa
35
+ // SOLO il corpo in un fold: in chat resta la summary, il corpo si apre con
36
+ // /expand. La summary include l'hint d'uso.
37
+ sink.write(summary.endsWith("\n") ? summary : summary + "\n");
38
+ const start = sink.logLength();
39
+ sink.write(body.endsWith("\n") ? body : body + "\n");
40
+ const end = sink.logLength();
41
+ sink.fold(start, end, foldSummaryLine(bodyLines.length, opts.command));
42
+ return coId;
43
+ }
44
+ // Riga di sintesi del fold collassato (mostrata al posto del corpo nascosto).
45
+ export function foldSummaryLine(lines, command) {
46
+ const what = command ? `/${command}` : "output";
47
+ return ` … ${what}: ${lines} righe collassate · /expand per aprire`;
48
+ }
@@ -0,0 +1,10 @@
1
+ interface FeedbackControl {
2
+ write(text: string): void;
3
+ writeConversation?(text: string): void;
4
+ setStatus(label: string | null): void;
5
+ setRoomStatus?(label: string | null, state?: "running" | "done" | "failed"): void;
6
+ refresh?(): void;
7
+ }
8
+ export declare function notifyStatus(ctl: FeedbackControl, text: string, failed?: boolean): void;
9
+ export declare function withCommandFeedback<T, C extends FeedbackControl>(ctl: C, run: (control: C) => Promise<T>, show: (lines: readonly string[]) => Promise<void>): Promise<T>;
10
+ export {};
@@ -0,0 +1,46 @@
1
+ import { plainText } from "./terminal-text.js";
2
+ export function notifyStatus(ctl, text, failed = false) {
3
+ const label = plainText(text).replace(/\s+/g, " ").trim();
4
+ if (!label)
5
+ return;
6
+ if (ctl.setRoomStatus)
7
+ ctl.setRoomStatus(label, failed ? "failed" : "done");
8
+ else
9
+ ctl.setStatus(label);
10
+ }
11
+ // Each command gets a private output sink: even nested menus, extensions and
12
+ // failures cannot accidentally commit operational text to native scrollback.
13
+ // The original sink remains available only for replaying conversation content.
14
+ export async function withCommandFeedback(ctl, run, show) {
15
+ let output = "";
16
+ let failed = false;
17
+ const commandCtl = new Proxy(ctl, {
18
+ get(target, prop, receiver) {
19
+ if (prop === "write")
20
+ return (text) => { output = (output + text).slice(-256_000); };
21
+ if (prop === "writeConversation")
22
+ return (target.writeConversation ?? target.write).bind(target);
23
+ // Command output is a panel, so it must never create chat folds.
24
+ if (prop === "logLength")
25
+ return () => -1;
26
+ const value = Reflect.get(target, prop, receiver);
27
+ return typeof value === "function" ? value.bind(target) : value;
28
+ },
29
+ });
30
+ try {
31
+ return await run(commandCtl);
32
+ }
33
+ catch (error) {
34
+ failed = true;
35
+ output += `\n${error instanceof Error ? error.message : String(error)}`;
36
+ throw error;
37
+ }
38
+ finally {
39
+ const lines = plainText(output).trim().split("\n").filter(l => l.trim());
40
+ if (lines.length === 1 && lines[0].length < 180)
41
+ notifyStatus(ctl, lines[0], failed);
42
+ else if (lines.length > 1 || lines[0])
43
+ await show(lines);
44
+ ctl.refresh?.();
45
+ }
46
+ }
@@ -0,0 +1,28 @@
1
+ import { type CommandCategory } from "./commands.js";
2
+ export type OutputKind = "navigable" | "static" | "transient" | "none";
3
+ export type OutputMechanism = "panel" | "notice" | "picker" | "multi-level-picker" | "live-viewer" | "fold" | "inline-text" | "action";
4
+ export interface CommandOutputEntry {
5
+ readonly name: string;
6
+ readonly category: CommandCategory;
7
+ readonly output: OutputKind;
8
+ readonly mechanism: OutputMechanism;
9
+ readonly argDependent: boolean;
10
+ readonly longOutput: boolean;
11
+ readonly note: string;
12
+ }
13
+ export declare function outputEntries(): readonly CommandOutputEntry[];
14
+ export declare function outputEntry(name: string): CommandOutputEntry | undefined;
15
+ export declare function isNavigable(name: string): boolean;
16
+ export declare function navigableCommands(): readonly CommandOutputEntry[];
17
+ export declare function nonNavigableCommands(): readonly CommandOutputEntry[];
18
+ export declare function migrationCandidates(): readonly CommandOutputEntry[];
19
+ export declare function needsMigration(name: string): boolean;
20
+ export interface OutputRegistrySummary {
21
+ readonly total: number;
22
+ readonly navigable: number;
23
+ readonly static: number;
24
+ readonly transient: number;
25
+ readonly none: number;
26
+ readonly toMigrate: number;
27
+ }
28
+ export declare function outputRegistrySummary(): OutputRegistrySummary;
@@ -0,0 +1,103 @@
1
+ // Registro/inventario dell'OUTPUT dei comandi slash builtin.
2
+ //
3
+ // Mappa OGNI comando builtin (vedi BUILTIN_COMMANDS) alla NATURA del suo output,
4
+ // marcando quali gestiscono gia' OUTPUT NAVIGABILE (picker/lista con frecce,
5
+ // fold espandibili, paginazione) e quali no (testo statico inline, o nessun
6
+ // output). Serve a chi deve MIGRARE i comandi verso un output navigabile/
7
+ // collassabile uniforme: l'interfaccia qui sotto identifica i candidati.
8
+ //
9
+ // Parte PURA: solo dati e funzioni pure, nessuna dipendenza a runtime.
10
+ import { BUILTIN_COMMANDS } from "./commands.js";
11
+ // Inventario completo: una voce per ciascun comando builtin canonico.
12
+ // Classificazione derivata dall'analisi dei case di dispatch in repl.ts.
13
+ const ENTRIES = [
14
+ { name: "fast", category: "modello", output: "transient", mechanism: "notice", argDependent: true, longOutput: false, note: "imposta o mostra Fast; indicatore accanto al modello" },
15
+ { name: "queue", category: "interfaccia", output: "navigable", mechanism: "live-viewer", argDependent: false, longOutput: true, note: "gestione immediata dei messaggi in attesa, modifica e momento di consegna" },
16
+ { name: "review", category: "interfaccia", output: "navigable", mechanism: "live-viewer", argDependent: true, longOutput: true, note: "schermata dedicata con sezioni, ricerca e dettaglio per operazione; Ctrl+R anche durante il run" },
17
+ { name: "help", category: "sistema", output: "navigable", mechanism: "picker", argDependent: false, longOutput: false, note: "palette comandi temporanea, Esc chiude senza lasciare testo" },
18
+ { name: "copy", category: "interfaccia", output: "transient", mechanism: "notice", argDependent: true, longOutput: false, note: "copia testo negli appunti locali; conferma solo se il helper riesce" },
19
+ { name: "rename", category: "sessione", output: "transient", mechanism: "notice", argDependent: true, longOutput: false, note: "salva un titolo della chat; errore di sintassi se assente" },
20
+ { name: "commands", category: "sistema", output: "navigable", mechanism: "picker", argDependent: false, longOutput: true, note: "palette di TUTTI i comandi (builtin, estensioni, template, skill); Enter esegue la voce scelta" },
21
+ { name: "model", category: "modello", output: "navigable", mechanism: "picker", argDependent: true, longOutput: false, note: "picker modelli se senza arg; testo di conferma se passato un nome" },
22
+ { name: "models", category: "modello", output: "navigable", mechanism: "picker", argDependent: false, longOutput: false, note: "pickModel: selettore con frecce" },
23
+ { name: "provider", category: "modello", output: "navigable", mechanism: "picker", argDependent: false, longOutput: false, note: "providerMenu navigabile" },
24
+ { name: "login", category: "modello", output: "navigable", mechanism: "picker", argDependent: false, longOutput: false, note: "stato abbonamenti, poche righe statiche" },
25
+ { name: "usage", category: "modello", output: "transient", mechanism: "notice", argDependent: false, longOutput: false, note: "usage provider esatto separato dalla stima locale del contesto" },
26
+ { name: "effort", category: "modello", output: "navigable", mechanism: "picker", argDependent: true, longOutput: false, note: "picker livelli se senza arg; indicatore aggiornato se passato" },
27
+ { name: "vibe", category: "vibe", output: "navigable", mechanism: "picker", argDependent: true, longOutput: false, note: "picker dei profili vibecoding; argomento imposta direttamente" },
28
+ { name: "context", category: "vibe", output: "navigable", mechanism: "fold", argDependent: true, longOutput: true, note: "ricevuta Context Fabric collassabile, epoch, lease e gestione pin" },
29
+ { name: "arch", category: "vibe", output: "navigable", mechanism: "fold", argDependent: true, longOutput: true, note: "mappa architetturale collassabile: moduli, dipendenze, cicli, entry point, hotspot" },
30
+ { name: "theme", category: "interfaccia", output: "navigable", mechanism: "picker", argDependent: true, longOutput: false, note: "picker temi se senza arg; indicatore aggiornato se passato" },
31
+ { name: "compact", category: "vascend", output: "transient", mechanism: "notice", argDependent: false, longOutput: false, note: "stream di progresso compattazione, poche righe" },
32
+ { name: "vascend", category: "vascend", output: "navigable", mechanism: "panel", argDependent: true, longOutput: true, note: "messaggio + renderVascendStatus in pannello temporaneo; lo status puo' crescere" },
33
+ { name: "todo", category: "attivita", output: "navigable", mechanism: "multi-level-picker", argDependent: false, longOutput: true, note: "lista dei gruppi e delle attività con stato; fallback testo se non TTY" },
34
+ { name: "collaboratori", category: "attivita", output: "navigable", mechanism: "live-viewer", argDependent: true, longOutput: true, note: "viewer live dei collaboratori paralleli + report finale" },
35
+ { name: "bg", category: "sistema", output: "navigable", mechanism: "panel", argDependent: true, longOutput: true, note: "lista o output di un task; l'output del task puo' essere lungo" },
36
+ { name: "expand", category: "interfaccia", output: "navigable", mechanism: "fold", argDependent: true, longOutput: false, note: "espande fold collassati gia' esistenti" },
37
+ { name: "img", category: "interfaccia", output: "transient", mechanism: "notice", argDependent: true, longOutput: false, note: "allega img #N: anteprima in pannello temporaneo da path; senza arg legge la clipboard di sistema" },
38
+ { name: "config", category: "sistema", output: "navigable", mechanism: "panel", argDependent: false, longOutput: true, note: "blocco di configurazione in pannello temporaneo, puo' essere lungo" },
39
+ { name: "cwd", category: "sistema", output: "transient", mechanism: "notice", argDependent: true, longOutput: false, note: "mostra il progetto; per cambiarlo propone un riavvio sicuro con talos -C" },
40
+ { name: "reload", category: "sistema", output: "transient", mechanism: "notice", argDependent: false, longOutput: false, note: "ricarica le estensioni a caldo; poche righe di diff dei tool" },
41
+ { name: "extensions", category: "sistema", output: "navigable", mechanism: "panel", argDependent: true, longOutput: true, note: "lista/gestione estensioni in pannello temporaneo; l'elenco cresce col numero di estensioni" },
42
+ { name: "tree", category: "sessione", output: "navigable", mechanism: "panel", argDependent: true, longOutput: true, note: "lista nodi sessione (statica); con id e' azione di checkout" },
43
+ { name: "sessions", category: "sessione", output: "navigable", mechanism: "panel", argDependent: false, longOutput: true, note: "elenco sessioni in pannello temporaneo, cresce col numero di sessioni" },
44
+ { name: "resume", category: "sessione", output: "navigable", mechanism: "picker", argDependent: true, longOutput: false, note: "picker sessioni se senza arg; azione diretta se passato id" },
45
+ { name: "new", category: "sessione", output: "none", mechanism: "action", argDependent: false, longOutput: false, note: "crea una sessione nuova e vuota (alias /clear); azzera il contesto" },
46
+ { name: "language", category: "interfaccia", output: "navigable", mechanism: "picker", argDependent: true, longOutput: false, note: "sceglie la lingua o segue il sistema; preferenza persistita" },
47
+ { name: "logout", category: "sistema", output: "transient", mechanism: "notice", argDependent: false, longOutput: false, note: "revoca best-effort sul backend + rimozione del token locale; una riga di conferma" },
48
+ { name: "quit", category: "sistema", output: "none", mechanism: "action", argDependent: false, longOutput: false, note: "esce, nessun output" },
49
+ ];
50
+ // Mappa nome canonico -> voce, per lookup O(1).
51
+ const BY_NAME = new Map(ENTRIES.map((e) => [e.name, e]));
52
+ // Tutte le voci dell'inventario.
53
+ export function outputEntries() {
54
+ return ENTRIES;
55
+ }
56
+ // Voce per un comando dato il nome (accetta anche gli ALIAS dei builtin, es.
57
+ // "themes" -> "theme", "castello" -> "piano"). undefined se sconosciuto.
58
+ export function outputEntry(name) {
59
+ const direct = BY_NAME.get(name);
60
+ if (direct)
61
+ return direct;
62
+ const canonical = aliasToCanonical(name);
63
+ return canonical ? BY_NAME.get(canonical) : undefined;
64
+ }
65
+ // Risolve un alias builtin al nome canonico (o ritorna name se gia' canonico).
66
+ function aliasToCanonical(name) {
67
+ const cmd = BUILTIN_COMMANDS.find((c) => c.name === name || (c.aliases ?? []).includes(name));
68
+ return cmd?.name;
69
+ }
70
+ // True se il comando gestisce gia' output NAVIGABILE.
71
+ export function isNavigable(name) {
72
+ return outputEntry(name)?.output === "navigable";
73
+ }
74
+ // Comandi che gestiscono gia' output navigabile.
75
+ export function navigableCommands() {
76
+ return ENTRIES.filter((e) => e.output === "navigable");
77
+ }
78
+ // Comandi NON navigabili (static o none). Universo dei potenziali da rivedere.
79
+ export function nonNavigableCommands() {
80
+ return ENTRIES.filter((e) => e.output !== "navigable");
81
+ }
82
+ // INTERFACCIA CHIAVE per la migrazione: i comandi DA MIGRARE verso output
83
+ // navigabile. Criterio: output statico (inline) E potenzialmente lungo. I
84
+ // comandi "none" (azioni senza output) non si migrano; quelli statici corti
85
+ // (es. login, compact) non ne traggono beneficio reale.
86
+ export function migrationCandidates() {
87
+ return ENTRIES.filter((e) => e.output === "static" && e.longOutput);
88
+ }
89
+ // True se il comando e' un candidato alla migrazione.
90
+ export function needsMigration(name) {
91
+ const e = outputEntry(name);
92
+ return e !== undefined && e.output === "static" && e.longOutput;
93
+ }
94
+ export function outputRegistrySummary() {
95
+ return {
96
+ total: ENTRIES.length,
97
+ navigable: ENTRIES.filter((e) => e.output === "navigable").length,
98
+ transient: ENTRIES.filter((e) => e.output === "transient").length,
99
+ static: ENTRIES.filter((e) => e.output === "static").length,
100
+ none: ENTRIES.filter((e) => e.output === "none").length,
101
+ toMigrate: migrationCandidates().length,
102
+ };
103
+ }
@@ -0,0 +1,12 @@
1
+ import type { ToolCallPart } from "../core/types.js";
2
+ import type { TuiTheme } from "./branding.js";
3
+ export type CommandState = "running" | "ok" | "error" | "background" | "stopped";
4
+ export declare function commandSource(call: Pick<ToolCallPart, "name" | "input">): string | undefined;
5
+ export declare function highlightCommand(source: string, t: TuiTheme): string;
6
+ export declare function commandHeader(firstRow: string, state: CommandState, t: TuiTheme, columns: number): string;
7
+ export declare function commandPreview(source: string, t: TuiTheme, columns: number, state?: CommandState): {
8
+ firstRow: string;
9
+ lines: string[];
10
+ };
11
+ export declare function commandOutput(output: string, t: TuiTheme, columns: number, isError?: boolean): string[];
12
+ export declare function commandResultState(output: string, isError?: boolean): CommandState;