@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 @@
1
+ {"type":"commonjs","private":true}
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ const MAX_OPERATIONS = 12;
4
+ const MAX_TEXT = 4000;
5
+
6
+ const KEY_ALIASES = Object.freeze({
7
+ ctrl: 'Ctrl', control: 'Ctrl', shift: 'Shift', alt: 'Alt',
8
+ space: 'Space', tab: 'Tab', esc: 'Esc', escape: 'Esc',
9
+ enter: 'Enter', return: 'Enter', backspace: 'Backspace', delete: 'Delete', del: 'Delete',
10
+ home: 'Home', end: 'End', left: 'ArrowLeft', arrowleft: 'ArrowLeft',
11
+ up: 'ArrowUp', arrowup: 'ArrowUp', right: 'ArrowRight', arrowright: 'ArrowRight',
12
+ down: 'ArrowDown', arrowdown: 'ArrowDown',
13
+ });
14
+
15
+ function normalizeKey(value) {
16
+ const raw = String(value || '').trim();
17
+ if (!raw) return null;
18
+ const alias = KEY_ALIASES[raw.toLowerCase()];
19
+ if (alias) return alias;
20
+ if (/^[a-z0-9]$/i.test(raw)) return raw.toUpperCase();
21
+ return null;
22
+ }
23
+
24
+ function normalizeShortcut(keys) {
25
+ const source = Array.isArray(keys)
26
+ ? keys
27
+ : String(keys || '').split(/[+\s]+/).filter(Boolean);
28
+ if (!source.length || source.length > 4) {
29
+ return { ok: false, code: 'BAD_SHORTCUT', error: 'Una scorciatoia richiede da uno a quattro tasti.' };
30
+ }
31
+ const normalized = [];
32
+ for (const value of source) {
33
+ const key = normalizeKey(value);
34
+ if (!key) return { ok: false, code: 'BAD_SHORTCUT', error: `Tasto non ammesso: ${String(value)}` };
35
+ if (!normalized.includes(key)) normalized.push(key);
36
+ }
37
+ return { ok: true, keys: normalized };
38
+ }
39
+
40
+ function normalizeAtomicOperations(value) {
41
+ if (!Array.isArray(value) || !value.length || value.length > MAX_OPERATIONS) {
42
+ return { ok: false, code: 'BAD_OPERATIONS', error: `Servono da 1 a ${MAX_OPERATIONS} operazioni.` };
43
+ }
44
+ const operations = [];
45
+ for (const raw of value) {
46
+ const type = String(raw && raw.type || '').trim().toLowerCase();
47
+ if (type === 'shortcut') {
48
+ const shortcut = normalizeShortcut(raw.keys);
49
+ if (!shortcut.ok) return shortcut;
50
+ operations.push({ type, keys: shortcut.keys });
51
+ continue;
52
+ }
53
+ if (type === 'text') {
54
+ const text = String(raw && raw.text != null ? raw.text : '');
55
+ if (!text || text.length > MAX_TEXT || /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/.test(text)) {
56
+ return { ok: false, code: 'BAD_TEXT', error: `Il testo deve contenere da 1 a ${MAX_TEXT} caratteri stampabili.` };
57
+ }
58
+ operations.push({ type, text });
59
+ continue;
60
+ }
61
+ if (type === 'mouse') {
62
+ const dx = Number(raw && raw.dx || 0);
63
+ const dy = Number(raw && raw.dy || 0);
64
+ const scroll = Number(raw && raw.scroll || 0);
65
+ if (![dx, dy, scroll].every(Number.isInteger)
66
+ || Math.abs(dx) > 1000 || Math.abs(dy) > 1000 || Math.abs(scroll) > 5) {
67
+ return { ok: false, code: 'BAD_MOUSE', error: 'Mouse fuori range: dx/dy ±1000, scroll ±5.' };
68
+ }
69
+ operations.push({ type, dx, dy, scroll });
70
+ continue;
71
+ }
72
+ if (type === 'click') {
73
+ const button = String(raw && raw.button || 'left').toLowerCase();
74
+ if (!['left', 'right', 'middle'].includes(button)) {
75
+ return { ok: false, code: 'BAD_BUTTON', error: 'Pulsante ammesso: left, right o middle.' };
76
+ }
77
+ operations.push({ type, button });
78
+ continue;
79
+ }
80
+ return { ok: false, code: 'BAD_OPERATION', error: `Operazione non ammessa: ${type || '(vuota)'}` };
81
+ }
82
+ return { ok: true, operations };
83
+ }
84
+
85
+ module.exports = {
86
+ MAX_OPERATIONS,
87
+ MAX_TEXT,
88
+ normalizeKey,
89
+ normalizeShortcut,
90
+ normalizeAtomicOperations,
91
+ };
@@ -0,0 +1,101 @@
1
+ 'use strict';
2
+
3
+ // MCP-RAC — grammatica computer-use v0.1 (spec §6.4).
4
+ //
5
+ // Un'azione e' un blocco:
6
+ //
7
+ // ACTION <observation_id> ttl=<ms>
8
+ // <dx> <dy> <scroll> ; K1 ; K2 ; ... ; K6 END
9
+ //
10
+ // Il primo segmento e' il MOVIMENTO (relativo, distribuito sull'orizzonte);
11
+ // i successivi sono KEYSET: l'insieme dei tasti tenuti premuti per 33 ms.
12
+ // `_` e' il keyset vuoto (tutto rilasciato). Le chiavi assenti si rilasciano.
13
+ //
14
+ // La grammatica e' volutamente povera: niente Enter, niente Canc, niente tasto
15
+ // Windows. Non e' una dimenticanza — e' il primo strato di sicurezza (spec §13):
16
+ // le azioni irreversibili non devono essere ESPRIMIBILI nel canale reattivo,
17
+ // prima ancora che vietate da una policy.
18
+
19
+ const LIMITI = Object.freeze({
20
+ MOUSE_DELTA: 1000, // dx, dy in [-1000, 1000]
21
+ SCROLL: 5, // scroll in [-5, 5]
22
+ TASTI_PER_CHUNK: 4, // spec §13: "max quattro tasti/chunk"
23
+ CHUNK_PER_AZIONE: 6, // 6 keyset da 33 ms = orizzonte 200 ms
24
+ TTL_MASSIMO_MS: 250, // oltre la lease il chunk non ha senso
25
+ CHUNK_MS: 33, // durata nominale di un keyset
26
+ ORIZZONTE_MS: 200,
27
+ BUFFER_MASSIMO: 16 * 1024,
28
+ });
29
+
30
+ // L'alfabeto completo dei tasti ammessi. Un token fuori da qui non e' "un tasto
31
+ // sconosciuto da inoltrare": e' un errore di grammatica che avvelena l'azione.
32
+ const TASTI_INTERNI = (() => {
33
+ const out = new Set(['Shift', 'Ctrl', 'Alt', 'Space', 'Tab', 'Esc', 'LB', 'RB', 'MB']);
34
+ for (let c = 65; c <= 90; c += 1) out.add(String.fromCharCode(c)); // A..Z
35
+ for (let d = 0; d <= 9; d += 1) out.add(String(d)); // 0..9
36
+ return out;
37
+ })();
38
+ // Un Set congelato resta modificabile tramite add/delete. Esponiamo quindi una
39
+ // fotografia realmente immutabile e teniamo il Set usato dalla validazione
40
+ // chiuso nel modulo.
41
+ const TASTI = Object.freeze([...TASTI_INTERNI].sort());
42
+
43
+ function interoIn(testo, min, max) {
44
+ if (!/^-?\d+$/.test(testo)) return null;
45
+ const n = Number(testo);
46
+ return n >= min && n <= max ? n : null;
47
+ }
48
+
49
+ // "ACTION 184 ttl=250" -> { observationId, ttlMs } | { errore }
50
+ function analizzaIntestazione(riga) {
51
+ const m = /^ACTION\s+(\d+)\s+ttl=(\d+)$/.exec(String(riga || '').trim());
52
+ if (!m) return { errore: 'intestazione malformata' };
53
+ const observationNumber = Number(m[1]);
54
+ const ttlMs = Number(m[2]);
55
+ if (!Number.isSafeInteger(observationNumber)) return { errore: 'observation_id fuori limite' };
56
+ if (ttlMs <= 0 || ttlMs > LIMITI.TTL_MASSIMO_MS) {
57
+ return { errore: `ttl fuori limite (1..${LIMITI.TTL_MASSIMO_MS})` };
58
+ }
59
+ return { observationId: m[1], ttlMs };
60
+ }
61
+
62
+ // "92 0 0" -> { tipo: 'mouse', dx, dy, scroll } | { errore }
63
+ function analizzaMouse(segmento) {
64
+ const parti = String(segmento || '').trim().split(/\s+/);
65
+ if (parti.length !== 3) return { errore: 'il movimento vuole esattamente dx dy scroll' };
66
+ const dx = interoIn(parti[0], -LIMITI.MOUSE_DELTA, LIMITI.MOUSE_DELTA);
67
+ const dy = interoIn(parti[1], -LIMITI.MOUSE_DELTA, LIMITI.MOUSE_DELTA);
68
+ const scroll = interoIn(parti[2], -LIMITI.SCROLL, LIMITI.SCROLL);
69
+ if (dx === null || dy === null || scroll === null) return { errore: 'movimento fuori range' };
70
+ return { tipo: 'mouse', dx, dy, scroll };
71
+ }
72
+
73
+ // "Shift W" | "_" -> { tipo: 'keyset', tasti: [...] } | { errore }
74
+ // I tasti si normalizzano ordinati e senza duplicati: {W,Shift} e {Shift,W}
75
+ // sono lo stesso stato fisico, e l'esecutore confronta insiemi.
76
+ function analizzaKeyset(segmento) {
77
+ const testo = String(segmento || '').trim();
78
+ if (testo === '_') return { tipo: 'keyset', tasti: [] };
79
+ if (!testo) return { errore: 'keyset vuoto: usa _ per rilasciare tutti i tasti' };
80
+ const token = testo.split(/\s+/);
81
+ if (token.length > LIMITI.TASTI_PER_CHUNK) {
82
+ return { errore: `piu' di ${LIMITI.TASTI_PER_CHUNK} tasti in un chunk` };
83
+ }
84
+ const visti = new Set();
85
+ for (const t of token) {
86
+ if (!TASTI_INTERNI.has(t)) return { errore: `tasto fuori alfabeto: ${t}` };
87
+ visti.add(t);
88
+ }
89
+ return { tipo: 'keyset', tasti: [...visti].sort() };
90
+ }
91
+
92
+ // Serializzazione, per il simulatore e i replay: da azione strutturata al testo
93
+ // che il decoder emetterebbe. Round-trip garantito dai test.
94
+ function serializza(azione) {
95
+ const testa = `ACTION ${azione.observationId} ttl=${azione.ttlMs}\n`;
96
+ const mouse = `${azione.mouse.dx} ${azione.mouse.dy} ${azione.mouse.scroll}`;
97
+ const keyset = azione.keyset.map((k) => (k.length ? k.join(' ') : '_'));
98
+ return testa + [mouse, ...keyset].join(' ; ') + ' ;\nEND';
99
+ }
100
+
101
+ module.exports = { LIMITI, TASTI, analizzaIntestazione, analizzaMouse, analizzaKeyset, serializza };
@@ -0,0 +1,185 @@
1
+ 'use strict';
2
+
3
+ // Parser incrementale MCP-RAC. L'unica uscita eseguibile e' `chunk`, prodotta
4
+ // esclusivamente dopo `;`. END chiude l'azione ma non rende eseguibile il testo
5
+ // che lo precede: un ultimo segmento senza `;` viene rifiutato.
6
+
7
+ const G = require('./grammatica.js');
8
+
9
+ const PENSIERO_INIZIO = '<|thought_start|>';
10
+ const PENSIERO_FINE = '<|thought_end|>';
11
+ const CODA_MINIMA = Math.max(PENSIERO_INIZIO.length, PENSIERO_FINE.length, 'ACTION'.length);
12
+
13
+ function creaParser(options = {}) {
14
+ const bufferMassimo = Number.isInteger(options.bufferMassimo)
15
+ ? Math.max(256, options.bufferMassimo) : G.LIMITI.BUFFER_MASSIMO;
16
+ let buffer = '';
17
+ let stato = 'fuori';
18
+ let azione = null;
19
+ let sequenza = 0;
20
+
21
+ const scartoCorrente = () => azione ? {
22
+ observationId: azione.observationId,
23
+ chunkEmessi: azione.mouseVisto + azione.keysetEmessi,
24
+ ultimaSequenza: sequenza,
25
+ } : null;
26
+
27
+ function errore(motivo) {
28
+ const scarto = scartoCorrente();
29
+ azione = null;
30
+ stato = 'avvelenato';
31
+ return { tipo: 'errore', motivo, scarto };
32
+ }
33
+
34
+ function commitSegmento(grezzo) {
35
+ if (!azione) return errore('segmento fuori da ACTION');
36
+ const testo = grezzo.trim();
37
+ let parsed;
38
+ let indice;
39
+ if (!azione.mouseVisto) {
40
+ parsed = G.analizzaMouse(testo);
41
+ indice = 0;
42
+ if (!parsed.errore) azione.mouseVisto = 1;
43
+ } else {
44
+ if (azione.keysetEmessi >= G.LIMITI.CHUNK_PER_AZIONE) {
45
+ return errore(`piu' di ${G.LIMITI.CHUNK_PER_AZIONE} keyset in un'azione`);
46
+ }
47
+ parsed = G.analizzaKeyset(testo);
48
+ indice = azione.keysetEmessi;
49
+ if (!parsed.errore) azione.keysetEmessi += 1;
50
+ }
51
+ if (parsed.errore) return errore(parsed.errore);
52
+ sequenza += 1;
53
+ return {
54
+ tipo: 'chunk',
55
+ chunk: {
56
+ ...parsed,
57
+ observationId: azione.observationId,
58
+ ttlMs: azione.ttlMs,
59
+ sequenza,
60
+ indice,
61
+ },
62
+ };
63
+ }
64
+
65
+ function trovaAction() {
66
+ const match = /(?:^|\n)ACTION(?=\s)/.exec(buffer);
67
+ if (!match) return -1;
68
+ return match.index + (buffer[match.index] === '\n' ? 1 : 0);
69
+ }
70
+
71
+ function passo(finale) {
72
+ if (stato === 'pensiero') {
73
+ const fine = buffer.indexOf(PENSIERO_FINE);
74
+ if (fine < 0) {
75
+ const sicuro = finale ? buffer.length : Math.max(0, buffer.length - CODA_MINIMA);
76
+ if (!sicuro) return null;
77
+ const testo = buffer.slice(0, sicuro);
78
+ buffer = buffer.slice(sicuro);
79
+ return { evento: { tipo: 'pensiero', testo } };
80
+ }
81
+ const testo = buffer.slice(0, fine);
82
+ buffer = buffer.slice(fine + PENSIERO_FINE.length);
83
+ stato = 'fuori';
84
+ return { evento: testo ? { tipo: 'pensiero', testo } : { tipo: 'pensiero_fine' } };
85
+ }
86
+
87
+ if (stato !== 'corpo' && buffer.startsWith(PENSIERO_INIZIO)) {
88
+ buffer = buffer.slice(PENSIERO_INIZIO.length);
89
+ stato = 'pensiero';
90
+ return { avanzato: true };
91
+ }
92
+
93
+ if (stato === 'fuori' || stato === 'avvelenato') {
94
+ const idx = trovaAction();
95
+ if (idx < 0) {
96
+ const tieni = finale ? 0 : CODA_MINIMA;
97
+ if (buffer.length > tieni) {
98
+ buffer = tieni ? buffer.slice(-tieni) : '';
99
+ return { avanzato: true };
100
+ }
101
+ return null;
102
+ }
103
+ if (idx > 0) {
104
+ buffer = buffer.slice(idx);
105
+ return { avanzato: true };
106
+ }
107
+ const aCapo = buffer.indexOf('\n');
108
+ if (aCapo < 0) return null;
109
+ const testa = G.analizzaIntestazione(buffer.slice(0, aCapo).replace(/\r$/, ''));
110
+ buffer = buffer.slice(aCapo + 1);
111
+ if (testa.errore) return { evento: errore(testa.errore) };
112
+ azione = {
113
+ observationId: testa.observationId,
114
+ ttlMs: testa.ttlMs,
115
+ mouseVisto: 0,
116
+ keysetEmessi: 0,
117
+ };
118
+ stato = 'corpo';
119
+ return { evento: { tipo: 'intestazione', ...testa } };
120
+ }
121
+
122
+ const punto = buffer.indexOf(';');
123
+ const endMatch = /(?:^|\n)\s*END(?=\s|$)/.exec(buffer);
124
+ const fine = endMatch ? endMatch.index : -1;
125
+ if (punto >= 0 && (fine < 0 || punto < fine)) {
126
+ const segmento = buffer.slice(0, punto);
127
+ buffer = buffer.slice(punto + 1);
128
+ return { evento: commitSegmento(segmento) };
129
+ }
130
+ if (fine >= 0) {
131
+ const prefisso = buffer.slice(0, fine).trim();
132
+ const conclusa = azione;
133
+ buffer = buffer.slice(fine + endMatch[0].length);
134
+ if (prefisso) return { evento: errore('segmento prima di END privo di delimitatore ;') };
135
+ if (!conclusa.mouseVisto || conclusa.keysetEmessi !== G.LIMITI.CHUNK_PER_AZIONE) {
136
+ return { evento: errore(`azione incompleta: attesi mouse + ${G.LIMITI.CHUNK_PER_AZIONE} keyset`) };
137
+ }
138
+ azione = null;
139
+ stato = 'fuori';
140
+ return { evento: { tipo: 'fine_azione', observationId: conclusa.observationId, ultimaSequenza: sequenza } };
141
+ }
142
+ return null;
143
+ }
144
+
145
+ function estrai(finale) {
146
+ const eventi = [];
147
+ for (;;) {
148
+ const r = passo(finale);
149
+ if (!r) break;
150
+ if (r.evento) eventi.push(r.evento);
151
+ }
152
+ return eventi;
153
+ }
154
+
155
+ return {
156
+ push(delta) {
157
+ buffer += String(delta == null ? '' : delta);
158
+ if (buffer.length > bufferMassimo) {
159
+ const event = errore(`buffer oltre ${bufferMassimo} byte`);
160
+ buffer = buffer.slice(-CODA_MINIMA);
161
+ return [event, ...estrai(false)];
162
+ }
163
+ return estrai(false);
164
+ },
165
+ fine() {
166
+ const eventi = estrai(true);
167
+ if (stato === 'corpo' && azione) eventi.push({ tipo: 'troncata', ...scartoCorrente() });
168
+ azione = null;
169
+ stato = 'fuori';
170
+ buffer = '';
171
+ return eventi;
172
+ },
173
+ reset() {
174
+ const scarto = scartoCorrente();
175
+ buffer = '';
176
+ stato = 'fuori';
177
+ azione = null;
178
+ return scarto;
179
+ },
180
+ stato: () => stato,
181
+ diagnostica: () => ({ stato, bytesInBuffer: buffer.length, sequenza }),
182
+ };
183
+ }
184
+
185
+ module.exports = { creaParser, PENSIERO_INIZIO, PENSIERO_FINE };
@@ -0,0 +1,136 @@
1
+ 'use strict';
2
+
3
+ const crypto = require('node:crypto');
4
+
5
+ const EXTENSION_ID = 'io.vascend.mcp.reactive-control/0.1';
6
+ const MAGIC = Buffer.from('RAC1');
7
+ const VERSION = 1;
8
+ const HEADER_BYTES = 52;
9
+
10
+ const MESSAGE_TYPES = Object.freeze({
11
+ OBS_KEYFRAME: 1,
12
+ OBS_DELTA: 2,
13
+ ACTION_START: 3,
14
+ ACTION_CHUNK: 4,
15
+ ACTION_REVOKE: 5,
16
+ ACK: 6,
17
+ SAFETY_STOP: 7,
18
+ });
19
+ const MESSAGE_NAMES = Object.freeze(Object.fromEntries(
20
+ Object.entries(MESSAGE_TYPES).map(([name, value]) => [value, name]),
21
+ ));
22
+
23
+ const SERVER_CAPABILITIES = Object.freeze({
24
+ extension: EXTENSION_ID,
25
+ version: VERSION,
26
+ transport: ['node-ipc'],
27
+ framing: ['rac-binary-v1'],
28
+ observation: ['keyframe', 'delta', 'checkpoint', 'revoke'],
29
+ actionRateHz: 30,
30
+ observationRateHz: 5,
31
+ maxActionHorizonMs: 200,
32
+ maxLeaseMs: 250,
33
+ strictObservationMaxAgeMs: 450,
34
+ cumulativeAck: true,
35
+ checksum: 'crc32',
36
+ duplexObservations: false,
37
+ });
38
+
39
+ let crcTable = null;
40
+ function tableCrc32() {
41
+ if (crcTable) return crcTable;
42
+ crcTable = Array.from({ length: 256 }, (_, index) => {
43
+ let value = index;
44
+ for (let bit = 0; bit < 8; bit += 1) {
45
+ value = (value >>> 1) ^ ((value & 1) ? 0xedb88320 : 0);
46
+ }
47
+ return value >>> 0;
48
+ });
49
+ return crcTable;
50
+ }
51
+
52
+ function crc32(value) {
53
+ const bytes = Buffer.isBuffer(value) ? value : Buffer.from(value || '');
54
+ const table = tableCrc32();
55
+ let crc = 0xffffffff;
56
+ for (const byte of bytes) crc = (crc >>> 8) ^ table[(crc ^ byte) & 0xff];
57
+ return (crc ^ 0xffffffff) >>> 0;
58
+ }
59
+
60
+ function sessionDigest(sessionId) {
61
+ return crypto.createHash('sha256').update(String(sessionId || '')).digest().subarray(0, 16);
62
+ }
63
+
64
+ function safeBigInt(value, name) {
65
+ try {
66
+ const parsed = BigInt(value || 0);
67
+ if (parsed < 0n || parsed > 0xffffffffffffffffn) throw new RangeError(name);
68
+ return parsed;
69
+ } catch (_) {
70
+ throw new TypeError(`${name || 'value'} non valido`);
71
+ }
72
+ }
73
+
74
+ function encodeFrame(input = {}) {
75
+ const type = typeof input.type === 'string' ? MESSAGE_TYPES[input.type] : Number(input.type);
76
+ if (!MESSAGE_NAMES[type]) throw new TypeError('RAC_MESSAGE_TYPE_INVALID');
77
+ const payload = Buffer.isBuffer(input.payload) ? input.payload : Buffer.from(String(input.payload || ''), 'utf8');
78
+ if (payload.length > 16 * 1024 * 1024) throw new RangeError('RAC_PAYLOAD_TOO_LARGE');
79
+ const header = Buffer.alloc(HEADER_BYTES);
80
+ MAGIC.copy(header, 0);
81
+ header.writeUInt8(VERSION, 4);
82
+ header.writeUInt8(type, 5);
83
+ header.writeUInt16BE(Number(input.flags || 0) & 0xffff, 6);
84
+ header.writeUInt32BE(Number(input.sequence || 0) >>> 0, 8);
85
+ header.writeBigUInt64BE(safeBigInt(input.monotonicUs, 'monotonicUs'), 12);
86
+ header.writeBigUInt64BE(safeBigInt(input.observationId, 'observationId'), 20);
87
+ header.writeUInt32BE(payload.length >>> 0, 28);
88
+ header.writeUInt32BE(crc32(payload), 32);
89
+ sessionDigest(input.sessionId).copy(header, 36);
90
+ return Buffer.concat([header, payload]);
91
+ }
92
+
93
+ function decodeFrame(value, expected = {}) {
94
+ const frame = Buffer.isBuffer(value) ? value : Buffer.from(value || '');
95
+ if (frame.length < HEADER_BYTES) return { ok: false, code: 'RAC_FRAME_TRUNCATED' };
96
+ if (!frame.subarray(0, 4).equals(MAGIC)) return { ok: false, code: 'RAC_FRAME_MAGIC' };
97
+ if (frame.readUInt8(4) !== VERSION) return { ok: false, code: 'RAC_FRAME_VERSION' };
98
+ const type = frame.readUInt8(5);
99
+ if (!MESSAGE_NAMES[type]) return { ok: false, code: 'RAC_FRAME_TYPE' };
100
+ const payloadLength = frame.readUInt32BE(28);
101
+ if (frame.length !== HEADER_BYTES + payloadLength) return { ok: false, code: 'RAC_FRAME_LENGTH' };
102
+ const payload = frame.subarray(HEADER_BYTES);
103
+ if (crc32(payload) !== frame.readUInt32BE(32)) return { ok: false, code: 'RAC_FRAME_CHECKSUM' };
104
+ if (expected.sessionId && !frame.subarray(36, 52).equals(sessionDigest(expected.sessionId))) {
105
+ return { ok: false, code: 'RAC_FRAME_SESSION' };
106
+ }
107
+ const observationId = frame.readBigUInt64BE(20).toString();
108
+ if (expected.observationId && String(expected.observationId) !== observationId) {
109
+ return { ok: false, code: 'STALE_OBSERVATION' };
110
+ }
111
+ return {
112
+ ok: true,
113
+ type: MESSAGE_NAMES[type],
114
+ typeId: type,
115
+ flags: frame.readUInt16BE(6),
116
+ sequence: frame.readUInt32BE(8),
117
+ monotonicUs: frame.readBigUInt64BE(12),
118
+ observationId,
119
+ payload,
120
+ checksum: frame.readUInt32BE(32),
121
+ };
122
+ }
123
+
124
+ function negotiateCapabilities(client = {}) {
125
+ const extension = String(client.extension || EXTENSION_ID);
126
+ if (extension !== EXTENSION_ID) return { ok: false, code: 'RAC_EXTENSION_UNSUPPORTED' };
127
+ const requestedTransports = Array.isArray(client.transport) ? client.transport : ['node-ipc'];
128
+ const transport = SERVER_CAPABILITIES.transport.find((item) => requestedTransports.includes(item));
129
+ if (!transport) return { ok: false, code: 'RAC_TRANSPORT_UNSUPPORTED' };
130
+ return { ok: true, ...SERVER_CAPABILITIES, transport };
131
+ }
132
+
133
+ module.exports = {
134
+ EXTENSION_ID, VERSION, HEADER_BYTES, MESSAGE_TYPES, SERVER_CAPABILITIES,
135
+ crc32, encodeFrame, decodeFrame, negotiateCapabilities,
136
+ };
package/install.ps1 ADDED
@@ -0,0 +1,30 @@
1
+ # Public entry point: https://cdn.jsdelivr.net/npm/@vascend/talos@latest/install.ps1
2
+ & {
3
+ $ErrorActionPreference = 'Stop'
4
+ $node = Get-Command node.exe -ErrorAction SilentlyContinue
5
+ $npm = Get-Command npm.cmd -ErrorAction SilentlyContinue
6
+ if (-not $node -or -not $npm) {
7
+ throw 'Talos requires Node.js 20 or newer (including npm). Install it from https://nodejs.org and run this command again.'
8
+ }
9
+ & $node.Source -e 'process.exit(Number(process.versions.node.split(String.fromCharCode(46))[0]) >= 20 ? 0 : 1)'
10
+ if ($LASTEXITCODE -ne 0) { throw 'Please update Node.js to version 20 or newer.' }
11
+ $talosVersion = if ($env:TALOS_VERSION) { $env:TALOS_VERSION } else { 'latest' }
12
+ if ($talosVersion -notmatch '\A(?:latest|[0-9]+\.[0-9]+\.[0-9]+)\z') {
13
+ throw 'TALOS_VERSION must be latest or a stable version such as 0.1.0.'
14
+ }
15
+ $talosPrefix = if ($env:TALOS_INSTALL_DIR) { $env:TALOS_INSTALL_DIR } else { Join-Path $env:LOCALAPPDATA 'Programs\Talos' }
16
+ Write-Host "Installing Talos $talosVersion in $talosPrefix"
17
+ & $npm.Source install --global --prefix $talosPrefix --registry=https://registry.npmjs.org "@vascend/talos@$talosVersion"
18
+ if ($LASTEXITCODE -ne 0) { throw 'Talos installation failed. Check the npm output above.' }
19
+ $talosEntry = Join-Path $talosPrefix 'node_modules\@vascend\talos\dist\index.js'
20
+ & $node.Source $talosEntry --version
21
+ if ($LASTEXITCODE -ne 0) { throw 'Talos was installed but the startup check failed.' }
22
+ if ($env:TALOS_NO_MODIFY_PATH -ne '1') {
23
+ $talosUserPath = [Environment]::GetEnvironmentVariable('Path', 'User')
24
+ if (($talosUserPath -split ';') -notcontains $talosPrefix) {
25
+ [Environment]::SetEnvironmentVariable('Path', (([string]$talosUserPath).TrimEnd(';') + ';' + $talosPrefix).TrimStart(';'), 'User')
26
+ }
27
+ }
28
+ if (($env:Path -split ';') -notcontains $talosPrefix) { $env:Path = "$talosPrefix;$env:Path" }
29
+ Write-Host 'Talos is ready. Run talos to sign in.'
30
+ }
package/install.sh ADDED
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Public entry point: https://cdn.jsdelivr.net/npm/@vascend/talos@latest/install.sh
5
+ main() {
6
+ if ! command -v node >/dev/null 2>&1 || ! command -v npm >/dev/null 2>&1; then
7
+ printf '%s\n' 'Talos requires Node.js 20 or newer (including npm). Install it from https://nodejs.org and run this command again.' >&2
8
+ return 1
9
+ fi
10
+ if ! node -e 'process.exit(Number(process.versions.node.split(".")[0]) >= 20 ? 0 : 1)'; then
11
+ printf '%s\n' 'Please update Node.js to version 20 or newer before installing Talos.' >&2
12
+ return 1
13
+ fi
14
+ local version="${TALOS_VERSION:-latest}"
15
+ if [[ "$version" != latest && ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
16
+ printf '%s\n' 'TALOS_VERSION must be latest or a stable version such as 0.1.0.' >&2
17
+ return 1
18
+ fi
19
+ local install_dir="${TALOS_INSTALL_DIR:-$HOME/.local}"
20
+ local bin_dir="$install_dir/bin"
21
+ printf 'Installing Talos %s in %s\n' "$version" "$install_dir"
22
+ npm install --global --prefix "$install_dir" --registry=https://registry.npmjs.org "@vascend/talos@$version"
23
+ "$bin_dir/talos" --version
24
+ case ":$PATH:" in
25
+ *":$bin_dir:"*) ;;
26
+ *)
27
+ local profile=""
28
+ case "${SHELL:-}" in
29
+ */zsh) profile="$HOME/.zshrc" ;;
30
+ */bash)
31
+ if [[ "$(uname -s)" == Darwin ]]; then profile="$HOME/.bash_profile"; else profile="$HOME/.bashrc"; fi
32
+ ;;
33
+ esac
34
+ if [[ -n "$profile" && "${TALOS_NO_MODIFY_PATH:-0}" != 1 ]]; then
35
+ local path_line
36
+ printf -v path_line 'export PATH=%q:"$PATH"' "$bin_dir"
37
+ if ! grep -Fqx "$path_line" "$profile" 2>/dev/null; then
38
+ printf '\n# Vascend Talos\n%s\n' "$path_line" >> "$profile"
39
+ fi
40
+ printf 'Open a new terminal, then run: talos\n'
41
+ else
42
+ printf 'Add %s to your PATH, then run: talos\n' "$bin_dir"
43
+ fi
44
+ printf 'To start immediately: %q\n' "$bin_dir/talos"
45
+ ;;
46
+ esac
47
+ printf '%s\n' 'Talos is ready. Run talos to sign in.'
48
+ }
49
+
50
+ main "$@"
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@vascend/talos",
3
+ "version": "0.1.0",
4
+ "description": "Vascend Talos - extensible coding agent for your terminal",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/VascendTechnologies/vascend-talos.git"
8
+ },
9
+ "homepage": "https://vascend.it/talos",
10
+ "type": "module",
11
+ "bin": {
12
+ "horizon": "./dist/index.js",
13
+ "talos": "./dist/index.js"
14
+ },
15
+ "exports": {
16
+ ".": "./dist/sdk.js"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "install.sh",
21
+ "install.ps1"
22
+ ],
23
+ "scripts": {
24
+ "dev": "bun run src/index.ts",
25
+ "start": "bun run src/index.ts",
26
+ "install:cli": "bun run build && bun link",
27
+ "backend": "bun run src/backend/index.ts",
28
+ "backend:dev": "bun --watch run src/backend/index.ts",
29
+ "build": "tsc -p tsconfig.json && node scripts/copy-computer-use.mjs",
30
+ "typecheck": "tsc -p tsconfig.json --noEmit",
31
+ "test": "node scripts/run-unit-tests.mjs",
32
+ "test:unit": "node scripts/run-unit-tests.mjs",
33
+ "test:e2e": "E2E=1 bun test ./test/e2e",
34
+ "test:e2e:dry": "bun test ./test/e2e",
35
+ "bench": "bun run bench/index.ts",
36
+ "bench:context": "bun run bench/context-gap/index.ts",
37
+ "bench:retrieval": "bun run bench/hybrid-retrieval/index.ts",
38
+ "typecheck:bench": "tsc -p tsconfig.bench.json",
39
+ "prepack": "npm run build",
40
+ "bench:rollup": "bun run bench/rollup-quality/index.ts"
41
+ },
42
+ "engines": {
43
+ "node": ">=20"
44
+ },
45
+ "devDependencies": {
46
+ "@types/bun": "^1.1.0",
47
+ "@types/node": "^22.10.0",
48
+ "@xterm/headless": "^6.0.0",
49
+ "typescript": "^5.7.0"
50
+ },
51
+ "license": "UNLICENSED",
52
+ "private": false,
53
+ "publishConfig": {
54
+ "access": "public"
55
+ }
56
+ }