theus-cli 0.2.83 → 0.2.84

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 (738) hide show
  1. package/README.md +5 -3
  2. package/bin/theus.js +101 -0
  3. package/package.json +14 -121
  4. package/assets/brand-official/v1.0/logo/theus-lockup-negative-official.png +0 -0
  5. package/assets/brand-official/v1.0/logo/theus-lockup-primary-dark-official.png +0 -0
  6. package/assets/fonts/satoshi/satoshi-300.woff2 +0 -0
  7. package/assets/fonts/satoshi/satoshi-400.woff2 +0 -0
  8. package/assets/fonts/satoshi/satoshi-500.woff2 +0 -0
  9. package/assets/fonts/satoshi/satoshi-700.woff2 +0 -0
  10. package/assets/fonts/satoshi/satoshi-900.woff2 +0 -0
  11. package/bin/theus +0 -30
  12. package/cli.js +0 -508227
  13. package/vendor/theus-arsenal/.arsenal-nombres-ola2.json +0 -6
  14. package/vendor/theus-arsenal/.arsenal-nombres-ola3.json +0 -72
  15. package/vendor/theus-arsenal/.mailmap +0 -2
  16. package/vendor/theus-arsenal/.theus-plugin/marketplace.json +0 -25
  17. package/vendor/theus-arsenal/.theus-plugin/plugin.json +0 -20
  18. package/vendor/theus-arsenal/AUTHORS.md +0 -8
  19. package/vendor/theus-arsenal/CLEANROOM_REPLACEMENT_PLAN.md +0 -11
  20. package/vendor/theus-arsenal/LICENSE +0 -26
  21. package/vendor/theus-arsenal/PROVENANCE.md +0 -9
  22. package/vendor/theus-arsenal/README.md +0 -41
  23. package/vendor/theus-arsenal/THIRD_PARTY.md +0 -80
  24. package/vendor/theus-arsenal/agents/actualizador-docs.md +0 -123
  25. package/vendor/theus-arsenal/agents/analista-comentarios.md +0 -53
  26. package/vendor/theus-arsenal/agents/analista-conversaciones.md +0 -60
  27. package/vendor/theus-arsenal/agents/analista-tests-pr.md +0 -53
  28. package/vendor/theus-arsenal/agents/analista-tipos.md +0 -49
  29. package/vendor/theus-arsenal/agents/arquitecto-accesibilidad.md +0 -148
  30. package/vendor/theus-arsenal/agents/arquitecto-codigo.md +0 -79
  31. package/vendor/theus-arsenal/agents/arquitecto-homelab.md +0 -90
  32. package/vendor/theus-arsenal/agents/arquitecto-redes.md +0 -116
  33. package/vendor/theus-arsenal/agents/arquitecto-sistemas.md +0 -219
  34. package/vendor/theus-arsenal/agents/bifurcador-opensource.md +0 -206
  35. package/vendor/theus-arsenal/agents/cazador-fallos-silenciosos.md +0 -58
  36. package/vendor/theus-arsenal/agents/consultor-documentacion.md +0 -76
  37. package/vendor/theus-arsenal/agents/diagnosticador-redes.md +0 -135
  38. package/vendor/theus-arsenal/agents/ejecutor-e2e.md +0 -96
  39. package/vendor/theus-arsenal/agents/empaquetador-opensource.md +0 -257
  40. package/vendor/theus-arsenal/agents/escaner-secretos.md +0 -196
  41. package/vendor/theus-arsenal/agents/especialista-seo.md +0 -70
  42. package/vendor/theus-arsenal/agents/estratega-marketing.md +0 -158
  43. package/vendor/theus-arsenal/agents/evaluador-agentes.md +0 -214
  44. package/vendor/theus-arsenal/agents/evaluador-harness.md +0 -217
  45. package/vendor/theus-arsenal/agents/explorador-codigo.md +0 -79
  46. package/vendor/theus-arsenal/agents/extractor-specs.md +0 -214
  47. package/vendor/theus-arsenal/agents/generador-harness.md +0 -139
  48. package/vendor/theus-arsenal/agents/guia-tdd.md +0 -99
  49. package/vendor/theus-arsenal/agents/jefe-de-gabinete.md +0 -162
  50. package/vendor/theus-arsenal/agents/limpiador-refactors.md +0 -93
  51. package/vendor/theus-arsenal/agents/optimizador-rendimiento.md +0 -454
  52. package/vendor/theus-arsenal/agents/planificador-harness.md +0 -107
  53. package/vendor/theus-arsenal/agents/planificador.md +0 -221
  54. package/vendor/theus-arsenal/agents/resolutor-apps-harmonyos.md +0 -181
  55. package/vendor/theus-arsenal/agents/resolutor-builds-cpp.md +0 -98
  56. package/vendor/theus-arsenal/agents/resolutor-builds-dart.md +0 -209
  57. package/vendor/theus-arsenal/agents/resolutor-builds-django.md +0 -253
  58. package/vendor/theus-arsenal/agents/resolutor-builds-go.md +0 -102
  59. package/vendor/theus-arsenal/agents/resolutor-builds-java.md +0 -274
  60. package/vendor/theus-arsenal/agents/resolutor-builds-kotlin.md +0 -128
  61. package/vendor/theus-arsenal/agents/resolutor-builds-pytorch.md +0 -128
  62. package/vendor/theus-arsenal/agents/resolutor-builds-react.md +0 -214
  63. package/vendor/theus-arsenal/agents/resolutor-builds-rust.md +0 -156
  64. package/vendor/theus-arsenal/agents/resolutor-builds-swift.md +0 -169
  65. package/vendor/theus-arsenal/agents/resolutor-builds.md +0 -122
  66. package/vendor/theus-arsenal/agents/revisor-bd.md +0 -97
  67. package/vendor/theus-arsenal/agents/revisor-codigo.md +0 -291
  68. package/vendor/theus-arsenal/agents/revisor-config-red.md +0 -116
  69. package/vendor/theus-arsenal/agents/revisor-cpp.md +0 -80
  70. package/vendor/theus-arsenal/agents/revisor-csharp.md +0 -109
  71. package/vendor/theus-arsenal/agents/revisor-django.md +0 -168
  72. package/vendor/theus-arsenal/agents/revisor-fastapi.md +0 -82
  73. package/vendor/theus-arsenal/agents/revisor-flutter.md +0 -251
  74. package/vendor/theus-arsenal/agents/revisor-go.md +0 -84
  75. package/vendor/theus-arsenal/agents/revisor-java.md +0 -192
  76. package/vendor/theus-arsenal/agents/revisor-kotlin.md +0 -171
  77. package/vendor/theus-arsenal/agents/revisor-ml.md +0 -159
  78. package/vendor/theus-arsenal/agents/revisor-php.md +0 -108
  79. package/vendor/theus-arsenal/agents/revisor-python.md +0 -106
  80. package/vendor/theus-arsenal/agents/revisor-react.md +0 -166
  81. package/vendor/theus-arsenal/agents/revisor-rust.md +0 -102
  82. package/vendor/theus-arsenal/agents/revisor-seguridad.md +0 -116
  83. package/vendor/theus-arsenal/agents/revisor-software-clinico.md +0 -95
  84. package/vendor/theus-arsenal/agents/revisor-swift.md +0 -115
  85. package/vendor/theus-arsenal/agents/revisor-typescript.md +0 -123
  86. package/vendor/theus-arsenal/agents/revisor-vue.md +0 -205
  87. package/vendor/theus-arsenal/agents/simplificador-codigo.md +0 -55
  88. package/vendor/theus-arsenal/commands/actualizar-docs.md +0 -88
  89. package/vendor/theus-arsenal/commands/actualizar-mapas-codigo.md +0 -78
  90. package/vendor/theus-arsenal/commands/aprender-evaluar.md +0 -109
  91. package/vendor/theus-arsenal/commands/aprender.md +0 -74
  92. package/vendor/theus-arsenal/commands/arreglar-build.md +0 -66
  93. package/vendor/theus-arsenal/commands/bucle-multiperspectiva.md +0 -153
  94. package/vendor/theus-arsenal/commands/build-cpp.md +0 -173
  95. package/vendor/theus-arsenal/commands/build-flutter.md +0 -164
  96. package/vendor/theus-arsenal/commands/build-go.md +0 -183
  97. package/vendor/theus-arsenal/commands/build-gradle.md +0 -75
  98. package/vendor/theus-arsenal/commands/build-kotlin.md +0 -176
  99. package/vendor/theus-arsenal/commands/build-react.md +0 -187
  100. package/vendor/theus-arsenal/commands/build-rust.md +0 -187
  101. package/vendor/theus-arsenal/commands/campana-marketing.md +0 -125
  102. package/vendor/theus-arsenal/commands/checkpoint.md +0 -78
  103. package/vendor/theus-arsenal/commands/cobertura-tests.md +0 -73
  104. package/vendor/theus-arsenal/commands/configurar-gestor-paquetes.md +0 -86
  105. package/vendor/theus-arsenal/commands/consulta.md +0 -164
  106. package/vendor/theus-arsenal/commands/control-calidad.md +0 -50
  107. package/vendor/theus-arsenal/commands/crear-skill.md +0 -77
  108. package/vendor/theus-arsenal/commands/enrutar-modelo.md +0 -30
  109. package/vendor/theus-arsenal/commands/epica-desbloquear.md +0 -17
  110. package/vendor/theus-arsenal/commands/epica-descomponer.md +0 -22
  111. package/vendor/theus-arsenal/commands/epica-publicar.md +0 -21
  112. package/vendor/theus-arsenal/commands/epica-reclamar.md +0 -25
  113. package/vendor/theus-arsenal/commands/epica-revisar.md +0 -22
  114. package/vendor/theus-arsenal/commands/epica-sincronizar.md +0 -21
  115. package/vendor/theus-arsenal/commands/epica-validar.md +0 -21
  116. package/vendor/theus-arsenal/commands/evolucionar.md +0 -176
  117. package/vendor/theus-arsenal/commands/funcionalidad.md +0 -49
  118. package/vendor/theus-arsenal/commands/guardar-sesion.md +0 -278
  119. package/vendor/theus-arsenal/commands/harness-build.md +0 -111
  120. package/vendor/theus-arsenal/commands/harness-diseno.md +0 -46
  121. package/vendor/theus-arsenal/commands/informe-costos.md +0 -90
  122. package/vendor/theus-arsenal/commands/iniciar-bucle.md +0 -36
  123. package/vendor/theus-arsenal/commands/instintos-estado.md +0 -53
  124. package/vendor/theus-arsenal/commands/instintos-exportar.md +0 -69
  125. package/vendor/theus-arsenal/commands/instintos-importar.md +0 -120
  126. package/vendor/theus-arsenal/commands/lienzo-planes.md +0 -48
  127. package/vendor/theus-arsenal/commands/limpiar-refactor.md +0 -84
  128. package/vendor/theus-arsenal/commands/modo-seguro.md +0 -96
  129. package/vendor/theus-arsenal/commands/orq-agregar-funcionalidad.md +0 -36
  130. package/vendor/theus-arsenal/commands/orq-cambiar-funcionalidad.md +0 -38
  131. package/vendor/theus-arsenal/commands/orq-construir-mvp.md +0 -36
  132. package/vendor/theus-arsenal/commands/orq-corregir-defecto.md +0 -40
  133. package/vendor/theus-arsenal/commands/orq-refinar-codigo.md +0 -44
  134. package/vendor/theus-arsenal/commands/orq-revisar.md +0 -135
  135. package/vendor/theus-arsenal/commands/plan-prd.md +0 -160
  136. package/vendor/theus-arsenal/commands/plan.md +0 -198
  137. package/vendor/theus-arsenal/commands/podar.md +0 -31
  138. package/vendor/theus-arsenal/commands/pr.md +0 -181
  139. package/vendor/theus-arsenal/commands/promover.md +0 -41
  140. package/vendor/theus-arsenal/commands/proyectos.md +0 -33
  141. package/vendor/theus-arsenal/commands/prp-commit.md +0 -112
  142. package/vendor/theus-arsenal/commands/prp-implementar.md +0 -385
  143. package/vendor/theus-arsenal/commands/prp-planificar.md +0 -501
  144. package/vendor/theus-arsenal/commands/reanudar-sesion.md +0 -160
  145. package/vendor/theus-arsenal/commands/revisar-codigo.md +0 -289
  146. package/vendor/theus-arsenal/commands/revisar-cpp.md +0 -132
  147. package/vendor/theus-arsenal/commands/revisar-fastapi.md +0 -39
  148. package/vendor/theus-arsenal/commands/revisar-flutter.md +0 -115
  149. package/vendor/theus-arsenal/commands/revisar-go.md +0 -148
  150. package/vendor/theus-arsenal/commands/revisar-kotlin.md +0 -140
  151. package/vendor/theus-arsenal/commands/revisar-pr.md +0 -37
  152. package/vendor/theus-arsenal/commands/revisar-python.md +0 -297
  153. package/vendor/theus-arsenal/commands/revisar-react.md +0 -170
  154. package/vendor/theus-arsenal/commands/revisar-rust.md +0 -142
  155. package/vendor/theus-arsenal/commands/revisar-vue.md +0 -174
  156. package/vendor/theus-arsenal/commands/salud-skills.md +0 -52
  157. package/vendor/theus-arsenal/commands/sesiones.md +0 -345
  158. package/vendor/theus-arsenal/commands/test-cpp.md +0 -252
  159. package/vendor/theus-arsenal/commands/test-flutter.md +0 -143
  160. package/vendor/theus-arsenal/commands/test-go.md +0 -268
  161. package/vendor/theus-arsenal/commands/test-kotlin.md +0 -312
  162. package/vendor/theus-arsenal/commands/test-react.md +0 -265
  163. package/vendor/theus-arsenal/commands/test-rust.md +0 -309
  164. package/vendor/theus-arsenal/commands/vigilancia-canary.md +0 -43
  165. package/vendor/theus-arsenal/hooks/hooks.json +0 -274
  166. package/vendor/theus-arsenal/package.json +0 -6
  167. package/vendor/theus-arsenal/rules/angular/coding-style.md +0 -182
  168. package/vendor/theus-arsenal/rules/angular/hooks.md +0 -25
  169. package/vendor/theus-arsenal/rules/angular/patterns.md +0 -249
  170. package/vendor/theus-arsenal/rules/angular/security.md +0 -87
  171. package/vendor/theus-arsenal/rules/angular/testing.md +0 -164
  172. package/vendor/theus-arsenal/rules/arkts/coding-style.md +0 -153
  173. package/vendor/theus-arsenal/rules/arkts/hooks.md +0 -80
  174. package/vendor/theus-arsenal/rules/arkts/patterns.md +0 -236
  175. package/vendor/theus-arsenal/rules/arkts/security.md +0 -141
  176. package/vendor/theus-arsenal/rules/arkts/testing.md +0 -126
  177. package/vendor/theus-arsenal/rules/common/agents.md +0 -49
  178. package/vendor/theus-arsenal/rules/common/code-review.md +0 -123
  179. package/vendor/theus-arsenal/rules/common/coding-style.md +0 -90
  180. package/vendor/theus-arsenal/rules/common/development-workflow.md +0 -44
  181. package/vendor/theus-arsenal/rules/common/git-workflow.md +0 -24
  182. package/vendor/theus-arsenal/rules/common/hooks.md +0 -32
  183. package/vendor/theus-arsenal/rules/common/patterns.md +0 -31
  184. package/vendor/theus-arsenal/rules/common/performance.md +0 -53
  185. package/vendor/theus-arsenal/rules/common/security.md +0 -29
  186. package/vendor/theus-arsenal/rules/common/testing.md +0 -57
  187. package/vendor/theus-arsenal/rules/cpp/coding-style.md +0 -44
  188. package/vendor/theus-arsenal/rules/cpp/hooks.md +0 -39
  189. package/vendor/theus-arsenal/rules/cpp/patterns.md +0 -51
  190. package/vendor/theus-arsenal/rules/cpp/security.md +0 -51
  191. package/vendor/theus-arsenal/rules/cpp/testing.md +0 -44
  192. package/vendor/theus-arsenal/rules/csharp/coding-style.md +0 -72
  193. package/vendor/theus-arsenal/rules/csharp/hooks.md +0 -25
  194. package/vendor/theus-arsenal/rules/csharp/patterns.md +0 -50
  195. package/vendor/theus-arsenal/rules/csharp/security.md +0 -58
  196. package/vendor/theus-arsenal/rules/csharp/testing.md +0 -50
  197. package/vendor/theus-arsenal/rules/dart/coding-style.md +0 -159
  198. package/vendor/theus-arsenal/rules/dart/hooks.md +0 -68
  199. package/vendor/theus-arsenal/rules/dart/patterns.md +0 -261
  200. package/vendor/theus-arsenal/rules/dart/security.md +0 -135
  201. package/vendor/theus-arsenal/rules/dart/testing.md +0 -215
  202. package/vendor/theus-arsenal/rules/fsharp/coding-style.md +0 -112
  203. package/vendor/theus-arsenal/rules/fsharp/hooks.md +0 -26
  204. package/vendor/theus-arsenal/rules/fsharp/patterns.md +0 -111
  205. package/vendor/theus-arsenal/rules/fsharp/security.md +0 -76
  206. package/vendor/theus-arsenal/rules/fsharp/testing.md +0 -62
  207. package/vendor/theus-arsenal/rules/golang/coding-style.md +0 -32
  208. package/vendor/theus-arsenal/rules/golang/hooks.md +0 -17
  209. package/vendor/theus-arsenal/rules/golang/patterns.md +0 -45
  210. package/vendor/theus-arsenal/rules/golang/security.md +0 -34
  211. package/vendor/theus-arsenal/rules/golang/testing.md +0 -31
  212. package/vendor/theus-arsenal/rules/java/coding-style.md +0 -114
  213. package/vendor/theus-arsenal/rules/java/hooks.md +0 -18
  214. package/vendor/theus-arsenal/rules/java/patterns.md +0 -147
  215. package/vendor/theus-arsenal/rules/java/security.md +0 -101
  216. package/vendor/theus-arsenal/rules/java/testing.md +0 -133
  217. package/vendor/theus-arsenal/rules/kotlin/coding-style.md +0 -86
  218. package/vendor/theus-arsenal/rules/kotlin/hooks.md +0 -17
  219. package/vendor/theus-arsenal/rules/kotlin/patterns.md +0 -146
  220. package/vendor/theus-arsenal/rules/kotlin/security.md +0 -82
  221. package/vendor/theus-arsenal/rules/kotlin/testing.md +0 -128
  222. package/vendor/theus-arsenal/rules/nuxt/coding-style.md +0 -47
  223. package/vendor/theus-arsenal/rules/nuxt/hooks.md +0 -39
  224. package/vendor/theus-arsenal/rules/nuxt/patterns.md +0 -54
  225. package/vendor/theus-arsenal/rules/nuxt/security.md +0 -48
  226. package/vendor/theus-arsenal/rules/nuxt/testing.md +0 -49
  227. package/vendor/theus-arsenal/rules/php/coding-style.md +0 -40
  228. package/vendor/theus-arsenal/rules/php/hooks.md +0 -24
  229. package/vendor/theus-arsenal/rules/php/patterns.md +0 -33
  230. package/vendor/theus-arsenal/rules/php/security.md +0 -37
  231. package/vendor/theus-arsenal/rules/php/testing.md +0 -38
  232. package/vendor/theus-arsenal/rules/python/coding-style.md +0 -42
  233. package/vendor/theus-arsenal/rules/python/fastapi.md +0 -58
  234. package/vendor/theus-arsenal/rules/python/hooks.md +0 -19
  235. package/vendor/theus-arsenal/rules/python/patterns.md +0 -39
  236. package/vendor/theus-arsenal/rules/python/security.md +0 -30
  237. package/vendor/theus-arsenal/rules/python/testing.md +0 -38
  238. package/vendor/theus-arsenal/rules/react/coding-style.md +0 -109
  239. package/vendor/theus-arsenal/rules/react/hooks.md +0 -187
  240. package/vendor/theus-arsenal/rules/react/patterns.md +0 -194
  241. package/vendor/theus-arsenal/rules/react/security.md +0 -180
  242. package/vendor/theus-arsenal/rules/react/testing.md +0 -208
  243. package/vendor/theus-arsenal/rules/react-native/accessibility.md +0 -55
  244. package/vendor/theus-arsenal/rules/react-native/coding-style.md +0 -71
  245. package/vendor/theus-arsenal/rules/react-native/hooks.md +0 -28
  246. package/vendor/theus-arsenal/rules/react-native/patterns.md +0 -88
  247. package/vendor/theus-arsenal/rules/react-native/performance.md +0 -45
  248. package/vendor/theus-arsenal/rules/react-native/production-readiness.md +0 -51
  249. package/vendor/theus-arsenal/rules/react-native/security.md +0 -43
  250. package/vendor/theus-arsenal/rules/react-native/testing.md +0 -52
  251. package/vendor/theus-arsenal/rules/ruby/coding-style.md +0 -46
  252. package/vendor/theus-arsenal/rules/ruby/hooks.md +0 -37
  253. package/vendor/theus-arsenal/rules/ruby/patterns.md +0 -44
  254. package/vendor/theus-arsenal/rules/ruby/security.md +0 -51
  255. package/vendor/theus-arsenal/rules/ruby/testing.md +0 -51
  256. package/vendor/theus-arsenal/rules/rust/coding-style.md +0 -151
  257. package/vendor/theus-arsenal/rules/rust/hooks.md +0 -16
  258. package/vendor/theus-arsenal/rules/rust/patterns.md +0 -168
  259. package/vendor/theus-arsenal/rules/rust/security.md +0 -141
  260. package/vendor/theus-arsenal/rules/rust/testing.md +0 -154
  261. package/vendor/theus-arsenal/rules/swift/coding-style.md +0 -47
  262. package/vendor/theus-arsenal/rules/swift/hooks.md +0 -20
  263. package/vendor/theus-arsenal/rules/swift/patterns.md +0 -66
  264. package/vendor/theus-arsenal/rules/swift/security.md +0 -33
  265. package/vendor/theus-arsenal/rules/swift/testing.md +0 -45
  266. package/vendor/theus-arsenal/rules/typescript/coding-style.md +0 -199
  267. package/vendor/theus-arsenal/rules/typescript/hooks.md +0 -22
  268. package/vendor/theus-arsenal/rules/typescript/patterns.md +0 -52
  269. package/vendor/theus-arsenal/rules/typescript/security.md +0 -28
  270. package/vendor/theus-arsenal/rules/typescript/testing.md +0 -18
  271. package/vendor/theus-arsenal/rules/vue/coding-style.md +0 -54
  272. package/vendor/theus-arsenal/rules/vue/hooks.md +0 -45
  273. package/vendor/theus-arsenal/rules/vue/patterns.md +0 -56
  274. package/vendor/theus-arsenal/rules/vue/security.md +0 -46
  275. package/vendor/theus-arsenal/rules/vue/testing.md +0 -53
  276. package/vendor/theus-arsenal/rules/web/coding-style.md +0 -108
  277. package/vendor/theus-arsenal/rules/web/design-quality.md +0 -75
  278. package/vendor/theus-arsenal/rules/web/hooks.md +0 -141
  279. package/vendor/theus-arsenal/rules/web/patterns.md +0 -91
  280. package/vendor/theus-arsenal/rules/web/performance.md +0 -76
  281. package/vendor/theus-arsenal/rules/web/security.md +0 -69
  282. package/vendor/theus-arsenal/rules/web/testing.md +0 -67
  283. package/vendor/theus-arsenal/scripts/hooks/bash-hook-dispatcher.js +0 -192
  284. package/vendor/theus-arsenal/scripts/hooks/block-no-verify.js +0 -556
  285. package/vendor/theus-arsenal/scripts/hooks/check-console-log.js +0 -92
  286. package/vendor/theus-arsenal/scripts/hooks/check-hook-enabled.js +0 -16
  287. package/vendor/theus-arsenal/scripts/hooks/config-protection.js +0 -171
  288. package/vendor/theus-arsenal/scripts/hooks/design-quality-check.js +0 -132
  289. package/vendor/theus-arsenal/scripts/hooks/doc-file-warning.js +0 -110
  290. package/vendor/theus-arsenal/scripts/hooks/modo-seguro.js +0 -158
  291. package/vendor/theus-arsenal/scripts/hooks/notificacion-escritorio.js +0 -208
  292. package/vendor/theus-arsenal/scripts/hooks/plugin-hook-bootstrap.js +0 -280
  293. package/vendor/theus-arsenal/scripts/hooks/post-bash-command-log.js +0 -87
  294. package/vendor/theus-arsenal/scripts/hooks/post-bash-dispatcher.js +0 -24
  295. package/vendor/theus-arsenal/scripts/hooks/post-bash-pr-created.js +0 -60
  296. package/vendor/theus-arsenal/scripts/hooks/post-edit-accumulator.js +0 -94
  297. package/vendor/theus-arsenal/scripts/hooks/post-edit-console-warn.js +0 -54
  298. package/vendor/theus-arsenal/scripts/hooks/post-edit-format.js +0 -110
  299. package/vendor/theus-arsenal/scripts/hooks/post-edit-typecheck.js +0 -98
  300. package/vendor/theus-arsenal/scripts/hooks/pre-bash-commit-quality.js +0 -447
  301. package/vendor/theus-arsenal/scripts/hooks/pre-bash-dev-server-block.js +0 -232
  302. package/vendor/theus-arsenal/scripts/hooks/pre-bash-dispatcher.js +0 -27
  303. package/vendor/theus-arsenal/scripts/hooks/pre-compact.js +0 -101
  304. package/vendor/theus-arsenal/scripts/hooks/pretooluse-visible-output.js +0 -49
  305. package/vendor/theus-arsenal/scripts/hooks/quality-gate.js +0 -168
  306. package/vendor/theus-arsenal/scripts/hooks/run-with-flags.js +0 -271
  307. package/vendor/theus-arsenal/scripts/hooks/salud-mcp.js +0 -749
  308. package/vendor/theus-arsenal/scripts/hooks/seguimiento-costos.js +0 -161
  309. package/vendor/theus-arsenal/scripts/hooks/session-end.js +0 -340
  310. package/vendor/theus-arsenal/scripts/hooks/session-start.js +0 -906
  311. package/vendor/theus-arsenal/scripts/hooks/stop-format-typecheck.js +0 -263
  312. package/vendor/theus-arsenal/scripts/hooks/suggest-compact.js +0 -286
  313. package/vendor/theus-arsenal/scripts/hooks/theus-context-monitor.js +0 -289
  314. package/vendor/theus-arsenal/scripts/hooks/verificacion-factual.js +0 -1278
  315. package/vendor/theus-arsenal/scripts/lib/agent-data-home.js +0 -96
  316. package/vendor/theus-arsenal/scripts/lib/cost-estimate.js +0 -66
  317. package/vendor/theus-arsenal/scripts/lib/hook-flags.js +0 -79
  318. package/vendor/theus-arsenal/scripts/lib/llm-summary.js +0 -185
  319. package/vendor/theus-arsenal/scripts/lib/loopback-guard.js +0 -54
  320. package/vendor/theus-arsenal/scripts/lib/observer-sessions.js +0 -237
  321. package/vendor/theus-arsenal/scripts/lib/package-manager.d.ts +0 -120
  322. package/vendor/theus-arsenal/scripts/lib/package-manager.js +0 -434
  323. package/vendor/theus-arsenal/scripts/lib/path-safety.js +0 -86
  324. package/vendor/theus-arsenal/scripts/lib/plan-canvas/markdown.js +0 -285
  325. package/vendor/theus-arsenal/scripts/lib/plan-canvas/sdk.js +0 -238
  326. package/vendor/theus-arsenal/scripts/lib/plan-canvas/server.js +0 -534
  327. package/vendor/theus-arsenal/scripts/lib/plan-canvas/sessions.js +0 -274
  328. package/vendor/theus-arsenal/scripts/lib/plan-canvas/ui.js +0 -546
  329. package/vendor/theus-arsenal/scripts/lib/project-detect.js +0 -451
  330. package/vendor/theus-arsenal/scripts/lib/resolve-formatter.js +0 -193
  331. package/vendor/theus-arsenal/scripts/lib/resolve-theus-root.js +0 -101
  332. package/vendor/theus-arsenal/scripts/lib/session-aliases.d.ts +0 -138
  333. package/vendor/theus-arsenal/scripts/lib/session-aliases.js +0 -483
  334. package/vendor/theus-arsenal/scripts/lib/session-bridge.js +0 -155
  335. package/vendor/theus-arsenal/scripts/lib/session-manager.d.ts +0 -137
  336. package/vendor/theus-arsenal/scripts/lib/session-manager.js +0 -555
  337. package/vendor/theus-arsenal/scripts/lib/shell-split.js +0 -86
  338. package/vendor/theus-arsenal/scripts/lib/shell-substitution.js +0 -501
  339. package/vendor/theus-arsenal/scripts/lib/skill-evolution/dashboard.js +0 -414
  340. package/vendor/theus-arsenal/scripts/lib/skill-evolution/health.js +0 -285
  341. package/vendor/theus-arsenal/scripts/lib/skill-evolution/index.js +0 -22
  342. package/vendor/theus-arsenal/scripts/lib/skill-evolution/provenance.js +0 -200
  343. package/vendor/theus-arsenal/scripts/lib/skill-evolution/tracker.js +0 -157
  344. package/vendor/theus-arsenal/scripts/lib/skill-evolution/versioning.js +0 -246
  345. package/vendor/theus-arsenal/scripts/lib/transcript-context.js +0 -232
  346. package/vendor/theus-arsenal/scripts/lib/utils.d.ts +0 -205
  347. package/vendor/theus-arsenal/scripts/lib/utils.js +0 -658
  348. package/vendor/theus-arsenal/scripts/plan-canvas.js +0 -341
  349. package/vendor/theus-arsenal/scripts/setup-package-manager.js +0 -46
  350. package/vendor/theus-arsenal/scripts/skills-health.js +0 -143
  351. package/vendor/theus-arsenal/skills/a11y-frontend/SKILL.md +0 -444
  352. package/vendor/theus-arsenal/skills/accesibilidad/SKILL.md +0 -144
  353. package/vendor/theus-arsenal/skills/acelerador-throughput-datos/SKILL.md +0 -72
  354. package/vendor/theus-arsenal/skills/agente-scraper-datos/SKILL.md +0 -771
  355. package/vendor/theus-arsenal/skills/analisis-plataformas-competencia/SKILL.md +0 -137
  356. package/vendor/theus-arsenal/skills/api-x/SKILL.md +0 -233
  357. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/SKILL.md +0 -335
  358. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/observer-loop.sh +0 -374
  359. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/observer.md +0 -188
  360. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/session-guardian.sh +0 -153
  361. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/start-observer.sh +0 -253
  362. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/config.json +0 -8
  363. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/hooks/observe.sh +0 -594
  364. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/detect-project.sh +0 -325
  365. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/instinct-cli.py +0 -1918
  366. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/lib/arsenal-dir.sh +0 -23
  367. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/test_parse_instinct.py +0 -1420
  368. package/vendor/theus-arsenal/skills/arquitectura-hexagonal/SKILL.md +0 -275
  369. package/vendor/theus-arsenal/skills/arquitectura-limpia-android/SKILL.md +0 -340
  370. package/vendor/theus-arsenal/skills/arquitectura-pipelines-recomendacion/SKILL.md +0 -112
  371. package/vendor/theus-arsenal/skills/atlas-datos-prediccion/SKILL.md +0 -53
  372. package/vendor/theus-arsenal/skills/auditoria-arquitectura-agentes/SKILL.md +0 -257
  373. package/vendor/theus-arsenal/skills/auditoria-produccion/SKILL.md +0 -180
  374. package/vendor/theus-arsenal/skills/auditoria-rutas-clic/SKILL.md +0 -243
  375. package/vendor/theus-arsenal/skills/autoevaluacion-agente/SKILL.md +0 -180
  376. package/vendor/theus-arsenal/skills/autoevaluacion-agente/examples/high-score-example.md +0 -89
  377. package/vendor/theus-arsenal/skills/autoevaluacion-agente/examples/low-score-example.md +0 -87
  378. package/vendor/theus-arsenal/skills/autoevaluacion-agente/references/evaluation-criteria.md +0 -71
  379. package/vendor/theus-arsenal/skills/autoevaluacion-agente/references/hook-integration.md +0 -90
  380. package/vendor/theus-arsenal/skills/autoevaluacion-agente/scripts/evaluate.py +0 -409
  381. package/vendor/theus-arsenal/skills/autoevaluacion-agente/templates/evaluation-report.md +0 -86
  382. package/vendor/theus-arsenal/skills/automatizacion-ssh-netmiko/SKILL.md +0 -176
  383. package/vendor/theus-arsenal/skills/base-datos-pubmed/SKILL.md +0 -174
  384. package/vendor/theus-arsenal/skills/base-datos-uspto/SKILL.md +0 -173
  385. package/vendor/theus-arsenal/skills/benchmark/SKILL.md +0 -92
  386. package/vendor/theus-arsenal/skills/bitacora-crecimiento/SKILL.md +0 -120
  387. package/vendor/theus-arsenal/skills/bucle-verificacion/SKILL.md +0 -125
  388. package/vendor/theus-arsenal/skills/buscar-primero/SKILL.md +0 -184
  389. package/vendor/theus-arsenal/skills/busqueda-exa/SKILL.md +0 -111
  390. package/vendor/theus-arsenal/skills/cache-por-hash/SKILL.md +0 -160
  391. package/vendor/theus-arsenal/skills/campana-marketing/SKILL.md +0 -118
  392. package/vendor/theus-arsenal/skills/capacidad-producto/SKILL.md +0 -138
  393. package/vendor/theus-arsenal/skills/cazador-vulnerabilidades/SKILL.md +0 -104
  394. package/vendor/theus-arsenal/skills/compactacion-estrategica/SKILL.md +0 -115
  395. package/vendor/theus-arsenal/skills/comparador-baskets-prediccion/SKILL.md +0 -69
  396. package/vendor/theus-arsenal/skills/compras-energia/SKILL.md +0 -206
  397. package/vendor/theus-arsenal/skills/concurrencia-swift-6-2/SKILL.md +0 -224
  398. package/vendor/theus-arsenal/skills/consejo/SKILL.md +0 -201
  399. package/vendor/theus-arsenal/skills/construccion-harness-agentes/SKILL.md +0 -78
  400. package/vendor/theus-arsenal/skills/constructor-conectores/SKILL.md +0 -119
  401. package/vendor/theus-arsenal/skills/constructor-equipos/SKILL.md +0 -169
  402. package/vendor/theus-arsenal/skills/consulta-documentacion/SKILL.md +0 -92
  403. package/vendor/theus-arsenal/skills/consultas-genomicas-gget/SKILL.md +0 -170
  404. package/vendor/theus-arsenal/skills/contacto-inversores/SKILL.md +0 -95
  405. package/vendor/theus-arsenal/skills/corrutinas-flows-kotlin/SKILL.md +0 -284
  406. package/vendor/theus-arsenal/skills/creacion-video-remotion/SKILL.md +0 -46
  407. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/3d.md +0 -86
  408. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/animations.md +0 -29
  409. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets/charts-bar-chart.tsx +0 -173
  410. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets/text-animations-typewriter.tsx +0 -100
  411. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets/text-animations-word-highlight.tsx +0 -108
  412. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets.md +0 -78
  413. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/audio.md +0 -172
  414. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/calculate-metadata.md +0 -104
  415. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/can-decode.md +0 -75
  416. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/charts.md +0 -58
  417. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/compositions.md +0 -146
  418. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/display-captions.md +0 -126
  419. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/extract-frames.md +0 -229
  420. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/fonts.md +0 -152
  421. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/get-audio-duration.md +0 -58
  422. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/get-video-dimensions.md +0 -68
  423. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/get-video-duration.md +0 -58
  424. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/gifs.md +0 -138
  425. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/images.md +0 -130
  426. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/import-srt-captions.md +0 -67
  427. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/lottie.md +0 -67
  428. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/measuring-dom-nodes.md +0 -34
  429. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/measuring-text.md +0 -143
  430. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/sequencing.md +0 -106
  431. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/tailwind.md +0 -11
  432. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/text-animations.md +0 -20
  433. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/timing.md +0 -179
  434. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/transcribe-captions.md +0 -19
  435. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/transitions.md +0 -122
  436. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/trimming.md +0 -52
  437. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/videos.md +0 -171
  438. package/vendor/theus-arsenal/skills/cumplimiento-aduanero/SKILL.md +0 -270
  439. package/vendor/theus-arsenal/skills/cumplimiento-hipaa/SKILL.md +0 -78
  440. package/vendor/theus-arsenal/skills/datos-sensibles-salud/SKILL.md +0 -149
  441. package/vendor/theus-arsenal/skills/decimales-tokens-evm/SKILL.md +0 -128
  442. package/vendor/theus-arsenal/skills/decisiones-arquitectura/SKILL.md +0 -206
  443. package/vendor/theus-arsenal/skills/demos-ui/SKILL.md +0 -469
  444. package/vendor/theus-arsenal/skills/desarrollo-por-intencion/SKILL.md +0 -369
  445. package/vendor/theus-arsenal/skills/descubrimiento-marca/SKILL.md +0 -149
  446. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/10_proposito-porque.md +0 -42
  447. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/20_posicionamiento.md +0 -47
  448. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/30_audiencia-nicho.md +0 -53
  449. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/40_personalidad-arquetipo.md +0 -61
  450. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/50_voz-tono.md +0 -62
  451. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/60_narrativa-historia.md +0 -54
  452. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/70_tension-fundador.md +0 -50
  453. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/90_SINTESIS.md +0 -133
  454. package/vendor/theus-arsenal/skills/descubrimiento-plugins-laravel/SKILL.md +0 -230
  455. package/vendor/theus-arsenal/skills/destilado-reglas/SKILL.md +0 -263
  456. package/vendor/theus-arsenal/skills/destilado-reglas/scripts/scan-rules.sh +0 -58
  457. package/vendor/theus-arsenal/skills/destilado-reglas/scripts/scan-skills.sh +0 -129
  458. package/vendor/theus-arsenal/skills/diagnostico-bgp/SKILL.md +0 -170
  459. package/vendor/theus-arsenal/skills/direccion-estetica/SKILL.md +0 -220
  460. package/vendor/theus-arsenal/skills/direccion-estetica/references/taxonomia-generos.md +0 -89
  461. package/vendor/theus-arsenal/skills/diseno-api/SKILL.md +0 -522
  462. package/vendor/theus-arsenal/skills/diseno-liquid-glass/SKILL.md +0 -282
  463. package/vendor/theus-arsenal/skills/e2e-escritorio-windows/SKILL.md +0 -879
  464. package/vendor/theus-arsenal/skills/edicion-video/SKILL.md +0 -289
  465. package/vendor/theus-arsenal/skills/enfoque-producto/SKILL.md +0 -91
  466. package/vendor/theus-arsenal/skills/entornos-flox/SKILL.md +0 -493
  467. package/vendor/theus-arsenal/skills/estandares-codigo/SKILL.md +0 -548
  468. package/vendor/theus-arsenal/skills/estandares-cpp/SKILL.md +0 -727
  469. package/vendor/theus-arsenal/skills/estandares-java/SKILL.md +0 -389
  470. package/vendor/theus-arsenal/skills/estilo-legado/SKILL.md +0 -149
  471. package/vendor/theus-arsenal/skills/estructura-informes-competencia/SKILL.md +0 -95
  472. package/vendor/theus-arsenal/skills/evaluacion-academica/SKILL.md +0 -165
  473. package/vendor/theus-arsenal/skills/explorador-skills/SKILL.md +0 -129
  474. package/vendor/theus-arsenal/skills/flujo-git/SKILL.md +0 -714
  475. package/vendor/theus-arsenal/skills/flujo-ingenieria-ml/SKILL.md +0 -343
  476. package/vendor/theus-arsenal/skills/flujo-tdd/SKILL.md +0 -584
  477. package/vendor/theus-arsenal/skills/forja-personas/SKILL.md +0 -298
  478. package/vendor/theus-arsenal/skills/forja-personas/gacha.py +0 -224
  479. package/vendor/theus-arsenal/skills/forja-personas/gacha.sh +0 -5
  480. package/vendor/theus-arsenal/skills/forja-personas/references/avatar-style.md +0 -123
  481. package/vendor/theus-arsenal/skills/forja-personas/references/boundary-rules.md +0 -53
  482. package/vendor/theus-arsenal/skills/forja-personas/references/error-handling.md +0 -53
  483. package/vendor/theus-arsenal/skills/forja-personas/references/identity-tension.md +0 -48
  484. package/vendor/theus-arsenal/skills/forja-personas/references/naming-system.md +0 -39
  485. package/vendor/theus-arsenal/skills/forja-personas/references/output-template.md +0 -166
  486. package/vendor/theus-arsenal/skills/fundamentos-animacion/SKILL.md +0 -296
  487. package/vendor/theus-arsenal/skills/generacion-iconos-ios/SKILL.md +0 -156
  488. package/vendor/theus-arsenal/skills/generacion-iconos-ios/scripts/generate_icons.swift +0 -258
  489. package/vendor/theus-arsenal/skills/generacion-iconos-ios/scripts/iconify_gen.sh +0 -235
  490. package/vendor/theus-arsenal/skills/gestion-excepciones-logisticas/SKILL.md +0 -208
  491. package/vendor/theus-arsenal/skills/gestion-transportistas/SKILL.md +0 -204
  492. package/vendor/theus-arsenal/skills/guia-adopcion-ml/SKILL.md +0 -64
  493. package/vendor/theus-arsenal/skills/harness-agente-autonomo/SKILL.md +0 -252
  494. package/vendor/theus-arsenal/skills/harness-eval-clinico/SKILL.md +0 -212
  495. package/vendor/theus-arsenal/skills/harness-evaluacion/SKILL.md +0 -296
  496. package/vendor/theus-arsenal/skills/harness-generador-evaluador/SKILL.md +0 -254
  497. package/vendor/theus-arsenal/skills/homelab-diseno-red/SKILL.md +0 -120
  498. package/vendor/theus-arsenal/skills/homelab-dns-pihole/SKILL.md +0 -264
  499. package/vendor/theus-arsenal/skills/homelab-preparacion-red/SKILL.md +0 -144
  500. package/vendor/theus-arsenal/skills/homelab-segmentacion-vlan/SKILL.md +0 -307
  501. package/vendor/theus-arsenal/skills/homelab-vpn-wireguard/SKILL.md +0 -299
  502. package/vendor/theus-arsenal/skills/ingenieria-agentica/SKILL.md +0 -96
  503. package/vendor/theus-arsenal/skills/inspeccion-animaciones-blender/SKILL.md +0 -164
  504. package/vendor/theus-arsenal/skills/instaladores-python/SKILL.md +0 -820
  505. package/vendor/theus-arsenal/skills/integracion-jira/SKILL.md +0 -307
  506. package/vendor/theus-arsenal/skills/inteligencia-leads/SKILL.md +0 -312
  507. package/vendor/theus-arsenal/skills/inteligencia-leads/agents/agente-enriquecimiento.md +0 -87
  508. package/vendor/theus-arsenal/skills/inteligencia-leads/agents/mapeador-mutuos.md +0 -76
  509. package/vendor/theus-arsenal/skills/inteligencia-leads/agents/puntuador-senales.md +0 -60
  510. package/vendor/theus-arsenal/skills/inteligencia-leads/agents/redactor-outreach.md +0 -102
  511. package/vendor/theus-arsenal/skills/inteligencia-mercados-prediccion/SKILL.md +0 -53
  512. package/vendor/theus-arsenal/skills/introspeccion-agente/SKILL.md +0 -150
  513. package/vendor/theus-arsenal/skills/inventario-skills/SKILL.md +0 -194
  514. package/vendor/theus-arsenal/skills/inventario-skills/scripts/quick-diff.sh +0 -87
  515. package/vendor/theus-arsenal/skills/inventario-skills/scripts/save-results.sh +0 -57
  516. package/vendor/theus-arsenal/skills/inventario-skills/scripts/scan.sh +0 -170
  517. package/vendor/theus-arsenal/skills/investigacion-mercado/SKILL.md +0 -87
  518. package/vendor/theus-arsenal/skills/investigacion-oraculos-prediccion/SKILL.md +0 -59
  519. package/vendor/theus-arsenal/skills/investigacion-profunda/SKILL.md +0 -161
  520. package/vendor/theus-arsenal/skills/keccak256-nodejs/SKILL.md +0 -100
  521. package/vendor/theus-arsenal/skills/libro-decisiones-recursivo/SKILL.md +0 -82
  522. package/vendor/theus-arsenal/skills/lienzo-planes/SKILL.md +0 -111
  523. package/vendor/theus-arsenal/skills/limpieza-configuracion/SKILL.md +0 -116
  524. package/vendor/theus-arsenal/skills/logistica-inversa-devoluciones/SKILL.md +0 -241
  525. package/vendor/theus-arsenal/skills/manejo-errores/SKILL.md +0 -375
  526. package/vendor/theus-arsenal/skills/materiales-inversores/SKILL.md +0 -101
  527. package/vendor/theus-arsenal/skills/memoria-por-proyecto/SKILL.md +0 -170
  528. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/forget.mjs +0 -44
  529. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/info.mjs +0 -24
  530. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/init.mjs +0 -152
  531. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/list.mjs +0 -40
  532. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/migrate.mjs +0 -214
  533. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/resume.mjs +0 -36
  534. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/save.mjs +0 -210
  535. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/shared.mjs +0 -402
  536. package/vendor/theus-arsenal/skills/memoria-por-proyecto/hooks/session-start.mjs +0 -238
  537. package/vendor/theus-arsenal/skills/metodologia-benchmarks/SKILL.md +0 -131
  538. package/vendor/theus-arsenal/skills/migraciones-bd/SKILL.md +0 -430
  539. package/vendor/theus-arsenal/skills/modelos-fundacionales-en-dispositivo/SKILL.md +0 -244
  540. package/vendor/theus-arsenal/skills/modo-seguro/SKILL.md +0 -86
  541. package/vendor/theus-arsenal/skills/motion-avanzado/SKILL.md +0 -592
  542. package/vendor/theus-arsenal/skills/motor-de-contenido/SKILL.md +0 -136
  543. package/vendor/theus-arsenal/skills/no-conformidades-calidad/SKILL.md +0 -249
  544. package/vendor/theus-arsenal/skills/onboarding-codigo/SKILL.md +0 -244
  545. package/vendor/theus-arsenal/skills/operaciones-agentes-empresariales/SKILL.md +0 -51
  546. package/vendor/theus-arsenal/skills/operaciones-conocimiento/SKILL.md +0 -159
  547. package/vendor/theus-arsenal/skills/operaciones-correo/SKILL.md +0 -123
  548. package/vendor/theus-arsenal/skills/operaciones-facturacion/SKILL.md +0 -142
  549. package/vendor/theus-arsenal/skills/operaciones-flujo-proyectos/SKILL.md +0 -110
  550. package/vendor/theus-arsenal/skills/operaciones-github/SKILL.md +0 -143
  551. package/vendor/theus-arsenal/skills/operaciones-google-workspace/SKILL.md +0 -100
  552. package/vendor/theus-arsenal/skills/operaciones-investigacion/SKILL.md +0 -124
  553. package/vendor/theus-arsenal/skills/operaciones-mensajes/SKILL.md +0 -103
  554. package/vendor/theus-arsenal/skills/operaciones-terminal/SKILL.md +0 -110
  555. package/vendor/theus-arsenal/skills/optimizacion-benchmark/SKILL.md +0 -70
  556. package/vendor/theus-arsenal/skills/optimizacion-costos-llm/SKILL.md +0 -182
  557. package/vendor/theus-arsenal/skills/optimizador-conexiones/SKILL.md +0 -191
  558. package/vendor/theus-arsenal/skills/optimizador-paralelismo/SKILL.md +0 -75
  559. package/vendor/theus-arsenal/skills/optimizador-prompts/SKILL.md +0 -374
  560. package/vendor/theus-arsenal/skills/orq-agregar-funcionalidad/SKILL.md +0 -37
  561. package/vendor/theus-arsenal/skills/orq-cambiar-funcionalidad/SKILL.md +0 -36
  562. package/vendor/theus-arsenal/skills/orq-construir-mvp/SKILL.md +0 -38
  563. package/vendor/theus-arsenal/skills/orq-corregir-defecto/SKILL.md +0 -36
  564. package/vendor/theus-arsenal/skills/orq-pipeline/SKILL.md +0 -134
  565. package/vendor/theus-arsenal/skills/orq-refinar-codigo/SKILL.md +0 -49
  566. package/vendor/theus-arsenal/skills/orquestacion-equipos-agentes/SKILL.md +0 -117
  567. package/vendor/theus-arsenal/skills/pagos-agentes-x402/SKILL.md +0 -237
  568. package/vendor/theus-arsenal/skills/patrones-angular/SKILL.md +0 -153
  569. package/vendor/theus-arsenal/skills/patrones-angular/references/angular-animations.md +0 -160
  570. package/vendor/theus-arsenal/skills/patrones-angular/references/angular-aria.md +0 -410
  571. package/vendor/theus-arsenal/skills/patrones-angular/references/cli.md +0 -86
  572. package/vendor/theus-arsenal/skills/patrones-angular/references/component-harnesses.md +0 -59
  573. package/vendor/theus-arsenal/skills/patrones-angular/references/component-styling.md +0 -91
  574. package/vendor/theus-arsenal/skills/patrones-angular/references/components.md +0 -117
  575. package/vendor/theus-arsenal/skills/patrones-angular/references/creating-services.md +0 -97
  576. package/vendor/theus-arsenal/skills/patrones-angular/references/data-resolvers.md +0 -69
  577. package/vendor/theus-arsenal/skills/patrones-angular/references/define-routes.md +0 -67
  578. package/vendor/theus-arsenal/skills/patrones-angular/references/defining-providers.md +0 -72
  579. package/vendor/theus-arsenal/skills/patrones-angular/references/di-fundamentals.md +0 -120
  580. package/vendor/theus-arsenal/skills/patrones-angular/references/e2e-testing.md +0 -56
  581. package/vendor/theus-arsenal/skills/patrones-angular/references/effects.md +0 -83
  582. package/vendor/theus-arsenal/skills/patrones-angular/references/hierarchical-injectors.md +0 -43
  583. package/vendor/theus-arsenal/skills/patrones-angular/references/host-elements.md +0 -80
  584. package/vendor/theus-arsenal/skills/patrones-angular/references/injection-context.md +0 -63
  585. package/vendor/theus-arsenal/skills/patrones-angular/references/inputs.md +0 -101
  586. package/vendor/theus-arsenal/skills/patrones-angular/references/linked-signal.md +0 -59
  587. package/vendor/theus-arsenal/skills/patrones-angular/references/loading-strategies.md +0 -61
  588. package/vendor/theus-arsenal/skills/patrones-angular/references/mcp.md +0 -67
  589. package/vendor/theus-arsenal/skills/patrones-angular/references/navigate-to-routes.md +0 -69
  590. package/vendor/theus-arsenal/skills/patrones-angular/references/outputs.md +0 -86
  591. package/vendor/theus-arsenal/skills/patrones-angular/references/reactive-forms.md +0 -122
  592. package/vendor/theus-arsenal/skills/patrones-angular/references/rendering-strategies.md +0 -44
  593. package/vendor/theus-arsenal/skills/patrones-angular/references/resource.md +0 -77
  594. package/vendor/theus-arsenal/skills/patrones-angular/references/route-animations.md +0 -56
  595. package/vendor/theus-arsenal/skills/patrones-angular/references/route-guards.md +0 -52
  596. package/vendor/theus-arsenal/skills/patrones-angular/references/router-lifecycle.md +0 -45
  597. package/vendor/theus-arsenal/skills/patrones-angular/references/router-testing.md +0 -87
  598. package/vendor/theus-arsenal/skills/patrones-angular/references/show-routes-with-outlets.md +0 -68
  599. package/vendor/theus-arsenal/skills/patrones-angular/references/signal-forms.md +0 -795
  600. package/vendor/theus-arsenal/skills/patrones-angular/references/signals-overview.md +0 -94
  601. package/vendor/theus-arsenal/skills/patrones-angular/references/tailwind-css.md +0 -69
  602. package/vendor/theus-arsenal/skills/patrones-angular/references/template-driven-forms.md +0 -114
  603. package/vendor/theus-arsenal/skills/patrones-angular/references/testing-fundamentals.md +0 -65
  604. package/vendor/theus-arsenal/skills/patrones-animacion/SKILL.md +0 -432
  605. package/vendor/theus-arsenal/skills/patrones-backend/SKILL.md +0 -560
  606. package/vendor/theus-arsenal/skills/patrones-cdss-clinico/SKILL.md +0 -249
  607. package/vendor/theus-arsenal/skills/patrones-cisco-ios/SKILL.md +0 -148
  608. package/vendor/theus-arsenal/skills/patrones-clickhouse/SKILL.md +0 -443
  609. package/vendor/theus-arsenal/skills/patrones-compose-multiplatform/SKILL.md +0 -298
  610. package/vendor/theus-arsenal/skills/patrones-dart-flutter/SKILL.md +0 -566
  611. package/vendor/theus-arsenal/skills/patrones-despliegue/SKILL.md +0 -426
  612. package/vendor/theus-arsenal/skills/patrones-django/SKILL.md +0 -739
  613. package/vendor/theus-arsenal/skills/patrones-django-celery/SKILL.md +0 -456
  614. package/vendor/theus-arsenal/skills/patrones-docker/SKILL.md +0 -363
  615. package/vendor/theus-arsenal/skills/patrones-dotnet/SKILL.md +0 -321
  616. package/vendor/theus-arsenal/skills/patrones-emr-clinico/SKILL.md +0 -168
  617. package/vendor/theus-arsenal/skills/patrones-fastapi/SKILL.md +0 -513
  618. package/vendor/theus-arsenal/skills/patrones-frontend/SKILL.md +0 -655
  619. package/vendor/theus-arsenal/skills/patrones-go/SKILL.md +0 -674
  620. package/vendor/theus-arsenal/skills/patrones-jpa/SKILL.md +0 -156
  621. package/vendor/theus-arsenal/skills/patrones-kotlin/SKILL.md +0 -717
  622. package/vendor/theus-arsenal/skills/patrones-kotlin-exposed/SKILL.md +0 -724
  623. package/vendor/theus-arsenal/skills/patrones-kotlin-ktor/SKILL.md +0 -694
  624. package/vendor/theus-arsenal/skills/patrones-kubernetes/SKILL.md +0 -754
  625. package/vendor/theus-arsenal/skills/patrones-laravel/SKILL.md +0 -414
  626. package/vendor/theus-arsenal/skills/patrones-mcp/SKILL.md +0 -66
  627. package/vendor/theus-arsenal/skills/patrones-mysql/SKILL.md +0 -420
  628. package/vendor/theus-arsenal/skills/patrones-nestjs/SKILL.md +0 -229
  629. package/vendor/theus-arsenal/skills/patrones-nextjs/SKILL.md +0 -56
  630. package/vendor/theus-arsenal/skills/patrones-nuxt4/SKILL.md +0 -99
  631. package/vendor/theus-arsenal/skills/patrones-perl/SKILL.md +0 -508
  632. package/vendor/theus-arsenal/skills/patrones-postgres/SKILL.md +0 -141
  633. package/vendor/theus-arsenal/skills/patrones-prisma/SKILL.md +0 -399
  634. package/vendor/theus-arsenal/skills/patrones-python/SKILL.md +0 -750
  635. package/vendor/theus-arsenal/skills/patrones-pytorch/SKILL.md +0 -400
  636. package/vendor/theus-arsenal/skills/patrones-quarkus/SKILL.md +0 -729
  637. package/vendor/theus-arsenal/skills/patrones-react/SKILL.md +0 -339
  638. package/vendor/theus-arsenal/skills/patrones-react-native/SKILL.md +0 -325
  639. package/vendor/theus-arsenal/skills/patrones-redis/SKILL.md +0 -401
  640. package/vendor/theus-arsenal/skills/patrones-rust/SKILL.md +0 -504
  641. package/vendor/theus-arsenal/skills/patrones-springboot/SKILL.md +0 -314
  642. package/vendor/theus-arsenal/skills/patrones-swiftui/SKILL.md +0 -261
  643. package/vendor/theus-arsenal/skills/patrones-tinystruct/SKILL.md +0 -281
  644. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/architecture.md +0 -90
  645. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/data-handling.md +0 -60
  646. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/database.md +0 -99
  647. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/routing.md +0 -64
  648. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/system-usage.md +0 -97
  649. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/testing.md +0 -72
  650. package/vendor/theus-arsenal/skills/patrones-vite/SKILL.md +0 -449
  651. package/vendor/theus-arsenal/skills/patrones-vue/SKILL.md +0 -469
  652. package/vendor/theus-arsenal/skills/persistencia-actores-swift/SKILL.md +0 -148
  653. package/vendor/theus-arsenal/skills/pipeline-opensource/SKILL.md +0 -254
  654. package/vendor/theus-arsenal/skills/planificacion-demanda-inventario/SKILL.md +0 -236
  655. package/vendor/theus-arsenal/skills/planificador-trades-prediccion/SKILL.md +0 -60
  656. package/vendor/theus-arsenal/skills/plano-tecnico/SKILL.md +0 -102
  657. package/vendor/theus-arsenal/skills/presentaciones-html/SKILL.md +0 -189
  658. package/vendor/theus-arsenal/skills/presentaciones-html/STYLE_PRESETS.md +0 -330
  659. package/vendor/theus-arsenal/skills/presentaciones-html/animation-patterns.md +0 -122
  660. package/vendor/theus-arsenal/skills/presentaciones-html/html-template.md +0 -419
  661. package/vendor/theus-arsenal/skills/presentaciones-html/scripts/export-pdf.sh +0 -418
  662. package/vendor/theus-arsenal/skills/presentaciones-html/scripts/extract-pptx.py +0 -96
  663. package/vendor/theus-arsenal/skills/presentaciones-html/viewport-base.css +0 -153
  664. package/vendor/theus-arsenal/skills/presupuesto-contexto/SKILL.md +0 -263
  665. package/vendor/theus-arsenal/skills/procesamiento-documentos-nutrient/SKILL.md +0 -168
  666. package/vendor/theus-arsenal/skills/programacion-produccion/SKILL.md +0 -220
  667. package/vendor/theus-arsenal/skills/publicacion-cruzada/SKILL.md +0 -117
  668. package/vendor/theus-arsenal/skills/publicador-social/SKILL.md +0 -121
  669. package/vendor/theus-arsenal/skills/puerta-de-entrega/SKILL.md +0 -164
  670. package/vendor/theus-arsenal/skills/puerta-de-entrega/hooks/puerta-entrega.py +0 -242
  671. package/vendor/theus-arsenal/skills/pulir-interfaces/SKILL.md +0 -126
  672. package/vendor/theus-arsenal/skills/qa-navegador/SKILL.md +0 -103
  673. package/vendor/theus-arsenal/skills/ranking-grafo-social/SKILL.md +0 -153
  674. package/vendor/theus-arsenal/skills/recuperacion-iterativa/SKILL.md +0 -236
  675. package/vendor/theus-arsenal/skills/redaccion-articulos/SKILL.md +0 -81
  676. package/vendor/theus-arsenal/skills/regex-vs-llm/SKILL.md +0 -221
  677. package/vendor/theus-arsenal/skills/regresion-codigo-ia/SKILL.md +0 -388
  678. package/vendor/theus-arsenal/skills/rendimiento-react/SKILL.md +0 -567
  679. package/vendor/theus-arsenal/skills/revision-codigo-flutter-dart/SKILL.md +0 -442
  680. package/vendor/theus-arsenal/skills/revision-literatura-cientifica/SKILL.md +0 -191
  681. package/vendor/theus-arsenal/skills/revision-multiperspectiva/SKILL.md +0 -302
  682. package/vendor/theus-arsenal/skills/revision-riesgo-prediccion/SKILL.md +0 -56
  683. package/vendor/theus-arsenal/skills/revision-seguridad/SKILL.md +0 -505
  684. package/vendor/theus-arsenal/skills/revision-seguridad/cloud-infrastructure-security.md +0 -361
  685. package/vendor/theus-arsenal/skills/runtime-bun/SKILL.md +0 -83
  686. package/vendor/theus-arsenal/skills/salud-codigo-codescene/SKILL.md +0 -163
  687. package/vendor/theus-arsenal/skills/salud-interfaces-red/SKILL.md +0 -143
  688. package/vendor/theus-arsenal/skills/seguimiento-costos/SKILL.md +0 -122
  689. package/vendor/theus-arsenal/skills/seguridad-agentes-trading/SKILL.md +0 -145
  690. package/vendor/theus-arsenal/skills/seguridad-amm-defi/SKILL.md +0 -166
  691. package/vendor/theus-arsenal/skills/seguridad-django/SKILL.md +0 -648
  692. package/vendor/theus-arsenal/skills/seguridad-laravel/SKILL.md +0 -945
  693. package/vendor/theus-arsenal/skills/seguridad-perl/SKILL.md +0 -507
  694. package/vendor/theus-arsenal/skills/seguridad-quarkus/SKILL.md +0 -474
  695. package/vendor/theus-arsenal/skills/seguridad-springboot/SKILL.md +0 -279
  696. package/vendor/theus-arsenal/skills/seo/SKILL.md +0 -166
  697. package/vendor/theus-arsenal/skills/sistema-diseno/SKILL.md +0 -81
  698. package/vendor/theus-arsenal/skills/sistema-operativo-agentico/SKILL.md +0 -375
  699. package/vendor/theus-arsenal/skills/sistemas-latencia-critica/SKILL.md +0 -65
  700. package/vendor/theus-arsenal/skills/tdd-django/SKILL.md +0 -735
  701. package/vendor/theus-arsenal/skills/tdd-laravel/SKILL.md +0 -673
  702. package/vendor/theus-arsenal/skills/tdd-quarkus/SKILL.md +0 -817
  703. package/vendor/theus-arsenal/skills/tdd-springboot/SKILL.md +0 -165
  704. package/vendor/theus-arsenal/skills/testing-cpp/SKILL.md +0 -328
  705. package/vendor/theus-arsenal/skills/testing-csharp/SKILL.md +0 -321
  706. package/vendor/theus-arsenal/skills/testing-e2e/SKILL.md +0 -325
  707. package/vendor/theus-arsenal/skills/testing-go/SKILL.md +0 -719
  708. package/vendor/theus-arsenal/skills/testing-kotlin/SKILL.md +0 -829
  709. package/vendor/theus-arsenal/skills/testing-perl/SKILL.md +0 -479
  710. package/vendor/theus-arsenal/skills/testing-protocolos-di-swift/SKILL.md +0 -196
  711. package/vendor/theus-arsenal/skills/testing-python/SKILL.md +0 -815
  712. package/vendor/theus-arsenal/skills/testing-react/SKILL.md +0 -421
  713. package/vendor/theus-arsenal/skills/testing-rust/SKILL.md +0 -506
  714. package/vendor/theus-arsenal/skills/tours-de-codigo/SKILL.md +0 -252
  715. package/vendor/theus-arsenal/skills/traduccion-documentos-visado/SKILL.md +0 -121
  716. package/vendor/theus-arsenal/skills/ui-a-vue/SKILL.md +0 -141
  717. package/vendor/theus-arsenal/skills/validacion-config-red/SKILL.md +0 -211
  718. package/vendor/theus-arsenal/skills/verificacion-django/SKILL.md +0 -470
  719. package/vendor/theus-arsenal/skills/verificacion-factual/SKILL.md +0 -142
  720. package/vendor/theus-arsenal/skills/verificacion-laravel/SKILL.md +0 -184
  721. package/vendor/theus-arsenal/skills/verificacion-quarkus/SKILL.md +0 -485
  722. package/vendor/theus-arsenal/skills/verificacion-springboot/SKILL.md +0 -237
  723. package/vendor/theus-arsenal/skills/videodb/SKILL.md +0 -374
  724. package/vendor/theus-arsenal/skills/videodb/reference/api-reference.md +0 -550
  725. package/vendor/theus-arsenal/skills/videodb/reference/capture-reference.md +0 -407
  726. package/vendor/theus-arsenal/skills/videodb/reference/capture.md +0 -101
  727. package/vendor/theus-arsenal/skills/videodb/reference/editor.md +0 -443
  728. package/vendor/theus-arsenal/skills/videodb/reference/generative.md +0 -331
  729. package/vendor/theus-arsenal/skills/videodb/reference/rtstream-reference.md +0 -564
  730. package/vendor/theus-arsenal/skills/videodb/reference/rtstream.md +0 -65
  731. package/vendor/theus-arsenal/skills/videodb/reference/search.md +0 -230
  732. package/vendor/theus-arsenal/skills/videodb/reference/streaming.md +0 -406
  733. package/vendor/theus-arsenal/skills/videodb/reference/use-cases.md +0 -118
  734. package/vendor/theus-arsenal/skills/videodb/scripts/ws_listener.py +0 -279
  735. package/vendor/theus-arsenal/skills/videos-manim/SKILL.md +0 -91
  736. package/vendor/theus-arsenal/skills/videos-manim/assets/network_graph_scene.py +0 -52
  737. package/vendor/theus-arsenal/skills/vigilancia-canary/SKILL.md +0 -108
  738. package/vendor/theus-arsenal/skills/voz-de-marca/SKILL.md +0 -106
