theus-cli-linux-arm64 1.2.2 → 1.4.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/README.md +50 -11
- 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
|
@@ -0,0 +1,737 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Layer B optional rewrite hook for statistical (token-sampling) watermarks.
|
|
3
|
+
|
|
4
|
+
Backends:
|
|
5
|
+
print-prompt — emit prompt only (default; CI-safe, no model)
|
|
6
|
+
ollama — POST to Ollama /api/chat
|
|
7
|
+
openai-compatible — POST to OpenAI-style /v1/chat/completions
|
|
8
|
+
|
|
9
|
+
Env (optional):
|
|
10
|
+
WATERMARKS_REWRITE_BACKEND
|
|
11
|
+
WATERMARKS_REWRITE_BASE_URL
|
|
12
|
+
WATERMARKS_REWRITE_MODEL
|
|
13
|
+
WATERMARKS_REWRITE_API_KEY (env-only; never pass keys on argv)
|
|
14
|
+
WATERMARKS_REWRITE_ALLOW_REMOTE (set to 1 to allow non-loopback endpoints)
|
|
15
|
+
WATERMARKS_REWRITE_CANDIDATES (default 1; variants generated per loop)
|
|
16
|
+
WATERMARKS_REWRITE_LOOPS (default 1; max evaluation rounds)
|
|
17
|
+
|
|
18
|
+
Rewriting is iterative and evaluation-driven: each loop generates
|
|
19
|
+
--candidates (default 1) variants, evaluates each, and stops as soon as an
|
|
20
|
+
attempt passes watermark detection; --max-loops (default 1) caps how many
|
|
21
|
+
evaluation rounds run before the best-effort variant is returned
|
|
22
|
+
(WATERMARKS_REWRITE_LOOPS). The evaluator is chosen by priority: keyed-Gumbel
|
|
23
|
+
same-key replay (when --gumbel-key / WATERMARKS_GUMBEL_KEY is set), else
|
|
24
|
+
MarkLLM same-config detection (--markllm-scheme), else, when no detector is
|
|
25
|
+
configured, bigram-Jaccard lexical divergence (no pass/fail verdict — all
|
|
26
|
+
attempts are generated and the most diverged one is selected). A vendor-detector
|
|
27
|
+
seam (Google's retired SynthID-text detector) is reserved ahead of the
|
|
28
|
+
same-config detectors should a vendor endpoint return.
|
|
29
|
+
|
|
30
|
+
Security notes:
|
|
31
|
+
- Only http(s) endpoints are accepted; redirects are refused outright so an
|
|
32
|
+
Authorization header (API key) can never be re-sent to an unvalidated host.
|
|
33
|
+
- Non-loopback endpoints are denied unless WATERMARKS_REWRITE_ALLOW_REMOTE=1
|
|
34
|
+
(or --allow-remote) is set explicitly.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
from __future__ import annotations
|
|
38
|
+
|
|
39
|
+
import argparse
|
|
40
|
+
import itertools
|
|
41
|
+
import json
|
|
42
|
+
import os
|
|
43
|
+
import re
|
|
44
|
+
import sys
|
|
45
|
+
import urllib.error
|
|
46
|
+
import urllib.request
|
|
47
|
+
from pathlib import Path
|
|
48
|
+
from urllib.parse import urlparse
|
|
49
|
+
|
|
50
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
51
|
+
|
|
52
|
+
from common import cleaned_path, eprint, read_text_input, write_text_output
|
|
53
|
+
from text_detectors import GumbelTextDetector, MarkLLMTextDetector
|
|
54
|
+
from text_unicode import clean_text
|
|
55
|
+
|
|
56
|
+
DEFAULT_MARKLLM_MODEL = "facebook/opt-1.3b"
|
|
57
|
+
DEFAULT_CANDIDATES = 1
|
|
58
|
+
DEFAULT_MAX_LOOPS = 1
|
|
59
|
+
|
|
60
|
+
PROMPTS = {
|
|
61
|
+
"paraphrase": (
|
|
62
|
+
"Rewrite the following text so that it uses substantially different wording at "
|
|
63
|
+
"the token level. Change clause order, connectors, and transition words; vary "
|
|
64
|
+
"sentence boundaries and length; and replace both content words and function "
|
|
65
|
+
"words where meaning allows. Preserve all facts, numbers, names, and technical "
|
|
66
|
+
"identifiers. Do not add or remove claims. Output only the rewritten text.\n\n---\n{TEXT}"
|
|
67
|
+
),
|
|
68
|
+
"humanize": (
|
|
69
|
+
"Rewrite the following text so it reads as if a human wrote it from scratch. "
|
|
70
|
+
"Vary sentence rhythm and length, replace formulaic AI-style transitions and "
|
|
71
|
+
"filler with concrete natural phrasing, and use plain, varied wording. Preserve "
|
|
72
|
+
"all facts, numbers, names, and technical identifiers. Do not add or remove "
|
|
73
|
+
"claims. Output only the rewritten text.\n\n---\n{TEXT}"
|
|
74
|
+
),
|
|
75
|
+
"code": (
|
|
76
|
+
"Rewrite the natural-language parts of this code — comments, docstrings, and "
|
|
77
|
+
"string literals — using different wording. Rename local variables, function "
|
|
78
|
+
"parameters, and private helper names to semantically equivalent names. Preserve "
|
|
79
|
+
"program behavior, public API names, and all values that affect output. Output "
|
|
80
|
+
"only the rewritten code.\n\n---\n{TEXT}"
|
|
81
|
+
),
|
|
82
|
+
"backtranslate_out": (
|
|
83
|
+
"Translate the following text to {LANG}. Output only the translation.\n\n---\n{TEXT}"
|
|
84
|
+
),
|
|
85
|
+
"backtranslate_back": (
|
|
86
|
+
"Translate the following text to {ORIGINAL_LANG}. Preserve meaning; use natural "
|
|
87
|
+
"phrasing. Output only the translation.\n\n---\n{TEXT}"
|
|
88
|
+
),
|
|
89
|
+
"structural_outline": (
|
|
90
|
+
"Extract a bullet outline of all claims and structure from the text "
|
|
91
|
+
"(no full sentences). Output only the outline.\n\n---\n{TEXT}"
|
|
92
|
+
),
|
|
93
|
+
"structural_write": (
|
|
94
|
+
"Write a complete document from this outline in natural, varied human prose. "
|
|
95
|
+
"Avoid formulaic transitions. Do not omit any bullet. Output only the document."
|
|
96
|
+
"\n\n---\n{TEXT}"
|
|
97
|
+
),
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def _tokens(text: str) -> list[str]:
|
|
102
|
+
return re.findall(r"[A-Za-z0-9]+", text.lower())
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _bigrams(tokens: list[str]) -> set[tuple[str, str]]:
|
|
106
|
+
# PARCHE Theus: itertools.pairwise es 3.10+; sobre una lista, zip con el
|
|
107
|
+
# desplazado en uno da exactamente los mismos pares y en el mismo orden.
|
|
108
|
+
return set(zip(tokens, tokens[1:]))
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _lexical_divergence(original: str, candidate: str) -> float:
|
|
112
|
+
"""Bigram Jaccard distance: 0.0 identical, 1.0 fully different."""
|
|
113
|
+
a = _tokens(original)
|
|
114
|
+
b = _tokens(candidate)
|
|
115
|
+
if not a and not b:
|
|
116
|
+
return 0.0
|
|
117
|
+
if not a or not b:
|
|
118
|
+
return 1.0
|
|
119
|
+
ba = _bigrams(a)
|
|
120
|
+
bb = _bigrams(b)
|
|
121
|
+
union = ba | bb
|
|
122
|
+
if not union:
|
|
123
|
+
return 0.0
|
|
124
|
+
return 1.0 - len(ba & bb) / len(union)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def _select_candidate(original: str, candidates: list[str]) -> tuple[str, list[float]]:
|
|
128
|
+
"""Pick the most lexically diverged rewrite, gently guarding extreme length drift."""
|
|
129
|
+
scores: list[float] = []
|
|
130
|
+
for cand in candidates:
|
|
131
|
+
score = _lexical_divergence(original, cand)
|
|
132
|
+
if original:
|
|
133
|
+
ratio = len(cand) / len(original)
|
|
134
|
+
if ratio > 2.0 or ratio < 0.5:
|
|
135
|
+
score -= 0.15
|
|
136
|
+
scores.append(score)
|
|
137
|
+
best_idx = max(range(len(candidates)), key=lambda i: scores[i])
|
|
138
|
+
return candidates[best_idx], scores
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def _env(name: str, default: str | None = None) -> str | None:
|
|
142
|
+
v = os.environ.get(name)
|
|
143
|
+
if v is None or v == "":
|
|
144
|
+
return default
|
|
145
|
+
return v
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def _flag_env(name: str) -> bool:
|
|
149
|
+
return os.environ.get(name, "").strip().lower() in ("1", "true", "yes", "on")
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def _env_int(name: str, default: int) -> int:
|
|
153
|
+
try:
|
|
154
|
+
return int(_env(name, str(default)) or str(default))
|
|
155
|
+
except ValueError:
|
|
156
|
+
return default
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
_LOOPBACK_HOSTS = frozenset({"localhost", "127.0.0.1", "::1"})
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def _check_remote(base_url: str, allow_remote: bool) -> None:
|
|
163
|
+
"""Enforce the rewrite-endpoint allowlist.
|
|
164
|
+
|
|
165
|
+
Default-deny: only loopback endpoints are accepted. Anything else requires
|
|
166
|
+
an explicit opt-in (--allow-remote / WATERMARKS_REWRITE_ALLOW_REMOTE=1),
|
|
167
|
+
and non-http(s) schemes (e.g. file://) are always refused.
|
|
168
|
+
"""
|
|
169
|
+
u = urlparse(base_url)
|
|
170
|
+
if u.scheme not in ("http", "https"):
|
|
171
|
+
raise SystemExit(
|
|
172
|
+
f"error: rewrite base URL must be http(s), got scheme '{u.scheme}': {base_url}"
|
|
173
|
+
)
|
|
174
|
+
host = u.hostname or ""
|
|
175
|
+
if host in _LOOPBACK_HOSTS:
|
|
176
|
+
return
|
|
177
|
+
if not allow_remote:
|
|
178
|
+
raise SystemExit(
|
|
179
|
+
"error: rewrite base URL host is not loopback "
|
|
180
|
+
f"('{host}'); refusing to send content off-machine. "
|
|
181
|
+
"Set WATERMARKS_REWRITE_ALLOW_REMOTE=1 or pass --allow-remote to override."
|
|
182
|
+
)
|
|
183
|
+
eprint(
|
|
184
|
+
f"warning: rewrite base URL host is '{host}' (not localhost); "
|
|
185
|
+
"content will leave this machine"
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class _NoRedirect(urllib.request.HTTPRedirectHandler):
|
|
190
|
+
"""Refuse HTTP redirects.
|
|
191
|
+
|
|
192
|
+
urllib's default handler re-sends the request headers on 301/302/303,
|
|
193
|
+
which would forward the Authorization header (API key) to an unvalidated
|
|
194
|
+
host behind the localhost allowlist. Any 3xx now surfaces as HTTPError.
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
def redirect_request(self, req, fp, code, msg, headers, newurl):
|
|
198
|
+
raise urllib.error.HTTPError(req.full_url, code, msg, headers, fp)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def _safe_detect(detector: object, text: str) -> dict:
|
|
202
|
+
"""Run a detector report defensively; a raising detector never fails the rewrite."""
|
|
203
|
+
try:
|
|
204
|
+
return detector.detect(text) # type: ignore[attr-defined]
|
|
205
|
+
except Exception as e: # defensive: the detector contract is fail-soft
|
|
206
|
+
return {"available": False, "error": f"evaluation failed: {e}"}
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def _pick_evaluator(
|
|
210
|
+
markllm_detector: MarkLLMTextDetector | None,
|
|
211
|
+
gumbel_detector: GumbelTextDetector | None,
|
|
212
|
+
) -> tuple[str, object | None]:
|
|
213
|
+
"""Pick the evaluator that drives the iterative rewrite loop.
|
|
214
|
+
|
|
215
|
+
Priority: keyed-Gumbel same-key replay (when the caller passed
|
|
216
|
+
--gumbel-key) > MarkLLM same-config detection (--markllm-scheme) >
|
|
217
|
+
bigram-Jaccard lexical divergence (fallback with no pass/fail verdict).
|
|
218
|
+
A vendor-detector seam (Google's SynthID-text detector, retired Aug 2026)
|
|
219
|
+
is reserved ahead of both should a vendor endpoint return; it only needs
|
|
220
|
+
available()/detect()/name per the TextDetector protocol in
|
|
221
|
+
text_detectors.py.
|
|
222
|
+
"""
|
|
223
|
+
if gumbel_detector is not None:
|
|
224
|
+
return "gumbel", gumbel_detector
|
|
225
|
+
if markllm_detector is not None:
|
|
226
|
+
return "markllm", markllm_detector
|
|
227
|
+
return "lexical-divergence", None
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def _generate_once(
|
|
231
|
+
backend: str,
|
|
232
|
+
base_url: str,
|
|
233
|
+
model: str,
|
|
234
|
+
api_key: str | None,
|
|
235
|
+
prompt: str,
|
|
236
|
+
timeout: float,
|
|
237
|
+
temperature: float,
|
|
238
|
+
reasoning_effort: str | None,
|
|
239
|
+
) -> str:
|
|
240
|
+
"""Generate a single rewrite variant through the configured backend."""
|
|
241
|
+
if backend == "ollama":
|
|
242
|
+
return call_ollama(base_url, model, prompt, timeout, temperature)
|
|
243
|
+
if backend == "openai-compatible":
|
|
244
|
+
return call_openai_compatible(
|
|
245
|
+
base_url, model, prompt, api_key, timeout, temperature, reasoning_effort
|
|
246
|
+
)
|
|
247
|
+
raise SystemExit(f"unknown backend: {backend}")
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def build_prompt(strength: str, text: str, *, lang: str, original_lang: str) -> str:
|
|
251
|
+
if strength == "paraphrase":
|
|
252
|
+
return PROMPTS["paraphrase"].format(TEXT=text)
|
|
253
|
+
if strength == "humanize":
|
|
254
|
+
return PROMPTS["humanize"].format(TEXT=text)
|
|
255
|
+
if strength == "code":
|
|
256
|
+
return PROMPTS["code"].format(TEXT=text)
|
|
257
|
+
if strength == "backtranslate":
|
|
258
|
+
# single combined instruction for print-prompt / one-shot backends
|
|
259
|
+
return (
|
|
260
|
+
f"Translate the text to {lang}, then translate that result back to "
|
|
261
|
+
f"{original_lang}. Preserve all facts, numbers, and names. "
|
|
262
|
+
f"Output only the final {original_lang} text.\n\n---\n{text}"
|
|
263
|
+
)
|
|
264
|
+
if strength == "structural":
|
|
265
|
+
return (
|
|
266
|
+
"First extract a bullet outline of all claims (no full sentences). "
|
|
267
|
+
"Then write a complete document from that outline in natural, varied human "
|
|
268
|
+
"prose without omitting any bullet. Output only the final document.\n\n---\n"
|
|
269
|
+
f"{text}"
|
|
270
|
+
)
|
|
271
|
+
raise ValueError(f"unknown strength: {strength}")
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def _http_json(url: str, payload: dict, headers: dict[str, str], timeout: float) -> dict:
|
|
275
|
+
if urlparse(url).scheme not in ("http", "https"):
|
|
276
|
+
raise ValueError(f"refusing non-http(s) rewrite endpoint: {url}")
|
|
277
|
+
body = json.dumps(payload).encode("utf-8")
|
|
278
|
+
# S310: URL scheme is restricted to http/https just above.
|
|
279
|
+
req = urllib.request.Request( # noqa: S310
|
|
280
|
+
url,
|
|
281
|
+
data=body,
|
|
282
|
+
headers={"Content-Type": "application/json", **headers},
|
|
283
|
+
method="POST",
|
|
284
|
+
)
|
|
285
|
+
opener = urllib.request.build_opener(_NoRedirect())
|
|
286
|
+
with opener.open(req, timeout=timeout) as resp:
|
|
287
|
+
return json.loads(resp.read().decode("utf-8"))
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
def call_ollama(base_url: str, model: str, prompt: str, timeout: float, temperature: float) -> str:
|
|
291
|
+
url = base_url.rstrip("/") + "/api/chat"
|
|
292
|
+
data = _http_json(
|
|
293
|
+
url,
|
|
294
|
+
{
|
|
295
|
+
"model": model,
|
|
296
|
+
"stream": False,
|
|
297
|
+
"messages": [{"role": "user", "content": prompt}],
|
|
298
|
+
"options": {"temperature": temperature},
|
|
299
|
+
},
|
|
300
|
+
{},
|
|
301
|
+
timeout,
|
|
302
|
+
)
|
|
303
|
+
msg = data.get("message") or {}
|
|
304
|
+
content = msg.get("content")
|
|
305
|
+
if not content:
|
|
306
|
+
raise RuntimeError(f"ollama empty response: {data!r}"[:500])
|
|
307
|
+
return str(content).strip()
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
def call_openai_compatible(
|
|
311
|
+
base_url: str,
|
|
312
|
+
model: str,
|
|
313
|
+
prompt: str,
|
|
314
|
+
api_key: str | None,
|
|
315
|
+
timeout: float,
|
|
316
|
+
temperature: float,
|
|
317
|
+
reasoning_effort: str | None = None,
|
|
318
|
+
) -> str:
|
|
319
|
+
url = base_url.rstrip("/") + "/v1/chat/completions"
|
|
320
|
+
headers: dict[str, str] = {}
|
|
321
|
+
if api_key:
|
|
322
|
+
headers["Authorization"] = f"Bearer {api_key}"
|
|
323
|
+
payload: dict = {
|
|
324
|
+
"model": model,
|
|
325
|
+
"messages": [{"role": "user", "content": prompt}],
|
|
326
|
+
"temperature": temperature,
|
|
327
|
+
}
|
|
328
|
+
if reasoning_effort:
|
|
329
|
+
payload["reasoning_effort"] = reasoning_effort
|
|
330
|
+
data = _http_json(
|
|
331
|
+
url,
|
|
332
|
+
payload,
|
|
333
|
+
headers,
|
|
334
|
+
timeout,
|
|
335
|
+
)
|
|
336
|
+
choices = data.get("choices") or []
|
|
337
|
+
if not choices:
|
|
338
|
+
raise RuntimeError(f"openai-compatible empty choices: {data!r}"[:500])
|
|
339
|
+
content = (choices[0].get("message") or {}).get("content")
|
|
340
|
+
if not content:
|
|
341
|
+
raise RuntimeError(f"openai-compatible empty content: {data!r}"[:500])
|
|
342
|
+
return str(content).strip()
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
def rewrite(
|
|
346
|
+
text: str,
|
|
347
|
+
*,
|
|
348
|
+
backend: str,
|
|
349
|
+
model: str | None,
|
|
350
|
+
base_url: str | None,
|
|
351
|
+
api_key: str | None,
|
|
352
|
+
strength: str,
|
|
353
|
+
lang: str,
|
|
354
|
+
original_lang: str,
|
|
355
|
+
timeout: float,
|
|
356
|
+
layer_a_after: bool,
|
|
357
|
+
temperature: float,
|
|
358
|
+
candidates: int,
|
|
359
|
+
max_loops: int = 1,
|
|
360
|
+
allow_remote: bool = False,
|
|
361
|
+
reasoning_effort: str | None = None,
|
|
362
|
+
markllm_scheme: str | None = None,
|
|
363
|
+
markllm_dir: str | None = None,
|
|
364
|
+
markllm_model: str | None = None,
|
|
365
|
+
markllm_timeout: float = 180.0,
|
|
366
|
+
gumbel_key: str | None = None,
|
|
367
|
+
) -> tuple[str, dict]:
|
|
368
|
+
prompt = build_prompt(strength, text, lang=lang, original_lang=original_lang)
|
|
369
|
+
info: dict = {
|
|
370
|
+
"backend": backend,
|
|
371
|
+
"strength": strength,
|
|
372
|
+
"model": model,
|
|
373
|
+
"base_url": base_url,
|
|
374
|
+
"temperature": temperature,
|
|
375
|
+
"prompt_chars": len(prompt),
|
|
376
|
+
"input_chars": len(text),
|
|
377
|
+
}
|
|
378
|
+
if reasoning_effort:
|
|
379
|
+
info["reasoning_effort"] = reasoning_effort
|
|
380
|
+
|
|
381
|
+
markllm: dict | None = None
|
|
382
|
+
markllm_detector: MarkLLMTextDetector | None = None
|
|
383
|
+
if markllm_scheme:
|
|
384
|
+
markllm_detector = MarkLLMTextDetector(
|
|
385
|
+
scheme=markllm_scheme,
|
|
386
|
+
upstream_dir=markllm_dir,
|
|
387
|
+
model=markllm_model or DEFAULT_MARKLLM_MODEL,
|
|
388
|
+
timeout=markllm_timeout,
|
|
389
|
+
)
|
|
390
|
+
markllm = {
|
|
391
|
+
"scheme": markllm_scheme,
|
|
392
|
+
"before": _safe_detect(markllm_detector, text),
|
|
393
|
+
}
|
|
394
|
+
if not markllm["before"]["available"]:
|
|
395
|
+
eprint(f"markllm verification unavailable: {markllm['before']['error']}")
|
|
396
|
+
info["markllm"] = markllm
|
|
397
|
+
|
|
398
|
+
gumbel: dict | None = None
|
|
399
|
+
gumbel_detector: GumbelTextDetector | None = None
|
|
400
|
+
if gumbel_key:
|
|
401
|
+
gumbel_detector = GumbelTextDetector(key=gumbel_key)
|
|
402
|
+
gumbel = {"before": _safe_detect(gumbel_detector, text)}
|
|
403
|
+
if not gumbel["before"]["available"]:
|
|
404
|
+
eprint(f"gumbel verification unavailable: {gumbel['before']['error']}")
|
|
405
|
+
info["gumbel"] = gumbel
|
|
406
|
+
|
|
407
|
+
if backend == "print-prompt":
|
|
408
|
+
info["mode"] = "print-prompt"
|
|
409
|
+
if candidates > 1:
|
|
410
|
+
eprint("note: --candidates ignored in print-prompt mode")
|
|
411
|
+
return prompt, info
|
|
412
|
+
|
|
413
|
+
if not model:
|
|
414
|
+
raise SystemExit("error: --model required for ollama/openai-compatible backends")
|
|
415
|
+
if not base_url:
|
|
416
|
+
raise SystemExit("error: --base-url required for ollama/openai-compatible backends")
|
|
417
|
+
|
|
418
|
+
_check_remote(base_url, allow_remote)
|
|
419
|
+
|
|
420
|
+
n_cands = max(1, candidates)
|
|
421
|
+
n_loops = max(1, max_loops)
|
|
422
|
+
info["candidates"] = n_cands
|
|
423
|
+
info["max_loops"] = n_loops
|
|
424
|
+
evaluator_name, evaluator = _pick_evaluator(markllm_detector, gumbel_detector)
|
|
425
|
+
info["evaluator"] = evaluator_name
|
|
426
|
+
|
|
427
|
+
# Iterative rewrite: each loop generates --candidates variants and
|
|
428
|
+
# evaluates them, stopping as soon as one passes; --max-loops caps how
|
|
429
|
+
# many evaluation rounds run before the best-effort variant is returned.
|
|
430
|
+
# When no detector is configured the evaluator is lexical divergence,
|
|
431
|
+
# which has no pass/fail verdict, so every attempt is generated and the
|
|
432
|
+
# most diverged one is selected (the original --candidates behavior).
|
|
433
|
+
attempts: list[tuple[str, dict]] = []
|
|
434
|
+
passed: bool | None = None
|
|
435
|
+
for loop in range(n_loops):
|
|
436
|
+
for _ in range(n_cands):
|
|
437
|
+
cand = _generate_once(
|
|
438
|
+
backend, base_url, model, api_key, prompt, timeout, temperature, reasoning_effort
|
|
439
|
+
)
|
|
440
|
+
cand_stats: dict | None = None
|
|
441
|
+
if layer_a_after:
|
|
442
|
+
cand, cand_stats = clean_text(cand)
|
|
443
|
+
divergence = _lexical_divergence(text, cand)
|
|
444
|
+
if evaluator is None:
|
|
445
|
+
evaluation: dict = {
|
|
446
|
+
"evaluator": "lexical-divergence",
|
|
447
|
+
"score": round(divergence, 4),
|
|
448
|
+
}
|
|
449
|
+
else:
|
|
450
|
+
evaluation = _safe_detect(evaluator, cand)
|
|
451
|
+
verdict = evaluation.get("is_watermarked")
|
|
452
|
+
passed_i: bool | None = (
|
|
453
|
+
True if verdict is False else (False if verdict is True else None)
|
|
454
|
+
)
|
|
455
|
+
attempts.append(
|
|
456
|
+
(
|
|
457
|
+
cand,
|
|
458
|
+
{
|
|
459
|
+
"loop": loop,
|
|
460
|
+
"lexical_divergence": round(divergence, 4),
|
|
461
|
+
"selection_score": round(divergence, 4),
|
|
462
|
+
"selected": False,
|
|
463
|
+
"passed": passed_i,
|
|
464
|
+
"evaluation": evaluation,
|
|
465
|
+
"layer_a_after": cand_stats,
|
|
466
|
+
},
|
|
467
|
+
)
|
|
468
|
+
)
|
|
469
|
+
if passed_i is True:
|
|
470
|
+
passed = True
|
|
471
|
+
break
|
|
472
|
+
if passed is True:
|
|
473
|
+
break
|
|
474
|
+
|
|
475
|
+
if evaluator is not None and passed is None:
|
|
476
|
+
passed = False
|
|
477
|
+
info["attempts_made"] = len(attempts)
|
|
478
|
+
info["passed"] = passed
|
|
479
|
+
|
|
480
|
+
# Best-effort selection when no attempt passed: the lowest watermark score
|
|
481
|
+
# (detector evaluator) or the most lexically diverged variant (fallback).
|
|
482
|
+
selected_idx: int
|
|
483
|
+
best_score: float | None = None
|
|
484
|
+
best_score_idx: int | None = None
|
|
485
|
+
best_div = -1.0
|
|
486
|
+
best_div_idx = 0
|
|
487
|
+
for i, (_cand, rec) in enumerate(attempts):
|
|
488
|
+
if rec["lexical_divergence"] > best_div:
|
|
489
|
+
best_div = rec["lexical_divergence"]
|
|
490
|
+
best_div_idx = i
|
|
491
|
+
if evaluator is not None:
|
|
492
|
+
s = rec["evaluation"].get("score")
|
|
493
|
+
if isinstance(s, (int, float)) and (best_score is None or s < best_score):
|
|
494
|
+
best_score = float(s)
|
|
495
|
+
best_score_idx = i
|
|
496
|
+
if passed is True:
|
|
497
|
+
selected_idx = len(attempts) - 1 # the passing attempt is the last one
|
|
498
|
+
elif best_score_idx is not None:
|
|
499
|
+
selected_idx = best_score_idx
|
|
500
|
+
else:
|
|
501
|
+
selected_idx = best_div_idx
|
|
502
|
+
|
|
503
|
+
out, rec = attempts[selected_idx]
|
|
504
|
+
rec["selected"] = True
|
|
505
|
+
info["candidate_scores"] = [r for _c, r in attempts]
|
|
506
|
+
if layer_a_after:
|
|
507
|
+
info["layer_a_after"] = rec["layer_a_after"]
|
|
508
|
+
info["output_chars"] = len(out)
|
|
509
|
+
info["mode"] = "rewritten"
|
|
510
|
+
note = (
|
|
511
|
+
"Layer B is best-effort against statistical token-sampling watermarks; "
|
|
512
|
+
"cannot certify removal against a vendor detector."
|
|
513
|
+
)
|
|
514
|
+
if evaluator is not None and passed is not True:
|
|
515
|
+
note += (
|
|
516
|
+
f" Exhausted {len(attempts)} attempt(s) without passing "
|
|
517
|
+
f"{evaluator_name} evaluation; returned the best-effort variant."
|
|
518
|
+
)
|
|
519
|
+
info["note"] = note
|
|
520
|
+
|
|
521
|
+
if markllm:
|
|
522
|
+
assert markllm_detector is not None # set together with markllm above
|
|
523
|
+
if evaluator_name == "markllm":
|
|
524
|
+
# The loop already scored the selected attempt; reuse the verdict
|
|
525
|
+
# instead of paying another MarkLLM detection.
|
|
526
|
+
after = rec["evaluation"]
|
|
527
|
+
else:
|
|
528
|
+
after = _safe_detect(markllm_detector, out)
|
|
529
|
+
markllm["after"] = after
|
|
530
|
+
before = markllm["before"]
|
|
531
|
+
if before.get("available") and after.get("available"):
|
|
532
|
+
markllm["cleared"] = bool(
|
|
533
|
+
before.get("is_watermarked") and not after.get("is_watermarked")
|
|
534
|
+
)
|
|
535
|
+
else:
|
|
536
|
+
markllm["cleared"] = None
|
|
537
|
+
markllm["note"] = (
|
|
538
|
+
"MarkLLM detection is only valid against the SAME scheme config + "
|
|
539
|
+
"keys used at generation; it does not certify a vendor detector."
|
|
540
|
+
)
|
|
541
|
+
|
|
542
|
+
if gumbel:
|
|
543
|
+
assert gumbel_detector is not None # set together with gumbel above
|
|
544
|
+
if evaluator_name == "gumbel":
|
|
545
|
+
# The loop already scored the selected attempt; reuse the verdict
|
|
546
|
+
# instead of paying another replay.
|
|
547
|
+
after = rec["evaluation"]
|
|
548
|
+
else:
|
|
549
|
+
after = _safe_detect(gumbel_detector, out)
|
|
550
|
+
gumbel["after"] = after
|
|
551
|
+
before = gumbel["before"]
|
|
552
|
+
if before.get("available") and after.get("available"):
|
|
553
|
+
gumbel["cleared"] = bool(
|
|
554
|
+
before.get("is_watermarked") and not after.get("is_watermarked")
|
|
555
|
+
)
|
|
556
|
+
else:
|
|
557
|
+
gumbel["cleared"] = None
|
|
558
|
+
gumbel["note"] = (
|
|
559
|
+
"Keyed-Gumbel detection is a same-key replay: valid only with the "
|
|
560
|
+
"same key, tokenizer, and PRF layout used at generation; it does "
|
|
561
|
+
"not certify a vendor detector."
|
|
562
|
+
)
|
|
563
|
+
|
|
564
|
+
eprint(
|
|
565
|
+
f"note: evaluator={evaluator_name} attempts={len(attempts)}/"
|
|
566
|
+
f"{n_cands * n_loops} loops={n_loops} passed={passed}"
|
|
567
|
+
)
|
|
568
|
+
return out, info
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
572
|
+
p = argparse.ArgumentParser(description=__doc__)
|
|
573
|
+
p.add_argument("path", nargs="?", default="-", help="Input text file, or - for stdin")
|
|
574
|
+
p.add_argument("-o", "--output", help="Output path (default: stdout or *.rewritten.*)")
|
|
575
|
+
p.add_argument(
|
|
576
|
+
"--backend",
|
|
577
|
+
choices=("print-prompt", "ollama", "openai-compatible"),
|
|
578
|
+
default=_env("WATERMARKS_REWRITE_BACKEND", "print-prompt"),
|
|
579
|
+
)
|
|
580
|
+
p.add_argument("--model", default=_env("WATERMARKS_REWRITE_MODEL"))
|
|
581
|
+
p.add_argument(
|
|
582
|
+
"--base-url",
|
|
583
|
+
default=_env("WATERMARKS_REWRITE_BASE_URL", "http://127.0.0.1:11434"),
|
|
584
|
+
)
|
|
585
|
+
p.add_argument(
|
|
586
|
+
"--allow-remote",
|
|
587
|
+
action="store_true",
|
|
588
|
+
default=None,
|
|
589
|
+
help="Allow non-loopback rewrite endpoints (default: deny; "
|
|
590
|
+
"WATERMARKS_REWRITE_ALLOW_REMOTE=1 has the same effect)",
|
|
591
|
+
)
|
|
592
|
+
p.add_argument(
|
|
593
|
+
"--reasoning-effort",
|
|
594
|
+
choices=("none", "low", "medium", "high", "off"),
|
|
595
|
+
default=_env("WATERMARKS_REWRITE_REASONING_EFFORT", "none"),
|
|
596
|
+
help="OpenAI-compatible reasoning_effort; 'none' skips chain-of-thought "
|
|
597
|
+
"(reasoning models like deepseek-v4-flash otherwise burn minutes on a "
|
|
598
|
+
"rewrite). 'off' omits the parameter entirely.",
|
|
599
|
+
)
|
|
600
|
+
# NOTE: no --api-key flag on purpose — keys on argv are visible in `ps`
|
|
601
|
+
# and shell history. Set WATERMARKS_REWRITE_API_KEY instead.
|
|
602
|
+
p.add_argument(
|
|
603
|
+
"--strength",
|
|
604
|
+
choices=("paraphrase", "backtranslate", "structural", "humanize", "code"),
|
|
605
|
+
default="paraphrase",
|
|
606
|
+
)
|
|
607
|
+
p.add_argument("--lang", default="French", help="Pivot language for backtranslate")
|
|
608
|
+
p.add_argument("--original-lang", default="English")
|
|
609
|
+
p.add_argument("--timeout", type=float, default=120.0)
|
|
610
|
+
p.add_argument(
|
|
611
|
+
"--temperature",
|
|
612
|
+
type=float,
|
|
613
|
+
default=0.9,
|
|
614
|
+
help="Sampling temperature for the rewrite backend",
|
|
615
|
+
)
|
|
616
|
+
p.add_argument(
|
|
617
|
+
"--candidates",
|
|
618
|
+
type=int,
|
|
619
|
+
default=_env_int("WATERMARKS_REWRITE_CANDIDATES", DEFAULT_CANDIDATES),
|
|
620
|
+
help="Variants generated per loop iteration; each variant is one "
|
|
621
|
+
"rewrite + one evaluation, and the loop stops as soon as an attempt "
|
|
622
|
+
f"passes (default: {DEFAULT_CANDIDATES}; WATERMARKS_REWRITE_CANDIDATES)",
|
|
623
|
+
)
|
|
624
|
+
p.add_argument(
|
|
625
|
+
"--max-loops",
|
|
626
|
+
type=int,
|
|
627
|
+
default=_env_int("WATERMARKS_REWRITE_LOOPS", DEFAULT_MAX_LOOPS),
|
|
628
|
+
help="Max evaluation rounds; each round generates --candidates "
|
|
629
|
+
"variants and stops when one passes. Raising this retries new "
|
|
630
|
+
f"variants until an evaluation passes (default: {DEFAULT_MAX_LOOPS}; "
|
|
631
|
+
"WATERMARKS_REWRITE_LOOPS)",
|
|
632
|
+
)
|
|
633
|
+
p.add_argument(
|
|
634
|
+
"--no-layer-a-after",
|
|
635
|
+
action="store_true",
|
|
636
|
+
help="Skip Layer A scrub on model output",
|
|
637
|
+
)
|
|
638
|
+
p.add_argument("--json-stats", action="store_true", help="Stats JSON on stderr")
|
|
639
|
+
p.add_argument(
|
|
640
|
+
"--markllm-scheme",
|
|
641
|
+
# Keep in sync with detect_text_watermark.SCHEMES.
|
|
642
|
+
choices=("kgw", "synthid", "synthid-text", "exp", "unigram", "sir"),
|
|
643
|
+
default=None,
|
|
644
|
+
help="Run MarkLLM before/after detection around the rewrite AND drive "
|
|
645
|
+
"the iterative rewrite loop with it (the evaluator, when configured; "
|
|
646
|
+
"otherwise lexical divergence selects the best variant). "
|
|
647
|
+
"Scheme = any key of detect_text_watermark.SCHEMES.",
|
|
648
|
+
)
|
|
649
|
+
p.add_argument(
|
|
650
|
+
"--markllm-dir",
|
|
651
|
+
default=_env("MARKLLM_DIR"),
|
|
652
|
+
help="MarkLLM checkout root (default: $MARKLLM_DIR)",
|
|
653
|
+
)
|
|
654
|
+
p.add_argument(
|
|
655
|
+
"--markllm-model",
|
|
656
|
+
default=_env("MARKLLM_MODEL", DEFAULT_MARKLLM_MODEL),
|
|
657
|
+
help=f"Scoring model for MarkLLM detection (default: $MARKLLM_MODEL or {DEFAULT_MARKLLM_MODEL})",
|
|
658
|
+
)
|
|
659
|
+
p.add_argument(
|
|
660
|
+
"--markllm-timeout",
|
|
661
|
+
type=float,
|
|
662
|
+
default=float(_env("WATERMARKS_MARKLLM_TIMEOUT", "180.0")),
|
|
663
|
+
help="Timeout per MarkLLM detection call (default: 180.0)",
|
|
664
|
+
)
|
|
665
|
+
p.add_argument(
|
|
666
|
+
"--gumbel-key",
|
|
667
|
+
default=_env("WATERMARKS_GUMBEL_KEY"),
|
|
668
|
+
help="Secret key for keyed-Gumbel (Aaronson EXP) same-key replay "
|
|
669
|
+
"detection; drives the iterative rewrite loop as the evaluator when "
|
|
670
|
+
"set (default: $WATERMARKS_GUMBEL_KEY). Preferred via env — keys on "
|
|
671
|
+
"argv are visible in ps/history; never logged.",
|
|
672
|
+
)
|
|
673
|
+
p.add_argument(
|
|
674
|
+
"--force-text",
|
|
675
|
+
action="store_true",
|
|
676
|
+
help="Rewrite even when the input looks like a binary container",
|
|
677
|
+
)
|
|
678
|
+
return p
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
def main() -> int:
|
|
682
|
+
args = build_parser().parse_args()
|
|
683
|
+
|
|
684
|
+
text = read_text_input(args.path, allow_binary=args.force_text)
|
|
685
|
+
allow_remote = (
|
|
686
|
+
args.allow_remote
|
|
687
|
+
if args.allow_remote is not None
|
|
688
|
+
else _flag_env("WATERMARKS_REWRITE_ALLOW_REMOTE")
|
|
689
|
+
)
|
|
690
|
+
try:
|
|
691
|
+
result, info = rewrite(
|
|
692
|
+
text,
|
|
693
|
+
backend=args.backend,
|
|
694
|
+
model=args.model,
|
|
695
|
+
base_url=args.base_url,
|
|
696
|
+
api_key=_env("WATERMARKS_REWRITE_API_KEY"),
|
|
697
|
+
strength=args.strength,
|
|
698
|
+
lang=args.lang,
|
|
699
|
+
original_lang=args.original_lang,
|
|
700
|
+
timeout=args.timeout,
|
|
701
|
+
layer_a_after=not args.no_layer_a_after,
|
|
702
|
+
temperature=args.temperature,
|
|
703
|
+
candidates=args.candidates,
|
|
704
|
+
max_loops=args.max_loops,
|
|
705
|
+
allow_remote=allow_remote,
|
|
706
|
+
reasoning_effort=(None if args.reasoning_effort == "off" else args.reasoning_effort),
|
|
707
|
+
markllm_scheme=args.markllm_scheme,
|
|
708
|
+
markllm_dir=args.markllm_dir,
|
|
709
|
+
markllm_model=args.markllm_model,
|
|
710
|
+
markllm_timeout=args.markllm_timeout,
|
|
711
|
+
gumbel_key=args.gumbel_key,
|
|
712
|
+
)
|
|
713
|
+
except (urllib.error.URLError, TimeoutError, RuntimeError) as e:
|
|
714
|
+
eprint(f"rewrite failed: {e}")
|
|
715
|
+
return 1
|
|
716
|
+
|
|
717
|
+
out = args.output
|
|
718
|
+
if out is None and args.path not in (None, "-") and args.backend != "print-prompt":
|
|
719
|
+
out = str(cleaned_path(Path(args.path), suffix=".rewritten"))
|
|
720
|
+
elif out is None and args.backend == "print-prompt":
|
|
721
|
+
out = "-"
|
|
722
|
+
|
|
723
|
+
write_text_output(result, out)
|
|
724
|
+
if args.json_stats:
|
|
725
|
+
eprint(json.dumps(info, indent=2, ensure_ascii=False))
|
|
726
|
+
else:
|
|
727
|
+
eprint(
|
|
728
|
+
f"backend={info['backend']} strength={info['strength']} "
|
|
729
|
+
f"mode={info.get('mode')} evaluator={info.get('evaluator', '-')} "
|
|
730
|
+
f"attempts={info.get('attempts_made', '-')} passed={info.get('passed', '-')} "
|
|
731
|
+
f"chars {info['input_chars']}->{info.get('output_chars', len(result))}"
|
|
732
|
+
)
|
|
733
|
+
return 0
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
if __name__ == "__main__":
|
|
737
|
+
raise SystemExit(main())
|