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,1077 @@
1
+ // ../../apps/manager/src/agent/workers/usage-worker.ts
2
+ import { parentPort, workerData } from "node:worker_threads";
3
+
4
+ // ../../apps/manager/src/agent/usage.ts
5
+ import { closeSync as closeSync3, existsSync as existsSync2, openSync as openSync3, readSync, readdirSync as readdirSync5, statSync as statSync4 } from "node:fs";
6
+ import { join as join3 } from "node:path";
7
+
8
+ // ../../apps/manager/src/agent/files.ts
9
+ import { AsyncLocalStorage } from "node:async_hooks";
10
+ import { chmodSync as chmodSync4, copyFileSync as copyFileSync3, existsSync, lstatSync as lstatSync4, mkdtempSync, readFileSync as readFileSync2, readdirSync as readdirSync4, realpathSync, rmdirSync as rmdirSync2, statSync as statSync3 } from "node:fs";
11
+
12
+ // ../../node_modules/specialist-context/dist/lib/core/language.js
13
+ function language(env = process.env) {
14
+ const forced = String(env.SPECIALIST_LANG || "").trim().toLowerCase();
15
+ if (forced === "pt" || forced === "en")
16
+ return forced;
17
+ const locale = [env.LC_ALL, env.LC_MESSAGES, env.LANG].find((v) => v && v.trim());
18
+ if (locale)
19
+ return /^pt/i.test(locale.trim()) ? "pt" : "en";
20
+ try {
21
+ return /^pt/i.test(Intl.DateTimeFormat().resolvedOptions().locale) ? "pt" : "en";
22
+ } catch {
23
+ return "en";
24
+ }
25
+ }
26
+
27
+ // ../../node_modules/specialist-context/dist/lib/core/texts.js
28
+ var en = {
29
+ // --- entry and general errors
30
+ oldNode: "specialist-context needs Node.js 20 or newer. Download it at https://nodejs.org",
31
+ somethingWrong: (msg) => `Something went wrong: ${msg}`,
32
+ devVersion: "development version",
33
+ noDate: "no date",
34
+ today: "today",
35
+ unknownOption: (a) => `Unknown option: ${a}`,
36
+ missingValue: (a, example) => `Missing the value of ${a}. Example: ${a} ${example}`,
37
+ optionTakesNoValue: (name) => `The option --${name} takes no value.`,
38
+ optionNotForCommand: (flag, command) => `The option --${flag} does not work with the ${command} command.`,
39
+ unknownCommand: (c) => `Unknown command: ${c}`,
40
+ seeCommands: (cli) => `See the commands: ${cli} help`,
41
+ seeHelp: (cli, command = "") => `See the help: ${cli} help${command ? " " + command : ""}`,
42
+ contextTakesNoArgs: (x) => `The context command does not take "${x}". Use --ai, --measure and --all.`,
43
+ unknownAi: (v) => `Unknown AI: ${v}. Use claude, cursor, codex or all.`,
44
+ // --- numbers: suffix and decimal separator of "1.5k" / "1,5 mil"
45
+ tokens: { thousand: "k", decimal: "." },
46
+ // --- help
47
+ help: {
48
+ description: "Context controller for AI: takes out of the conversation what the task does not use, applies profiles and measures the token cost.",
49
+ supports: "Works with Claude Code, Cursor and Codex.",
50
+ usage: "Usage",
51
+ usageArgs: "<command> [options]",
52
+ // Argument placeholders: only they are translated; command names are not.
53
+ argAction: "<action>",
54
+ argName: "[name]",
55
+ argCommand: "[command]",
56
+ argItems: "[items...]",
57
+ argOptions: "[options]",
58
+ argItemsRequired: "<items>",
59
+ argTask: "<task>",
60
+ commands: "Commands",
61
+ examples: "Examples",
62
+ options: "Options",
63
+ actions: "Actions",
64
+ moreDetails: (cli) => `More about a command: ${cli} help profile`,
65
+ cmdContext: "What each AI loads in every conversation and what it costs",
66
+ cmdLibrary: "Stores and returns skills, agents and connectors",
67
+ cmdProfile: "Turns on only what the task uses (video, web, dados, jogos...)",
68
+ cmdMcp: "Connector for the AI to find and load skills on demand",
69
+ cmdHelp: "Shows this help",
70
+ cmdVersion: "Shows the version",
71
+ cmdSuggest: "Says which profile and stored items fit a task",
72
+ cmdHook: "Turns the per-message suggestion in Claude Code on or off",
73
+ cmdAuto: "Turns automatic profile switching (automatic mode) on or off",
74
+ mcp: [
75
+ "Connects the controller to the AI as an MCP server. The AI finds and loads, on demand, the skills stored in the library",
76
+ "(find_skills, load_skill) and sees what a profile would turn on (activate_profile). No tool changes the disk."
77
+ ],
78
+ mcpConnect: "To connect it in Claude Code",
79
+ mcpCompact: "short descriptions and replies: uses fewer tokens",
80
+ context: [
81
+ "Shows, for Claude Code, Cursor and Codex, what loads in every conversation (descriptions of skills,",
82
+ "agents, commands, plugins, rules, instructions and MCP tools) and what it costs in tokens. Tells where to save."
83
+ ],
84
+ contextAi: "claude, cursor, codex or all (default: the ones on this computer)",
85
+ contextMeasure: "starts each user MCP server and measures its tools for real",
86
+ contextAll: "shows every item, including the ones with no cost",
87
+ library: [
88
+ "Stores items in ~/.specialist-agent/biblioteca so they do not load in every conversation. Nothing is deleted: the",
89
+ "manifest keeps the way back. The AI finds what it needs through the router (a small skill) and the MCP connector."
90
+ ],
91
+ libNone: "(none)",
92
+ libList: "lists what is stored",
93
+ libStore: "takes it out of the context (ids or names seen in context)",
94
+ libReturn: "puts it back where it was",
95
+ libRouter: "installs the router and the connector (store already does it)",
96
+ libAi: "claude, cursor, codex or all",
97
+ libAll: "everything that can be stored (except the pinned ones), or everything back",
98
+ libSimulate: "only shows what would change",
99
+ libProject: "in Cursor, the router becomes a .mdc rule of the open project",
100
+ profile: [
101
+ "A profile turns on only what a task uses and stores the rest in the library. The defaults are video, web,",
102
+ "dados (data), jogos (games), dev, terminal, local and reversa (reverse); yours live in ~/.specialist-agent/perfis.json.",
103
+ "Plugins with hooks and pinned items always stay on. Without --ai, it applies to Claude Code."
104
+ ],
105
+ profileList: "lists the profiles",
106
+ profileSimulate: "shows what it turns on and what it stores",
107
+ profilePin: "stays on in every profile",
108
+ profileRestore: "goes back to how it was before profiles",
109
+ version: "Shows the installed version.",
110
+ suggest: [
111
+ "Says the profile that best fits the task and up to 5 items stored in the library (the same ranking as find_skills).",
112
+ "With nothing that fits, it says nothing. Read only: it never changes the disk and uses no network."
113
+ ],
114
+ suggestHook: "reads the Claude Code UserPromptSubmit event JSON from stdin and answers in its format (never blocks: an error exits quietly with 0)",
115
+ hook: [
116
+ 'Turns on, in ~/.claude/settings.json, the UserPromptSubmit hook that runs "specialist-context suggest --hook" on every message.',
117
+ "It touches only the hook entry, keeps the .sa-bak copy and asks for confirmation. The Claude Code plugin already has the hook.",
118
+ "Needs the package installed: npm i -g specialist-context."
119
+ ],
120
+ hookYes: "confirms in advance, without asking",
121
+ auto: [
122
+ "With automatic mode on, when the hook is highly confident that a profile fits the task, the profile is applied for you,",
123
+ "the way the profile command does (stores what goes out, brings back what comes in; it never touches pinned or project items).",
124
+ "The activate_profile MCP tool also starts applying for real (in any supported AI), without that confidence threshold.",
125
+ "At most one switch every 10 minutes. To undo: specialist-context profile --restore (Cursor and Codex: with --ai). Off is the default: it only suggests."
126
+ ],
127
+ autoYes: "confirms in advance, without asking"
128
+ },
129
+ // --- suggest and the hook
130
+ suggest: {
131
+ missingTask: (cli) => `Say the task: ${cli} suggest <task>`,
132
+ profile: (id, name) => `Profile that fits: ${id} (${name})`,
133
+ apply: (cli, id) => `To see what changes: ${cli} profile ${id} --simulate`,
134
+ items: "Stored items that fit:",
135
+ load: "The AI loads them with load_skill (specialist-context connector)."
136
+ },
137
+ hook: {
138
+ unknownAction: (a) => `Unknown action: ${a}. Use on, off or status.`,
139
+ sayAction: (cli) => `Say the action: ${cli} hook on|off|status`,
140
+ on: (file) => `Hook turned on in ${file}.`,
141
+ off: (file) => `Hook turned off (${file}).`,
142
+ alreadyOn: (file) => `The hook is already on in ${file}.`,
143
+ notOn: (file) => `The hook is not on in ${file}.`,
144
+ plugin: "The specialist-context plugin is installed and on: the hook comes from it. I wrote nothing.",
145
+ confirmOn: (file) => `I will add the UserPromptSubmit hook to ${file} (copy in .sa-bak). Continue? [y/N] `,
146
+ confirmOff: (file) => `I will remove the hook from ${file} (copy in .sa-bak). Continue? [y/N] `,
147
+ noTerminal: "There is no terminal to confirm. Run it again with --yes.",
148
+ nothing: "Nothing changed.",
149
+ unexpectedFormat: (file) => `The "hooks" field of ${file} is in a format I do not recognize. I changed nothing in it.`,
150
+ needsPackage: "The hook needs the package installed: npm i -g specialist-context",
151
+ legacy: (cli) => `There is also a hook entry with the old command (specialist-agent sugerir --gancho), which no longer works: ${cli} hook on replaces it, ${cli} hook off removes it.`
152
+ },
153
+ auto: {
154
+ sayAction: (cli) => `Say the action: ${cli} auto on|off|status`,
155
+ unknownAction: (a) => `Unknown action: ${a}. Use on, off or status.`,
156
+ on: (since) => `Automatic mode on${since ? ` since ${since}` : ""}.`,
157
+ off: "Automatic mode off: the hook only suggests.",
158
+ alreadyOn: "Automatic mode is already on.",
159
+ alreadyOff: "Automatic mode is already off.",
160
+ lastSwitch: (when) => `Last profile switch: ${when}.`,
161
+ confirmOn: (cli) => `With automatic mode on, two things start changing your machine without asking again. (1) In Claude Code, when the hook is highly confident about a profile, it is applied for you. (2) In any supported AI (Claude Code, Cursor and Codex), the activate_profile tool stops only previewing: the AI really applies the profile it picks itself, without that confidence threshold. Applying stores in the library what the profile does not use and brings back what it uses (pinned and project items do not change), at most one switch every 10 minutes. Undo with "${cli} profile --restore" (for Cursor and Codex, with --ai). Turn it on? [y/N] `,
162
+ noHook: (cli) => `The hook is not on: automatic mode only acts when the AI calls activate_profile. To turn the hook on: ${cli} hook on`,
163
+ toUndo: (cli) => `To undo an applied profile: ${cli} profile --restore`
164
+ },
165
+ // --- kinds and states of the context table
166
+ kind: { skill: "skill", agent: "agent", command: "command", plugin: "plugin", mcp: "mcp", rule: "rule", instructions: "instructions" },
167
+ state: { library: "library", off: "off", project: "project", always: "always", otherAi: "other AI", pinned: "pinned", on: "on" },
168
+ table: { tokens: "tokens", kind: "type", item: "item", state: "state" },
169
+ // --- context
170
+ ctx: {
171
+ profile: "profile",
172
+ nothingInstalled: "Nothing installed.",
173
+ moreWithCost: (n) => `${n} more with a cost`,
174
+ noCost: (n) => `${n} with no cost`,
175
+ see: (parts) => `${parts}: see them with --all`,
176
+ and: " and ",
177
+ alwaysLoaded: "Always loaded",
178
+ inLibrary: (n, tokens) => `in the library: ${n} (~${tokens})`,
179
+ noAi: (folders) => `Could not find Claude Code, Cursor or Codex on this computer (${folders}).`,
180
+ measuring: "Measuring the MCP servers (starts each one, asks for the tool list and stops it)...",
181
+ tools: (n) => `${n} tools`,
182
+ title: "Context that loads in every conversation",
183
+ estimate: "(estimate: ~4 characters per token; ~ = server not measured yet)",
184
+ spendLess: "To spend less",
185
+ profilesPerTask: (cli) => `Profiles per task (only what the task uses stays on): ${cli} profile`,
186
+ realCost: (cli) => `Real cost of the MCP servers: ${cli} context --measure`
187
+ },
188
+ // --- library (command)
189
+ lib: {
190
+ andMore: (n) => ` and ${n} more`,
191
+ profileIn: (profile, ai) => `Profile ${profile} in ${ai}`,
192
+ simulation: " (dry run: nothing changed)",
193
+ turnsOn: "Turns on",
194
+ stores: "Stores",
195
+ stay: (names) => `Stay (pinned or with hooks): ${names}`,
196
+ nothingToChange: "Nothing to change.",
197
+ router: (x) => `router: ${x}`,
198
+ removed: (x) => `removed ${x}`,
199
+ fewerTokens: (n) => `~${n} fewer tokens`,
200
+ moreTokens: (n) => `~${n} more tokens`,
201
+ perConversation: " per conversation.",
202
+ newSession: (ai) => `MCP servers, plugins and agents change in a new ${ai} session.`,
203
+ title: "Library",
204
+ empty: "Empty. Everything installed loads in every conversation.",
205
+ storeHint: (cli) => `Store: ${cli} library store <id or name> [--ai claude] (ids in: ${cli} context)`,
206
+ returnHint: (cli) => `Return: ${cli} library return <id or name> or --all`,
207
+ unknownAction: (a) => `Unknown action: ${a}. Use store, return or router.`,
208
+ routerAlreadyThere: "the router was already there.",
209
+ sayWhat: (action, cli) => `Say what to ${action}: ${cli} library ${action} <id or name>, or --all.`,
210
+ nothingTo: (action) => `Nothing to ${action}.`,
211
+ projectOnlyForRouter: (cli) => `The option --project only works with ${cli} library router.`
212
+ },
213
+ // --- profile (command)
214
+ prof: {
215
+ profiles: "Profiles",
216
+ active: " active ",
217
+ noneActive: " none active",
218
+ pinnedLine: (pinned) => `Always on (pinned): ${pinned}. Plugins with hooks stay too.`,
219
+ none: "none",
220
+ turnOn: (cli) => `Turn on: ${cli} profile video [--ai claude|cursor|codex|all] [--simulate]`,
221
+ goBack: (cli) => `Go back: ${cli} profile --restore`,
222
+ pin: (cli) => `Pin: ${cli} profile pin <id or name> (unpin: profile unpin)`,
223
+ change: (file) => `Change or create profiles: ${file}`,
224
+ restoreNoName: "--restore does not take a profile name.",
225
+ noActiveProfile: (cli) => `No active profile. To return everything from the library: ${cli} library return --all`,
226
+ restored: "Back to how it was before profiles.",
227
+ sayWhat: (action, cli) => `Say what to ${action}: ${cli} profile ${action} <id or name>`,
228
+ pinned: (list) => `Pinned: ${list}`,
229
+ pinNotFound: (target) => `Could not find ${target} in any AI; it stays on the list.`,
230
+ oneAtATime: (rest) => `One profile at a time. Left over: ${rest}`,
231
+ toGoBack: (cli) => `To go back: ${cli} profile --restore`
232
+ },
233
+ // --- default profiles
234
+ profiles: {
235
+ video: { name: "Video", description: "Video, animation, voice, captions, images and music" },
236
+ web: { name: "Web", description: "Sites, apps, design and interface" },
237
+ dados: { name: "Data", description: "Spreadsheets, databases, SQL, charts and analysis" },
238
+ jogos: { name: "Games", description: "Games, engines and game art" },
239
+ dev: { name: "Programming", description: "Code, review, tests and deploy" },
240
+ terminal: { name: "Terminal", description: "Mods, terminal and Claude Code productivity" },
241
+ local: { name: "Local AI", description: "Local models and automation" },
242
+ reversa: { name: "Reverse engineering", description: "Binaries, Android, web and firmware" }
243
+ },
244
+ // --- errors of the controller, the library and the files
245
+ err: {
246
+ unknownProfile: (name, list) => `Unknown profile: ${name}. Profiles: ${list}`,
247
+ notFound: (target, cli) => `Could not find "${target}". See the ids with: ${cli} context`,
248
+ ambiguous: (target, ids) => `"${target}" is ambiguous: ${ids}`,
249
+ notInLibrary: "not in the library",
250
+ cannotRead: (file, cause) => `Could not read ${file} (${cause}). I changed nothing in it.`,
251
+ couldNotUndo: (cause) => `could not undo everything: ${cause}`,
252
+ invalidJson: (file, cause) => `The JSON of ${file} is not valid (${cause}). I changed nothing in it; fix the file and try again.`,
253
+ jsonNotObject: (file) => `The JSON of ${file} is not an object. I changed nothing in it.`,
254
+ alreadyExists: (path) => `already exists: ${path}`,
255
+ changedMeanwhile: (file) => `${file} changed while I was preparing the change (another program wrote to it). I changed nothing in it; try again.`,
256
+ sourceLeft: (source, target, cause) => `I moved ${source} to ${target}, but ${source} did not go entirely (${cause}); another program may be using the folder. The whole item is at ${target}: close what uses the folder and delete ${source} by hand.`,
257
+ manifestOtherVersion: (file) => `The library manifest (${file}) is from another version. I changed nothing in it.`,
258
+ cannotStore: (id, reason) => `${id} cannot go to the library${reason ? ` (${reason})` : ""}`,
259
+ keyNotFound: (key, file) => `could not find ${key} in ${file}`,
260
+ tableNotFound: (table, file) => `could not find [${table}] in ${file}`,
261
+ anotherExists: (path, storedPath) => `another one already exists at ${path}; the stored one stays at ${storedPath}`,
262
+ goneFromLibrary: (storedPath) => `gone from the library: ${storedPath}`,
263
+ keyExists: (key, file, storedPath) => `${key} already exists in ${file}; the stored one stays at ${storedPath}`,
264
+ remoteNoLogin: "remote server: cannot measure without a login",
265
+ noAnswer: "the server did not answer in time",
266
+ closed: "the server closed before answering",
267
+ serverError: "server error"
268
+ },
269
+ // --- why an item cannot go to the library
270
+ reason: {
271
+ router: "Specialist Context router",
272
+ connector: "Specialist Context connector",
273
+ instructions: "the person's instructions: they load whole, edit the file to shorten",
274
+ hasHooks: "has hooks: stays on in profiles",
275
+ projectPlugin: "project plugin",
276
+ projectSkill: "project skill",
277
+ fromProject: "from the project",
278
+ localServer: "local server of this project",
279
+ mcpJsonServer: "server from the project's .mcp.json",
280
+ mcpJsonPending: "server from the project's .mcp.json, waiting for approval in Claude Code",
281
+ projectServer: "project server",
282
+ inlineServer: "inline table or dotted keys in config.toml: edit config.toml by hand",
283
+ projectRule: "project rule",
284
+ sharedFolder: "folder shared with Codex: use --ai codex",
285
+ claudeFolder: "Claude Code folder: use --ai claude",
286
+ codexFolder: "Codex folder: use --ai codex"
287
+ },
288
+ // --- context recommendations
289
+ rec: {
290
+ serverCosts: (name, tokens, estimated, profile) => `The ${name} server costs ~${tokens} tokens per conversation${estimated ? " (estimate)" : ""}${profile ? ` and is not in the ${profile} profile` : ""}.`,
291
+ notCompact: "The Specialist Context server runs without --compact: its replies come out longer.",
292
+ toolSearch: (value) => `ENABLE_TOOL_SEARCH=${value}: MCP tools load in full. Without this variable, Claude Code loads only the names.`
293
+ },
294
+ // --- MCP connector: tools, descriptions and replies
295
+ mcp: {
296
+ find: {
297
+ description: "Find the user's stored skills, subagents, commands and MCP servers that fit a task. They live in the Specialist Context library, out of the context, to save tokens. Local ranking, no network. Call it before work in a new area (video, web, data, games...); then call load_skill with an id.",
298
+ short: "Find stored skills, agents and MCP servers for a task (local, no network).",
299
+ task: 'The task in a few words, e.g. "edit a video with captions"'
300
+ },
301
+ load: {
302
+ description: "Return the instructions of one item found by find_skills (progressive disclosure): follow them for this task. For a skill, also lists its other files to read when needed.",
303
+ short: "Load the instructions of an item from find_skills."
304
+ },
305
+ activate: {
306
+ description: `Preview a task profile (video, web, dados, jogos, dev, terminal, local, reversa or one of the user's) for this AI: what would come back from the library and what would be stored. It never changes the disk, unless the user turned on automatic mode (then it really applies it and says how to undo): otherwise, tell the user to run the returned "command" in a terminal to apply it.`,
307
+ short: "Preview a task profile (video, web, dados, jogos...). Never changes anything, unless the user turned on automatic mode: returns the command for the user to run."
308
+ },
309
+ missingTask: 'Missing "task".',
310
+ missingId: 'Missing "id".',
311
+ missingName: 'Missing "name".',
312
+ unknownClient: (clients) => `Unknown MCP client. Clients served: ${clients}.`,
313
+ tipWithItems: "load_skill(id) for the best fit.",
314
+ tipNoItems: "Nothing stored fits; go on with what is loaded.",
315
+ notFoundLoad: (id) => `Could not find "${id}". Call find_skills first.`,
316
+ cannotReadInstructions: (id) => `Could not read the instructions of ${id}.`,
317
+ /** With automatic mode off, activate_profile only previews: it is offered only with it on. */
318
+ howToEnable: (id, cli, auto = false) => `${cli} library return ${id} (takes effect next session)${auto ? ", or activate_profile" : ""}`,
319
+ agentNote: "Subagent instructions: follow them here, or turn it on with activate_profile to use it as a subagent.",
320
+ agentNoteManual: "Subagent instructions: follow them here.",
321
+ /** An item turned off outside the library: where the person turns it on. */
322
+ enableOff: {
323
+ plugin: (id) => `The user turns it on with: claude plugin enable ${id} (or enabledPlugins in Claude Code's settings). Takes effect next session.`,
324
+ claude: (name) => `The user turns ${name} on in Claude Code with /mcp (approving it, if it is a server of the project's .mcp.json). Takes effect next session.`,
325
+ codex: (name, file) => `The user turns it on with enabled = true in [mcp_servers.${name}] of ${file}. Takes effect next session.`,
326
+ cursor: (name) => `The user turns ${name} on in Cursor's MCP settings.`
327
+ },
328
+ restart: "MCP servers, plugins and subagents change in a new session.",
329
+ profileNotice: 'Nothing was changed. Ask the user to run "command" in a terminal to apply the profile.',
330
+ auto: {
331
+ applied: (profile, undo) => `Automatic mode (turned on by the user): profile ${profile} was applied. It takes full effect in the next conversation (MCP connectors and skills load at the start); until then, use load_skill for what you need. To undo: ${undo}`,
332
+ active: (profile) => `Profile ${profile} is already active. Nothing was changed.`,
333
+ cooldown: "Automatic mode: a profile was switched less than 10 minutes ago. Nothing was changed.",
334
+ busy: "Automatic mode: another profile switch is in progress right now. Nothing was changed.",
335
+ failed: (error) => `Automatic mode: I could not apply the profile and undid what I had done (${error}). The profile was not turned on.`
336
+ },
337
+ serverError: (msg) => `Error: ${msg}`
338
+ }
339
+ };
340
+ var pt = {
341
+ oldNode: "O specialist-context precisa do Node.js 20 ou mais novo. Baixe em https://nodejs.org",
342
+ somethingWrong: (msg) => `Algo deu errado: ${msg}`,
343
+ devVersion: "vers\xE3o de desenvolvimento",
344
+ noDate: "sem data",
345
+ today: "hoje",
346
+ unknownOption: (a) => `Op\xE7\xE3o desconhecida: ${a}`,
347
+ missingValue: (a, example) => `Falta o valor de ${a}. Exemplo: ${a} ${example}`,
348
+ optionTakesNoValue: (name) => `A op\xE7\xE3o --${name} n\xE3o recebe valor.`,
349
+ optionNotForCommand: (flag, command) => `A op\xE7\xE3o --${flag} n\xE3o serve para o comando ${command}.`,
350
+ unknownCommand: (c) => `Comando desconhecido: ${c}`,
351
+ seeCommands: (cli) => `Veja os comandos: ${cli} help`,
352
+ seeHelp: (cli, command = "") => `Veja a ajuda: ${cli} help${command ? " " + command : ""}`,
353
+ contextTakesNoArgs: (x) => `O comando context n\xE3o recebe "${x}". Use --ai, --measure e --all.`,
354
+ unknownAi: (v) => `IA desconhecida: ${v}. Use claude, cursor, codex ou all.`,
355
+ tokens: { thousand: " mil", decimal: "," },
356
+ help: {
357
+ description: "Controlador de contexto para IA: tira da conversa o que a tarefa n\xE3o usa, aplica perfis e mede o custo em tokens.",
358
+ supports: "Atende Claude Code, Cursor e Codex.",
359
+ usage: "Uso",
360
+ usageArgs: "<comando> [op\xE7\xF5es]",
361
+ argAction: "<a\xE7\xE3o>",
362
+ argName: "[nome]",
363
+ argCommand: "[comando]",
364
+ argItems: "[itens...]",
365
+ argOptions: "[op\xE7\xF5es]",
366
+ argItemsRequired: "<itens>",
367
+ argTask: "<tarefa>",
368
+ commands: "Comandos",
369
+ examples: "Exemplos",
370
+ options: "Op\xE7\xF5es",
371
+ actions: "A\xE7\xF5es",
372
+ moreDetails: (cli) => `Mais detalhes de um comando: ${cli} help profile`,
373
+ cmdContext: "O que cada IA carrega em toda conversa e quanto custa",
374
+ cmdLibrary: "Guarda e devolve skills, agentes e conectores",
375
+ cmdProfile: "Liga s\xF3 o que a tarefa usa (video, web, dados, jogos...)",
376
+ cmdMcp: "Conector para a IA achar e carregar skills sob demanda",
377
+ cmdHelp: "Mostra esta ajuda",
378
+ cmdVersion: "Mostra a vers\xE3o",
379
+ cmdSuggest: "Diz o perfil e os itens guardados que servem a uma tarefa",
380
+ cmdHook: "Liga ou desliga a sugest\xE3o a cada mensagem no Claude Code",
381
+ cmdAuto: "Liga ou desliga a troca de perfil sozinha (modo autom\xE1tico)",
382
+ mcp: [
383
+ "Liga o controlador \xE0 IA como conector MCP. A IA acha e carrega, sob demanda, as skills guardadas na biblioteca",
384
+ "(find_skills, load_skill) e v\xEA o que um perfil ligaria (activate_profile). Nenhuma ferramenta muda o disco."
385
+ ],
386
+ mcpConnect: "Para ligar no Claude Code",
387
+ mcpCompact: "descri\xE7\xF5es e respostas curtas: gasta menos tokens",
388
+ context: [
389
+ "Mostra, para o Claude Code, o Cursor e o Codex, o que carrega em toda conversa (descri\xE7\xF5es de skills,",
390
+ "agentes, comandos, plugins, regras, instru\xE7\xF5es e ferramentas MCP) e quanto custa em tokens. Diz onde economizar."
391
+ ],
392
+ contextAi: "claude, cursor, codex ou all (padr\xE3o: as que est\xE3o no computador)",
393
+ contextMeasure: "liga cada conector MCP do usu\xE1rio e mede as ferramentas de verdade",
394
+ contextAll: "mostra todos os itens, tamb\xE9m os sem custo",
395
+ library: [
396
+ "Guarda itens em ~/.specialist-agent/biblioteca para n\xE3o carregarem em toda conversa. Nada \xE9 apagado: o",
397
+ "manifesto guarda o caminho de volta. A IA acha o que precisa pelo roteador (uma skill pequena) e pelo conector MCP."
398
+ ],
399
+ libNone: "(nenhuma)",
400
+ libList: "lista o que est\xE1 guardado",
401
+ libStore: "tira do contexto (ids ou nomes vistos em context)",
402
+ libReturn: "p\xF5e de volta onde estava",
403
+ libRouter: "instala o roteador e o conector (o store j\xE1 faz isso)",
404
+ libAi: "claude, cursor, codex ou all",
405
+ libAll: "tudo o que pode ser guardado (menos os fixos), ou tudo de volta",
406
+ libSimulate: "s\xF3 mostra o que mudaria",
407
+ libProject: "no Cursor, o roteador vira uma regra .mdc do projeto aberto",
408
+ profile: [
409
+ "Um perfil liga s\xF3 o que uma tarefa usa e guarda o resto na biblioteca. Os padr\xF5es s\xE3o video, web,",
410
+ "dados, jogos, dev, terminal, local e reversa; os seus ficam em ~/.specialist-agent/perfis.json.",
411
+ "Plugins com hooks e os itens fixos ficam sempre ligados. Sem --ai, vale para o Claude Code."
412
+ ],
413
+ profileList: "lista os perfis",
414
+ profileSimulate: "mostra o que liga e o que guarda",
415
+ profilePin: "fica ligado em todos os perfis",
416
+ profileRestore: "volta ao que era antes dos perfis",
417
+ version: "Mostra a vers\xE3o instalada.",
418
+ suggest: [
419
+ "Diz o perfil que mais combina com a tarefa e at\xE9 5 itens guardados na biblioteca (o mesmo ranking de find_skills).",
420
+ "Sem nada que combine, n\xE3o diz nada. S\xF3 l\xEA: nunca muda o disco, n\xE3o usa rede."
421
+ ],
422
+ suggestHook: "l\xEA do stdin o JSON do evento UserPromptSubmit do Claude Code e responde no formato dele (nunca bloqueia: erro sai calado, com 0)",
423
+ hook: [
424
+ 'Liga, no ~/.claude/settings.json, o gancho UserPromptSubmit que roda "specialist-context suggest --hook" a cada mensagem.',
425
+ "Mexe s\xF3 na entrada do gancho, guarda a c\xF3pia .sa-bak e pede confirma\xE7\xE3o. Quem usa o plugin do Claude Code j\xE1 tem o gancho.",
426
+ "Precisa do pacote instalado: npm i -g specialist-context."
427
+ ],
428
+ hookYes: "confirma de antem\xE3o, sem perguntar",
429
+ auto: [
430
+ "Com o modo autom\xE1tico ligado, quando o gancho tem confian\xE7a alta de que um perfil serve \xE0 tarefa, o perfil \xE9 aplicado sozinho,",
431
+ "como o comando profile faz (guarda o que sai, devolve o que entra; nunca mexe nos itens fixos nem nos do projeto).",
432
+ "A ferramenta MCP activate_profile tamb\xE9m passa a aplicar de verdade (em qualquer IA atendida), sem esse limiar de confian\xE7a.",
433
+ "No m\xE1ximo uma troca a cada 10 minutos. Para desfazer: specialist-context profile --restore (Cursor e Codex: com --ai). Desligado \xE9 o padr\xE3o: s\xF3 sugere."
434
+ ],
435
+ autoYes: "confirma de antem\xE3o, sem perguntar"
436
+ },
437
+ suggest: {
438
+ missingTask: (cli) => `Diga a tarefa: ${cli} suggest <tarefa>`,
439
+ profile: (id, name) => `Perfil que combina: ${id} (${name})`,
440
+ apply: (cli, id) => `Para ver o que muda: ${cli} profile ${id} --simulate`,
441
+ items: "Guardados que combinam:",
442
+ load: "A IA carrega com load_skill (conector specialist-context)."
443
+ },
444
+ hook: {
445
+ unknownAction: (a) => `A\xE7\xE3o desconhecida: ${a}. Use on, off ou status.`,
446
+ sayAction: (cli) => `Diga a a\xE7\xE3o: ${cli} hook on|off|status`,
447
+ on: (file) => `Gancho ligado em ${file}.`,
448
+ off: (file) => `Gancho desligado (${file}).`,
449
+ alreadyOn: (file) => `O gancho j\xE1 est\xE1 ligado em ${file}.`,
450
+ notOn: (file) => `O gancho n\xE3o est\xE1 ligado em ${file}.`,
451
+ plugin: "O plugin specialist-context est\xE1 instalado e ligado: o gancho vem dele. N\xE3o gravei nada.",
452
+ confirmOn: (file) => `Vou acrescentar o gancho UserPromptSubmit a ${file} (c\xF3pia em .sa-bak). Continuar? [s/N] `,
453
+ confirmOff: (file) => `Vou tirar o gancho de ${file} (c\xF3pia em .sa-bak). Continuar? [s/N] `,
454
+ noTerminal: "N\xE3o h\xE1 terminal para confirmar. Rode de novo com --yes.",
455
+ nothing: "Nada mudou.",
456
+ unexpectedFormat: (file) => `O campo "hooks" de ${file} est\xE1 num formato que n\xE3o reconhe\xE7o. N\xE3o mudei nada nele.`,
457
+ needsPackage: "O gancho precisa do pacote instalado: npm i -g specialist-context",
458
+ legacy: (cli) => `H\xE1 tamb\xE9m uma entrada do gancho com o comando antigo (specialist-agent sugerir --gancho), que n\xE3o funciona mais: ${cli} hook on a troca, ${cli} hook off a tira.`
459
+ },
460
+ auto: {
461
+ sayAction: (cli) => `Diga a a\xE7\xE3o: ${cli} auto on|off|status`,
462
+ unknownAction: (a) => `A\xE7\xE3o desconhecida: ${a}. Use on, off ou status.`,
463
+ on: (since) => `Modo autom\xE1tico ligado${since ? ` desde ${since}` : ""}.`,
464
+ off: "Modo autom\xE1tico desligado: o gancho s\xF3 sugere.",
465
+ alreadyOn: "O modo autom\xE1tico j\xE1 est\xE1 ligado.",
466
+ alreadyOff: "O modo autom\xE1tico j\xE1 est\xE1 desligado.",
467
+ lastSwitch: (when) => `\xDAltima troca de perfil: ${when}.`,
468
+ confirmOn: (cli) => `Com o modo autom\xE1tico ligado, duas coisas passam a mudar a sua m\xE1quina sem perguntar de novo. (1) No Claude Code, quando o gancho tiver confian\xE7a alta num perfil, ele \xE9 aplicado sozinho. (2) Em qualquer IA atendida (Claude Code, Cursor e Codex), a ferramenta activate_profile deixa de s\xF3 simular: a IA aplica de verdade o perfil que ela mesma escolher, sem esse limiar de confian\xE7a. Aplicar guarda na biblioteca o que o perfil n\xE3o usa e devolve o que usa (itens fixos e de projeto n\xE3o mudam), no m\xE1ximo uma troca a cada 10 minutos. Desfaz com "${cli} profile --restore" (no Cursor e no Codex, com --ai). Ligar? [s/N] `,
469
+ noHook: (cli) => `O gancho n\xE3o est\xE1 ligado: o modo autom\xE1tico s\xF3 age quando a IA chama activate_profile. Para ligar o gancho: ${cli} hook on`,
470
+ toUndo: (cli) => `Para desfazer um perfil aplicado: ${cli} profile --restore`
471
+ },
472
+ kind: { skill: "skill", agent: "agente", command: "comando", plugin: "plugin", mcp: "mcp", rule: "regra", instructions: "instru\xE7\xF5es" },
473
+ state: { library: "biblioteca", off: "desligado", project: "projeto", always: "sempre", otherAi: "outra IA", pinned: "fixo", on: "ligado" },
474
+ table: { tokens: "tokens", kind: "tipo", item: "item", state: "estado" },
475
+ ctx: {
476
+ profile: "perfil",
477
+ nothingInstalled: "Nada instalado.",
478
+ moreWithCost: (n) => `mais ${n} com custo`,
479
+ noCost: (n) => `${n} sem custo`,
480
+ see: (parts) => `${parts}: veja com --all`,
481
+ and: " e ",
482
+ alwaysLoaded: "Sempre carregado",
483
+ inLibrary: (n, tokens) => `na biblioteca: ${n} (~${tokens})`,
484
+ noAi: (folders) => `N\xE3o achei Claude Code, Cursor nem Codex neste computador (${folders}).`,
485
+ measuring: "Medindo os conectores MCP (liga cada um, pede a lista de ferramentas e desliga)...",
486
+ tools: (n) => `${n} ferramentas`,
487
+ title: "Contexto que carrega em toda conversa",
488
+ estimate: "(estimativa: ~4 caracteres por token; ~ = conector ainda n\xE3o medido)",
489
+ spendLess: "Para gastar menos",
490
+ profilesPerTask: (cli) => `Perfis por tarefa (s\xF3 o que a tarefa usa fica ligado): ${cli} profile`,
491
+ realCost: (cli) => `Custo real dos conectores MCP: ${cli} context --measure`
492
+ },
493
+ lib: {
494
+ andMore: (n) => ` e mais ${n}`,
495
+ profileIn: (profile, ai) => `Perfil ${profile} no ${ai}`,
496
+ simulation: " (simula\xE7\xE3o: nada mudou)",
497
+ turnsOn: "Liga",
498
+ stores: "Guarda",
499
+ stay: (names) => `Ficam (fixos ou com hooks): ${names}`,
500
+ nothingToChange: "Nada a mudar.",
501
+ router: (x) => `roteador: ${x}`,
502
+ removed: (x) => `tirei ${x}`,
503
+ fewerTokens: (n) => `~${n} tokens a menos`,
504
+ moreTokens: (n) => `~${n} tokens a mais`,
505
+ perConversation: " por conversa.",
506
+ newSession: (ai) => `Conectores MCP, plugins e agentes mudam numa sess\xE3o nova do ${ai}.`,
507
+ title: "Biblioteca",
508
+ empty: "Vazia. Tudo o que est\xE1 instalado carrega em toda conversa.",
509
+ storeHint: (cli) => `Guardar: ${cli} library store <id ou nome> [--ai claude] (ids em: ${cli} context)`,
510
+ returnHint: (cli) => `Devolver: ${cli} library return <id ou nome> ou --all`,
511
+ unknownAction: (a) => `A\xE7\xE3o desconhecida: ${a}. Use store, return ou router.`,
512
+ routerAlreadyThere: "o roteador j\xE1 estava l\xE1.",
513
+ sayWhat: (action, cli) => `Diga o que ${action === "store" ? "guardar" : "devolver"}: ${cli} library ${action} <id ou nome>, ou --all.`,
514
+ nothingTo: (action) => `Nada para ${action === "store" ? "guardar" : "devolver"}.`,
515
+ projectOnlyForRouter: (cli) => `A op\xE7\xE3o --project s\xF3 serve para ${cli} library router.`
516
+ },
517
+ prof: {
518
+ profiles: "Perfis",
519
+ active: " ativo ",
520
+ noneActive: " nenhum ativo",
521
+ pinnedLine: (pinned) => `Sempre ligados (fixos): ${pinned}. Plugins com hooks tamb\xE9m ficam.`,
522
+ none: "nenhum",
523
+ turnOn: (cli) => `Ligar: ${cli} profile video [--ai claude|cursor|codex|all] [--simulate]`,
524
+ goBack: (cli) => `Voltar: ${cli} profile --restore`,
525
+ pin: (cli) => `Fixar: ${cli} profile pin <id ou nome> (soltar: profile unpin)`,
526
+ change: (file) => `Mudar ou criar perfis: ${file}`,
527
+ restoreNoName: "--restore n\xE3o recebe nome de perfil.",
528
+ noActiveProfile: (cli) => `Nenhum perfil ativo. Para devolver tudo da biblioteca: ${cli} library return --all`,
529
+ restored: "Voltou ao que era antes dos perfis.",
530
+ sayWhat: (action, cli) => `Diga o que ${action === "pin" ? "fixar" : "soltar"}: ${cli} profile ${action} <id ou nome>`,
531
+ pinned: (list) => `Fixos: ${list}`,
532
+ pinNotFound: (target) => `N\xE3o achei ${target} em nenhuma IA; ficou na lista.`,
533
+ oneAtATime: (rest) => `Um perfil por vez. Sobrou: ${rest}`,
534
+ toGoBack: (cli) => `Para voltar: ${cli} profile --restore`
535
+ },
536
+ profiles: {
537
+ video: { name: "V\xEDdeo", description: "V\xEDdeo, anima\xE7\xE3o, voz, legenda, imagem e m\xFAsica" },
538
+ web: { name: "Web", description: "Sites, apps, design e interface" },
539
+ dados: { name: "Dados", description: "Planilhas, bancos de dados, SQL, gr\xE1ficos e an\xE1lise" },
540
+ jogos: { name: "Jogos", description: "Jogos, engines e arte de jogo" },
541
+ dev: { name: "Programa\xE7\xE3o", description: "C\xF3digo, revis\xE3o, testes e deploy" },
542
+ terminal: { name: "Terminal", description: "Mods, terminal e produtividade do Claude Code" },
543
+ local: { name: "IA no PC", description: "Modelos locais e automa\xE7\xE3o" },
544
+ reversa: { name: "Engenharia reversa", description: "Bin\xE1rios, Android, web e firmware" }
545
+ },
546
+ err: {
547
+ unknownProfile: (name, list) => `Perfil desconhecido: ${name}. Perfis: ${list}`,
548
+ notFound: (target, cli) => `N\xE3o achei "${target}". Veja os ids com: ${cli} context`,
549
+ ambiguous: (target, ids) => `"${target}" \xE9 amb\xEDguo: ${ids}`,
550
+ notInLibrary: "n\xE3o est\xE1 na biblioteca",
551
+ cannotRead: (file, cause) => `N\xE3o consegui ler ${file} (${cause}). N\xE3o mudei nada nele.`,
552
+ couldNotUndo: (cause) => `n\xE3o consegui desfazer tudo: ${cause}`,
553
+ invalidJson: (file, cause) => `O JSON de ${file} n\xE3o \xE9 v\xE1lido (${cause}). N\xE3o mudei nada nele; conserte o arquivo e tente de novo.`,
554
+ jsonNotObject: (file) => `O JSON de ${file} n\xE3o \xE9 um objeto. N\xE3o mudei nada nele.`,
555
+ alreadyExists: (path) => `j\xE1 existe: ${path}`,
556
+ changedMeanwhile: (file) => `${file} mudou enquanto eu preparava a mudan\xE7a (outro programa gravou nele). N\xE3o mudei nada nele; tente de novo.`,
557
+ sourceLeft: (source, target, cause) => `Movi ${source} para ${target}, mas ${source} n\xE3o saiu inteira (${cause}); outro programa pode estar usando a pasta. O item inteiro est\xE1 em ${target}: feche o que usa a pasta e apague ${source} \xE0 m\xE3o.`,
558
+ manifestOtherVersion: (file) => `O manifesto da biblioteca (${file}) \xE9 de outra vers\xE3o. N\xE3o mudei nada nele.`,
559
+ cannotStore: (id, reason) => `${id} n\xE3o pode ir para a biblioteca${reason ? ` (${reason})` : ""}`,
560
+ keyNotFound: (key, file) => `n\xE3o achei ${key} em ${file}`,
561
+ tableNotFound: (table, file) => `n\xE3o achei [${table}] em ${file}`,
562
+ anotherExists: (path, storedPath) => `j\xE1 existe outro em ${path}; o guardado continua em ${storedPath}`,
563
+ goneFromLibrary: (storedPath) => `sumiu da biblioteca: ${storedPath}`,
564
+ keyExists: (key, file, storedPath) => `j\xE1 existe ${key} em ${file}; o guardado continua em ${storedPath}`,
565
+ remoteNoLogin: "conector remoto: n\xE3o d\xE1 para medir sem login",
566
+ noAnswer: "o conector n\xE3o respondeu a tempo",
567
+ closed: "o conector fechou antes de responder",
568
+ serverError: "erro do conector"
569
+ },
570
+ reason: {
571
+ router: "roteador do Specialist Context",
572
+ connector: "conector do Specialist Context",
573
+ instructions: "instru\xE7\xF5es da pessoa: carregam inteiras, edite o arquivo para encurtar",
574
+ hasHooks: "tem hooks: fica ligado nos perfis",
575
+ projectPlugin: "plugin do projeto",
576
+ projectSkill: "skill do projeto",
577
+ fromProject: "do projeto",
578
+ localServer: "conector local deste projeto",
579
+ mcpJsonServer: "conector do .mcp.json do projeto",
580
+ mcpJsonPending: "conector do .mcp.json do projeto, esperando aprova\xE7\xE3o no Claude Code",
581
+ projectServer: "conector do projeto",
582
+ inlineServer: "tabela inline ou chaves com ponto no config.toml: edite o config.toml \xE0 m\xE3o",
583
+ projectRule: "regra do projeto",
584
+ sharedFolder: "pasta dividida com o Codex: use --ai codex",
585
+ claudeFolder: "pasta do Claude Code: use --ai claude",
586
+ codexFolder: "pasta do Codex: use --ai codex"
587
+ },
588
+ rec: {
589
+ serverCosts: (name, tokens, estimated, profile) => `O conector ${name} custa ~${tokens} tokens por conversa${estimated ? " (estimativa)" : ""}${profile ? ` e n\xE3o est\xE1 no perfil ${profile}` : ""}.`,
590
+ notCompact: "O conector do Specialist Context roda sem --compact: as respostas dele saem mais longas.",
591
+ toolSearch: (value) => `ENABLE_TOOL_SEARCH=${value}: as ferramentas MCP carregam inteiras. Sem essa vari\xE1vel, o Claude Code carrega s\xF3 os nomes.`
592
+ },
593
+ mcp: {
594
+ find: {
595
+ description: "Acha as skills, subagentes, comandos e conectores MCP guardados do usu\xE1rio que servem a uma tarefa. Ficam na biblioteca do Specialist Context, fora do contexto, para gastar menos tokens. Ranking local, sem rede. Chame antes de trabalhar numa \xE1rea nova (v\xEDdeo, web, dados, jogos...); depois chame load_skill com um id.",
596
+ short: "Acha skills, agentes e conectores MCP guardados para uma tarefa (local, sem rede).",
597
+ task: 'A tarefa em poucas palavras, por exemplo "editar um v\xEDdeo com legendas"'
598
+ },
599
+ load: {
600
+ description: "Devolve as instru\xE7\xF5es de um item achado por find_skills (divulga\xE7\xE3o progressiva): siga-as nesta tarefa. Para uma skill, lista tamb\xE9m os outros arquivos dela, para ler quando precisar.",
601
+ short: "Carrega as instru\xE7\xF5es de um item de find_skills."
602
+ },
603
+ activate: {
604
+ description: 'Mostra antes um perfil de tarefa (video, web, dados, jogos, dev, terminal, local, reversa ou um do usu\xE1rio) para esta IA: o que voltaria da biblioteca e o que seria guardado. Nunca muda o disco, salvo se o usu\xE1rio ligou o modo autom\xE1tico (a\xED aplica de verdade e diz como desfazer): sen\xE3o, pe\xE7a ao usu\xE1rio que rode o "command" devolvido num terminal para aplicar.',
605
+ short: "Mostra um perfil de tarefa (video, web, dados, jogos...). Nunca muda nada, salvo no modo autom\xE1tico ligado pelo usu\xE1rio: devolve o comando para ele rodar."
606
+ },
607
+ missingTask: 'Falta "task".',
608
+ missingId: 'Falta "id".',
609
+ missingName: 'Falta "name".',
610
+ unknownClient: (clients) => `Cliente MCP desconhecido. Clientes atendidos: ${clients}.`,
611
+ tipWithItems: "load_skill(id) para o que melhor serve.",
612
+ tipNoItems: "Nada guardado serve; siga com o que j\xE1 est\xE1 carregado.",
613
+ notFoundLoad: (id) => `N\xE3o achei "${id}". Use find_skills primeiro.`,
614
+ cannotReadInstructions: (id) => `N\xE3o consegui ler as instru\xE7\xF5es de ${id}.`,
615
+ howToEnable: (id, cli, auto = false) => `${cli} library return ${id} (vale na pr\xF3xima sess\xE3o)${auto ? ", ou activate_profile" : ""}`,
616
+ agentNote: "Instru\xE7\xF5es de subagente: siga-as aqui, ou ligue-o com activate_profile para us\xE1-lo como subagente.",
617
+ agentNoteManual: "Instru\xE7\xF5es de subagente: siga-as aqui.",
618
+ enableOff: {
619
+ plugin: (id) => `O usu\xE1rio liga com: claude plugin enable ${id} (ou enabledPlugins nas configura\xE7\xF5es do Claude Code). Vale na pr\xF3xima sess\xE3o.`,
620
+ claude: (name) => `O usu\xE1rio liga ${name} no Claude Code com /mcp (aprovando, se for conector do .mcp.json do projeto). Vale na pr\xF3xima sess\xE3o.`,
621
+ codex: (name, file) => `O usu\xE1rio liga com enabled = true em [mcp_servers.${name}] de ${file}. Vale na pr\xF3xima sess\xE3o.`,
622
+ cursor: (name) => `O usu\xE1rio liga ${name} nas configura\xE7\xF5es de MCP do Cursor.`
623
+ },
624
+ restart: "Conectores MCP, plugins e subagentes mudam numa sess\xE3o nova.",
625
+ profileNotice: 'Nada foi mudado. Pe\xE7a ao usu\xE1rio que rode "command" num terminal para aplicar o perfil.',
626
+ auto: {
627
+ applied: (profile, undo) => `Modo autom\xE1tico (ligado pelo usu\xE1rio): o perfil ${profile} foi aplicado. Vale por inteiro na pr\xF3xima conversa (conector MCP e skills carregam no in\xEDcio); at\xE9 l\xE1, use load_skill para o que precisar. Para desfazer: ${undo}`,
628
+ active: (profile) => `O perfil ${profile} j\xE1 est\xE1 ativo. Nada foi mudado.`,
629
+ cooldown: "Modo autom\xE1tico: j\xE1 houve uma troca de perfil h\xE1 menos de 10 minutos. Nada foi mudado.",
630
+ busy: "Modo autom\xE1tico: outra troca de perfil est\xE1 em andamento agora. Nada foi mudado.",
631
+ failed: (error) => `Modo autom\xE1tico: n\xE3o consegui aplicar o perfil e desfiz o que tinha feito (${error}). O perfil n\xE3o foi ligado.`
632
+ },
633
+ serverError: (msg) => `Erro: ${msg}`
634
+ }
635
+ };
636
+ var t = () => language() === "pt" ? pt : en;
637
+
638
+ // ../../node_modules/specialist-context/dist/lib/core/controller/ranking.js
639
+ var STOP = new Set("a o as os um uma uns umas de do da dos das em no na nos nas por para pra com sem e ou que se como mais menos meu minha seu sua eu voce ele ela isso este esta esse essa aqui quero fazer faz criar cria usar usa ser ter tem muito pouco sobre ao aos the an of to in on for with and or is are be it this that my your you use using make create do does can when how what from by at as".split(/\s+/));
640
+ function stem(word) {
641
+ let p = word;
642
+ if (p.length > 5 && p.endsWith("ing"))
643
+ p = p.slice(0, -3);
644
+ else if (p.endsWith("coes"))
645
+ p = p.slice(0, -4) + "cao";
646
+ else if (p.length > 4 && p.endsWith("oes"))
647
+ p = p.slice(0, -3) + "ao";
648
+ else if (p.length > 3 && p.endsWith("s") && !p.endsWith("ss"))
649
+ p = p.slice(0, -1);
650
+ return p.slice(0, 6);
651
+ }
652
+ var GROUPS = [
653
+ "video filme movie clip clipe reels shorts youtube",
654
+ "animacao animation animate motion",
655
+ "imagem image foto photo picture img",
656
+ "audio som sound",
657
+ "voz voice speech tts fala narracao narration",
658
+ "legenda subtitle caption transcricao transcription",
659
+ "musica music song",
660
+ "jogo game gaming gamedev",
661
+ "dados data dataset analytics",
662
+ "banco database sql postgres",
663
+ "planilha spreadsheet excel xlsx csv",
664
+ "grafico chart plot dashboard visualizacao visualization",
665
+ "site website web pagina page landing frontend",
666
+ "tela screen ui interface layout",
667
+ "design desenho visual estilo style",
668
+ "teste test testing",
669
+ "codigo code programacao programming",
670
+ "documento document docx pdf",
671
+ "apresentacao presentation slides deck pptx",
672
+ "seguranca security",
673
+ "revisao review",
674
+ "erro bug debug depurar",
675
+ "navegador browser chrome",
676
+ "traducao translation translate traduzir",
677
+ "pesquisa research",
678
+ "modelo3d 3d blender"
679
+ ];
680
+ var SYNONYMS = /* @__PURE__ */ new Map();
681
+ for (const g of GROUPS) {
682
+ const stems = [...new Set(g.split(" ").map(stem))];
683
+ for (const r of stems)
684
+ SYNONYMS.set(r, [.../* @__PURE__ */ new Set([...SYNONYMS.get(r) || [], ...stems.filter((x) => x !== r)])]);
685
+ }
686
+
687
+ // ../../node_modules/specialist-context/dist/lib/core/controller/types.js
688
+ var KIND_SEGMENT = {
689
+ skill: "skill",
690
+ agent: "agente",
691
+ command: "comando",
692
+ plugin: "plugin",
693
+ mcp: "mcp",
694
+ rule: "regra",
695
+ instructions: "instrucoes"
696
+ };
697
+
698
+ // ../../node_modules/specialist-context/dist/lib/core/node/controller/files.js
699
+ import { chmodSync as chmodSync3, closeSync as closeSync2, copyFileSync as copyFileSync2, fsyncSync as fsyncSync2, lstatSync as lstatSync3, mkdirSync as mkdirSync2, openSync as openSync2, readdirSync as readdirSync3, readFileSync, renameSync, statSync as statSync2, writeFileSync } from "node:fs";
700
+ import { basename, dirname, extname, join as join2 } from "node:path";
701
+
702
+ // ../../node_modules/specialist-context/dist/lib/core/node/controller/copy.js
703
+ import { chmodSync, closeSync, copyFileSync, fsyncSync, lstatSync, mkdirSync, openSync, readdirSync, readlinkSync, statSync, symlinkSync } from "node:fs";
704
+ var code = (e) => e.code;
705
+ function fsyncBy(path, flags) {
706
+ const fd = openSync(path, flags);
707
+ try {
708
+ fsyncSync(fd);
709
+ } finally {
710
+ closeSync(fd);
711
+ }
712
+ }
713
+ function fsyncFolder(dir) {
714
+ if (process.platform === "win32")
715
+ return;
716
+ try {
717
+ fsyncBy(dir, "r");
718
+ } catch (e) {
719
+ if (!["EINVAL", "ENOTSUP", "EISDIR", "EPERM"].includes(code(e) || ""))
720
+ throw e;
721
+ }
722
+ }
723
+
724
+ // ../../node_modules/specialist-context/dist/lib/core/node/controller/remove.js
725
+ import { chmodSync as chmodSync2, lstatSync as lstatSync2, readdirSync as readdirSync2, rmdirSync, rmSync, unlinkSync } from "node:fs";
726
+ import { join } from "node:path";
727
+ var code2 = (e) => e.code;
728
+ function stat(p) {
729
+ try {
730
+ return lstatSync2(p);
731
+ } catch (e) {
732
+ if (code2(e) === "ENOENT" || code2(e) === "ENOTDIR")
733
+ return null;
734
+ throw e;
735
+ }
736
+ }
737
+ function removeItem(p) {
738
+ const st = stat(p);
739
+ if (!st)
740
+ return;
741
+ if (st.isDirectory()) {
742
+ for (const n of readdirSync2(p))
743
+ removeItem(join(p, n));
744
+ rmdirSync(p);
745
+ return;
746
+ }
747
+ try {
748
+ unlinkSync(p);
749
+ } catch (e) {
750
+ if (code2(e) === "ENOENT")
751
+ return;
752
+ if (st.isSymbolicLink())
753
+ return rmdirSync(p);
754
+ if (code2(e) === "EPERM" || code2(e) === "EACCES") {
755
+ chmodSync2(p, 438);
756
+ return unlinkSync(p);
757
+ }
758
+ throw e;
759
+ }
760
+ }
761
+ function remove(p, { rm = rmSync } = {}) {
762
+ rm(p, { recursive: true, force: true });
763
+ if (stat(p))
764
+ removeItem(p);
765
+ }
766
+
767
+ // ../../node_modules/specialist-context/dist/lib/core/node/controller/files.js
768
+ var FileError = class extends Error {
769
+ userInput = true;
770
+ constructor(message) {
771
+ super(message);
772
+ this.name = "FileError";
773
+ }
774
+ };
775
+ function readTextStrict(file) {
776
+ try {
777
+ return readFileSync(file, "utf8");
778
+ } catch (e) {
779
+ const code3 = e.code;
780
+ if (code3 === "ENOENT" || code3 === "ENOTDIR")
781
+ return null;
782
+ throw new FileError(t().err.cannotRead(file, code3 || e.message));
783
+ }
784
+ }
785
+ var withMode = process.platform !== "win32";
786
+ function modeOf(file) {
787
+ try {
788
+ return statSync2(file).mode & 511;
789
+ } catch {
790
+ return null;
791
+ }
792
+ }
793
+ var STALE_TEMP_MS = 6e4;
794
+ function cleanTemporaries(file) {
795
+ const dir = dirname(file);
796
+ const base = basename(file) + ".";
797
+ let names;
798
+ try {
799
+ names = readdirSync3(dir);
800
+ } catch {
801
+ return;
802
+ }
803
+ for (const n of names) {
804
+ if (!n.startsWith(base) || !/^\d+\.(?:sa-)?tmp$/.test(n.slice(base.length)))
805
+ continue;
806
+ try {
807
+ const p = join2(dir, n);
808
+ if (Date.now() - statSync2(p).mtimeMs > STALE_TEMP_MS)
809
+ remove(p);
810
+ } catch {
811
+ }
812
+ }
813
+ }
814
+ function writeText(file, text, { mode, expected } = {}) {
815
+ mkdirSync2(dirname(file), { recursive: true });
816
+ cleanTemporaries(file);
817
+ const tmp = `${file}.${process.pid}.sa-tmp`;
818
+ const m = mode ?? modeOf(file);
819
+ try {
820
+ const fd = openSync2(tmp, "w", m !== null && withMode ? m : 438);
821
+ try {
822
+ writeFileSync(fd, text);
823
+ fsyncSync2(fd);
824
+ } finally {
825
+ closeSync2(fd);
826
+ }
827
+ if (m !== null && withMode)
828
+ chmodSync3(tmp, m);
829
+ if (expected !== void 0)
830
+ checkUnchanged(file, expected);
831
+ renameSync(tmp, file);
832
+ } catch (e) {
833
+ remove(tmp);
834
+ throw e;
835
+ }
836
+ try {
837
+ fsyncFolder(dirname(file));
838
+ } catch {
839
+ }
840
+ }
841
+ var ChangedMeanwhileError = class extends FileError {
842
+ constructor(file) {
843
+ super(t().err.changedMeanwhile(file));
844
+ this.name = "ChangedMeanwhileError";
845
+ }
846
+ };
847
+ function checkUnchanged(file, expected) {
848
+ if (readTextStrict(file) !== expected)
849
+ throw new ChangedMeanwhileError(file);
850
+ }
851
+
852
+ // ../../node_modules/specialist-context/dist/lib/core/controller/hook.js
853
+ var HOOK_COMMAND = "specialist-context suggest --hook";
854
+ var PORTABLE_HOOK_COMMAND = `node -e "require('child_process').spawnSync('${HOOK_COMMAND}',{shell:true,stdio:['inherit','inherit','ignore']})"`;
855
+
856
+ // ../../node_modules/specialist-context/dist/lib/core/node/controller/store-format.js
857
+ var KIND_FROM_DISK = new Map(Object.entries(KIND_SEGMENT).map(([kind, seg]) => [seg, kind]));
858
+
859
+ // ../../node_modules/specialist-context/dist/lib/core/node/controller/auto.js
860
+ var STALE_LOCK_MS = 2 * 6e4;
861
+
862
+ // ../../node_modules/specialist-context/dist/lib/core/node/controller/codex.js
863
+ var AGENTS_LIMIT = 32 * 1024;
864
+
865
+ // ../../apps/manager/src/agent/files.ts
866
+ var stripBom = (t2) => t2.replace(/^/, "");
867
+ function readJson2(file, fallback) {
868
+ try {
869
+ return JSON.parse(stripBom(readFileSync2(file, "utf8")));
870
+ } catch {
871
+ return fallback;
872
+ }
873
+ }
874
+ var withMode2 = process.platform !== "win32";
875
+ function writeText2(file, text, { mode, expected } = {}) {
876
+ writeText(file, text, { mode, expected });
877
+ }
878
+ function writeJson2(file, data, opts = {}) {
879
+ writeText2(file, JSON.stringify(data, null, 2) + "\n", opts);
880
+ }
881
+ var operationCopies = new AsyncLocalStorage();
882
+
883
+ // ../../apps/manager/src/agent/usage.ts
884
+ var CHUNK = 4 * 1024 * 1024;
885
+ var KEEP_DAYS = 400;
886
+ var dayOf = (iso) => {
887
+ const d = new Date(iso ?? "");
888
+ if (Number.isNaN(d.getTime())) return null;
889
+ return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
890
+ };
891
+ function toolKeys(content) {
892
+ const keys = [];
893
+ for (const c of content) {
894
+ if (!c || c.type !== "tool_use" || typeof c.name !== "string") continue;
895
+ if (c.name === "Skill" && c.input?.skill) keys.push("skill:" + String(c.input.skill).replace(/^\//, ""));
896
+ else if ((c.name === "Task" || c.name === "Agent") && c.input?.subagent_type) keys.push("agent:" + c.input.subagent_type);
897
+ else if (c.name.startsWith("mcp__")) {
898
+ const server = c.name.slice(5).split("__")[0] || "";
899
+ keys.push(server.startsWith("plugin_") ? "plugin:" + server.slice(7) : "mcp:" + server);
900
+ }
901
+ }
902
+ return keys;
903
+ }
904
+ function eventsFromLine(line) {
905
+ if (!line.includes('"tool_use"') && !line.includes("<command-name>")) return null;
906
+ let o;
907
+ try {
908
+ o = JSON.parse(line);
909
+ } catch {
910
+ return null;
911
+ }
912
+ const day = dayOf(o.timestamp);
913
+ if (!day) return null;
914
+ const content = o.message?.content;
915
+ let keys = [];
916
+ if (o.type === "assistant" && Array.isArray(content)) keys = toolKeys(content);
917
+ else if (o.type === "user") {
918
+ const text = typeof content === "string" ? content : Array.isArray(content) ? content.map((c) => typeof c === "string" ? c : c?.text || "").join(" ") : "";
919
+ const m = /<command-name>\/?([^<\s]+)<\/command-name>/.exec(text);
920
+ if (m) keys = ["cmd:" + m[1]];
921
+ }
922
+ if (!keys.length) return null;
923
+ return typeof o.cwd === "string" && o.cwd ? { day, keys, cwd: o.cwd } : { day, keys };
924
+ }
925
+ var HEAD = 256 * 1024;
926
+ function headCwd(path) {
927
+ let fd = null;
928
+ try {
929
+ fd = openSync3(path, "r");
930
+ const buf = Buffer.alloc(HEAD);
931
+ const n = readSync(fd, buf, 0, HEAD, 0);
932
+ const m = /"cwd"\s*:\s*("(?:[^"\\]|\\.)*")/.exec(buf.toString("utf8", 0, n));
933
+ const cwd = m ? JSON.parse(m[1]) : null;
934
+ return typeof cwd === "string" ? cwd : "";
935
+ } catch {
936
+ return "";
937
+ } finally {
938
+ if (fd !== null) closeSync3(fd);
939
+ }
940
+ }
941
+ function listTranscripts(dir, depth = 0, out = []) {
942
+ let items;
943
+ try {
944
+ items = readdirSync5(dir, { withFileTypes: true });
945
+ } catch {
946
+ return out;
947
+ }
948
+ for (const d of items) {
949
+ const full = join3(dir, d.name);
950
+ if (d.isDirectory() && depth < 4) listTranscripts(full, depth + 1, out);
951
+ else if (d.isFile() && d.name.endsWith(".jsonl")) out.push(full);
952
+ }
953
+ return out;
954
+ }
955
+ function readNew(path, rec, size) {
956
+ const fd = openSync3(path, "r");
957
+ const buf = Buffer.alloc(CHUNK);
958
+ let pos = rec.offset;
959
+ let rest = Buffer.alloc(0);
960
+ try {
961
+ while (pos < size) {
962
+ const n = readSync(fd, buf, 0, Math.min(CHUNK, size - pos), pos);
963
+ if (n <= 0) break;
964
+ pos += n;
965
+ const data = Buffer.concat([rest, buf.subarray(0, n)]);
966
+ const end = data.lastIndexOf(10);
967
+ rest = data.subarray(end + 1);
968
+ for (const line of end < 0 ? [] : data.toString("utf8", 0, end).split("\n")) {
969
+ const ev = eventsFromLine(line);
970
+ if (!ev) continue;
971
+ if (ev.cwd && !rec.cwd) rec.cwd = ev.cwd;
972
+ const d = rec.days[ev.day] ||= {};
973
+ for (const k of ev.keys) d[k] = (d[k] || 0) + 1;
974
+ }
975
+ }
976
+ } finally {
977
+ closeSync3(fd);
978
+ }
979
+ rec.offset = pos - rest.length;
980
+ }
981
+ var VERSION = 2;
982
+ function upgrade(data) {
983
+ if ((Number(data.versao) || 1) >= VERSION) return data;
984
+ for (const [path, rec] of Object.entries(data.files || {})) {
985
+ if (existsSync2(path)) {
986
+ data.files[path] = { offset: 0, days: {} };
987
+ continue;
988
+ }
989
+ for (const [day, keys] of Object.entries(rec.days || {})) {
990
+ for (const k of Object.keys(keys)) if (k.startsWith("plugin:") || k.startsWith("mcp:plugin_")) delete keys[k];
991
+ if (!Object.keys(keys).length) delete rec.days[day];
992
+ }
993
+ }
994
+ return { ...data, files: data.files || {}, versao: VERSION };
995
+ }
996
+ function createUsage(ctx2) {
997
+ let db = null;
998
+ const load = () => db ||= upgrade(readJson2(ctx2.usageFile, null) || { versao: VERSION, files: {} });
999
+ function refresh({ onProgress = () => {
1000
+ }, now = Date.now() } = {}) {
1001
+ const data = load();
1002
+ const files = listTranscripts(ctx2.projectsDir);
1003
+ let done = 0;
1004
+ for (const path of files) {
1005
+ let st;
1006
+ try {
1007
+ st = statSync4(path);
1008
+ } catch {
1009
+ continue;
1010
+ }
1011
+ let rec = data.files[path];
1012
+ if (!rec || st.size < rec.offset) rec = data.files[path] = { offset: 0, days: {} };
1013
+ if (st.size > rec.offset) {
1014
+ try {
1015
+ readNew(path, rec, st.size);
1016
+ } catch {
1017
+ }
1018
+ }
1019
+ if (rec.cwd === void 0 && callsAgent(rec)) rec.cwd = headCwd(path);
1020
+ rec.seen = now;
1021
+ onProgress({ done: ++done, total: files.length });
1022
+ }
1023
+ const cutoff = dayOf(now - KEEP_DAYS * 864e5) || "";
1024
+ for (const rec of Object.values(data.files)) for (const d of Object.keys(rec.days)) if (d < cutoff) delete rec.days[d];
1025
+ const seen = new Set(files);
1026
+ for (const [path, rec] of Object.entries(data.files)) if (!seen.has(path) && !Object.keys(rec.days).length) delete data.files[path];
1027
+ data.updatedAt = new Date(now).toISOString();
1028
+ try {
1029
+ writeJson2(ctx2.usageFile, data);
1030
+ } catch {
1031
+ }
1032
+ return data;
1033
+ }
1034
+ function totals(days = 30, now = Date.now()) {
1035
+ const data = load();
1036
+ const from = dayOf(now - (days - 1) * 864e5) || "";
1037
+ const count = {};
1038
+ const last2 = {};
1039
+ const perDay = {};
1040
+ for (const rec of Object.values(data.files)) {
1041
+ for (const [day, keys] of Object.entries(rec.days)) {
1042
+ for (const [k, n] of Object.entries(keys)) {
1043
+ if (!last2[k] || day > last2[k]) last2[k] = day;
1044
+ if (day < from) continue;
1045
+ count[k] = (count[k] || 0) + n;
1046
+ perDay[day] = (perDay[day] || 0) + n;
1047
+ }
1048
+ }
1049
+ }
1050
+ return { days, from, count, last: last2, perDay, updatedAt: data.updatedAt || null, files: Object.keys(data.files).length };
1051
+ }
1052
+ function agentFolders() {
1053
+ const out = {};
1054
+ for (const rec of Object.values(load().files)) {
1055
+ if (!rec.cwd) continue;
1056
+ for (const keys of Object.values(rec.days)) for (const k of Object.keys(keys)) if (k.startsWith("agent:")) (out[k.slice(6)] ||= /* @__PURE__ */ new Set()).add(rec.cwd);
1057
+ }
1058
+ return Object.fromEntries(Object.entries(out).map(([k, v]) => [k, [...v]]));
1059
+ }
1060
+ return { refresh, totals, agentFolders };
1061
+ }
1062
+ var callsAgent = (rec) => Object.values(rec.days).some((keys) => Object.keys(keys).some((k) => k.startsWith("agent:")));
1063
+
1064
+ // ../../apps/manager/src/agent/workers/usage-worker.ts
1065
+ var { ctx, windows = [7, 30, 90] } = workerData;
1066
+ var usage = createUsage(ctx);
1067
+ var last = 0;
1068
+ usage.refresh({
1069
+ onProgress: ({ done, total }) => {
1070
+ const now = Date.now();
1071
+ if (now - last > 250 || done === total) {
1072
+ last = now;
1073
+ parentPort?.postMessage({ type: "progress", done, total });
1074
+ }
1075
+ }
1076
+ });
1077
+ parentPort?.postMessage({ type: "done", totals: Object.fromEntries(windows.map((d) => [d, usage.totals(d)])), agentFolders: usage.agentFolders() });