specialist-agent 2.13.0 → 3.3.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 (329) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +36 -206
  3. package/dist/catalog.json +16677 -0
  4. package/dist/hw-worker.mjs +288 -0
  5. package/dist/icones/icone.ico +0 -0
  6. package/dist/icones/icone.png +0 -0
  7. package/dist/interface/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
  8. package/dist/interface/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
  9. package/dist/interface/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
  10. package/dist/interface/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
  11. package/dist/interface/assets/figtree-latin-ext-400-normal-CXAzuTZb.woff2 +0 -0
  12. package/dist/interface/assets/figtree-latin-ext-500-normal-Du0rIuHj.woff2 +0 -0
  13. package/dist/interface/assets/figtree-latin-ext-600-normal-DJlfifZj.woff2 +0 -0
  14. package/dist/interface/assets/figtree-latin-ext-700-normal-CS4sQkGV.woff2 +0 -0
  15. package/dist/interface/assets/index-BltVv7tb.js +24 -0
  16. package/dist/interface/assets/index-Cpa6kApK.css +1 -0
  17. package/dist/interface/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  18. package/dist/interface/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  19. package/dist/interface/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
  20. package/dist/interface/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  21. package/dist/interface/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  22. package/dist/interface/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
  23. package/dist/interface/assets/unbounded-latin-500-normal-4slEIF53.woff2 +0 -0
  24. package/dist/interface/assets/unbounded-latin-700-normal-CaoNriVp.woff2 +0 -0
  25. package/dist/interface/assets/unbounded-latin-ext-500-normal-BTIpesyw.woff2 +0 -0
  26. package/dist/interface/assets/unbounded-latin-ext-700-normal-BLzWLLjG.woff2 +0 -0
  27. package/dist/interface/icones/apple-touch-icon.png +0 -0
  28. package/dist/interface/icones/favicon-32.png +0 -0
  29. package/dist/interface/icones/icone-192.png +0 -0
  30. package/dist/interface/icones/icone-512.png +0 -0
  31. package/dist/interface/icones/icone-mascara-512.png +0 -0
  32. package/dist/interface/index.html +19 -0
  33. package/dist/interface/manifest.webmanifest +19 -0
  34. package/dist/interface/sw.js +64 -0
  35. package/dist/licencas/BRAND.md +22 -0
  36. package/dist/licencas/LICENSE-CONTENT.md +44 -0
  37. package/dist/licencas/OFL-Figtree.txt +93 -0
  38. package/dist/licencas/OFL-JetBrainsMono.txt +93 -0
  39. package/dist/licencas/OFL-Unbounded.txt +93 -0
  40. package/dist/licencas/TERCEIROS.txt +104 -0
  41. package/dist/specialist-agent.mjs +14515 -0
  42. package/dist/usage-worker.mjs +1077 -0
  43. package/package.json +34 -58
  44. package/.claude-plugin/marketplace.json +0 -52
  45. package/.claude-plugin/plugin.json +0 -37
  46. package/.codex/INSTALL.md +0 -145
  47. package/.cursor-plugin/marketplace.json +0 -52
  48. package/.cursor-plugin/plugin.json +0 -37
  49. package/.opencode/INSTALL.md +0 -127
  50. package/.opencode/opencode.json +0 -186
  51. package/agents/analyst-lite.md +0 -48
  52. package/agents/analyst.md +0 -396
  53. package/agents/api-lite.md +0 -43
  54. package/agents/api.md +0 -427
  55. package/agents/architect-lite.md +0 -104
  56. package/agents/architect.md +0 -571
  57. package/agents/autopilot-lite.md +0 -46
  58. package/agents/autopilot.md +0 -196
  59. package/agents/cloud-lite.md +0 -75
  60. package/agents/cloud.md +0 -213
  61. package/agents/data-lite.md +0 -67
  62. package/agents/data.md +0 -306
  63. package/agents/debugger-lite.md +0 -46
  64. package/agents/debugger.md +0 -410
  65. package/agents/deps-lite.md +0 -41
  66. package/agents/deps.md +0 -363
  67. package/agents/designer-lite.md +0 -67
  68. package/agents/designer.md +0 -195
  69. package/agents/devops-lite.md +0 -67
  70. package/agents/devops.md +0 -205
  71. package/agents/docs-lite.md +0 -42
  72. package/agents/docs.md +0 -454
  73. package/agents/executor-lite.md +0 -61
  74. package/agents/executor.md +0 -695
  75. package/agents/explorer-lite.md +0 -55
  76. package/agents/explorer.md +0 -152
  77. package/agents/finance-lite.md +0 -66
  78. package/agents/finance.md +0 -255
  79. package/agents/i18n-lite.md +0 -44
  80. package/agents/i18n.md +0 -594
  81. package/agents/legal-lite.md +0 -113
  82. package/agents/legal.md +0 -302
  83. package/agents/marketing-lite.md +0 -25
  84. package/agents/marketing.md +0 -188
  85. package/agents/memory.md +0 -166
  86. package/agents/orchestrator-lite.md +0 -40
  87. package/agents/orchestrator.md +0 -512
  88. package/agents/pair-lite.md +0 -38
  89. package/agents/pair.md +0 -310
  90. package/agents/perf-lite.md +0 -42
  91. package/agents/perf.md +0 -320
  92. package/agents/planner-lite.md +0 -59
  93. package/agents/planner.md +0 -272
  94. package/agents/product-lite.md +0 -25
  95. package/agents/product.md +0 -195
  96. package/agents/refactor-lite.md +0 -42
  97. package/agents/refactor.md +0 -467
  98. package/agents/ripple-lite.md +0 -106
  99. package/agents/ripple.md +0 -166
  100. package/agents/scout-lite.md +0 -37
  101. package/agents/scout.md +0 -224
  102. package/agents/security-lite.md +0 -66
  103. package/agents/security.md +0 -252
  104. package/agents/sentry-triage-lite.md +0 -54
  105. package/agents/sentry-triage.md +0 -217
  106. package/agents/starter-lite.md +0 -80
  107. package/agents/starter.md +0 -300
  108. package/agents/support-lite.md +0 -24
  109. package/agents/support.md +0 -191
  110. package/agents/tdd-lite.md +0 -43
  111. package/agents/tdd.md +0 -329
  112. package/agents/tester-lite.md +0 -71
  113. package/agents/tester.md +0 -237
  114. package/cli/architectures.mjs +0 -713
  115. package/cli/detect-architecture.mjs +0 -752
  116. package/cli/generate-architecture.mjs +0 -1096
  117. package/cli/index.mjs +0 -1217
  118. package/cli/recommend-architecture.mjs +0 -870
  119. package/hooks/after-review.mjs +0 -130
  120. package/hooks/after-task.mjs +0 -117
  121. package/hooks/before-plan.mjs +0 -155
  122. package/hooks/before-review.mjs +0 -139
  123. package/hooks/hooks.json +0 -66
  124. package/hooks/lifecycle.json +0 -91
  125. package/hooks/native/auto-dispatch.mjs +0 -207
  126. package/hooks/native/auto-format.mjs +0 -176
  127. package/hooks/native/mcp-discovery.mjs +0 -168
  128. package/hooks/native/security-config.json +0 -38
  129. package/hooks/native/security-guard.mjs +0 -323
  130. package/hooks/native/session-context.mjs +0 -179
  131. package/hooks/native/session-end.mjs +0 -42
  132. package/hooks/native/utils.mjs +0 -62
  133. package/hooks/on-error.mjs +0 -129
  134. package/hooks/session-end.mjs +0 -185
  135. package/hooks/session-start.mjs +0 -154
  136. package/packs/angular/ARCHITECTURE.md +0 -814
  137. package/packs/angular/CLAUDE.md +0 -105
  138. package/packs/angular/agents/builder.md +0 -113
  139. package/packs/angular/agents/doctor.md +0 -187
  140. package/packs/angular/agents/migrator.md +0 -101
  141. package/packs/angular/agents/reviewer.md +0 -252
  142. package/packs/angular/agents-lite/builder.md +0 -65
  143. package/packs/angular/agents-lite/doctor.md +0 -64
  144. package/packs/angular/agents-lite/migrator.md +0 -75
  145. package/packs/angular/agents-lite/reviewer.md +0 -69
  146. package/packs/angular/skills/dev-create-component/SKILL.md +0 -56
  147. package/packs/angular/skills/dev-create-injectable/SKILL.md +0 -60
  148. package/packs/angular/skills/dev-create-module/SKILL.md +0 -49
  149. package/packs/angular/skills/dev-create-service/SKILL.md +0 -34
  150. package/packs/angular/skills/dev-create-test/SKILL.md +0 -78
  151. package/packs/angular/skills/dev-generate-types/SKILL.md +0 -37
  152. package/packs/angular/skills/docs-onboard/SKILL.md +0 -42
  153. package/packs/angular/skills/migration-migrate-component/SKILL.md +0 -42
  154. package/packs/angular/skills/migration-migrate-module/SKILL.md +0 -25
  155. package/packs/angular/skills/review-check-architecture/SKILL.md +0 -67
  156. package/packs/angular/skills/review-fix-violations/SKILL.md +0 -43
  157. package/packs/angular/skills/review-review/SKILL.md +0 -43
  158. package/packs/astro/ARCHITECTURE.md +0 -718
  159. package/packs/astro/CLAUDE.md +0 -106
  160. package/packs/astro/agents/builder.md +0 -123
  161. package/packs/astro/agents/doctor.md +0 -200
  162. package/packs/astro/agents/migrator.md +0 -105
  163. package/packs/astro/agents/reviewer.md +0 -253
  164. package/packs/astro/agents-lite/builder.md +0 -71
  165. package/packs/astro/agents-lite/doctor.md +0 -66
  166. package/packs/astro/agents-lite/migrator.md +0 -71
  167. package/packs/astro/agents-lite/reviewer.md +0 -70
  168. package/packs/astro/skills/dev-create-component/SKILL.md +0 -50
  169. package/packs/astro/skills/dev-create-island/SKILL.md +0 -63
  170. package/packs/astro/skills/dev-create-module/SKILL.md +0 -49
  171. package/packs/astro/skills/dev-create-service/SKILL.md +0 -34
  172. package/packs/astro/skills/dev-create-test/SKILL.md +0 -76
  173. package/packs/astro/skills/dev-generate-types/SKILL.md +0 -37
  174. package/packs/astro/skills/docs-onboard/SKILL.md +0 -51
  175. package/packs/astro/skills/migration-migrate-component/SKILL.md +0 -48
  176. package/packs/astro/skills/migration-migrate-module/SKILL.md +0 -25
  177. package/packs/astro/skills/review-check-architecture/SKILL.md +0 -72
  178. package/packs/astro/skills/review-fix-violations/SKILL.md +0 -43
  179. package/packs/astro/skills/review-review/SKILL.md +0 -45
  180. package/packs/nextjs/ARCHITECTURE.md +0 -1033
  181. package/packs/nextjs/CLAUDE.md +0 -106
  182. package/packs/nextjs/agents/builder.md +0 -132
  183. package/packs/nextjs/agents/doctor.md +0 -226
  184. package/packs/nextjs/agents/migrator.md +0 -101
  185. package/packs/nextjs/agents/reviewer.md +0 -243
  186. package/packs/nextjs/agents-lite/builder.md +0 -74
  187. package/packs/nextjs/agents-lite/doctor.md +0 -74
  188. package/packs/nextjs/agents-lite/migrator.md +0 -75
  189. package/packs/nextjs/agents-lite/reviewer.md +0 -73
  190. package/packs/nextjs/skills/dev-create-component/SKILL.md +0 -82
  191. package/packs/nextjs/skills/dev-create-hook/SKILL.md +0 -90
  192. package/packs/nextjs/skills/dev-create-module/SKILL.md +0 -63
  193. package/packs/nextjs/skills/dev-create-service/SKILL.md +0 -35
  194. package/packs/nextjs/skills/dev-create-test/SKILL.md +0 -106
  195. package/packs/nextjs/skills/dev-generate-types/SKILL.md +0 -37
  196. package/packs/nextjs/skills/docs-onboard/SKILL.md +0 -55
  197. package/packs/nextjs/skills/migration-migrate-component/SKILL.md +0 -58
  198. package/packs/nextjs/skills/migration-migrate-module/SKILL.md +0 -25
  199. package/packs/nextjs/skills/review-check-architecture/SKILL.md +0 -101
  200. package/packs/nextjs/skills/review-fix-violations/SKILL.md +0 -48
  201. package/packs/nextjs/skills/review-review/SKILL.md +0 -47
  202. package/packs/nuxt/ARCHITECTURE.md +0 -831
  203. package/packs/nuxt/CLAUDE.md +0 -111
  204. package/packs/nuxt/agents/builder.md +0 -120
  205. package/packs/nuxt/agents/doctor.md +0 -198
  206. package/packs/nuxt/agents/migrator.md +0 -101
  207. package/packs/nuxt/agents/reviewer.md +0 -255
  208. package/packs/nuxt/agents-lite/builder.md +0 -67
  209. package/packs/nuxt/agents-lite/doctor.md +0 -67
  210. package/packs/nuxt/agents-lite/migrator.md +0 -80
  211. package/packs/nuxt/agents-lite/reviewer.md +0 -71
  212. package/packs/nuxt/skills/dev-create-component/SKILL.md +0 -60
  213. package/packs/nuxt/skills/dev-create-composable/SKILL.md +0 -33
  214. package/packs/nuxt/skills/dev-create-module/SKILL.md +0 -49
  215. package/packs/nuxt/skills/dev-create-service/SKILL.md +0 -34
  216. package/packs/nuxt/skills/dev-create-test/SKILL.md +0 -61
  217. package/packs/nuxt/skills/dev-generate-types/SKILL.md +0 -37
  218. package/packs/nuxt/skills/docs-onboard/SKILL.md +0 -49
  219. package/packs/nuxt/skills/migration-migrate-component/SKILL.md +0 -48
  220. package/packs/nuxt/skills/migration-migrate-module/SKILL.md +0 -25
  221. package/packs/nuxt/skills/review-check-architecture/SKILL.md +0 -71
  222. package/packs/nuxt/skills/review-fix-violations/SKILL.md +0 -43
  223. package/packs/nuxt/skills/review-review/SKILL.md +0 -45
  224. package/packs/react/ARCHITECTURE.md +0 -991
  225. package/packs/react/CLAUDE.md +0 -102
  226. package/packs/react/agents/builder.md +0 -113
  227. package/packs/react/agents/doctor.md +0 -203
  228. package/packs/react/agents/migrator.md +0 -101
  229. package/packs/react/agents/reviewer.md +0 -252
  230. package/packs/react/agents-lite/builder.md +0 -65
  231. package/packs/react/agents-lite/doctor.md +0 -64
  232. package/packs/react/agents-lite/migrator.md +0 -74
  233. package/packs/react/agents-lite/reviewer.md +0 -69
  234. package/packs/react/skills/dev-create-component/SKILL.md +0 -53
  235. package/packs/react/skills/dev-create-hook/SKILL.md +0 -78
  236. package/packs/react/skills/dev-create-module/SKILL.md +0 -51
  237. package/packs/react/skills/dev-create-service/SKILL.md +0 -34
  238. package/packs/react/skills/dev-create-test/SKILL.md +0 -92
  239. package/packs/react/skills/dev-generate-types/SKILL.md +0 -37
  240. package/packs/react/skills/docs-onboard/SKILL.md +0 -42
  241. package/packs/react/skills/migration-migrate-component/SKILL.md +0 -44
  242. package/packs/react/skills/migration-migrate-module/SKILL.md +0 -25
  243. package/packs/react/skills/review-check-architecture/SKILL.md +0 -73
  244. package/packs/react/skills/review-fix-violations/SKILL.md +0 -45
  245. package/packs/react/skills/review-review/SKILL.md +0 -44
  246. package/packs/svelte/ARCHITECTURE.md +0 -975
  247. package/packs/svelte/CLAUDE.md +0 -102
  248. package/packs/svelte/agents/builder.md +0 -114
  249. package/packs/svelte/agents/doctor.md +0 -174
  250. package/packs/svelte/agents/migrator.md +0 -101
  251. package/packs/svelte/agents/reviewer.md +0 -238
  252. package/packs/svelte/agents-lite/builder.md +0 -66
  253. package/packs/svelte/agents-lite/doctor.md +0 -67
  254. package/packs/svelte/agents-lite/migrator.md +0 -82
  255. package/packs/svelte/agents-lite/reviewer.md +0 -70
  256. package/packs/svelte/skills/dev-create-component/SKILL.md +0 -77
  257. package/packs/svelte/skills/dev-create-module/SKILL.md +0 -59
  258. package/packs/svelte/skills/dev-create-service/SKILL.md +0 -35
  259. package/packs/svelte/skills/dev-create-store/SKILL.md +0 -94
  260. package/packs/svelte/skills/dev-create-test/SKILL.md +0 -98
  261. package/packs/svelte/skills/dev-generate-types/SKILL.md +0 -37
  262. package/packs/svelte/skills/docs-onboard/SKILL.md +0 -47
  263. package/packs/svelte/skills/migration-migrate-component/SKILL.md +0 -51
  264. package/packs/svelte/skills/migration-migrate-module/SKILL.md +0 -25
  265. package/packs/svelte/skills/review-check-architecture/SKILL.md +0 -79
  266. package/packs/svelte/skills/review-fix-violations/SKILL.md +0 -47
  267. package/packs/svelte/skills/review-review/SKILL.md +0 -45
  268. package/packs/vue/ARCHITECTURE.md +0 -798
  269. package/packs/vue/CLAUDE.md +0 -102
  270. package/packs/vue/agents/builder.md +0 -112
  271. package/packs/vue/agents/doctor.md +0 -185
  272. package/packs/vue/agents/migrator.md +0 -101
  273. package/packs/vue/agents/reviewer.md +0 -249
  274. package/packs/vue/agents-lite/builder.md +0 -65
  275. package/packs/vue/agents-lite/doctor.md +0 -63
  276. package/packs/vue/agents-lite/migrator.md +0 -73
  277. package/packs/vue/agents-lite/reviewer.md +0 -68
  278. package/packs/vue/skills/dev-create-component/SKILL.md +0 -58
  279. package/packs/vue/skills/dev-create-composable/SKILL.md +0 -31
  280. package/packs/vue/skills/dev-create-module/SKILL.md +0 -50
  281. package/packs/vue/skills/dev-create-service/SKILL.md +0 -34
  282. package/packs/vue/skills/dev-create-test/SKILL.md +0 -62
  283. package/packs/vue/skills/dev-generate-types/SKILL.md +0 -37
  284. package/packs/vue/skills/docs-onboard/SKILL.md +0 -42
  285. package/packs/vue/skills/migration-migrate-component/SKILL.md +0 -41
  286. package/packs/vue/skills/migration-migrate-module/SKILL.md +0 -25
  287. package/packs/vue/skills/review-check-architecture/SKILL.md +0 -73
  288. package/packs/vue/skills/review-fix-violations/SKILL.md +0 -42
  289. package/packs/vue/skills/review-review/SKILL.md +0 -43
  290. package/skills/audit/SKILL.md +0 -231
  291. package/skills/autofix/SKILL.md +0 -166
  292. package/skills/autopilot/SKILL.md +0 -286
  293. package/skills/brainstorm/SKILL.md +0 -298
  294. package/skills/checkpoint/SKILL.md +0 -217
  295. package/skills/codereview/SKILL.md +0 -268
  296. package/skills/commit/SKILL.md +0 -150
  297. package/skills/copywriting/SKILL.md +0 -218
  298. package/skills/cro/SKILL.md +0 -234
  299. package/skills/debug/SKILL.md +0 -210
  300. package/skills/design-review/SKILL.md +0 -217
  301. package/skills/discovery/SKILL.md +0 -218
  302. package/skills/estimate/SKILL.md +0 -154
  303. package/skills/finish/SKILL.md +0 -220
  304. package/skills/grill/SKILL.md +0 -270
  305. package/skills/health/SKILL.md +0 -251
  306. package/skills/improve-architecture/SKILL.md +0 -205
  307. package/skills/learn/SKILL.md +0 -260
  308. package/skills/lint/SKILL.md +0 -126
  309. package/skills/migrate-architecture/SKILL.md +0 -242
  310. package/skills/migrate-framework/SKILL.md +0 -172
  311. package/skills/onboard/SKILL.md +0 -168
  312. package/skills/plan/SKILL.md +0 -141
  313. package/skills/prd/SKILL.md +0 -241
  314. package/skills/recall/SKILL.md +0 -112
  315. package/skills/remember/SKILL.md +0 -108
  316. package/skills/seo-audit/SKILL.md +0 -240
  317. package/skills/tdd/SKILL.md +0 -201
  318. package/skills/tutorial/SKILL.md +0 -346
  319. package/skills/verify/SKILL.md +0 -168
  320. package/skills/worktree/SKILL.md +0 -168
  321. package/skills/write-skill/SKILL.md +0 -225
  322. package/templates/autopilot/PROMPT.md +0 -39
  323. package/templates/autopilot/README.md +0 -122
  324. package/templates/autopilot/devcontainer.json +0 -21
  325. package/templates/industry/ecommerce.md +0 -127
  326. package/templates/industry/fintech.md +0 -161
  327. package/templates/industry/saas.md +0 -134
  328. package/templates/session-memory.json +0 -48
  329. package/templates/skill-template/SKILL.md +0 -90
