theus-cli-linux-x64 1.2.1 → 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/README.md +15 -0
- package/RELEASE.json +6 -6
- package/bin/theus +0 -0
- package/package.json +1 -1
- package/vendor/chrome-extension/README.md +142 -0
- package/vendor/chrome-extension/background.js +540 -0
- package/vendor/chrome-extension/cdp-core.js +400 -0
- package/vendor/chrome-extension/cdp-core.test.ts +321 -0
- package/vendor/chrome-extension/cdp.js +672 -0
- package/vendor/chrome-extension/icons/icon128.png +0 -0
- package/vendor/chrome-extension/icons/icon16.png +0 -0
- package/vendor/chrome-extension/icons/icon32.png +0 -0
- package/vendor/chrome-extension/icons/icon48.png +0 -0
- package/vendor/chrome-extension/manifest.json +36 -0
- package/vendor/chrome-extension/popup.html +78 -0
- package/vendor/chrome-extension/popup.js +47 -0
- package/vendor/chrome-extension/recorder.js +316 -0
- 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,613 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Optional MarkLLM text-watermark harness backed by an external THU-BPM/MarkLLM checkout.
|
|
3
|
+
|
|
4
|
+
This script does NOT vendor upstream code. It imports ``AutoWatermark`` from a
|
|
5
|
+
user-provided checkout (https://github.com/THU-BPM/MarkLLM) at runtime, using
|
|
6
|
+
that environment's optional dependencies (torch, transformers, datasets, ...).
|
|
7
|
+
|
|
8
|
+
MarkLLM is Apache-2.0. It is an independent verification harness: detection is
|
|
9
|
+
only valid against the SAME scheme config + keys used at generation. It cannot
|
|
10
|
+
certify that a vendor detector will fail on the given text.
|
|
11
|
+
|
|
12
|
+
Subcommands:
|
|
13
|
+
detect run detection on a text file with a known scheme/config
|
|
14
|
+
watermark generate watermarked (and optionally unwatermarked) sample text
|
|
15
|
+
from a prompt, for controlled before/after experiments
|
|
16
|
+
|
|
17
|
+
Exit codes:
|
|
18
|
+
0 success
|
|
19
|
+
1 runtime error (model load, detection/generation failure)
|
|
20
|
+
2 bad input (missing/unreadable file, binary input, bad args)
|
|
21
|
+
3 unavailable (not configured / missing checkout / missing deps)
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
import argparse
|
|
27
|
+
import json
|
|
28
|
+
import os
|
|
29
|
+
import socket
|
|
30
|
+
import socketserver
|
|
31
|
+
import sys
|
|
32
|
+
import threading
|
|
33
|
+
from pathlib import Path
|
|
34
|
+
from typing import Any
|
|
35
|
+
|
|
36
|
+
SCRIPTS_DIR = Path(__file__).resolve().parent
|
|
37
|
+
sys.path.insert(0, str(SCRIPTS_DIR))
|
|
38
|
+
|
|
39
|
+
from common import emit_json, eprint, read_text_input, safe_write_text # noqa: E402
|
|
40
|
+
|
|
41
|
+
# Scheme name as the user types it -> MarkLLM algorithm name (config/{ALG}.json).
|
|
42
|
+
# All schemes ship configs in the MarkLLM checkout; SIR additionally needs
|
|
43
|
+
# its transform/embedding models downloaded per the MarkLLM README.
|
|
44
|
+
SCHEMES = {
|
|
45
|
+
"kgw": "KGW",
|
|
46
|
+
"synthid": "SynthID",
|
|
47
|
+
"synthid-text": "SynthID",
|
|
48
|
+
"exp": "EXP",
|
|
49
|
+
"unigram": "Unigram",
|
|
50
|
+
"sir": "SIR",
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
DEFAULT_MODEL = "facebook/opt-1.3b"
|
|
54
|
+
|
|
55
|
+
# Algorithm configs are ~200 B (KGW/SynthID). Cap well above that so a crafted
|
|
56
|
+
# or accidental huge file is refused before either this script or upstream
|
|
57
|
+
# reads it into memory.
|
|
58
|
+
MAX_CONFIG_BYTES = 1 << 20
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class _Unavailable(RuntimeError):
|
|
62
|
+
"""Backend present but unusable (unconfigured checkout, missing deps)."""
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def resolve_upstream(raw: str | None) -> Path | None:
|
|
66
|
+
if not raw:
|
|
67
|
+
return None
|
|
68
|
+
upstream = Path(raw).expanduser().resolve()
|
|
69
|
+
if not upstream.is_dir():
|
|
70
|
+
return None
|
|
71
|
+
return upstream
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def resolve_device(raw: str | None) -> str:
|
|
75
|
+
"""Resolve the ``auto`` device hint to a concrete torch device."""
|
|
76
|
+
if raw and raw != "auto":
|
|
77
|
+
return raw
|
|
78
|
+
try:
|
|
79
|
+
import torch
|
|
80
|
+
|
|
81
|
+
if torch.cuda.is_available():
|
|
82
|
+
return "cuda"
|
|
83
|
+
# Never auto-select mps: SynthID/KGW build torch.Generator(device=...),
|
|
84
|
+
# which supports only cpu/cuda and raises RuntimeError on 'mps' (Apple
|
|
85
|
+
# Silicon). Fall through to cpu. Pass --device mps explicitly to override.
|
|
86
|
+
except Exception: # noqa: S110 - optional torch device detection
|
|
87
|
+
pass
|
|
88
|
+
return "cpu"
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _load_algorithm(
|
|
92
|
+
upstream: Path,
|
|
93
|
+
alg: str,
|
|
94
|
+
config: Path,
|
|
95
|
+
model: str,
|
|
96
|
+
device: str,
|
|
97
|
+
offline: bool = False,
|
|
98
|
+
temperature: float | None = None,
|
|
99
|
+
top_p: float | None = None,
|
|
100
|
+
):
|
|
101
|
+
"""Import the checkout and build an ``AutoWatermark`` instance.
|
|
102
|
+
|
|
103
|
+
``temperature``/``top_p`` (when not None) are folded into the generation
|
|
104
|
+
kwargs so callers can control sampling.
|
|
105
|
+
"""
|
|
106
|
+
gen_kwargs_extra: dict[str, float] = {}
|
|
107
|
+
if temperature is not None:
|
|
108
|
+
gen_kwargs_extra["temperature"] = temperature
|
|
109
|
+
if top_p is not None:
|
|
110
|
+
gen_kwargs_extra["top_p"] = top_p
|
|
111
|
+
sys.path.insert(0, str(upstream))
|
|
112
|
+
try:
|
|
113
|
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
114
|
+
from utils.transformers_config import TransformersConfig
|
|
115
|
+
from watermark.auto_watermark import AutoWatermark
|
|
116
|
+
except ImportError as e:
|
|
117
|
+
raise _Unavailable(f"MarkLLM dependencies missing: {e}") from e
|
|
118
|
+
|
|
119
|
+
# --offline: never contact the HF hub. local_files_only makes transformers
|
|
120
|
+
# fail fast instead of hanging, and HF_HUB_OFFLINE covers the lower-level
|
|
121
|
+
# hub calls. Custom-code execution is not possible either way: transformers
|
|
122
|
+
# only honors auto_map/trust_remote_code when explicitly enabled, which is
|
|
123
|
+
# never done here.
|
|
124
|
+
if offline:
|
|
125
|
+
os.environ.setdefault("HF_HUB_OFFLINE", "1")
|
|
126
|
+
load_kwargs = {"local_files_only": True} if offline else {}
|
|
127
|
+
|
|
128
|
+
tokenizer = AutoTokenizer.from_pretrained(model, **load_kwargs)
|
|
129
|
+
lm = AutoModelForCausalLM.from_pretrained(model, **load_kwargs).to(device)
|
|
130
|
+
transformers_config = TransformersConfig(
|
|
131
|
+
model=lm,
|
|
132
|
+
tokenizer=tokenizer,
|
|
133
|
+
device=device,
|
|
134
|
+
max_new_tokens=200,
|
|
135
|
+
min_length=0,
|
|
136
|
+
do_sample=True,
|
|
137
|
+
no_repeat_ngram_size=4,
|
|
138
|
+
**gen_kwargs_extra,
|
|
139
|
+
)
|
|
140
|
+
return AutoWatermark.load(
|
|
141
|
+
alg,
|
|
142
|
+
algorithm_config=str(config),
|
|
143
|
+
transformers_config=transformers_config,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def _threshold_from_config(config: Path) -> float | None:
|
|
148
|
+
try:
|
|
149
|
+
data = json.loads(config.read_text("utf-8"))
|
|
150
|
+
except (OSError, ValueError):
|
|
151
|
+
return None
|
|
152
|
+
for key in ("threshold", "z_threshold"):
|
|
153
|
+
value = data.get(key)
|
|
154
|
+
if isinstance(value, (int, float)):
|
|
155
|
+
return float(value)
|
|
156
|
+
return None
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _resolve_config(upstream: Path, alg: str, config: str | None) -> Path:
|
|
160
|
+
path = Path(config).expanduser().resolve() if config else upstream / "config" / f"{alg}.json"
|
|
161
|
+
if not path.is_file():
|
|
162
|
+
raise _Unavailable(f"MarkLLM config not found: {path}")
|
|
163
|
+
try:
|
|
164
|
+
size = path.stat().st_size
|
|
165
|
+
except OSError as e:
|
|
166
|
+
raise _Unavailable(f"cannot stat MarkLLM config {path}: {e}") from e
|
|
167
|
+
if size > MAX_CONFIG_BYTES:
|
|
168
|
+
raise _Unavailable(f"MarkLLM config too large ({size} bytes > {MAX_CONFIG_BYTES}): {path}")
|
|
169
|
+
return path
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def _generate(
|
|
173
|
+
wm: Any,
|
|
174
|
+
prompt: str,
|
|
175
|
+
seed: int | None,
|
|
176
|
+
max_new_tokens: int,
|
|
177
|
+
min_length: int = 0,
|
|
178
|
+
need_unwatermarked: bool = True,
|
|
179
|
+
) -> tuple[str, str | None]:
|
|
180
|
+
"""Generate watermarked (and optionally unwatermarked) text for *prompt*."""
|
|
181
|
+
if seed is not None:
|
|
182
|
+
import torch
|
|
183
|
+
|
|
184
|
+
torch.manual_seed(seed)
|
|
185
|
+
wm.config.gen_kwargs["max_new_tokens"] = max_new_tokens
|
|
186
|
+
wm.config.gen_kwargs["min_length"] = min_length
|
|
187
|
+
watermarked = wm.generate_watermarked_text(prompt)
|
|
188
|
+
unwatermarked = wm.generate_unwatermarked_text(prompt) if need_unwatermarked else None
|
|
189
|
+
return watermarked, unwatermarked
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def _detect_payload(wm: Any, text: str, threshold: float | None) -> dict[str, Any]:
|
|
193
|
+
"""Same-config detection payload (is_watermarked/score/threshold)."""
|
|
194
|
+
result = wm.detect_watermark(text, return_dict=True)
|
|
195
|
+
is_watermarked = bool(result.get("is_watermarked", False))
|
|
196
|
+
score = result.get("score")
|
|
197
|
+
try:
|
|
198
|
+
score = float(score)
|
|
199
|
+
except (TypeError, ValueError):
|
|
200
|
+
score = None
|
|
201
|
+
return {
|
|
202
|
+
"is_watermarked": is_watermarked,
|
|
203
|
+
"score": score,
|
|
204
|
+
"threshold": threshold,
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def _cmd_detect(args: argparse.Namespace, upstream: Path, alg: str) -> int:
|
|
209
|
+
if args.path != "-" and not Path(args.path).is_file():
|
|
210
|
+
eprint(f"not a file: {args.path}")
|
|
211
|
+
return 2
|
|
212
|
+
text = read_text_input(args.path, allow_binary=args.force_text)
|
|
213
|
+
|
|
214
|
+
device = resolve_device(args.device)
|
|
215
|
+
|
|
216
|
+
try:
|
|
217
|
+
config = _resolve_config(upstream, alg, args.config)
|
|
218
|
+
threshold = _threshold_from_config(config)
|
|
219
|
+
wm = _load_algorithm(
|
|
220
|
+
upstream,
|
|
221
|
+
alg,
|
|
222
|
+
config,
|
|
223
|
+
args.model,
|
|
224
|
+
device,
|
|
225
|
+
offline=args.offline,
|
|
226
|
+
temperature=args.temperature,
|
|
227
|
+
top_p=args.top_p,
|
|
228
|
+
)
|
|
229
|
+
det = _detect_payload(wm, text, threshold)
|
|
230
|
+
except _Unavailable as e:
|
|
231
|
+
eprint(str(e))
|
|
232
|
+
return 3
|
|
233
|
+
except Exception as e:
|
|
234
|
+
eprint(f"detection error: {e}")
|
|
235
|
+
return 1
|
|
236
|
+
|
|
237
|
+
is_watermarked = det["is_watermarked"]
|
|
238
|
+
score = det["score"]
|
|
239
|
+
|
|
240
|
+
payload = {
|
|
241
|
+
"available": True,
|
|
242
|
+
"upstream_dir": str(upstream),
|
|
243
|
+
"scheme": alg,
|
|
244
|
+
"config": str(config),
|
|
245
|
+
"model": args.model,
|
|
246
|
+
"device": device,
|
|
247
|
+
"is_watermarked": is_watermarked,
|
|
248
|
+
"score": score,
|
|
249
|
+
"threshold": threshold,
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if args.json:
|
|
253
|
+
emit_json(payload)
|
|
254
|
+
else:
|
|
255
|
+
label = "watermarked" if is_watermarked else "not watermarked"
|
|
256
|
+
score_txt = f"{score:.4f}" if score is not None else "n/a"
|
|
257
|
+
thresh_txt = f"{threshold:.4f}" if threshold is not None else "n/a"
|
|
258
|
+
print(f"{alg}: {label} (score {score_txt}, threshold {thresh_txt})")
|
|
259
|
+
|
|
260
|
+
return 0
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def _cmd_watermark(args: argparse.Namespace, upstream: Path, alg: str) -> int:
|
|
264
|
+
prompt = read_text_input(args.prompt, allow_binary=args.force_text)
|
|
265
|
+
|
|
266
|
+
device = resolve_device(args.device)
|
|
267
|
+
|
|
268
|
+
try:
|
|
269
|
+
config = _resolve_config(upstream, alg, args.config)
|
|
270
|
+
wm = _load_algorithm(
|
|
271
|
+
upstream,
|
|
272
|
+
alg,
|
|
273
|
+
config,
|
|
274
|
+
args.model,
|
|
275
|
+
device,
|
|
276
|
+
offline=args.offline,
|
|
277
|
+
temperature=args.temperature,
|
|
278
|
+
top_p=args.top_p,
|
|
279
|
+
)
|
|
280
|
+
watermarked, unwatermarked = _generate(
|
|
281
|
+
wm,
|
|
282
|
+
prompt,
|
|
283
|
+
args.seed,
|
|
284
|
+
args.max_new_tokens,
|
|
285
|
+
args.min_length,
|
|
286
|
+
need_unwatermarked=bool(args.unwatermarked_output),
|
|
287
|
+
)
|
|
288
|
+
except _Unavailable as e:
|
|
289
|
+
eprint(str(e))
|
|
290
|
+
return 3
|
|
291
|
+
except Exception as e:
|
|
292
|
+
eprint(f"generation error: {e}")
|
|
293
|
+
return 1
|
|
294
|
+
|
|
295
|
+
wm_out = "-" if args.watermarked_output is None else args.watermarked_output
|
|
296
|
+
safe_write_text(wm_out, watermarked)
|
|
297
|
+
if unwatermarked is not None:
|
|
298
|
+
safe_write_text(args.unwatermarked_output, unwatermarked)
|
|
299
|
+
|
|
300
|
+
payload = {
|
|
301
|
+
"available": True,
|
|
302
|
+
"upstream_dir": str(upstream),
|
|
303
|
+
"scheme": alg,
|
|
304
|
+
"config": str(config),
|
|
305
|
+
"model": args.model,
|
|
306
|
+
"device": device,
|
|
307
|
+
"temperature": args.temperature,
|
|
308
|
+
"top_p": args.top_p,
|
|
309
|
+
"watermarked_output": wm_out,
|
|
310
|
+
"unwatermarked_output": args.unwatermarked_output,
|
|
311
|
+
"watermarked_chars": len(watermarked),
|
|
312
|
+
"unwatermarked_chars": len(unwatermarked) if unwatermarked is not None else None,
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if args.json:
|
|
316
|
+
emit_json(payload)
|
|
317
|
+
else:
|
|
318
|
+
print(f"{alg}: watermarked sample ({payload['watermarked_chars']} chars) -> {wm_out}")
|
|
319
|
+
if unwatermarked is not None:
|
|
320
|
+
print(
|
|
321
|
+
f" unwatermarked sample ({payload['unwatermarked_chars']} chars) -> {args.unwatermarked_output}"
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
def _handle_serve_request(wm: Any, req: dict[str, Any], threshold: float | None) -> dict[str, Any]:
|
|
326
|
+
"""Handle one JSON-lines request; never raises (responds with ok:false)."""
|
|
327
|
+
rid = req.get("id")
|
|
328
|
+
op = req.get("op")
|
|
329
|
+
if op == "exit":
|
|
330
|
+
return {"ok": True, "id": rid}
|
|
331
|
+
try:
|
|
332
|
+
if op == "watermark":
|
|
333
|
+
prompt = req.get("prompt")
|
|
334
|
+
if not isinstance(prompt, str) or not prompt:
|
|
335
|
+
raise ValueError("'prompt' must be a non-empty string")
|
|
336
|
+
# Per-request generation knobs.
|
|
337
|
+
for key in ("temperature", "top_p"):
|
|
338
|
+
value = req.get(key)
|
|
339
|
+
if isinstance(value, (int, float)):
|
|
340
|
+
wm.config.gen_kwargs[key] = float(value)
|
|
341
|
+
watermarked, unwatermarked = _generate(
|
|
342
|
+
wm,
|
|
343
|
+
prompt,
|
|
344
|
+
req.get("seed"),
|
|
345
|
+
req.get("max_new_tokens", 200),
|
|
346
|
+
req.get("min_length", 0),
|
|
347
|
+
need_unwatermarked=True,
|
|
348
|
+
)
|
|
349
|
+
return {
|
|
350
|
+
"ok": True,
|
|
351
|
+
"id": rid,
|
|
352
|
+
"watermarked": watermarked,
|
|
353
|
+
"unwatermarked": unwatermarked,
|
|
354
|
+
"watermarked_chars": len(watermarked),
|
|
355
|
+
"unwatermarked_chars": len(unwatermarked),
|
|
356
|
+
}
|
|
357
|
+
if op == "detect":
|
|
358
|
+
text = req.get("text")
|
|
359
|
+
if not isinstance(text, str) or not text:
|
|
360
|
+
raise ValueError("'text' must be a non-empty string")
|
|
361
|
+
det = _detect_payload(wm, text, threshold)
|
|
362
|
+
return {"ok": True, "id": rid, **det}
|
|
363
|
+
return {"ok": False, "id": rid, "error": f"unknown op {op!r}"}
|
|
364
|
+
except Exception as e: # a bad request must not kill the worker
|
|
365
|
+
return {"ok": False, "id": rid, "error": str(e)}
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def _cmd_serve(args: argparse.Namespace, upstream: Path, alg: str) -> int:
|
|
369
|
+
"""Serve watermark/detect requests over JSON-lines stdin/stdout.
|
|
370
|
+
|
|
371
|
+
Loads the MarkLLM model once and keeps it resident so callers (e.g. the
|
|
372
|
+
SynthID-text benchmark) can run many operations without paying the
|
|
373
|
+
torch + model load cost per call. Protocol:
|
|
374
|
+
|
|
375
|
+
request: {"op": "watermark", "id": N, "prompt": str, "seed": int|None,
|
|
376
|
+
"max_new_tokens": int, "min_length": int,
|
|
377
|
+
"temperature": float|None, "top_p": float|None}
|
|
378
|
+
{"op": "detect", "id": N, "text": str}
|
|
379
|
+
{"op": "exit", "id": N}
|
|
380
|
+
|
|
381
|
+
Per-request "temperature"/"top_p" override the worker's generation kwargs;
|
|
382
|
+
omitted keys keep the current value.
|
|
383
|
+
response: {"ok": true, "id": N, ...} | {"ok": false, "id": N, "error": str}
|
|
384
|
+
|
|
385
|
+
The first stdout line is a {"ready": true, ...} handshake emitted after
|
|
386
|
+
model load. Errors on one request never kill the worker.
|
|
387
|
+
"""
|
|
388
|
+
device = resolve_device(args.device)
|
|
389
|
+
try:
|
|
390
|
+
config = _resolve_config(upstream, alg, args.config)
|
|
391
|
+
threshold = _threshold_from_config(config)
|
|
392
|
+
wm = _load_algorithm(
|
|
393
|
+
upstream,
|
|
394
|
+
alg,
|
|
395
|
+
config,
|
|
396
|
+
args.model,
|
|
397
|
+
device,
|
|
398
|
+
offline=args.offline,
|
|
399
|
+
temperature=args.temperature,
|
|
400
|
+
top_p=args.top_p,
|
|
401
|
+
)
|
|
402
|
+
except _Unavailable as e:
|
|
403
|
+
eprint(str(e))
|
|
404
|
+
return 3
|
|
405
|
+
except Exception as e:
|
|
406
|
+
eprint(f"serve load error: {e}")
|
|
407
|
+
return 1
|
|
408
|
+
|
|
409
|
+
def respond(payload: dict[str, Any]) -> None:
|
|
410
|
+
print(json.dumps(payload), flush=True)
|
|
411
|
+
|
|
412
|
+
ready: dict[str, Any] = {
|
|
413
|
+
"ready": True,
|
|
414
|
+
"scheme": alg,
|
|
415
|
+
"model": args.model,
|
|
416
|
+
"device": device,
|
|
417
|
+
"temperature": args.temperature,
|
|
418
|
+
"top_p": args.top_p,
|
|
419
|
+
}
|
|
420
|
+
lock = threading.Lock()
|
|
421
|
+
server: socketserver.ThreadingTCPServer | None = None
|
|
422
|
+
if args.port >= 0:
|
|
423
|
+
# Loopback TCP listener so other processes (e.g. the rewrite
|
|
424
|
+
# subprocess's MarkLLM detector) can reuse this resident model
|
|
425
|
+
# instead of cold-starting their own. Port 0 = ephemeral.
|
|
426
|
+
server = _serve_socket_server(wm, threshold, args.port, lock)
|
|
427
|
+
ready["port"] = server.server_address[1]
|
|
428
|
+
respond(ready)
|
|
429
|
+
|
|
430
|
+
try:
|
|
431
|
+
for raw_line in sys.stdin:
|
|
432
|
+
line = raw_line.strip()
|
|
433
|
+
if not line:
|
|
434
|
+
continue
|
|
435
|
+
try:
|
|
436
|
+
req = json.loads(line)
|
|
437
|
+
except json.JSONDecodeError:
|
|
438
|
+
respond({"ok": False, "error": "invalid JSON request"})
|
|
439
|
+
continue
|
|
440
|
+
if not isinstance(req, dict):
|
|
441
|
+
respond({"ok": False, "error": "request must be a JSON object"})
|
|
442
|
+
continue
|
|
443
|
+
with lock:
|
|
444
|
+
resp = _handle_serve_request(wm, req, threshold)
|
|
445
|
+
respond(resp)
|
|
446
|
+
if req.get("op") == "exit":
|
|
447
|
+
return 0
|
|
448
|
+
finally:
|
|
449
|
+
if server is not None:
|
|
450
|
+
server.shutdown()
|
|
451
|
+
server.server_close()
|
|
452
|
+
return 0
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
def _serve_socket_server(
|
|
456
|
+
wm: Any, threshold: float | None, port: int, lock: threading.Lock
|
|
457
|
+
) -> socketserver.ThreadingTCPServer:
|
|
458
|
+
"""A loopback JSON-lines TCP server sharing this process's model."""
|
|
459
|
+
|
|
460
|
+
class _Handler(socketserver.BaseRequestHandler):
|
|
461
|
+
def handle(self) -> None:
|
|
462
|
+
f = self.request.makefile("r", encoding="utf-8")
|
|
463
|
+
for raw in f:
|
|
464
|
+
line = raw.strip()
|
|
465
|
+
if not line:
|
|
466
|
+
continue
|
|
467
|
+
try:
|
|
468
|
+
req = json.loads(line)
|
|
469
|
+
if not isinstance(req, dict):
|
|
470
|
+
raise ValueError("request must be a JSON object")
|
|
471
|
+
except (json.JSONDecodeError, ValueError):
|
|
472
|
+
resp: dict[str, Any] = {"ok": False, "error": "invalid JSON request"}
|
|
473
|
+
else:
|
|
474
|
+
with lock:
|
|
475
|
+
resp = _handle_serve_request(wm, req, threshold)
|
|
476
|
+
try:
|
|
477
|
+
self.request.sendall((json.dumps(resp) + "\n").encode("utf-8"))
|
|
478
|
+
except OSError:
|
|
479
|
+
return
|
|
480
|
+
if isinstance(req, dict) and req.get("op") == "exit":
|
|
481
|
+
return
|
|
482
|
+
|
|
483
|
+
class _Server(socketserver.ThreadingTCPServer):
|
|
484
|
+
allow_reuse_address = True
|
|
485
|
+
daemon_threads = True
|
|
486
|
+
|
|
487
|
+
_Server.address_family = socket.AF_INET
|
|
488
|
+
srv = _Server(("127.0.0.1", port), _Handler)
|
|
489
|
+
threading.Thread(target=srv.serve_forever, daemon=True).start()
|
|
490
|
+
return srv
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
def _add_common(p: argparse.ArgumentParser) -> None:
|
|
494
|
+
p.add_argument(
|
|
495
|
+
"--upstream-dir",
|
|
496
|
+
type=Path,
|
|
497
|
+
default=None,
|
|
498
|
+
help="MarkLLM checkout root (default: $MARKLLM_DIR)",
|
|
499
|
+
)
|
|
500
|
+
p.add_argument(
|
|
501
|
+
"--scheme",
|
|
502
|
+
required=True,
|
|
503
|
+
choices=sorted(SCHEMES),
|
|
504
|
+
help="Watermark scheme to use (kgw, synthid)",
|
|
505
|
+
)
|
|
506
|
+
p.add_argument(
|
|
507
|
+
"--config",
|
|
508
|
+
default=None,
|
|
509
|
+
help="Algorithm config JSON (default: <checkout>/config/<ALG>.json)",
|
|
510
|
+
)
|
|
511
|
+
p.add_argument(
|
|
512
|
+
"--temperature",
|
|
513
|
+
type=float,
|
|
514
|
+
default=None,
|
|
515
|
+
help="Generation temperature (default: unset -> MarkLLM/HF default)",
|
|
516
|
+
)
|
|
517
|
+
p.add_argument(
|
|
518
|
+
"--top-p",
|
|
519
|
+
type=float,
|
|
520
|
+
default=None,
|
|
521
|
+
help="Generation nucleus-sampling top-p (default: unset -> MarkLLM/HF default)",
|
|
522
|
+
)
|
|
523
|
+
p.add_argument(
|
|
524
|
+
"--model",
|
|
525
|
+
default=os.environ.get("MARKLLM_MODEL", DEFAULT_MODEL),
|
|
526
|
+
help=f"HF causal LM for scoring (default: $MARKLLM_MODEL or {DEFAULT_MODEL})",
|
|
527
|
+
)
|
|
528
|
+
p.add_argument(
|
|
529
|
+
"--device",
|
|
530
|
+
default="auto",
|
|
531
|
+
help="auto|cpu|cuda|mps (default: auto)",
|
|
532
|
+
)
|
|
533
|
+
p.add_argument(
|
|
534
|
+
"--offline",
|
|
535
|
+
action="store_true",
|
|
536
|
+
help="Never contact the HF hub: load the scoring model from the local "
|
|
537
|
+
"cache only (fails fast if not cached)",
|
|
538
|
+
)
|
|
539
|
+
p.add_argument(
|
|
540
|
+
"--force-text",
|
|
541
|
+
action="store_true",
|
|
542
|
+
help="Process input even when it looks like a binary container",
|
|
543
|
+
)
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
def main() -> int:
|
|
547
|
+
p = argparse.ArgumentParser(description=__doc__)
|
|
548
|
+
sub = p.add_subparsers(dest="cmd", required=True)
|
|
549
|
+
|
|
550
|
+
detect = sub.add_parser("detect", help="Detect a scheme watermark in text")
|
|
551
|
+
detect.add_argument("path", help="Text file to detect on, or - for stdin")
|
|
552
|
+
_add_common(detect)
|
|
553
|
+
detect.add_argument("--json", action="store_true", help="Emit JSON on stdout")
|
|
554
|
+
detect.set_defaults(handler=_cmd_detect)
|
|
555
|
+
|
|
556
|
+
wm = sub.add_parser("watermark", help="Generate watermarked sample text")
|
|
557
|
+
wm.add_argument("prompt", help="Prompt file, or - for stdin")
|
|
558
|
+
wm.add_argument(
|
|
559
|
+
"-o",
|
|
560
|
+
"--watermarked-output",
|
|
561
|
+
default=None,
|
|
562
|
+
help="Output path for the watermarked sample (default: stdout)",
|
|
563
|
+
)
|
|
564
|
+
wm.add_argument(
|
|
565
|
+
"-o2",
|
|
566
|
+
"--unwatermarked-output",
|
|
567
|
+
default=None,
|
|
568
|
+
help="Also write an unwatermarked sample to this path",
|
|
569
|
+
)
|
|
570
|
+
wm.add_argument("--max-new-tokens", type=int, default=200)
|
|
571
|
+
wm.add_argument("--min-length", type=int, default=0)
|
|
572
|
+
wm.add_argument("--seed", type=int, default=None, help="Optional RNG seed")
|
|
573
|
+
_add_common(wm)
|
|
574
|
+
wm.add_argument("--json", action="store_true", help="Emit JSON on stdout")
|
|
575
|
+
wm.set_defaults(handler=_cmd_watermark)
|
|
576
|
+
|
|
577
|
+
serve = sub.add_parser(
|
|
578
|
+
"serve", help="Serve watermark/detect over JSON-lines stdin (persistent worker)"
|
|
579
|
+
)
|
|
580
|
+
_add_common(serve)
|
|
581
|
+
serve.add_argument(
|
|
582
|
+
"--port",
|
|
583
|
+
type=int,
|
|
584
|
+
default=-1,
|
|
585
|
+
help="Also listen on 127.0.0.1:PORT (JSON-lines; 0 = ephemeral) for "
|
|
586
|
+
"other processes to reuse this resident model (default: no listener)",
|
|
587
|
+
)
|
|
588
|
+
serve.set_defaults(handler=_cmd_serve)
|
|
589
|
+
|
|
590
|
+
args = p.parse_args()
|
|
591
|
+
|
|
592
|
+
if args.cmd == "detect" and args.path != "-" and not Path(args.path).is_file():
|
|
593
|
+
eprint(f"not a file: {args.path}")
|
|
594
|
+
return 2
|
|
595
|
+
|
|
596
|
+
raw_upstream = args.upstream_dir or os.environ.get("MARKLLM_DIR")
|
|
597
|
+
upstream = resolve_upstream(str(raw_upstream) if raw_upstream else None)
|
|
598
|
+
if upstream is None:
|
|
599
|
+
eprint(
|
|
600
|
+
"MarkLLM not configured: set MARKLLM_DIR or pass --upstream-dir",
|
|
601
|
+
)
|
|
602
|
+
return 3
|
|
603
|
+
|
|
604
|
+
if not (upstream / "watermark").is_dir():
|
|
605
|
+
eprint(f"MarkLLM checkout incomplete (no watermark/ dir): {upstream}")
|
|
606
|
+
return 3
|
|
607
|
+
|
|
608
|
+
alg = SCHEMES[args.scheme]
|
|
609
|
+
return args.handler(args, upstream, alg)
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
if __name__ == "__main__":
|
|
613
|
+
raise SystemExit(main())
|