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.
- package/LICENSE +101 -0
- package/LICENSE-AGPL-3.0 +661 -0
- package/README.md +69 -2
- package/dist/api/index.d.ts +34 -0
- package/dist/api/index.js +98 -0
- package/dist/baseline/index.d.ts +20 -0
- package/dist/baseline/index.js +81 -0
- package/dist/bundle/dist/cli.mjs +29893 -0
- package/dist/bundle/package.json +6 -0
- package/dist/bundle/rulepack/rulepack.json +1496 -0
- package/dist/bundle/rules/situaciones.yml +27 -0
- package/dist/cli/benchmark.d.ts +89 -0
- package/dist/cli/benchmark.js +185 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +377 -0
- package/dist/config/core.d.ts +55 -0
- package/dist/config/core.js +244 -0
- package/dist/config/glob.d.ts +2 -0
- package/dist/config/glob.js +72 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.js +38 -0
- package/dist/config/situaciones.d.ts +17 -0
- package/dist/config/situaciones.js +43 -0
- package/dist/contracts/index.d.ts +238 -0
- package/dist/contracts/index.js +4 -0
- package/dist/document/index.d.ts +10 -0
- package/dist/document/index.js +70 -0
- package/dist/document/text.d.ts +22 -0
- package/dist/document/text.js +91 -0
- package/dist/document/tokenize.d.ts +4 -0
- package/dist/document/tokenize.js +59 -0
- package/dist/markdown/index.d.ts +7 -0
- package/dist/markdown/index.js +178 -0
- package/dist/paths.d.ts +4 -0
- package/dist/paths.js +14 -0
- package/dist/reporters/index.d.ts +29 -0
- package/dist/reporters/index.js +182 -0
- package/dist/rules/compiler/build.d.ts +1 -0
- package/dist/rules/compiler/build.js +46 -0
- package/dist/rules/compiler/index.d.ts +40 -0
- package/dist/rules/compiler/index.js +343 -0
- package/dist/rules/compiler/safety.d.ts +16 -0
- package/dist/rules/compiler/safety.js +124 -0
- package/dist/rules/detectors/index.d.ts +4 -0
- package/dist/rules/detectors/index.js +651 -0
- package/dist/rules/detectors/shared.d.ts +30 -0
- package/dist/rules/detectors/shared.js +87 -0
- package/dist/rules/runtime/index.d.ts +17 -0
- package/dist/rules/runtime/index.js +74 -0
- package/dist/runner/index.d.ts +18 -0
- package/dist/runner/index.js +176 -0
- package/dist/runner/lint-text.d.ts +19 -0
- package/dist/runner/lint-text.js +20 -0
- package/dist/scoring/index.d.ts +16 -0
- package/dist/scoring/index.js +41 -0
- package/dist/suppressions/index.d.ts +23 -0
- package/dist/suppressions/index.js +86 -0
- package/dist/web/engine.meta.json +1 -0
- package/dist/web/engine.mjs +11029 -0
- package/dist/web/index.d.ts +39 -0
- package/dist/web/index.js +37 -0
- package/dist/web/node-crypto-shim.d.ts +9 -0
- package/dist/web/node-crypto-shim.js +24 -0
- package/dist/web/sha256.d.ts +11 -0
- package/dist/web/sha256.js +89 -0
- package/package.json +88 -4
- package/rulepack/rulepack.json +1496 -0
- package/rules/profiles/academico.yml +4 -0
- package/rules/profiles/chat.yml +4 -0
- package/rules/profiles/correo.yml +3 -0
- package/rules/profiles/general.yml +2 -0
- package/rules/profiles/marketing.yml +4 -0
- package/rules/profiles/readme.yml +5 -0
- package/rules/profiles/redes.yml +6 -0
- package/rules/profiles/tecnico.yml +4 -0
- package/rules/situaciones.yml +27 -0
- package/schemas/rule.schema.json +90 -0
|
@@ -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
|
+
}
|