@@ -0,0 +1,288 @@
1
+ // ../../apps/manager/src/agent/workers/hw-worker.ts
2
+ import { homedir } from "node:os";
3
+ import { parentPort, workerData } from "node:worker_threads";
4
+
5
+ // ../core/src/node/hardware.ts
6
+ import { spawnSync } from "node:child_process";
7
+ import { existsSync, readdirSync, readFileSync, statfsSync } from "node:fs";
8
+ import { totalmem } from "node:os";
9
+ import { dirname, join, resolve } from "node:path";
10
+
11
+ // ../core/src/hardware.ts
12
+ function currentOS(platform) {
13
+ if (platform === "win32") return "win";
14
+ if (platform === "darwin") return "mac";
15
+ return "linux";
16
+ }
17
+ var NV = { "1050": 2, "1050 ti": 4, "1060": 6, "1070": 8, "1070 ti": 8, "1080": 8, "1080 ti": 11, "1630": 4, "1650": 4, "1650 super": 4, "1660": 6, "1660 super": 6, "1660 ti": 6, "2060": 6, "2060 super": 8, "2070": 8, "2070 super": 8, "2080": 8, "2080 super": 8, "2080 ti": 11, "3050": 8, "3060": 12, "3060 ti": 8, "3070": 8, "3070 ti": 8, "3080": 10, "3080 ti": 12, "3090": 24, "3090 ti": 24, "4060": 8, "4060 ti": 8, "4070": 12, "4070 super": 12, "4070 ti": 12, "4070 ti super": 16, "4080": 16, "4080 super": 16, "4090": 24, "5050": 8, "5060": 8, "5060 ti": 16, "5070": 12, "5070 ti": 16, "5080": 16, "5090": 32 };
18
+ var NVL = { "1650": 4, "1660 ti": 6, "2050": 4, "2060": 6, "2070": 8, "2080": 8, "3050": 4, "3050 ti": 4, "3060": 6, "3070": 8, "3070 ti": 8, "3080": 8, "3080 ti": 16, "4050": 6, "4060": 8, "4070": 8, "4080": 12, "4090": 16, "5050": 8, "5060": 8, "5070": 8, "5070 ti": 12, "5080": 16, "5090": 24 };
19
+ var NV_VAR = { "1060": [3, 6], "2060": [6, 12], "3050": [6, 8], "3060": [8, 12], "3080": [10, 12], "4060 ti": [8, 16], "5060 ti": [8, 16] };
20
+ var AMD = { "570": 4, "580": 8, "590": 8, "5500 xt": 8, "5600 xt": 6, "5700": 8, "5700 xt": 8, "6400": 4, "6500 xt": 4, "6600": 8, "6600 xt": 8, "6650 xt": 8, "6700": 10, "6700 xt": 12, "6750 xt": 12, "6800": 16, "6800 xt": 16, "6900 xt": 16, "6950 xt": 16, "7600": 8, "7600 xt": 16, "7700 xt": 12, "7800 xt": 16, "7900 gre": 16, "7900 xt": 20, "7900 xtx": 24, "9060 xt": 16, "9070": 16, "9070 xt": 16 };
21
+ var ARC = { a310: 4, a380: 6, a580: 8, a750: 8, a770: 16, b570: 10, b580: 12 };
22
+ var APPLE_CHIP = /\bM[1-9]\b/;
23
+ function parseGPU(raw) {
24
+ const s = String(raw || "").replace(/\((R|TM|C)\)/gi, " ");
25
+ const out = { brand: "", vram: null, gpu: "", note: "" };
26
+ if (!s.trim()) return out;
27
+ const laptop = /laptop|mobile|max-q/i.test(s);
28
+ let m;
29
+ if (/nvidia|geforce|quadro|\brtx\b|\bgtx\b/i.test(s)) {
30
+ out.brand = "nvidia";
31
+ m = s.match(/\b(RTX|GTX)\s*(\d{3,4})(\s*Ti)?(\s*SUPER)?/i);
32
+ if (m) {
33
+ const key = m[2] + (m[3] ? " ti" : "") + (m[4] ? " super" : "");
34
+ out.gpu = m[1].toUpperCase() + " " + m[2] + (m[3] ? " Ti" : "") + (m[4] ? " Super" : "") + (laptop ? " (notebook)" : "");
35
+ const v = (laptop ? NVL[key] : void 0) ?? NV[key];
36
+ if (v != null) out.vram = v;
37
+ const sizes = laptop ? void 0 : NV_VAR[key];
38
+ if (sizes) out.note = `Existe vers\xE3o de ${sizes[0]} ou ${sizes[1]} GB. Confira.`;
39
+ } else out.gpu = "NVIDIA";
40
+ } else if ((/apple/i.test(s) || APPLE_CHIP.test(s)) && !/intel|radeon/i.test(s)) {
41
+ out.brand = "apple";
42
+ out.gpu = "Chip Apple";
43
+ out.note = "No Mac, a placa usa a mem\xF3ria do sistema.";
44
+ } else if (/radeon|\bamd\b|\bati\b/i.test(s)) {
45
+ out.brand = "amd";
46
+ m = s.match(/\bRX\s*(\d{3,4})\s*(XTX|XT|GRE)?/i);
47
+ if (m) {
48
+ const key = m[1] + (m[2] ? " " + m[2].toLowerCase() : "");
49
+ out.gpu = "Radeon RX " + m[1] + (m[2] ? " " + m[2].toUpperCase() : "");
50
+ if (AMD[key] != null) out.vram = AMD[key];
51
+ } else {
52
+ out.gpu = "Radeon integrada";
53
+ out.vram = 0;
54
+ }
55
+ } else if (/intel/i.test(s)) {
56
+ out.brand = "intel";
57
+ m = s.match(/\bArc\s*(A|B)\s*(\d{3})/i);
58
+ if (m) {
59
+ const key = (m[1] + m[2]).toLowerCase();
60
+ out.gpu = "Intel Arc " + m[1].toUpperCase() + m[2];
61
+ if (ARC[key] != null) out.vram = ARC[key];
62
+ } else {
63
+ out.gpu = "Intel integrada";
64
+ out.vram = 0;
65
+ out.note = "Se o seu computador tamb\xE9m tem placa NVIDIA ou AMD, informe com --gpu e --vram.";
66
+ }
67
+ }
68
+ return out;
69
+ }
70
+ function parseNvidiaSmi(text) {
71
+ return String(text || "").split(/\r?\n/).map((l) => l.split(",")).filter((p) => p.length >= 2 && p[0].trim()).map((p) => ({ name: p[0].trim(), vram: Math.round(parseFloat(p[1]) / 1024) })).filter((g) => Number.isFinite(g.vram));
72
+ }
73
+ var WIN_4GB_NOTE = "O Windows s\xF3 informa at\xE9 4 GB. Se a sua placa tiver mais, use --vram.";
74
+ var parseJsonList = (json) => {
75
+ let data;
76
+ try {
77
+ data = JSON.parse(String(json || "").trim() || "null");
78
+ } catch {
79
+ return [];
80
+ }
81
+ return Array.isArray(data) ? data : data ? [data] : [];
82
+ };
83
+ function parseWinRegistryVram(json) {
84
+ return parseJsonList(json).filter((a) => a && typeof a.DriverDesc === "string" && a.DriverDesc.trim()).map((a) => ({ name: String(a.DriverDesc).trim(), vram: Math.round(Number(a["HardwareInformation.qwMemorySize"]) / 2 ** 30) })).filter((g) => Number.isFinite(g.vram) && g.vram > 0);
85
+ }
86
+ function parseWinVideo(json, registry = []) {
87
+ const list = parseJsonList(json);
88
+ return list.filter((a) => a && a.Name).map((a) => {
89
+ const name = String(a.Name).trim();
90
+ const p = parseGPU(a.Name);
91
+ const gb = Number(a.AdapterRAM) > 0 ? Number(a.AdapterRAM) / 2 ** 30 : null;
92
+ const fromRegistry = registry.find((r) => r.name.toLowerCase() === name.toLowerCase())?.vram;
93
+ let vram = p.vram;
94
+ if (vram == null && fromRegistry) return { name, brand: p.brand, vram: fromRegistry, approx: true, note: p.note || "" };
95
+ if (vram == null && gb != null) vram = gb >= 3.9 ? 4 : Math.round(gb);
96
+ return { name, brand: p.brand, vram, approx: true, note: p.note || (gb != null && gb >= 3.9 && p.vram == null ? WIN_4GB_NOTE : "") };
97
+ });
98
+ }
99
+ function parseLspci(text) {
100
+ const out = [];
101
+ for (const line of String(text || "").split(/\r?\n/)) {
102
+ const m = line.match(/(?:VGA compatible controller|3D controller|Display controller)[^:]*:\s*(.+)$/i);
103
+ if (m) out.push(m[1].trim());
104
+ }
105
+ return out;
106
+ }
107
+ var sizeGB = (s) => {
108
+ const m = String(s || "").match(/([\d.,]+)\s*(GB|MB)/i);
109
+ if (!m) return null;
110
+ const n = parseFloat(m[1].replace(",", "."));
111
+ return m[2].toUpperCase() === "MB" ? Math.round(n / 1024) : Math.round(n);
112
+ };
113
+ function parseMacDisplays(json) {
114
+ let data;
115
+ try {
116
+ data = JSON.parse(String(json || "") || "{}");
117
+ } catch {
118
+ return [];
119
+ }
120
+ return (data.SPDisplaysDataType || []).map((d) => {
121
+ const name = String(d.sppci_model || d._name || "").trim();
122
+ const vendor = String(d.spdisplays_vendor || d.sppci_vendor || "");
123
+ if (/apple/i.test(name) || /apple/i.test(vendor)) return { name: name || "Chip Apple", brand: "apple", vram: null, approx: false, note: "" };
124
+ const p = parseGPU(name);
125
+ const vram = sizeGB(d.spdisplays_vram) ?? (d.spdisplays_vram_shared ? 0 : p.vram);
126
+ return { name, brand: p.brand, vram, approx: false, note: "" };
127
+ });
128
+ }
129
+ function pickBest(list) {
130
+ const score = (g) => !g.brand ? -1 : (g.brand === "nvidia" ? 1e3 : g.brand === "apple" ? 500 : 0) + (g.vram || 0);
131
+ const ok = list.filter((g) => g.brand);
132
+ return ok.length ? ok.sort((a, b) => score(b) - score(a))[0] : null;
133
+ }
134
+
135
+ // ../core/src/node/hardware.ts
136
+ function capture(file, args, timeout = 15e3) {
137
+ try {
138
+ const r = spawnSync(file, args, { encoding: "utf8", timeout, windowsHide: true, stdio: ["ignore", "pipe", "ignore"] });
139
+ return { status: r.status, stdout: r.stdout || "" };
140
+ } catch {
141
+ return { status: null, stdout: "" };
142
+ }
143
+ }
144
+ var WIN_REGISTRY_VRAM = "Get-ItemProperty 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\0*' -ErrorAction SilentlyContinue | Select-Object DriverDesc,'HardwareInformation.qwMemorySize' | ConvertTo-Json";
145
+ var VENDORS = { "0x10de": "nvidia", "0x1002": "amd", "0x8086": "intel" };
146
+ var linuxSys = {
147
+ // Without lspci: reads the vendor straight from /sys.
148
+ pciGPUs() {
149
+ const root = "/sys/bus/pci/devices";
150
+ const out = [];
151
+ try {
152
+ for (const dev of readdirSync(root)) {
153
+ const cls = readFileSync(join(root, dev, "class"), "utf8").trim();
154
+ if (!/^0x03(00|02|80)/.test(cls)) continue;
155
+ const brand = VENDORS[readFileSync(join(root, dev, "vendor"), "utf8").trim()];
156
+ if (brand) out.push({ name: "", brand, vram: brand === "intel" ? 0 : null, approx: true, note: "" });
157
+ }
158
+ } catch {
159
+ }
160
+ return out;
161
+ },
162
+ amdVram() {
163
+ try {
164
+ for (const card of readdirSync("/sys/class/drm")) {
165
+ const f = join("/sys/class/drm", card, "device", "mem_info_vram_total");
166
+ if (existsSync(f)) {
167
+ const gb = Math.round(Number(readFileSync(f, "utf8").trim()) / 2 ** 30);
168
+ if (gb > 0) return gb;
169
+ }
170
+ }
171
+ } catch {
172
+ }
173
+ return null;
174
+ }
175
+ };
176
+ function nvidiaSmi(run, os2) {
177
+ const args = ["--query-gpu=name,memory.total", "--format=csv,noheader,nounits"];
178
+ let r = run("nvidia-smi", args);
179
+ const legacy = "C:\\Program Files\\NVIDIA Corporation\\NVSMI\\nvidia-smi.exe";
180
+ if (r.status !== 0 && os2 === "win" && existsSync(legacy)) r = run(legacy, args);
181
+ if (r.status !== 0) return null;
182
+ const gpus = parseNvidiaSmi(r.stdout).sort((a, b) => b.vram - a.vram);
183
+ return gpus[0] || null;
184
+ }
185
+ function freeDiskGB(folder, readDisk = statfsSync) {
186
+ let p = resolve(folder);
187
+ while (!existsSync(p)) {
188
+ const above = dirname(p);
189
+ if (above === p) return null;
190
+ p = above;
191
+ }
192
+ try {
193
+ const st = readDisk(p);
194
+ return Math.floor(Number(st.bavail) * Number(st.bsize) / 2 ** 30);
195
+ } catch {
196
+ return null;
197
+ }
198
+ }
199
+ function detectHardware({ os: os2 = currentOS(process.platform), run = capture, mem = totalmem(), arch = process.arch, sys = linuxSys } = {}) {
200
+ const pc2 = { os: os2, brand: "", vram: null, ram: Math.round(mem / 2 ** 30), name: "", source: "", approx: false, note: "" };
201
+ if (os2 === "win" || os2 === "linux") {
202
+ const g = nvidiaSmi(run, os2);
203
+ if (g) return { ...pc2, brand: "nvidia", vram: g.vram, name: g.name, source: "nvidia-smi" };
204
+ }
205
+ if (os2 === "win") {
206
+ const r2 = run("powershell", ["-NoProfile", "-NonInteractive", "-Command", "Get-CimInstance Win32_VideoController | Select-Object Name,AdapterRAM | ConvertTo-Json"]);
207
+ let cards = r2.status === 0 ? parseWinVideo(r2.stdout) : [];
208
+ if (cards.some((c) => c.note === WIN_4GB_NOTE)) {
209
+ const reg = run("powershell", ["-NoProfile", "-NonInteractive", "-Command", WIN_REGISTRY_VRAM]);
210
+ if (reg.status === 0) cards = parseWinVideo(r2.stdout, parseWinRegistryVram(reg.stdout));
211
+ }
212
+ const best2 = pickBest(cards);
213
+ return best2 ? { ...pc2, ...best2, source: "Windows" } : pc2;
214
+ }
215
+ if (os2 === "mac") {
216
+ const r2 = run("system_profiler", ["SPDisplaysDataType", "-json"], 3e4);
217
+ const best2 = r2.status === 0 ? pickBest(parseMacDisplays(r2.stdout)) : null;
218
+ if (best2) return { ...pc2, ...best2, source: "system_profiler" };
219
+ if (arch === "arm64") return { ...pc2, brand: "apple", name: "Chip Apple", source: "processador" };
220
+ return pc2;
221
+ }
222
+ const r = run("lspci", []);
223
+ let list = r.status === 0 ? parseLspci(r.stdout).map((name) => ({ name, approx: true, ...parseGPU(name) })) : [];
224
+ let source = "lspci";
225
+ if (!list.some((g) => g.brand)) {
226
+ list = sys.pciGPUs();
227
+ source = "/sys";
228
+ }
229
+ const best = pickBest(list);
230
+ if (!best) return pc2;
231
+ if (best.brand === "amd" && best.gpu !== "Radeon integrada") {
232
+ const v = sys.amdVram();
233
+ if (v) Object.assign(best, { vram: v, approx: false });
234
+ }
235
+ return { ...pc2, name: best.name, brand: best.brand, vram: best.vram, approx: !!best.approx, note: best.note || "", source };
236
+ }
237
+
238
+ // ../core/src/node/prereqs.ts
239
+ import { spawnSync as spawnSync2 } from "node:child_process";
240
+ import { existsSync as existsSync2 } from "node:fs";
241
+ import { join as join2 } from "node:path";
242
+
243
+ // ../core/src/prereqs.ts
244
+ var PRE_ORDER = ["git", "uv", "node", "ffmpeg", "espeak", "docker", "claude"];
245
+ var PRE_BIN = { git: "git", uv: "uv", node: "node", ffmpeg: "ffmpeg", espeak: "espeak-ng", docker: "docker", claude: "claude" };
246
+
247
+ // ../core/src/node/prereqs.ts
248
+ function commandExists(cmd, os2) {
249
+ try {
250
+ const r = os2 === "win" ? spawnSync2("where", [cmd], { stdio: "ignore", windowsHide: true }) : spawnSync2("sh", ["-c", 'command -v "$1" >/dev/null 2>&1', "sh", cmd], { stdio: "ignore" });
251
+ return r.status === 0;
252
+ } catch {
253
+ return false;
254
+ }
255
+ }
256
+ function hasPrereq(id, os2) {
257
+ if (id === "espeak" && os2 === "win") return existsSync2(join2(process.env.ProgramFiles || "C:\\Program Files", "eSpeak NG"));
258
+ if (id === "git" && os2 === "mac") {
259
+ try {
260
+ return spawnSync2("git", ["--version"], { stdio: "ignore" }).status === 0;
261
+ } catch {
262
+ return false;
263
+ }
264
+ }
265
+ const bin = PRE_BIN[id];
266
+ if (!bin) return null;
267
+ return commandExists(bin, os2);
268
+ }
269
+
270
+ // ../../apps/manager/src/agent/workers/hw-worker.ts
271
+ var { os, path, pathKey, base } = workerData || {};
272
+ if (path && pathKey) process.env[pathKey] = path;
273
+ var pc;
274
+ try {
275
+ pc = detectHardware({ os });
276
+ } catch (e) {
277
+ pc = { os, brand: "", vram: null, ram: null, name: "", source: "error", note: String(e.message || e) };
278
+ }
279
+ var prereqs = {};
280
+ for (const id of PRE_ORDER) {
281
+ try {
282
+ prereqs[id] = hasPrereq(id, os);
283
+ } catch {
284
+ prereqs[id] = null;
285
+ }
286
+ }
287
+ var freeDisk = freeDiskGB(base || homedir());
288
+ parentPort?.postMessage({ pc, prereqs, freeDisk });
Binary file
Binary file