theus-cli-linux-arm64 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RELEASE.json +6 -6
- package/bin/theus +0 -0
- package/package.json +1 -1
- package/vendor/higiene-motor/PARCHES.md +244 -0
- package/vendor/higiene-motor/audit_dir.py +166 -0
- package/vendor/higiene-motor/audit_lib.py +333 -0
- package/vendor/higiene-motor/audit_website.py +635 -0
- package/vendor/higiene-motor/av_meta.py +498 -0
- package/vendor/higiene-motor/check_staged.py +71 -0
- package/vendor/higiene-motor/clean_ctrlregen.py +212 -0
- package/vendor/higiene-motor/clean_file.py +237 -0
- package/vendor/higiene-motor/clean_image.py +218 -0
- package/vendor/higiene-motor/clean_staged.py +143 -0
- package/vendor/higiene-motor/clean_text.py +108 -0
- package/vendor/higiene-motor/common.py +486 -0
- package/vendor/higiene-motor/container_meta.py +2522 -0
- package/vendor/higiene-motor/detect_gumbel.py +308 -0
- package/vendor/higiene-motor/detect_text_watermark.py +613 -0
- package/vendor/higiene-motor/format_dispatch.py +157 -0
- package/vendor/higiene-motor/hook_written_file.py +253 -0
- package/vendor/higiene-motor/image_meta.py +2171 -0
- package/vendor/higiene-motor/inspect_file.py +138 -0
- package/vendor/higiene-motor/inspect_image.py +72 -0
- package/vendor/higiene-motor/inspect_text.py +86 -0
- package/vendor/higiene-motor/markdiffusion_harness.py +533 -0
- package/vendor/higiene-motor/rewrite_text.py +737 -0
- package/vendor/higiene-motor/score_stylometry.py +460 -0
- package/vendor/higiene-motor/score_synthid.py +165 -0
- package/vendor/higiene-motor/server.py +1059 -0
- package/vendor/higiene-motor/synthid_score_server.py +176 -0
- package/vendor/higiene-motor/text_detectors.py +433 -0
- package/vendor/higiene-motor/text_unicode.py +730 -0
- package/vendor/theus-arsenal/.arsenal-nombres-ola2.json +0 -6
- package/vendor/theus-arsenal/.arsenal-nombres-ola3.json +0 -72
- package/vendor/theus-arsenal/.mailmap +0 -2
- package/vendor/theus-arsenal/.theus-plugin/marketplace.json +0 -25
- package/vendor/theus-arsenal/.theus-plugin/plugin.json +0 -20
- package/vendor/theus-arsenal/AUTHORS.md +0 -8
- package/vendor/theus-arsenal/CLEANROOM_REPLACEMENT_PLAN.md +0 -11
- package/vendor/theus-arsenal/LICENSE +0 -26
- package/vendor/theus-arsenal/PROVENANCE.md +0 -9
- package/vendor/theus-arsenal/README.md +0 -41
- package/vendor/theus-arsenal/THIRD_PARTY.md +0 -80
- package/vendor/theus-arsenal/agents/actualizador-docs.md +0 -123
- package/vendor/theus-arsenal/agents/analista-comentarios.md +0 -53
- package/vendor/theus-arsenal/agents/analista-conversaciones.md +0 -60
- package/vendor/theus-arsenal/agents/analista-tests-pr.md +0 -53
- package/vendor/theus-arsenal/agents/analista-tipos.md +0 -49
- package/vendor/theus-arsenal/agents/arquitecto-accesibilidad.md +0 -148
- package/vendor/theus-arsenal/agents/arquitecto-codigo.md +0 -79
- package/vendor/theus-arsenal/agents/arquitecto-homelab.md +0 -90
- package/vendor/theus-arsenal/agents/arquitecto-redes.md +0 -116
- package/vendor/theus-arsenal/agents/arquitecto-sistemas.md +0 -219
- package/vendor/theus-arsenal/agents/bifurcador-opensource.md +0 -206
- package/vendor/theus-arsenal/agents/cazador-fallos-silenciosos.md +0 -58
- package/vendor/theus-arsenal/agents/consultor-documentacion.md +0 -76
- package/vendor/theus-arsenal/agents/diagnosticador-redes.md +0 -135
- package/vendor/theus-arsenal/agents/ejecutor-e2e.md +0 -96
- package/vendor/theus-arsenal/agents/empaquetador-opensource.md +0 -257
- package/vendor/theus-arsenal/agents/escaner-secretos.md +0 -196
- package/vendor/theus-arsenal/agents/especialista-seo.md +0 -70
- package/vendor/theus-arsenal/agents/estratega-marketing.md +0 -158
- package/vendor/theus-arsenal/agents/evaluador-agentes.md +0 -214
- package/vendor/theus-arsenal/agents/evaluador-harness.md +0 -217
- package/vendor/theus-arsenal/agents/explorador-codigo.md +0 -79
- package/vendor/theus-arsenal/agents/extractor-specs.md +0 -214
- package/vendor/theus-arsenal/agents/generador-harness.md +0 -139
- package/vendor/theus-arsenal/agents/guia-tdd.md +0 -99
- package/vendor/theus-arsenal/agents/jefe-de-gabinete.md +0 -162
- package/vendor/theus-arsenal/agents/limpiador-refactors.md +0 -93
- package/vendor/theus-arsenal/agents/optimizador-rendimiento.md +0 -454
- package/vendor/theus-arsenal/agents/planificador-harness.md +0 -107
- package/vendor/theus-arsenal/agents/planificador.md +0 -221
- package/vendor/theus-arsenal/agents/resolutor-apps-harmonyos.md +0 -181
- package/vendor/theus-arsenal/agents/resolutor-builds-cpp.md +0 -98
- package/vendor/theus-arsenal/agents/resolutor-builds-dart.md +0 -209
- package/vendor/theus-arsenal/agents/resolutor-builds-django.md +0 -253
- package/vendor/theus-arsenal/agents/resolutor-builds-go.md +0 -102
- package/vendor/theus-arsenal/agents/resolutor-builds-java.md +0 -274
- package/vendor/theus-arsenal/agents/resolutor-builds-kotlin.md +0 -128
- package/vendor/theus-arsenal/agents/resolutor-builds-pytorch.md +0 -128
- package/vendor/theus-arsenal/agents/resolutor-builds-react.md +0 -214
- package/vendor/theus-arsenal/agents/resolutor-builds-rust.md +0 -156
- package/vendor/theus-arsenal/agents/resolutor-builds-swift.md +0 -169
- package/vendor/theus-arsenal/agents/resolutor-builds.md +0 -122
- package/vendor/theus-arsenal/agents/revisor-bd.md +0 -97
- package/vendor/theus-arsenal/agents/revisor-codigo.md +0 -291
- package/vendor/theus-arsenal/agents/revisor-config-red.md +0 -116
- package/vendor/theus-arsenal/agents/revisor-cpp.md +0 -80
- package/vendor/theus-arsenal/agents/revisor-csharp.md +0 -109
- package/vendor/theus-arsenal/agents/revisor-django.md +0 -168
- package/vendor/theus-arsenal/agents/revisor-fastapi.md +0 -82
- package/vendor/theus-arsenal/agents/revisor-flutter.md +0 -251
- package/vendor/theus-arsenal/agents/revisor-go.md +0 -84
- package/vendor/theus-arsenal/agents/revisor-java.md +0 -192
- package/vendor/theus-arsenal/agents/revisor-kotlin.md +0 -171
- package/vendor/theus-arsenal/agents/revisor-ml.md +0 -159
- package/vendor/theus-arsenal/agents/revisor-php.md +0 -108
- package/vendor/theus-arsenal/agents/revisor-python.md +0 -106
- package/vendor/theus-arsenal/agents/revisor-react.md +0 -166
- package/vendor/theus-arsenal/agents/revisor-rust.md +0 -102
- package/vendor/theus-arsenal/agents/revisor-seguridad.md +0 -116
- package/vendor/theus-arsenal/agents/revisor-software-clinico.md +0 -95
- package/vendor/theus-arsenal/agents/revisor-swift.md +0 -115
- package/vendor/theus-arsenal/agents/revisor-typescript.md +0 -123
- package/vendor/theus-arsenal/agents/revisor-vue.md +0 -205
- package/vendor/theus-arsenal/agents/simplificador-codigo.md +0 -55
- package/vendor/theus-arsenal/commands/actualizar-docs.md +0 -88
- package/vendor/theus-arsenal/commands/actualizar-mapas-codigo.md +0 -78
- package/vendor/theus-arsenal/commands/aprender-evaluar.md +0 -109
- package/vendor/theus-arsenal/commands/aprender.md +0 -74
- package/vendor/theus-arsenal/commands/arreglar-build.md +0 -66
- package/vendor/theus-arsenal/commands/bucle-multiperspectiva.md +0 -153
- package/vendor/theus-arsenal/commands/build-cpp.md +0 -173
- package/vendor/theus-arsenal/commands/build-flutter.md +0 -164
- package/vendor/theus-arsenal/commands/build-go.md +0 -183
- package/vendor/theus-arsenal/commands/build-gradle.md +0 -75
- package/vendor/theus-arsenal/commands/build-kotlin.md +0 -176
- package/vendor/theus-arsenal/commands/build-react.md +0 -187
- package/vendor/theus-arsenal/commands/build-rust.md +0 -187
- package/vendor/theus-arsenal/commands/campana-marketing.md +0 -125
- package/vendor/theus-arsenal/commands/checkpoint.md +0 -78
- package/vendor/theus-arsenal/commands/cobertura-tests.md +0 -73
- package/vendor/theus-arsenal/commands/configurar-gestor-paquetes.md +0 -86
- package/vendor/theus-arsenal/commands/consulta.md +0 -164
- package/vendor/theus-arsenal/commands/control-calidad.md +0 -50
- package/vendor/theus-arsenal/commands/crear-skill.md +0 -77
- package/vendor/theus-arsenal/commands/enrutar-modelo.md +0 -30
- package/vendor/theus-arsenal/commands/epica-desbloquear.md +0 -17
- package/vendor/theus-arsenal/commands/epica-descomponer.md +0 -22
- package/vendor/theus-arsenal/commands/epica-publicar.md +0 -21
- package/vendor/theus-arsenal/commands/epica-reclamar.md +0 -25
- package/vendor/theus-arsenal/commands/epica-revisar.md +0 -22
- package/vendor/theus-arsenal/commands/epica-sincronizar.md +0 -21
- package/vendor/theus-arsenal/commands/epica-validar.md +0 -21
- package/vendor/theus-arsenal/commands/evolucionar.md +0 -176
- package/vendor/theus-arsenal/commands/funcionalidad.md +0 -49
- package/vendor/theus-arsenal/commands/guardar-sesion.md +0 -278
- package/vendor/theus-arsenal/commands/harness-build.md +0 -111
- package/vendor/theus-arsenal/commands/harness-diseno.md +0 -46
- package/vendor/theus-arsenal/commands/informe-costos.md +0 -90
- package/vendor/theus-arsenal/commands/iniciar-bucle.md +0 -36
- package/vendor/theus-arsenal/commands/instintos-estado.md +0 -53
- package/vendor/theus-arsenal/commands/instintos-exportar.md +0 -69
- package/vendor/theus-arsenal/commands/instintos-importar.md +0 -120
- package/vendor/theus-arsenal/commands/lienzo-planes.md +0 -48
- package/vendor/theus-arsenal/commands/limpiar-refactor.md +0 -84
- package/vendor/theus-arsenal/commands/modo-seguro.md +0 -96
- package/vendor/theus-arsenal/commands/orq-agregar-funcionalidad.md +0 -36
- package/vendor/theus-arsenal/commands/orq-cambiar-funcionalidad.md +0 -38
- package/vendor/theus-arsenal/commands/orq-construir-mvp.md +0 -36
- package/vendor/theus-arsenal/commands/orq-corregir-defecto.md +0 -40
- package/vendor/theus-arsenal/commands/orq-refinar-codigo.md +0 -44
- package/vendor/theus-arsenal/commands/orq-revisar.md +0 -135
- package/vendor/theus-arsenal/commands/plan-prd.md +0 -160
- package/vendor/theus-arsenal/commands/plan.md +0 -198
- package/vendor/theus-arsenal/commands/podar.md +0 -31
- package/vendor/theus-arsenal/commands/pr.md +0 -181
- package/vendor/theus-arsenal/commands/promover.md +0 -41
- package/vendor/theus-arsenal/commands/proyectos.md +0 -33
- package/vendor/theus-arsenal/commands/prp-commit.md +0 -112
- package/vendor/theus-arsenal/commands/prp-implementar.md +0 -385
- package/vendor/theus-arsenal/commands/prp-planificar.md +0 -501
- package/vendor/theus-arsenal/commands/reanudar-sesion.md +0 -160
- package/vendor/theus-arsenal/commands/revisar-codigo.md +0 -289
- package/vendor/theus-arsenal/commands/revisar-cpp.md +0 -132
- package/vendor/theus-arsenal/commands/revisar-fastapi.md +0 -39
- package/vendor/theus-arsenal/commands/revisar-flutter.md +0 -115
- package/vendor/theus-arsenal/commands/revisar-go.md +0 -148
- package/vendor/theus-arsenal/commands/revisar-kotlin.md +0 -140
- package/vendor/theus-arsenal/commands/revisar-pr.md +0 -37
- package/vendor/theus-arsenal/commands/revisar-python.md +0 -297
- package/vendor/theus-arsenal/commands/revisar-react.md +0 -170
- package/vendor/theus-arsenal/commands/revisar-rust.md +0 -142
- package/vendor/theus-arsenal/commands/revisar-vue.md +0 -174
- package/vendor/theus-arsenal/commands/salud-skills.md +0 -52
- package/vendor/theus-arsenal/commands/sesiones.md +0 -345
- package/vendor/theus-arsenal/commands/test-cpp.md +0 -252
- package/vendor/theus-arsenal/commands/test-flutter.md +0 -143
- package/vendor/theus-arsenal/commands/test-go.md +0 -268
- package/vendor/theus-arsenal/commands/test-kotlin.md +0 -312
- package/vendor/theus-arsenal/commands/test-react.md +0 -265
- package/vendor/theus-arsenal/commands/test-rust.md +0 -309
- package/vendor/theus-arsenal/commands/vigilancia-canary.md +0 -43
- package/vendor/theus-arsenal/hooks/hooks.json +0 -274
- package/vendor/theus-arsenal/package.json +0 -6
- package/vendor/theus-arsenal/rules/angular/coding-style.md +0 -182
- package/vendor/theus-arsenal/rules/angular/hooks.md +0 -25
- package/vendor/theus-arsenal/rules/angular/patterns.md +0 -249
- package/vendor/theus-arsenal/rules/angular/security.md +0 -87
- package/vendor/theus-arsenal/rules/angular/testing.md +0 -164
- package/vendor/theus-arsenal/rules/arkts/coding-style.md +0 -153
- package/vendor/theus-arsenal/rules/arkts/hooks.md +0 -80
- package/vendor/theus-arsenal/rules/arkts/patterns.md +0 -236
- package/vendor/theus-arsenal/rules/arkts/security.md +0 -141
- package/vendor/theus-arsenal/rules/arkts/testing.md +0 -126
- package/vendor/theus-arsenal/rules/common/agents.md +0 -49
- package/vendor/theus-arsenal/rules/common/code-review.md +0 -123
- package/vendor/theus-arsenal/rules/common/coding-style.md +0 -90
- package/vendor/theus-arsenal/rules/common/development-workflow.md +0 -44
- package/vendor/theus-arsenal/rules/common/git-workflow.md +0 -24
- package/vendor/theus-arsenal/rules/common/hooks.md +0 -32
- package/vendor/theus-arsenal/rules/common/patterns.md +0 -31
- package/vendor/theus-arsenal/rules/common/performance.md +0 -53
- package/vendor/theus-arsenal/rules/common/security.md +0 -29
- package/vendor/theus-arsenal/rules/common/testing.md +0 -57
- package/vendor/theus-arsenal/rules/cpp/coding-style.md +0 -44
- package/vendor/theus-arsenal/rules/cpp/hooks.md +0 -39
- package/vendor/theus-arsenal/rules/cpp/patterns.md +0 -51
- package/vendor/theus-arsenal/rules/cpp/security.md +0 -51
- package/vendor/theus-arsenal/rules/cpp/testing.md +0 -44
- package/vendor/theus-arsenal/rules/csharp/coding-style.md +0 -72
- package/vendor/theus-arsenal/rules/csharp/hooks.md +0 -25
- package/vendor/theus-arsenal/rules/csharp/patterns.md +0 -50
- package/vendor/theus-arsenal/rules/csharp/security.md +0 -58
- package/vendor/theus-arsenal/rules/csharp/testing.md +0 -50
- package/vendor/theus-arsenal/rules/dart/coding-style.md +0 -159
- package/vendor/theus-arsenal/rules/dart/hooks.md +0 -68
- package/vendor/theus-arsenal/rules/dart/patterns.md +0 -261
- package/vendor/theus-arsenal/rules/dart/security.md +0 -135
- package/vendor/theus-arsenal/rules/dart/testing.md +0 -215
- package/vendor/theus-arsenal/rules/fsharp/coding-style.md +0 -112
- package/vendor/theus-arsenal/rules/fsharp/hooks.md +0 -26
- package/vendor/theus-arsenal/rules/fsharp/patterns.md +0 -111
- package/vendor/theus-arsenal/rules/fsharp/security.md +0 -76
- package/vendor/theus-arsenal/rules/fsharp/testing.md +0 -62
- package/vendor/theus-arsenal/rules/golang/coding-style.md +0 -32
- package/vendor/theus-arsenal/rules/golang/hooks.md +0 -17
- package/vendor/theus-arsenal/rules/golang/patterns.md +0 -45
- package/vendor/theus-arsenal/rules/golang/security.md +0 -34
- package/vendor/theus-arsenal/rules/golang/testing.md +0 -31
- package/vendor/theus-arsenal/rules/java/coding-style.md +0 -114
- package/vendor/theus-arsenal/rules/java/hooks.md +0 -18
- package/vendor/theus-arsenal/rules/java/patterns.md +0 -147
- package/vendor/theus-arsenal/rules/java/security.md +0 -101
- package/vendor/theus-arsenal/rules/java/testing.md +0 -133
- package/vendor/theus-arsenal/rules/kotlin/coding-style.md +0 -86
- package/vendor/theus-arsenal/rules/kotlin/hooks.md +0 -17
- package/vendor/theus-arsenal/rules/kotlin/patterns.md +0 -146
- package/vendor/theus-arsenal/rules/kotlin/security.md +0 -82
- package/vendor/theus-arsenal/rules/kotlin/testing.md +0 -128
- package/vendor/theus-arsenal/rules/nuxt/coding-style.md +0 -47
- package/vendor/theus-arsenal/rules/nuxt/hooks.md +0 -39
- package/vendor/theus-arsenal/rules/nuxt/patterns.md +0 -54
- package/vendor/theus-arsenal/rules/nuxt/security.md +0 -48
- package/vendor/theus-arsenal/rules/nuxt/testing.md +0 -49
- package/vendor/theus-arsenal/rules/php/coding-style.md +0 -40
- package/vendor/theus-arsenal/rules/php/hooks.md +0 -24
- package/vendor/theus-arsenal/rules/php/patterns.md +0 -33
- package/vendor/theus-arsenal/rules/php/security.md +0 -37
- package/vendor/theus-arsenal/rules/php/testing.md +0 -38
- package/vendor/theus-arsenal/rules/python/coding-style.md +0 -42
- package/vendor/theus-arsenal/rules/python/fastapi.md +0 -58
- package/vendor/theus-arsenal/rules/python/hooks.md +0 -19
- package/vendor/theus-arsenal/rules/python/patterns.md +0 -39
- package/vendor/theus-arsenal/rules/python/security.md +0 -30
- package/vendor/theus-arsenal/rules/python/testing.md +0 -38
- package/vendor/theus-arsenal/rules/react/coding-style.md +0 -109
- package/vendor/theus-arsenal/rules/react/hooks.md +0 -187
- package/vendor/theus-arsenal/rules/react/patterns.md +0 -194
- package/vendor/theus-arsenal/rules/react/security.md +0 -180
- package/vendor/theus-arsenal/rules/react/testing.md +0 -208
- package/vendor/theus-arsenal/rules/react-native/accessibility.md +0 -55
- package/vendor/theus-arsenal/rules/react-native/coding-style.md +0 -71
- package/vendor/theus-arsenal/rules/react-native/hooks.md +0 -28
- package/vendor/theus-arsenal/rules/react-native/patterns.md +0 -88
- package/vendor/theus-arsenal/rules/react-native/performance.md +0 -45
- package/vendor/theus-arsenal/rules/react-native/production-readiness.md +0 -51
- package/vendor/theus-arsenal/rules/react-native/security.md +0 -43
- package/vendor/theus-arsenal/rules/react-native/testing.md +0 -52
- package/vendor/theus-arsenal/rules/ruby/coding-style.md +0 -46
- package/vendor/theus-arsenal/rules/ruby/hooks.md +0 -37
- package/vendor/theus-arsenal/rules/ruby/patterns.md +0 -44
- package/vendor/theus-arsenal/rules/ruby/security.md +0 -51
- package/vendor/theus-arsenal/rules/ruby/testing.md +0 -51
- package/vendor/theus-arsenal/rules/rust/coding-style.md +0 -151
- package/vendor/theus-arsenal/rules/rust/hooks.md +0 -16
- package/vendor/theus-arsenal/rules/rust/patterns.md +0 -168
- package/vendor/theus-arsenal/rules/rust/security.md +0 -141
- package/vendor/theus-arsenal/rules/rust/testing.md +0 -154
- package/vendor/theus-arsenal/rules/swift/coding-style.md +0 -47
- package/vendor/theus-arsenal/rules/swift/hooks.md +0 -20
- package/vendor/theus-arsenal/rules/swift/patterns.md +0 -66
- package/vendor/theus-arsenal/rules/swift/security.md +0 -33
- package/vendor/theus-arsenal/rules/swift/testing.md +0 -45
- package/vendor/theus-arsenal/rules/typescript/coding-style.md +0 -199
- package/vendor/theus-arsenal/rules/typescript/hooks.md +0 -22
- package/vendor/theus-arsenal/rules/typescript/patterns.md +0 -52
- package/vendor/theus-arsenal/rules/typescript/security.md +0 -28
- package/vendor/theus-arsenal/rules/typescript/testing.md +0 -18
- package/vendor/theus-arsenal/rules/vue/coding-style.md +0 -54
- package/vendor/theus-arsenal/rules/vue/hooks.md +0 -45
- package/vendor/theus-arsenal/rules/vue/patterns.md +0 -56
- package/vendor/theus-arsenal/rules/vue/security.md +0 -46
- package/vendor/theus-arsenal/rules/vue/testing.md +0 -53
- package/vendor/theus-arsenal/rules/web/coding-style.md +0 -108
- package/vendor/theus-arsenal/rules/web/design-quality.md +0 -75
- package/vendor/theus-arsenal/rules/web/hooks.md +0 -141
- package/vendor/theus-arsenal/rules/web/patterns.md +0 -91
- package/vendor/theus-arsenal/rules/web/performance.md +0 -76
- package/vendor/theus-arsenal/rules/web/security.md +0 -69
- package/vendor/theus-arsenal/rules/web/testing.md +0 -67
- package/vendor/theus-arsenal/scripts/hooks/bash-hook-dispatcher.js +0 -192
- package/vendor/theus-arsenal/scripts/hooks/block-no-verify.js +0 -556
- package/vendor/theus-arsenal/scripts/hooks/check-console-log.js +0 -92
- package/vendor/theus-arsenal/scripts/hooks/check-hook-enabled.js +0 -16
- package/vendor/theus-arsenal/scripts/hooks/config-protection.js +0 -171
- package/vendor/theus-arsenal/scripts/hooks/design-quality-check.js +0 -132
- package/vendor/theus-arsenal/scripts/hooks/doc-file-warning.js +0 -110
- package/vendor/theus-arsenal/scripts/hooks/modo-seguro.js +0 -158
- package/vendor/theus-arsenal/scripts/hooks/notificacion-escritorio.js +0 -208
- package/vendor/theus-arsenal/scripts/hooks/plugin-hook-bootstrap.js +0 -280
- package/vendor/theus-arsenal/scripts/hooks/post-bash-command-log.js +0 -87
- package/vendor/theus-arsenal/scripts/hooks/post-bash-dispatcher.js +0 -24
- package/vendor/theus-arsenal/scripts/hooks/post-bash-pr-created.js +0 -60
- package/vendor/theus-arsenal/scripts/hooks/post-edit-accumulator.js +0 -94
- package/vendor/theus-arsenal/scripts/hooks/post-edit-console-warn.js +0 -54
- package/vendor/theus-arsenal/scripts/hooks/post-edit-format.js +0 -110
- package/vendor/theus-arsenal/scripts/hooks/post-edit-typecheck.js +0 -98
- package/vendor/theus-arsenal/scripts/hooks/pre-bash-commit-quality.js +0 -447
- package/vendor/theus-arsenal/scripts/hooks/pre-bash-dev-server-block.js +0 -232
- package/vendor/theus-arsenal/scripts/hooks/pre-bash-dispatcher.js +0 -27
- package/vendor/theus-arsenal/scripts/hooks/pre-compact.js +0 -101
- package/vendor/theus-arsenal/scripts/hooks/pretooluse-visible-output.js +0 -49
- package/vendor/theus-arsenal/scripts/hooks/quality-gate.js +0 -168
- package/vendor/theus-arsenal/scripts/hooks/run-with-flags.js +0 -271
- package/vendor/theus-arsenal/scripts/hooks/salud-mcp.js +0 -749
- package/vendor/theus-arsenal/scripts/hooks/seguimiento-costos.js +0 -161
- package/vendor/theus-arsenal/scripts/hooks/session-end.js +0 -340
- package/vendor/theus-arsenal/scripts/hooks/session-start.js +0 -906
- package/vendor/theus-arsenal/scripts/hooks/stop-format-typecheck.js +0 -263
- package/vendor/theus-arsenal/scripts/hooks/suggest-compact.js +0 -286
- package/vendor/theus-arsenal/scripts/hooks/theus-context-monitor.js +0 -289
- package/vendor/theus-arsenal/scripts/hooks/verificacion-factual.js +0 -1278
- package/vendor/theus-arsenal/scripts/lib/agent-data-home.js +0 -96
- package/vendor/theus-arsenal/scripts/lib/cost-estimate.js +0 -66
- package/vendor/theus-arsenal/scripts/lib/hook-flags.js +0 -79
- package/vendor/theus-arsenal/scripts/lib/llm-summary.js +0 -185
- package/vendor/theus-arsenal/scripts/lib/loopback-guard.js +0 -54
- package/vendor/theus-arsenal/scripts/lib/observer-sessions.js +0 -237
- package/vendor/theus-arsenal/scripts/lib/package-manager.d.ts +0 -120
- package/vendor/theus-arsenal/scripts/lib/package-manager.js +0 -434
- package/vendor/theus-arsenal/scripts/lib/path-safety.js +0 -86
- package/vendor/theus-arsenal/scripts/lib/plan-canvas/markdown.js +0 -285
- package/vendor/theus-arsenal/scripts/lib/plan-canvas/sdk.js +0 -238
- package/vendor/theus-arsenal/scripts/lib/plan-canvas/server.js +0 -534
- package/vendor/theus-arsenal/scripts/lib/plan-canvas/sessions.js +0 -274
- package/vendor/theus-arsenal/scripts/lib/plan-canvas/ui.js +0 -546
- package/vendor/theus-arsenal/scripts/lib/project-detect.js +0 -451
- package/vendor/theus-arsenal/scripts/lib/resolve-formatter.js +0 -193
- package/vendor/theus-arsenal/scripts/lib/resolve-theus-root.js +0 -101
- package/vendor/theus-arsenal/scripts/lib/session-aliases.d.ts +0 -138
- package/vendor/theus-arsenal/scripts/lib/session-aliases.js +0 -483
- package/vendor/theus-arsenal/scripts/lib/session-bridge.js +0 -155
- package/vendor/theus-arsenal/scripts/lib/session-manager.d.ts +0 -137
- package/vendor/theus-arsenal/scripts/lib/session-manager.js +0 -555
- package/vendor/theus-arsenal/scripts/lib/shell-split.js +0 -86
- package/vendor/theus-arsenal/scripts/lib/shell-substitution.js +0 -501
- package/vendor/theus-arsenal/scripts/lib/skill-evolution/dashboard.js +0 -414
- package/vendor/theus-arsenal/scripts/lib/skill-evolution/health.js +0 -285
- package/vendor/theus-arsenal/scripts/lib/skill-evolution/index.js +0 -22
- package/vendor/theus-arsenal/scripts/lib/skill-evolution/provenance.js +0 -200
- package/vendor/theus-arsenal/scripts/lib/skill-evolution/tracker.js +0 -157
- package/vendor/theus-arsenal/scripts/lib/skill-evolution/versioning.js +0 -246
- package/vendor/theus-arsenal/scripts/lib/transcript-context.js +0 -232
- package/vendor/theus-arsenal/scripts/lib/utils.d.ts +0 -205
- package/vendor/theus-arsenal/scripts/lib/utils.js +0 -658
- package/vendor/theus-arsenal/scripts/plan-canvas.js +0 -341
- package/vendor/theus-arsenal/scripts/setup-package-manager.js +0 -46
- package/vendor/theus-arsenal/scripts/skills-health.js +0 -143
- package/vendor/theus-arsenal/skills/a11y-frontend/SKILL.md +0 -444
- package/vendor/theus-arsenal/skills/accesibilidad/SKILL.md +0 -144
- package/vendor/theus-arsenal/skills/acelerador-throughput-datos/SKILL.md +0 -72
- package/vendor/theus-arsenal/skills/agente-scraper-datos/SKILL.md +0 -771
- package/vendor/theus-arsenal/skills/analisis-plataformas-competencia/SKILL.md +0 -137
- package/vendor/theus-arsenal/skills/api-x/SKILL.md +0 -233
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/SKILL.md +0 -335
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/observer-loop.sh +0 -374
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/observer.md +0 -188
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/session-guardian.sh +0 -153
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/start-observer.sh +0 -253
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/config.json +0 -8
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/hooks/observe.sh +0 -594
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/detect-project.sh +0 -325
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/instinct-cli.py +0 -1918
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/lib/arsenal-dir.sh +0 -23
- package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/test_parse_instinct.py +0 -1420
- package/vendor/theus-arsenal/skills/arquitectura-hexagonal/SKILL.md +0 -275
- package/vendor/theus-arsenal/skills/arquitectura-limpia-android/SKILL.md +0 -340
- package/vendor/theus-arsenal/skills/arquitectura-pipelines-recomendacion/SKILL.md +0 -112
- package/vendor/theus-arsenal/skills/atlas-datos-prediccion/SKILL.md +0 -53
- package/vendor/theus-arsenal/skills/auditoria-arquitectura-agentes/SKILL.md +0 -257
- package/vendor/theus-arsenal/skills/auditoria-produccion/SKILL.md +0 -180
- package/vendor/theus-arsenal/skills/auditoria-rutas-clic/SKILL.md +0 -243
- package/vendor/theus-arsenal/skills/autoevaluacion-agente/SKILL.md +0 -180
- package/vendor/theus-arsenal/skills/autoevaluacion-agente/examples/high-score-example.md +0 -89
- package/vendor/theus-arsenal/skills/autoevaluacion-agente/examples/low-score-example.md +0 -87
- package/vendor/theus-arsenal/skills/autoevaluacion-agente/references/evaluation-criteria.md +0 -71
- package/vendor/theus-arsenal/skills/autoevaluacion-agente/references/hook-integration.md +0 -90
- package/vendor/theus-arsenal/skills/autoevaluacion-agente/scripts/evaluate.py +0 -409
- package/vendor/theus-arsenal/skills/autoevaluacion-agente/templates/evaluation-report.md +0 -86
- package/vendor/theus-arsenal/skills/automatizacion-ssh-netmiko/SKILL.md +0 -176
- package/vendor/theus-arsenal/skills/base-datos-pubmed/SKILL.md +0 -174
- package/vendor/theus-arsenal/skills/base-datos-uspto/SKILL.md +0 -173
- package/vendor/theus-arsenal/skills/benchmark/SKILL.md +0 -92
- package/vendor/theus-arsenal/skills/bitacora-crecimiento/SKILL.md +0 -120
- package/vendor/theus-arsenal/skills/bucle-verificacion/SKILL.md +0 -125
- package/vendor/theus-arsenal/skills/buscar-primero/SKILL.md +0 -184
- package/vendor/theus-arsenal/skills/busqueda-exa/SKILL.md +0 -111
- package/vendor/theus-arsenal/skills/cache-por-hash/SKILL.md +0 -160
- package/vendor/theus-arsenal/skills/campana-marketing/SKILL.md +0 -118
- package/vendor/theus-arsenal/skills/capacidad-producto/SKILL.md +0 -138
- package/vendor/theus-arsenal/skills/cazador-vulnerabilidades/SKILL.md +0 -104
- package/vendor/theus-arsenal/skills/compactacion-estrategica/SKILL.md +0 -115
- package/vendor/theus-arsenal/skills/comparador-baskets-prediccion/SKILL.md +0 -69
- package/vendor/theus-arsenal/skills/compras-energia/SKILL.md +0 -206
- package/vendor/theus-arsenal/skills/concurrencia-swift-6-2/SKILL.md +0 -224
- package/vendor/theus-arsenal/skills/consejo/SKILL.md +0 -201
- package/vendor/theus-arsenal/skills/construccion-harness-agentes/SKILL.md +0 -78
- package/vendor/theus-arsenal/skills/constructor-conectores/SKILL.md +0 -119
- package/vendor/theus-arsenal/skills/constructor-equipos/SKILL.md +0 -169
- package/vendor/theus-arsenal/skills/consulta-documentacion/SKILL.md +0 -92
- package/vendor/theus-arsenal/skills/consultas-genomicas-gget/SKILL.md +0 -170
- package/vendor/theus-arsenal/skills/contacto-inversores/SKILL.md +0 -95
- package/vendor/theus-arsenal/skills/corrutinas-flows-kotlin/SKILL.md +0 -284
- package/vendor/theus-arsenal/skills/creacion-video-remotion/SKILL.md +0 -46
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/3d.md +0 -86
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/animations.md +0 -29
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets/charts-bar-chart.tsx +0 -173
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets/text-animations-typewriter.tsx +0 -100
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets/text-animations-word-highlight.tsx +0 -108
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets.md +0 -78
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/audio.md +0 -172
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/calculate-metadata.md +0 -104
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/can-decode.md +0 -75
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/charts.md +0 -58
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/compositions.md +0 -146
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/display-captions.md +0 -126
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/extract-frames.md +0 -229
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/fonts.md +0 -152
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/get-audio-duration.md +0 -58
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/get-video-dimensions.md +0 -68
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/get-video-duration.md +0 -58
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/gifs.md +0 -138
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/images.md +0 -130
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/import-srt-captions.md +0 -67
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/lottie.md +0 -67
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/measuring-dom-nodes.md +0 -34
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/measuring-text.md +0 -143
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/sequencing.md +0 -106
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/tailwind.md +0 -11
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/text-animations.md +0 -20
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/timing.md +0 -179
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/transcribe-captions.md +0 -19
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/transitions.md +0 -122
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/trimming.md +0 -52
- package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/videos.md +0 -171
- package/vendor/theus-arsenal/skills/cumplimiento-aduanero/SKILL.md +0 -270
- package/vendor/theus-arsenal/skills/cumplimiento-hipaa/SKILL.md +0 -78
- package/vendor/theus-arsenal/skills/datos-sensibles-salud/SKILL.md +0 -149
- package/vendor/theus-arsenal/skills/decimales-tokens-evm/SKILL.md +0 -128
- package/vendor/theus-arsenal/skills/decisiones-arquitectura/SKILL.md +0 -206
- package/vendor/theus-arsenal/skills/demos-ui/SKILL.md +0 -469
- package/vendor/theus-arsenal/skills/desarrollo-por-intencion/SKILL.md +0 -369
- package/vendor/theus-arsenal/skills/descubrimiento-marca/SKILL.md +0 -149
- package/vendor/theus-arsenal/skills/descubrimiento-marca/references/10_proposito-porque.md +0 -42
- package/vendor/theus-arsenal/skills/descubrimiento-marca/references/20_posicionamiento.md +0 -47
- package/vendor/theus-arsenal/skills/descubrimiento-marca/references/30_audiencia-nicho.md +0 -53
- package/vendor/theus-arsenal/skills/descubrimiento-marca/references/40_personalidad-arquetipo.md +0 -61
- package/vendor/theus-arsenal/skills/descubrimiento-marca/references/50_voz-tono.md +0 -62
- package/vendor/theus-arsenal/skills/descubrimiento-marca/references/60_narrativa-historia.md +0 -54
- package/vendor/theus-arsenal/skills/descubrimiento-marca/references/70_tension-fundador.md +0 -50
- package/vendor/theus-arsenal/skills/descubrimiento-marca/references/90_SINTESIS.md +0 -133
- package/vendor/theus-arsenal/skills/descubrimiento-plugins-laravel/SKILL.md +0 -230
- package/vendor/theus-arsenal/skills/destilado-reglas/SKILL.md +0 -263
- package/vendor/theus-arsenal/skills/destilado-reglas/scripts/scan-rules.sh +0 -58
- package/vendor/theus-arsenal/skills/destilado-reglas/scripts/scan-skills.sh +0 -129
- package/vendor/theus-arsenal/skills/diagnostico-bgp/SKILL.md +0 -170
- package/vendor/theus-arsenal/skills/direccion-estetica/SKILL.md +0 -220
- package/vendor/theus-arsenal/skills/direccion-estetica/references/taxonomia-generos.md +0 -89
- package/vendor/theus-arsenal/skills/diseno-api/SKILL.md +0 -522
- package/vendor/theus-arsenal/skills/diseno-liquid-glass/SKILL.md +0 -282
- package/vendor/theus-arsenal/skills/e2e-escritorio-windows/SKILL.md +0 -879
- package/vendor/theus-arsenal/skills/edicion-video/SKILL.md +0 -289
- package/vendor/theus-arsenal/skills/enfoque-producto/SKILL.md +0 -91
- package/vendor/theus-arsenal/skills/entornos-flox/SKILL.md +0 -493
- package/vendor/theus-arsenal/skills/estandares-codigo/SKILL.md +0 -548
- package/vendor/theus-arsenal/skills/estandares-cpp/SKILL.md +0 -727
- package/vendor/theus-arsenal/skills/estandares-java/SKILL.md +0 -389
- package/vendor/theus-arsenal/skills/estilo-legado/SKILL.md +0 -149
- package/vendor/theus-arsenal/skills/estructura-informes-competencia/SKILL.md +0 -95
- package/vendor/theus-arsenal/skills/evaluacion-academica/SKILL.md +0 -165
- package/vendor/theus-arsenal/skills/explorador-skills/SKILL.md +0 -129
- package/vendor/theus-arsenal/skills/flujo-git/SKILL.md +0 -714
- package/vendor/theus-arsenal/skills/flujo-ingenieria-ml/SKILL.md +0 -343
- package/vendor/theus-arsenal/skills/flujo-tdd/SKILL.md +0 -584
- package/vendor/theus-arsenal/skills/forja-personas/SKILL.md +0 -298
- package/vendor/theus-arsenal/skills/forja-personas/gacha.py +0 -224
- package/vendor/theus-arsenal/skills/forja-personas/gacha.sh +0 -5
- package/vendor/theus-arsenal/skills/forja-personas/references/avatar-style.md +0 -123
- package/vendor/theus-arsenal/skills/forja-personas/references/boundary-rules.md +0 -53
- package/vendor/theus-arsenal/skills/forja-personas/references/error-handling.md +0 -53
- package/vendor/theus-arsenal/skills/forja-personas/references/identity-tension.md +0 -48
- package/vendor/theus-arsenal/skills/forja-personas/references/naming-system.md +0 -39
- package/vendor/theus-arsenal/skills/forja-personas/references/output-template.md +0 -166
- package/vendor/theus-arsenal/skills/fundamentos-animacion/SKILL.md +0 -296
- package/vendor/theus-arsenal/skills/generacion-iconos-ios/SKILL.md +0 -156
- package/vendor/theus-arsenal/skills/generacion-iconos-ios/scripts/generate_icons.swift +0 -258
- package/vendor/theus-arsenal/skills/generacion-iconos-ios/scripts/iconify_gen.sh +0 -235
- package/vendor/theus-arsenal/skills/gestion-excepciones-logisticas/SKILL.md +0 -208
- package/vendor/theus-arsenal/skills/gestion-transportistas/SKILL.md +0 -204
- package/vendor/theus-arsenal/skills/guia-adopcion-ml/SKILL.md +0 -64
- package/vendor/theus-arsenal/skills/harness-agente-autonomo/SKILL.md +0 -252
- package/vendor/theus-arsenal/skills/harness-eval-clinico/SKILL.md +0 -212
- package/vendor/theus-arsenal/skills/harness-evaluacion/SKILL.md +0 -296
- package/vendor/theus-arsenal/skills/harness-generador-evaluador/SKILL.md +0 -254
- package/vendor/theus-arsenal/skills/homelab-diseno-red/SKILL.md +0 -120
- package/vendor/theus-arsenal/skills/homelab-dns-pihole/SKILL.md +0 -264
- package/vendor/theus-arsenal/skills/homelab-preparacion-red/SKILL.md +0 -144
- package/vendor/theus-arsenal/skills/homelab-segmentacion-vlan/SKILL.md +0 -307
- package/vendor/theus-arsenal/skills/homelab-vpn-wireguard/SKILL.md +0 -299
- package/vendor/theus-arsenal/skills/ingenieria-agentica/SKILL.md +0 -96
- package/vendor/theus-arsenal/skills/inspeccion-animaciones-blender/SKILL.md +0 -164
- package/vendor/theus-arsenal/skills/instaladores-python/SKILL.md +0 -820
- package/vendor/theus-arsenal/skills/integracion-jira/SKILL.md +0 -307
- package/vendor/theus-arsenal/skills/inteligencia-leads/SKILL.md +0 -312
- package/vendor/theus-arsenal/skills/inteligencia-leads/agents/agente-enriquecimiento.md +0 -87
- package/vendor/theus-arsenal/skills/inteligencia-leads/agents/mapeador-mutuos.md +0 -76
- package/vendor/theus-arsenal/skills/inteligencia-leads/agents/puntuador-senales.md +0 -60
- package/vendor/theus-arsenal/skills/inteligencia-leads/agents/redactor-outreach.md +0 -102
- package/vendor/theus-arsenal/skills/inteligencia-mercados-prediccion/SKILL.md +0 -53
- package/vendor/theus-arsenal/skills/introspeccion-agente/SKILL.md +0 -150
- package/vendor/theus-arsenal/skills/inventario-skills/SKILL.md +0 -194
- package/vendor/theus-arsenal/skills/inventario-skills/scripts/quick-diff.sh +0 -87
- package/vendor/theus-arsenal/skills/inventario-skills/scripts/save-results.sh +0 -57
- package/vendor/theus-arsenal/skills/inventario-skills/scripts/scan.sh +0 -170
- package/vendor/theus-arsenal/skills/investigacion-mercado/SKILL.md +0 -87
- package/vendor/theus-arsenal/skills/investigacion-oraculos-prediccion/SKILL.md +0 -59
- package/vendor/theus-arsenal/skills/investigacion-profunda/SKILL.md +0 -161
- package/vendor/theus-arsenal/skills/keccak256-nodejs/SKILL.md +0 -100
- package/vendor/theus-arsenal/skills/libro-decisiones-recursivo/SKILL.md +0 -82
- package/vendor/theus-arsenal/skills/lienzo-planes/SKILL.md +0 -111
- package/vendor/theus-arsenal/skills/limpieza-configuracion/SKILL.md +0 -116
- package/vendor/theus-arsenal/skills/logistica-inversa-devoluciones/SKILL.md +0 -241
- package/vendor/theus-arsenal/skills/manejo-errores/SKILL.md +0 -375
- package/vendor/theus-arsenal/skills/materiales-inversores/SKILL.md +0 -101
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/SKILL.md +0 -170
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/forget.mjs +0 -44
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/info.mjs +0 -24
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/init.mjs +0 -152
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/list.mjs +0 -40
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/migrate.mjs +0 -214
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/resume.mjs +0 -36
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/save.mjs +0 -210
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/shared.mjs +0 -402
- package/vendor/theus-arsenal/skills/memoria-por-proyecto/hooks/session-start.mjs +0 -238
- package/vendor/theus-arsenal/skills/metodologia-benchmarks/SKILL.md +0 -131
- package/vendor/theus-arsenal/skills/migraciones-bd/SKILL.md +0 -430
- package/vendor/theus-arsenal/skills/modelos-fundacionales-en-dispositivo/SKILL.md +0 -244
- package/vendor/theus-arsenal/skills/modo-seguro/SKILL.md +0 -86
- package/vendor/theus-arsenal/skills/motion-avanzado/SKILL.md +0 -592
- package/vendor/theus-arsenal/skills/motor-de-contenido/SKILL.md +0 -136
- package/vendor/theus-arsenal/skills/no-conformidades-calidad/SKILL.md +0 -249
- package/vendor/theus-arsenal/skills/onboarding-codigo/SKILL.md +0 -244
- package/vendor/theus-arsenal/skills/operaciones-agentes-empresariales/SKILL.md +0 -51
- package/vendor/theus-arsenal/skills/operaciones-conocimiento/SKILL.md +0 -159
- package/vendor/theus-arsenal/skills/operaciones-correo/SKILL.md +0 -123
- package/vendor/theus-arsenal/skills/operaciones-facturacion/SKILL.md +0 -142
- package/vendor/theus-arsenal/skills/operaciones-flujo-proyectos/SKILL.md +0 -110
- package/vendor/theus-arsenal/skills/operaciones-github/SKILL.md +0 -143
- package/vendor/theus-arsenal/skills/operaciones-google-workspace/SKILL.md +0 -100
- package/vendor/theus-arsenal/skills/operaciones-investigacion/SKILL.md +0 -124
- package/vendor/theus-arsenal/skills/operaciones-mensajes/SKILL.md +0 -103
- package/vendor/theus-arsenal/skills/operaciones-terminal/SKILL.md +0 -110
- package/vendor/theus-arsenal/skills/optimizacion-benchmark/SKILL.md +0 -70
- package/vendor/theus-arsenal/skills/optimizacion-costos-llm/SKILL.md +0 -182
- package/vendor/theus-arsenal/skills/optimizador-conexiones/SKILL.md +0 -191
- package/vendor/theus-arsenal/skills/optimizador-paralelismo/SKILL.md +0 -75
- package/vendor/theus-arsenal/skills/optimizador-prompts/SKILL.md +0 -374
- package/vendor/theus-arsenal/skills/orq-agregar-funcionalidad/SKILL.md +0 -37
- package/vendor/theus-arsenal/skills/orq-cambiar-funcionalidad/SKILL.md +0 -36
- package/vendor/theus-arsenal/skills/orq-construir-mvp/SKILL.md +0 -38
- package/vendor/theus-arsenal/skills/orq-corregir-defecto/SKILL.md +0 -36
- package/vendor/theus-arsenal/skills/orq-pipeline/SKILL.md +0 -134
- package/vendor/theus-arsenal/skills/orq-refinar-codigo/SKILL.md +0 -49
- package/vendor/theus-arsenal/skills/orquestacion-equipos-agentes/SKILL.md +0 -117
- package/vendor/theus-arsenal/skills/pagos-agentes-x402/SKILL.md +0 -237
- package/vendor/theus-arsenal/skills/patrones-angular/SKILL.md +0 -153
- package/vendor/theus-arsenal/skills/patrones-angular/references/angular-animations.md +0 -160
- package/vendor/theus-arsenal/skills/patrones-angular/references/angular-aria.md +0 -410
- package/vendor/theus-arsenal/skills/patrones-angular/references/cli.md +0 -86
- package/vendor/theus-arsenal/skills/patrones-angular/references/component-harnesses.md +0 -59
- package/vendor/theus-arsenal/skills/patrones-angular/references/component-styling.md +0 -91
- package/vendor/theus-arsenal/skills/patrones-angular/references/components.md +0 -117
- package/vendor/theus-arsenal/skills/patrones-angular/references/creating-services.md +0 -97
- package/vendor/theus-arsenal/skills/patrones-angular/references/data-resolvers.md +0 -69
- package/vendor/theus-arsenal/skills/patrones-angular/references/define-routes.md +0 -67
- package/vendor/theus-arsenal/skills/patrones-angular/references/defining-providers.md +0 -72
- package/vendor/theus-arsenal/skills/patrones-angular/references/di-fundamentals.md +0 -120
- package/vendor/theus-arsenal/skills/patrones-angular/references/e2e-testing.md +0 -56
- package/vendor/theus-arsenal/skills/patrones-angular/references/effects.md +0 -83
- package/vendor/theus-arsenal/skills/patrones-angular/references/hierarchical-injectors.md +0 -43
- package/vendor/theus-arsenal/skills/patrones-angular/references/host-elements.md +0 -80
- package/vendor/theus-arsenal/skills/patrones-angular/references/injection-context.md +0 -63
- package/vendor/theus-arsenal/skills/patrones-angular/references/inputs.md +0 -101
- package/vendor/theus-arsenal/skills/patrones-angular/references/linked-signal.md +0 -59
- package/vendor/theus-arsenal/skills/patrones-angular/references/loading-strategies.md +0 -61
- package/vendor/theus-arsenal/skills/patrones-angular/references/mcp.md +0 -67
- package/vendor/theus-arsenal/skills/patrones-angular/references/navigate-to-routes.md +0 -69
- package/vendor/theus-arsenal/skills/patrones-angular/references/outputs.md +0 -86
- package/vendor/theus-arsenal/skills/patrones-angular/references/reactive-forms.md +0 -122
- package/vendor/theus-arsenal/skills/patrones-angular/references/rendering-strategies.md +0 -44
- package/vendor/theus-arsenal/skills/patrones-angular/references/resource.md +0 -77
- package/vendor/theus-arsenal/skills/patrones-angular/references/route-animations.md +0 -56
- package/vendor/theus-arsenal/skills/patrones-angular/references/route-guards.md +0 -52
- package/vendor/theus-arsenal/skills/patrones-angular/references/router-lifecycle.md +0 -45
- package/vendor/theus-arsenal/skills/patrones-angular/references/router-testing.md +0 -87
- package/vendor/theus-arsenal/skills/patrones-angular/references/show-routes-with-outlets.md +0 -68
- package/vendor/theus-arsenal/skills/patrones-angular/references/signal-forms.md +0 -795
- package/vendor/theus-arsenal/skills/patrones-angular/references/signals-overview.md +0 -94
- package/vendor/theus-arsenal/skills/patrones-angular/references/tailwind-css.md +0 -69
- package/vendor/theus-arsenal/skills/patrones-angular/references/template-driven-forms.md +0 -114
- package/vendor/theus-arsenal/skills/patrones-angular/references/testing-fundamentals.md +0 -65
- package/vendor/theus-arsenal/skills/patrones-animacion/SKILL.md +0 -432
- package/vendor/theus-arsenal/skills/patrones-backend/SKILL.md +0 -560
- package/vendor/theus-arsenal/skills/patrones-cdss-clinico/SKILL.md +0 -249
- package/vendor/theus-arsenal/skills/patrones-cisco-ios/SKILL.md +0 -148
- package/vendor/theus-arsenal/skills/patrones-clickhouse/SKILL.md +0 -443
- package/vendor/theus-arsenal/skills/patrones-compose-multiplatform/SKILL.md +0 -298
- package/vendor/theus-arsenal/skills/patrones-dart-flutter/SKILL.md +0 -566
- package/vendor/theus-arsenal/skills/patrones-despliegue/SKILL.md +0 -426
- package/vendor/theus-arsenal/skills/patrones-django/SKILL.md +0 -739
- package/vendor/theus-arsenal/skills/patrones-django-celery/SKILL.md +0 -456
- package/vendor/theus-arsenal/skills/patrones-docker/SKILL.md +0 -363
- package/vendor/theus-arsenal/skills/patrones-dotnet/SKILL.md +0 -321
- package/vendor/theus-arsenal/skills/patrones-emr-clinico/SKILL.md +0 -168
- package/vendor/theus-arsenal/skills/patrones-fastapi/SKILL.md +0 -513
- package/vendor/theus-arsenal/skills/patrones-frontend/SKILL.md +0 -655
- package/vendor/theus-arsenal/skills/patrones-go/SKILL.md +0 -674
- package/vendor/theus-arsenal/skills/patrones-jpa/SKILL.md +0 -156
- package/vendor/theus-arsenal/skills/patrones-kotlin/SKILL.md +0 -717
- package/vendor/theus-arsenal/skills/patrones-kotlin-exposed/SKILL.md +0 -724
- package/vendor/theus-arsenal/skills/patrones-kotlin-ktor/SKILL.md +0 -694
- package/vendor/theus-arsenal/skills/patrones-kubernetes/SKILL.md +0 -754
- package/vendor/theus-arsenal/skills/patrones-laravel/SKILL.md +0 -414
- package/vendor/theus-arsenal/skills/patrones-mcp/SKILL.md +0 -66
- package/vendor/theus-arsenal/skills/patrones-mysql/SKILL.md +0 -420
- package/vendor/theus-arsenal/skills/patrones-nestjs/SKILL.md +0 -229
- package/vendor/theus-arsenal/skills/patrones-nextjs/SKILL.md +0 -56
- package/vendor/theus-arsenal/skills/patrones-nuxt4/SKILL.md +0 -99
- package/vendor/theus-arsenal/skills/patrones-perl/SKILL.md +0 -508
- package/vendor/theus-arsenal/skills/patrones-postgres/SKILL.md +0 -141
- package/vendor/theus-arsenal/skills/patrones-prisma/SKILL.md +0 -399
- package/vendor/theus-arsenal/skills/patrones-python/SKILL.md +0 -750
- package/vendor/theus-arsenal/skills/patrones-pytorch/SKILL.md +0 -400
- package/vendor/theus-arsenal/skills/patrones-quarkus/SKILL.md +0 -729
- package/vendor/theus-arsenal/skills/patrones-react/SKILL.md +0 -339
- package/vendor/theus-arsenal/skills/patrones-react-native/SKILL.md +0 -325
- package/vendor/theus-arsenal/skills/patrones-redis/SKILL.md +0 -401
- package/vendor/theus-arsenal/skills/patrones-rust/SKILL.md +0 -504
- package/vendor/theus-arsenal/skills/patrones-springboot/SKILL.md +0 -314
- package/vendor/theus-arsenal/skills/patrones-swiftui/SKILL.md +0 -261
- package/vendor/theus-arsenal/skills/patrones-tinystruct/SKILL.md +0 -281
- package/vendor/theus-arsenal/skills/patrones-tinystruct/references/architecture.md +0 -90
- package/vendor/theus-arsenal/skills/patrones-tinystruct/references/data-handling.md +0 -60
- package/vendor/theus-arsenal/skills/patrones-tinystruct/references/database.md +0 -99
- package/vendor/theus-arsenal/skills/patrones-tinystruct/references/routing.md +0 -64
- package/vendor/theus-arsenal/skills/patrones-tinystruct/references/system-usage.md +0 -97
- package/vendor/theus-arsenal/skills/patrones-tinystruct/references/testing.md +0 -72
- package/vendor/theus-arsenal/skills/patrones-vite/SKILL.md +0 -449
- package/vendor/theus-arsenal/skills/patrones-vue/SKILL.md +0 -469
- package/vendor/theus-arsenal/skills/persistencia-actores-swift/SKILL.md +0 -148
- package/vendor/theus-arsenal/skills/pipeline-opensource/SKILL.md +0 -254
- package/vendor/theus-arsenal/skills/planificacion-demanda-inventario/SKILL.md +0 -236
- package/vendor/theus-arsenal/skills/planificador-trades-prediccion/SKILL.md +0 -60
- package/vendor/theus-arsenal/skills/plano-tecnico/SKILL.md +0 -102
- package/vendor/theus-arsenal/skills/presentaciones-html/SKILL.md +0 -189
- package/vendor/theus-arsenal/skills/presentaciones-html/STYLE_PRESETS.md +0 -330
- package/vendor/theus-arsenal/skills/presentaciones-html/animation-patterns.md +0 -122
- package/vendor/theus-arsenal/skills/presentaciones-html/html-template.md +0 -419
- package/vendor/theus-arsenal/skills/presentaciones-html/scripts/export-pdf.sh +0 -418
- package/vendor/theus-arsenal/skills/presentaciones-html/scripts/extract-pptx.py +0 -96
- package/vendor/theus-arsenal/skills/presentaciones-html/viewport-base.css +0 -153
- package/vendor/theus-arsenal/skills/presupuesto-contexto/SKILL.md +0 -263
- package/vendor/theus-arsenal/skills/procesamiento-documentos-nutrient/SKILL.md +0 -168
- package/vendor/theus-arsenal/skills/programacion-produccion/SKILL.md +0 -220
- package/vendor/theus-arsenal/skills/publicacion-cruzada/SKILL.md +0 -117
- package/vendor/theus-arsenal/skills/publicador-social/SKILL.md +0 -121
- package/vendor/theus-arsenal/skills/puerta-de-entrega/SKILL.md +0 -164
- package/vendor/theus-arsenal/skills/puerta-de-entrega/hooks/puerta-entrega.py +0 -242
- package/vendor/theus-arsenal/skills/pulir-interfaces/SKILL.md +0 -126
- package/vendor/theus-arsenal/skills/qa-navegador/SKILL.md +0 -103
- package/vendor/theus-arsenal/skills/ranking-grafo-social/SKILL.md +0 -153
- package/vendor/theus-arsenal/skills/recuperacion-iterativa/SKILL.md +0 -236
- package/vendor/theus-arsenal/skills/redaccion-articulos/SKILL.md +0 -81
- package/vendor/theus-arsenal/skills/regex-vs-llm/SKILL.md +0 -221
- package/vendor/theus-arsenal/skills/regresion-codigo-ia/SKILL.md +0 -388
- package/vendor/theus-arsenal/skills/rendimiento-react/SKILL.md +0 -567
- package/vendor/theus-arsenal/skills/revision-codigo-flutter-dart/SKILL.md +0 -442
- package/vendor/theus-arsenal/skills/revision-literatura-cientifica/SKILL.md +0 -191
- package/vendor/theus-arsenal/skills/revision-multiperspectiva/SKILL.md +0 -302
- package/vendor/theus-arsenal/skills/revision-riesgo-prediccion/SKILL.md +0 -56
- package/vendor/theus-arsenal/skills/revision-seguridad/SKILL.md +0 -505
- package/vendor/theus-arsenal/skills/revision-seguridad/cloud-infrastructure-security.md +0 -361
- package/vendor/theus-arsenal/skills/runtime-bun/SKILL.md +0 -83
- package/vendor/theus-arsenal/skills/salud-codigo-codescene/SKILL.md +0 -163
- package/vendor/theus-arsenal/skills/salud-interfaces-red/SKILL.md +0 -143
- package/vendor/theus-arsenal/skills/seguimiento-costos/SKILL.md +0 -122
- package/vendor/theus-arsenal/skills/seguridad-agentes-trading/SKILL.md +0 -145
- package/vendor/theus-arsenal/skills/seguridad-amm-defi/SKILL.md +0 -166
- package/vendor/theus-arsenal/skills/seguridad-django/SKILL.md +0 -648
- package/vendor/theus-arsenal/skills/seguridad-laravel/SKILL.md +0 -945
- package/vendor/theus-arsenal/skills/seguridad-perl/SKILL.md +0 -507
- package/vendor/theus-arsenal/skills/seguridad-quarkus/SKILL.md +0 -474
- package/vendor/theus-arsenal/skills/seguridad-springboot/SKILL.md +0 -279
- package/vendor/theus-arsenal/skills/seo/SKILL.md +0 -166
- package/vendor/theus-arsenal/skills/sistema-diseno/SKILL.md +0 -81
- package/vendor/theus-arsenal/skills/sistema-operativo-agentico/SKILL.md +0 -375
- package/vendor/theus-arsenal/skills/sistemas-latencia-critica/SKILL.md +0 -65
- package/vendor/theus-arsenal/skills/tdd-django/SKILL.md +0 -735
- package/vendor/theus-arsenal/skills/tdd-laravel/SKILL.md +0 -673
- package/vendor/theus-arsenal/skills/tdd-quarkus/SKILL.md +0 -817
- package/vendor/theus-arsenal/skills/tdd-springboot/SKILL.md +0 -165
- package/vendor/theus-arsenal/skills/testing-cpp/SKILL.md +0 -328
- package/vendor/theus-arsenal/skills/testing-csharp/SKILL.md +0 -321
- package/vendor/theus-arsenal/skills/testing-e2e/SKILL.md +0 -325
- package/vendor/theus-arsenal/skills/testing-go/SKILL.md +0 -719
- package/vendor/theus-arsenal/skills/testing-kotlin/SKILL.md +0 -829
- package/vendor/theus-arsenal/skills/testing-perl/SKILL.md +0 -479
- package/vendor/theus-arsenal/skills/testing-protocolos-di-swift/SKILL.md +0 -196
- package/vendor/theus-arsenal/skills/testing-python/SKILL.md +0 -815
- package/vendor/theus-arsenal/skills/testing-react/SKILL.md +0 -421
- package/vendor/theus-arsenal/skills/testing-rust/SKILL.md +0 -506
- package/vendor/theus-arsenal/skills/tours-de-codigo/SKILL.md +0 -252
- package/vendor/theus-arsenal/skills/traduccion-documentos-visado/SKILL.md +0 -121
- package/vendor/theus-arsenal/skills/ui-a-vue/SKILL.md +0 -141
- package/vendor/theus-arsenal/skills/validacion-config-red/SKILL.md +0 -211
- package/vendor/theus-arsenal/skills/verificacion-django/SKILL.md +0 -470
- package/vendor/theus-arsenal/skills/verificacion-factual/SKILL.md +0 -142
- package/vendor/theus-arsenal/skills/verificacion-laravel/SKILL.md +0 -184
- package/vendor/theus-arsenal/skills/verificacion-quarkus/SKILL.md +0 -485
- package/vendor/theus-arsenal/skills/verificacion-springboot/SKILL.md +0 -237
- package/vendor/theus-arsenal/skills/videodb/SKILL.md +0 -374
- package/vendor/theus-arsenal/skills/videodb/reference/api-reference.md +0 -550
- package/vendor/theus-arsenal/skills/videodb/reference/capture-reference.md +0 -407
- package/vendor/theus-arsenal/skills/videodb/reference/capture.md +0 -101
- package/vendor/theus-arsenal/skills/videodb/reference/editor.md +0 -443
- package/vendor/theus-arsenal/skills/videodb/reference/generative.md +0 -331
- package/vendor/theus-arsenal/skills/videodb/reference/rtstream-reference.md +0 -564
- package/vendor/theus-arsenal/skills/videodb/reference/rtstream.md +0 -65
- package/vendor/theus-arsenal/skills/videodb/reference/search.md +0 -230
- package/vendor/theus-arsenal/skills/videodb/reference/streaming.md +0 -406
- package/vendor/theus-arsenal/skills/videodb/reference/use-cases.md +0 -118
- package/vendor/theus-arsenal/skills/videodb/scripts/ws_listener.py +0 -279
- package/vendor/theus-arsenal/skills/videos-manim/SKILL.md +0 -91
- package/vendor/theus-arsenal/skills/videos-manim/assets/network_graph_scene.py +0 -52
- package/vendor/theus-arsenal/skills/vigilancia-canary/SKILL.md +0 -108
- package/vendor/theus-arsenal/skills/voz-de-marca/SKILL.md +0 -106
|
@@ -1,749 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* MCP health-check hook.
|
|
6
|
-
*
|
|
7
|
-
* Compatible con los eventos de hook del motor de Theus:
|
|
8
|
-
* - PreToolUse: probe MCP server health before MCP tool execution
|
|
9
|
-
* - PostToolUseFailure: mark unhealthy servers, attempt reconnect, and re-probe
|
|
10
|
-
*
|
|
11
|
-
* The hook persists health state outside the conversation context so it
|
|
12
|
-
* survives compaction and later turns.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const fs = require('fs');
|
|
16
|
-
const os = require('os');
|
|
17
|
-
const path = require('path');
|
|
18
|
-
const http = require('http');
|
|
19
|
-
const https = require('https');
|
|
20
|
-
const { spawn, spawnSync } = require('child_process');
|
|
21
|
-
|
|
22
|
-
const MAX_STDIN = 1024 * 1024;
|
|
23
|
-
const DEFAULT_TTL_MS = 2 * 60 * 1000;
|
|
24
|
-
const DEFAULT_TIMEOUT_MS = 5000;
|
|
25
|
-
const DEFAULT_BACKOFF_MS = 30 * 1000;
|
|
26
|
-
const MAX_BACKOFF_MS = 10 * 60 * 1000;
|
|
27
|
-
// The preflight HTTP probe only checks reachability; it does not have access to
|
|
28
|
-
// el token OAuth almacenado del CLI. Trata las respuestas con auth como
|
|
29
|
-
// reachable so the real MCP client can attempt the authenticated call. A
|
|
30
|
-
// Streamable HTTP MCP server can also return 406 to a bare GET that omits
|
|
31
|
-
// Accept: text/event-stream; that still proves the endpoint is alive.
|
|
32
|
-
const HEALTHY_HTTP_CODES = new Set([200, 201, 202, 204, 301, 302, 303, 304, 307, 308, 400, 401, 403, 405, 406]);
|
|
33
|
-
const RECONNECT_STATUS_CODES = new Set([401, 403, 429, 503]);
|
|
34
|
-
const FAILURE_PATTERNS = [
|
|
35
|
-
{ code: 401, pattern: /\b401\b|unauthori[sz]ed|auth(?:entication)?\s+(?:failed|expired|invalid)/i },
|
|
36
|
-
{ code: 403, pattern: /\b403\b|forbidden|permission denied/i },
|
|
37
|
-
{ code: 429, pattern: /\b429\b|rate limit|too many requests/i },
|
|
38
|
-
{ code: 503, pattern: /\b503\b|service unavailable|overloaded|temporarily unavailable/i },
|
|
39
|
-
{ code: 'transport', pattern: /ECONNREFUSED|ENOTFOUND|EAI_AGAIN|timed? out|socket hang up|connection (?:failed|lost|reset|closed)/i }
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
function envNumber(name, fallback) {
|
|
43
|
-
const value = Number(process.env[name]);
|
|
44
|
-
return Number.isFinite(value) && value >= 0 ? value : fallback;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function stateFilePath() {
|
|
48
|
-
if (process.env.THEUS_SALUD_MCP_STATE_PATH) {
|
|
49
|
-
return path.resolve(process.env.THEUS_SALUD_MCP_STATE_PATH);
|
|
50
|
-
}
|
|
51
|
-
return path.join(require('../lib/agent-data-home').resolveAgentDataHome(), 'salud-mcp', 'cache-salud.json');
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function configPaths() {
|
|
55
|
-
if (process.env.THEUS_SALUD_MCP_CONFIG_PATH) {
|
|
56
|
-
return process.env.THEUS_SALUD_MCP_CONFIG_PATH
|
|
57
|
-
.split(path.delimiter)
|
|
58
|
-
.map(entry => entry.trim())
|
|
59
|
-
.filter(Boolean)
|
|
60
|
-
.map(entry => path.resolve(entry));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const cwd = process.cwd();
|
|
64
|
-
const home = os.homedir();
|
|
65
|
-
|
|
66
|
-
return [
|
|
67
|
-
path.join(cwd, '.mcp.json'),
|
|
68
|
-
path.join(cwd, '.theus', 'settings.json'),
|
|
69
|
-
path.join(home, '.theus.json'),
|
|
70
|
-
path.join(home, '.theus', 'settings.json')
|
|
71
|
-
];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function readJsonFile(filePath) {
|
|
75
|
-
try {
|
|
76
|
-
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
77
|
-
} catch {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function loadState(filePath) {
|
|
83
|
-
const state = readJsonFile(filePath);
|
|
84
|
-
if (!state || typeof state !== 'object' || Array.isArray(state)) {
|
|
85
|
-
return { version: 1, servers: {} };
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (!state.servers || typeof state.servers !== 'object' || Array.isArray(state.servers)) {
|
|
89
|
-
state.servers = {};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return state;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function saveState(filePath, state) {
|
|
96
|
-
try {
|
|
97
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
98
|
-
fs.writeFileSync(filePath, JSON.stringify(state, null, 2));
|
|
99
|
-
} catch {
|
|
100
|
-
// Never block the hook on state persistence errors.
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function readRawStdin() {
|
|
105
|
-
return new Promise(resolve => {
|
|
106
|
-
let raw = '';
|
|
107
|
-
let truncated = /^(1|true|yes)$/i.test(String(process.env.THEUS_HOOK_INPUT_TRUNCATED || ''));
|
|
108
|
-
process.stdin.setEncoding('utf8');
|
|
109
|
-
process.stdin.on('data', chunk => {
|
|
110
|
-
if (raw.length < MAX_STDIN) {
|
|
111
|
-
const remaining = MAX_STDIN - raw.length;
|
|
112
|
-
raw += chunk.substring(0, remaining);
|
|
113
|
-
if (chunk.length > remaining) {
|
|
114
|
-
truncated = true;
|
|
115
|
-
}
|
|
116
|
-
} else {
|
|
117
|
-
truncated = true;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
process.stdin.on('end', () => resolve({ raw, truncated }));
|
|
121
|
-
process.stdin.on('error', () => resolve({ raw, truncated }));
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function safeParse(raw) {
|
|
126
|
-
try {
|
|
127
|
-
return raw.trim() ? JSON.parse(raw) : {};
|
|
128
|
-
} catch {
|
|
129
|
-
return {};
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function extractMcpTarget(input) {
|
|
134
|
-
const toolName = String(input.tool_name || input.name || '');
|
|
135
|
-
const explicitServer = input.server
|
|
136
|
-
|| input.mcp_server
|
|
137
|
-
|| input.tool_input?.server
|
|
138
|
-
|| input.tool_input?.mcp_server
|
|
139
|
-
|| input.tool_input?.connector
|
|
140
|
-
|| null;
|
|
141
|
-
const explicitTool = input.tool
|
|
142
|
-
|| input.mcp_tool
|
|
143
|
-
|| input.tool_input?.tool
|
|
144
|
-
|| input.tool_input?.mcp_tool
|
|
145
|
-
|| null;
|
|
146
|
-
|
|
147
|
-
if (explicitServer) {
|
|
148
|
-
return {
|
|
149
|
-
server: String(explicitServer),
|
|
150
|
-
tool: explicitTool ? String(explicitTool) : toolName
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (!toolName.startsWith('mcp__')) {
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const segments = toolName.slice(5).split('__');
|
|
159
|
-
if (segments.length < 2 || !segments[0]) {
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return {
|
|
164
|
-
server: segments[0],
|
|
165
|
-
tool: segments.slice(1).join('__')
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function extractMcpTargetFromRaw(raw) {
|
|
170
|
-
const toolNameMatch = raw.match(/"(?:tool_name|name)"\s*:\s*"([^"]+)"/);
|
|
171
|
-
const serverMatch = raw.match(/"(?:server|mcp_server|connector)"\s*:\s*"([^"]+)"/);
|
|
172
|
-
const toolMatch = raw.match(/"(?:tool|mcp_tool)"\s*:\s*"([^"]+)"/);
|
|
173
|
-
|
|
174
|
-
return extractMcpTarget({
|
|
175
|
-
tool_name: toolNameMatch ? toolNameMatch[1] : '',
|
|
176
|
-
server: serverMatch ? serverMatch[1] : undefined,
|
|
177
|
-
tool: toolMatch ? toolMatch[1] : undefined
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function resolveServerConfig(serverName) {
|
|
182
|
-
for (const filePath of configPaths()) {
|
|
183
|
-
const data = readJsonFile(filePath);
|
|
184
|
-
const server = data?.mcpServers?.[serverName]
|
|
185
|
-
|| data?.mcp_servers?.[serverName]
|
|
186
|
-
|| null;
|
|
187
|
-
|
|
188
|
-
if (server && typeof server === 'object' && !Array.isArray(server)) {
|
|
189
|
-
return {
|
|
190
|
-
config: server,
|
|
191
|
-
source: filePath
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function markHealthy(state, serverName, now, details = {}) {
|
|
200
|
-
state.servers[serverName] = {
|
|
201
|
-
status: 'healthy',
|
|
202
|
-
checkedAt: now,
|
|
203
|
-
expiresAt: now + envNumber('THEUS_SALUD_MCP_TTL_MS', DEFAULT_TTL_MS),
|
|
204
|
-
failureCount: 0,
|
|
205
|
-
lastError: null,
|
|
206
|
-
lastFailureCode: null,
|
|
207
|
-
nextRetryAt: now,
|
|
208
|
-
lastRestoredAt: now,
|
|
209
|
-
...details
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function markUnhealthy(state, serverName, now, failureCode, errorMessage) {
|
|
214
|
-
const previous = state.servers[serverName] || {};
|
|
215
|
-
const failureCount = Number(previous.failureCount || 0) + 1;
|
|
216
|
-
const backoffBase = envNumber('THEUS_SALUD_MCP_BACKOFF_MS', DEFAULT_BACKOFF_MS);
|
|
217
|
-
const nextRetryDelay = Math.min(backoffBase * (2 ** Math.max(failureCount - 1, 0)), MAX_BACKOFF_MS);
|
|
218
|
-
|
|
219
|
-
state.servers[serverName] = {
|
|
220
|
-
status: 'unhealthy',
|
|
221
|
-
checkedAt: now,
|
|
222
|
-
expiresAt: now,
|
|
223
|
-
failureCount,
|
|
224
|
-
lastError: errorMessage || null,
|
|
225
|
-
lastFailureCode: failureCode || null,
|
|
226
|
-
nextRetryAt: now + nextRetryDelay,
|
|
227
|
-
lastRestoredAt: previous.lastRestoredAt || null
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function failureSummary(input) {
|
|
232
|
-
const output = input.tool_output;
|
|
233
|
-
const pieces = [
|
|
234
|
-
typeof input.error === 'string' ? input.error : '',
|
|
235
|
-
typeof input.message === 'string' ? input.message : '',
|
|
236
|
-
typeof input.tool_response === 'string' ? input.tool_response : '',
|
|
237
|
-
typeof output === 'string' ? output : '',
|
|
238
|
-
typeof output?.output === 'string' ? output.output : '',
|
|
239
|
-
typeof output?.stderr === 'string' ? output.stderr : '',
|
|
240
|
-
typeof input.tool_input?.error === 'string' ? input.tool_input.error : ''
|
|
241
|
-
].filter(Boolean);
|
|
242
|
-
|
|
243
|
-
return pieces.join('\n');
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
function detectFailureCode(text) {
|
|
247
|
-
const summary = String(text || '');
|
|
248
|
-
for (const entry of FAILURE_PATTERNS) {
|
|
249
|
-
if (entry.pattern.test(summary)) {
|
|
250
|
-
return entry.code;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return null;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
function requestHttp(urlString, headers, timeoutMs) {
|
|
257
|
-
return new Promise(resolve => {
|
|
258
|
-
let settled = false;
|
|
259
|
-
let timedOut = false;
|
|
260
|
-
|
|
261
|
-
const url = new URL(urlString);
|
|
262
|
-
const client = url.protocol === 'https:' ? https : http;
|
|
263
|
-
|
|
264
|
-
const req = client.request(
|
|
265
|
-
url,
|
|
266
|
-
{
|
|
267
|
-
method: 'GET',
|
|
268
|
-
headers,
|
|
269
|
-
},
|
|
270
|
-
res => {
|
|
271
|
-
if (settled) return;
|
|
272
|
-
settled = true;
|
|
273
|
-
res.resume();
|
|
274
|
-
resolve({
|
|
275
|
-
ok: HEALTHY_HTTP_CODES.has(res.statusCode),
|
|
276
|
-
statusCode: res.statusCode,
|
|
277
|
-
reason: `HTTP ${res.statusCode}`
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
);
|
|
281
|
-
|
|
282
|
-
req.setTimeout(timeoutMs, () => {
|
|
283
|
-
timedOut = true;
|
|
284
|
-
req.destroy(new Error('timeout'));
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
req.on('error', error => {
|
|
288
|
-
if (settled) return;
|
|
289
|
-
settled = true;
|
|
290
|
-
resolve({
|
|
291
|
-
ok: false,
|
|
292
|
-
statusCode: null,
|
|
293
|
-
reason: timedOut ? 'request timed out' : error.message
|
|
294
|
-
});
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
req.end();
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
function probeCommandServer(serverName, config) {
|
|
302
|
-
return new Promise(resolve => {
|
|
303
|
-
const command = config.command;
|
|
304
|
-
const args = Array.isArray(config.args) ? config.args.map(arg => String(arg)) : [];
|
|
305
|
-
const timeoutMs = envNumber('THEUS_SALUD_MCP_TIMEOUT_MS', DEFAULT_TIMEOUT_MS);
|
|
306
|
-
const mergedEnv = {
|
|
307
|
-
...process.env,
|
|
308
|
-
...(config.env && typeof config.env === 'object' && !Array.isArray(config.env) ? config.env : {})
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
let done = false;
|
|
312
|
-
|
|
313
|
-
function finish(result) {
|
|
314
|
-
if (done) return;
|
|
315
|
-
done = true;
|
|
316
|
-
resolve(result);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
// On Windows, commands like 'npx' are commonly exposed as npx.cmd.
|
|
320
|
-
// Probe bare PATH commands through platform-extension fallbacks, but keep
|
|
321
|
-
// absolute/relative path commands as a single candidate so their existing
|
|
322
|
-
// ENOENT failure semantics stay intact.
|
|
323
|
-
const commandIsString = typeof command === 'string' && command.length > 0;
|
|
324
|
-
const isPathLike = commandIsString && (
|
|
325
|
-
path.isAbsolute(command)
|
|
326
|
-
|| command.includes('/')
|
|
327
|
-
|| command.includes('\\')
|
|
328
|
-
);
|
|
329
|
-
const candidates = process.platform === 'win32'
|
|
330
|
-
&& commandIsString
|
|
331
|
-
&& !path.extname(command)
|
|
332
|
-
&& !isPathLike
|
|
333
|
-
? [command, `${command}.cmd`, `${command}.exe`, `${command}.bat`]
|
|
334
|
-
: [command];
|
|
335
|
-
|
|
336
|
-
// cmd.exe treats these as operators, grouping syntax, expansion markers,
|
|
337
|
-
// separators, or argument boundaries. Do not route such command strings
|
|
338
|
-
// through shell mode.
|
|
339
|
-
const UNSAFE_SHELL_CHARS = /[&|<>^%!()\s;]/;
|
|
340
|
-
|
|
341
|
-
// When spawning via cmd.exe (shell:true) on Windows, Node concatenates
|
|
342
|
-
// command + args WITHOUT quoting (DEP0190). An arg containing a space —
|
|
343
|
-
// such as a path under "C:\Program Files" — gets re-split by cmd.exe.
|
|
344
|
-
// Build a properly-quoted command line instead and pass it as a single
|
|
345
|
-
// string with no args array, so cmd.exe sees each token as one unit.
|
|
346
|
-
function quoteWin(token) {
|
|
347
|
-
// If the token has no characters that need quoting, return it as-is.
|
|
348
|
-
if (!/[\s"&|<>^%!();]/.test(token)) {
|
|
349
|
-
return token;
|
|
350
|
-
}
|
|
351
|
-
// Escape embedded double quotes by doubling them, then wrap in double
|
|
352
|
-
// quotes. cmd.exe uses "" as an escaped quote inside a quoted string.
|
|
353
|
-
return '"' + token.replace(/"/g, '""') + '"';
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
function attempt(idx) {
|
|
357
|
-
const tryCommand = candidates[idx];
|
|
358
|
-
const isLast = idx + 1 >= candidates.length;
|
|
359
|
-
let stderr = '';
|
|
360
|
-
let attemptDone = false;
|
|
361
|
-
let timer = null;
|
|
362
|
-
|
|
363
|
-
function retryNext() {
|
|
364
|
-
if (attemptDone) return;
|
|
365
|
-
attemptDone = true;
|
|
366
|
-
if (timer) {
|
|
367
|
-
clearTimeout(timer);
|
|
368
|
-
timer = null;
|
|
369
|
-
}
|
|
370
|
-
attempt(idx + 1);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
function attemptFinish(result) {
|
|
374
|
-
if (attemptDone) return;
|
|
375
|
-
attemptDone = true;
|
|
376
|
-
if (timer) {
|
|
377
|
-
clearTimeout(timer);
|
|
378
|
-
timer = null;
|
|
379
|
-
}
|
|
380
|
-
finish(result);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
// Node 18.20+/20.12+ refuse to spawn .cmd/.bat directly on Windows
|
|
384
|
-
// after the CVE-2024-27980 mitigation. Only those extension candidates
|
|
385
|
-
// go through cmd.exe, after the command string is shell-character clean.
|
|
386
|
-
const useShell = process.platform === 'win32'
|
|
387
|
-
&& typeof tryCommand === 'string'
|
|
388
|
-
&& /\.(cmd|bat)$/i.test(tryCommand)
|
|
389
|
-
&& !UNSAFE_SHELL_CHARS.test(tryCommand);
|
|
390
|
-
|
|
391
|
-
let child;
|
|
392
|
-
try {
|
|
393
|
-
if (useShell) {
|
|
394
|
-
// Build a single quoted command line for cmd.exe. Passing an args
|
|
395
|
-
// array with shell:true causes Node to concatenate without quoting
|
|
396
|
-
// (DEP0190), which splits space-containing args (e.g. paths under
|
|
397
|
-
// "C:\Program Files") at every space boundary.
|
|
398
|
-
const quotedCmdline = [tryCommand, ...args].map(quoteWin).join(' ');
|
|
399
|
-
child = spawn(quotedCmdline, {
|
|
400
|
-
env: mergedEnv,
|
|
401
|
-
cwd: process.cwd(),
|
|
402
|
-
stdio: ['pipe', 'ignore', 'pipe'],
|
|
403
|
-
shell: true
|
|
404
|
-
});
|
|
405
|
-
} else {
|
|
406
|
-
child = spawn(tryCommand, args, {
|
|
407
|
-
env: mergedEnv,
|
|
408
|
-
cwd: process.cwd(),
|
|
409
|
-
stdio: ['pipe', 'ignore', 'pipe'],
|
|
410
|
-
shell: false
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
} catch (error) {
|
|
414
|
-
if ((error.code === 'ENOENT' || error.code === 'EINVAL') && !isLast) {
|
|
415
|
-
retryNext();
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
attemptFinish({
|
|
419
|
-
ok: false,
|
|
420
|
-
statusCode: null,
|
|
421
|
-
reason: error.message
|
|
422
|
-
});
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
child.stderr.on('data', chunk => {
|
|
427
|
-
if (stderr.length < 4000) {
|
|
428
|
-
const remaining = 4000 - stderr.length;
|
|
429
|
-
stderr += String(chunk).slice(0, remaining);
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
child.on('error', error => {
|
|
434
|
-
if ((error.code === 'ENOENT' || error.code === 'EINVAL') && !isLast) {
|
|
435
|
-
retryNext();
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
attemptFinish({
|
|
439
|
-
ok: false,
|
|
440
|
-
statusCode: null,
|
|
441
|
-
reason: error.message
|
|
442
|
-
});
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
child.on('exit', (code, signal) => {
|
|
446
|
-
attemptFinish({
|
|
447
|
-
ok: false,
|
|
448
|
-
statusCode: code,
|
|
449
|
-
reason: stderr.trim() || `process exited before handshake (${signal || code || 'unknown'})`
|
|
450
|
-
});
|
|
451
|
-
});
|
|
452
|
-
|
|
453
|
-
timer = setTimeout(() => {
|
|
454
|
-
// A fast-crashing stdio server can finish before the timer callback runs
|
|
455
|
-
// on a loaded machine. Check the process state again before classifying it
|
|
456
|
-
// as healthy on timeout.
|
|
457
|
-
if (child.exitCode !== null || child.signalCode !== null) {
|
|
458
|
-
attemptFinish({
|
|
459
|
-
ok: false,
|
|
460
|
-
statusCode: child.exitCode,
|
|
461
|
-
reason: stderr.trim() || `process exited before handshake (${child.signalCode || child.exitCode || 'unknown'})`
|
|
462
|
-
});
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
try {
|
|
467
|
-
if (useShell && child.pid && process.platform === 'win32') {
|
|
468
|
-
// When spawned via shell on Windows, child is cmd.exe. kill() only
|
|
469
|
-
// terminates the shell and leaves the real server process orphaned.
|
|
470
|
-
// taskkill /T kills the entire process tree rooted at cmd.exe.
|
|
471
|
-
const killResult = spawnSync('taskkill', ['/PID', String(child.pid), '/T', '/F'], {
|
|
472
|
-
stdio: 'ignore',
|
|
473
|
-
windowsHide: true
|
|
474
|
-
});
|
|
475
|
-
if (killResult.error || (typeof killResult.status === 'number' && killResult.status !== 0)) {
|
|
476
|
-
// taskkill not on PATH, permission denied, or already exited.
|
|
477
|
-
// Best-effort fallback: signal the cmd.exe shell directly. The
|
|
478
|
-
// child tree may still leak if it already detached, but this at
|
|
479
|
-
// least kills the shell we spawned.
|
|
480
|
-
try { child.kill('SIGKILL'); } catch { /* ignore */ }
|
|
481
|
-
}
|
|
482
|
-
} else {
|
|
483
|
-
child.kill('SIGTERM');
|
|
484
|
-
setTimeout(() => {
|
|
485
|
-
try {
|
|
486
|
-
child.kill('SIGKILL');
|
|
487
|
-
} catch {
|
|
488
|
-
// ignore
|
|
489
|
-
}
|
|
490
|
-
}, 200).unref?.();
|
|
491
|
-
}
|
|
492
|
-
} catch {
|
|
493
|
-
// ignore
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
attemptFinish({
|
|
497
|
-
ok: true,
|
|
498
|
-
statusCode: null,
|
|
499
|
-
reason: `${serverName} accepted a new stdio process`
|
|
500
|
-
});
|
|
501
|
-
}, timeoutMs);
|
|
502
|
-
|
|
503
|
-
if (typeof timer.unref === 'function') {
|
|
504
|
-
timer.unref();
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
attempt(0);
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
async function probeServer(serverName, resolvedConfig) {
|
|
513
|
-
const config = resolvedConfig.config;
|
|
514
|
-
|
|
515
|
-
if (config.type === 'http' || config.url) {
|
|
516
|
-
const result = await requestHttp(config.url, config.headers || {}, envNumber('THEUS_SALUD_MCP_TIMEOUT_MS', DEFAULT_TIMEOUT_MS));
|
|
517
|
-
|
|
518
|
-
return {
|
|
519
|
-
ok: result.ok,
|
|
520
|
-
failureCode: RECONNECT_STATUS_CODES.has(result.statusCode) ? result.statusCode : null,
|
|
521
|
-
reason: result.reason,
|
|
522
|
-
source: resolvedConfig.source
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
if (config.command) {
|
|
527
|
-
const result = await probeCommandServer(serverName, config);
|
|
528
|
-
|
|
529
|
-
return {
|
|
530
|
-
ok: result.ok,
|
|
531
|
-
failureCode: RECONNECT_STATUS_CODES.has(result.statusCode) ? result.statusCode : null,
|
|
532
|
-
reason: result.reason,
|
|
533
|
-
source: resolvedConfig.source
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
return {
|
|
538
|
-
ok: false,
|
|
539
|
-
failureCode: null,
|
|
540
|
-
reason: 'unsupported MCP server config',
|
|
541
|
-
source: resolvedConfig.source
|
|
542
|
-
};
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
function reconnectCommand(serverName) {
|
|
546
|
-
const key = `THEUS_SALUD_MCP_RECONEXION_${String(serverName).toUpperCase().replace(/[^A-Z0-9]/g, '_')}`;
|
|
547
|
-
const command = process.env[key] || process.env.THEUS_SALUD_MCP_COMANDO_RECONEXION || '';
|
|
548
|
-
if (!command.trim()) {
|
|
549
|
-
return null;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
return command.includes('{server}')
|
|
553
|
-
? command.replace(/\{server\}/g, serverName)
|
|
554
|
-
: command;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
function attemptReconnect(serverName) {
|
|
558
|
-
const command = reconnectCommand(serverName);
|
|
559
|
-
if (!command) {
|
|
560
|
-
return { attempted: false, success: false, reason: 'no reconnect command configured' };
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
const result = spawnSync(command, {
|
|
564
|
-
shell: true,
|
|
565
|
-
env: process.env,
|
|
566
|
-
cwd: process.cwd(),
|
|
567
|
-
encoding: 'utf8',
|
|
568
|
-
timeout: envNumber('THEUS_SALUD_MCP_RECONEXION_TIMEOUT_MS', DEFAULT_TIMEOUT_MS)
|
|
569
|
-
});
|
|
570
|
-
|
|
571
|
-
if (result.error) {
|
|
572
|
-
return { attempted: true, success: false, reason: result.error.message };
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
if (result.status !== 0) {
|
|
576
|
-
return {
|
|
577
|
-
attempted: true,
|
|
578
|
-
success: false,
|
|
579
|
-
reason: (result.stderr || result.stdout || `reconnect exited ${result.status}`).trim()
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
return { attempted: true, success: true, reason: 'reconnect command completed' };
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
function shouldFailOpen() {
|
|
587
|
-
return /^(1|true|yes)$/i.test(String(process.env.THEUS_SALUD_MCP_FAIL_OPEN || ''));
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
function emitLogs(logs) {
|
|
591
|
-
for (const line of logs) {
|
|
592
|
-
process.stderr.write(`${line}\n`);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
async function handlePreToolUse(rawInput, input, target, statePathValue, now) {
|
|
597
|
-
const logs = [];
|
|
598
|
-
const state = loadState(statePathValue);
|
|
599
|
-
const previous = state.servers[target.server] || {};
|
|
600
|
-
|
|
601
|
-
if (previous.status === 'healthy' && Number(previous.expiresAt || 0) > now) {
|
|
602
|
-
return { rawInput, exitCode: 0, logs };
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
if (previous.status === 'unhealthy' && Number(previous.nextRetryAt || 0) > now) {
|
|
606
|
-
logs.push(
|
|
607
|
-
`[salud-mcp] ${target.server} está marcado como no saludable hasta ${new Date(previous.nextRetryAt).toISOString()}; se omite ${target.tool || 'la tool'}`
|
|
608
|
-
);
|
|
609
|
-
return { rawInput, exitCode: shouldFailOpen() ? 0 : 2, logs };
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
const resolvedConfig = resolveServerConfig(target.server);
|
|
613
|
-
if (!resolvedConfig) {
|
|
614
|
-
logs.push(`[salud-mcp] No se encontró configuración MCP para ${target.server}; se omite el sondeo previo`);
|
|
615
|
-
return { rawInput, exitCode: 0, logs };
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
const probe = await probeServer(target.server, resolvedConfig);
|
|
619
|
-
if (probe.ok) {
|
|
620
|
-
markHealthy(state, target.server, now, { source: resolvedConfig.source });
|
|
621
|
-
saveState(statePathValue, state);
|
|
622
|
-
|
|
623
|
-
if (previous.status === 'unhealthy') {
|
|
624
|
-
logs.push(`[salud-mcp] ${target.server}: conexión restablecida`);
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
return { rawInput, exitCode: 0, logs };
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
let reconnect = { attempted: false, success: false, reason: 'probe failed' };
|
|
631
|
-
if (probe.failureCode || previous.status === 'unhealthy') {
|
|
632
|
-
reconnect = attemptReconnect(target.server);
|
|
633
|
-
if (reconnect.success) {
|
|
634
|
-
const reprobe = await probeServer(target.server, resolvedConfig);
|
|
635
|
-
if (reprobe.ok) {
|
|
636
|
-
markHealthy(state, target.server, now, {
|
|
637
|
-
source: resolvedConfig.source,
|
|
638
|
-
restoredBy: 'reconnect-command'
|
|
639
|
-
});
|
|
640
|
-
saveState(statePathValue, state);
|
|
641
|
-
logs.push(`[salud-mcp] ${target.server}: conexión restablecida tras la reconexión`);
|
|
642
|
-
return { rawInput, exitCode: 0, logs };
|
|
643
|
-
}
|
|
644
|
-
probe.reason = `${probe.reason}; reconnect reprobe failed: ${reprobe.reason}`;
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
markUnhealthy(state, target.server, now, probe.failureCode, probe.reason);
|
|
649
|
-
saveState(statePathValue, state);
|
|
650
|
-
|
|
651
|
-
const reconnectSuffix = reconnect.attempted
|
|
652
|
-
? ` Reconnect attempt: ${reconnect.success ? 'ok' : reconnect.reason}.`
|
|
653
|
-
: '';
|
|
654
|
-
logs.push(
|
|
655
|
-
`[salud-mcp] ${target.server} no está disponible (${probe.reason}). Se bloquea ${target.tool || 'la tool'} para que el agente recurra a herramientas no MCP.${reconnectSuffix}`
|
|
656
|
-
);
|
|
657
|
-
|
|
658
|
-
return { rawInput, exitCode: shouldFailOpen() ? 0 : 2, logs };
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
async function handlePostToolUseFailure(rawInput, input, target, statePathValue, now) {
|
|
662
|
-
const logs = [];
|
|
663
|
-
const summary = failureSummary(input);
|
|
664
|
-
const failureCode = detectFailureCode(summary);
|
|
665
|
-
|
|
666
|
-
if (!failureCode) {
|
|
667
|
-
return { rawInput, exitCode: 0, logs };
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
const state = loadState(statePathValue);
|
|
671
|
-
markUnhealthy(state, target.server, now, failureCode, summary.slice(0, 500));
|
|
672
|
-
saveState(statePathValue, state);
|
|
673
|
-
|
|
674
|
-
logs.push(`[salud-mcp] ${target.server} reportó ${failureCode}; se marca el servidor como no saludable y se intenta reconectar`);
|
|
675
|
-
|
|
676
|
-
const reconnect = attemptReconnect(target.server);
|
|
677
|
-
if (!reconnect.attempted) {
|
|
678
|
-
logs.push(`[salud-mcp] ${target.server}: reconexión omitida: ${reconnect.reason}`);
|
|
679
|
-
return { rawInput, exitCode: 0, logs };
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
if (!reconnect.success) {
|
|
683
|
-
logs.push(`[salud-mcp] ${target.server}: la reconexión falló: ${reconnect.reason}`);
|
|
684
|
-
return { rawInput, exitCode: 0, logs };
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
const resolvedConfig = resolveServerConfig(target.server);
|
|
688
|
-
if (!resolvedConfig) {
|
|
689
|
-
logs.push(`[salud-mcp] ${target.server}: la reconexión terminó pero no había configuración para un sondeo de confirmación`);
|
|
690
|
-
return { rawInput, exitCode: 0, logs };
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
const reprobe = await probeServer(target.server, resolvedConfig);
|
|
694
|
-
if (!reprobe.ok) {
|
|
695
|
-
logs.push(`[salud-mcp] ${target.server}: el comando de reconexión corrió, pero el sondeo de salud siguió fallando: ${reprobe.reason}`);
|
|
696
|
-
return { rawInput, exitCode: 0, logs };
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
const refreshed = loadState(statePathValue);
|
|
700
|
-
markHealthy(refreshed, target.server, now, {
|
|
701
|
-
source: resolvedConfig.source,
|
|
702
|
-
restoredBy: 'post-failure-reconnect'
|
|
703
|
-
});
|
|
704
|
-
saveState(statePathValue, refreshed);
|
|
705
|
-
logs.push(`[salud-mcp] ${target.server}: conexión restablecida`);
|
|
706
|
-
return { rawInput, exitCode: 0, logs };
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
async function main() {
|
|
710
|
-
const { raw: rawInput, truncated } = await readRawStdin();
|
|
711
|
-
const input = safeParse(rawInput);
|
|
712
|
-
const target = extractMcpTarget(input) || (truncated ? extractMcpTargetFromRaw(rawInput) : null);
|
|
713
|
-
|
|
714
|
-
if (!target) {
|
|
715
|
-
process.stdout.write(rawInput);
|
|
716
|
-
process.exit(0);
|
|
717
|
-
return;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
if (truncated) {
|
|
721
|
-
const limit = Number(process.env.THEUS_HOOK_INPUT_MAX_BYTES) || MAX_STDIN;
|
|
722
|
-
const logs = [
|
|
723
|
-
shouldFailOpen()
|
|
724
|
-
? `[salud-mcp] La entrada del hook superó ${limit} bytes al revisar ${target.server}; se permite ${target.tool || 'la tool'} porque el modo fail-open está activo`
|
|
725
|
-
: `[salud-mcp] La entrada del hook superó ${limit} bytes al revisar ${target.server}; se bloquea ${target.tool || 'la tool'} para no eludir los chequeos de salud MCP`
|
|
726
|
-
];
|
|
727
|
-
emitLogs(logs);
|
|
728
|
-
process.stdout.write(rawInput);
|
|
729
|
-
process.exit(shouldFailOpen() ? 0 : 2);
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
const eventName = process.env.THEUS_HOOK_EVENT_NAME || 'PreToolUse';
|
|
734
|
-
const now = Date.now();
|
|
735
|
-
const statePathValue = stateFilePath();
|
|
736
|
-
|
|
737
|
-
const result = eventName === 'PostToolUseFailure'
|
|
738
|
-
? await handlePostToolUseFailure(rawInput, input, target, statePathValue, now)
|
|
739
|
-
: await handlePreToolUse(rawInput, input, target, statePathValue, now);
|
|
740
|
-
|
|
741
|
-
emitLogs(result.logs);
|
|
742
|
-
process.stdout.write(result.rawInput);
|
|
743
|
-
process.exit(result.exitCode);
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
main().catch(error => {
|
|
747
|
-
process.stderr.write(`[salud-mcp] Error inesperado: ${error.message}\n`);
|
|
748
|
-
process.exit(0);
|
|
749
|
-
});
|