theus-cli-linux-x64 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.
Files changed (759) hide show
  1. package/README.md +50 -11
  2. package/RELEASE.json +6 -6
  3. package/bin/theus +0 -0
  4. package/package.json +1 -1
  5. package/vendor/higiene-motor/PARCHES.md +244 -0
  6. package/vendor/higiene-motor/audit_dir.py +166 -0
  7. package/vendor/higiene-motor/audit_lib.py +333 -0
  8. package/vendor/higiene-motor/audit_website.py +635 -0
  9. package/vendor/higiene-motor/av_meta.py +498 -0
  10. package/vendor/higiene-motor/check_staged.py +71 -0
  11. package/vendor/higiene-motor/clean_ctrlregen.py +212 -0
  12. package/vendor/higiene-motor/clean_file.py +237 -0
  13. package/vendor/higiene-motor/clean_image.py +218 -0
  14. package/vendor/higiene-motor/clean_staged.py +143 -0
  15. package/vendor/higiene-motor/clean_text.py +108 -0
  16. package/vendor/higiene-motor/common.py +486 -0
  17. package/vendor/higiene-motor/container_meta.py +2522 -0
  18. package/vendor/higiene-motor/detect_gumbel.py +308 -0
  19. package/vendor/higiene-motor/detect_text_watermark.py +613 -0
  20. package/vendor/higiene-motor/format_dispatch.py +157 -0
  21. package/vendor/higiene-motor/hook_written_file.py +253 -0
  22. package/vendor/higiene-motor/image_meta.py +2171 -0
  23. package/vendor/higiene-motor/inspect_file.py +138 -0
  24. package/vendor/higiene-motor/inspect_image.py +72 -0
  25. package/vendor/higiene-motor/inspect_text.py +86 -0
  26. package/vendor/higiene-motor/markdiffusion_harness.py +533 -0
  27. package/vendor/higiene-motor/rewrite_text.py +737 -0
  28. package/vendor/higiene-motor/score_stylometry.py +460 -0
  29. package/vendor/higiene-motor/score_synthid.py +165 -0
  30. package/vendor/higiene-motor/server.py +1059 -0
  31. package/vendor/higiene-motor/synthid_score_server.py +176 -0
  32. package/vendor/higiene-motor/text_detectors.py +433 -0
  33. package/vendor/higiene-motor/text_unicode.py +730 -0
  34. package/vendor/theus-arsenal/.arsenal-nombres-ola2.json +0 -6
  35. package/vendor/theus-arsenal/.arsenal-nombres-ola3.json +0 -72
  36. package/vendor/theus-arsenal/.mailmap +0 -2
  37. package/vendor/theus-arsenal/.theus-plugin/marketplace.json +0 -25
  38. package/vendor/theus-arsenal/.theus-plugin/plugin.json +0 -20
  39. package/vendor/theus-arsenal/AUTHORS.md +0 -8
  40. package/vendor/theus-arsenal/CLEANROOM_REPLACEMENT_PLAN.md +0 -11
  41. package/vendor/theus-arsenal/LICENSE +0 -26
  42. package/vendor/theus-arsenal/PROVENANCE.md +0 -9
  43. package/vendor/theus-arsenal/README.md +0 -41
  44. package/vendor/theus-arsenal/THIRD_PARTY.md +0 -80
  45. package/vendor/theus-arsenal/agents/actualizador-docs.md +0 -123
  46. package/vendor/theus-arsenal/agents/analista-comentarios.md +0 -53
  47. package/vendor/theus-arsenal/agents/analista-conversaciones.md +0 -60
  48. package/vendor/theus-arsenal/agents/analista-tests-pr.md +0 -53
  49. package/vendor/theus-arsenal/agents/analista-tipos.md +0 -49
  50. package/vendor/theus-arsenal/agents/arquitecto-accesibilidad.md +0 -148
  51. package/vendor/theus-arsenal/agents/arquitecto-codigo.md +0 -79
  52. package/vendor/theus-arsenal/agents/arquitecto-homelab.md +0 -90
  53. package/vendor/theus-arsenal/agents/arquitecto-redes.md +0 -116
  54. package/vendor/theus-arsenal/agents/arquitecto-sistemas.md +0 -219
  55. package/vendor/theus-arsenal/agents/bifurcador-opensource.md +0 -206
  56. package/vendor/theus-arsenal/agents/cazador-fallos-silenciosos.md +0 -58
  57. package/vendor/theus-arsenal/agents/consultor-documentacion.md +0 -76
  58. package/vendor/theus-arsenal/agents/diagnosticador-redes.md +0 -135
  59. package/vendor/theus-arsenal/agents/ejecutor-e2e.md +0 -96
  60. package/vendor/theus-arsenal/agents/empaquetador-opensource.md +0 -257
  61. package/vendor/theus-arsenal/agents/escaner-secretos.md +0 -196
  62. package/vendor/theus-arsenal/agents/especialista-seo.md +0 -70
  63. package/vendor/theus-arsenal/agents/estratega-marketing.md +0 -158
  64. package/vendor/theus-arsenal/agents/evaluador-agentes.md +0 -214
  65. package/vendor/theus-arsenal/agents/evaluador-harness.md +0 -217
  66. package/vendor/theus-arsenal/agents/explorador-codigo.md +0 -79
  67. package/vendor/theus-arsenal/agents/extractor-specs.md +0 -214
  68. package/vendor/theus-arsenal/agents/generador-harness.md +0 -139
  69. package/vendor/theus-arsenal/agents/guia-tdd.md +0 -99
  70. package/vendor/theus-arsenal/agents/jefe-de-gabinete.md +0 -162
  71. package/vendor/theus-arsenal/agents/limpiador-refactors.md +0 -93
  72. package/vendor/theus-arsenal/agents/optimizador-rendimiento.md +0 -454
  73. package/vendor/theus-arsenal/agents/planificador-harness.md +0 -107
  74. package/vendor/theus-arsenal/agents/planificador.md +0 -221
  75. package/vendor/theus-arsenal/agents/resolutor-apps-harmonyos.md +0 -181
  76. package/vendor/theus-arsenal/agents/resolutor-builds-cpp.md +0 -98
  77. package/vendor/theus-arsenal/agents/resolutor-builds-dart.md +0 -209
  78. package/vendor/theus-arsenal/agents/resolutor-builds-django.md +0 -253
  79. package/vendor/theus-arsenal/agents/resolutor-builds-go.md +0 -102
  80. package/vendor/theus-arsenal/agents/resolutor-builds-java.md +0 -274
  81. package/vendor/theus-arsenal/agents/resolutor-builds-kotlin.md +0 -128
  82. package/vendor/theus-arsenal/agents/resolutor-builds-pytorch.md +0 -128
  83. package/vendor/theus-arsenal/agents/resolutor-builds-react.md +0 -214
  84. package/vendor/theus-arsenal/agents/resolutor-builds-rust.md +0 -156
  85. package/vendor/theus-arsenal/agents/resolutor-builds-swift.md +0 -169
  86. package/vendor/theus-arsenal/agents/resolutor-builds.md +0 -122
  87. package/vendor/theus-arsenal/agents/revisor-bd.md +0 -97
  88. package/vendor/theus-arsenal/agents/revisor-codigo.md +0 -291
  89. package/vendor/theus-arsenal/agents/revisor-config-red.md +0 -116
  90. package/vendor/theus-arsenal/agents/revisor-cpp.md +0 -80
  91. package/vendor/theus-arsenal/agents/revisor-csharp.md +0 -109
  92. package/vendor/theus-arsenal/agents/revisor-django.md +0 -168
  93. package/vendor/theus-arsenal/agents/revisor-fastapi.md +0 -82
  94. package/vendor/theus-arsenal/agents/revisor-flutter.md +0 -251
  95. package/vendor/theus-arsenal/agents/revisor-go.md +0 -84
  96. package/vendor/theus-arsenal/agents/revisor-java.md +0 -192
  97. package/vendor/theus-arsenal/agents/revisor-kotlin.md +0 -171
  98. package/vendor/theus-arsenal/agents/revisor-ml.md +0 -159
  99. package/vendor/theus-arsenal/agents/revisor-php.md +0 -108
  100. package/vendor/theus-arsenal/agents/revisor-python.md +0 -106
  101. package/vendor/theus-arsenal/agents/revisor-react.md +0 -166
  102. package/vendor/theus-arsenal/agents/revisor-rust.md +0 -102
  103. package/vendor/theus-arsenal/agents/revisor-seguridad.md +0 -116
  104. package/vendor/theus-arsenal/agents/revisor-software-clinico.md +0 -95
  105. package/vendor/theus-arsenal/agents/revisor-swift.md +0 -115
  106. package/vendor/theus-arsenal/agents/revisor-typescript.md +0 -123
  107. package/vendor/theus-arsenal/agents/revisor-vue.md +0 -205
  108. package/vendor/theus-arsenal/agents/simplificador-codigo.md +0 -55
  109. package/vendor/theus-arsenal/commands/actualizar-docs.md +0 -88
  110. package/vendor/theus-arsenal/commands/actualizar-mapas-codigo.md +0 -78
  111. package/vendor/theus-arsenal/commands/aprender-evaluar.md +0 -109
  112. package/vendor/theus-arsenal/commands/aprender.md +0 -74
  113. package/vendor/theus-arsenal/commands/arreglar-build.md +0 -66
  114. package/vendor/theus-arsenal/commands/bucle-multiperspectiva.md +0 -153
  115. package/vendor/theus-arsenal/commands/build-cpp.md +0 -173
  116. package/vendor/theus-arsenal/commands/build-flutter.md +0 -164
  117. package/vendor/theus-arsenal/commands/build-go.md +0 -183
  118. package/vendor/theus-arsenal/commands/build-gradle.md +0 -75
  119. package/vendor/theus-arsenal/commands/build-kotlin.md +0 -176
  120. package/vendor/theus-arsenal/commands/build-react.md +0 -187
  121. package/vendor/theus-arsenal/commands/build-rust.md +0 -187
  122. package/vendor/theus-arsenal/commands/campana-marketing.md +0 -125
  123. package/vendor/theus-arsenal/commands/checkpoint.md +0 -78
  124. package/vendor/theus-arsenal/commands/cobertura-tests.md +0 -73
  125. package/vendor/theus-arsenal/commands/configurar-gestor-paquetes.md +0 -86
  126. package/vendor/theus-arsenal/commands/consulta.md +0 -164
  127. package/vendor/theus-arsenal/commands/control-calidad.md +0 -50
  128. package/vendor/theus-arsenal/commands/crear-skill.md +0 -77
  129. package/vendor/theus-arsenal/commands/enrutar-modelo.md +0 -30
  130. package/vendor/theus-arsenal/commands/epica-desbloquear.md +0 -17
  131. package/vendor/theus-arsenal/commands/epica-descomponer.md +0 -22
  132. package/vendor/theus-arsenal/commands/epica-publicar.md +0 -21
  133. package/vendor/theus-arsenal/commands/epica-reclamar.md +0 -25
  134. package/vendor/theus-arsenal/commands/epica-revisar.md +0 -22
  135. package/vendor/theus-arsenal/commands/epica-sincronizar.md +0 -21
  136. package/vendor/theus-arsenal/commands/epica-validar.md +0 -21
  137. package/vendor/theus-arsenal/commands/evolucionar.md +0 -176
  138. package/vendor/theus-arsenal/commands/funcionalidad.md +0 -49
  139. package/vendor/theus-arsenal/commands/guardar-sesion.md +0 -278
  140. package/vendor/theus-arsenal/commands/harness-build.md +0 -111
  141. package/vendor/theus-arsenal/commands/harness-diseno.md +0 -46
  142. package/vendor/theus-arsenal/commands/informe-costos.md +0 -90
  143. package/vendor/theus-arsenal/commands/iniciar-bucle.md +0 -36
  144. package/vendor/theus-arsenal/commands/instintos-estado.md +0 -53
  145. package/vendor/theus-arsenal/commands/instintos-exportar.md +0 -69
  146. package/vendor/theus-arsenal/commands/instintos-importar.md +0 -120
  147. package/vendor/theus-arsenal/commands/lienzo-planes.md +0 -48
  148. package/vendor/theus-arsenal/commands/limpiar-refactor.md +0 -84
  149. package/vendor/theus-arsenal/commands/modo-seguro.md +0 -96
  150. package/vendor/theus-arsenal/commands/orq-agregar-funcionalidad.md +0 -36
  151. package/vendor/theus-arsenal/commands/orq-cambiar-funcionalidad.md +0 -38
  152. package/vendor/theus-arsenal/commands/orq-construir-mvp.md +0 -36
  153. package/vendor/theus-arsenal/commands/orq-corregir-defecto.md +0 -40
  154. package/vendor/theus-arsenal/commands/orq-refinar-codigo.md +0 -44
  155. package/vendor/theus-arsenal/commands/orq-revisar.md +0 -135
  156. package/vendor/theus-arsenal/commands/plan-prd.md +0 -160
  157. package/vendor/theus-arsenal/commands/plan.md +0 -198
  158. package/vendor/theus-arsenal/commands/podar.md +0 -31
  159. package/vendor/theus-arsenal/commands/pr.md +0 -181
  160. package/vendor/theus-arsenal/commands/promover.md +0 -41
  161. package/vendor/theus-arsenal/commands/proyectos.md +0 -33
  162. package/vendor/theus-arsenal/commands/prp-commit.md +0 -112
  163. package/vendor/theus-arsenal/commands/prp-implementar.md +0 -385
  164. package/vendor/theus-arsenal/commands/prp-planificar.md +0 -501
  165. package/vendor/theus-arsenal/commands/reanudar-sesion.md +0 -160
  166. package/vendor/theus-arsenal/commands/revisar-codigo.md +0 -289
  167. package/vendor/theus-arsenal/commands/revisar-cpp.md +0 -132
  168. package/vendor/theus-arsenal/commands/revisar-fastapi.md +0 -39
  169. package/vendor/theus-arsenal/commands/revisar-flutter.md +0 -115
  170. package/vendor/theus-arsenal/commands/revisar-go.md +0 -148
  171. package/vendor/theus-arsenal/commands/revisar-kotlin.md +0 -140
  172. package/vendor/theus-arsenal/commands/revisar-pr.md +0 -37
  173. package/vendor/theus-arsenal/commands/revisar-python.md +0 -297
  174. package/vendor/theus-arsenal/commands/revisar-react.md +0 -170
  175. package/vendor/theus-arsenal/commands/revisar-rust.md +0 -142
  176. package/vendor/theus-arsenal/commands/revisar-vue.md +0 -174
  177. package/vendor/theus-arsenal/commands/salud-skills.md +0 -52
  178. package/vendor/theus-arsenal/commands/sesiones.md +0 -345
  179. package/vendor/theus-arsenal/commands/test-cpp.md +0 -252
  180. package/vendor/theus-arsenal/commands/test-flutter.md +0 -143
  181. package/vendor/theus-arsenal/commands/test-go.md +0 -268
  182. package/vendor/theus-arsenal/commands/test-kotlin.md +0 -312
  183. package/vendor/theus-arsenal/commands/test-react.md +0 -265
  184. package/vendor/theus-arsenal/commands/test-rust.md +0 -309
  185. package/vendor/theus-arsenal/commands/vigilancia-canary.md +0 -43
  186. package/vendor/theus-arsenal/hooks/hooks.json +0 -274
  187. package/vendor/theus-arsenal/package.json +0 -6
  188. package/vendor/theus-arsenal/rules/angular/coding-style.md +0 -182
  189. package/vendor/theus-arsenal/rules/angular/hooks.md +0 -25
  190. package/vendor/theus-arsenal/rules/angular/patterns.md +0 -249
  191. package/vendor/theus-arsenal/rules/angular/security.md +0 -87
  192. package/vendor/theus-arsenal/rules/angular/testing.md +0 -164
  193. package/vendor/theus-arsenal/rules/arkts/coding-style.md +0 -153
  194. package/vendor/theus-arsenal/rules/arkts/hooks.md +0 -80
  195. package/vendor/theus-arsenal/rules/arkts/patterns.md +0 -236
  196. package/vendor/theus-arsenal/rules/arkts/security.md +0 -141
  197. package/vendor/theus-arsenal/rules/arkts/testing.md +0 -126
  198. package/vendor/theus-arsenal/rules/common/agents.md +0 -49
  199. package/vendor/theus-arsenal/rules/common/code-review.md +0 -123
  200. package/vendor/theus-arsenal/rules/common/coding-style.md +0 -90
  201. package/vendor/theus-arsenal/rules/common/development-workflow.md +0 -44
  202. package/vendor/theus-arsenal/rules/common/git-workflow.md +0 -24
  203. package/vendor/theus-arsenal/rules/common/hooks.md +0 -32
  204. package/vendor/theus-arsenal/rules/common/patterns.md +0 -31
  205. package/vendor/theus-arsenal/rules/common/performance.md +0 -53
  206. package/vendor/theus-arsenal/rules/common/security.md +0 -29
  207. package/vendor/theus-arsenal/rules/common/testing.md +0 -57
  208. package/vendor/theus-arsenal/rules/cpp/coding-style.md +0 -44
  209. package/vendor/theus-arsenal/rules/cpp/hooks.md +0 -39
  210. package/vendor/theus-arsenal/rules/cpp/patterns.md +0 -51
  211. package/vendor/theus-arsenal/rules/cpp/security.md +0 -51
  212. package/vendor/theus-arsenal/rules/cpp/testing.md +0 -44
  213. package/vendor/theus-arsenal/rules/csharp/coding-style.md +0 -72
  214. package/vendor/theus-arsenal/rules/csharp/hooks.md +0 -25
  215. package/vendor/theus-arsenal/rules/csharp/patterns.md +0 -50
  216. package/vendor/theus-arsenal/rules/csharp/security.md +0 -58
  217. package/vendor/theus-arsenal/rules/csharp/testing.md +0 -50
  218. package/vendor/theus-arsenal/rules/dart/coding-style.md +0 -159
  219. package/vendor/theus-arsenal/rules/dart/hooks.md +0 -68
  220. package/vendor/theus-arsenal/rules/dart/patterns.md +0 -261
  221. package/vendor/theus-arsenal/rules/dart/security.md +0 -135
  222. package/vendor/theus-arsenal/rules/dart/testing.md +0 -215
  223. package/vendor/theus-arsenal/rules/fsharp/coding-style.md +0 -112
  224. package/vendor/theus-arsenal/rules/fsharp/hooks.md +0 -26
  225. package/vendor/theus-arsenal/rules/fsharp/patterns.md +0 -111
  226. package/vendor/theus-arsenal/rules/fsharp/security.md +0 -76
  227. package/vendor/theus-arsenal/rules/fsharp/testing.md +0 -62
  228. package/vendor/theus-arsenal/rules/golang/coding-style.md +0 -32
  229. package/vendor/theus-arsenal/rules/golang/hooks.md +0 -17
  230. package/vendor/theus-arsenal/rules/golang/patterns.md +0 -45
  231. package/vendor/theus-arsenal/rules/golang/security.md +0 -34
  232. package/vendor/theus-arsenal/rules/golang/testing.md +0 -31
  233. package/vendor/theus-arsenal/rules/java/coding-style.md +0 -114
  234. package/vendor/theus-arsenal/rules/java/hooks.md +0 -18
  235. package/vendor/theus-arsenal/rules/java/patterns.md +0 -147
  236. package/vendor/theus-arsenal/rules/java/security.md +0 -101
  237. package/vendor/theus-arsenal/rules/java/testing.md +0 -133
  238. package/vendor/theus-arsenal/rules/kotlin/coding-style.md +0 -86
  239. package/vendor/theus-arsenal/rules/kotlin/hooks.md +0 -17
  240. package/vendor/theus-arsenal/rules/kotlin/patterns.md +0 -146
  241. package/vendor/theus-arsenal/rules/kotlin/security.md +0 -82
  242. package/vendor/theus-arsenal/rules/kotlin/testing.md +0 -128
  243. package/vendor/theus-arsenal/rules/nuxt/coding-style.md +0 -47
  244. package/vendor/theus-arsenal/rules/nuxt/hooks.md +0 -39
  245. package/vendor/theus-arsenal/rules/nuxt/patterns.md +0 -54
  246. package/vendor/theus-arsenal/rules/nuxt/security.md +0 -48
  247. package/vendor/theus-arsenal/rules/nuxt/testing.md +0 -49
  248. package/vendor/theus-arsenal/rules/php/coding-style.md +0 -40
  249. package/vendor/theus-arsenal/rules/php/hooks.md +0 -24
  250. package/vendor/theus-arsenal/rules/php/patterns.md +0 -33
  251. package/vendor/theus-arsenal/rules/php/security.md +0 -37
  252. package/vendor/theus-arsenal/rules/php/testing.md +0 -38
  253. package/vendor/theus-arsenal/rules/python/coding-style.md +0 -42
  254. package/vendor/theus-arsenal/rules/python/fastapi.md +0 -58
  255. package/vendor/theus-arsenal/rules/python/hooks.md +0 -19
  256. package/vendor/theus-arsenal/rules/python/patterns.md +0 -39
  257. package/vendor/theus-arsenal/rules/python/security.md +0 -30
  258. package/vendor/theus-arsenal/rules/python/testing.md +0 -38
  259. package/vendor/theus-arsenal/rules/react/coding-style.md +0 -109
  260. package/vendor/theus-arsenal/rules/react/hooks.md +0 -187
  261. package/vendor/theus-arsenal/rules/react/patterns.md +0 -194
  262. package/vendor/theus-arsenal/rules/react/security.md +0 -180
  263. package/vendor/theus-arsenal/rules/react/testing.md +0 -208
  264. package/vendor/theus-arsenal/rules/react-native/accessibility.md +0 -55
  265. package/vendor/theus-arsenal/rules/react-native/coding-style.md +0 -71
  266. package/vendor/theus-arsenal/rules/react-native/hooks.md +0 -28
  267. package/vendor/theus-arsenal/rules/react-native/patterns.md +0 -88
  268. package/vendor/theus-arsenal/rules/react-native/performance.md +0 -45
  269. package/vendor/theus-arsenal/rules/react-native/production-readiness.md +0 -51
  270. package/vendor/theus-arsenal/rules/react-native/security.md +0 -43
  271. package/vendor/theus-arsenal/rules/react-native/testing.md +0 -52
  272. package/vendor/theus-arsenal/rules/ruby/coding-style.md +0 -46
  273. package/vendor/theus-arsenal/rules/ruby/hooks.md +0 -37
  274. package/vendor/theus-arsenal/rules/ruby/patterns.md +0 -44
  275. package/vendor/theus-arsenal/rules/ruby/security.md +0 -51
  276. package/vendor/theus-arsenal/rules/ruby/testing.md +0 -51
  277. package/vendor/theus-arsenal/rules/rust/coding-style.md +0 -151
  278. package/vendor/theus-arsenal/rules/rust/hooks.md +0 -16
  279. package/vendor/theus-arsenal/rules/rust/patterns.md +0 -168
  280. package/vendor/theus-arsenal/rules/rust/security.md +0 -141
  281. package/vendor/theus-arsenal/rules/rust/testing.md +0 -154
  282. package/vendor/theus-arsenal/rules/swift/coding-style.md +0 -47
  283. package/vendor/theus-arsenal/rules/swift/hooks.md +0 -20
  284. package/vendor/theus-arsenal/rules/swift/patterns.md +0 -66
  285. package/vendor/theus-arsenal/rules/swift/security.md +0 -33
  286. package/vendor/theus-arsenal/rules/swift/testing.md +0 -45
  287. package/vendor/theus-arsenal/rules/typescript/coding-style.md +0 -199
  288. package/vendor/theus-arsenal/rules/typescript/hooks.md +0 -22
  289. package/vendor/theus-arsenal/rules/typescript/patterns.md +0 -52
  290. package/vendor/theus-arsenal/rules/typescript/security.md +0 -28
  291. package/vendor/theus-arsenal/rules/typescript/testing.md +0 -18
  292. package/vendor/theus-arsenal/rules/vue/coding-style.md +0 -54
  293. package/vendor/theus-arsenal/rules/vue/hooks.md +0 -45
  294. package/vendor/theus-arsenal/rules/vue/patterns.md +0 -56
  295. package/vendor/theus-arsenal/rules/vue/security.md +0 -46
  296. package/vendor/theus-arsenal/rules/vue/testing.md +0 -53
  297. package/vendor/theus-arsenal/rules/web/coding-style.md +0 -108
  298. package/vendor/theus-arsenal/rules/web/design-quality.md +0 -75
  299. package/vendor/theus-arsenal/rules/web/hooks.md +0 -141
  300. package/vendor/theus-arsenal/rules/web/patterns.md +0 -91
  301. package/vendor/theus-arsenal/rules/web/performance.md +0 -76
  302. package/vendor/theus-arsenal/rules/web/security.md +0 -69
  303. package/vendor/theus-arsenal/rules/web/testing.md +0 -67
  304. package/vendor/theus-arsenal/scripts/hooks/bash-hook-dispatcher.js +0 -192
  305. package/vendor/theus-arsenal/scripts/hooks/block-no-verify.js +0 -556
  306. package/vendor/theus-arsenal/scripts/hooks/check-console-log.js +0 -92
  307. package/vendor/theus-arsenal/scripts/hooks/check-hook-enabled.js +0 -16
  308. package/vendor/theus-arsenal/scripts/hooks/config-protection.js +0 -171
  309. package/vendor/theus-arsenal/scripts/hooks/design-quality-check.js +0 -132
  310. package/vendor/theus-arsenal/scripts/hooks/doc-file-warning.js +0 -110
  311. package/vendor/theus-arsenal/scripts/hooks/modo-seguro.js +0 -158
  312. package/vendor/theus-arsenal/scripts/hooks/notificacion-escritorio.js +0 -208
  313. package/vendor/theus-arsenal/scripts/hooks/plugin-hook-bootstrap.js +0 -280
  314. package/vendor/theus-arsenal/scripts/hooks/post-bash-command-log.js +0 -87
  315. package/vendor/theus-arsenal/scripts/hooks/post-bash-dispatcher.js +0 -24
  316. package/vendor/theus-arsenal/scripts/hooks/post-bash-pr-created.js +0 -60
  317. package/vendor/theus-arsenal/scripts/hooks/post-edit-accumulator.js +0 -94
  318. package/vendor/theus-arsenal/scripts/hooks/post-edit-console-warn.js +0 -54
  319. package/vendor/theus-arsenal/scripts/hooks/post-edit-format.js +0 -110
  320. package/vendor/theus-arsenal/scripts/hooks/post-edit-typecheck.js +0 -98
  321. package/vendor/theus-arsenal/scripts/hooks/pre-bash-commit-quality.js +0 -447
  322. package/vendor/theus-arsenal/scripts/hooks/pre-bash-dev-server-block.js +0 -232
  323. package/vendor/theus-arsenal/scripts/hooks/pre-bash-dispatcher.js +0 -27
  324. package/vendor/theus-arsenal/scripts/hooks/pre-compact.js +0 -101
  325. package/vendor/theus-arsenal/scripts/hooks/pretooluse-visible-output.js +0 -49
  326. package/vendor/theus-arsenal/scripts/hooks/quality-gate.js +0 -168
  327. package/vendor/theus-arsenal/scripts/hooks/run-with-flags.js +0 -271
  328. package/vendor/theus-arsenal/scripts/hooks/salud-mcp.js +0 -749
  329. package/vendor/theus-arsenal/scripts/hooks/seguimiento-costos.js +0 -161
  330. package/vendor/theus-arsenal/scripts/hooks/session-end.js +0 -340
  331. package/vendor/theus-arsenal/scripts/hooks/session-start.js +0 -906
  332. package/vendor/theus-arsenal/scripts/hooks/stop-format-typecheck.js +0 -263
  333. package/vendor/theus-arsenal/scripts/hooks/suggest-compact.js +0 -286
  334. package/vendor/theus-arsenal/scripts/hooks/theus-context-monitor.js +0 -289
  335. package/vendor/theus-arsenal/scripts/hooks/verificacion-factual.js +0 -1278
  336. package/vendor/theus-arsenal/scripts/lib/agent-data-home.js +0 -96
  337. package/vendor/theus-arsenal/scripts/lib/cost-estimate.js +0 -66
  338. package/vendor/theus-arsenal/scripts/lib/hook-flags.js +0 -79
  339. package/vendor/theus-arsenal/scripts/lib/llm-summary.js +0 -185
  340. package/vendor/theus-arsenal/scripts/lib/loopback-guard.js +0 -54
  341. package/vendor/theus-arsenal/scripts/lib/observer-sessions.js +0 -237
  342. package/vendor/theus-arsenal/scripts/lib/package-manager.d.ts +0 -120
  343. package/vendor/theus-arsenal/scripts/lib/package-manager.js +0 -434
  344. package/vendor/theus-arsenal/scripts/lib/path-safety.js +0 -86
  345. package/vendor/theus-arsenal/scripts/lib/plan-canvas/markdown.js +0 -285
  346. package/vendor/theus-arsenal/scripts/lib/plan-canvas/sdk.js +0 -238
  347. package/vendor/theus-arsenal/scripts/lib/plan-canvas/server.js +0 -534
  348. package/vendor/theus-arsenal/scripts/lib/plan-canvas/sessions.js +0 -274
  349. package/vendor/theus-arsenal/scripts/lib/plan-canvas/ui.js +0 -546
  350. package/vendor/theus-arsenal/scripts/lib/project-detect.js +0 -451
  351. package/vendor/theus-arsenal/scripts/lib/resolve-formatter.js +0 -193
  352. package/vendor/theus-arsenal/scripts/lib/resolve-theus-root.js +0 -101
  353. package/vendor/theus-arsenal/scripts/lib/session-aliases.d.ts +0 -138
  354. package/vendor/theus-arsenal/scripts/lib/session-aliases.js +0 -483
  355. package/vendor/theus-arsenal/scripts/lib/session-bridge.js +0 -155
  356. package/vendor/theus-arsenal/scripts/lib/session-manager.d.ts +0 -137
  357. package/vendor/theus-arsenal/scripts/lib/session-manager.js +0 -555
  358. package/vendor/theus-arsenal/scripts/lib/shell-split.js +0 -86
  359. package/vendor/theus-arsenal/scripts/lib/shell-substitution.js +0 -501
  360. package/vendor/theus-arsenal/scripts/lib/skill-evolution/dashboard.js +0 -414
  361. package/vendor/theus-arsenal/scripts/lib/skill-evolution/health.js +0 -285
  362. package/vendor/theus-arsenal/scripts/lib/skill-evolution/index.js +0 -22
  363. package/vendor/theus-arsenal/scripts/lib/skill-evolution/provenance.js +0 -200
  364. package/vendor/theus-arsenal/scripts/lib/skill-evolution/tracker.js +0 -157
  365. package/vendor/theus-arsenal/scripts/lib/skill-evolution/versioning.js +0 -246
  366. package/vendor/theus-arsenal/scripts/lib/transcript-context.js +0 -232
  367. package/vendor/theus-arsenal/scripts/lib/utils.d.ts +0 -205
  368. package/vendor/theus-arsenal/scripts/lib/utils.js +0 -658
  369. package/vendor/theus-arsenal/scripts/plan-canvas.js +0 -341
  370. package/vendor/theus-arsenal/scripts/setup-package-manager.js +0 -46
  371. package/vendor/theus-arsenal/scripts/skills-health.js +0 -143
  372. package/vendor/theus-arsenal/skills/a11y-frontend/SKILL.md +0 -444
  373. package/vendor/theus-arsenal/skills/accesibilidad/SKILL.md +0 -144
  374. package/vendor/theus-arsenal/skills/acelerador-throughput-datos/SKILL.md +0 -72
  375. package/vendor/theus-arsenal/skills/agente-scraper-datos/SKILL.md +0 -771
  376. package/vendor/theus-arsenal/skills/analisis-plataformas-competencia/SKILL.md +0 -137
  377. package/vendor/theus-arsenal/skills/api-x/SKILL.md +0 -233
  378. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/SKILL.md +0 -335
  379. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/observer-loop.sh +0 -374
  380. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/observer.md +0 -188
  381. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/session-guardian.sh +0 -153
  382. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/agents/start-observer.sh +0 -253
  383. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/config.json +0 -8
  384. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/hooks/observe.sh +0 -594
  385. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/detect-project.sh +0 -325
  386. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/instinct-cli.py +0 -1918
  387. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/lib/arsenal-dir.sh +0 -23
  388. package/vendor/theus-arsenal/skills/aprendizaje-continuo-v2/scripts/test_parse_instinct.py +0 -1420
  389. package/vendor/theus-arsenal/skills/arquitectura-hexagonal/SKILL.md +0 -275
  390. package/vendor/theus-arsenal/skills/arquitectura-limpia-android/SKILL.md +0 -340
  391. package/vendor/theus-arsenal/skills/arquitectura-pipelines-recomendacion/SKILL.md +0 -112
  392. package/vendor/theus-arsenal/skills/atlas-datos-prediccion/SKILL.md +0 -53
  393. package/vendor/theus-arsenal/skills/auditoria-arquitectura-agentes/SKILL.md +0 -257
  394. package/vendor/theus-arsenal/skills/auditoria-produccion/SKILL.md +0 -180
  395. package/vendor/theus-arsenal/skills/auditoria-rutas-clic/SKILL.md +0 -243
  396. package/vendor/theus-arsenal/skills/autoevaluacion-agente/SKILL.md +0 -180
  397. package/vendor/theus-arsenal/skills/autoevaluacion-agente/examples/high-score-example.md +0 -89
  398. package/vendor/theus-arsenal/skills/autoevaluacion-agente/examples/low-score-example.md +0 -87
  399. package/vendor/theus-arsenal/skills/autoevaluacion-agente/references/evaluation-criteria.md +0 -71
  400. package/vendor/theus-arsenal/skills/autoevaluacion-agente/references/hook-integration.md +0 -90
  401. package/vendor/theus-arsenal/skills/autoevaluacion-agente/scripts/evaluate.py +0 -409
  402. package/vendor/theus-arsenal/skills/autoevaluacion-agente/templates/evaluation-report.md +0 -86
  403. package/vendor/theus-arsenal/skills/automatizacion-ssh-netmiko/SKILL.md +0 -176
  404. package/vendor/theus-arsenal/skills/base-datos-pubmed/SKILL.md +0 -174
  405. package/vendor/theus-arsenal/skills/base-datos-uspto/SKILL.md +0 -173
  406. package/vendor/theus-arsenal/skills/benchmark/SKILL.md +0 -92
  407. package/vendor/theus-arsenal/skills/bitacora-crecimiento/SKILL.md +0 -120
  408. package/vendor/theus-arsenal/skills/bucle-verificacion/SKILL.md +0 -125
  409. package/vendor/theus-arsenal/skills/buscar-primero/SKILL.md +0 -184
  410. package/vendor/theus-arsenal/skills/busqueda-exa/SKILL.md +0 -111
  411. package/vendor/theus-arsenal/skills/cache-por-hash/SKILL.md +0 -160
  412. package/vendor/theus-arsenal/skills/campana-marketing/SKILL.md +0 -118
  413. package/vendor/theus-arsenal/skills/capacidad-producto/SKILL.md +0 -138
  414. package/vendor/theus-arsenal/skills/cazador-vulnerabilidades/SKILL.md +0 -104
  415. package/vendor/theus-arsenal/skills/compactacion-estrategica/SKILL.md +0 -115
  416. package/vendor/theus-arsenal/skills/comparador-baskets-prediccion/SKILL.md +0 -69
  417. package/vendor/theus-arsenal/skills/compras-energia/SKILL.md +0 -206
  418. package/vendor/theus-arsenal/skills/concurrencia-swift-6-2/SKILL.md +0 -224
  419. package/vendor/theus-arsenal/skills/consejo/SKILL.md +0 -201
  420. package/vendor/theus-arsenal/skills/construccion-harness-agentes/SKILL.md +0 -78
  421. package/vendor/theus-arsenal/skills/constructor-conectores/SKILL.md +0 -119
  422. package/vendor/theus-arsenal/skills/constructor-equipos/SKILL.md +0 -169
  423. package/vendor/theus-arsenal/skills/consulta-documentacion/SKILL.md +0 -92
  424. package/vendor/theus-arsenal/skills/consultas-genomicas-gget/SKILL.md +0 -170
  425. package/vendor/theus-arsenal/skills/contacto-inversores/SKILL.md +0 -95
  426. package/vendor/theus-arsenal/skills/corrutinas-flows-kotlin/SKILL.md +0 -284
  427. package/vendor/theus-arsenal/skills/creacion-video-remotion/SKILL.md +0 -46
  428. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/3d.md +0 -86
  429. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/animations.md +0 -29
  430. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets/charts-bar-chart.tsx +0 -173
  431. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets/text-animations-typewriter.tsx +0 -100
  432. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets/text-animations-word-highlight.tsx +0 -108
  433. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/assets.md +0 -78
  434. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/audio.md +0 -172
  435. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/calculate-metadata.md +0 -104
  436. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/can-decode.md +0 -75
  437. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/charts.md +0 -58
  438. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/compositions.md +0 -146
  439. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/display-captions.md +0 -126
  440. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/extract-frames.md +0 -229
  441. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/fonts.md +0 -152
  442. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/get-audio-duration.md +0 -58
  443. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/get-video-dimensions.md +0 -68
  444. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/get-video-duration.md +0 -58
  445. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/gifs.md +0 -138
  446. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/images.md +0 -130
  447. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/import-srt-captions.md +0 -67
  448. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/lottie.md +0 -67
  449. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/measuring-dom-nodes.md +0 -34
  450. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/measuring-text.md +0 -143
  451. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/sequencing.md +0 -106
  452. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/tailwind.md +0 -11
  453. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/text-animations.md +0 -20
  454. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/timing.md +0 -179
  455. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/transcribe-captions.md +0 -19
  456. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/transitions.md +0 -122
  457. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/trimming.md +0 -52
  458. package/vendor/theus-arsenal/skills/creacion-video-remotion/rules/videos.md +0 -171
  459. package/vendor/theus-arsenal/skills/cumplimiento-aduanero/SKILL.md +0 -270
  460. package/vendor/theus-arsenal/skills/cumplimiento-hipaa/SKILL.md +0 -78
  461. package/vendor/theus-arsenal/skills/datos-sensibles-salud/SKILL.md +0 -149
  462. package/vendor/theus-arsenal/skills/decimales-tokens-evm/SKILL.md +0 -128
  463. package/vendor/theus-arsenal/skills/decisiones-arquitectura/SKILL.md +0 -206
  464. package/vendor/theus-arsenal/skills/demos-ui/SKILL.md +0 -469
  465. package/vendor/theus-arsenal/skills/desarrollo-por-intencion/SKILL.md +0 -369
  466. package/vendor/theus-arsenal/skills/descubrimiento-marca/SKILL.md +0 -149
  467. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/10_proposito-porque.md +0 -42
  468. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/20_posicionamiento.md +0 -47
  469. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/30_audiencia-nicho.md +0 -53
  470. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/40_personalidad-arquetipo.md +0 -61
  471. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/50_voz-tono.md +0 -62
  472. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/60_narrativa-historia.md +0 -54
  473. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/70_tension-fundador.md +0 -50
  474. package/vendor/theus-arsenal/skills/descubrimiento-marca/references/90_SINTESIS.md +0 -133
  475. package/vendor/theus-arsenal/skills/descubrimiento-plugins-laravel/SKILL.md +0 -230
  476. package/vendor/theus-arsenal/skills/destilado-reglas/SKILL.md +0 -263
  477. package/vendor/theus-arsenal/skills/destilado-reglas/scripts/scan-rules.sh +0 -58
  478. package/vendor/theus-arsenal/skills/destilado-reglas/scripts/scan-skills.sh +0 -129
  479. package/vendor/theus-arsenal/skills/diagnostico-bgp/SKILL.md +0 -170
  480. package/vendor/theus-arsenal/skills/direccion-estetica/SKILL.md +0 -220
  481. package/vendor/theus-arsenal/skills/direccion-estetica/references/taxonomia-generos.md +0 -89
  482. package/vendor/theus-arsenal/skills/diseno-api/SKILL.md +0 -522
  483. package/vendor/theus-arsenal/skills/diseno-liquid-glass/SKILL.md +0 -282
  484. package/vendor/theus-arsenal/skills/e2e-escritorio-windows/SKILL.md +0 -879
  485. package/vendor/theus-arsenal/skills/edicion-video/SKILL.md +0 -289
  486. package/vendor/theus-arsenal/skills/enfoque-producto/SKILL.md +0 -91
  487. package/vendor/theus-arsenal/skills/entornos-flox/SKILL.md +0 -493
  488. package/vendor/theus-arsenal/skills/estandares-codigo/SKILL.md +0 -548
  489. package/vendor/theus-arsenal/skills/estandares-cpp/SKILL.md +0 -727
  490. package/vendor/theus-arsenal/skills/estandares-java/SKILL.md +0 -389
  491. package/vendor/theus-arsenal/skills/estilo-legado/SKILL.md +0 -149
  492. package/vendor/theus-arsenal/skills/estructura-informes-competencia/SKILL.md +0 -95
  493. package/vendor/theus-arsenal/skills/evaluacion-academica/SKILL.md +0 -165
  494. package/vendor/theus-arsenal/skills/explorador-skills/SKILL.md +0 -129
  495. package/vendor/theus-arsenal/skills/flujo-git/SKILL.md +0 -714
  496. package/vendor/theus-arsenal/skills/flujo-ingenieria-ml/SKILL.md +0 -343
  497. package/vendor/theus-arsenal/skills/flujo-tdd/SKILL.md +0 -584
  498. package/vendor/theus-arsenal/skills/forja-personas/SKILL.md +0 -298
  499. package/vendor/theus-arsenal/skills/forja-personas/gacha.py +0 -224
  500. package/vendor/theus-arsenal/skills/forja-personas/gacha.sh +0 -5
  501. package/vendor/theus-arsenal/skills/forja-personas/references/avatar-style.md +0 -123
  502. package/vendor/theus-arsenal/skills/forja-personas/references/boundary-rules.md +0 -53
  503. package/vendor/theus-arsenal/skills/forja-personas/references/error-handling.md +0 -53
  504. package/vendor/theus-arsenal/skills/forja-personas/references/identity-tension.md +0 -48
  505. package/vendor/theus-arsenal/skills/forja-personas/references/naming-system.md +0 -39
  506. package/vendor/theus-arsenal/skills/forja-personas/references/output-template.md +0 -166
  507. package/vendor/theus-arsenal/skills/fundamentos-animacion/SKILL.md +0 -296
  508. package/vendor/theus-arsenal/skills/generacion-iconos-ios/SKILL.md +0 -156
  509. package/vendor/theus-arsenal/skills/generacion-iconos-ios/scripts/generate_icons.swift +0 -258
  510. package/vendor/theus-arsenal/skills/generacion-iconos-ios/scripts/iconify_gen.sh +0 -235
  511. package/vendor/theus-arsenal/skills/gestion-excepciones-logisticas/SKILL.md +0 -208
  512. package/vendor/theus-arsenal/skills/gestion-transportistas/SKILL.md +0 -204
  513. package/vendor/theus-arsenal/skills/guia-adopcion-ml/SKILL.md +0 -64
  514. package/vendor/theus-arsenal/skills/harness-agente-autonomo/SKILL.md +0 -252
  515. package/vendor/theus-arsenal/skills/harness-eval-clinico/SKILL.md +0 -212
  516. package/vendor/theus-arsenal/skills/harness-evaluacion/SKILL.md +0 -296
  517. package/vendor/theus-arsenal/skills/harness-generador-evaluador/SKILL.md +0 -254
  518. package/vendor/theus-arsenal/skills/homelab-diseno-red/SKILL.md +0 -120
  519. package/vendor/theus-arsenal/skills/homelab-dns-pihole/SKILL.md +0 -264
  520. package/vendor/theus-arsenal/skills/homelab-preparacion-red/SKILL.md +0 -144
  521. package/vendor/theus-arsenal/skills/homelab-segmentacion-vlan/SKILL.md +0 -307
  522. package/vendor/theus-arsenal/skills/homelab-vpn-wireguard/SKILL.md +0 -299
  523. package/vendor/theus-arsenal/skills/ingenieria-agentica/SKILL.md +0 -96
  524. package/vendor/theus-arsenal/skills/inspeccion-animaciones-blender/SKILL.md +0 -164
  525. package/vendor/theus-arsenal/skills/instaladores-python/SKILL.md +0 -820
  526. package/vendor/theus-arsenal/skills/integracion-jira/SKILL.md +0 -307
  527. package/vendor/theus-arsenal/skills/inteligencia-leads/SKILL.md +0 -312
  528. package/vendor/theus-arsenal/skills/inteligencia-leads/agents/agente-enriquecimiento.md +0 -87
  529. package/vendor/theus-arsenal/skills/inteligencia-leads/agents/mapeador-mutuos.md +0 -76
  530. package/vendor/theus-arsenal/skills/inteligencia-leads/agents/puntuador-senales.md +0 -60
  531. package/vendor/theus-arsenal/skills/inteligencia-leads/agents/redactor-outreach.md +0 -102
  532. package/vendor/theus-arsenal/skills/inteligencia-mercados-prediccion/SKILL.md +0 -53
  533. package/vendor/theus-arsenal/skills/introspeccion-agente/SKILL.md +0 -150
  534. package/vendor/theus-arsenal/skills/inventario-skills/SKILL.md +0 -194
  535. package/vendor/theus-arsenal/skills/inventario-skills/scripts/quick-diff.sh +0 -87
  536. package/vendor/theus-arsenal/skills/inventario-skills/scripts/save-results.sh +0 -57
  537. package/vendor/theus-arsenal/skills/inventario-skills/scripts/scan.sh +0 -170
  538. package/vendor/theus-arsenal/skills/investigacion-mercado/SKILL.md +0 -87
  539. package/vendor/theus-arsenal/skills/investigacion-oraculos-prediccion/SKILL.md +0 -59
  540. package/vendor/theus-arsenal/skills/investigacion-profunda/SKILL.md +0 -161
  541. package/vendor/theus-arsenal/skills/keccak256-nodejs/SKILL.md +0 -100
  542. package/vendor/theus-arsenal/skills/libro-decisiones-recursivo/SKILL.md +0 -82
  543. package/vendor/theus-arsenal/skills/lienzo-planes/SKILL.md +0 -111
  544. package/vendor/theus-arsenal/skills/limpieza-configuracion/SKILL.md +0 -116
  545. package/vendor/theus-arsenal/skills/logistica-inversa-devoluciones/SKILL.md +0 -241
  546. package/vendor/theus-arsenal/skills/manejo-errores/SKILL.md +0 -375
  547. package/vendor/theus-arsenal/skills/materiales-inversores/SKILL.md +0 -101
  548. package/vendor/theus-arsenal/skills/memoria-por-proyecto/SKILL.md +0 -170
  549. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/forget.mjs +0 -44
  550. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/info.mjs +0 -24
  551. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/init.mjs +0 -152
  552. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/list.mjs +0 -40
  553. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/migrate.mjs +0 -214
  554. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/resume.mjs +0 -36
  555. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/save.mjs +0 -210
  556. package/vendor/theus-arsenal/skills/memoria-por-proyecto/commands/shared.mjs +0 -402
  557. package/vendor/theus-arsenal/skills/memoria-por-proyecto/hooks/session-start.mjs +0 -238
  558. package/vendor/theus-arsenal/skills/metodologia-benchmarks/SKILL.md +0 -131
  559. package/vendor/theus-arsenal/skills/migraciones-bd/SKILL.md +0 -430
  560. package/vendor/theus-arsenal/skills/modelos-fundacionales-en-dispositivo/SKILL.md +0 -244
  561. package/vendor/theus-arsenal/skills/modo-seguro/SKILL.md +0 -86
  562. package/vendor/theus-arsenal/skills/motion-avanzado/SKILL.md +0 -592
  563. package/vendor/theus-arsenal/skills/motor-de-contenido/SKILL.md +0 -136
  564. package/vendor/theus-arsenal/skills/no-conformidades-calidad/SKILL.md +0 -249
  565. package/vendor/theus-arsenal/skills/onboarding-codigo/SKILL.md +0 -244
  566. package/vendor/theus-arsenal/skills/operaciones-agentes-empresariales/SKILL.md +0 -51
  567. package/vendor/theus-arsenal/skills/operaciones-conocimiento/SKILL.md +0 -159
  568. package/vendor/theus-arsenal/skills/operaciones-correo/SKILL.md +0 -123
  569. package/vendor/theus-arsenal/skills/operaciones-facturacion/SKILL.md +0 -142
  570. package/vendor/theus-arsenal/skills/operaciones-flujo-proyectos/SKILL.md +0 -110
  571. package/vendor/theus-arsenal/skills/operaciones-github/SKILL.md +0 -143
  572. package/vendor/theus-arsenal/skills/operaciones-google-workspace/SKILL.md +0 -100
  573. package/vendor/theus-arsenal/skills/operaciones-investigacion/SKILL.md +0 -124
  574. package/vendor/theus-arsenal/skills/operaciones-mensajes/SKILL.md +0 -103
  575. package/vendor/theus-arsenal/skills/operaciones-terminal/SKILL.md +0 -110
  576. package/vendor/theus-arsenal/skills/optimizacion-benchmark/SKILL.md +0 -70
  577. package/vendor/theus-arsenal/skills/optimizacion-costos-llm/SKILL.md +0 -182
  578. package/vendor/theus-arsenal/skills/optimizador-conexiones/SKILL.md +0 -191
  579. package/vendor/theus-arsenal/skills/optimizador-paralelismo/SKILL.md +0 -75
  580. package/vendor/theus-arsenal/skills/optimizador-prompts/SKILL.md +0 -374
  581. package/vendor/theus-arsenal/skills/orq-agregar-funcionalidad/SKILL.md +0 -37
  582. package/vendor/theus-arsenal/skills/orq-cambiar-funcionalidad/SKILL.md +0 -36
  583. package/vendor/theus-arsenal/skills/orq-construir-mvp/SKILL.md +0 -38
  584. package/vendor/theus-arsenal/skills/orq-corregir-defecto/SKILL.md +0 -36
  585. package/vendor/theus-arsenal/skills/orq-pipeline/SKILL.md +0 -134
  586. package/vendor/theus-arsenal/skills/orq-refinar-codigo/SKILL.md +0 -49
  587. package/vendor/theus-arsenal/skills/orquestacion-equipos-agentes/SKILL.md +0 -117
  588. package/vendor/theus-arsenal/skills/pagos-agentes-x402/SKILL.md +0 -237
  589. package/vendor/theus-arsenal/skills/patrones-angular/SKILL.md +0 -153
  590. package/vendor/theus-arsenal/skills/patrones-angular/references/angular-animations.md +0 -160
  591. package/vendor/theus-arsenal/skills/patrones-angular/references/angular-aria.md +0 -410
  592. package/vendor/theus-arsenal/skills/patrones-angular/references/cli.md +0 -86
  593. package/vendor/theus-arsenal/skills/patrones-angular/references/component-harnesses.md +0 -59
  594. package/vendor/theus-arsenal/skills/patrones-angular/references/component-styling.md +0 -91
  595. package/vendor/theus-arsenal/skills/patrones-angular/references/components.md +0 -117
  596. package/vendor/theus-arsenal/skills/patrones-angular/references/creating-services.md +0 -97
  597. package/vendor/theus-arsenal/skills/patrones-angular/references/data-resolvers.md +0 -69
  598. package/vendor/theus-arsenal/skills/patrones-angular/references/define-routes.md +0 -67
  599. package/vendor/theus-arsenal/skills/patrones-angular/references/defining-providers.md +0 -72
  600. package/vendor/theus-arsenal/skills/patrones-angular/references/di-fundamentals.md +0 -120
  601. package/vendor/theus-arsenal/skills/patrones-angular/references/e2e-testing.md +0 -56
  602. package/vendor/theus-arsenal/skills/patrones-angular/references/effects.md +0 -83
  603. package/vendor/theus-arsenal/skills/patrones-angular/references/hierarchical-injectors.md +0 -43
  604. package/vendor/theus-arsenal/skills/patrones-angular/references/host-elements.md +0 -80
  605. package/vendor/theus-arsenal/skills/patrones-angular/references/injection-context.md +0 -63
  606. package/vendor/theus-arsenal/skills/patrones-angular/references/inputs.md +0 -101
  607. package/vendor/theus-arsenal/skills/patrones-angular/references/linked-signal.md +0 -59
  608. package/vendor/theus-arsenal/skills/patrones-angular/references/loading-strategies.md +0 -61
  609. package/vendor/theus-arsenal/skills/patrones-angular/references/mcp.md +0 -67
  610. package/vendor/theus-arsenal/skills/patrones-angular/references/navigate-to-routes.md +0 -69
  611. package/vendor/theus-arsenal/skills/patrones-angular/references/outputs.md +0 -86
  612. package/vendor/theus-arsenal/skills/patrones-angular/references/reactive-forms.md +0 -122
  613. package/vendor/theus-arsenal/skills/patrones-angular/references/rendering-strategies.md +0 -44
  614. package/vendor/theus-arsenal/skills/patrones-angular/references/resource.md +0 -77
  615. package/vendor/theus-arsenal/skills/patrones-angular/references/route-animations.md +0 -56
  616. package/vendor/theus-arsenal/skills/patrones-angular/references/route-guards.md +0 -52
  617. package/vendor/theus-arsenal/skills/patrones-angular/references/router-lifecycle.md +0 -45
  618. package/vendor/theus-arsenal/skills/patrones-angular/references/router-testing.md +0 -87
  619. package/vendor/theus-arsenal/skills/patrones-angular/references/show-routes-with-outlets.md +0 -68
  620. package/vendor/theus-arsenal/skills/patrones-angular/references/signal-forms.md +0 -795
  621. package/vendor/theus-arsenal/skills/patrones-angular/references/signals-overview.md +0 -94
  622. package/vendor/theus-arsenal/skills/patrones-angular/references/tailwind-css.md +0 -69
  623. package/vendor/theus-arsenal/skills/patrones-angular/references/template-driven-forms.md +0 -114
  624. package/vendor/theus-arsenal/skills/patrones-angular/references/testing-fundamentals.md +0 -65
  625. package/vendor/theus-arsenal/skills/patrones-animacion/SKILL.md +0 -432
  626. package/vendor/theus-arsenal/skills/patrones-backend/SKILL.md +0 -560
  627. package/vendor/theus-arsenal/skills/patrones-cdss-clinico/SKILL.md +0 -249
  628. package/vendor/theus-arsenal/skills/patrones-cisco-ios/SKILL.md +0 -148
  629. package/vendor/theus-arsenal/skills/patrones-clickhouse/SKILL.md +0 -443
  630. package/vendor/theus-arsenal/skills/patrones-compose-multiplatform/SKILL.md +0 -298
  631. package/vendor/theus-arsenal/skills/patrones-dart-flutter/SKILL.md +0 -566
  632. package/vendor/theus-arsenal/skills/patrones-despliegue/SKILL.md +0 -426
  633. package/vendor/theus-arsenal/skills/patrones-django/SKILL.md +0 -739
  634. package/vendor/theus-arsenal/skills/patrones-django-celery/SKILL.md +0 -456
  635. package/vendor/theus-arsenal/skills/patrones-docker/SKILL.md +0 -363
  636. package/vendor/theus-arsenal/skills/patrones-dotnet/SKILL.md +0 -321
  637. package/vendor/theus-arsenal/skills/patrones-emr-clinico/SKILL.md +0 -168
  638. package/vendor/theus-arsenal/skills/patrones-fastapi/SKILL.md +0 -513
  639. package/vendor/theus-arsenal/skills/patrones-frontend/SKILL.md +0 -655
  640. package/vendor/theus-arsenal/skills/patrones-go/SKILL.md +0 -674
  641. package/vendor/theus-arsenal/skills/patrones-jpa/SKILL.md +0 -156
  642. package/vendor/theus-arsenal/skills/patrones-kotlin/SKILL.md +0 -717
  643. package/vendor/theus-arsenal/skills/patrones-kotlin-exposed/SKILL.md +0 -724
  644. package/vendor/theus-arsenal/skills/patrones-kotlin-ktor/SKILL.md +0 -694
  645. package/vendor/theus-arsenal/skills/patrones-kubernetes/SKILL.md +0 -754
  646. package/vendor/theus-arsenal/skills/patrones-laravel/SKILL.md +0 -414
  647. package/vendor/theus-arsenal/skills/patrones-mcp/SKILL.md +0 -66
  648. package/vendor/theus-arsenal/skills/patrones-mysql/SKILL.md +0 -420
  649. package/vendor/theus-arsenal/skills/patrones-nestjs/SKILL.md +0 -229
  650. package/vendor/theus-arsenal/skills/patrones-nextjs/SKILL.md +0 -56
  651. package/vendor/theus-arsenal/skills/patrones-nuxt4/SKILL.md +0 -99
  652. package/vendor/theus-arsenal/skills/patrones-perl/SKILL.md +0 -508
  653. package/vendor/theus-arsenal/skills/patrones-postgres/SKILL.md +0 -141
  654. package/vendor/theus-arsenal/skills/patrones-prisma/SKILL.md +0 -399
  655. package/vendor/theus-arsenal/skills/patrones-python/SKILL.md +0 -750
  656. package/vendor/theus-arsenal/skills/patrones-pytorch/SKILL.md +0 -400
  657. package/vendor/theus-arsenal/skills/patrones-quarkus/SKILL.md +0 -729
  658. package/vendor/theus-arsenal/skills/patrones-react/SKILL.md +0 -339
  659. package/vendor/theus-arsenal/skills/patrones-react-native/SKILL.md +0 -325
  660. package/vendor/theus-arsenal/skills/patrones-redis/SKILL.md +0 -401
  661. package/vendor/theus-arsenal/skills/patrones-rust/SKILL.md +0 -504
  662. package/vendor/theus-arsenal/skills/patrones-springboot/SKILL.md +0 -314
  663. package/vendor/theus-arsenal/skills/patrones-swiftui/SKILL.md +0 -261
  664. package/vendor/theus-arsenal/skills/patrones-tinystruct/SKILL.md +0 -281
  665. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/architecture.md +0 -90
  666. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/data-handling.md +0 -60
  667. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/database.md +0 -99
  668. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/routing.md +0 -64
  669. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/system-usage.md +0 -97
  670. package/vendor/theus-arsenal/skills/patrones-tinystruct/references/testing.md +0 -72
  671. package/vendor/theus-arsenal/skills/patrones-vite/SKILL.md +0 -449
  672. package/vendor/theus-arsenal/skills/patrones-vue/SKILL.md +0 -469
  673. package/vendor/theus-arsenal/skills/persistencia-actores-swift/SKILL.md +0 -148
  674. package/vendor/theus-arsenal/skills/pipeline-opensource/SKILL.md +0 -254
  675. package/vendor/theus-arsenal/skills/planificacion-demanda-inventario/SKILL.md +0 -236
  676. package/vendor/theus-arsenal/skills/planificador-trades-prediccion/SKILL.md +0 -60
  677. package/vendor/theus-arsenal/skills/plano-tecnico/SKILL.md +0 -102
  678. package/vendor/theus-arsenal/skills/presentaciones-html/SKILL.md +0 -189
  679. package/vendor/theus-arsenal/skills/presentaciones-html/STYLE_PRESETS.md +0 -330
  680. package/vendor/theus-arsenal/skills/presentaciones-html/animation-patterns.md +0 -122
  681. package/vendor/theus-arsenal/skills/presentaciones-html/html-template.md +0 -419
  682. package/vendor/theus-arsenal/skills/presentaciones-html/scripts/export-pdf.sh +0 -418
  683. package/vendor/theus-arsenal/skills/presentaciones-html/scripts/extract-pptx.py +0 -96
  684. package/vendor/theus-arsenal/skills/presentaciones-html/viewport-base.css +0 -153
  685. package/vendor/theus-arsenal/skills/presupuesto-contexto/SKILL.md +0 -263
  686. package/vendor/theus-arsenal/skills/procesamiento-documentos-nutrient/SKILL.md +0 -168
  687. package/vendor/theus-arsenal/skills/programacion-produccion/SKILL.md +0 -220
  688. package/vendor/theus-arsenal/skills/publicacion-cruzada/SKILL.md +0 -117
  689. package/vendor/theus-arsenal/skills/publicador-social/SKILL.md +0 -121
  690. package/vendor/theus-arsenal/skills/puerta-de-entrega/SKILL.md +0 -164
  691. package/vendor/theus-arsenal/skills/puerta-de-entrega/hooks/puerta-entrega.py +0 -242
  692. package/vendor/theus-arsenal/skills/pulir-interfaces/SKILL.md +0 -126
  693. package/vendor/theus-arsenal/skills/qa-navegador/SKILL.md +0 -103
  694. package/vendor/theus-arsenal/skills/ranking-grafo-social/SKILL.md +0 -153
  695. package/vendor/theus-arsenal/skills/recuperacion-iterativa/SKILL.md +0 -236
  696. package/vendor/theus-arsenal/skills/redaccion-articulos/SKILL.md +0 -81
  697. package/vendor/theus-arsenal/skills/regex-vs-llm/SKILL.md +0 -221
  698. package/vendor/theus-arsenal/skills/regresion-codigo-ia/SKILL.md +0 -388
  699. package/vendor/theus-arsenal/skills/rendimiento-react/SKILL.md +0 -567
  700. package/vendor/theus-arsenal/skills/revision-codigo-flutter-dart/SKILL.md +0 -442
  701. package/vendor/theus-arsenal/skills/revision-literatura-cientifica/SKILL.md +0 -191
  702. package/vendor/theus-arsenal/skills/revision-multiperspectiva/SKILL.md +0 -302
  703. package/vendor/theus-arsenal/skills/revision-riesgo-prediccion/SKILL.md +0 -56
  704. package/vendor/theus-arsenal/skills/revision-seguridad/SKILL.md +0 -505
  705. package/vendor/theus-arsenal/skills/revision-seguridad/cloud-infrastructure-security.md +0 -361
  706. package/vendor/theus-arsenal/skills/runtime-bun/SKILL.md +0 -83
  707. package/vendor/theus-arsenal/skills/salud-codigo-codescene/SKILL.md +0 -163
  708. package/vendor/theus-arsenal/skills/salud-interfaces-red/SKILL.md +0 -143
  709. package/vendor/theus-arsenal/skills/seguimiento-costos/SKILL.md +0 -122
  710. package/vendor/theus-arsenal/skills/seguridad-agentes-trading/SKILL.md +0 -145
  711. package/vendor/theus-arsenal/skills/seguridad-amm-defi/SKILL.md +0 -166
  712. package/vendor/theus-arsenal/skills/seguridad-django/SKILL.md +0 -648
  713. package/vendor/theus-arsenal/skills/seguridad-laravel/SKILL.md +0 -945
  714. package/vendor/theus-arsenal/skills/seguridad-perl/SKILL.md +0 -507
  715. package/vendor/theus-arsenal/skills/seguridad-quarkus/SKILL.md +0 -474
  716. package/vendor/theus-arsenal/skills/seguridad-springboot/SKILL.md +0 -279
  717. package/vendor/theus-arsenal/skills/seo/SKILL.md +0 -166
  718. package/vendor/theus-arsenal/skills/sistema-diseno/SKILL.md +0 -81
  719. package/vendor/theus-arsenal/skills/sistema-operativo-agentico/SKILL.md +0 -375
  720. package/vendor/theus-arsenal/skills/sistemas-latencia-critica/SKILL.md +0 -65
  721. package/vendor/theus-arsenal/skills/tdd-django/SKILL.md +0 -735
  722. package/vendor/theus-arsenal/skills/tdd-laravel/SKILL.md +0 -673
  723. package/vendor/theus-arsenal/skills/tdd-quarkus/SKILL.md +0 -817
  724. package/vendor/theus-arsenal/skills/tdd-springboot/SKILL.md +0 -165
  725. package/vendor/theus-arsenal/skills/testing-cpp/SKILL.md +0 -328
  726. package/vendor/theus-arsenal/skills/testing-csharp/SKILL.md +0 -321
  727. package/vendor/theus-arsenal/skills/testing-e2e/SKILL.md +0 -325
  728. package/vendor/theus-arsenal/skills/testing-go/SKILL.md +0 -719
  729. package/vendor/theus-arsenal/skills/testing-kotlin/SKILL.md +0 -829
  730. package/vendor/theus-arsenal/skills/testing-perl/SKILL.md +0 -479
  731. package/vendor/theus-arsenal/skills/testing-protocolos-di-swift/SKILL.md +0 -196
  732. package/vendor/theus-arsenal/skills/testing-python/SKILL.md +0 -815
  733. package/vendor/theus-arsenal/skills/testing-react/SKILL.md +0 -421
  734. package/vendor/theus-arsenal/skills/testing-rust/SKILL.md +0 -506
  735. package/vendor/theus-arsenal/skills/tours-de-codigo/SKILL.md +0 -252
  736. package/vendor/theus-arsenal/skills/traduccion-documentos-visado/SKILL.md +0 -121
  737. package/vendor/theus-arsenal/skills/ui-a-vue/SKILL.md +0 -141
  738. package/vendor/theus-arsenal/skills/validacion-config-red/SKILL.md +0 -211
  739. package/vendor/theus-arsenal/skills/verificacion-django/SKILL.md +0 -470
  740. package/vendor/theus-arsenal/skills/verificacion-factual/SKILL.md +0 -142
  741. package/vendor/theus-arsenal/skills/verificacion-laravel/SKILL.md +0 -184
  742. package/vendor/theus-arsenal/skills/verificacion-quarkus/SKILL.md +0 -485
  743. package/vendor/theus-arsenal/skills/verificacion-springboot/SKILL.md +0 -237
  744. package/vendor/theus-arsenal/skills/videodb/SKILL.md +0 -374
  745. package/vendor/theus-arsenal/skills/videodb/reference/api-reference.md +0 -550
  746. package/vendor/theus-arsenal/skills/videodb/reference/capture-reference.md +0 -407
  747. package/vendor/theus-arsenal/skills/videodb/reference/capture.md +0 -101
  748. package/vendor/theus-arsenal/skills/videodb/reference/editor.md +0 -443
  749. package/vendor/theus-arsenal/skills/videodb/reference/generative.md +0 -331
  750. package/vendor/theus-arsenal/skills/videodb/reference/rtstream-reference.md +0 -564
  751. package/vendor/theus-arsenal/skills/videodb/reference/rtstream.md +0 -65
  752. package/vendor/theus-arsenal/skills/videodb/reference/search.md +0 -230
  753. package/vendor/theus-arsenal/skills/videodb/reference/streaming.md +0 -406
  754. package/vendor/theus-arsenal/skills/videodb/reference/use-cases.md +0 -118
  755. package/vendor/theus-arsenal/skills/videodb/scripts/ws_listener.py +0 -279
  756. package/vendor/theus-arsenal/skills/videos-manim/SKILL.md +0 -91
  757. package/vendor/theus-arsenal/skills/videos-manim/assets/network_graph_scene.py +0 -52
  758. package/vendor/theus-arsenal/skills/vigilancia-canary/SKILL.md +0 -108
  759. package/vendor/theus-arsenal/skills/voz-de-marca/SKILL.md +0 -106
