@wenathlan/saddle 1.8.18 → 2.0.2

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 (802) hide show
  1. package/Dockerfile +1339 -0
  2. package/README.md +33 -12
  3. package/alternatives.ts +1218 -0
  4. package/biome.json +153 -0
  5. package/boards.json +1517 -0
  6. package/compute.ts +3144 -0
  7. package/cores.json +1801 -0
  8. package/dist/acquisition.d.ts +359 -0
  9. package/dist/acquisition.d.ts.map +1 -0
  10. package/dist/acquisition.js +629 -0
  11. package/dist/acquisition.js.map +1 -0
  12. package/dist/alternatives.d.ts +509 -0
  13. package/dist/alternatives.d.ts.map +1 -0
  14. package/dist/alternatives.js +951 -0
  15. package/dist/alternatives.js.map +1 -0
  16. package/dist/automation.d.ts +426 -0
  17. package/dist/automation.d.ts.map +1 -0
  18. package/dist/automation.js +561 -0
  19. package/dist/automation.js.map +1 -0
  20. package/dist/browser.d.ts +562 -0
  21. package/dist/browser.d.ts.map +1 -0
  22. package/dist/browser.js +1057 -0
  23. package/dist/browser.js.map +1 -0
  24. package/dist/capacitor.config.d.ts +13 -0
  25. package/dist/capacitor.config.d.ts.map +1 -0
  26. package/dist/capacitor.config.js +26 -0
  27. package/dist/capacitor.config.js.map +1 -0
  28. package/dist/cli.d.ts +17 -0
  29. package/dist/cli.d.ts.map +1 -0
  30. package/dist/cli.js +111 -0
  31. package/dist/cli.js.map +1 -0
  32. package/dist/communication.d.ts +192 -0
  33. package/dist/communication.d.ts.map +1 -0
  34. package/dist/communication.js +418 -0
  35. package/dist/communication.js.map +1 -0
  36. package/dist/compute.d.ts +1161 -0
  37. package/dist/compute.d.ts.map +1 -0
  38. package/dist/compute.js +2273 -0
  39. package/dist/compute.js.map +1 -0
  40. package/dist/distribution.d.ts +529 -0
  41. package/dist/distribution.d.ts.map +1 -0
  42. package/dist/distribution.js +811 -0
  43. package/dist/distribution.js.map +1 -0
  44. package/dist/execution.d.ts +530 -0
  45. package/dist/execution.d.ts.map +1 -0
  46. package/dist/execution.js +761 -0
  47. package/dist/execution.js.map +1 -0
  48. package/dist/format.d.ts +19 -0
  49. package/dist/format.d.ts.map +1 -0
  50. package/dist/format.js +60 -0
  51. package/dist/format.js.map +1 -0
  52. package/dist/foundation.d.ts +176 -0
  53. package/dist/foundation.d.ts.map +1 -0
  54. package/dist/foundation.js +309 -0
  55. package/dist/foundation.js.map +1 -0
  56. package/dist/index.d.ts +733 -123
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +1018 -123
  59. package/dist/index.js.map +1 -1
  60. package/dist/integration.d.ts +236 -0
  61. package/dist/integration.d.ts.map +1 -0
  62. package/dist/integration.js +236 -0
  63. package/dist/integration.js.map +1 -0
  64. package/dist/intelligence.d.ts +94 -0
  65. package/dist/intelligence.d.ts.map +1 -0
  66. package/dist/intelligence.js +145 -0
  67. package/dist/intelligence.js.map +1 -0
  68. package/dist/{isolation/contracts.d.ts → isolation.d.ts} +12 -1
  69. package/dist/isolation.d.ts.map +1 -0
  70. package/dist/{isolation/contracts.js → isolation.js} +13 -1
  71. package/dist/isolation.js.map +1 -0
  72. package/dist/media.d.ts +344 -0
  73. package/dist/media.d.ts.map +1 -0
  74. package/dist/media.js +986 -0
  75. package/dist/media.js.map +1 -0
  76. package/dist/modes.d.ts +359 -0
  77. package/dist/modes.d.ts.map +1 -0
  78. package/dist/modes.js +134 -0
  79. package/dist/modes.js.map +1 -0
  80. package/dist/{library/public.d.ts → operations.d.ts} +15 -1
  81. package/dist/operations.d.ts.map +1 -0
  82. package/dist/{library/public.js → operations.js} +18 -7
  83. package/dist/operations.js.map +1 -0
  84. package/dist/orchestrator.d.ts +1339 -0
  85. package/dist/orchestrator.d.ts.map +1 -0
  86. package/dist/orchestrator.js +4308 -0
  87. package/dist/orchestrator.js.map +1 -0
  88. package/dist/performance.d.ts +416 -0
  89. package/dist/performance.d.ts.map +1 -0
  90. package/dist/performance.js +827 -0
  91. package/dist/performance.js.map +1 -0
  92. package/dist/quantum.d.ts +810 -0
  93. package/dist/quantum.d.ts.map +1 -0
  94. package/dist/quantum.js +2073 -0
  95. package/dist/quantum.js.map +1 -0
  96. package/dist/render.d.ts +381 -0
  97. package/dist/render.d.ts.map +1 -0
  98. package/dist/render.js +1073 -0
  99. package/dist/render.js.map +1 -0
  100. package/dist/scheduler.d.ts +596 -0
  101. package/dist/scheduler.d.ts.map +1 -0
  102. package/dist/scheduler.js +1259 -0
  103. package/dist/scheduler.js.map +1 -0
  104. package/dist/security.d.ts +501 -0
  105. package/dist/security.d.ts.map +1 -0
  106. package/dist/security.js +1170 -0
  107. package/dist/security.js.map +1 -0
  108. package/dist/server.d.ts +21 -0
  109. package/dist/server.d.ts.map +1 -0
  110. package/dist/{server/node.js → server.js} +16 -2
  111. package/dist/server.js.map +1 -0
  112. package/dist/tiers.d.ts +1002 -0
  113. package/dist/tiers.d.ts.map +1 -0
  114. package/dist/tiers.js +2165 -0
  115. package/dist/tiers.js.map +1 -0
  116. package/dist/virtual.d.ts +641 -0
  117. package/dist/virtual.d.ts.map +1 -0
  118. package/dist/virtual.js +1285 -0
  119. package/dist/virtual.js.map +1 -0
  120. package/dist/virtualcpu.d.ts +316 -0
  121. package/dist/virtualcpu.d.ts.map +1 -0
  122. package/dist/virtualcpu.js +1180 -0
  123. package/dist/virtualcpu.js.map +1 -0
  124. package/dist/virtualgpu.d.ts +345 -0
  125. package/dist/virtualgpu.d.ts.map +1 -0
  126. package/dist/virtualgpu.js +1000 -0
  127. package/dist/virtualgpu.js.map +1 -0
  128. package/dist/virtualization.d.ts +607 -0
  129. package/dist/virtualization.d.ts.map +1 -0
  130. package/dist/virtualization.js +1187 -0
  131. package/dist/virtualization.js.map +1 -0
  132. package/dist/virtualmemory.d.ts +818 -0
  133. package/dist/virtualmemory.d.ts.map +1 -0
  134. package/dist/virtualmemory.js +1796 -0
  135. package/dist/virtualmemory.js.map +1 -0
  136. package/dist/webscrape.d.ts +720 -0
  137. package/dist/webscrape.d.ts.map +1 -0
  138. package/dist/webscrape.js +2697 -0
  139. package/dist/webscrape.js.map +1 -0
  140. package/docker.config +769 -0
  141. package/docs/CONVERSA.txt +1523 -0
  142. package/docs/alternatives.md +499 -0
  143. package/docs/architecture-1.8.19.md +76 -0
  144. package/docs/architecture-1.8.19.mmd +33 -0
  145. package/docs/architecture-1.8.19.png +0 -0
  146. package/docs/architecture.md +355 -0
  147. package/docs/brancharchive-2026-08-18.md +18 -0
  148. package/docs/browser.md +7 -0
  149. package/docs/consolidation.md +70 -0
  150. package/docs/e2ugh-engine.md +528 -0
  151. package/{dist/examples/localjob.js → docs/example-localjob.ts} +3 -3
  152. package/{dist/examples/publicapi.js → docs/example-publicapi.ts} +2 -2
  153. package/docs/hardware.md +342 -0
  154. package/docs/optimization.md +126 -0
  155. package/docs/performance.md +499 -0
  156. package/docs/planning.1.8.18.md +94 -0
  157. package/docs/planning.1.8.19.md +49 -0
  158. package/docs/releasenotes-1.8.19.md +35 -0
  159. package/docs/research-1.8.19-virtual-browser.md +27 -0
  160. package/docs/security.md +454 -0
  161. package/docs/todo-1.8.18.md +12 -0
  162. package/docs/todo-1.8.19.md +241 -0
  163. package/docs/viability.md +777 -0
  164. package/docs/virtualization.md +335 -0
  165. package/docs/web-duplicatecleanup.md +9 -0
  166. package/docs/web-ideas.md +106 -0
  167. package/docs/workflowimprovements-2026-08-19.md +70 -0
  168. package/gpumonitor.cpp +1543 -0
  169. package/gpus.json +2408 -0
  170. package/index.ts +1478 -0
  171. package/media.ts +1337 -0
  172. package/mttg.config +1549 -0
  173. package/orchestrator.ts +5462 -0
  174. package/package.json +304 -56
  175. package/passage.config +1331 -0
  176. package/performance.ts +1049 -0
  177. package/processors.json +2217 -0
  178. package/qemu.config +1062 -0
  179. package/qemubridge.py +1340 -0
  180. package/quantum.ts +2393 -0
  181. package/render.ts +1325 -0
  182. package/scheduler.ts +1600 -0
  183. package/security.ts +1449 -0
  184. package/tiers.ts +2871 -0
  185. package/tsconfig.json +29 -0
  186. package/virtualcpu.ts +1273 -0
  187. package/virtualgpu.ts +1181 -0
  188. package/virtualhardware.c +1011 -0
  189. package/virtualhardware.json +739 -0
  190. package/virtualization.ts +1628 -0
  191. package/virtualizationcore.cpp +4635 -0
  192. package/virtualmemory.ts +2303 -0
  193. package/vm.config.json +1910 -0
  194. package/{extension → web/extension}/manifest.json +1 -1
  195. package/web/readme.md +382 -0
  196. package/web/tsconfig.json +25 -0
  197. package/dist/adapters/forge.d.ts +0 -17
  198. package/dist/adapters/forge.d.ts.map +0 -1
  199. package/dist/adapters/forge.js +0 -19
  200. package/dist/adapters/forge.js.map +0 -1
  201. package/dist/adapters/forgejo.d.ts +0 -49
  202. package/dist/adapters/forgejo.d.ts.map +0 -1
  203. package/dist/adapters/forgejo.js +0 -8
  204. package/dist/adapters/forgejo.js.map +0 -1
  205. package/dist/adapters/github.d.ts +0 -12
  206. package/dist/adapters/github.d.ts.map +0 -1
  207. package/dist/adapters/github.js +0 -20
  208. package/dist/adapters/github.js.map +0 -1
  209. package/dist/adapters/gitlab.d.ts +0 -17
  210. package/dist/adapters/gitlab.d.ts.map +0 -1
  211. package/dist/adapters/gitlab.js +0 -10
  212. package/dist/adapters/gitlab.js.map +0 -1
  213. package/dist/adapters/huggingface.d.ts +0 -17
  214. package/dist/adapters/huggingface.d.ts.map +0 -1
  215. package/dist/adapters/huggingface.js +0 -6
  216. package/dist/adapters/huggingface.js.map +0 -1
  217. package/dist/adapters/socket.d.ts +0 -11
  218. package/dist/adapters/socket.d.ts.map +0 -1
  219. package/dist/adapters/socket.js +0 -17
  220. package/dist/adapters/socket.js.map +0 -1
  221. package/dist/adapters/transport.d.ts +0 -7
  222. package/dist/adapters/transport.d.ts.map +0 -1
  223. package/dist/adapters/transport.js +0 -36
  224. package/dist/adapters/transport.js.map +0 -1
  225. package/dist/ai/chunk.d.ts +0 -2
  226. package/dist/ai/chunk.d.ts.map +0 -1
  227. package/dist/ai/chunk.js +0 -36
  228. package/dist/ai/chunk.js.map +0 -1
  229. package/dist/ai/llmstxt.d.ts +0 -6
  230. package/dist/ai/llmstxt.d.ts.map +0 -1
  231. package/dist/ai/llmstxt.js +0 -12
  232. package/dist/ai/llmstxt.js.map +0 -1
  233. package/dist/ai/provenance.d.ts +0 -22
  234. package/dist/ai/provenance.d.ts.map +0 -1
  235. package/dist/ai/provenance.js +0 -25
  236. package/dist/ai/provenance.js.map +0 -1
  237. package/dist/ai/rag.d.ts +0 -26
  238. package/dist/ai/rag.d.ts.map +0 -1
  239. package/dist/ai/rag.js +0 -22
  240. package/dist/ai/rag.js.map +0 -1
  241. package/dist/ai/tokens.d.ts +0 -15
  242. package/dist/ai/tokens.d.ts.map +0 -1
  243. package/dist/ai/tokens.js +0 -9
  244. package/dist/ai/tokens.js.map +0 -1
  245. package/dist/api/auth.d.ts +0 -16
  246. package/dist/api/auth.d.ts.map +0 -1
  247. package/dist/api/auth.js +0 -19
  248. package/dist/api/auth.js.map +0 -1
  249. package/dist/api/contracts.d.ts +0 -28
  250. package/dist/api/contracts.d.ts.map +0 -1
  251. package/dist/api/contracts.js +0 -14
  252. package/dist/api/contracts.js.map +0 -1
  253. package/dist/api/control.d.ts +0 -10
  254. package/dist/api/control.d.ts.map +0 -1
  255. package/dist/api/control.js +0 -35
  256. package/dist/api/control.js.map +0 -1
  257. package/dist/api/http.d.ts +0 -7
  258. package/dist/api/http.d.ts.map +0 -1
  259. package/dist/api/http.js +0 -12
  260. package/dist/api/http.js.map +0 -1
  261. package/dist/api/rate.d.ts +0 -28
  262. package/dist/api/rate.d.ts.map +0 -1
  263. package/dist/api/rate.js +0 -36
  264. package/dist/api/rate.js.map +0 -1
  265. package/dist/api/security.d.ts +0 -12
  266. package/dist/api/security.d.ts.map +0 -1
  267. package/dist/api/security.js +0 -56
  268. package/dist/api/security.js.map +0 -1
  269. package/dist/api/service.d.ts +0 -5
  270. package/dist/api/service.d.ts.map +0 -1
  271. package/dist/api/service.js +0 -70
  272. package/dist/api/service.js.map +0 -1
  273. package/dist/apps/registry.d.ts +0 -33
  274. package/dist/apps/registry.d.ts.map +0 -1
  275. package/dist/apps/registry.js +0 -24
  276. package/dist/apps/registry.js.map +0 -1
  277. package/dist/binary/archive.d.ts +0 -27
  278. package/dist/binary/archive.d.ts.map +0 -1
  279. package/dist/binary/archive.js +0 -46
  280. package/dist/binary/archive.js.map +0 -1
  281. package/dist/binary/build.d.ts +0 -29
  282. package/dist/binary/build.d.ts.map +0 -1
  283. package/dist/binary/build.js +0 -17
  284. package/dist/binary/build.js.map +0 -1
  285. package/dist/binary/transform.d.ts +0 -70
  286. package/dist/binary/transform.d.ts.map +0 -1
  287. package/dist/binary/transform.js +0 -105
  288. package/dist/binary/transform.js.map +0 -1
  289. package/dist/bot/adapter.d.ts +0 -5
  290. package/dist/bot/adapter.d.ts.map +0 -1
  291. package/dist/bot/adapter.js +0 -11
  292. package/dist/bot/adapter.js.map +0 -1
  293. package/dist/bot/bot.d.ts +0 -28
  294. package/dist/bot/bot.d.ts.map +0 -1
  295. package/dist/bot/bot.js +0 -52
  296. package/dist/bot/bot.js.map +0 -1
  297. package/dist/bot/commands.d.ts +0 -8
  298. package/dist/bot/commands.d.ts.map +0 -1
  299. package/dist/bot/commands.js +0 -19
  300. package/dist/bot/commands.js.map +0 -1
  301. package/dist/bot/permissions.d.ts +0 -13
  302. package/dist/bot/permissions.d.ts.map +0 -1
  303. package/dist/bot/permissions.js +0 -16
  304. package/dist/bot/permissions.js.map +0 -1
  305. package/dist/browser/actions.d.ts +0 -33
  306. package/dist/browser/actions.d.ts.map +0 -1
  307. package/dist/browser/actions.js +0 -44
  308. package/dist/browser/actions.js.map +0 -1
  309. package/dist/browser/agent.d.ts +0 -21
  310. package/dist/browser/agent.d.ts.map +0 -1
  311. package/dist/browser/agent.js +0 -13
  312. package/dist/browser/agent.js.map +0 -1
  313. package/dist/browser/context.d.ts +0 -43
  314. package/dist/browser/context.d.ts.map +0 -1
  315. package/dist/browser/context.js +0 -54
  316. package/dist/browser/context.js.map +0 -1
  317. package/dist/browser/fingerprint.d.ts +0 -4
  318. package/dist/browser/fingerprint.d.ts.map +0 -1
  319. package/dist/browser/fingerprint.js +0 -12
  320. package/dist/browser/fingerprint.js.map +0 -1
  321. package/dist/browser/index.d.ts +0 -11
  322. package/dist/browser/index.d.ts.map +0 -1
  323. package/dist/browser/index.js +0 -11
  324. package/dist/browser/index.js.map +0 -1
  325. package/dist/browser/playwright.d.ts +0 -11
  326. package/dist/browser/playwright.d.ts.map +0 -1
  327. package/dist/browser/playwright.js +0 -24
  328. package/dist/browser/playwright.js.map +0 -1
  329. package/dist/browser/recorder.d.ts +0 -21
  330. package/dist/browser/recorder.d.ts.map +0 -1
  331. package/dist/browser/recorder.js +0 -58
  332. package/dist/browser/recorder.js.map +0 -1
  333. package/dist/browser/session.d.ts +0 -14
  334. package/dist/browser/session.d.ts.map +0 -1
  335. package/dist/browser/session.js +0 -21
  336. package/dist/browser/session.js.map +0 -1
  337. package/dist/browser/snapshot.d.ts +0 -69
  338. package/dist/browser/snapshot.d.ts.map +0 -1
  339. package/dist/browser/snapshot.js +0 -133
  340. package/dist/browser/snapshot.js.map +0 -1
  341. package/dist/captcha/contract.d.ts +0 -35
  342. package/dist/captcha/contract.d.ts.map +0 -1
  343. package/dist/captcha/contract.js +0 -17
  344. package/dist/captcha/contract.js.map +0 -1
  345. package/dist/captcha/evidence.d.ts +0 -10
  346. package/dist/captcha/evidence.d.ts.map +0 -1
  347. package/dist/captcha/evidence.js +0 -9
  348. package/dist/captcha/evidence.js.map +0 -1
  349. package/dist/captcha/guard.d.ts +0 -23
  350. package/dist/captcha/guard.d.ts.map +0 -1
  351. package/dist/captcha/guard.js +0 -12
  352. package/dist/captcha/guard.js.map +0 -1
  353. package/dist/cli/main.d.ts +0 -4
  354. package/dist/cli/main.d.ts.map +0 -1
  355. package/dist/cli/main.js +0 -46
  356. package/dist/cli/main.js.map +0 -1
  357. package/dist/core/errors.d.ts +0 -84
  358. package/dist/core/errors.d.ts.map +0 -1
  359. package/dist/core/errors.js +0 -54
  360. package/dist/core/errors.js.map +0 -1
  361. package/dist/core/events.d.ts +0 -9
  362. package/dist/core/events.d.ts.map +0 -1
  363. package/dist/core/events.js +0 -21
  364. package/dist/core/events.js.map +0 -1
  365. package/dist/core/hash.d.ts +0 -10
  366. package/dist/core/hash.d.ts.map +0 -1
  367. package/dist/core/hash.js +0 -82
  368. package/dist/core/hash.js.map +0 -1
  369. package/dist/core/ids.d.ts +0 -10
  370. package/dist/core/ids.d.ts.map +0 -1
  371. package/dist/core/ids.js +0 -15
  372. package/dist/core/ids.js.map +0 -1
  373. package/dist/delivery/manifest.d.ts +0 -35
  374. package/dist/delivery/manifest.d.ts.map +0 -1
  375. package/dist/delivery/manifest.js +0 -68
  376. package/dist/delivery/manifest.js.map +0 -1
  377. package/dist/deploy/index.d.ts +0 -6
  378. package/dist/deploy/index.d.ts.map +0 -1
  379. package/dist/deploy/index.js +0 -6
  380. package/dist/deploy/index.js.map +0 -1
  381. package/dist/dispatch/resumable.d.ts +0 -102
  382. package/dist/dispatch/resumable.d.ts.map +0 -1
  383. package/dist/dispatch/resumable.js +0 -64
  384. package/dist/dispatch/resumable.js.map +0 -1
  385. package/dist/dispatch/workflow.d.ts +0 -6
  386. package/dist/dispatch/workflow.d.ts.map +0 -1
  387. package/dist/dispatch/workflow.js +0 -37
  388. package/dist/dispatch/workflow.js.map +0 -1
  389. package/dist/domain/artifacts.d.ts +0 -12
  390. package/dist/domain/artifacts.d.ts.map +0 -1
  391. package/dist/domain/artifacts.js +0 -14
  392. package/dist/domain/artifacts.js.map +0 -1
  393. package/dist/domain/jobs.d.ts +0 -12
  394. package/dist/domain/jobs.d.ts.map +0 -1
  395. package/dist/domain/jobs.js +0 -20
  396. package/dist/domain/jobs.js.map +0 -1
  397. package/dist/domain/providers.d.ts +0 -10
  398. package/dist/domain/providers.d.ts.map +0 -1
  399. package/dist/domain/providers.js +0 -8
  400. package/dist/domain/providers.js.map +0 -1
  401. package/dist/domain/runtime.d.ts +0 -14
  402. package/dist/domain/runtime.d.ts.map +0 -1
  403. package/dist/domain/runtime.js +0 -10
  404. package/dist/domain/runtime.js.map +0 -1
  405. package/dist/domain/sessions.d.ts +0 -12
  406. package/dist/domain/sessions.d.ts.map +0 -1
  407. package/dist/domain/sessions.js +0 -57
  408. package/dist/domain/sessions.js.map +0 -1
  409. package/dist/examples/localjob.d.ts +0 -2
  410. package/dist/examples/localjob.d.ts.map +0 -1
  411. package/dist/examples/localjob.js.map +0 -1
  412. package/dist/examples/publicapi.d.ts +0 -2
  413. package/dist/examples/publicapi.d.ts.map +0 -1
  414. package/dist/examples/publicapi.js.map +0 -1
  415. package/dist/extension/build.d.ts +0 -9
  416. package/dist/extension/build.d.ts.map +0 -1
  417. package/dist/extension/build.js +0 -85
  418. package/dist/extension/build.js.map +0 -1
  419. package/dist/extension/content.d.ts +0 -6
  420. package/dist/extension/content.d.ts.map +0 -1
  421. package/dist/extension/content.js +0 -135
  422. package/dist/extension/content.js.map +0 -1
  423. package/dist/extension/index.d.ts +0 -7
  424. package/dist/extension/index.d.ts.map +0 -1
  425. package/dist/extension/index.js +0 -7
  426. package/dist/extension/index.js.map +0 -1
  427. package/dist/extension/pagebridge.d.ts +0 -6
  428. package/dist/extension/pagebridge.d.ts.map +0 -1
  429. package/dist/extension/pagebridge.js +0 -42
  430. package/dist/extension/pagebridge.js.map +0 -1
  431. package/dist/extension/permissions.d.ts +0 -26
  432. package/dist/extension/permissions.d.ts.map +0 -1
  433. package/dist/extension/permissions.js +0 -28
  434. package/dist/extension/permissions.js.map +0 -1
  435. package/dist/extension/popup.d.ts +0 -5
  436. package/dist/extension/popup.d.ts.map +0 -1
  437. package/dist/extension/popup.js +0 -26
  438. package/dist/extension/popup.js.map +0 -1
  439. package/dist/extension/protocol.d.ts +0 -58
  440. package/dist/extension/protocol.d.ts.map +0 -1
  441. package/dist/extension/protocol.js +0 -101
  442. package/dist/extension/protocol.js.map +0 -1
  443. package/dist/extension/serviceworker.d.ts +0 -25
  444. package/dist/extension/serviceworker.d.ts.map +0 -1
  445. package/dist/extension/serviceworker.js +0 -102
  446. package/dist/extension/serviceworker.js.map +0 -1
  447. package/dist/extension/worker.d.ts +0 -28
  448. package/dist/extension/worker.d.ts.map +0 -1
  449. package/dist/extension/worker.js +0 -22
  450. package/dist/extension/worker.js.map +0 -1
  451. package/dist/format/check.d.ts +0 -8
  452. package/dist/format/check.d.ts.map +0 -1
  453. package/dist/format/check.js +0 -38
  454. package/dist/format/check.js.map +0 -1
  455. package/dist/isolation/contracts.d.ts.map +0 -1
  456. package/dist/isolation/contracts.js.map +0 -1
  457. package/dist/library/public.d.ts.map +0 -1
  458. package/dist/library/public.js.map +0 -1
  459. package/dist/mcp/browser.d.ts +0 -9
  460. package/dist/mcp/browser.d.ts.map +0 -1
  461. package/dist/mcp/browser.js +0 -13
  462. package/dist/mcp/browser.js.map +0 -1
  463. package/dist/mcp/server.d.ts +0 -35
  464. package/dist/mcp/server.d.ts.map +0 -1
  465. package/dist/mcp/server.js +0 -40
  466. package/dist/mcp/server.js.map +0 -1
  467. package/dist/mcp/transport.d.ts +0 -7
  468. package/dist/mcp/transport.d.ts.map +0 -1
  469. package/dist/mcp/transport.js +0 -17
  470. package/dist/mcp/transport.js.map +0 -1
  471. package/dist/memory/bridge.d.ts +0 -14
  472. package/dist/memory/bridge.d.ts.map +0 -1
  473. package/dist/memory/bridge.js +0 -16
  474. package/dist/memory/bridge.js.map +0 -1
  475. package/dist/memory/engine.d.ts +0 -38
  476. package/dist/memory/engine.d.ts.map +0 -1
  477. package/dist/memory/engine.js +0 -109
  478. package/dist/memory/engine.js.map +0 -1
  479. package/dist/memory/modes.d.ts +0 -43
  480. package/dist/memory/modes.d.ts.map +0 -1
  481. package/dist/memory/modes.js +0 -66
  482. package/dist/memory/modes.js.map +0 -1
  483. package/dist/memory/objects.d.ts +0 -21
  484. package/dist/memory/objects.d.ts.map +0 -1
  485. package/dist/memory/objects.js +0 -20
  486. package/dist/memory/objects.js.map +0 -1
  487. package/dist/memory/planner.d.ts +0 -66
  488. package/dist/memory/planner.d.ts.map +0 -1
  489. package/dist/memory/planner.js +0 -108
  490. package/dist/memory/planner.js.map +0 -1
  491. package/dist/memory/targets.d.ts +0 -78
  492. package/dist/memory/targets.d.ts.map +0 -1
  493. package/dist/memory/targets.js +0 -29
  494. package/dist/memory/targets.js.map +0 -1
  495. package/dist/memory/transforms.d.ts +0 -19
  496. package/dist/memory/transforms.d.ts.map +0 -1
  497. package/dist/memory/transforms.js +0 -14
  498. package/dist/memory/transforms.js.map +0 -1
  499. package/dist/modes/matrix.d.ts +0 -23
  500. package/dist/modes/matrix.d.ts.map +0 -1
  501. package/dist/modes/matrix.js +0 -18
  502. package/dist/modes/matrix.js.map +0 -1
  503. package/dist/modes/modes.d.ts +0 -33
  504. package/dist/modes/modes.d.ts.map +0 -1
  505. package/dist/modes/modes.js +0 -15
  506. package/dist/modes/modes.js.map +0 -1
  507. package/dist/modes/resolve.d.ts +0 -96
  508. package/dist/modes/resolve.d.ts.map +0 -1
  509. package/dist/modes/resolve.js +0 -48
  510. package/dist/modes/resolve.js.map +0 -1
  511. package/dist/observability/metrics.d.ts +0 -14
  512. package/dist/observability/metrics.d.ts.map +0 -1
  513. package/dist/observability/metrics.js +0 -18
  514. package/dist/observability/metrics.js.map +0 -1
  515. package/dist/packager/manifest.d.ts +0 -66
  516. package/dist/packager/manifest.d.ts.map +0 -1
  517. package/dist/packager/manifest.js +0 -94
  518. package/dist/packager/manifest.js.map +0 -1
  519. package/dist/packager/publish.d.ts +0 -51
  520. package/dist/packager/publish.d.ts.map +0 -1
  521. package/dist/packager/publish.js +0 -18
  522. package/dist/packager/publish.js.map +0 -1
  523. package/dist/packager/targetcli.d.ts +0 -7
  524. package/dist/packager/targetcli.d.ts.map +0 -1
  525. package/dist/packager/targetcli.js +0 -22
  526. package/dist/packager/targetcli.js.map +0 -1
  527. package/dist/persistence/adapter.d.ts +0 -5
  528. package/dist/persistence/adapter.d.ts.map +0 -1
  529. package/dist/persistence/adapter.js +0 -11
  530. package/dist/persistence/adapter.js.map +0 -1
  531. package/dist/persistence/drizzle.d.ts +0 -2
  532. package/dist/persistence/drizzle.d.ts.map +0 -1
  533. package/dist/persistence/drizzle.js +0 -12
  534. package/dist/persistence/drizzle.js.map +0 -1
  535. package/dist/persistence/memory.d.ts +0 -2
  536. package/dist/persistence/memory.d.ts.map +0 -1
  537. package/dist/persistence/memory.js +0 -27
  538. package/dist/persistence/memory.js.map +0 -1
  539. package/dist/persistence/migrations.d.ts +0 -19
  540. package/dist/persistence/migrations.d.ts.map +0 -1
  541. package/dist/persistence/migrations.js +0 -13
  542. package/dist/persistence/migrations.js.map +0 -1
  543. package/dist/persistence/prisma.d.ts +0 -2
  544. package/dist/persistence/prisma.d.ts.map +0 -1
  545. package/dist/persistence/prisma.js +0 -25
  546. package/dist/persistence/prisma.js.map +0 -1
  547. package/dist/persistence/schema.d.ts +0 -63
  548. package/dist/persistence/schema.d.ts.map +0 -1
  549. package/dist/persistence/schema.js +0 -28
  550. package/dist/persistence/schema.js.map +0 -1
  551. package/dist/persistence/sql.d.ts +0 -3
  552. package/dist/persistence/sql.d.ts.map +0 -1
  553. package/dist/persistence/sql.js +0 -37
  554. package/dist/persistence/sql.js.map +0 -1
  555. package/dist/protocol/blocks.d.ts +0 -10
  556. package/dist/protocol/blocks.d.ts.map +0 -1
  557. package/dist/protocol/blocks.js +0 -26
  558. package/dist/protocol/blocks.js.map +0 -1
  559. package/dist/protocol/json.d.ts +0 -6
  560. package/dist/protocol/json.d.ts.map +0 -1
  561. package/dist/protocol/json.js +0 -6
  562. package/dist/protocol/json.js.map +0 -1
  563. package/dist/protocol/ndjson.d.ts +0 -3
  564. package/dist/protocol/ndjson.d.ts.map +0 -1
  565. package/dist/protocol/ndjson.js +0 -20
  566. package/dist/protocol/ndjson.js.map +0 -1
  567. package/dist/protocol/sse.d.ts +0 -7
  568. package/dist/protocol/sse.d.ts.map +0 -1
  569. package/dist/protocol/sse.js +0 -25
  570. package/dist/protocol/sse.js.map +0 -1
  571. package/dist/proxy/pool.d.ts +0 -9
  572. package/dist/proxy/pool.d.ts.map +0 -1
  573. package/dist/proxy/pool.js +0 -27
  574. package/dist/proxy/pool.js.map +0 -1
  575. package/dist/queue/idempotency.d.ts +0 -10
  576. package/dist/queue/idempotency.d.ts.map +0 -1
  577. package/dist/queue/idempotency.js +0 -13
  578. package/dist/queue/idempotency.js.map +0 -1
  579. package/dist/queue/persistent.d.ts +0 -14
  580. package/dist/queue/persistent.d.ts.map +0 -1
  581. package/dist/queue/persistent.js +0 -66
  582. package/dist/queue/persistent.js.map +0 -1
  583. package/dist/queue/queue.d.ts +0 -7
  584. package/dist/queue/queue.d.ts.map +0 -1
  585. package/dist/queue/queue.js +0 -55
  586. package/dist/queue/queue.js.map +0 -1
  587. package/dist/queue/saga.d.ts +0 -5
  588. package/dist/queue/saga.d.ts.map +0 -1
  589. package/dist/queue/saga.js +0 -20
  590. package/dist/queue/saga.js.map +0 -1
  591. package/dist/release/assets.d.ts +0 -144
  592. package/dist/release/assets.d.ts.map +0 -1
  593. package/dist/release/assets.js +0 -157
  594. package/dist/release/assets.js.map +0 -1
  595. package/dist/release/evidence.d.ts +0 -92
  596. package/dist/release/evidence.d.ts.map +0 -1
  597. package/dist/release/evidence.js +0 -148
  598. package/dist/release/evidence.js.map +0 -1
  599. package/dist/release/verify.d.ts +0 -12
  600. package/dist/release/verify.d.ts.map +0 -1
  601. package/dist/release/verify.js +0 -112
  602. package/dist/release/verify.js.map +0 -1
  603. package/dist/runners/chain.d.ts +0 -125
  604. package/dist/runners/chain.d.ts.map +0 -1
  605. package/dist/runners/chain.js +0 -95
  606. package/dist/runners/chain.js.map +0 -1
  607. package/dist/runners/health.d.ts +0 -36
  608. package/dist/runners/health.d.ts.map +0 -1
  609. package/dist/runners/health.js +0 -26
  610. package/dist/runners/health.js.map +0 -1
  611. package/dist/runners/heartbeat.d.ts +0 -23
  612. package/dist/runners/heartbeat.d.ts.map +0 -1
  613. package/dist/runners/heartbeat.js +0 -29
  614. package/dist/runners/heartbeat.js.map +0 -1
  615. package/dist/runners/inprocess.d.ts +0 -17
  616. package/dist/runners/inprocess.d.ts.map +0 -1
  617. package/dist/runners/inprocess.js +0 -20
  618. package/dist/runners/inprocess.js.map +0 -1
  619. package/dist/runners/scheduler.d.ts +0 -5
  620. package/dist/runners/scheduler.d.ts.map +0 -1
  621. package/dist/runners/scheduler.js +0 -19
  622. package/dist/runners/scheduler.js.map +0 -1
  623. package/dist/runtime/abort.d.ts +0 -8
  624. package/dist/runtime/abort.d.ts.map +0 -1
  625. package/dist/runtime/abort.js +0 -13
  626. package/dist/runtime/abort.js.map +0 -1
  627. package/dist/runtime/compatibility.d.ts +0 -37
  628. package/dist/runtime/compatibility.d.ts.map +0 -1
  629. package/dist/runtime/compatibility.js +0 -10
  630. package/dist/runtime/compatibility.js.map +0 -1
  631. package/dist/runtime/detect.d.ts +0 -13
  632. package/dist/runtime/detect.d.ts.map +0 -1
  633. package/dist/runtime/detect.js +0 -18
  634. package/dist/runtime/detect.js.map +0 -1
  635. package/dist/runtime/engine.d.ts +0 -20
  636. package/dist/runtime/engine.d.ts.map +0 -1
  637. package/dist/runtime/engine.js +0 -61
  638. package/dist/runtime/engine.js.map +0 -1
  639. package/dist/runtime/retry.d.ts +0 -19
  640. package/dist/runtime/retry.d.ts.map +0 -1
  641. package/dist/runtime/retry.js +0 -54
  642. package/dist/runtime/retry.js.map +0 -1
  643. package/dist/runtime/worker.d.ts +0 -10
  644. package/dist/runtime/worker.d.ts.map +0 -1
  645. package/dist/runtime/worker.js +0 -25
  646. package/dist/runtime/worker.js.map +0 -1
  647. package/dist/scrape/cache.d.ts +0 -45
  648. package/dist/scrape/cache.d.ts.map +0 -1
  649. package/dist/scrape/cache.js +0 -45
  650. package/dist/scrape/cache.js.map +0 -1
  651. package/dist/scrape/crawl.d.ts +0 -47
  652. package/dist/scrape/crawl.d.ts.map +0 -1
  653. package/dist/scrape/crawl.js +0 -114
  654. package/dist/scrape/crawl.js.map +0 -1
  655. package/dist/scrape/extract.d.ts +0 -63
  656. package/dist/scrape/extract.d.ts.map +0 -1
  657. package/dist/scrape/extract.js +0 -47
  658. package/dist/scrape/extract.js.map +0 -1
  659. package/dist/scrape/normalize.d.ts +0 -52
  660. package/dist/scrape/normalize.d.ts.map +0 -1
  661. package/dist/scrape/normalize.js +0 -102
  662. package/dist/scrape/normalize.js.map +0 -1
  663. package/dist/scrape/robots.d.ts +0 -37
  664. package/dist/scrape/robots.d.ts.map +0 -1
  665. package/dist/scrape/robots.js +0 -71
  666. package/dist/scrape/robots.js.map +0 -1
  667. package/dist/scrape/schema.d.ts +0 -23
  668. package/dist/scrape/schema.d.ts.map +0 -1
  669. package/dist/scrape/schema.js +0 -92
  670. package/dist/scrape/schema.js.map +0 -1
  671. package/dist/scrape/scraper.d.ts +0 -6
  672. package/dist/scrape/scraper.d.ts.map +0 -1
  673. package/dist/scrape/scraper.js +0 -46
  674. package/dist/scrape/scraper.js.map +0 -1
  675. package/dist/scrape/semantic.d.ts +0 -25
  676. package/dist/scrape/semantic.d.ts.map +0 -1
  677. package/dist/scrape/semantic.js +0 -27
  678. package/dist/scrape/semantic.js.map +0 -1
  679. package/dist/server/node.d.ts +0 -7
  680. package/dist/server/node.d.ts.map +0 -1
  681. package/dist/server/node.js.map +0 -1
  682. package/dist/sessions/file.d.ts +0 -25
  683. package/dist/sessions/file.d.ts.map +0 -1
  684. package/dist/sessions/file.js +0 -13
  685. package/dist/sessions/file.js.map +0 -1
  686. package/dist/sessions/replay.d.ts +0 -9
  687. package/dist/sessions/replay.d.ts.map +0 -1
  688. package/dist/sessions/replay.js +0 -70
  689. package/dist/sessions/replay.js.map +0 -1
  690. package/dist/sessions/store.d.ts +0 -25
  691. package/dist/sessions/store.d.ts.map +0 -1
  692. package/dist/sessions/store.js +0 -13
  693. package/dist/sessions/store.js.map +0 -1
  694. package/dist/storage/adapter.d.ts +0 -5
  695. package/dist/storage/adapter.d.ts.map +0 -1
  696. package/dist/storage/adapter.js +0 -11
  697. package/dist/storage/adapter.js.map +0 -1
  698. package/dist/storage/cache.d.ts +0 -23
  699. package/dist/storage/cache.d.ts.map +0 -1
  700. package/dist/storage/cache.js +0 -79
  701. package/dist/storage/cache.js.map +0 -1
  702. package/dist/storage/checksum.d.ts +0 -3
  703. package/dist/storage/checksum.d.ts.map +0 -1
  704. package/dist/storage/checksum.js +0 -19
  705. package/dist/storage/checksum.js.map +0 -1
  706. package/dist/storage/chunked.d.ts +0 -21
  707. package/dist/storage/chunked.d.ts.map +0 -1
  708. package/dist/storage/chunked.js +0 -67
  709. package/dist/storage/chunked.js.map +0 -1
  710. package/dist/storage/content.d.ts +0 -24
  711. package/dist/storage/content.d.ts.map +0 -1
  712. package/dist/storage/content.js +0 -44
  713. package/dist/storage/content.js.map +0 -1
  714. package/dist/storage/filehosting.d.ts +0 -2
  715. package/dist/storage/filehosting.d.ts.map +0 -1
  716. package/dist/storage/filehosting.js +0 -24
  717. package/dist/storage/filehosting.js.map +0 -1
  718. package/dist/storage/githubcontents.d.ts +0 -2
  719. package/dist/storage/githubcontents.d.ts.map +0 -1
  720. package/dist/storage/githubcontents.js +0 -29
  721. package/dist/storage/githubcontents.js.map +0 -1
  722. package/dist/storage/index.d.ts +0 -12
  723. package/dist/storage/index.d.ts.map +0 -1
  724. package/dist/storage/index.js +0 -12
  725. package/dist/storage/index.js.map +0 -1
  726. package/dist/storage/local.d.ts +0 -2
  727. package/dist/storage/local.d.ts.map +0 -1
  728. package/dist/storage/local.js +0 -72
  729. package/dist/storage/local.js.map +0 -1
  730. package/dist/storage/memory.d.ts +0 -6
  731. package/dist/storage/memory.d.ts.map +0 -1
  732. package/dist/storage/memory.js +0 -36
  733. package/dist/storage/memory.js.map +0 -1
  734. package/dist/storage/pool.d.ts +0 -95
  735. package/dist/storage/pool.d.ts.map +0 -1
  736. package/dist/storage/pool.js +0 -202
  737. package/dist/storage/pool.js.map +0 -1
  738. package/dist/storage/s3compatible.d.ts +0 -3
  739. package/dist/storage/s3compatible.d.ts.map +0 -1
  740. package/dist/storage/s3compatible.js +0 -70
  741. package/dist/storage/s3compatible.js.map +0 -1
  742. package/dist/storage/sync.d.ts +0 -47
  743. package/dist/storage/sync.d.ts.map +0 -1
  744. package/dist/storage/sync.js +0 -75
  745. package/dist/storage/sync.js.map +0 -1
  746. package/dist/surfaces/adapters.d.ts +0 -97
  747. package/dist/surfaces/adapters.d.ts.map +0 -1
  748. package/dist/surfaces/adapters.js +0 -50
  749. package/dist/surfaces/adapters.js.map +0 -1
  750. package/dist/surfaces/controls.d.ts +0 -18
  751. package/dist/surfaces/controls.d.ts.map +0 -1
  752. package/dist/surfaces/controls.js +0 -45
  753. package/dist/surfaces/controls.js.map +0 -1
  754. package/dist/surfaces/manifest.d.ts +0 -68
  755. package/dist/surfaces/manifest.d.ts.map +0 -1
  756. package/dist/surfaces/manifest.js +0 -42
  757. package/dist/surfaces/manifest.js.map +0 -1
  758. package/dist/surfaces/n8n.d.ts +0 -25
  759. package/dist/surfaces/n8n.d.ts.map +0 -1
  760. package/dist/surfaces/n8n.js +0 -31
  761. package/dist/surfaces/n8n.js.map +0 -1
  762. package/dist/surfaces/operations.d.ts +0 -32
  763. package/dist/surfaces/operations.d.ts.map +0 -1
  764. package/dist/surfaces/operations.js +0 -53
  765. package/dist/surfaces/operations.js.map +0 -1
  766. package/dist/surfaces/requirements.d.ts +0 -29
  767. package/dist/surfaces/requirements.d.ts.map +0 -1
  768. package/dist/surfaces/requirements.js +0 -50
  769. package/dist/surfaces/requirements.js.map +0 -1
  770. package/dist/surfaces/targets.d.ts +0 -196
  771. package/dist/surfaces/targets.d.ts.map +0 -1
  772. package/dist/surfaces/targets.js +0 -27
  773. package/dist/surfaces/targets.js.map +0 -1
  774. package/dist/webhook/delivery.d.ts +0 -18
  775. package/dist/webhook/delivery.d.ts.map +0 -1
  776. package/dist/webhook/delivery.js +0 -36
  777. package/dist/webhook/delivery.js.map +0 -1
  778. package/dist/webhook/receiver.d.ts +0 -26
  779. package/dist/webhook/receiver.d.ts.map +0 -1
  780. package/dist/webhook/receiver.js +0 -24
  781. package/dist/webhook/receiver.js.map +0 -1
  782. package/dist/webhook/signature.d.ts +0 -3
  783. package/dist/webhook/signature.d.ts.map +0 -1
  784. package/dist/webhook/signature.js +0 -7
  785. package/dist/webhook/signature.js.map +0 -1
  786. package/dist/workflow/manifest.d.ts +0 -22
  787. package/dist/workflow/manifest.d.ts.map +0 -1
  788. package/dist/workflow/manifest.js +0 -21
  789. package/dist/workflow/manifest.js.map +0 -1
  790. package/dist/workflow/registry.d.ts +0 -7
  791. package/dist/workflow/registry.d.ts.map +0 -1
  792. package/dist/workflow/registry.js +0 -18
  793. package/dist/workflow/registry.js.map +0 -1
  794. package/dist/workflow/templates.d.ts +0 -6
  795. package/dist/workflow/templates.d.ts.map +0 -1
  796. package/dist/workflow/templates.js +0 -18
  797. package/dist/workflow/templates.js.map +0 -1
  798. package/dist/workflow/triggers.d.ts +0 -64
  799. package/dist/workflow/triggers.d.ts.map +0 -1
  800. package/dist/workflow/triggers.js +0 -99
  801. package/dist/workflow/triggers.js.map +0 -1
  802. /package/{extension/README.md → docs/extension.md} +0 -0