@@ -1,906 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Hook de SessionStart - Cargar el contexto previo al iniciar una sesión
4
- *
5
- * Multiplataforma (Windows, macOS, Linux)
6
- *
7
- * Se ejecuta cuando arranca una nueva sesión de Theus. Carga el resumen de la
8
- * sesión más reciente en el contexto vía stdout, reporta las sesiones y skills
9
- * aprendidas disponibles, y carga las reglas y contextos del plugin desde
10
- * ${THEUS_PLUGIN_ROOT}/rules y ${THEUS_PLUGIN_ROOT}/contexts si existen.
11
- */
12
-
13
- const {
14
- getSessionsDir,
15
- getSessionSearchDirs,
16
- getLearnedSkillsDir,
17
- getProjectName,
18
- findFiles,
19
- ensureDir,
20
- readFile,
21
- stripAnsi,
22
- log
23
- } = require('../lib/utils');
24
- const { resolveProjectContext, writeSessionLease, resolveSessionId, getObserverDataDir } = require('../lib/observer-sessions');
25
- const { getPackageManager, getSelectionPrompt } = require('../lib/package-manager');
26
- const { listAliases } = require('../lib/session-aliases');
27
- const { detectProjectType } = require('../lib/project-detect');
28
- const path = require('path');
29
- const fs = require('fs');
30
-
31
- const DEFAULT_INSTINCT_CONFIDENCE_THRESHOLD = 0.7;
32
- const DEFAULT_MAX_INJECTED_INSTINCTS = 6;
33
- const MAX_INJECTED_LEARNED_SKILLS = 6;
34
- const MAX_LEARNED_SKILL_SUMMARY_CHARS = 220;
35
- const DEFAULT_SESSION_START_CONTEXT_MAX_CHARS = 8000;
36
- const DEFAULT_SESSION_RETENTION_DAYS = 30;
37
- const MAX_PLUGIN_RESOURCE_CHARS = 4000;
38
- const SESSION_START_MODE_INVALID = 'invalid';
39
- const SESSION_START_MODE_SKIP = 'skip';
40
-
41
- /**
42
- * Resuelve una ruta del sistema de archivos a su forma canónica (real).
43
- *
44
- * Maneja symlinks y, en sistemas de archivos que no distinguen mayúsculas
45
- * (macOS, Windows), normaliza el uso de mayúsculas para que las comparaciones
46
- * de rutas sean confiables. Recurre a la ruta original si la resolución falla
47
- * (p. ej., la ruta ya no existe).
48
- *
49
- * @param {string} p - La ruta a normalizar.
50
- * @returns {string} La ruta canónica, o la original si la resolución falla.
51
- */
52
- function normalizePath(p) {
53
- try {
54
- return fs.realpathSync(p);
55
- } catch {
56
- return p;
57
- }
58
- }
59
-
60
- function dedupeRecentSessions(searchDirs) {
61
- const recentSessionsByName = new Map();
62
-
63
- for (const [dirIndex, dir] of searchDirs.entries()) {
64
- const matches = findFiles(dir, '*-session.tmp', { maxAge: 7 });
65
-
66
- for (const match of matches) {
67
- const basename = path.basename(match.path);
68
- const current = {
69
- ...match,
70
- basename,
71
- dirIndex,
72
- };
73
- const existing = recentSessionsByName.get(basename);
74
-
75
- if (
76
- !existing
77
- || current.mtime > existing.mtime
78
- || (current.mtime === existing.mtime && current.dirIndex < existing.dirIndex)
79
- ) {
80
- recentSessionsByName.set(basename, current);
81
- }
82
- }
83
- }
84
-
85
- return Array.from(recentSessionsByName.values())
86
- .sort((left, right) => right.mtime - left.mtime || left.dirIndex - right.dirIndex);
87
- }
88
-
89
- /**
90
- * Resuelve los días de retención de sesiones desde la variable de entorno
91
- * THEUS_SESSION_RETENTION_DAYS.
92
- *
93
- * @returns {number|null} La ventana de retención en días, o `null` cuando el
94
- * usuario optó explícitamente por no purgar. Valores vacíos o basura caen
95
- * al valor por defecto {@link DEFAULT_SESSION_RETENTION_DAYS}.
96
- */
97
- function getSessionRetentionDays() {
98
- const raw = process.env.THEUS_SESSION_RETENTION_DAYS;
99
- if (!raw) return DEFAULT_SESSION_RETENTION_DAYS;
100
-
101
- const normalized = String(raw).trim().toLowerCase();
102
- if (['0', 'off', 'false', 'disabled', 'never', 'none'].includes(normalized)) {
103
- return null;
104
- }
105
-
106
- const parsed = Number.parseInt(raw, 10);
107
- return Number.isInteger(parsed) && parsed > 0 ? parsed : DEFAULT_SESSION_RETENTION_DAYS;
108
- }
109
-
110
- function isSessionStartContextDisabled() {
111
- const raw = String(process.env.THEUS_SESSION_START_CONTEXT || '').trim().toLowerCase();
112
- return ['0', 'false', 'off', 'none', 'disabled'].includes(raw);
113
- }
114
-
115
- function getSessionStartMaxContextChars() {
116
- const raw = process.env.THEUS_SESSION_START_MAX_CHARS;
117
- if (!raw) return DEFAULT_SESSION_START_CONTEXT_MAX_CHARS;
118
-
119
- const parsed = Number.parseInt(raw, 10);
120
- return Number.isInteger(parsed) && parsed >= 0 ? parsed : DEFAULT_SESSION_START_CONTEXT_MAX_CHARS;
121
- }
122
-
123
- /**
124
- * Resuelve la confianza mínima que necesita un instinto para inyectarse en
125
- * SessionStart. Sobrescribible vía `THEUS_INSTINCT_CONFIDENCE_THRESHOLD`
126
- * (un número en [0, 1]); valores vacíos o fuera de rango caen al valor por
127
- * defecto {@link DEFAULT_INSTINCT_CONFIDENCE_THRESHOLD}.
128
- *
129
- * @returns {number} El piso de confianza para instintos inyectados.
130
- */
131
- function getInstinctConfidenceThreshold() {
132
- const raw = process.env.THEUS_INSTINCT_CONFIDENCE_THRESHOLD;
133
- if (!raw) return DEFAULT_INSTINCT_CONFIDENCE_THRESHOLD;
134
-
135
- // Exigir un decimal plano (p. ej. "0.7", "1", "0.95") para que la basura al
136
- // final ("0.7x") y la sintaxis numérica no decimal como "0x1" (hexadecimal)
137
- // o "1e2" (exponente) se rechacen por completo en lugar de que Number() las
138
- // acepte en silencio.
139
- const normalized = raw.trim();
140
- if (!/^\d+(\.\d+)?$/.test(normalized)) return DEFAULT_INSTINCT_CONFIDENCE_THRESHOLD;
141
-
142
- const parsed = Number(normalized);
143
- return Number.isFinite(parsed) && parsed >= 0 && parsed <= 1
144
- ? parsed
145
- : DEFAULT_INSTINCT_CONFIDENCE_THRESHOLD;
146
- }
147
-
148
- /**
149
- * Resuelve la cantidad máxima de instintos inyectados en SessionStart.
150
- * Sobrescribible vía `THEUS_MAX_INJECTED_INSTINCTS` (un entero positivo);
151
- * valores vacíos o inválidos caen al valor por defecto
152
- * {@link DEFAULT_MAX_INJECTED_INSTINCTS}.
153
- *
154
- * @returns {number} El tope de instintos inyectados.
155
- */
156
- function getMaxInjectedInstincts() {
157
- const raw = process.env.THEUS_MAX_INJECTED_INSTINCTS;
158
- if (!raw) return DEFAULT_MAX_INJECTED_INSTINCTS;
159
-
160
- // Exigir un entero no negativo plano para que "3.9", "6abc", "0x1"
161
- // (hexadecimal) y "1e2" (exponente) se rechacen por completo y caigan al
162
- // valor por defecto, en lugar de que parseInt trunque o Number() acepte
163
- // sintaxis alternativa.
164
- const normalized = raw.trim();
165
- if (!/^\d+$/.test(normalized)) return DEFAULT_MAX_INJECTED_INSTINCTS;
166
-
167
- const parsed = Number(normalized);
168
- return Number.isInteger(parsed) && parsed > 0 ? parsed : DEFAULT_MAX_INJECTED_INSTINCTS;
169
- }
170
-
171
- function parseSessionStartPayload(rawInput) {
172
- const input = String(rawInput || '');
173
- if (!input.trim()) return { mode: null, sessionId: null };
174
-
175
- let payload;
176
- try {
177
- payload = JSON.parse(input);
178
- } catch {
179
- log(`[SessionStart] Payload de stdin inválido; se omite la inyección del resumen de la sesión previa. Longitud: ${input.length}`);
180
- return { mode: SESSION_START_MODE_INVALID, sessionId: null };
181
- }
182
-
183
- const sessionId = payload && typeof payload.session_id === 'string' && payload.session_id.trim()
184
- ? payload.session_id.trim()
185
- : null;
186
-
187
- const supportedModes = new Set(['startup', 'resume', 'clear', 'compact']);
188
-
189
- if (payload.hook_event_name === 'SessionStart') {
190
- const mode = typeof payload.source === 'string' ? payload.source.trim().toLowerCase() : '';
191
- return { mode: supportedModes.has(mode) ? mode : SESSION_START_MODE_SKIP, sessionId };
192
- }
193
-
194
- return { mode: SESSION_START_MODE_SKIP, sessionId };
195
- }
196
-
197
- function limitSessionStartContext(additionalContext, maxChars = getSessionStartMaxContextChars()) {
198
- const context = String(additionalContext || '');
199
-
200
- if (context.length <= maxChars) {
201
- return context;
202
- }
203
-
204
- const marker = '\n\n[SessionStart truncó el contexto. Define THEUS_SESSION_START_MAX_CHARS para subir el tope o THEUS_SESSION_START_CONTEXT=off para desactivar el contexto inyectado.]';
205
- const prefixLength = Math.max(0, maxChars - marker.length);
206
- log(`[SessionStart] Contexto adicional truncado de ${context.length} a ${maxChars} caracteres`);
207
-
208
- return `${context.slice(0, prefixLength).trimEnd()}${marker}`.slice(0, maxChars);
209
- }
210
-
211
- function pruneExpiredSessions(searchDirs, retentionDays) {
212
- const uniqueDirs = Array.from(new Set(searchDirs.filter(dir => typeof dir === 'string' && dir.length > 0)));
213
- let removed = 0;
214
-
215
- for (const dir of uniqueDirs) {
216
- if (!fs.existsSync(dir)) continue;
217
-
218
- let entries;
219
- try {
220
- entries = fs.readdirSync(dir, { withFileTypes: true });
221
- } catch {
222
- continue;
223
- }
224
-
225
- for (const entry of entries) {
226
- if (!entry.isFile() || !entry.name.endsWith('-session.tmp')) continue;
227
-
228
- const fullPath = path.join(dir, entry.name);
229
- let stats;
230
- try {
231
- stats = fs.statSync(fullPath);
232
- } catch {
233
- continue;
234
- }
235
-
236
- const ageInDays = (Date.now() - stats.mtimeMs) / (1000 * 60 * 60 * 24);
237
- if (ageInDays <= retentionDays) continue;
238
-
239
- try {
240
- fs.rmSync(fullPath, { force: true });
241
- removed += 1;
242
- } catch (error) {
243
- log(`[SessionStart] Advertencia: no se pudo purgar la sesión expirada ${fullPath}: ${error.message}`);
244
- }
245
- }
246
- }
247
-
248
- return removed;
249
- }
250
-
251
- /**
252
- * Carga los archivos Markdown de un directorio de recursos del plugin
253
- * (${THEUS_PLUGIN_ROOT}/rules o ${THEUS_PLUGIN_ROOT}/contexts) si existen.
254
- *
255
- * @param {string} dirName - Nombre del subdirectorio dentro de la raíz del plugin.
256
- * @param {string} label - Etiqueta visible del bloque inyectado.
257
- * @returns {string} El bloque de contexto, o cadena vacía si no hay nada que cargar.
258
- */
259
- /**
260
- * Construye un índice compacto de las reglas del plugin
261
- * (${THEUS_PLUGIN_ROOT}/rules/<grupo>/*.md) para inyectarlo como contexto.
262
- *
263
- * Las reglas están organizadas en subdirectorios por lenguaje/tema y suman
264
- * decenas de archivos: inyectarlas completas reventaría el presupuesto de
265
- * contexto de la sesión. En su lugar se inyecta el mapa de grupos y archivos
266
- * con la instrucción de leer el archivo pertinente al trabajar en cada área.
267
- *
268
- * @returns {string} El bloque de índice, o cadena vacía si no hay reglas.
269
- */
270
- function loadPluginRulesIndex() {
271
- const pluginRoot = String(process.env.THEUS_PLUGIN_ROOT || '').trim();
272
- if (!pluginRoot) return '';
273
-
274
- const rulesDir = path.join(pluginRoot, 'rules');
275
- if (!fs.existsSync(rulesDir)) return '';
276
-
277
- let groups;
278
- try {
279
- groups = fs.readdirSync(rulesDir, { withFileTypes: true })
280
- .filter(entry => entry.isDirectory())
281
- .map(entry => entry.name)
282
- .sort((a, b) => (a === 'common' ? -1 : b === 'common' ? 1 : a.localeCompare(b)));
283
- } catch (error) {
284
- log(`[SessionStart] Advertencia: no se pudo leer ${rulesDir}: ${error.message}`);
285
- return '';
286
- }
287
-
288
- const lines = [];
289
- for (const group of groups) {
290
- let files;
291
- try {
292
- files = fs.readdirSync(path.join(rulesDir, group))
293
- .filter(name => /\.md$/i.test(name))
294
- .map(name => name.replace(/\.md$/i, ''))
295
- .sort();
296
- } catch {
297
- continue;
298
- }
299
- if (files.length === 0) continue;
300
- const nota = group === 'common' ? ' (aplican a todo el código, en cualquier lenguaje)' : '';
301
- lines.push(`- ${group}${nota}: ${files.join(', ')}`);
302
- }
303
-
304
- if (lines.length === 0) return '';
305
-
306
- log(`[SessionStart] Inyectando índice de reglas del plugin (${lines.length} grupos)`);
307
- return [
308
- 'Reglas de calidad del arsenal:',
309
- '',
310
- `El plugin incluye reglas de estilo, patrones, seguridad y testing en \`${rulesDir}/<grupo>/<archivo>.md\`.`,
311
- 'Antes de escribir o revisar código de una de estas áreas, lee con la tool Read el archivo pertinente (como mínimo security y patterns del grupo, más los de common):',
312
- ...lines,
313
- ].join('\n');
314
- }
315
-
316
- function loadPluginResources(dirName, label) {
317
- const pluginRoot = String(process.env.THEUS_PLUGIN_ROOT || '').trim();
318
- if (!pluginRoot) return '';
319
-
320
- const dir = path.join(pluginRoot, dirName);
321
- if (!fs.existsSync(dir)) return '';
322
-
323
- let entries;
324
- try {
325
- entries = fs.readdirSync(dir, { withFileTypes: true })
326
- .filter(entry => entry.isFile() && /\.md$/i.test(entry.name))
327
- .sort((left, right) => left.name.localeCompare(right.name));
328
- } catch (error) {
329
- log(`[SessionStart] Advertencia: no se pudo leer ${dir}: ${error.message}`);
330
- return '';
331
- }
332
-
333
- if (entries.length === 0) return '';
334
-
335
- const parts = [];
336
- let used = 0;
337
- for (const entry of entries) {
338
- const filePath = path.join(dir, entry.name);
339
- const content = readFile(filePath);
340
- if (!content) continue;
341
-
342
- const trimmed = content.trim();
343
- const remaining = MAX_PLUGIN_RESOURCE_CHARS - used;
344
- if (remaining <= 0) {
345
- parts.push(`- ${entry.name}: omitido por límite de tamaño`);
346
- continue;
347
- }
348
-
349
- const slice = trimmed.length > remaining ? `${trimmed.slice(0, remaining).trimEnd()}\n[...truncado]` : trimmed;
350
- used += slice.length;
351
- parts.push(`### ${entry.name}\n${slice}`);
352
- }
353
-
354
- if (parts.length === 0) return '';
355
-
356
- log(`[SessionStart] Cargando ${parts.length} archivo(s) de ${dirName}/ del plugin`);
357
- return `${label}:\n\n${parts.join('\n\n')}`;
358
- }
359
-
360
- /**
361
- * Selecciona la sesión que mejor coincide con el directorio de trabajo actual.
362
- *
363
- * Los archivos de sesión escritos por session-end.js contienen campos de
364
- * encabezado como:
365
- * **Proyecto:** mi-proyecto
366
- * **Worktree:** /ruta/al/proyecto
367
- *
368
- * Esta función lee cada archivo de sesión una sola vez, cacheando su
369
- * contenido, y devuelve tanto el objeto de sesión seleccionado como su
370
- * contenido ya leído para evitar E/S duplicada en el llamador.
371
- *
372
- * Prioridad (de mayor a menor):
373
- * 1. Coincidencia exacta de worktree (cwd) — la más reciente
374
- * 2. Coincidencia por nombre de proyecto para sesiones legacy sin metadatos de Worktree
375
- * 3. Sin inyección cuando las sesiones pertenecen a otro worktree/proyecto
376
- *
377
- * Las sesiones ya vienen ordenadas de más reciente a más antigua, así que la
378
- * primera coincidencia de cada categoría gana.
379
- *
380
- * @param {Array<Object>} sessions - Lista de sesiones deduplicada, más recientes primero.
381
- * @param {string} cwd - Directorio de trabajo actual (process.cwd()).
382
- * @param {string} currentProject - Nombre del proyecto actual según getProjectName().
383
- * @returns {{ session: Object, content: string, matchReason: string } | null}
384
- * La sesión que mejor coincide con su contenido cacheado y el motivo de la
385
- * coincidencia, o null si la lista está vacía o ningún archivo es legible.
386
- */
387
- function selectMatchingSession(sessions, cwd, currentProject) {
388
- if (sessions.length === 0) return null;
389
-
390
- // Normalizar cwd una vez fuera del bucle para evitar syscalls repetidas
391
- const normalizedCwd = normalizePath(cwd);
392
-
393
- let projectMatch = null;
394
- let projectMatchContent = null;
395
- let readableSessions = 0;
396
-
397
- for (const session of sessions) {
398
- const content = readFile(session.path);
399
- if (!content) continue;
400
- readableSessions++;
401
-
402
- // Extraer el campo **Worktree:**
403
- const worktreeMatch = content.match(/\*\*Worktree:\*\*\s*(.+)$/m);
404
- const sessionWorktree = worktreeMatch ? worktreeMatch[1].trim() : '';
405
-
406
- // Coincidencia exacta de worktree — la mejor posible, retornar de inmediato.
407
- // Normalizar ambas rutas para manejar symlinks y sistemas de archivos que
408
- // no distinguen mayúsculas
409
- if (sessionWorktree && normalizePath(sessionWorktree) === normalizedCwd) {
410
- return { session, content, matchReason: 'worktree' };
411
- }
412
-
413
- // La coincidencia por nombre de proyecto solo es segura para archivos de
414
- // sesión legacy escritos antes de que existieran los metadatos de
415
- // Worktree. Un Worktree explícito distinto no es una coincidencia.
416
- if (!projectMatch && currentProject && !sessionWorktree) {
417
- const projectFieldMatch = content.match(/\*\*Proyecto:\*\*\s*(.+)$/m);
418
- const sessionProject = projectFieldMatch ? projectFieldMatch[1].trim() : '';
419
- if (sessionProject && sessionProject === currentProject) {
420
- projectMatch = session;
421
- projectMatchContent = content;
422
- }
423
- }
424
- }
425
-
426
- if (projectMatch) {
427
- return { session: projectMatch, content: projectMatchContent, matchReason: 'project' };
428
- }
429
-
430
- log(readableSessions > 0
431
- ? '[SessionStart] No se encontró una sesión que coincida por worktree/proyecto'
432
- : '[SessionStart] Ningún archivo de sesión fue legible');
433
- return null;
434
- }
435
-
436
- function parseInstinctFile(content) {
437
- const instincts = [];
438
- let current = null;
439
- let inFrontmatter = false;
440
- let contentLines = [];
441
-
442
- for (const line of String(content).split('\n')) {
443
- if (line.trim() === '---') {
444
- if (inFrontmatter) {
445
- inFrontmatter = false;
446
- } else {
447
- if (current && current.id) {
448
- current.content = contentLines.join('\n').trim();
449
- instincts.push(current);
450
- }
451
- current = {};
452
- contentLines = [];
453
- inFrontmatter = true;
454
- }
455
- continue;
456
- }
457
-
458
- if (inFrontmatter) {
459
- const separatorIndex = line.indexOf(':');
460
- if (separatorIndex === -1) continue;
461
- const key = line.slice(0, separatorIndex).trim();
462
- let value = line.slice(separatorIndex + 1).trim();
463
- if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
464
- value = value.slice(1, -1);
465
- }
466
- if (key === 'confidence') {
467
- const parsed = Number.parseFloat(value);
468
- current[key] = Number.isFinite(parsed) ? parsed : 0.5;
469
- } else {
470
- current[key] = value;
471
- }
472
- } else if (current) {
473
- contentLines.push(line);
474
- }
475
- }
476
-
477
- if (current && current.id) {
478
- current.content = contentLines.join('\n').trim();
479
- instincts.push(current);
480
- }
481
-
482
- return instincts;
483
- }
484
-
485
- function readInstinctsFromDir(directory, scope) {
486
- if (!directory || !fs.existsSync(directory)) return [];
487
-
488
- const entries = fs.readdirSync(directory, { withFileTypes: true })
489
- .filter(entry => entry.isFile() && /\.(ya?ml|md)$/i.test(entry.name))
490
- .sort((left, right) => left.name.localeCompare(right.name));
491
-
492
- const instincts = [];
493
- for (const entry of entries) {
494
- const filePath = path.join(directory, entry.name);
495
- try {
496
- const parsed = parseInstinctFile(fs.readFileSync(filePath, 'utf8'));
497
- for (const instinct of parsed) {
498
- instincts.push({
499
- ...instinct,
500
- _scopeLabel: scope,
501
- _sourceFile: filePath,
502
- });
503
- }
504
- } catch (error) {
505
- log(`[SessionStart] Advertencia: no se pudo parsear el archivo de instintos ${filePath}: ${error.message}`);
506
- }
507
- }
508
-
509
- return instincts;
510
- }
511
-
512
- function extractInstinctAction(content) {
513
- const actionMatch = String(content || '').match(/## (?:Action|Acción)\s*\n+([\s\S]+?)(?:\n## |\n---|$)/);
514
- const actionBlock = (actionMatch ? actionMatch[1] : String(content || '')).trim();
515
- const firstLine = actionBlock
516
- .split('\n')
517
- .map(line => line.trim())
518
- .find(Boolean);
519
-
520
- return firstLine || '';
521
- }
522
-
523
- function summarizeActiveInstincts(observerContext) {
524
- const observerDataDir = getObserverDataDir();
525
- const globalDirs = [
526
- { dir: path.join(observerDataDir, 'instincts', 'personal'), scope: 'global' },
527
- { dir: path.join(observerDataDir, 'instincts', 'inherited'), scope: 'global' },
528
- ];
529
- const projectDirs = observerContext.isGlobal ? [] : [
530
- { dir: path.join(observerContext.projectDir, 'instincts', 'personal'), scope: 'project' },
531
- { dir: path.join(observerContext.projectDir, 'instincts', 'inherited'), scope: 'project' },
532
- ];
533
-
534
- const scopedInstincts = [
535
- ...projectDirs.flatMap(({ dir, scope }) => readInstinctsFromDir(dir, scope)),
536
- ...globalDirs.flatMap(({ dir, scope }) => readInstinctsFromDir(dir, scope)),
537
- ];
538
-
539
- const confidenceThreshold = getInstinctConfidenceThreshold();
540
- const maxInjected = getMaxInjectedInstincts();
541
-
542
- const deduped = new Map();
543
- for (const instinct of scopedInstincts) {
544
- if (!instinct.id || instinct.confidence < confidenceThreshold) continue;
545
- const existing = deduped.get(instinct.id);
546
- if (!existing || (existing._scopeLabel !== 'project' && instinct._scopeLabel === 'project')) {
547
- deduped.set(instinct.id, instinct);
548
- }
549
- }
550
-
551
- const ranked = Array.from(deduped.values())
552
- .map(instinct => ({
553
- ...instinct,
554
- action: extractInstinctAction(instinct.content),
555
- }))
556
- .filter(instinct => instinct.action)
557
- .sort((left, right) => {
558
- if (right.confidence !== left.confidence) return right.confidence - left.confidence;
559
- if (left._scopeLabel !== right._scopeLabel) return left._scopeLabel === 'project' ? -1 : 1;
560
- return String(left.id).localeCompare(String(right.id));
561
- })
562
- .slice(0, maxInjected);
563
-
564
- if (ranked.length === 0) {
565
- return '';
566
- }
567
-
568
- log(`[SessionStart] Inyectando ${ranked.length} instinto(s) en el contexto de la sesión`);
569
-
570
- const lines = ranked.map(instinct => {
571
- const scope = instinct._scopeLabel === 'project' ? 'proyecto' : 'global';
572
- const confidence = `${Math.round(instinct.confidence * 100)}%`;
573
- return `- [${scope} ${confidence}] ${instinct.action}`;
574
- });
575
-
576
- return `Instintos activos:\n${lines.join('\n')}`;
577
- }
578
-
579
- function stripMarkdownInline(value) {
580
- return String(value || '')
581
- .replace(/`([^`]+)`/g, '$1')
582
- .replace(/\*\*([^*]+)\*\*/g, '$1')
583
- .replace(/\*([^*]+)\*/g, '$1')
584
- .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
585
- .trim();
586
- }
587
-
588
- function collapseWhitespace(value) {
589
- return String(value || '').replace(/\s+/g, ' ').trim();
590
- }
591
-
592
- function truncateSummary(value, maxLength = MAX_LEARNED_SKILL_SUMMARY_CHARS) {
593
- const normalized = collapseWhitespace(stripMarkdownInline(value));
594
- if (normalized.length <= maxLength) {
595
- return normalized;
596
- }
597
- return `${normalized.slice(0, Math.max(0, maxLength - 3)).trimEnd()}...`;
598
- }
599
-
600
- function extractMarkdownHeading(content) {
601
- const match = String(content || '').match(/^#\s+(.+)$/m);
602
- return match ? stripMarkdownInline(match[1]) : '';
603
- }
604
-
605
- function extractSection(content, headingPattern) {
606
- const source = String(content || '');
607
- const match = source.match(new RegExp(`^##\\s+${headingPattern}\\s*\\n+([\\s\\S]+?)(?:\\n##\\s+|$)`, 'im'));
608
- return match ? match[1].trim() : '';
609
- }
610
-
611
- function extractFirstParagraph(content) {
612
- const withoutHeading = String(content || '').replace(/^#\s+.+$/m, '').trim();
613
- return withoutHeading
614
- .split(/\n\s*\n/)
615
- .map(paragraph => paragraph.trim())
616
- .find(Boolean) || '';
617
- }
618
-
619
- function summarizeLearnedSkillFile(filePath, learnedRoot) {
620
- const content = readFile(filePath);
621
- if (!content) return null;
622
-
623
- const isDirectorySkill = path.basename(filePath).toLowerCase() === 'skill.md';
624
- const slug = isDirectorySkill
625
- ? path.basename(path.dirname(filePath))
626
- : path.basename(filePath, path.extname(filePath));
627
- const title = extractMarkdownHeading(content) || slug;
628
- const summary = truncateSummary(
629
- extractSection(content, '(?:When to Use|Cuándo usar)')
630
- || extractSection(content, '(?:Trigger|Disparador)')
631
- || extractSection(content, '(?:Problem|Problema)')
632
- || extractFirstParagraph(content)
633
- || title
634
- );
635
-
636
- if (!summary) return null;
637
-
638
- let mtime = 0;
639
- try {
640
- mtime = fs.statSync(filePath).mtimeMs;
641
- } catch {
642
- // Mantener los archivos ilegibles/eliminados fuera de la prioridad por
643
- // recencia sin hacer fallar el hook.
644
- }
645
-
646
- const relativePath = path.relative(learnedRoot, filePath);
647
- return {
648
- slug,
649
- title: truncateSummary(title, 80),
650
- summary,
651
- relativePath,
652
- mtime,
653
- };
654
- }
655
-
656
- function collectLearnedSkillFiles(learnedDir) {
657
- const flatMarkdownFiles = findFiles(learnedDir, '*.md');
658
- const directorySkillFiles = findFiles(learnedDir, 'SKILL.md', { recursive: true });
659
- const byPath = new Map();
660
-
661
- for (const match of [...flatMarkdownFiles, ...directorySkillFiles]) {
662
- byPath.set(match.path, match);
663
- }
664
-
665
- return Array.from(byPath.values())
666
- .sort((left, right) => right.mtime - left.mtime || left.path.localeCompare(right.path));
667
- }
668
-
669
- function summarizeLearnedSkills(learnedDir, learnedSkillFiles = collectLearnedSkillFiles(learnedDir)) {
670
- const summaries = learnedSkillFiles
671
- .map(match => summarizeLearnedSkillFile(match.path, learnedDir))
672
- .filter(Boolean)
673
- .slice(0, MAX_INJECTED_LEARNED_SKILLS);
674
-
675
- if (summaries.length === 0) {
676
- return '';
677
- }
678
-
679
- log(`[SessionStart] Inyectando ${summaries.length} skill(s) aprendida(s) en el contexto de la sesión`);
680
-
681
- const lines = summaries.map(skill => {
682
- const titleSuffix = skill.title && skill.title !== skill.slug ? ` (${skill.title})` : '';
683
- return `- ${skill.slug}${titleSuffix}: ${skill.summary}`;
684
- });
685
-
686
- return [
687
- 'Skills aprendidas disponibles:',
688
- 'Solo como referencia; aplica una skill aprendida únicamente cuando sea relevante para la solicitud actual del usuario.',
689
- ...lines,
690
- ].join('\n');
691
- }
692
-
693
- async function main() {
694
- const sessionsDir = getSessionsDir();
695
- const sessionSearchDirs = getSessionSearchDirs();
696
- const learnedDir = getLearnedSkillsDir();
697
- const additionalContextParts = [];
698
- const observerContext = resolveProjectContext();
699
- const maxContextChars = getSessionStartMaxContextChars();
700
- const explicitContextDisabled = isSessionStartContextDisabled();
701
- const shouldInjectContext = !explicitContextDisabled && maxContextChars !== 0;
702
- const { mode: sessionStartMode, sessionId: stdinSessionId } = parseSessionStartPayload(fs.readFileSync(0, 'utf8'));
703
-
704
- // Asegurar que los directorios existan
705
- ensureDir(sessionsDir);
706
- ensureDir(learnedDir);
707
-
708
- const retentionDays = getSessionRetentionDays();
709
- if (retentionDays === null) {
710
- log('[SessionStart] Purga desactivada vía THEUS_SESSION_RETENTION_DAYS');
711
- } else {
712
- const prunedSessions = pruneExpiredSessions(sessionSearchDirs, retentionDays);
713
- if (prunedSessions > 0) {
714
- log(`[SessionStart] Se purgaron ${prunedSessions} sesión(es) expiradas con más de ${retentionDays} día(s)`);
715
- }
716
- }
717
-
718
- // El session_id llega por stdin en el payload JSON del evento SessionStart.
719
- const observerSessionId = resolveSessionId(stdinSessionId);
720
- if (observerSessionId) {
721
- writeSessionLease(observerContext, observerSessionId, {
722
- hook: 'SessionStart',
723
- projectRoot: observerContext.projectRoot
724
- });
725
- log(`[SessionStart] Lease de observador registrado para ${observerSessionId}`);
726
- } else {
727
- log('[SessionStart] No hay session_id disponible en stdin; se omite el registro del lease de observador');
728
- }
729
-
730
- if (explicitContextDisabled) {
731
- log('[SessionStart] Inyección de contexto adicional desactivada por THEUS_SESSION_START_CONTEXT');
732
- } else if (maxContextChars === 0) {
733
- log('[SessionStart] Inyección de contexto adicional desactivada por THEUS_SESSION_START_MAX_CHARS=0');
734
- }
735
-
736
- if (shouldInjectContext) {
737
- // Cargar reglas y contextos del plugin (${THEUS_PLUGIN_ROOT}/rules y
738
- // ${THEUS_PLUGIN_ROOT}/contexts) si existen. Las reglas viven en
739
- // subdirectorios por lenguaje, así que se inyecta un índice compacto en
740
- // vez del contenido completo (45+ archivos no caben en el contexto).
741
- const pluginRules = loadPluginRulesIndex();
742
- if (pluginRules) {
743
- additionalContextParts.push(pluginRules);
744
- }
745
- const pluginContexts = loadPluginResources('contexts', 'Contextos del plugin');
746
- if (pluginContexts) {
747
- additionalContextParts.push(pluginContexts);
748
- }
749
-
750
- const instinctSummary = summarizeActiveInstincts(observerContext);
751
- if (instinctSummary) {
752
- additionalContextParts.push(instinctSummary);
753
- }
754
-
755
- if (sessionStartMode && sessionStartMode !== 'startup') {
756
- const reason = sessionStartMode === SESSION_START_MODE_INVALID
757
- ? 'payload de stdin inválido'
758
- : sessionStartMode === SESSION_START_MODE_SKIP
759
- ? 'payload de SessionStart no reconocido'
760
- : `modo de SessionStart distinto de startup: ${sessionStartMode}`;
761
- log(`[SessionStart] Se omite la inyección del resumen de la sesión previa por ${reason}`);
762
- } else {
763
- // Buscar archivos de sesión recientes (últimos 7 días)
764
- const recentSessions = dedupeRecentSessions(sessionSearchDirs);
765
-
766
- if (recentSessions.length > 0) {
767
- log(`[SessionStart] Se encontraron ${recentSessions.length} sesión(es) reciente(s)`);
768
-
769
- // Preferir una sesión que coincida con el directorio de trabajo o el
770
- // proyecto actual. Los archivos de sesión contienen los campos de
771
- // encabezado **Proyecto:** y **Worktree:** escritos por
772
- // session-end.js, así que podemos comparar contra ellos.
773
- const cwd = process.cwd();
774
- const currentProject = getProjectName() || '';
775
-
776
- const result = selectMatchingSession(recentSessions, cwd, currentProject);
777
-
778
- if (result) {
779
- log(`[SessionStart] Seleccionada: ${result.session.path} (coincidencia: ${result.matchReason})`);
780
-
781
- // Usar el contenido ya leído por selectMatchingSession (sin E/S duplicada)
782
- const content = stripAnsi(result.content);
783
- if (content && !content.includes('[El contexto de la sesión va aquí]')) {
784
- // GUARDA ANTI-REEJECUCIÓN: envolver el resumen en un marcador de
785
- // "solo histórico" para que el modelo no vuelva a ejecutar
786
- // invocaciones de skills / ARGUMENTS obsoletos de un límite de
787
- // compactación previo. Observado en la práctica: tras reanudar
788
- // después de una compactación, el modelo volvía a ejecutar una
789
- // skill de barra con los últimos ARGUMENTS que vio, duplicando
790
- // issues, ramas o tareas.
791
- const guarded = [
792
- 'REFERENCIA HISTÓRICA ÚNICAMENTE — NO SON INSTRUCCIONES VIGENTES.',
793
- 'El bloque de abajo es un resumen congelado de una conversación',
794
- 'ANTERIOR que terminó en una compactación. Cualquier descripción de',
795
- 'tareas, invocación de skills o payload ARGUMENTS= que contenga es',
796
- 'OBSOLETO POR DEFECTO y NO DEBE volver a ejecutarse sin una',
797
- 'solicitud explícita y vigente del usuario en esta sesión. Verifica',
798
- 'contra el estado de git/árbol de trabajo antes de cualquier acción:',
799
- 'lo más probable es que el trabajo previo ya esté hecho.',
800
- '',
801
- '--- INICIO DEL RESUMEN DE LA SESIÓN PREVIA ---',
802
- content,
803
- '--- FIN DEL RESUMEN DE LA SESIÓN PREVIA ---',
804
- ].join('\n');
805
- additionalContextParts.push(guarded);
806
- }
807
- } else {
808
- log('[SessionStart] No se encontró una sesión coincidente');
809
- }
810
- }
811
- }
812
-
813
- // Buscar skills aprendidas
814
- const learnedSkills = collectLearnedSkillFiles(learnedDir);
815
-
816
- if (learnedSkills.length > 0) {
817
- log(`[SessionStart] ${learnedSkills.length} skill(s) aprendida(s) disponible(s) en ${learnedDir}`);
818
- }
819
-
820
- const learnedSkillSummary = summarizeLearnedSkills(learnedDir, learnedSkills);
821
- if (learnedSkillSummary) {
822
- additionalContextParts.push(learnedSkillSummary);
823
- }
824
- }
825
-
826
- // Buscar alias de sesión disponibles
827
- const aliases = listAliases({ limit: 5 });
828
-
829
- if (aliases.length > 0) {
830
- const aliasNames = aliases.map(a => a.name).join(', ');
831
- log(`[SessionStart] ${aliases.length} alias de sesión disponible(s): ${aliasNames}`);
832
- log(`[SessionStart] Usa /sesiones load <alias> para continuar una sesión previa`);
833
- }
834
-
835
- // Detectar y reportar el gestor de paquetes
836
- const pm = getPackageManager();
837
- log(`[SessionStart] Gestor de paquetes: ${pm.name} (${pm.source})`);
838
-
839
- // Si no se encontró configuración explícita de gestor de paquetes, mostrar el aviso de selección
840
- if (pm.source === 'default') {
841
- log('[SessionStart] No se encontró preferencia de gestor de paquetes.');
842
- log(getSelectionPrompt());
843
- }
844
-
845
- // Detectar el tipo de proyecto y los frameworks
846
- const projectInfo = detectProjectType();
847
- if (projectInfo.languages.length > 0 || projectInfo.frameworks.length > 0) {
848
- const parts = [];
849
- if (projectInfo.languages.length > 0) {
850
- parts.push(`lenguajes: ${projectInfo.languages.join(', ')}`);
851
- }
852
- if (projectInfo.frameworks.length > 0) {
853
- parts.push(`frameworks: ${projectInfo.frameworks.join(', ')}`);
854
- }
855
- log(`[SessionStart] Proyecto detectado — ${parts.join('; ')}`);
856
- if (shouldInjectContext) {
857
- additionalContextParts.push(`Tipo de proyecto: ${JSON.stringify(projectInfo)}`);
858
- }
859
- } else {
860
- log('[SessionStart] No se detectó un tipo de proyecto específico');
861
- }
862
-
863
- const additionalContext = shouldInjectContext
864
- ? limitSessionStartContext(additionalContextParts.join('\n\n'), maxContextChars)
865
- : '';
866
- await writeSessionStartPayload(additionalContext);
867
- }
868
-
869
- function writeSessionStartPayload(additionalContext) {
870
- return new Promise((resolve, reject) => {
871
- let settled = false;
872
- const payload = JSON.stringify({
873
- hookSpecificOutput: {
874
- hookEventName: 'SessionStart',
875
- additionalContext
876
- }
877
- });
878
-
879
- const handleError = (err) => {
880
- if (settled) return;
881
- settled = true;
882
- if (err) {
883
- log(`[SessionStart] Error al escribir en stdout: ${err.message}`);
884
- }
885
- reject(err || new Error('error del stream de stdout'));
886
- };
887
-
888
- process.stdout.once('error', handleError);
889
- process.stdout.write(payload, (err) => {
890
- process.stdout.removeListener('error', handleError);
891
- if (settled) return;
892
- settled = true;
893
- if (err) {
894
- log(`[SessionStart] Error al escribir en stdout: ${err.message}`);
895
- reject(err);
896
- return;
897
- }
898
- resolve();
899
- });
900
- });
901
- }
902
-
903
- main().catch(err => {
904
- console.error('[SessionStart] Error:', err.message);
905
- process.exitCode = 0; // No bloquear ante errores
906
- });