@@ -0,0 +1,730 @@
1
+ """Layer A: invisible Unicode / homoglyph space detection and cleaning."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import unicodedata
6
+ from collections import Counter
7
+ from dataclasses import dataclass, field
8
+ from difflib import SequenceMatcher
9
+
10
+ # Format / invisible controls commonly used for steganography or broken pastes.
11
+ STRIP_CODEPOINTS: frozenset[int] = frozenset(
12
+ {
13
+ 0x00AD, # soft hyphen
14
+ 0x034F, # combining grapheme joiner
15
+ 0x061C, # Arabic letter mark
16
+ 0x115F, # Hangul choseong filler
17
+ 0x1160, # Hangul jungseong filler
18
+ 0x17B4, # Khmer vowel inherent AQ
19
+ 0x17B5, # Khmer vowel inherent AA
20
+ 0x180B, # Mongolian free variation selector-1
21
+ 0x180C,
22
+ 0x180D,
23
+ 0x180E, # Mongolian vowel separator
24
+ 0x180F, # Mongolian free variation selector-4 (Unicode 14)
25
+ 0x200B, # zero width space
26
+ 0x200C, # zero width non-joiner
27
+ 0x200D, # zero width joiner
28
+ 0x200E, # LRM
29
+ 0x200F, # RLM
30
+ 0x202A, # LRE
31
+ 0x202B, # RLE
32
+ 0x202C, # PDF
33
+ 0x202D, # LRO
34
+ 0x202E, # RLO
35
+ 0x2060, # word joiner
36
+ 0x2061, # function application
37
+ 0x2062, # invisible times
38
+ 0x2063, # invisible separator
39
+ 0x2064, # invisible plus
40
+ 0x2066, # LRI
41
+ 0x2067, # RLI
42
+ 0x2068, # FSI
43
+ 0x2069, # PDI
44
+ 0x206A, # inhibit symmetric swapping
45
+ 0x206B,
46
+ 0x206C,
47
+ 0x206D,
48
+ 0x206E,
49
+ 0x206F,
50
+ 0xFEFF, # BOM / ZWNBSP
51
+ 0xFE00, # variation selectors
52
+ 0xFE01,
53
+ 0xFE02,
54
+ 0xFE03,
55
+ 0xFE04,
56
+ 0xFE05,
57
+ 0xFE06,
58
+ 0xFE07,
59
+ 0xFE08,
60
+ 0xFE09,
61
+ 0xFE0A,
62
+ 0xFE0B,
63
+ 0xFE0C,
64
+ 0xFE0D,
65
+ 0xFE0E,
66
+ 0xFE0F,
67
+ 0x3164, # Hangul filler (blank compatibility jamo)
68
+ 0xFFA0, # halfwidth Hangul filler
69
+ 0xFFF9, # interlinear annotation
70
+ 0xFFFA,
71
+ 0xFFFB,
72
+ }
73
+ )
74
+
75
+ # Spaces that look like (or substitute for) U+0020.
76
+ SPACE_HOMOGLYPHS: dict[int, str] = {
77
+ 0x00A0: " ", # no-break space
78
+ 0x1680: " ", # Ogham space mark
79
+ 0x2000: " ", # en quad
80
+ 0x2001: " ", # em quad
81
+ 0x2002: " ", # en space
82
+ 0x2003: " ", # em space
83
+ 0x2004: " ", # three-per-em space
84
+ 0x2005: " ", # four-per-em space
85
+ 0x2006: " ", # six-per-em space
86
+ 0x2007: " ", # figure space
87
+ 0x2008: " ", # punctuation space
88
+ 0x2009: " ", # thin space
89
+ 0x200A: " ", # hair space
90
+ 0x202F: " ", # narrow no-break space
91
+ 0x205F: " ", # medium mathematical space
92
+ 0x3000: " ", # ideographic space
93
+ }
94
+
95
+ # Optional confusable Latin lookalikes (aggressive mode only).
96
+ LATIN_CONFUSABLES: dict[int, str] = {
97
+ 0x0410: "A", # Cyrillic
98
+ 0x0412: "B",
99
+ 0x0415: "E",
100
+ 0x041A: "K",
101
+ 0x041C: "M",
102
+ 0x041D: "H",
103
+ 0x041E: "O",
104
+ 0x0420: "P",
105
+ 0x0421: "C",
106
+ 0x0422: "T",
107
+ 0x0425: "X",
108
+ 0x0430: "a",
109
+ 0x0435: "e",
110
+ 0x043E: "o",
111
+ 0x0440: "p",
112
+ 0x0441: "c",
113
+ 0x0443: "y",
114
+ 0x0445: "x",
115
+ 0x0456: "i",
116
+ 0xFF21: "A", # fullwidth
117
+ 0xFF22: "B",
118
+ 0xFF23: "C",
119
+ 0xFF24: "D",
120
+ 0xFF25: "E",
121
+ 0xFF26: "F",
122
+ 0xFF27: "G",
123
+ 0xFF28: "H",
124
+ 0xFF29: "I",
125
+ 0xFF2A: "J",
126
+ 0xFF2B: "K",
127
+ 0xFF2C: "L",
128
+ 0xFF2D: "M",
129
+ 0xFF2E: "N",
130
+ 0xFF2F: "O",
131
+ 0xFF30: "P",
132
+ 0xFF31: "Q",
133
+ 0xFF32: "R",
134
+ 0xFF33: "S",
135
+ 0xFF34: "T",
136
+ 0xFF35: "U",
137
+ 0xFF36: "V",
138
+ 0xFF37: "W",
139
+ 0xFF38: "X",
140
+ 0xFF39: "Y",
141
+ 0xFF3A: "Z",
142
+ 0xFF41: "a",
143
+ 0xFF42: "b",
144
+ 0xFF43: "c",
145
+ 0xFF44: "d",
146
+ 0xFF45: "e",
147
+ 0xFF46: "f",
148
+ 0xFF47: "g",
149
+ 0xFF48: "h",
150
+ 0xFF49: "i",
151
+ 0xFF4A: "j",
152
+ 0xFF4B: "k",
153
+ 0xFF4C: "l",
154
+ 0xFF4D: "m",
155
+ 0xFF4E: "n",
156
+ 0xFF4F: "o",
157
+ 0xFF50: "p",
158
+ 0xFF51: "q",
159
+ 0xFF52: "r",
160
+ 0xFF53: "s",
161
+ 0xFF54: "t",
162
+ 0xFF55: "u",
163
+ 0xFF56: "v",
164
+ 0xFF57: "w",
165
+ 0xFF58: "x",
166
+ 0xFF59: "y",
167
+ 0xFF5A: "z",
168
+ }
169
+
170
+ # Variation selectors beyond FE0x (VS17-VS256 in Supplementary Special-purpose)
171
+ _VS_SUPPLEMENT = range(0xE0100, 0xE01F0)
172
+
173
+ # Unassigned code points with Other_Default_Ignorable_Code_Point=Yes: reserved
174
+ # for future default-ignorable characters, so conformant renderers display them
175
+ # invisibly today and normalisation preserves them. They have no legitimate use
176
+ # in interchange text (conformance clause C7), which makes them ideal covert
177
+ # carriers. Kept as explicit ranges, never a category-Cn rule: unicodedata is
178
+ # pinned per Python build, so a Cn rule would destroy freshly assigned real
179
+ # characters. Re-check these ranges on Unicode version bumps: assignment turns
180
+ # a strip entry into a potential preserve-in-context case, exactly as happened
181
+ # when U+180F became Mongolian FVS4 in Unicode 14.
182
+ _RESERVED_IGNORABLE_CPS: frozenset[int] = frozenset({0x2065, 0xE0000})
183
+ _RESERVED_IGNORABLE_RANGES: tuple[range, ...] = (
184
+ range(0xFFF0, 0xFFF9),
185
+ range(0xE0080, 0xE0100),
186
+ range(0xE01F0, 0xE1000),
187
+ )
188
+
189
+
190
+ def _is_reserved_ignorable(cp: int) -> bool:
191
+ if cp in _RESERVED_IGNORABLE_CPS:
192
+ return True
193
+ return any(cp in r for r in _RESERVED_IGNORABLE_RANGES)
194
+
195
+
196
+ # The 66 Unicode noncharacters: U+FDD0..U+FDEF plus U+nFFFE/U+nFFFF at the
197
+ # end of every plane. Permanently reserved for internal use and prohibited in
198
+ # interchange text (TUS 23.7), so any occurrence in interchange is contraband.
199
+ # Rendered as nothing or tofu, preserved by normalisation, and permanently
200
+ # unassignable, so stripping them carries no future-Unicode risk.
201
+ def _is_noncharacter(cp: int) -> bool:
202
+ return 0xFDD0 <= cp <= 0xFDEF or (cp & 0xFFFE) == 0xFFFE
203
+
204
+
205
+ # Bidi / directional format controls (subset of strip set, finer inspect labels)
206
+ _BIDI_CPS: frozenset[int] = frozenset(
207
+ {
208
+ 0x061C,
209
+ 0x200E,
210
+ 0x200F,
211
+ 0x202A,
212
+ 0x202B,
213
+ 0x202C,
214
+ 0x202D,
215
+ 0x202E,
216
+ 0x2066,
217
+ 0x2067,
218
+ 0x2068,
219
+ 0x2069,
220
+ }
221
+ )
222
+
223
+ # Directional marks and isolates are legitimate in mixed RTL/LTR prose. Inspect
224
+ # them, but preserve them during the default clean. Paired LRE/RLE embeddings
225
+ # (see _valid_bidi_embedding_indices) are preserved too; overrides and
226
+ # unpaired embeddings remain destructive by default because they can reorder
227
+ # unrelated spans.
228
+ _PRESERVABLE_BIDI_CPS: frozenset[int] = frozenset(
229
+ {
230
+ 0x061C,
231
+ 0x200E,
232
+ 0x200F,
233
+ 0x2066,
234
+ 0x2067,
235
+ 0x2068,
236
+ 0x2069,
237
+ }
238
+ )
239
+
240
+ # Visible-layout format controls: Egyptian hieroglyph quadrat controls,
241
+ # Duployan shorthand overlap/step controls, and musical beam/tie/slur/phrase
242
+ # controls are Cf but visibly govern how their script renders. Next to their
243
+ # own script they are document body, not carriers; floating between unrelated
244
+ # text they stay strip-class. Context ranges include each script's own block
245
+ # (and the controls themselves) so control sequences survive intact.
246
+ _LAYOUT_CF_CONTROLS: tuple[tuple[range, range], ...] = (
247
+ (range(0x13430, 0x13440), range(0x13000, 0x14400)), # Egyptian hieroglyphs
248
+ (range(0x1BCA0, 0x1BCA4), range(0x1BC00, 0x1BCA4)), # Duployan shorthand
249
+ (range(0x1D173, 0x1D17B), range(0x1D100, 0x1D200)), # musical symbols
250
+ )
251
+
252
+
253
+ def _layout_cf_script(cp: int) -> range | None:
254
+ for controls, script in _LAYOUT_CF_CONTROLS:
255
+ if cp in controls:
256
+ return script
257
+ return None
258
+
259
+
260
+ # Zero-width family (common edit-based carriers)
261
+ _ZW_FAMILY: frozenset[int] = frozenset({0x200B, 0x200C, 0x200D, 0x2060, 0xFEFF, 0x180E})
262
+
263
+
264
+ def _is_private_use(cp: int) -> bool:
265
+ """BMP and supplementary private-use planes (Co: no portable meaning)."""
266
+ return 0xE000 <= cp <= 0xF8FF or 0xF0000 <= cp <= 0xFFFFD or 0x100000 <= cp <= 0x10FFFD
267
+
268
+
269
+ def _is_strip_cp(cp: int) -> bool:
270
+ if cp in STRIP_CODEPOINTS:
271
+ return True
272
+ if cp in _VS_SUPPLEMENT:
273
+ return True
274
+ # Tag characters used in some stego schemes (U+E0001-U+E007F)
275
+ if 0xE0001 <= cp <= 0xE007F:
276
+ return True
277
+ if _is_noncharacter(cp):
278
+ return True
279
+ if _is_reserved_ignorable(cp):
280
+ return True
281
+ return bool(_is_private_use(cp))
282
+
283
+
284
+ def _strip_kind(cp: int) -> str:
285
+ """Finer-grained inspect kind for strip-class codepoints."""
286
+ if 0xE0001 <= cp <= 0xE007F:
287
+ return "tag_chars"
288
+ if _is_noncharacter(cp):
289
+ return "noncharacter"
290
+ if _is_reserved_ignorable(cp):
291
+ return "reserved_ignorable"
292
+ if cp in _VS_SUPPLEMENT or 0xFE00 <= cp <= 0xFE0F or cp in _MONGOLIAN_FVS:
293
+ return "variation_selector"
294
+ if cp in _BIDI_CPS:
295
+ return "bidi"
296
+ if cp in _ZW_FAMILY:
297
+ return "zwj_family"
298
+ if _is_private_use(cp):
299
+ return "private_use"
300
+ return "strip"
301
+
302
+
303
+ # Emoji presentation glue: zero-width joiner and text/emoji variation
304
+ # selectors. These are invisible carriers when free-floating, but after an
305
+ # emoji base they are part of the visible sequence (⚖️, 👨‍👩‍👧, ❤️‍🔥) and
306
+ # stripping them visibly alters the text.
307
+ EMOJI_GLUE_CODEPOINTS: frozenset[int] = frozenset({0x200D, 0xFE0E, 0xFE0F})
308
+
309
+
310
+ def _is_emoji_glue(cp: int) -> bool:
311
+ return cp in EMOJI_GLUE_CODEPOINTS
312
+
313
+
314
+ def _is_emoji_base(cp: int) -> bool:
315
+ """Return True for characters that can start or continue an emoji sequence."""
316
+ if 0x1F000 <= cp <= 0x1FAFF:
317
+ return True
318
+ if 0x2190 <= cp <= 0x25FF: # arrows, technical symbols, enclosed symbols
319
+ return True
320
+ if 0x2600 <= cp <= 0x27BF: # misc symbols / dingbats / arrows
321
+ return True
322
+ if 0x2B00 <= cp <= 0x2BFF: # misc symbols and arrows
323
+ return True
324
+ # Emoji=Yes singletons outside the ranges above (general punctuation,
325
+ # letterlike symbols, supplemental arrows-B): !!, !?, i, curved up/down
326
+ # arrows. Without these a VS16 after them is stripped, visibly turning
327
+ # the emoji presentation back into the text glyph.
328
+ if cp in (0x203C, 0x2049, 0x2139, 0x2934, 0x2935):
329
+ return True
330
+ if cp in (0x00A9, 0x00AE, 0x2122, 0x3030, 0x303D, 0x3297, 0x3299):
331
+ return True
332
+ # keycap bases
333
+ return cp in (0x0023, 0x002A) or 0x0030 <= cp <= 0x0039
334
+
335
+
336
+ # ZWNJ/ZWJ are orthographic inside complex scripts (Persian می‌روم, Devanagari
337
+ # क्‍ष); flag emoji are an emoji base followed by tag chars (🏴󠁧󠁢󠁳󠁣󠁴󠁿); and a
338
+ # handful of Cf codepoints are normal Arabic/Syriac orthography, not carriers.
339
+ # So are Mongolian free variation selectors (choose a glyph of the preceding
340
+ # letter), Khmer inherent vowels (invisible but phonemic), and Hangul fillers
341
+ # (hold a jamo slot in a partial syllable). Each is only meaningful directly
342
+ # after a base from its own script; isolated instances are contraband.
343
+ _SCRIPT_JOINERS: frozenset[int] = frozenset({0x200C, 0x200D})
344
+ _TAG_RANGE = range(0xE0020, 0xE0080)
345
+ _ORTHOGRAPHIC_CF: frozenset[int] = frozenset(
346
+ {0x0600, 0x0601, 0x0602, 0x0603, 0x0604, 0x0605, 0x06DD, 0x070F, 0x08E2, 0x110BD, 0x110CD}
347
+ )
348
+ _MONGOLIAN_FVS: frozenset[int] = frozenset({0x180B, 0x180C, 0x180D, 0x180F})
349
+ _KHMER_VOWELS: frozenset[int] = frozenset({0x17B4, 0x17B5})
350
+ _HANGUL_FILLERS: frozenset[int] = frozenset({0x115F, 0x1160, 0x3164, 0xFFA0})
351
+ _SCRIPT_GLUE: frozenset[int] = _MONGOLIAN_FVS | _KHMER_VOWELS | _HANGUL_FILLERS
352
+
353
+
354
+ def _joining_script(cp: int) -> str | None:
355
+ """Return a broad script group where ZWJ/ZWNJ can be orthographic."""
356
+ for start, end, name in (
357
+ (0x0600, 0x08FF, "arabic"),
358
+ (0x0900, 0x0DFF, "indic"),
359
+ (0x0F00, 0x109F, "south-asian"),
360
+ (0x1780, 0x17FF, "khmer"),
361
+ (0x1800, 0x18AF, "mongolian"),
362
+ ):
363
+ if start <= cp <= end and unicodedata.category(chr(cp))[0] in ("L", "M"):
364
+ return name
365
+ return None
366
+
367
+
368
+ def _is_cjk_ideograph(cp: int) -> bool:
369
+ return (
370
+ 0x3400 <= cp <= 0x4DBF
371
+ or 0x4E00 <= cp <= 0x9FFF
372
+ or 0xF900 <= cp <= 0xFAFF
373
+ or 0x20000 <= cp <= 0x323AF
374
+ )
375
+
376
+
377
+ def _is_mongolian_base(cp: int) -> bool:
378
+ return 0x1800 <= cp <= 0x18AF
379
+
380
+
381
+ def _is_variation_selector(cp: int) -> bool:
382
+ return cp in _VS_SUPPLEMENT or 0xFE00 <= cp <= 0xFE0F or cp in _MONGOLIAN_FVS
383
+
384
+
385
+ def _valid_flag_tag_indices(text: str) -> set[int]:
386
+ """Indices in complete subdivision-flag tag sequences."""
387
+ valid: set[int] = set()
388
+ i = 0
389
+ while i < len(text):
390
+ if ord(text[i]) != 0x1F3F4: # waving black flag
391
+ i += 1
392
+ continue
393
+ j = i + 1
394
+ while j < len(text) and 0xE0020 <= ord(text[j]) <= 0xE007E:
395
+ j += 1
396
+ if j > i + 1 and j < len(text) and ord(text[j]) == 0xE007F:
397
+ valid.update(range(i + 1, j + 1))
398
+ i = j + 1
399
+ else:
400
+ i += 1
401
+ return valid
402
+
403
+
404
+ def _valid_bidi_embedding_indices(text: str) -> set[int]:
405
+ """Indices belonging to complete LRE/RLE ... PDF pairs, excluding overrides."""
406
+ valid: set[int] = set()
407
+ stack: list[tuple[int, int]] = []
408
+ for index, char in enumerate(text):
409
+ cp = ord(char)
410
+ if cp in (0x202A, 0x202B, 0x202D, 0x202E):
411
+ stack.append((cp, index))
412
+ elif cp == 0x202C:
413
+ if not stack:
414
+ continue
415
+ opener, opener_index = stack.pop()
416
+ if opener in (0x202A, 0x202B):
417
+ valid.update((opener_index, index))
418
+ return valid
419
+
420
+
421
+ def _is_mongolian_letter(cp: int) -> bool:
422
+ return 0x1800 <= cp <= 0x18AF and unicodedata.category(chr(cp))[0] == "L"
423
+
424
+
425
+ def _is_khmer_letter(cp: int) -> bool:
426
+ return 0x1780 <= cp <= 0x17FF and unicodedata.category(chr(cp))[0] == "L"
427
+
428
+
429
+ def _is_hangul_jamo(cp: int) -> bool:
430
+ # Conjoining jamo plus the compatibility and halfwidth presentation forms,
431
+ # so each filler can follow letters of its own form (U+115F/U+1160 after
432
+ # conjoining jamo, U+3164 after compatibility jamo, U+FFA0 after halfwidth).
433
+ return (
434
+ 0x1100 <= cp <= 0x11FF
435
+ or 0xA960 <= cp <= 0xA97C # Hangul Jamo Extended-A
436
+ or 0xD7B0 <= cp <= 0xD7C6 # Hangul Jamo Extended-B
437
+ or 0x3131 <= cp <= 0x318E # Hangul Compatibility Jamo (incl. U+3164)
438
+ or 0xFFA1 <= cp <= 0xFFDC # halfwidth Hangul jamo letters
439
+ )
440
+
441
+
442
+ def _is_glue(cp: int) -> bool:
443
+ """Load-bearing invisible char: emoji glue, script joiner, flag tag char,
444
+ or same-script filler/selector (Mongolian FVS, Khmer vowel, Hangul filler)."""
445
+ return (
446
+ _is_emoji_glue(cp)
447
+ or _is_variation_selector(cp)
448
+ or cp in _SCRIPT_JOINERS
449
+ or cp in _TAG_RANGE
450
+ or cp in _SCRIPT_GLUE
451
+ )
452
+
453
+
454
+ def _decide(
455
+ ch: str,
456
+ prev_kept: str | None,
457
+ prev_input: str | None,
458
+ next_input: str | None,
459
+ *,
460
+ valid_flag_tag: bool,
461
+ valid_bidi_embedding: bool,
462
+ normalize_spaces: bool,
463
+ treat_confusables: bool,
464
+ strip_emoji_glue: bool,
465
+ strip_bidi: bool,
466
+ ) -> tuple[str, str, str | None]:
467
+ """Classify one input char for both inspect and clean.
468
+
469
+ Returns ``(action, out_char, kind)`` where action is ``keep``, ``strip``
470
+ or ``replace``; out_char is the surviving character for keep/replace; and
471
+ kind is the inspect classification (None when not suspicious).
472
+ """
473
+ cp = ord(ch)
474
+ if valid_bidi_embedding and not strip_bidi:
475
+ return ("keep", ch, None)
476
+ if cp in _PRESERVABLE_BIDI_CPS and not strip_bidi:
477
+ return ("keep", ch, None)
478
+ if prev_input is not None and not strip_emoji_glue:
479
+ prev_cp = ord(prev_input)
480
+ if cp in _VS_SUPPLEMENT and _is_cjk_ideograph(prev_cp):
481
+ return ("keep", ch, None)
482
+ if cp in _MONGOLIAN_FVS and _is_mongolian_base(prev_cp):
483
+ return ("keep", ch, None)
484
+ if 0xFE00 <= cp <= 0xFE0D and _is_cjk_ideograph(prev_cp):
485
+ return ("keep", ch, None)
486
+ if _is_emoji_glue(cp) and not strip_emoji_glue:
487
+ if cp in (0xFE0E, 0xFE0F) and prev_input is not None and _is_emoji_base(ord(prev_input)):
488
+ return ("keep", ch, None)
489
+ if (
490
+ cp == 0x200D
491
+ and prev_kept is not None
492
+ and next_input is not None
493
+ and _is_emoji_base(ord(prev_kept))
494
+ and _is_emoji_base(ord(next_input))
495
+ ):
496
+ return ("keep", ch, None)
497
+ if not strip_emoji_glue:
498
+ if cp in _SCRIPT_JOINERS and prev_input is not None and next_input is not None:
499
+ prev_script = _joining_script(ord(prev_input))
500
+ next_script = _joining_script(ord(next_input))
501
+ if prev_script is not None and prev_script == next_script:
502
+ return ("keep", ch, None)
503
+ if cp in _TAG_RANGE and valid_flag_tag:
504
+ return ("keep", ch, None)
505
+ if cp in _MONGOLIAN_FVS and prev_kept is not None and _is_mongolian_letter(ord(prev_kept)):
506
+ return ("keep", ch, None)
507
+ if cp in _KHMER_VOWELS and prev_kept is not None and _is_khmer_letter(ord(prev_kept)):
508
+ return ("keep", ch, None)
509
+ if cp in _HANGUL_FILLERS and prev_kept is not None and _is_hangul_jamo(ord(prev_kept)):
510
+ return ("keep", ch, None)
511
+ if cp in _ORTHOGRAPHIC_CF:
512
+ return ("keep", ch, None)
513
+ script = _layout_cf_script(cp)
514
+ if script is not None and (
515
+ (prev_input is not None and ord(prev_input) in script)
516
+ or (next_input is not None and ord(next_input) in script)
517
+ ):
518
+ return ("keep", ch, None)
519
+ if _is_strip_cp(cp):
520
+ return ("strip", "", _strip_kind(cp))
521
+ if normalize_spaces and cp in SPACE_HOMOGLYPHS:
522
+ return ("replace", SPACE_HOMOGLYPHS[cp], "space")
523
+ if treat_confusables and cp in LATIN_CONFUSABLES:
524
+ return ("replace", LATIN_CONFUSABLES[cp], "confusable")
525
+ if unicodedata.category(ch) == "Cf" and cp not in SPACE_HOMOGLYPHS:
526
+ return ("strip", "", "other_cf")
527
+ return ("keep", ch, None)
528
+
529
+
530
+ def _char_label(ch: str) -> str:
531
+ cp = ord(ch)
532
+ name = unicodedata.name(ch, "UNKNOWN")
533
+ cat = unicodedata.category(ch)
534
+ return f"U+{cp:04X} {name} ({cat})"
535
+
536
+
537
+ def _hit_confidence(kind: str) -> str:
538
+ """Layer A hits are edit-based carriers; space homoglyphs are weaker context."""
539
+ return "informational" if kind == "space" else "probable"
540
+
541
+
542
+ @dataclass
543
+ class CharHit:
544
+ codepoint: int
545
+ char: str
546
+ label: str
547
+ count: int
548
+ kind: str # strip | bidi | tag_chars | variation_selector | zwj_family | private_use | noncharacter | reserved_ignorable | space | confusable | other_cf
549
+ samples: list[int] = field(default_factory=list) # character offsets
550
+
551
+
552
+ @dataclass
553
+ class TextInspectReport:
554
+ length: int
555
+ suspicious_total: int
556
+ hits: list[CharHit]
557
+ notes: list[str] = field(default_factory=list)
558
+
559
+ def to_dict(self) -> dict:
560
+ return {
561
+ "length": self.length,
562
+ "suspicious_total": self.suspicious_total,
563
+ "hits": [
564
+ {
565
+ "codepoint": f"U+{h.codepoint:04X}",
566
+ "label": h.label,
567
+ "count": h.count,
568
+ "kind": h.kind,
569
+ "confidence": _hit_confidence(h.kind),
570
+ "sample_offsets": h.samples[:10],
571
+ }
572
+ for h in self.hits
573
+ ],
574
+ "notes": self.notes,
575
+ }
576
+
577
+
578
+ def inspect_text(
579
+ text: str,
580
+ *,
581
+ aggressive: bool = False,
582
+ strip_emoji_glue: bool = False,
583
+ ) -> TextInspectReport:
584
+ buckets: dict[tuple[int, str], list[int]] = {}
585
+ prev_kept: str | None = None
586
+ valid_flag_tags = _valid_flag_tag_indices(text)
587
+ valid_bidi_embeddings = _valid_bidi_embedding_indices(text)
588
+ for i, ch in enumerate(text):
589
+ action, out_char, kind = _decide(
590
+ ch,
591
+ prev_kept,
592
+ text[i - 1] if i > 0 else None,
593
+ text[i + 1] if i + 1 < len(text) else None,
594
+ valid_flag_tag=i in valid_flag_tags,
595
+ valid_bidi_embedding=i in valid_bidi_embeddings,
596
+ normalize_spaces=True,
597
+ treat_confusables=aggressive,
598
+ strip_emoji_glue=strip_emoji_glue,
599
+ strip_bidi=True,
600
+ )
601
+ if kind is None:
602
+ # Kept; glue (emoji/script joiner/tag) does not advance the
603
+ # "previous kept" base so ZWJ chains and flag runs stay bound.
604
+ if not _is_glue(ord(ch)):
605
+ prev_kept = out_char
606
+ continue
607
+ key = (ord(ch), kind)
608
+ buckets.setdefault(key, []).append(i)
609
+ if action == "replace":
610
+ prev_kept = out_char
611
+ # strip: prev_kept unchanged
612
+
613
+ hits: list[CharHit] = []
614
+ total = 0
615
+ for (cp, kind), offsets in sorted(buckets.items(), key=lambda x: (-len(x[1]), x[0][0])):
616
+ ch = chr(cp)
617
+ hits.append(
618
+ CharHit(
619
+ codepoint=cp,
620
+ char=ch,
621
+ label=_char_label(ch),
622
+ count=len(offsets),
623
+ kind=kind,
624
+ samples=offsets[:10],
625
+ )
626
+ )
627
+ total += len(offsets)
628
+
629
+ notes = [
630
+ "Layer A only: invisible/format Unicode and space homoglyphs (edit-based carriers).",
631
+ "Statistical (token-sampling) watermarks are not detectable here; use Layer B rewrite.",
632
+ "Inspect kinds: strip, bidi, tag_chars, variation_selector, zwj_family, private_use, space, confusable, other_cf.",
633
+ "Load-bearing invisibles are preserved by default during cleaning: emoji glue, CJK/Mongolian variation selectors, script joiners, complete flag tag sequences, same-script fillers/selectors (Mongolian FVS, Khmer inherent vowels, Hangul jamo fillers), RTL directional marks/paired embeddings, orthographic Arabic/Syriac Cf marks, and visible-layout format controls next to their own script (Egyptian hieroglyph quadrat, Duployan shorthand, musical beaming). Inspection still reports bidi controls. Use explicit strip flags only after review.",
634
+ ]
635
+ if not hits:
636
+ notes.append(
637
+ "No deterministic Layer A (invisible Unicode/format) carriers detected; "
638
+ "statistical and pixel-domain marks are out of scope here."
639
+ )
640
+ return TextInspectReport(length=len(text), suspicious_total=total, hits=hits, notes=notes)
641
+
642
+
643
+ def clean_text(
644
+ text: str,
645
+ *,
646
+ nfkc: bool = False,
647
+ aggressive_homoglyphs: bool = False,
648
+ normalize_spaces: bool = True,
649
+ strip_emoji_glue: bool = False,
650
+ strip_bidi: bool = False,
651
+ ) -> tuple[str, dict]:
652
+ """Return cleaned text and a stats dict."""
653
+ removed: Counter[str] = Counter()
654
+ replaced: Counter[str] = Counter()
655
+ out_chars: list[str] = []
656
+ prev_kept: str | None = None
657
+ valid_flag_tags = _valid_flag_tag_indices(text)
658
+ valid_bidi_embeddings = _valid_bidi_embedding_indices(text)
659
+
660
+ for i, ch in enumerate(text):
661
+ action, out_char, _kind = _decide(
662
+ ch,
663
+ prev_kept,
664
+ text[i - 1] if i > 0 else None,
665
+ text[i + 1] if i + 1 < len(text) else None,
666
+ valid_flag_tag=i in valid_flag_tags,
667
+ valid_bidi_embedding=i in valid_bidi_embeddings,
668
+ normalize_spaces=normalize_spaces,
669
+ treat_confusables=aggressive_homoglyphs,
670
+ strip_emoji_glue=strip_emoji_glue,
671
+ strip_bidi=strip_bidi,
672
+ )
673
+ if action == "keep":
674
+ out_chars.append(out_char)
675
+ # Glue (emoji/script joiner/tag) does not advance the "previous
676
+ # kept" base, so ZWJ chains (❤️‍🔥) and flag runs stay bound.
677
+ if not _is_glue(ord(ch)):
678
+ prev_kept = out_char
679
+ elif action == "replace":
680
+ out_chars.append(out_char)
681
+ replaced[_char_label(ch)] += 1
682
+ prev_kept = out_char
683
+ else: # strip
684
+ removed[_char_label(ch)] += 1
685
+ # prev_kept unchanged
686
+
687
+ result = "".join(out_chars)
688
+ nfkc_changed = False
689
+ if nfkc:
690
+ before = result
691
+ result = unicodedata.normalize("NFKC", result)
692
+ if result != before:
693
+ nfkc_changed = True
694
+ changed_inputs = sum(
695
+ end - start
696
+ for operation, start, end, _new_start, _new_end in SequenceMatcher(
697
+ None, before, result, autojunk=False
698
+ ).get_opcodes()
699
+ if operation != "equal"
700
+ )
701
+ replaced["NFKC_normalize"] += changed_inputs or 1
702
+
703
+ # Collapse runs of spaces only if we introduced space replacements? Keep conservative: no.
704
+
705
+ stats = {
706
+ "input_length": len(text),
707
+ "output_length": len(result),
708
+ "removed": dict(removed),
709
+ "replaced": dict(replaced),
710
+ "removed_count": sum(removed.values()),
711
+ "replaced_count": sum(replaced.values()),
712
+ "nfkc_changed": nfkc_changed,
713
+ }
714
+ return result, stats
715
+
716
+
717
+ def human_report(report: TextInspectReport) -> str:
718
+ lines = [
719
+ f"Length: {report.length} chars",
720
+ f"Suspicious: {report.suspicious_total}",
721
+ ]
722
+ if report.hits:
723
+ lines.append("Hits:")
724
+ for h in report.hits:
725
+ lines.append(
726
+ f" [{h.kind}/{_hit_confidence(h.kind)}] {h.label} x{h.count} @ {h.samples[:5]}"
727
+ )
728
+ for n in report.notes:
729
+ lines.append(f"Note: {n}")
730
+ return "\n".join(lines)