textoneitor 0.0.0-stage → 1.2.2

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 (77) hide show
  1. package/LICENSE +101 -0
  2. package/LICENSE-AGPL-3.0 +661 -0
  3. package/README.md +69 -2
  4. package/dist/api/index.d.ts +34 -0
  5. package/dist/api/index.js +98 -0
  6. package/dist/baseline/index.d.ts +20 -0
  7. package/dist/baseline/index.js +81 -0
  8. package/dist/bundle/dist/cli.mjs +29893 -0
  9. package/dist/bundle/package.json +6 -0
  10. package/dist/bundle/rulepack/rulepack.json +1496 -0
  11. package/dist/bundle/rules/situaciones.yml +27 -0
  12. package/dist/cli/benchmark.d.ts +89 -0
  13. package/dist/cli/benchmark.js +185 -0
  14. package/dist/cli/main.d.ts +2 -0
  15. package/dist/cli/main.js +377 -0
  16. package/dist/config/core.d.ts +55 -0
  17. package/dist/config/core.js +244 -0
  18. package/dist/config/glob.d.ts +2 -0
  19. package/dist/config/glob.js +72 -0
  20. package/dist/config/index.d.ts +8 -0
  21. package/dist/config/index.js +38 -0
  22. package/dist/config/situaciones.d.ts +17 -0
  23. package/dist/config/situaciones.js +43 -0
  24. package/dist/contracts/index.d.ts +238 -0
  25. package/dist/contracts/index.js +4 -0
  26. package/dist/document/index.d.ts +10 -0
  27. package/dist/document/index.js +70 -0
  28. package/dist/document/text.d.ts +22 -0
  29. package/dist/document/text.js +91 -0
  30. package/dist/document/tokenize.d.ts +4 -0
  31. package/dist/document/tokenize.js +59 -0
  32. package/dist/markdown/index.d.ts +7 -0
  33. package/dist/markdown/index.js +178 -0
  34. package/dist/paths.d.ts +4 -0
  35. package/dist/paths.js +14 -0
  36. package/dist/reporters/index.d.ts +29 -0
  37. package/dist/reporters/index.js +182 -0
  38. package/dist/rules/compiler/build.d.ts +1 -0
  39. package/dist/rules/compiler/build.js +46 -0
  40. package/dist/rules/compiler/index.d.ts +40 -0
  41. package/dist/rules/compiler/index.js +343 -0
  42. package/dist/rules/compiler/safety.d.ts +16 -0
  43. package/dist/rules/compiler/safety.js +124 -0
  44. package/dist/rules/detectors/index.d.ts +4 -0
  45. package/dist/rules/detectors/index.js +651 -0
  46. package/dist/rules/detectors/shared.d.ts +30 -0
  47. package/dist/rules/detectors/shared.js +87 -0
  48. package/dist/rules/runtime/index.d.ts +17 -0
  49. package/dist/rules/runtime/index.js +74 -0
  50. package/dist/runner/index.d.ts +18 -0
  51. package/dist/runner/index.js +176 -0
  52. package/dist/runner/lint-text.d.ts +19 -0
  53. package/dist/runner/lint-text.js +20 -0
  54. package/dist/scoring/index.d.ts +16 -0
  55. package/dist/scoring/index.js +41 -0
  56. package/dist/suppressions/index.d.ts +23 -0
  57. package/dist/suppressions/index.js +86 -0
  58. package/dist/web/engine.meta.json +1 -0
  59. package/dist/web/engine.mjs +11029 -0
  60. package/dist/web/index.d.ts +39 -0
  61. package/dist/web/index.js +37 -0
  62. package/dist/web/node-crypto-shim.d.ts +9 -0
  63. package/dist/web/node-crypto-shim.js +24 -0
  64. package/dist/web/sha256.d.ts +11 -0
  65. package/dist/web/sha256.js +89 -0
  66. package/package.json +88 -4
  67. package/rulepack/rulepack.json +1496 -0
  68. package/rules/profiles/academico.yml +4 -0
  69. package/rules/profiles/chat.yml +4 -0
  70. package/rules/profiles/correo.yml +3 -0
  71. package/rules/profiles/general.yml +2 -0
  72. package/rules/profiles/marketing.yml +4 -0
  73. package/rules/profiles/readme.yml +5 -0
  74. package/rules/profiles/redes.yml +6 -0
  75. package/rules/profiles/tecnico.yml +4 -0
  76. package/rules/situaciones.yml +27 -0
  77. package/schemas/rule.schema.json +90 -0
