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.
- package/LICENSE +1 -1
- package/README.md +36 -206
- package/dist/catalog.json +16677 -0
- package/dist/hw-worker.mjs +288 -0
- package/dist/icones/icone.ico +0 -0
- package/dist/icones/icone.png +0 -0
- package/dist/interface/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-ext-400-normal-CXAzuTZb.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-ext-500-normal-Du0rIuHj.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-ext-600-normal-DJlfifZj.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-ext-700-normal-CS4sQkGV.woff2 +0 -0
- package/dist/interface/assets/index-BltVv7tb.js +24 -0
- package/dist/interface/assets/index-Cpa6kApK.css +1 -0
- package/dist/interface/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- package/dist/interface/assets/unbounded-latin-500-normal-4slEIF53.woff2 +0 -0
- package/dist/interface/assets/unbounded-latin-700-normal-CaoNriVp.woff2 +0 -0
- package/dist/interface/assets/unbounded-latin-ext-500-normal-BTIpesyw.woff2 +0 -0
- package/dist/interface/assets/unbounded-latin-ext-700-normal-BLzWLLjG.woff2 +0 -0
- package/dist/interface/icones/apple-touch-icon.png +0 -0
- package/dist/interface/icones/favicon-32.png +0 -0
- package/dist/interface/icones/icone-192.png +0 -0
- package/dist/interface/icones/icone-512.png +0 -0
- package/dist/interface/icones/icone-mascara-512.png +0 -0
- package/dist/interface/index.html +19 -0
- package/dist/interface/manifest.webmanifest +19 -0
- package/dist/interface/sw.js +64 -0
- package/dist/licencas/BRAND.md +22 -0
- package/dist/licencas/LICENSE-CONTENT.md +44 -0
- package/dist/licencas/OFL-Figtree.txt +93 -0
- package/dist/licencas/OFL-JetBrainsMono.txt +93 -0
- package/dist/licencas/OFL-Unbounded.txt +93 -0
- package/dist/licencas/TERCEIROS.txt +104 -0
- package/dist/specialist-agent.mjs +14515 -0
- package/dist/usage-worker.mjs +1077 -0
- package/package.json +34 -58
- package/.claude-plugin/marketplace.json +0 -52
- package/.claude-plugin/plugin.json +0 -37
- package/.codex/INSTALL.md +0 -145
- package/.cursor-plugin/marketplace.json +0 -52
- package/.cursor-plugin/plugin.json +0 -37
- package/.opencode/INSTALL.md +0 -127
- package/.opencode/opencode.json +0 -186
- package/agents/analyst-lite.md +0 -48
- package/agents/analyst.md +0 -396
- package/agents/api-lite.md +0 -43
- package/agents/api.md +0 -427
- package/agents/architect-lite.md +0 -104
- package/agents/architect.md +0 -571
- package/agents/autopilot-lite.md +0 -46
- package/agents/autopilot.md +0 -196
- package/agents/cloud-lite.md +0 -75
- package/agents/cloud.md +0 -213
- package/agents/data-lite.md +0 -67
- package/agents/data.md +0 -306
- package/agents/debugger-lite.md +0 -46
- package/agents/debugger.md +0 -410
- package/agents/deps-lite.md +0 -41
- package/agents/deps.md +0 -363
- package/agents/designer-lite.md +0 -67
- package/agents/designer.md +0 -195
- package/agents/devops-lite.md +0 -67
- package/agents/devops.md +0 -205
- package/agents/docs-lite.md +0 -42
- package/agents/docs.md +0 -454
- package/agents/executor-lite.md +0 -61
- package/agents/executor.md +0 -695
- package/agents/explorer-lite.md +0 -55
- package/agents/explorer.md +0 -152
- package/agents/finance-lite.md +0 -66
- package/agents/finance.md +0 -255
- package/agents/i18n-lite.md +0 -44
- package/agents/i18n.md +0 -594
- package/agents/legal-lite.md +0 -113
- package/agents/legal.md +0 -302
- package/agents/marketing-lite.md +0 -25
- package/agents/marketing.md +0 -188
- package/agents/memory.md +0 -166
- package/agents/orchestrator-lite.md +0 -40
- package/agents/orchestrator.md +0 -512
- package/agents/pair-lite.md +0 -38
- package/agents/pair.md +0 -310
- package/agents/perf-lite.md +0 -42
- package/agents/perf.md +0 -320
- package/agents/planner-lite.md +0 -59
- package/agents/planner.md +0 -272
- package/agents/product-lite.md +0 -25
- package/agents/product.md +0 -195
- package/agents/refactor-lite.md +0 -42
- package/agents/refactor.md +0 -467
- package/agents/ripple-lite.md +0 -106
- package/agents/ripple.md +0 -166
- package/agents/scout-lite.md +0 -37
- package/agents/scout.md +0 -224
- package/agents/security-lite.md +0 -66
- package/agents/security.md +0 -252
- package/agents/sentry-triage-lite.md +0 -54
- package/agents/sentry-triage.md +0 -217
- package/agents/starter-lite.md +0 -80
- package/agents/starter.md +0 -300
- package/agents/support-lite.md +0 -24
- package/agents/support.md +0 -191
- package/agents/tdd-lite.md +0 -43
- package/agents/tdd.md +0 -329
- package/agents/tester-lite.md +0 -71
- package/agents/tester.md +0 -237
- package/cli/architectures.mjs +0 -713
- package/cli/detect-architecture.mjs +0 -752
- package/cli/generate-architecture.mjs +0 -1096
- package/cli/index.mjs +0 -1217
- package/cli/recommend-architecture.mjs +0 -870
- package/hooks/after-review.mjs +0 -130
- package/hooks/after-task.mjs +0 -117
- package/hooks/before-plan.mjs +0 -155
- package/hooks/before-review.mjs +0 -139
- package/hooks/hooks.json +0 -66
- package/hooks/lifecycle.json +0 -91
- package/hooks/native/auto-dispatch.mjs +0 -207
- package/hooks/native/auto-format.mjs +0 -176
- package/hooks/native/mcp-discovery.mjs +0 -168
- package/hooks/native/security-config.json +0 -38
- package/hooks/native/security-guard.mjs +0 -323
- package/hooks/native/session-context.mjs +0 -179
- package/hooks/native/session-end.mjs +0 -42
- package/hooks/native/utils.mjs +0 -62
- package/hooks/on-error.mjs +0 -129
- package/hooks/session-end.mjs +0 -185
- package/hooks/session-start.mjs +0 -154
- package/packs/angular/ARCHITECTURE.md +0 -814
- package/packs/angular/CLAUDE.md +0 -105
- package/packs/angular/agents/builder.md +0 -113
- package/packs/angular/agents/doctor.md +0 -187
- package/packs/angular/agents/migrator.md +0 -101
- package/packs/angular/agents/reviewer.md +0 -252
- package/packs/angular/agents-lite/builder.md +0 -65
- package/packs/angular/agents-lite/doctor.md +0 -64
- package/packs/angular/agents-lite/migrator.md +0 -75
- package/packs/angular/agents-lite/reviewer.md +0 -69
- package/packs/angular/skills/dev-create-component/SKILL.md +0 -56
- package/packs/angular/skills/dev-create-injectable/SKILL.md +0 -60
- package/packs/angular/skills/dev-create-module/SKILL.md +0 -49
- package/packs/angular/skills/dev-create-service/SKILL.md +0 -34
- package/packs/angular/skills/dev-create-test/SKILL.md +0 -78
- package/packs/angular/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/angular/skills/docs-onboard/SKILL.md +0 -42
- package/packs/angular/skills/migration-migrate-component/SKILL.md +0 -42
- package/packs/angular/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/angular/skills/review-check-architecture/SKILL.md +0 -67
- package/packs/angular/skills/review-fix-violations/SKILL.md +0 -43
- package/packs/angular/skills/review-review/SKILL.md +0 -43
- package/packs/astro/ARCHITECTURE.md +0 -718
- package/packs/astro/CLAUDE.md +0 -106
- package/packs/astro/agents/builder.md +0 -123
- package/packs/astro/agents/doctor.md +0 -200
- package/packs/astro/agents/migrator.md +0 -105
- package/packs/astro/agents/reviewer.md +0 -253
- package/packs/astro/agents-lite/builder.md +0 -71
- package/packs/astro/agents-lite/doctor.md +0 -66
- package/packs/astro/agents-lite/migrator.md +0 -71
- package/packs/astro/agents-lite/reviewer.md +0 -70
- package/packs/astro/skills/dev-create-component/SKILL.md +0 -50
- package/packs/astro/skills/dev-create-island/SKILL.md +0 -63
- package/packs/astro/skills/dev-create-module/SKILL.md +0 -49
- package/packs/astro/skills/dev-create-service/SKILL.md +0 -34
- package/packs/astro/skills/dev-create-test/SKILL.md +0 -76
- package/packs/astro/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/astro/skills/docs-onboard/SKILL.md +0 -51
- package/packs/astro/skills/migration-migrate-component/SKILL.md +0 -48
- package/packs/astro/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/astro/skills/review-check-architecture/SKILL.md +0 -72
- package/packs/astro/skills/review-fix-violations/SKILL.md +0 -43
- package/packs/astro/skills/review-review/SKILL.md +0 -45
- package/packs/nextjs/ARCHITECTURE.md +0 -1033
- package/packs/nextjs/CLAUDE.md +0 -106
- package/packs/nextjs/agents/builder.md +0 -132
- package/packs/nextjs/agents/doctor.md +0 -226
- package/packs/nextjs/agents/migrator.md +0 -101
- package/packs/nextjs/agents/reviewer.md +0 -243
- package/packs/nextjs/agents-lite/builder.md +0 -74
- package/packs/nextjs/agents-lite/doctor.md +0 -74
- package/packs/nextjs/agents-lite/migrator.md +0 -75
- package/packs/nextjs/agents-lite/reviewer.md +0 -73
- package/packs/nextjs/skills/dev-create-component/SKILL.md +0 -82
- package/packs/nextjs/skills/dev-create-hook/SKILL.md +0 -90
- package/packs/nextjs/skills/dev-create-module/SKILL.md +0 -63
- package/packs/nextjs/skills/dev-create-service/SKILL.md +0 -35
- package/packs/nextjs/skills/dev-create-test/SKILL.md +0 -106
- package/packs/nextjs/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/nextjs/skills/docs-onboard/SKILL.md +0 -55
- package/packs/nextjs/skills/migration-migrate-component/SKILL.md +0 -58
- package/packs/nextjs/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/nextjs/skills/review-check-architecture/SKILL.md +0 -101
- package/packs/nextjs/skills/review-fix-violations/SKILL.md +0 -48
- package/packs/nextjs/skills/review-review/SKILL.md +0 -47
- package/packs/nuxt/ARCHITECTURE.md +0 -831
- package/packs/nuxt/CLAUDE.md +0 -111
- package/packs/nuxt/agents/builder.md +0 -120
- package/packs/nuxt/agents/doctor.md +0 -198
- package/packs/nuxt/agents/migrator.md +0 -101
- package/packs/nuxt/agents/reviewer.md +0 -255
- package/packs/nuxt/agents-lite/builder.md +0 -67
- package/packs/nuxt/agents-lite/doctor.md +0 -67
- package/packs/nuxt/agents-lite/migrator.md +0 -80
- package/packs/nuxt/agents-lite/reviewer.md +0 -71
- package/packs/nuxt/skills/dev-create-component/SKILL.md +0 -60
- package/packs/nuxt/skills/dev-create-composable/SKILL.md +0 -33
- package/packs/nuxt/skills/dev-create-module/SKILL.md +0 -49
- package/packs/nuxt/skills/dev-create-service/SKILL.md +0 -34
- package/packs/nuxt/skills/dev-create-test/SKILL.md +0 -61
- package/packs/nuxt/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/nuxt/skills/docs-onboard/SKILL.md +0 -49
- package/packs/nuxt/skills/migration-migrate-component/SKILL.md +0 -48
- package/packs/nuxt/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/nuxt/skills/review-check-architecture/SKILL.md +0 -71
- package/packs/nuxt/skills/review-fix-violations/SKILL.md +0 -43
- package/packs/nuxt/skills/review-review/SKILL.md +0 -45
- package/packs/react/ARCHITECTURE.md +0 -991
- package/packs/react/CLAUDE.md +0 -102
- package/packs/react/agents/builder.md +0 -113
- package/packs/react/agents/doctor.md +0 -203
- package/packs/react/agents/migrator.md +0 -101
- package/packs/react/agents/reviewer.md +0 -252
- package/packs/react/agents-lite/builder.md +0 -65
- package/packs/react/agents-lite/doctor.md +0 -64
- package/packs/react/agents-lite/migrator.md +0 -74
- package/packs/react/agents-lite/reviewer.md +0 -69
- package/packs/react/skills/dev-create-component/SKILL.md +0 -53
- package/packs/react/skills/dev-create-hook/SKILL.md +0 -78
- package/packs/react/skills/dev-create-module/SKILL.md +0 -51
- package/packs/react/skills/dev-create-service/SKILL.md +0 -34
- package/packs/react/skills/dev-create-test/SKILL.md +0 -92
- package/packs/react/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/react/skills/docs-onboard/SKILL.md +0 -42
- package/packs/react/skills/migration-migrate-component/SKILL.md +0 -44
- package/packs/react/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/react/skills/review-check-architecture/SKILL.md +0 -73
- package/packs/react/skills/review-fix-violations/SKILL.md +0 -45
- package/packs/react/skills/review-review/SKILL.md +0 -44
- package/packs/svelte/ARCHITECTURE.md +0 -975
- package/packs/svelte/CLAUDE.md +0 -102
- package/packs/svelte/agents/builder.md +0 -114
- package/packs/svelte/agents/doctor.md +0 -174
- package/packs/svelte/agents/migrator.md +0 -101
- package/packs/svelte/agents/reviewer.md +0 -238
- package/packs/svelte/agents-lite/builder.md +0 -66
- package/packs/svelte/agents-lite/doctor.md +0 -67
- package/packs/svelte/agents-lite/migrator.md +0 -82
- package/packs/svelte/agents-lite/reviewer.md +0 -70
- package/packs/svelte/skills/dev-create-component/SKILL.md +0 -77
- package/packs/svelte/skills/dev-create-module/SKILL.md +0 -59
- package/packs/svelte/skills/dev-create-service/SKILL.md +0 -35
- package/packs/svelte/skills/dev-create-store/SKILL.md +0 -94
- package/packs/svelte/skills/dev-create-test/SKILL.md +0 -98
- package/packs/svelte/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/svelte/skills/docs-onboard/SKILL.md +0 -47
- package/packs/svelte/skills/migration-migrate-component/SKILL.md +0 -51
- package/packs/svelte/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/svelte/skills/review-check-architecture/SKILL.md +0 -79
- package/packs/svelte/skills/review-fix-violations/SKILL.md +0 -47
- package/packs/svelte/skills/review-review/SKILL.md +0 -45
- package/packs/vue/ARCHITECTURE.md +0 -798
- package/packs/vue/CLAUDE.md +0 -102
- package/packs/vue/agents/builder.md +0 -112
- package/packs/vue/agents/doctor.md +0 -185
- package/packs/vue/agents/migrator.md +0 -101
- package/packs/vue/agents/reviewer.md +0 -249
- package/packs/vue/agents-lite/builder.md +0 -65
- package/packs/vue/agents-lite/doctor.md +0 -63
- package/packs/vue/agents-lite/migrator.md +0 -73
- package/packs/vue/agents-lite/reviewer.md +0 -68
- package/packs/vue/skills/dev-create-component/SKILL.md +0 -58
- package/packs/vue/skills/dev-create-composable/SKILL.md +0 -31
- package/packs/vue/skills/dev-create-module/SKILL.md +0 -50
- package/packs/vue/skills/dev-create-service/SKILL.md +0 -34
- package/packs/vue/skills/dev-create-test/SKILL.md +0 -62
- package/packs/vue/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/vue/skills/docs-onboard/SKILL.md +0 -42
- package/packs/vue/skills/migration-migrate-component/SKILL.md +0 -41
- package/packs/vue/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/vue/skills/review-check-architecture/SKILL.md +0 -73
- package/packs/vue/skills/review-fix-violations/SKILL.md +0 -42
- package/packs/vue/skills/review-review/SKILL.md +0 -43
- package/skills/audit/SKILL.md +0 -231
- package/skills/autofix/SKILL.md +0 -166
- package/skills/autopilot/SKILL.md +0 -286
- package/skills/brainstorm/SKILL.md +0 -298
- package/skills/checkpoint/SKILL.md +0 -217
- package/skills/codereview/SKILL.md +0 -268
- package/skills/commit/SKILL.md +0 -150
- package/skills/copywriting/SKILL.md +0 -218
- package/skills/cro/SKILL.md +0 -234
- package/skills/debug/SKILL.md +0 -210
- package/skills/design-review/SKILL.md +0 -217
- package/skills/discovery/SKILL.md +0 -218
- package/skills/estimate/SKILL.md +0 -154
- package/skills/finish/SKILL.md +0 -220
- package/skills/grill/SKILL.md +0 -270
- package/skills/health/SKILL.md +0 -251
- package/skills/improve-architecture/SKILL.md +0 -205
- package/skills/learn/SKILL.md +0 -260
- package/skills/lint/SKILL.md +0 -126
- package/skills/migrate-architecture/SKILL.md +0 -242
- package/skills/migrate-framework/SKILL.md +0 -172
- package/skills/onboard/SKILL.md +0 -168
- package/skills/plan/SKILL.md +0 -141
- package/skills/prd/SKILL.md +0 -241
- package/skills/recall/SKILL.md +0 -112
- package/skills/remember/SKILL.md +0 -108
- package/skills/seo-audit/SKILL.md +0 -240
- package/skills/tdd/SKILL.md +0 -201
- package/skills/tutorial/SKILL.md +0 -346
- package/skills/verify/SKILL.md +0 -168
- package/skills/worktree/SKILL.md +0 -168
- package/skills/write-skill/SKILL.md +0 -225
- package/templates/autopilot/PROMPT.md +0 -39
- package/templates/autopilot/README.md +0 -122
- package/templates/autopilot/devcontainer.json +0 -21
- package/templates/industry/ecommerce.md +0 -127
- package/templates/industry/fintech.md +0 -161
- package/templates/industry/saas.md +0 -134
- package/templates/session-memory.json +0 -48
- 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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|