@@ -0,0 +1,1180 @@
1
+ /**
2
+ * virtualcpu - virtual processor bank and procfs generators.
3
+ *
4
+ * This module embeds the BEST_VIRTUAL_PROCESSORS bank with real, verified
5
+ * specifications of the strongest server, workstation and desktop processors
6
+ * available on 2026-08-22 (AMD EPYC 9965 Turin, Ryzen 9 9950X3D, Threadripper
7
+ * PRO 9995WX, Threadripper 7980X, Intel Core Ultra 9 285K, AMD EPYC 9955) and
8
+ * converts any of them into byte-accurate procfs texts: generateVirtualCpuinfo
9
+ * renders a complete /proc/cpuinfo payload with vendor identity, family,
10
+ * model, topology, cache sizes and the full Zen 5 flag set (avx512f, avx512bw,
11
+ * avx512cd, avx512dq, avx512vl, avx512_bf16, sha_ni and friends), while
12
+ * generateVirtualLscpu renders the util-linux summary with NUMA ranges and
13
+ * vulnerability lines. The module also owns the cpuRegistry, a fluent
14
+ * virtualcpubuilder, a processor factory, topology solving, capability
15
+ * scoring, the marchFlag/validateCpuCount helpers absorbed from the v2 stub
16
+ * and the boards() socket index.
17
+ *
18
+ * /proc/meminfo generation (generateVirtualMeminfo, meminfoptions and
19
+ * pagealign) moved to virtualmemory.ts in the v2 reorganization so every
20
+ * memory concern lives in one module.
21
+ *
22
+ * Data sources (verified 2026-08-22): amd.com product pages (EPYC 9965,
23
+ * EPYC 9955, Ryzen 9 9950X3D, Threadripper PRO 9995WX), intel.com ARK
24
+ * (Core Ultra 9 285K), techpowerup.com CPU database and the QEMU 11.1.0
25
+ * target/i386 CPU model table (EPYC-v5).
26
+ *
27
+ * Contexts (24): hardwareerror, vendorid, vendorprofile, ZEN5FLAGS,
28
+ * ARROWLAKEFLAGS, vendorprofiles, virtualcpuspec, BEST_VIRTUAL_PROCESSORS,
29
+ * cpuRegistry, solvetopology, generateVirtualCpuinfo, generateVirtualLscpu,
30
+ * virtualcpubuilder, createVirtualProcessor, validateCpuCount, marchFlag,
31
+ * boards, cpuscore, compareVirtualProcessors, listBestVirtualProcessors,
32
+ * serializeprovisionedcpu, modellease, stableModelId, virtualcpudemo.
33
+ *
34
+ * Patterns: registry (cpuRegistry), builder (virtualcpubuilder), factory
35
+ * (createVirtualProcessor), proxy-free disposable lease (modellease).
36
+ * Rules: lowercase identifiers, english jsdoc, third person, no emoji,
37
+ * try/catch catcher on every fallible path, node:* built-ins only, and no
38
+ * hardcoded localhost address anywhere.
39
+ */
40
+ var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
41
+ if (value !== null && value !== void 0) {
42
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
43
+ var dispose, inner;
44
+ if (async) {
45
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
46
+ dispose = value[Symbol.asyncDispose];
47
+ }
48
+ if (dispose === void 0) {
49
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
50
+ dispose = value[Symbol.dispose];
51
+ if (async) inner = dispose;
52
+ }
53
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
54
+ if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
55
+ env.stack.push({ value: value, dispose: dispose, async: async });
56
+ }
57
+ else if (async) {
58
+ env.stack.push({ async: true });
59
+ }
60
+ return value;
61
+ };
62
+ var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
63
+ return function (env) {
64
+ function fail(e) {
65
+ env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
66
+ env.hasError = true;
67
+ }
68
+ var r, s = 0;
69
+ function next() {
70
+ while (r = env.stack.pop()) {
71
+ try {
72
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
73
+ if (r.dispose) {
74
+ var result = r.dispose.call(r.value);
75
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
76
+ }
77
+ else s |= 1;
78
+ }
79
+ catch (e) {
80
+ fail(e);
81
+ }
82
+ }
83
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
84
+ if (env.hasError) throw env.error;
85
+ }
86
+ return next();
87
+ };
88
+ })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
89
+ var e = new Error(message);
90
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
91
+ });
92
+ import { createHash, randomInt } from 'node:crypto';
93
+ /* ------------------------------------------------------------------ */
94
+ /* Section 1: errors */
95
+ /* ------------------------------------------------------------------ */
96
+ /** Error thrown by every hardware subsystem with an optional cause chain. */
97
+ export class hardwareerror extends Error {
98
+ /** Machine readable subsystem tag. */
99
+ subsystem;
100
+ constructor(message, options) {
101
+ super(message, options);
102
+ this.name = 'hardwareerror';
103
+ this.subsystem = options?.subsystem ?? 'virtualcpu';
104
+ }
105
+ }
106
+ /**
107
+ * Complete Zen 5 flag set as observed in production /proc/cpuinfo dumps of
108
+ * AMD Turin and Granite Ridge machines. Includes the full AVX-512 family
109
+ * (avx512f, avx512dq, avx512cd, avx512bw, avx512vl, avx512_bf16, avx512vbmi,
110
+ * avx512vbmi2, avx512ifma, avx512vnni, avx512vp2intersect, avx512vpopcntdq,
111
+ * avx512bitalg), the vector crypto extensions (sha_ni, gfni, vaes,
112
+ * vpclmulqdq) and the modern memory extensions (movdiri, movdir64b, fsrm,
113
+ * serialize, cldemote).
114
+ */
115
+ export const ZEN5FLAGS = [
116
+ 'fpu',
117
+ 'vme',
118
+ 'de',
119
+ 'pse',
120
+ 'tsc',
121
+ 'msr',
122
+ 'pae',
123
+ 'mce',
124
+ 'cx8',
125
+ 'apic',
126
+ 'sep',
127
+ 'mtrr',
128
+ 'pge',
129
+ 'mca',
130
+ 'cmov',
131
+ 'pat',
132
+ 'pse36',
133
+ 'clflush',
134
+ 'mmx',
135
+ 'fxsr',
136
+ 'sse',
137
+ 'sse2',
138
+ 'ht',
139
+ 'syscall',
140
+ 'nx',
141
+ 'mmxext',
142
+ 'fxsr_opt',
143
+ 'pdpe1gb',
144
+ 'rdtscp',
145
+ 'lm',
146
+ 'constant_tsc',
147
+ 'rep_good',
148
+ 'amd_lbr_v2',
149
+ 'nopl',
150
+ 'nonstop_tsc',
151
+ 'cpuid',
152
+ 'extd_apicid',
153
+ 'aperfmperf',
154
+ 'rapl',
155
+ 'pni',
156
+ 'pclmulqdq',
157
+ 'monitor',
158
+ 'ssse3',
159
+ 'fma',
160
+ 'cx16',
161
+ 'sse4_1',
162
+ 'sse4_2',
163
+ 'x2apic',
164
+ 'movbe',
165
+ 'popcnt',
166
+ 'aes',
167
+ 'xsave',
168
+ 'avx',
169
+ 'f16c',
170
+ 'rdrand',
171
+ 'lahf_lm',
172
+ 'cmp_legacy',
173
+ 'svm',
174
+ 'extapic',
175
+ 'cr8_legacy',
176
+ 'abm',
177
+ 'sse4a',
178
+ 'misalignsse',
179
+ '3dnowprefetch',
180
+ 'osvw',
181
+ 'ibs',
182
+ 'skinit',
183
+ 'wdt',
184
+ 'tce',
185
+ 'topoext',
186
+ 'perfctr_core',
187
+ 'perfctr_nb',
188
+ 'bpext',
189
+ 'perfctr_llc',
190
+ 'mwaitx',
191
+ 'cpb',
192
+ 'cat_l3',
193
+ 'cdp_l3',
194
+ 'hw_pstate',
195
+ 'ssbd',
196
+ 'mba',
197
+ 'perfmon_v2',
198
+ 'ibrs',
199
+ 'ibpb',
200
+ 'stibp',
201
+ 'vmmcall',
202
+ 'fsgsbase',
203
+ 'bmi1',
204
+ 'avx2',
205
+ 'smep',
206
+ 'bmi2',
207
+ 'erms',
208
+ 'invpcid',
209
+ 'cqm',
210
+ 'rdt_a',
211
+ 'avx512f',
212
+ 'avx512dq',
213
+ 'rdseed',
214
+ 'adx',
215
+ 'smap',
216
+ 'clflushopt',
217
+ 'clwb',
218
+ 'avx512vl',
219
+ 'avx512bw',
220
+ 'avx512cd',
221
+ 'avx512_bf16',
222
+ 'avx512vbmi',
223
+ 'avx512vbmi2',
224
+ 'avx512ifma',
225
+ 'avx512vp2intersect',
226
+ 'sha_ni',
227
+ 'gfni',
228
+ 'vaes',
229
+ 'vpclmulqdq',
230
+ 'avx512vpopcntdq',
231
+ 'avx512vnni',
232
+ 'avx512bitalg',
233
+ 'rdpid',
234
+ 'movdiri',
235
+ 'movdir64b',
236
+ 'fsrm',
237
+ 'cldemote',
238
+ 'serialize',
239
+ 'flush_l1d',
240
+ 'arch_capabilities',
241
+ ];
242
+ /**
243
+ * Arrow Lake flag set for the Core Ultra 9 285K. Arrow Lake ships AVX2 with
244
+ * AVX-VNNI and the SHA extensions but no AVX-512 execution units, and it
245
+ * reports no hyper-threading, so the ht flag is absent on purpose.
246
+ */
247
+ export const ARROWLAKEFLAGS = [
248
+ 'fpu',
249
+ 'vme',
250
+ 'de',
251
+ 'pse',
252
+ 'tsc',
253
+ 'msr',
254
+ 'pae',
255
+ 'mce',
256
+ 'cx8',
257
+ 'apic',
258
+ 'sep',
259
+ 'mtrr',
260
+ 'pge',
261
+ 'mca',
262
+ 'cmov',
263
+ 'pat',
264
+ 'pse36',
265
+ 'clflush',
266
+ 'mmx',
267
+ 'fxsr',
268
+ 'sse',
269
+ 'sse2',
270
+ 'syscall',
271
+ 'nx',
272
+ 'pdpe1gb',
273
+ 'rdtscp',
274
+ 'lm',
275
+ 'constant_tsc',
276
+ 'arch_perfmon',
277
+ 'rep_good',
278
+ 'nopl',
279
+ 'xtopology',
280
+ 'nonstop_tsc',
281
+ 'cpuid',
282
+ 'aperfmperf',
283
+ 'tsc_known_freq',
284
+ 'pni',
285
+ 'pclmulqdq',
286
+ 'monitor',
287
+ 'ssse3',
288
+ 'fma',
289
+ 'cx16',
290
+ 'sse4_1',
291
+ 'sse4_2',
292
+ 'x2apic',
293
+ 'movbe',
294
+ 'popcnt',
295
+ 'aes',
296
+ 'xsave',
297
+ 'avx',
298
+ 'f16c',
299
+ 'rdrand',
300
+ 'lahf_lm',
301
+ 'abm',
302
+ '3dnowprefetch',
303
+ 'cpuid_fault',
304
+ 'epb',
305
+ 'invpcid_single',
306
+ 'ssbd',
307
+ 'ibrs',
308
+ 'ibpb',
309
+ 'stibp',
310
+ 'ibrs_enhanced',
311
+ 'tpr_shadow',
312
+ 'vnmi',
313
+ 'flexpriority',
314
+ 'ept',
315
+ 'vpid',
316
+ 'ept_ad',
317
+ 'fsgsbase',
318
+ 'tsc_adjust',
319
+ 'bmi1',
320
+ 'avx2',
321
+ 'smep',
322
+ 'bmi2',
323
+ 'erms',
324
+ 'invpcid',
325
+ 'rdseed',
326
+ 'adx',
327
+ 'smap',
328
+ 'clflushopt',
329
+ 'clwb',
330
+ 'sha_ni',
331
+ 'xsaveopt',
332
+ 'xsavec',
333
+ 'xgetbv1',
334
+ 'xsaves',
335
+ 'split_lock_detect',
336
+ 'user_shstk',
337
+ 'avx_vnni',
338
+ 'waitpkg',
339
+ 'gfni',
340
+ 'vaes',
341
+ 'vpclmulqdq',
342
+ 'rdpid',
343
+ 'movdiri',
344
+ 'movdir64b',
345
+ 'fsrm',
346
+ 'md_clear',
347
+ 'serialize',
348
+ 'tsxldtrk',
349
+ 'la57',
350
+ 'cldemote',
351
+ 'arch_capabilities',
352
+ ];
353
+ /** Vendor strategy table: identity strings and per-vendor cpuinfo details. */
354
+ export const vendorprofiles = {
355
+ amd: {
356
+ vendorid: 'AuthenticAMD',
357
+ flags: ZEN5FLAGS,
358
+ bugs: ['sysret_ss_attrs', 'spectre_v1', 'spectre_v2', 'spec_store_bypass', 'srso'],
359
+ tlbsize: '3584 2M/4M pages',
360
+ cpuidlevel: 16,
361
+ powermanagement: 'ts ttp tm hwpstate cpb eff_freq_ro [13] [14]',
362
+ },
363
+ intel: {
364
+ vendorid: 'GenuineIntel',
365
+ flags: ARROWLAKEFLAGS,
366
+ bugs: ['spectre_v1', 'spectre_v2', 'spec_store_bypass', 'swapgs', 'eibrs_pbrsb'],
367
+ tlbsize: null,
368
+ cpuidlevel: 32,
369
+ powermanagement: 'ts ttp tm hwpstate cpb eff_freq_ro [8] [9] [10] [11] [12] [13] [14]',
370
+ },
371
+ };
372
+ /**
373
+ * BEST_VIRTUAL_PROCESSORS: the bank of real, verified top-end processors
374
+ * embedded as immutable data. Every entry was cross-checked against vendor
375
+ * pages and the TechPowerUp database on 2026-08-22.
376
+ */
377
+ export const BEST_VIRTUAL_PROCESSORS = [
378
+ {
379
+ model: 'AMD EPYC 9965',
380
+ displayname: 'AMD EPYC 9965 192-Core Processor',
381
+ vendor: 'amd',
382
+ cores: 192,
383
+ threads: 384,
384
+ baseclockmhz: 2250,
385
+ boostclockmhz: 3700,
386
+ allcoreclockmhz: 3350,
387
+ l3mb: 384,
388
+ l2mb: 192,
389
+ socket: 'SP5 (LGA6096)',
390
+ tdpwatts: 500,
391
+ maxtdpwatts: 500,
392
+ pcie: 'PCIe 5.0 x128',
393
+ maxmemorygb: 6144,
394
+ memorytype: 'DDR5-6400 ECC RDIMM',
395
+ memorychannels: 12,
396
+ microarch: 'Zen 5c (Turin)',
397
+ cpufamily: 25,
398
+ cpumodel: 17,
399
+ stepping: 2,
400
+ physicalline: '52 bits physical',
401
+ virtualline: '57 bits virtual',
402
+ launch: '2024-10-10',
403
+ },
404
+ {
405
+ model: 'AMD Ryzen 9 9950X3D',
406
+ displayname: 'AMD Ryzen 9 9950X3D 16-Core Processor',
407
+ vendor: 'amd',
408
+ cores: 16,
409
+ threads: 32,
410
+ baseclockmhz: 4300,
411
+ boostclockmhz: 5700,
412
+ allcoreclockmhz: 5400,
413
+ l3mb: 128,
414
+ l2mb: 16,
415
+ socket: 'AM5',
416
+ tdpwatts: 170,
417
+ maxtdpwatts: 200,
418
+ pcie: 'PCIe 5.0 x24',
419
+ maxmemorygb: 192,
420
+ memorytype: 'DDR5-5600',
421
+ memorychannels: 2,
422
+ microarch: 'Zen 5 X3D (3D V-Cache on one CCD, 144 MB total cache with L2)',
423
+ cpufamily: 25,
424
+ cpumodel: 17,
425
+ stepping: 2,
426
+ physicalline: '48 bits physical',
427
+ virtualline: '57 bits virtual',
428
+ launch: '2025-03-12',
429
+ },
430
+ {
431
+ model: 'AMD Threadripper PRO 9995WX',
432
+ displayname: 'AMD Ryzen Threadripper PRO 9995WX 96-Core Processor',
433
+ vendor: 'amd',
434
+ cores: 96,
435
+ threads: 192,
436
+ baseclockmhz: 2500,
437
+ boostclockmhz: 5400,
438
+ allcoreclockmhz: 4100,
439
+ l3mb: 384,
440
+ l2mb: 96,
441
+ socket: 'sTR5 (LGA4844)',
442
+ tdpwatts: 350,
443
+ maxtdpwatts: 350,
444
+ pcie: 'PCIe 5.0 x128',
445
+ maxmemorygb: 2048,
446
+ memorytype: 'DDR5-6400 ECC RDIMM',
447
+ memorychannels: 8,
448
+ microarch: 'Zen 5 (Shimada Peak, WRX90)',
449
+ cpufamily: 25,
450
+ cpumodel: 17,
451
+ stepping: 2,
452
+ physicalline: '52 bits physical',
453
+ virtualline: '57 bits virtual',
454
+ launch: '2025-07',
455
+ },
456
+ {
457
+ model: 'AMD Threadripper 7980X',
458
+ displayname: 'AMD Ryzen Threadripper 7980X 64-Core Processor',
459
+ vendor: 'amd',
460
+ cores: 64,
461
+ threads: 128,
462
+ baseclockmhz: 3200,
463
+ boostclockmhz: 5100,
464
+ allcoreclockmhz: 4400,
465
+ l3mb: 256,
466
+ l2mb: 64,
467
+ socket: 'sTR5',
468
+ tdpwatts: 350,
469
+ maxtdpwatts: 350,
470
+ pcie: 'PCIe 5.0 x48',
471
+ maxmemorygb: 1024,
472
+ memorytype: 'DDR5-6400',
473
+ memorychannels: 4,
474
+ microarch: 'Zen 5 (TRX50)',
475
+ cpufamily: 25,
476
+ cpumodel: 17,
477
+ stepping: 2,
478
+ physicalline: '52 bits physical',
479
+ virtualline: '57 bits virtual',
480
+ launch: '2023-10',
481
+ },
482
+ {
483
+ model: 'Intel Core Ultra 9 285K',
484
+ displayname: 'Intel(R) Core(TM) Ultra 9 285K',
485
+ vendor: 'intel',
486
+ cores: 24,
487
+ threads: 24,
488
+ baseclockmhz: 3700,
489
+ boostclockmhz: 5700,
490
+ allcoreclockmhz: 5400,
491
+ l3mb: 36,
492
+ l2mb: 36,
493
+ socket: 'LGA1851',
494
+ tdpwatts: 125,
495
+ maxtdpwatts: 250,
496
+ pcie: 'PCIe 5.0 x20 + PCIe 4.0 x4',
497
+ maxmemorygb: 192,
498
+ memorytype: 'DDR5-6400',
499
+ memorychannels: 2,
500
+ microarch: 'Arrow Lake (8 Performance + 16 Efficient cores, no hyper-threading)',
501
+ cpufamily: 6,
502
+ cpumodel: 191,
503
+ stepping: 2,
504
+ physicalline: '46 bits physical',
505
+ virtualline: '57 bits virtual',
506
+ launch: '2024-10-24',
507
+ },
508
+ {
509
+ model: 'AMD EPYC 9955',
510
+ displayname: 'AMD EPYC 9955 128-Core Processor',
511
+ vendor: 'amd',
512
+ cores: 128,
513
+ threads: 256,
514
+ baseclockmhz: 2600,
515
+ boostclockmhz: 3750,
516
+ allcoreclockmhz: 3450,
517
+ l3mb: 384,
518
+ l2mb: 128,
519
+ socket: 'SP5',
520
+ tdpwatts: 400,
521
+ maxtdpwatts: 400,
522
+ pcie: 'PCIe 5.0 x128',
523
+ maxmemorygb: 6144,
524
+ memorytype: 'DDR5-6400 ECC RDIMM',
525
+ memorychannels: 12,
526
+ microarch: 'Zen 5c (Turin dense)',
527
+ cpufamily: 25,
528
+ cpumodel: 17,
529
+ stepping: 2,
530
+ physicalline: '52 bits physical',
531
+ virtualline: '57 bits virtual',
532
+ launch: '2024-10-10',
533
+ },
534
+ ];
535
+ /* ------------------------------------------------------------------ */
536
+ /* Section 4: cpuRegistry */
537
+ /* ------------------------------------------------------------------ */
538
+ /**
539
+ * Registry of every known virtual processor. Seeded from
540
+ * BEST_VIRTUAL_PROCESSORS and extensible at runtime through
541
+ * registerVirtualCpu; iteration order equals insertion order.
542
+ */
543
+ export const cpuRegistry = new Map(BEST_VIRTUAL_PROCESSORS.map((spec) => [spec.model.toLowerCase(), spec]));
544
+ /** Normalizes a model string for case-insensitive registry lookups. */
545
+ export function normalizemodel(model) {
546
+ return model.trim().toLowerCase();
547
+ }
548
+ /**
549
+ * Registers a custom processor spec in the cpuRegistry. Registration is
550
+ * rejected when the spec is malformed or duplicates an existing model.
551
+ */
552
+ export function registerVirtualCpu(spec) {
553
+ try {
554
+ const key = normalizemodel(spec.model);
555
+ if (key.length === 0) {
556
+ throw new hardwareerror('model name must not be empty');
557
+ }
558
+ if (cpuRegistry.has(key)) {
559
+ throw new hardwareerror(`model ${spec.model} is already registered`);
560
+ }
561
+ cpuRegistry.set(key, spec);
562
+ return key;
563
+ }
564
+ catch (cause) {
565
+ if (cause instanceof hardwareerror) {
566
+ throw cause;
567
+ }
568
+ throw new hardwareerror('registerVirtualCpu failed', { cause: cause });
569
+ }
570
+ }
571
+ /**
572
+ * Looks up a processor by exact (case-insensitive) model name.
573
+ *
574
+ * @param model Model name such as "AMD EPYC 9965".
575
+ */
576
+ export function getVirtualCpu(model) {
577
+ const found = cpuRegistry.get(normalizemodel(model));
578
+ if (found === undefined) {
579
+ throw new hardwareerror(`unknown processor model "${model}"; known models: ${listVirtualCpus().join(', ')}`);
580
+ }
581
+ return found;
582
+ }
583
+ /**
584
+ * Searches the registry by substring, returning every spec whose model name
585
+ * contains the fragment (case-insensitive). The const type parameter keeps
586
+ * literal fragment types intact for logging callers.
587
+ */
588
+ export function findVirtualCpus(fragment) {
589
+ const needle = normalizemodel(fragment);
590
+ const results = [];
591
+ for (const spec of cpuRegistry.values()) {
592
+ if (normalizemodel(spec.model).includes(needle)) {
593
+ results.push(spec);
594
+ }
595
+ }
596
+ return results;
597
+ }
598
+ /** Lists every registered model name in registry order. */
599
+ export function listVirtualCpus() {
600
+ return [...cpuRegistry.values()].map((spec) => spec.model);
601
+ }
602
+ /** Removes a custom model from the registry; returns true when it existed. */
603
+ export function removeVirtualCpu(model) {
604
+ return cpuRegistry.delete(normalizemodel(model));
605
+ }
606
+ /** Derives a stable, deterministic identifier for a model name via sha256. */
607
+ export function stableModelId(model) {
608
+ return createHash('sha256').update(`virtualengine:${model}`).digest('hex').slice(0, 12);
609
+ }
610
+ /**
611
+ * Solves the package topology for a requested vCPU count against a spec.
612
+ * Symmetric multithreading parts round core counts up so partial
613
+ * configurations stay coherent, and heterogeneous parts (Arrow Lake)
614
+ * report one thread per core.
615
+ */
616
+ export function solvetopology(spec, vcpus) {
617
+ try {
618
+ const threadspercore = Math.max(1, Math.round(spec.threads / spec.cores));
619
+ if (!Number.isInteger(vcpus) || vcpus < 1) {
620
+ throw new hardwareerror(`vcpus must be a positive integer, received ${vcpus}`);
621
+ }
622
+ if (vcpus > spec.threads) {
623
+ throw new hardwareerror(`model ${spec.model} exposes at most ${spec.threads} threads; ${vcpus} were requested`);
624
+ }
625
+ const coresonline = Math.ceil(vcpus / threadspercore);
626
+ return {
627
+ vcpus,
628
+ threadspercore,
629
+ coresonline,
630
+ siblings: vcpus,
631
+ sockets: 1,
632
+ fullypopulated: vcpus === spec.threads,
633
+ };
634
+ }
635
+ catch (cause) {
636
+ if (cause instanceof hardwareerror) {
637
+ throw cause;
638
+ }
639
+ throw new hardwareerror('solvetopology failed', { cause: cause });
640
+ }
641
+ }
642
+ /** Renders one scalar cpuinfo line with the per-key tab alignment the kernel uses. */
643
+ const keytabs = {
644
+ processor: '\t',
645
+ vendor_id: '\t',
646
+ 'cpu family': '\t',
647
+ model: '\t\t',
648
+ 'model name': '\t',
649
+ stepping: '\t',
650
+ microcode: '\t',
651
+ 'cpu MHz': '\t\t',
652
+ 'cache size': '\t',
653
+ 'physical id': '\t',
654
+ siblings: '\t',
655
+ 'core id': '\t\t',
656
+ 'cpu cores': '\t',
657
+ apicid: '\t\t',
658
+ 'initial apicid': '\t',
659
+ fpu: '\t\t',
660
+ fpu_exception: '\t',
661
+ 'cpuid level': '\t',
662
+ wp: '\t\t',
663
+ flags: '\t\t',
664
+ bugs: '\t\t',
665
+ bogomips: '\t',
666
+ 'TLB size': '\t',
667
+ 'clflush size': '\t',
668
+ cache_alignment: '',
669
+ 'address sizes': '\t',
670
+ 'power management': '',
671
+ };
672
+ /** Renders one cpuinfo line exactly as procfs does: key, tabs, colon, value. */
673
+ function line(key, value) {
674
+ const tabs = keytabs[key] ?? '\t';
675
+ return `${key}${tabs}: ${value}`;
676
+ }
677
+ /**
678
+ * Generates a complete, byte-realistic /proc/cpuinfo text for a registered
679
+ * processor model with an arbitrary vCPU count. Each logical processor block
680
+ * carries processor index, vendor_id (AuthenticAMD or GenuineIntel), cpu
681
+ * family, model, model name, stepping, microcode, cpu MHz with natural
682
+ * jitter, cache size, physical id, siblings, core id, cpu cores, apicid,
683
+ * initial apicid, fpu markers, cpuid level, wp, the full vendor flag set,
684
+ * known bug list, bogomips, TLB size, clflush size, cache alignment,
685
+ * address sizes and the power management hint line.
686
+ *
687
+ * @param model Processor model name present in the cpuRegistry.
688
+ * @param vcpus Number of logical processors to render (1 to model threads).
689
+ * @param options Optional family, model, stepping, microcode and flag tweaks.
690
+ */
691
+ export function generateVirtualCpuinfo(model, vcpus, options) {
692
+ try {
693
+ const spec = getVirtualCpu(model);
694
+ const topology = solvetopology(spec, vcpus);
695
+ const profile = vendorprofiles[spec.vendor];
696
+ const family = options?.family ?? spec.cpufamily;
697
+ const modelnumber = options?.modelnumber ?? spec.cpumodel;
698
+ const stepping = options?.stepping ?? spec.stepping;
699
+ const microcode = options?.microcode ?? '0xffffffff';
700
+ const flags = [...profile.flags, ...(options?.extraflags ?? [])].join(' ');
701
+ const bugs = profile.bugs.join(' ');
702
+ const maxmhz = options?.maxmhz ?? spec.boostclockmhz;
703
+ const minmhz = options?.minmhz ?? spec.baseclockmhz;
704
+ const blocks = [];
705
+ for (let processor = 0; processor < topology.vcpus; processor += 1) {
706
+ const currentmhz = randomInt(Math.round(minmhz), Math.round(maxmhz + 1));
707
+ const bogomips = (spec.baseclockmhz * 2 + randomInt(-40, 41) / 100).toFixed(2);
708
+ const coreid = Math.floor(processor / topology.threadspercore);
709
+ const lines = [
710
+ line('processor', processor),
711
+ line('vendor_id', profile.vendorid),
712
+ line('cpu family', family),
713
+ line('model', modelnumber),
714
+ line('model name', spec.displayname),
715
+ line('stepping', stepping),
716
+ line('microcode', microcode),
717
+ line('cpu MHz', currentmhz.toFixed(3)),
718
+ line('cache size', `${spec.l3mb} MB`),
719
+ line('physical id', 0),
720
+ line('siblings', topology.siblings),
721
+ line('core id', coreid),
722
+ line('cpu cores', topology.coresonline),
723
+ line('apicid', processor),
724
+ line('initial apicid', processor),
725
+ line('fpu', 'yes'),
726
+ line('fpu_exception', 'yes'),
727
+ line('cpuid level', profile.cpuidlevel),
728
+ line('wp', 'yes'),
729
+ line('flags', flags),
730
+ line('bugs', bugs),
731
+ line('bogomips', bogomips),
732
+ ];
733
+ if (profile.tlbsize !== null) {
734
+ lines.push(line('TLB size', profile.tlbsize));
735
+ }
736
+ lines.push(line('clflush size', 64), line('cache_alignment', 64), line('address sizes', `${spec.physicalline}, ${spec.virtualline}`), line('power management', profile.powermanagement));
737
+ blocks.push(lines.join('\n'));
738
+ }
739
+ return blocks.join('\n\n');
740
+ }
741
+ catch (cause) {
742
+ if (cause instanceof hardwareerror) {
743
+ throw cause;
744
+ }
745
+ throw new hardwareerror('generateVirtualCpuinfo failed', { cause: cause });
746
+ }
747
+ }
748
+ /* ------------------------------------------------------------------ */
749
+ /* Section 7: lscpu summary generation */
750
+ /* ------------------------------------------------------------------ */
751
+ /**
752
+ * Generates an lscpu-style summary block for a registered model, covering
753
+ * architecture, endianness, address sizes, vendor, family, model, per-core
754
+ * threading, socket topology, frequency range, caches and NUMA nodes. The
755
+ * text mirrors the column layout produced by util-linux lscpu on 2026
756
+ * distributions.
757
+ */
758
+ export function generateVirtualLscpu(model, vcpus, numanodes = 1) {
759
+ try {
760
+ const spec = getVirtualCpu(model);
761
+ const topology = solvetopology(spec, vcpus);
762
+ const corespersocket = Math.ceil(topology.coresonline / numanodes) * numanodes;
763
+ const rows = [
764
+ ['Architecture:', 'x86_64'],
765
+ ['CPU op-mode(s):', '32-bit, 64-bit'],
766
+ ['Byte Order:', 'Little Endian'],
767
+ ['Address sizes:', `${spec.physicalline}, ${spec.virtualline}`],
768
+ ['CPU(s):', String(topology.vcpus)],
769
+ ['On-line CPU(s) list:', topology.vcpus === 1 ? '0' : `0-${topology.vcpus - 1}`],
770
+ ['Vendor ID:', vendorprofiles[spec.vendor].vendorid],
771
+ ['Model name:', spec.displayname],
772
+ ['CPU family:', String(spec.cpufamily)],
773
+ ['Model:', String(spec.cpumodel)],
774
+ ['Thread(s) per core:', String(topology.threadspercore)],
775
+ ['Core(s) per socket:', String(corespersocket)],
776
+ ['Socket(s):', '1'],
777
+ ['Stepping:', String(spec.stepping)],
778
+ ['Frequency boost:', 'enabled'],
779
+ ['CPU max MHz:', `${spec.boostclockmhz}.0000`],
780
+ ['CPU min MHz:', `${(spec.baseclockmhz * 0.62).toFixed(4)}`],
781
+ ['BogoMIPS:', `${(spec.baseclockmhz * 2).toFixed(2)}`],
782
+ [
783
+ 'L1d cache:',
784
+ `${Math.round((spec.l2mb / spec.cores) * 1024)} KiB (${spec.cores} instances)`,
785
+ ],
786
+ ['L2 cache:', `${spec.l2mb} MiB (${spec.cores} instances)`],
787
+ ['L3 cache:', `${spec.l3mb} MiB (${Math.max(1, Math.round(spec.cores / 8))} instances)`],
788
+ ['NUMA node(s):', String(numanodes)],
789
+ ];
790
+ const pernode = Math.ceil(topology.vcpus / numanodes);
791
+ for (let node = 0; node < numanodes; node += 1) {
792
+ const start = node * pernode;
793
+ const end = Math.min(start + pernode, topology.vcpus) - 1;
794
+ rows.push([`NUMA node${node} CPU(s):`, start === end ? String(start) : `${start}-${end}`]);
795
+ }
796
+ rows.push(['Vulnerability Itlb multihit:', 'Not affected']);
797
+ rows.push([
798
+ 'Vulnerability L1tf:',
799
+ vendorprofiles[spec.vendor].bugs.includes('l1tf') ? 'Mitigation; VMX flush' : 'Not affected',
800
+ ]);
801
+ rows.push(['Vulnerability Mds:', 'Not affected']);
802
+ rows.push(['Vulnerability Meltdown:', 'Not affected']);
803
+ rows.push([
804
+ 'Vulnerability Spectre v1:',
805
+ 'Mitigation; usercopy/swapgs barriers and __user pointer sanitization',
806
+ ]);
807
+ rows.push([
808
+ 'Vulnerability Spectre v2:',
809
+ spec.vendor === 'amd' ? 'Mitigation; Retpolines, IBPB' : 'Mitigation; Enhanced IBRS',
810
+ ]);
811
+ return rows.map(([key, value]) => `${key.padEnd(28)}${value}`).join('\n');
812
+ }
813
+ catch (cause) {
814
+ if (cause instanceof hardwareerror) {
815
+ throw cause;
816
+ }
817
+ throw new hardwareerror('generateVirtualLscpu failed', { cause: cause });
818
+ }
819
+ }
820
+ /**
821
+ * Fluent builder for virtual processors. The builder starts empty, collects
822
+ * every field through chainable with* methods, validates the result and
823
+ * produces a provisionedcpu that bundles the spec, the solved topology and
824
+ * the generated cpuinfo and lscpu texts.
825
+ */
826
+ export class virtualcpubuilder {
827
+ #spec;
828
+ #vcpus;
829
+ #numanodes;
830
+ constructor() {
831
+ this.#spec = {};
832
+ this.#vcpus = 1;
833
+ this.#numanodes = 1;
834
+ }
835
+ /** Sets the model name; when present in the registry it seeds defaults. */
836
+ withmodel(model) {
837
+ this.#spec.model = model;
838
+ const known = cpuRegistry.get(normalizemodel(model));
839
+ if (known !== undefined) {
840
+ this.#spec = { ...known };
841
+ }
842
+ return this;
843
+ }
844
+ /** Sets the number of online vCPUs. */
845
+ withvcpus(vcpus) {
846
+ this.#vcpus = vcpus;
847
+ return this;
848
+ }
849
+ /** Sets base, single-core boost and all-core boost clocks in MHz. */
850
+ withclocks(base, boost, allcore) {
851
+ this.#spec.baseclockmhz = base;
852
+ this.#spec.boostclockmhz = boost;
853
+ this.#spec.allcoreclockmhz = allcore;
854
+ return this;
855
+ }
856
+ /** Sets L3 and L2 cache sizes in MB. */
857
+ withcache(l3mb, l2mb) {
858
+ this.#spec.l3mb = l3mb;
859
+ this.#spec.l2mb = l2mb;
860
+ return this;
861
+ }
862
+ /** Sets package, socket, TDP and PCIe lanes. */
863
+ withpackage(socket, tdpwatts, maxtdpwatts, pcie) {
864
+ this.#spec.socket = socket;
865
+ this.#spec.tdpwatts = tdpwatts;
866
+ this.#spec.maxtdpwatts = maxtdpwatts;
867
+ this.#spec.pcie = pcie;
868
+ return this;
869
+ }
870
+ /** Sets maximum memory, memory type and channel count. */
871
+ withmemory(maxmemorygb, memorytype, memorychannels) {
872
+ this.#spec.maxmemorygb = maxmemorygb;
873
+ this.#spec.memorytype = memorytype;
874
+ this.#spec.memorychannels = memorychannels;
875
+ return this;
876
+ }
877
+ /** Sets core and thread counts plus the vendor identity. */
878
+ withtopology(cores, threads, vendor) {
879
+ this.#spec.cores = cores;
880
+ this.#spec.threads = threads;
881
+ this.#spec.vendor = vendor;
882
+ return this;
883
+ }
884
+ /** Sets CPUID family, model and stepping. */
885
+ withcpuid(cpufamily, cpumodel, stepping) {
886
+ this.#spec.cpufamily = cpufamily;
887
+ this.#spec.cpumodel = cpumodel;
888
+ this.#spec.stepping = stepping;
889
+ return this;
890
+ }
891
+ /** Sets the number of NUMA nodes advertised in lscpu output. */
892
+ withnumanodes(numanodes) {
893
+ this.#numanodes = Math.max(1, numanodes);
894
+ return this;
895
+ }
896
+ /** Validates the accumulated spec and produces the provisioned bundle. */
897
+ build() {
898
+ try {
899
+ const defaults = {
900
+ model: 'custom virtual processor',
901
+ displayname: 'custom virtual processor',
902
+ vendor: 'amd',
903
+ cores: 8,
904
+ threads: 16,
905
+ baseclockmhz: 3200,
906
+ boostclockmhz: 5200,
907
+ allcoreclockmhz: 4600,
908
+ l3mb: 64,
909
+ l2mb: 8,
910
+ socket: 'virtual',
911
+ tdpwatts: 120,
912
+ maxtdpwatts: 160,
913
+ pcie: 'PCIe 5.0 x16',
914
+ maxmemorygb: 128,
915
+ memorytype: 'DDR5-5600',
916
+ memorychannels: 2,
917
+ microarch: 'virtual',
918
+ cpufamily: 25,
919
+ cpumodel: 17,
920
+ stepping: 1,
921
+ physicalline: '48 bits physical',
922
+ virtualline: '57 bits virtual',
923
+ launch: '2026-08-22',
924
+ };
925
+ const spec = {
926
+ ...defaults,
927
+ ...this.#spec,
928
+ model: this.#spec.model ?? defaults.model,
929
+ };
930
+ if (!cpuRegistry.has(normalizemodel(spec.model))) {
931
+ registerVirtualCpu(spec);
932
+ }
933
+ const topology = solvetopology(spec, this.#vcpus);
934
+ return Object.freeze({
935
+ id: stableModelId(spec.model),
936
+ spec: Object.freeze(spec),
937
+ vcpus: topology.vcpus,
938
+ topology: Object.freeze(topology),
939
+ cpuinfotext: generateVirtualCpuinfo(spec.model, topology.vcpus),
940
+ lscputext: generateVirtualLscpu(spec.model, topology.vcpus, this.#numanodes),
941
+ createdat: Date.now(),
942
+ });
943
+ }
944
+ catch (cause) {
945
+ throw new hardwareerror('virtualcpubuilder.build failed', { cause: cause });
946
+ }
947
+ }
948
+ }
949
+ /**
950
+ * Factory that provisions a registered processor model for spoofing. The
951
+ * factory resolves the spec from the cpuRegistry, solves the topology for
952
+ * the requested vCPU count and bundles the generated cpuinfo and lscpu
953
+ * texts into a frozen provisionedcpu record.
954
+ *
955
+ * @param model Exact model name in the registry.
956
+ * @param vcpus Number of online vCPUs (1 to the model thread count).
957
+ */
958
+ export function createVirtualProcessor(model, vcpus) {
959
+ try {
960
+ return new virtualcpubuilder().withmodel(model).withvcpus(vcpus).build();
961
+ }
962
+ catch (cause) {
963
+ if (cause instanceof hardwareerror) {
964
+ throw cause;
965
+ }
966
+ throw new hardwareerror('createVirtualProcessor failed', { cause: cause });
967
+ }
968
+ }
969
+ /* ------------------------------------------------------------------ */
970
+ /* Section 9: stub helpers absorbed in v2 (validateCpuCount, marchFlag) */
971
+ /* ------------------------------------------------------------------ */
972
+ /**
973
+ * Hard vCPU bounds of the virtualcpu module. The ceiling of 192 matches the
974
+ * strongest bank part (EPYC 9965, 192 cores) and the memory limits published
975
+ * by virtualmemory.ts.
976
+ */
977
+ export const cpucountlimits = {
978
+ min: 1,
979
+ max: 192,
980
+ };
981
+ /**
982
+ * Validates a vCPU count against the 1 to 192 modularity range. The check is
983
+ * pure: it returns true when the count is an integer inside the bounds.
984
+ */
985
+ export function validateCpuCount(n) {
986
+ try {
987
+ return Number.isInteger(n) && n >= cpucountlimits.min && n <= cpucountlimits.max;
988
+ }
989
+ catch {
990
+ return false;
991
+ }
992
+ }
993
+ /**
994
+ * Reference gcc march tuning string for Zen 5 targets: znver4 codegen with
995
+ * native tuning, LTO, the AVX-512 foundation plus byte/word lanes and the
996
+ * 512-bit preferred vector width that matches ZEN5FLAGS. This is the only
997
+ * occurrence of the flag string in the whole pool, confirmed by grep on the
998
+ * 2026-08-22 merge pass.
999
+ */
1000
+ export function marchFlag() {
1001
+ return '-march=znver4 -mtune=native -O3 -flto -mavx512f -mavx512bw -mprefer-vector-width=512';
1002
+ }
1003
+ /* ------------------------------------------------------------------ */
1004
+ /* Section 10: boards (socket index of the bank) */
1005
+ /* ------------------------------------------------------------------ */
1006
+ /**
1007
+ * Socket families advertised by the bank, in the order the v4 helper
1008
+ * documented them: SP5 LGA6096 (EPYC), TR5 (Threadripper) and AM5
1009
+ * (Ryzen). The helper derives the live list from the cpuRegistry so custom
1010
+ * registrations extend it automatically; the canonical trio is returned as
1011
+ * the fallback whenever the registry carries no socket data.
1012
+ */
1013
+ export function boards() {
1014
+ try {
1015
+ const sockets = [];
1016
+ for (const spec of cpuRegistry.values()) {
1017
+ const socket = spec.socket.split(' ')[0];
1018
+ if (socket.length > 0 && !sockets.includes(socket)) {
1019
+ sockets.push(socket);
1020
+ }
1021
+ }
1022
+ if (sockets.length === 0) {
1023
+ return ['SP5', 'TR5', 'AM5'];
1024
+ }
1025
+ return sockets;
1026
+ }
1027
+ catch {
1028
+ return ['SP5', 'TR5', 'AM5'];
1029
+ }
1030
+ }
1031
+ /* ------------------------------------------------------------------ */
1032
+ /* Section 11: capability scoring */
1033
+ /* ------------------------------------------------------------------ */
1034
+ /** Weights applied by cpuscore; larger specs always score higher. */
1035
+ export const cpuscoreweights = {
1036
+ core: 10,
1037
+ thread: 4,
1038
+ l3mb: 0.5,
1039
+ boostmhz: 1.5,
1040
+ memorychannels: 8,
1041
+ tdpwatts: 0.2,
1042
+ };
1043
+ /**
1044
+ * Computes a scalar capability score for a processor spec. The score blends
1045
+ * core count, thread count, L3 capacity, boost clock, memory channels and
1046
+ * sustainable power, which produces a stable ordering of the bank.
1047
+ */
1048
+ export function cpuscore(spec) {
1049
+ const score = spec.cores * cpuscoreweights.core +
1050
+ spec.threads * cpuscoreweights.thread +
1051
+ spec.l3mb * cpuscoreweights.l3mb +
1052
+ spec.boostclockmhz * cpuscoreweights.boostmhz +
1053
+ spec.memorychannels * cpuscoreweights.memorychannels +
1054
+ spec.tdpwatts * cpuscoreweights.tdpwatts;
1055
+ return Number(score.toFixed(2));
1056
+ }
1057
+ /** Compares two specs by capability score, descending. */
1058
+ export function compareVirtualProcessors(a, b) {
1059
+ return cpuscore(b) - cpuscore(a);
1060
+ }
1061
+ /** Returns the bank sorted by capability score, strongest first. */
1062
+ export function listBestVirtualProcessors() {
1063
+ return [...cpuRegistry.values()].sort(compareVirtualProcessors);
1064
+ }
1065
+ /** Serializes a provisioned processor to a JSON-safe object. */
1066
+ export function serializeprovisionedcpu(provisioned) {
1067
+ try {
1068
+ return {
1069
+ id: provisioned.id,
1070
+ model: provisioned.spec.model,
1071
+ vendor: provisioned.spec.vendor,
1072
+ vcpus: provisioned.vcpus,
1073
+ coresonline: provisioned.topology.coresonline,
1074
+ threadspercore: provisioned.topology.threadspercore,
1075
+ score: cpuscore(provisioned.spec),
1076
+ createdat: provisioned.createdat,
1077
+ };
1078
+ }
1079
+ catch (cause) {
1080
+ throw new hardwareerror('serializeprovisionedcpu failed', { cause: cause });
1081
+ }
1082
+ }
1083
+ /* ------------------------------------------------------------------ */
1084
+ /* Section 12: disposable registry lease and demo */
1085
+ /* ------------------------------------------------------------------ */
1086
+ /**
1087
+ * Lease over a runtime-registered custom model. The lease removes the model
1088
+ * from the cpuRegistry when disposed through a `using` declaration, which
1089
+ * keeps speculative registrations from polluting the global bank.
1090
+ */
1091
+ export class modellease {
1092
+ model;
1093
+ spec;
1094
+ #released;
1095
+ constructor(spec) {
1096
+ this.model = spec.model;
1097
+ this.spec = spec;
1098
+ this.#released = false;
1099
+ registerVirtualCpu(spec);
1100
+ }
1101
+ /** True while the leased model is still registered. */
1102
+ get active() {
1103
+ return !this.#released;
1104
+ }
1105
+ /** Releases the lease, removing the model from the registry. */
1106
+ release() {
1107
+ if (!this.#released) {
1108
+ removeVirtualCpu(this.model);
1109
+ this.#released = true;
1110
+ }
1111
+ }
1112
+ /** Synchronous disposer so leases compose with `using` declarations. */
1113
+ [Symbol.dispose]() {
1114
+ try {
1115
+ this.release();
1116
+ }
1117
+ catch {
1118
+ /* double release is a no-op by construction */
1119
+ }
1120
+ }
1121
+ }
1122
+ /**
1123
+ * End-to-end demo of the virtualcpu pipeline: provisions the EPYC 9965 at a
1124
+ * random vCPU count, registers a leased custom model through a `using`
1125
+ * declaration and returns the serialized summary plus the first cpuinfo
1126
+ * block for eyeball verification.
1127
+ */
1128
+ export function virtualcpudemo() {
1129
+ try {
1130
+ const env_1 = { stack: [], error: void 0, hasError: false };
1131
+ try {
1132
+ const leased = __addDisposableResource(env_1, new modellease({
1133
+ model: 'virtual engineering sample',
1134
+ displayname: 'Virtual Engineering Sample 32-Core Processor',
1135
+ vendor: 'amd',
1136
+ cores: 32,
1137
+ threads: 64,
1138
+ baseclockmhz: 3000,
1139
+ boostclockmhz: 5000,
1140
+ allcoreclockmhz: 4300,
1141
+ l3mb: 128,
1142
+ l2mb: 32,
1143
+ socket: 'virtual',
1144
+ tdpwatts: 180,
1145
+ maxtdpwatts: 220,
1146
+ pcie: 'PCIe 5.0 x32',
1147
+ maxmemorygb: 512,
1148
+ memorytype: 'DDR5-5600',
1149
+ memorychannels: 4,
1150
+ microarch: 'virtual',
1151
+ cpufamily: 25,
1152
+ cpumodel: 17,
1153
+ stepping: 1,
1154
+ physicalline: '48 bits physical',
1155
+ virtualline: '57 bits virtual',
1156
+ launch: '2026-08-22',
1157
+ }), false);
1158
+ const vcpus = randomInt(8, 65);
1159
+ const provisioned = createVirtualProcessor('AMD EPYC 9965', vcpus);
1160
+ return {
1161
+ leasedmodel: leased.model,
1162
+ leasedactive: leased.active,
1163
+ summary: serializeprovisionedcpu(provisioned),
1164
+ march: marchFlag(),
1165
+ cpuinfohead: provisioned.cpuinfotext.split('\n').slice(0, 5).join('\n'),
1166
+ };
1167
+ }
1168
+ catch (e_1) {
1169
+ env_1.error = e_1;
1170
+ env_1.hasError = true;
1171
+ }
1172
+ finally {
1173
+ __disposeResources(env_1);
1174
+ }
1175
+ }
1176
+ catch (cause) {
1177
+ throw new hardwareerror('virtualcpudemo failed', { cause: cause });
1178
+ }
1179
+ }
1180
+ //# sourceMappingURL=virtualcpu.js.map