@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,60 @@
1
+ import type { AgentEvent, Message, ToolCallPart } from "../core/types.js";
2
+ export type ReviewState = "running" | "ok" | "error" | "stopped" | "info";
3
+ export type ReviewKind = "tool" | "file" | "team" | "notice";
4
+ export interface ReviewChange {
5
+ readonly before?: string;
6
+ readonly after: string;
7
+ readonly scope: "file" | "fragment" | "append" | "reported";
8
+ }
9
+ export interface ReviewEntry {
10
+ readonly id: string;
11
+ readonly kind: ReviewKind;
12
+ readonly title: string;
13
+ readonly tool?: string;
14
+ readonly target: string;
15
+ readonly actor: string;
16
+ readonly state: ReviewState;
17
+ readonly startedAt?: number;
18
+ readonly endedAt?: number;
19
+ readonly input?: Readonly<Record<string, unknown>>;
20
+ readonly output?: string;
21
+ readonly change?: ReviewChange;
22
+ readonly parentId?: string;
23
+ readonly role?: string;
24
+ readonly parent?: string;
25
+ }
26
+ export declare function reviewTitle(name: string): string;
27
+ export declare function callTarget(call: ToolCallPart): string;
28
+ export declare class ReviewStore {
29
+ private readonly capacity;
30
+ private items;
31
+ private callIndex;
32
+ private actorText;
33
+ private sequence;
34
+ private run;
35
+ private _revision;
36
+ private _evicted;
37
+ private _running;
38
+ private _label;
39
+ private _goal;
40
+ constructor(capacity?: number);
41
+ get revision(): number;
42
+ get evicted(): number;
43
+ get running(): boolean;
44
+ get label(): string;
45
+ get goal(): string;
46
+ entries(): readonly ReviewEntry[];
47
+ get(id: string): ReviewEntry | undefined;
48
+ begin(goal: string): void;
49
+ finish(interrupted?: boolean): void;
50
+ reset(history?: readonly Message[]): void;
51
+ change(callId: string, change: ReviewChange): void;
52
+ record(event: AgentEvent, at?: number | undefined, actor?: string): void;
53
+ recordActor(actor: string, event: AgentEvent): void;
54
+ private recordKingdom;
55
+ private actorId;
56
+ private finishActor;
57
+ private callId;
58
+ private notice;
59
+ private put;
60
+ }
@@ -0,0 +1,270 @@
1
+ import { oneLine } from "./terminal-text.js";
2
+ const LABELS = {
3
+ read_file: "Lettura", list_dir: "Cartella", grep: "Ricerca", glob: "Ricerca file",
4
+ write_file: "Scrittura", edit_file: "Modifica", bash: "Comando", bash_bg: "Comando in background",
5
+ run_program: "Programma", tool_search: "Ricerca strumenti", tool_invoke: "Strumento",
6
+ ask_user: "Domanda", vascend_plan: "Lista attività", vascend_mark: "Stato attività",
7
+ vascend_note: "Nota", vascend_addtasks: "Nuove attività", kingdoms_warm: "Collaboratori",
8
+ vascend_addrooms: "Nuove attività", vascend_status: "Lista attività",
9
+ kingdom_send: "Messaggio al team", kingdom_inbox: "Messaggi del team", kingdom_wait: "Attesa collaboratori",
10
+ };
11
+ export function reviewTitle(name) { return LABELS[name] ?? name; }
12
+ export function callTarget(call) {
13
+ const i = call.input;
14
+ return oneLine(String(i["path"] ?? i["command"] ?? i["pattern"] ?? i["query"] ??
15
+ i["task"] ?? i["question"] ?? i["goal"] ?? call.name));
16
+ }
17
+ // Registro della sessione: conserva gli output ricevuti anche quando il log
18
+ // della chat viene compattato. Nessuna lettura del filesystem dal renderer.
19
+ export class ReviewStore {
20
+ capacity;
21
+ items = new Map();
22
+ callIndex = new Map();
23
+ actorText = new Map();
24
+ sequence = 0;
25
+ run = 0;
26
+ _revision = 0;
27
+ _evicted = 0;
28
+ _running = false;
29
+ _label = "Pronto";
30
+ _goal = "";
31
+ constructor(capacity = 2000) {
32
+ this.capacity = capacity;
33
+ }
34
+ get revision() { return this._revision; }
35
+ get evicted() { return this._evicted; }
36
+ get running() { return this._running || [...this.items.values()].some(e => e.state === "running"); }
37
+ get label() { return !this._running && this.running ? "Collaboratori in esecuzione" : this._label; }
38
+ get goal() { return this._goal; }
39
+ entries() { return [...this.items.values()]; }
40
+ get(id) { return this.items.get(id); }
41
+ begin(goal) {
42
+ this.run += 1;
43
+ this._running = true;
44
+ this._label = "Avvio";
45
+ this._goal = goal;
46
+ this._revision += 1;
47
+ }
48
+ finish(interrupted = false) {
49
+ for (const entry of this.items.values()) {
50
+ if (entry.state === "running" && entry.actor === "Talos")
51
+ this.put({ ...entry, state: "stopped", endedAt: Date.now() });
52
+ }
53
+ this._running = false;
54
+ this._label = interrupted ? "Interrotto" : "In attesa del prossimo messaggio";
55
+ this._revision += 1;
56
+ }
57
+ reset(history = []) {
58
+ this.items.clear();
59
+ this.callIndex.clear();
60
+ this.actorText.clear();
61
+ this.sequence = 0;
62
+ this.run = 0;
63
+ this._evicted = 0;
64
+ this._running = false;
65
+ this._label = "Pronto";
66
+ this._goal = "";
67
+ for (const message of history) {
68
+ if (message.role === "user")
69
+ this._goal = message.content.filter(p => p.type === "text").map(p => p.text).join("\n");
70
+ for (const part of message.content) {
71
+ if (part.type === "tool_call")
72
+ this.record({ type: "tool_call", call: part }, undefined);
73
+ else if (part.type === "tool_result")
74
+ this.record({ type: "tool_result", result: part }, undefined);
75
+ }
76
+ }
77
+ // Una sessione ripresa non ha durate affidabili ne' comandi ancora in volo.
78
+ for (const e of this.items.values()) {
79
+ this.put({ ...e, startedAt: undefined, endedAt: undefined, state: e.state === "running" ? "stopped" : e.state });
80
+ }
81
+ this._revision += 1;
82
+ }
83
+ change(callId, change) {
84
+ const id = this.callIndex.get(`Talos:${callId}`) ?? this.callId(callId);
85
+ const entry = this.items.get(id);
86
+ if (entry)
87
+ this.put({ ...entry, change });
88
+ }
89
+ record(event, at = Date.now(), actor = "Talos") {
90
+ switch (event.type) {
91
+ case "status":
92
+ this._label = oneLine(event.label);
93
+ this._revision += 1;
94
+ break;
95
+ case "turn_start":
96
+ this._label = "Elaborazione";
97
+ this._revision += 1;
98
+ break;
99
+ case "text":
100
+ if (this._label !== "Risposta in corso") {
101
+ this._label = "Risposta in corso";
102
+ this._revision += 1;
103
+ }
104
+ break;
105
+ case "tool_call": {
106
+ const call = event.call;
107
+ if (actor === "Talos")
108
+ this._label = `${reviewTitle(call.name)} · ${callTarget(call)}`;
109
+ const id = this.callId(call.id, actor);
110
+ this.callIndex.set(`${actor}:${call.id}`, id);
111
+ this.put({ id, kind: "tool", title: reviewTitle(call.name), tool: call.name,
112
+ target: callTarget(call), actor, state: "running", startedAt: at,
113
+ input: call.input, parentId: event.parentId });
114
+ break;
115
+ }
116
+ case "tool_result": {
117
+ if (actor === "Talos")
118
+ this._label = "Elaborazione";
119
+ const id = this.callIndex.get(`${actor}:${event.result.callId}`) ?? this.callId(event.result.callId, actor);
120
+ const entry = this.items.get(id);
121
+ const input = entry?.input;
122
+ const editing = entry?.tool === "edit_file";
123
+ const writing = entry?.tool === "write_file";
124
+ const change = !event.result.isError && input && (editing || writing)
125
+ ? { before: editing ? String(input["old_string"] ?? "") : undefined,
126
+ after: String(input[editing ? "new_string" : "content"] ?? ""),
127
+ scope: editing ? "fragment" : input["append"] === true ? "append" : "reported" }
128
+ : undefined;
129
+ this.put({ ...(entry ?? { id, kind: "tool", title: "Risultato", target: event.result.callId, actor }),
130
+ state: event.result.isError ? "error" : "ok", output: event.result.output, endedAt: at,
131
+ ...(change ? { change } : {}) });
132
+ break;
133
+ }
134
+ case "error":
135
+ this.notice("Errore", event.message, "error", at, actor);
136
+ break;
137
+ case "compacted":
138
+ this.notice("Contesto riassunto", `Stima locale: ${event.tokensBefore} → ${event.tokensAfter} token.\n${event.anchors?.join("\n") ?? ""}`, "info", at);
139
+ break;
140
+ case "user_message":
141
+ this.notice("Messaggio preso in carico", event.text, "info", event.at);
142
+ break;
143
+ case "workspace_message":
144
+ this.notice(`Sessione ${event.message.fromLabel}`, event.message.text, "info", at);
145
+ break;
146
+ case "kingdom":
147
+ this.recordKingdom(event, at);
148
+ break;
149
+ }
150
+ }
151
+ recordActor(actor, event) {
152
+ if (event.type === "status") {
153
+ this.put({ id: `status:${this.run}:${actor}`, kind: "notice", actor, title: "Stato",
154
+ target: oneLine(event.label), output: event.label, state: "info", startedAt: Date.now() });
155
+ return;
156
+ }
157
+ if (event.type === "text") {
158
+ const text = (this.actorText.get(actor) ?? "") + event.delta;
159
+ this.actorText.set(actor, text);
160
+ this.put({ id: `stream:${this.run}:${actor}`, kind: "notice", actor, title: "Risposta in corso",
161
+ target: "Scrive un aggiornamento", output: text, state: "info", startedAt: Date.now() });
162
+ return;
163
+ }
164
+ if (event.type === "tool_call" || event.type === "done" || event.type === "error") {
165
+ const text = this.actorText.get(actor);
166
+ if (text?.trim())
167
+ this.notice("Aggiornamento", text, "info", Date.now(), actor);
168
+ this.actorText.delete(actor);
169
+ this.items.delete(`stream:${this.run}:${actor}`);
170
+ }
171
+ if (event.type === "turn_start" || event.type === "done" || event.type === "error") {
172
+ this.record({ type: "kingdom", phase: "vassal", slug: actor,
173
+ state: event.type === "turn_start" ? "active" : event.type === "done" ? "done" : "error",
174
+ ...(event.type === "error" ? { label: event.message } : {}) });
175
+ }
176
+ if (event.type === "done" || event.type === "error")
177
+ this.finishActor(actor);
178
+ if (event.type !== "turn_start")
179
+ this.record(event, Date.now(), actor);
180
+ }
181
+ recordKingdom(e, at) {
182
+ if (e.phase === "start") {
183
+ for (const member of e.castles) {
184
+ this.put({ id: `team:${this.run}:${member.slug}`, kind: "team", title: member.slug,
185
+ actor: member.slug, target: member.goal, role: member.role, parent: member.parent,
186
+ state: "info", output: member.after.length ? `In coda · dopo ${member.after.join(", ")}` : "In coda", startedAt: at });
187
+ }
188
+ }
189
+ else if (e.phase === "tool") {
190
+ const key = `${e.slug}:${e.callId}`;
191
+ const id = e.state === "start" ? this.callId(e.callId, e.slug) : this.callIndex.get(key) ?? this.callId(e.callId, e.slug);
192
+ this.callIndex.set(key, id);
193
+ const prev = this.items.get(id);
194
+ this.put({ ...prev, id, kind: "tool", title: reviewTitle(e.tool), tool: e.tool, actor: e.slug,
195
+ target: e.command ?? e.args ?? prev?.target ?? e.tool,
196
+ state: e.state === "start" ? "running" : e.state === "error" ? "error" : "ok",
197
+ startedAt: prev?.startedAt ?? e.at, endedAt: e.state === "start" ? undefined : e.at,
198
+ input: e.command ? { command: e.command } : prev?.input ?? { argomenti: e.args ?? "" },
199
+ output: e.output ?? prev?.output });
200
+ }
201
+ else if (e.phase === "file") {
202
+ this.put({ id: `file:${++this.sequence}`, kind: "file", title: "Modifica segnalata", target: e.path,
203
+ actor: e.slug, state: "info", startedAt: at, output: "Modifica segnalata dal collaboratore; i frammenti ricevuti possono essere parziali.",
204
+ change: e.edit ? { before: e.edit.oldString, after: e.edit.newString ?? e.edit.content ?? "", scope: "reported" } : undefined });
205
+ }
206
+ else if (e.phase === "vassal") {
207
+ const id = this.actorId(e.slug);
208
+ const prev = this.items.get(id);
209
+ this.put({ ...prev, id, kind: "team", title: e.slug, actor: e.slug,
210
+ target: e.goal ?? prev?.target ?? e.label ?? "Collaboratore",
211
+ role: e.role ?? prev?.role, parent: e.parent ?? prev?.parent,
212
+ output: e.label ?? prev?.output, startedAt: prev?.startedAt ?? at,
213
+ state: e.state === "error" ? "error" : e.state === "done" ? "ok" : "running",
214
+ endedAt: e.state === "done" || e.state === "error" ? at : undefined });
215
+ if (e.state === "done" || e.state === "error")
216
+ this.finishActor(e.slug);
217
+ }
218
+ else if (e.phase === "end") {
219
+ for (const report of e.reports) {
220
+ const id = this.actorId(report.slug);
221
+ const prev = this.items.get(id);
222
+ this.put({ ...prev, id, kind: "team", title: report.slug, actor: report.slug,
223
+ target: prev?.target ?? report.role ?? "Collaboratore", endedAt: at,
224
+ state: report.ok ? "ok" : "error", output: [report.summary, report.error].filter(Boolean).join("\n") });
225
+ this.finishActor(report.slug);
226
+ }
227
+ }
228
+ else if (e.phase === "say" || e.phase === "note" || e.phase === "notice" || e.phase === "message" || e.phase === "inbox") {
229
+ const actor = "slug" in e ? e.slug : "from" in e ? e.from : "Talos";
230
+ this.notice(e.phase === "message" ? `${actor} → ${e.to}` : e.phase === "inbox" ? `Messaggio ${e.state === "read" ? "letto" : "in coda"}` : "Aggiornamento", e.text, "info", at, actor);
231
+ }
232
+ else if (e.phase === "task") {
233
+ const id = `task:${this.run}:${e.slug}:${e.workstreamId}:${e.taskRef}`;
234
+ this.put({ id, kind: "team", title: e.taskRef, target: e.workstreamId, actor: e.slug,
235
+ state: e.status === "completed" ? "ok" : e.status === "failed" ? "error" : e.status === "running" ? "running" : "info", startedAt: e.at });
236
+ }
237
+ else if (e.phase === "usage") {
238
+ this.put({ id: `usage:${this.run}:${e.slug}`, kind: "team", title: "Consumi", target: e.slug, actor: e.slug,
239
+ state: "info", startedAt: e.at, output: `Input: ${e.inputTokens}\nOutput: ${e.outputTokens}\nTotale: ${e.totalTokens}\nTurni: ${e.turns}` +
240
+ (e.costUsd === undefined ? "" : `\nCosto USD: ${e.costUsd}`) });
241
+ }
242
+ }
243
+ actorId(actor) {
244
+ return [...this.items.values()].find(e => e.id.startsWith("team:") && e.actor === actor && e.state === "running")?.id ?? `team:${this.run}:${actor}`;
245
+ }
246
+ finishActor(actor) {
247
+ for (const entry of this.items.values()) {
248
+ if (entry.actor === actor && entry.state === "running")
249
+ this.put({ ...entry, state: "stopped", endedAt: Date.now() });
250
+ }
251
+ }
252
+ callId(id, actor = "Talos") { return `call:${this.run}:${actor}:${id}`; }
253
+ notice(title, output, state, at, actor = "Talos") {
254
+ this.put({ id: `notice:${++this.sequence}`, kind: "notice", title, target: oneLine(output).slice(0, 200), actor, state, output, startedAt: at });
255
+ }
256
+ put(entry) {
257
+ this.items.set(entry.id, entry);
258
+ if (this.items.size > this.capacity) {
259
+ const oldest = [...this.items.values()].find(e => e.state !== "running");
260
+ if (oldest) {
261
+ this.items.delete(oldest.id);
262
+ for (const [key, id] of this.callIndex)
263
+ if (id === oldest.id)
264
+ this.callIndex.delete(key);
265
+ this._evicted += 1;
266
+ }
267
+ }
268
+ this._revision += 1;
269
+ }
270
+ }
@@ -0,0 +1,2 @@
1
+ import type { ReviewEntry, ReviewStore } from "./review-store.js";
2
+ export declare function teamEntries(store: ReviewStore): readonly ReviewEntry[];
@@ -0,0 +1,27 @@
1
+ // Proiezione del registro: una riga stabile per agente, non una per evento.
2
+ export function teamEntries(store) {
3
+ const groups = new Map();
4
+ for (const entry of store.entries()) {
5
+ if (entry.actor === "Talos")
6
+ continue;
7
+ groups.set(entry.actor, [...(groups.get(entry.actor) ?? []), entry]);
8
+ }
9
+ return [...groups].map(([actor, entries]) => {
10
+ const lifecycle = entries.filter(e => e.id.startsWith("team:")).at(-1);
11
+ const active = entries.filter(e => e.kind === "tool" && e.state === "running");
12
+ const problems = entries.filter(e => e.state === "error" || e.state === "stopped");
13
+ const files = new Set(entries.filter(e => e.change || e.kind === "file").map(e => e.target));
14
+ const latest = [...entries].sort((a, b) => (a.endedAt ?? a.startedAt ?? 0) - (b.endedAt ?? b.startedAt ?? 0)).at(-1);
15
+ const current = active.map(e => `${e.title}: ${e.target}`).join(" · ");
16
+ const state = lifecycle?.state ?? (active.length ? "running" : "info");
17
+ const goal = lifecycle?.target ?? "Incarico non disponibile";
18
+ const status = entries.find(e => e.id.startsWith("status:"));
19
+ const waiting = state === "running" && status && /attes|conferm|permess|domand/i.test(status.target)
20
+ && (status.startedAt ?? 0) >= (latest.endedAt ?? latest.startedAt ?? 0);
21
+ const activity = (waiting ? status.target : "") || current || (state !== "running" ? lifecycle?.output : "") || `${latest.title}: ${latest.target}`;
22
+ return { id: `agent:${actor}`, actor, kind: "team", title: actor,
23
+ state, target: `${actor} · ${state === "running" ? "in corso" : state === "ok" ? "concluso" : state === "error" ? "errore" : state === "stopped" ? "interrotto" : lifecycle?.output?.startsWith("In coda") ? "in coda" : "stato non disponibile"} · ${activity}`,
24
+ output: `Incarico: ${goal}\nRuolo: ${lifecycle?.role ?? "non disponibile"}\nRisponde a: ${lifecycle?.parent ?? "orchestratore"}\nAttività: ${activity}\n${active.length} tool attivi · ${files.size} file · ${problems.length} problemi\nEventi disponibili: ${entries.length}`,
25
+ startedAt: lifecycle?.startedAt, endedAt: lifecycle?.endedAt };
26
+ });
27
+ }
@@ -0,0 +1,26 @@
1
+ interface MouseEvent {
2
+ button: number;
3
+ x: number;
4
+ y: number;
5
+ press: boolean;
6
+ }
7
+ export declare class SelectorMouseInput {
8
+ private readonly text;
9
+ private readonly mouse;
10
+ private pending;
11
+ private timer?;
12
+ constructor(text: (text: string) => void, mouse: (event: MouseEvent) => void);
13
+ push(chunk: string): void;
14
+ dispose(): void;
15
+ }
16
+ export declare function selectorMouseIndex(o: {
17
+ x: number;
18
+ y: number;
19
+ rows: number;
20
+ columns: number;
21
+ renderedRows: number;
22
+ count: number;
23
+ index: number;
24
+ pageSize: number;
25
+ }): number | null;
26
+ export {};
@@ -0,0 +1,65 @@
1
+ // SGR reports can arrive in multiple chunks. Never forward partial mouse
2
+ // sequences to readline: their numbers would become the palette's query.
3
+ export class SelectorMouseInput {
4
+ text;
5
+ mouse;
6
+ pending = "";
7
+ timer;
8
+ constructor(text, mouse) {
9
+ this.text = text;
10
+ this.mouse = mouse;
11
+ }
12
+ push(chunk) {
13
+ if (this.timer)
14
+ clearTimeout(this.timer);
15
+ let rest = this.pending + chunk;
16
+ this.pending = "";
17
+ while (rest) {
18
+ const start = rest.indexOf("\x1b[<");
19
+ if (start < 0) {
20
+ // Keep even ESC or ESC+[ until we can distinguish a key from a
21
+ // fragmented mouse report. A lone Escape is released after 35 ms.
22
+ const suffix = rest.endsWith("\x1b[") ? 2 : rest.endsWith("\x1b") ? 1 : 0;
23
+ if (suffix) {
24
+ if (rest.length > suffix)
25
+ this.text(rest.slice(0, -suffix));
26
+ this.pending = rest.slice(-suffix);
27
+ this.timer = setTimeout(() => {
28
+ const key = this.pending;
29
+ this.pending = "";
30
+ this.text(key);
31
+ }, 35);
32
+ }
33
+ else
34
+ this.text(rest);
35
+ return;
36
+ }
37
+ if (start)
38
+ this.text(rest.slice(0, start));
39
+ rest = rest.slice(start);
40
+ const match = /^\x1b\[<(\d+);(\d+);(\d+)([Mm])/.exec(rest);
41
+ if (match) {
42
+ this.mouse({ button: Number(match[1]), x: Number(match[2]), y: Number(match[3]), press: match[4] === "M" });
43
+ rest = rest.slice(match[0].length);
44
+ }
45
+ else if (/^\x1b\[<[\d;]*$/.test(rest) && rest.length < 48) {
46
+ this.pending = rest;
47
+ this.timer = setTimeout(() => { this.pending = ""; }, 250);
48
+ return;
49
+ }
50
+ else {
51
+ rest = rest.slice(3); // discard a malformed control prefix
52
+ }
53
+ }
54
+ }
55
+ dispose() { if (this.timer)
56
+ clearTimeout(this.timer); this.pending = ""; }
57
+ }
58
+ export function selectorMouseIndex(o) {
59
+ const top = o.rows - Math.min(o.renderedRows, o.rows - 1) + 1;
60
+ const row = o.y - top - 1; // title occupies the first overlay row
61
+ if (o.x < 1 || o.x > o.columns + 1 || row < 0 || row >= Math.min(o.count, o.pageSize))
62
+ return null;
63
+ const start = Math.max(0, Math.min(o.index - Math.floor(o.pageSize / 2), o.count - o.pageSize));
64
+ return start + row;
65
+ }
@@ -0,0 +1,51 @@
1
+ import type { TuiTheme } from "./branding.js";
2
+ export interface SelectOption<T> {
3
+ readonly key?: string;
4
+ readonly label: string;
5
+ readonly detail: string;
6
+ readonly group?: string;
7
+ readonly hint?: string;
8
+ readonly value: T;
9
+ }
10
+ interface SelectorControl {
11
+ pause(): void;
12
+ resume(): void;
13
+ write(text: string): void;
14
+ setOverlay(lines: string[] | null): void;
15
+ }
16
+ interface SelectorOptions<T> {
17
+ readonly title: string;
18
+ readonly hint?: string;
19
+ readonly options: readonly SelectOption<T>[];
20
+ readonly current?: T;
21
+ readonly currentKey?: string;
22
+ readonly theme: TuiTheme;
23
+ readonly wide?: boolean;
24
+ readonly question?: boolean;
25
+ readonly selectedDetailsOnly?: boolean;
26
+ readonly mouse?: boolean;
27
+ }
28
+ export interface SelectorRenderOptions<T> extends SelectorOptions<T> {
29
+ readonly index: number;
30
+ readonly pageSize: number;
31
+ readonly columns: number;
32
+ readonly query?: string;
33
+ readonly totalCount?: number;
34
+ readonly details?: boolean;
35
+ readonly detailOffset?: number;
36
+ }
37
+ export declare function pickerPageSize(rows: number, fullHeight?: boolean): number;
38
+ export declare function filterOptions<T extends {
39
+ label: string;
40
+ detail: string;
41
+ group?: string;
42
+ hint?: string;
43
+ }>(options: readonly T[], query: string): readonly T[];
44
+ export declare function renderSelector<T>(opts: SelectorRenderOptions<T>): string[];
45
+ export declare function selectOption<T>(opts: SelectorOptions<T> & {
46
+ readonly ctl: SelectorControl;
47
+ readonly terminalColumns: () => number;
48
+ readonly filterable?: boolean;
49
+ readonly fullHeight?: boolean;
50
+ }): Promise<SelectOption<T> | null>;
51
+ export {};