@@ -0,0 +1,4 @@
1
+ # Perfil académico: tolera conectores y fórmulas del género.
2
+ rules:
3
+ lexico/es-importante-destacar: info
4
+ retorica/no-solo-sino: info
@@ -0,0 +1,4 @@
1
+ # Perfil chat: conversacion con confianza. Los tacos no se marcan ni se sugieren.
2
+ # Frases cortas seguidas son normales aqui.
3
+ rules:
4
+ estructura/longitud-uniforme: "off"
@@ -0,0 +1,3 @@
1
+ # Perfil correo: natural y educado, sin jerga.
2
+ rules:
3
+ densidad/emojis: warning
@@ -0,0 +1,2 @@
1
+ # Perfil general: niveles por defecto de cada regla.
2
+ rules: {}
@@ -0,0 +1,4 @@
1
+ # Perfil marketing: tolera arenga, emojis y exclamaciones; endurece muletillas.
2
+ rules:
3
+ lexico/muletillas-ia: error
4
+ lexico/metaforas-comodin: error
@@ -0,0 +1,5 @@
1
+ # Perfil readme: texto de proyecto para quien lo va a leer dos minutos.
2
+ rules:
3
+ formato/negrita-abre-parrafo: warning
4
+ formato/sentencia-dos-puntos: warning
5
+ lexico/honestidad-anunciada: warning
@@ -0,0 +1,6 @@
1
+ # Perfil redes: publicaciones personales. Frases muy cortas y varias seguidas son lo normal; tolera emojis y exclamaciones.
2
+ rules:
3
+ estructura/longitud-uniforme: "off"
4
+ densidad/exclamaciones: "off"
5
+ densidad/emojis: "off"
6
+ retorica/arenga-final: error
@@ -0,0 +1,4 @@
1
+ # Perfil técnico: documentación y manuales. Tolera listas y encabezados estructurados.
2
+ rules:
3
+ formato/encabezado-title-case: info
4
+ estructura/encabezado-dos-puntos: off
@@ -0,0 +1,27 @@
1
+ # Situaciones: la capa de contexto de la humanización (docs/decisions.md, 2026-09-18).
2
+ #
3
+ # Cada situación junta tres cosas:
4
+ # perfil el perfil de reglas con el que se revisa (rules/profiles/<perfil>.yml)
5
+ # guia el principio de su viñeta en la sección «Según la situación» de la guía
6
+ # (integrations/claude-code/guia/humano.md); el gate `situaciones` comprueba que existe
7
+ # archivos los tipos de archivo de texto que le corresponden. Con `--profile auto`, la ruta decide la situación:
8
+ # gana la primera que coincide. Un archivo que no coincide con ninguna no se revisa con `auto`.
9
+ #
10
+ # Los overrides de textoneitor.yml siguen mandando sobre esto.
11
+ schema_version: 1
12
+ situaciones:
13
+ - id: chat
14
+ perfil: chat
15
+ guia: "Conversación"
16
+ - id: correo
17
+ perfil: correo
18
+ guia: "Correo"
19
+ archivos: ["**/correo*.{md,txt}", "**/*.correo.md", "**/correos/**/*.{md,txt}"]
20
+ - id: readme
21
+ perfil: readme
22
+ guia: "README y textos de un proyecto"
23
+ archivos: ["**/README*.md", "**/CHANGELOG*.md", "**/CONTRIBUTING*.md", "**/docs/**/*.md"]
24
+ - id: redes
25
+ perfil: redes
26
+ guia: "Redes"
27
+ archivos: ["**/*.post.md", "**/redes/**/*.{md,txt}"]
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://textoneitor/schemas/rule.schema.json",
4
+ "title": "Definición de regla del linter",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version", "id", "revision", "status", "title", "summary", "category", "scope", "detector",
9
+ "conditions", "default_level", "score", "message", "explanation", "rewrite_guidance", "examples", "provenance"
10
+ ],
11
+ "properties": {
12
+ "schema_version": { "const": 1 },
13
+ "id": { "type": "string", "pattern": "^(lexico|estructura|repeticion|densidad|retorica|formato)/[a-z0-9]+(-[a-z0-9]+)*$" },
14
+ "revision": { "type": "integer", "minimum": 1 },
15
+ "status": { "enum": ["draft", "candidate", "stable", "deprecated"] },
16
+ "title": { "type": "string", "minLength": 4, "maxLength": 80 },
17
+ "summary": { "type": "string", "minLength": 10, "maxLength": 300 },
18
+ "category": { "enum": ["lexico", "estructura", "repeticion", "densidad", "retorica", "formato"] },
19
+ "scope": { "enum": ["sentence", "paragraph", "document", "block"] },
20
+ "detector": { "enum": ["regex", "lexicon", "sequence", "density", "repetition", "structure", "cooccurrence"] },
21
+ "conditions": { "type": "object" },
22
+ "exceptions": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "properties": {
26
+ "patterns": { "type": "array", "items": { "type": "string", "minLength": 1 } },
27
+ "lexicon": { "type": "string" }
28
+ }
29
+ },
30
+ "default_level": { "enum": ["off", "info", "warning", "error"] },
31
+ "score": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": ["weight", "cap"],
35
+ "properties": {
36
+ "weight": { "type": "number", "minimum": 0, "maximum": 10 },
37
+ "cap": { "type": "number", "minimum": 1, "maximum": 10 }
38
+ }
39
+ },
40
+ "message": { "type": "string", "minLength": 10, "maxLength": 200 },
41
+ "explanation": { "type": "string", "minLength": 20 },
42
+ "rewrite_guidance": { "type": "string", "minLength": 10 },
43
+ "examples": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": ["positive", "negative"],
47
+ "properties": {
48
+ "positive": { "type": "array", "items": { "$ref": "#/definitions/example" } },
49
+ "negative": { "type": "array", "items": { "$ref": "#/definitions/example" } }
50
+ }
51
+ },
52
+ "provenance": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["evidence", "known_false_positives", "reviewed_by"],
56
+ "properties": {
57
+ "evidence": { "type": "string", "minLength": 1 },
58
+ "known_false_positives": { "type": "array", "items": { "type": "string" } },
59
+ "reviewed_by": { "type": "array", "items": { "type": "string" } }
60
+ }
61
+ },
62
+ "profiles": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "properties": {
66
+ "general": { "enum": ["off", "info", "warning", "error"] },
67
+ "tecnico": { "enum": ["off", "info", "warning", "error"] },
68
+ "academico": { "enum": ["off", "info", "warning", "error"] },
69
+ "marketing": { "enum": ["off", "info", "warning", "error"] },
70
+ "chat": { "enum": ["off", "info", "warning", "error"] },
71
+ "correo": { "enum": ["off", "info", "warning", "error"] },
72
+ "readme": { "enum": ["off", "info", "warning", "error"] },
73
+ "redes": { "enum": ["off", "info", "warning", "error"] }
74
+ }
75
+ }
76
+ },
77
+ "definitions": {
78
+ "example": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": ["text", "expect"],
82
+ "properties": {
83
+ "text": { "type": "string", "minLength": 1 },
84
+ "expect": { "type": "integer", "minimum": 0 },
85
+ "format": { "enum": ["text", "markdown"] },
86
+ "note": { "type": "string" }
87
+ }
88
+ }
89
+ }
90
+ }