vigiles 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.json +46 -0
- package/.claude/settings.local.json +8 -0
- package/.claude-plugin/hooks/post-edit.sh +34 -0
- package/.claude-plugin/hooks/pre-edit.sh +40 -0
- package/.claude-plugin/hooks/session-start.sh +38 -0
- package/.claude-plugin/marketplace.json +14 -0
- package/.claude-plugin/plugin.json +47 -0
- package/.github/workflows/ci.yml +81 -0
- package/.prettierignore +1 -0
- package/.vigiles/generated.d.ts +205 -0
- package/CLAUDE.md +95 -0
- package/CLAUDE.md.spec.ts +142 -0
- package/CONTRIBUTING.md +121 -0
- package/LICENSE +21 -0
- package/README.md +377 -0
- package/action.yml +25 -0
- package/dist/action.d.ts +7 -0
- package/dist/action.d.ts.map +1 -0
- package/dist/action.js +180 -0
- package/dist/action.js.map +1 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1267 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.test.d.ts +2 -0
- package/dist/cli.test.d.ts.map +1 -0
- package/dist/cli.test.js +650 -0
- package/dist/cli.test.js.map +1 -0
- package/dist/compile.d.ts +101 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +503 -0
- package/dist/compile.js.map +1 -0
- package/dist/evolve.d.ts +132 -0
- package/dist/evolve.d.ts.map +1 -0
- package/dist/evolve.js +599 -0
- package/dist/evolve.js.map +1 -0
- package/dist/freshness.d.ts +67 -0
- package/dist/freshness.d.ts.map +1 -0
- package/dist/freshness.js +244 -0
- package/dist/freshness.js.map +1 -0
- package/dist/freshness.test.d.ts +2 -0
- package/dist/freshness.test.d.ts.map +1 -0
- package/dist/freshness.test.js +356 -0
- package/dist/freshness.test.js.map +1 -0
- package/dist/generate-types.d.ts +34 -0
- package/dist/generate-types.d.ts.map +1 -0
- package/dist/generate-types.js +381 -0
- package/dist/generate-types.js.map +1 -0
- package/dist/inline.d.ts +58 -0
- package/dist/inline.d.ts.map +1 -0
- package/dist/inline.js +142 -0
- package/dist/inline.js.map +1 -0
- package/dist/inline.test.d.ts +5 -0
- package/dist/inline.test.d.ts.map +1 -0
- package/dist/inline.test.js +152 -0
- package/dist/inline.test.js.map +1 -0
- package/dist/linters.d.ts +38 -0
- package/dist/linters.d.ts.map +1 -0
- package/dist/linters.js +588 -0
- package/dist/linters.js.map +1 -0
- package/dist/proofs.d.ts +272 -0
- package/dist/proofs.d.ts.map +1 -0
- package/dist/proofs.js +622 -0
- package/dist/proofs.js.map +1 -0
- package/dist/proofs.test.d.ts +9 -0
- package/dist/proofs.test.d.ts.map +1 -0
- package/dist/proofs.test.js +952 -0
- package/dist/proofs.test.js.map +1 -0
- package/dist/spec.d.ts +258 -0
- package/dist/spec.d.ts.map +1 -0
- package/dist/spec.js +113 -0
- package/dist/spec.js.map +1 -0
- package/dist/spec.test.d.ts +2 -0
- package/dist/spec.test.d.ts.map +1 -0
- package/dist/spec.test.js +1222 -0
- package/dist/spec.test.js.map +1 -0
- package/dist/types.d.ts +101 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/validate.d.ts +10 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +286 -0
- package/dist/validate.js.map +1 -0
- package/dist/validate.test.d.ts +2 -0
- package/dist/validate.test.d.ts.map +1 -0
- package/dist/validate.test.js +531 -0
- package/dist/validate.test.js.map +1 -0
- package/docs/agent-setup.md +85 -0
- package/docs/agent-workflows.md +103 -0
- package/docs/comparison.md +71 -0
- package/docs/freshness.md +124 -0
- package/docs/inline-mode.md +119 -0
- package/docs/linter-support.md +166 -0
- package/docs/spec-format.md +194 -0
- package/eslint.config.mjs +79 -0
- package/examples/CLAUDE.md +54 -0
- package/examples/CLAUDE.md.spec.ts +65 -0
- package/examples/SKILL.md +50 -0
- package/examples/SKILL.md.spec.ts +57 -0
- package/fixtures/example-project/CLAUDE.md +11 -0
- package/fixtures/example-project/package.json +9 -0
- package/fixtures/example-project/src/index.ts +3 -0
- package/fixtures/example-project/src/utils.test.ts +2 -0
- package/fixtures/example-project/src/utils.ts +3 -0
- package/logo.png +0 -0
- package/package.json +42 -0
- package/research/adoption-strategy.md +111 -0
- package/research/agent-integration.md +145 -0
- package/research/ai-code-quality.md +197 -0
- package/research/code-search-for-agents.md +313 -0
- package/research/competitive-landscape.md +163 -0
- package/research/doc-freshness.md +516 -0
- package/research/executable-specs.md +368 -0
- package/research/feature-ideas.md +464 -0
- package/research/formal-proofs-for-agents.md +338 -0
- package/research/fp-for-agent-harness.md +150 -0
- package/research/fp-for-deterministic-ai.md +131 -0
- package/research/self-evolving-specs.md +298 -0
- package/schemas/claude-md-strict.yml +18 -0
- package/schemas/claude-md.yml +6 -0
- package/schemas/skill-strict.yml +12 -0
- package/schemas/skill.yml +5 -0
- package/skills/audit-feedback-loop/SKILL.md +76 -0
- package/skills/edit-spec/SKILL.md +131 -0
- package/skills/enforce-rules-format/SKILL.md +71 -0
- package/skills/generate-logo/SKILL.md +102 -0
- package/skills/generate-rule/SKILL.md +90 -0
- package/skills/linter-docs/clippy.md +241 -0
- package/skills/linter-docs/eslint.md +384 -0
- package/skills/linter-docs/pylint.md +288 -0
- package/skills/linter-docs/rubocop.md +277 -0
- package/skills/linter-docs/ruff.md +187 -0
- package/skills/linter-docs/stylelint.md +247 -0
- package/skills/migrate-to-spec/SKILL.md +124 -0
- package/skills/pr-to-lint-rule/SKILL.md +97 -0
- package/skills/strengthen/SKILL.md +168 -0
- package/src/action.ts +214 -0
- package/src/cli.test.ts +914 -0
- package/src/cli.ts +1631 -0
- package/src/compile.ts +691 -0
- package/src/evolve.ts +781 -0
- package/src/freshness.test.ts +449 -0
- package/src/freshness.ts +299 -0
- package/src/generate-types.ts +448 -0
- package/src/inline.test.ts +206 -0
- package/src/inline.ts +164 -0
- package/src/linters.ts +739 -0
- package/src/proofs.test.ts +1314 -0
- package/src/proofs.ts +849 -0
- package/src/spec.test.ts +1471 -0
- package/src/spec.ts +427 -0
- package/src/types.ts +117 -0
- package/src/validate.test.ts +701 -0
- package/src/validate.ts +381 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* vigiles generate-types — emit .d.ts with type unions from actual project state.
|
|
4
|
+
*
|
|
5
|
+
* Scans linter configs, package.json, and filesystem to generate TypeScript
|
|
6
|
+
* types that the compiler uses to PROVE references are valid at authoring time.
|
|
7
|
+
*
|
|
8
|
+
* Generated types:
|
|
9
|
+
* - EslintRule / StylelintRule / RuffRule / ... — enabled rules per linter
|
|
10
|
+
* - NpmScript — scripts from package.json
|
|
11
|
+
* - ProjectFile — files in the project (scoped to src/ by default)
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.generateTypes = generateTypes;
|
|
15
|
+
const node_fs_1 = require("node:fs");
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const node_child_process_1 = require("node:child_process");
|
|
18
|
+
const glob_1 = require("glob");
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Linter config detection
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
function fileContainsSection(filePath, section) {
|
|
23
|
+
if (!(0, node_fs_1.existsSync)(filePath))
|
|
24
|
+
return false;
|
|
25
|
+
try {
|
|
26
|
+
return (0, node_fs_1.readFileSync)(filePath, "utf-8").includes(section);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function hasRuffConfig(basePath) {
|
|
33
|
+
return ((0, node_fs_1.existsSync)((0, node_path_1.resolve)(basePath, "ruff.toml")) ||
|
|
34
|
+
(0, node_fs_1.existsSync)((0, node_path_1.resolve)(basePath, ".ruff.toml")) ||
|
|
35
|
+
fileContainsSection((0, node_path_1.resolve)(basePath, "pyproject.toml"), "[tool.ruff"));
|
|
36
|
+
}
|
|
37
|
+
function hasPylintConfig(basePath) {
|
|
38
|
+
return ((0, node_fs_1.existsSync)((0, node_path_1.resolve)(basePath, ".pylintrc")) ||
|
|
39
|
+
(0, node_fs_1.existsSync)((0, node_path_1.resolve)(basePath, "pylintrc")) ||
|
|
40
|
+
fileContainsSection((0, node_path_1.resolve)(basePath, "pyproject.toml"), "[tool.pylint") ||
|
|
41
|
+
fileContainsSection((0, node_path_1.resolve)(basePath, "setup.cfg"), "[pylint"));
|
|
42
|
+
}
|
|
43
|
+
function hasRubocopConfig(basePath) {
|
|
44
|
+
return (0, node_fs_1.existsSync)((0, node_path_1.resolve)(basePath, ".rubocop.yml"));
|
|
45
|
+
}
|
|
46
|
+
function discoverEslintRules(basePath) {
|
|
47
|
+
try {
|
|
48
|
+
const script = `
|
|
49
|
+
const { loadESLint } = require("eslint");
|
|
50
|
+
(async () => {
|
|
51
|
+
try {
|
|
52
|
+
const ESLint = await loadESLint();
|
|
53
|
+
const eslint = new ESLint({ cwd: ${JSON.stringify(basePath)} });
|
|
54
|
+
const config = await eslint.calculateConfigForFile("dummy.js");
|
|
55
|
+
const enabled = Object.entries(config.rules || {})
|
|
56
|
+
.filter(([, v]) => {
|
|
57
|
+
const sev = Array.isArray(v) ? v[0] : v;
|
|
58
|
+
return sev !== 0 && sev !== "off";
|
|
59
|
+
})
|
|
60
|
+
.map(([k]) => k);
|
|
61
|
+
console.log(JSON.stringify(enabled));
|
|
62
|
+
} catch(e) {
|
|
63
|
+
console.log("[]");
|
|
64
|
+
}
|
|
65
|
+
})();
|
|
66
|
+
`;
|
|
67
|
+
const output = (0, node_child_process_1.execSync)(`node -e '${script.replace(/'/g, "'\\''")}'`, {
|
|
68
|
+
encoding: "utf-8",
|
|
69
|
+
cwd: basePath,
|
|
70
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
71
|
+
timeout: 15000,
|
|
72
|
+
});
|
|
73
|
+
const rules = JSON.parse(output.trim() || "[]");
|
|
74
|
+
if (rules.length === 0)
|
|
75
|
+
return null;
|
|
76
|
+
return { linter: "eslint", rules, via: "flat config" };
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function discoverStylelintRules(basePath) {
|
|
83
|
+
try {
|
|
84
|
+
const script = `
|
|
85
|
+
const stylelint = require("stylelint");
|
|
86
|
+
(async () => {
|
|
87
|
+
try {
|
|
88
|
+
const linter = stylelint.createLinter({});
|
|
89
|
+
const result = await linter.getConfigForFile(${JSON.stringify((0, node_path_1.resolve)(basePath, "dummy.css"))});
|
|
90
|
+
const enabled = Object.entries(result.config.rules || {})
|
|
91
|
+
.filter(([, v]) => v !== null && !(Array.isArray(v) && v[0] === null))
|
|
92
|
+
.map(([k]) => k);
|
|
93
|
+
console.log(JSON.stringify(enabled));
|
|
94
|
+
} catch(e) {
|
|
95
|
+
console.log("[]");
|
|
96
|
+
}
|
|
97
|
+
})();
|
|
98
|
+
`;
|
|
99
|
+
const output = (0, node_child_process_1.execSync)(`node -e '${script.replace(/'/g, "'\\''")}'`, {
|
|
100
|
+
encoding: "utf-8",
|
|
101
|
+
cwd: basePath,
|
|
102
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
103
|
+
timeout: 15000,
|
|
104
|
+
});
|
|
105
|
+
const rules = JSON.parse(output.trim() || "[]");
|
|
106
|
+
if (rules.length === 0)
|
|
107
|
+
return null;
|
|
108
|
+
return { linter: "stylelint", rules, via: "config" };
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function discoverRuffRules(basePath) {
|
|
115
|
+
try {
|
|
116
|
+
if (!hasRuffConfig(basePath))
|
|
117
|
+
return null;
|
|
118
|
+
(0, node_child_process_1.execSync)("which ruff", { stdio: "ignore" });
|
|
119
|
+
const dummyPath = (0, node_path_1.resolve)(basePath, "dummy.py");
|
|
120
|
+
const output = (0, node_child_process_1.execSync)(`ruff check --show-settings ${dummyPath}`, {
|
|
121
|
+
encoding: "utf-8",
|
|
122
|
+
cwd: basePath,
|
|
123
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
124
|
+
timeout: 10000,
|
|
125
|
+
});
|
|
126
|
+
const enabledMatch = output.match(/linter\.rules\.enabled\s*=\s*\[([\s\S]*?)\]/);
|
|
127
|
+
const rules = [];
|
|
128
|
+
if (enabledMatch?.[1]) {
|
|
129
|
+
const codeRe = /\(([A-Z]+\d*)\)/g;
|
|
130
|
+
let m;
|
|
131
|
+
while ((m = codeRe.exec(enabledMatch[1])) !== null) {
|
|
132
|
+
rules.push(m[1]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (rules.length === 0)
|
|
136
|
+
return null;
|
|
137
|
+
return { linter: "ruff", rules, via: "CLI" };
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function discoverPylintRules(basePath) {
|
|
144
|
+
try {
|
|
145
|
+
if (!hasPylintConfig(basePath))
|
|
146
|
+
return null;
|
|
147
|
+
(0, node_child_process_1.execSync)("which pylint", { stdio: "ignore" });
|
|
148
|
+
const output = (0, node_child_process_1.execSync)("pylint --list-msgs-enabled", {
|
|
149
|
+
encoding: "utf-8",
|
|
150
|
+
cwd: basePath,
|
|
151
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
152
|
+
timeout: 15000,
|
|
153
|
+
});
|
|
154
|
+
const disabledIdx = output.indexOf("Disabled messages:");
|
|
155
|
+
const enabledSection = disabledIdx >= 0 ? output.substring(0, disabledIdx) : output;
|
|
156
|
+
// Extract rule IDs like (C0114), (W0611) etc.
|
|
157
|
+
const rules = [];
|
|
158
|
+
const idRe = /\(([A-Z]\d{4})\)/g;
|
|
159
|
+
let m;
|
|
160
|
+
while ((m = idRe.exec(enabledSection)) !== null) {
|
|
161
|
+
rules.push(m[1]);
|
|
162
|
+
}
|
|
163
|
+
// Also extract symbolic names like "missing-module-docstring"
|
|
164
|
+
const nameRe = /^(\w[\w-]+)\s*\(/gm;
|
|
165
|
+
while ((m = nameRe.exec(enabledSection)) !== null) {
|
|
166
|
+
rules.push(m[1]);
|
|
167
|
+
}
|
|
168
|
+
if (rules.length === 0)
|
|
169
|
+
return null;
|
|
170
|
+
return { linter: "pylint", rules, via: "CLI" };
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function discoverRubocopRules(basePath) {
|
|
177
|
+
try {
|
|
178
|
+
if (!hasRubocopConfig(basePath))
|
|
179
|
+
return null;
|
|
180
|
+
(0, node_child_process_1.execSync)("which rubocop", { stdio: "ignore" });
|
|
181
|
+
const output = (0, node_child_process_1.execSync)("rubocop --list-target-files --show-cops 2>/dev/null | head -500", {
|
|
182
|
+
encoding: "utf-8",
|
|
183
|
+
cwd: basePath,
|
|
184
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
185
|
+
timeout: 15000,
|
|
186
|
+
shell: "/bin/sh",
|
|
187
|
+
});
|
|
188
|
+
const rules = [];
|
|
189
|
+
const copRe = /^(\w+\/\w+):/gm;
|
|
190
|
+
let m;
|
|
191
|
+
while ((m = copRe.exec(output)) !== null) {
|
|
192
|
+
rules.push(m[1]);
|
|
193
|
+
}
|
|
194
|
+
if (rules.length === 0)
|
|
195
|
+
return null;
|
|
196
|
+
return { linter: "rubocop", rules, via: "CLI" };
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function discoverClippyRules(basePath) {
|
|
203
|
+
try {
|
|
204
|
+
const cargoPath = (0, node_path_1.resolve)(basePath, "Cargo.toml");
|
|
205
|
+
if (!(0, node_fs_1.existsSync)(cargoPath))
|
|
206
|
+
return null;
|
|
207
|
+
(0, node_child_process_1.execSync)("which cargo", { stdio: "ignore" });
|
|
208
|
+
// Clippy doesn't have a good "list enabled lints" command.
|
|
209
|
+
// We read Cargo.toml [lints.clippy] section for explicit config,
|
|
210
|
+
// and include default warn/deny lints from clippy -W clippy::all
|
|
211
|
+
const content = (0, node_fs_1.readFileSync)(cargoPath, "utf-8");
|
|
212
|
+
const sectionMatch = content.match(/\[lints\.clippy\]([\s\S]*?)(?=\n\[|$)/);
|
|
213
|
+
const rules = [];
|
|
214
|
+
if (sectionMatch?.[1]) {
|
|
215
|
+
const ruleRe = /^(\w[\w-]+)\s*=\s*"(\w+)"/gm;
|
|
216
|
+
let m;
|
|
217
|
+
while ((m = ruleRe.exec(sectionMatch[1])) !== null) {
|
|
218
|
+
if (m[2] !== "allow") {
|
|
219
|
+
rules.push(m[1]);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (rules.length === 0)
|
|
224
|
+
return null;
|
|
225
|
+
return { linter: "clippy", rules, via: "Cargo.toml" };
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
// NPM script discovery
|
|
233
|
+
// ---------------------------------------------------------------------------
|
|
234
|
+
function discoverNpmScripts(basePath) {
|
|
235
|
+
const pkgPath = (0, node_path_1.resolve)(basePath, "package.json");
|
|
236
|
+
if (!(0, node_fs_1.existsSync)(pkgPath))
|
|
237
|
+
return [];
|
|
238
|
+
try {
|
|
239
|
+
const pkg = JSON.parse((0, node_fs_1.readFileSync)(pkgPath, "utf-8"));
|
|
240
|
+
return Object.keys(pkg.scripts ?? {});
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
return [];
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
// Project file discovery
|
|
248
|
+
// ---------------------------------------------------------------------------
|
|
249
|
+
function discoverProjectFiles(basePath, globs = ["src/**/*"]) {
|
|
250
|
+
const files = [];
|
|
251
|
+
for (const pattern of globs) {
|
|
252
|
+
const matches = (0, glob_1.globSync)(pattern, {
|
|
253
|
+
cwd: basePath,
|
|
254
|
+
ignore: ["node_modules/**", "dist/**", ".git/**"],
|
|
255
|
+
nodir: true,
|
|
256
|
+
});
|
|
257
|
+
files.push(...matches);
|
|
258
|
+
}
|
|
259
|
+
return [...new Set(files)].sort();
|
|
260
|
+
}
|
|
261
|
+
// ---------------------------------------------------------------------------
|
|
262
|
+
// Type generation
|
|
263
|
+
// ---------------------------------------------------------------------------
|
|
264
|
+
function escapeForUnion(s) {
|
|
265
|
+
return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
266
|
+
}
|
|
267
|
+
function formatUnion(items, indent = " ") {
|
|
268
|
+
if (items.length === 0)
|
|
269
|
+
return "never";
|
|
270
|
+
if (items.length <= 3) {
|
|
271
|
+
return items.map((i) => `"${escapeForUnion(i)}"`).join(" | ");
|
|
272
|
+
}
|
|
273
|
+
return ("\n" + items.map((i) => `${indent}| "${escapeForUnion(i)}"`).join("\n"));
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Generate .d.ts content with type unions from actual project state.
|
|
277
|
+
*
|
|
278
|
+
* Scans all available linters, package.json scripts, and project files.
|
|
279
|
+
*/
|
|
280
|
+
function generateTypes(options = {}) {
|
|
281
|
+
const basePath = options.basePath ?? process.cwd();
|
|
282
|
+
const fileGlobs = options.fileGlobs ?? ["src/**/*"];
|
|
283
|
+
// Discover everything
|
|
284
|
+
const linters = [];
|
|
285
|
+
const eslint = discoverEslintRules(basePath);
|
|
286
|
+
if (eslint)
|
|
287
|
+
linters.push(eslint);
|
|
288
|
+
const stylelint = discoverStylelintRules(basePath);
|
|
289
|
+
if (stylelint)
|
|
290
|
+
linters.push(stylelint);
|
|
291
|
+
const ruff = discoverRuffRules(basePath);
|
|
292
|
+
if (ruff)
|
|
293
|
+
linters.push(ruff);
|
|
294
|
+
const pylint = discoverPylintRules(basePath);
|
|
295
|
+
if (pylint)
|
|
296
|
+
linters.push(pylint);
|
|
297
|
+
const rubocop = discoverRubocopRules(basePath);
|
|
298
|
+
if (rubocop)
|
|
299
|
+
linters.push(rubocop);
|
|
300
|
+
const clippy = discoverClippyRules(basePath);
|
|
301
|
+
if (clippy)
|
|
302
|
+
linters.push(clippy);
|
|
303
|
+
const scripts = discoverNpmScripts(basePath);
|
|
304
|
+
const files = discoverProjectFiles(basePath, fileGlobs);
|
|
305
|
+
// Generate .d.ts
|
|
306
|
+
const sections = [];
|
|
307
|
+
sections.push(`/**`);
|
|
308
|
+
sections.push(` * Auto-generated by \`vigiles generate-types\`.`);
|
|
309
|
+
sections.push(` * DO NOT EDIT — re-run \`vigiles generate-types\` to update.`);
|
|
310
|
+
sections.push(` */`);
|
|
311
|
+
sections.push(``);
|
|
312
|
+
// ---------------------------------------------------------------------------
|
|
313
|
+
// vigiles/generated — standalone types for direct import
|
|
314
|
+
// ---------------------------------------------------------------------------
|
|
315
|
+
sections.push(`declare module "vigiles/generated" {`);
|
|
316
|
+
// Linter rules
|
|
317
|
+
for (const { linter, rules, via } of linters) {
|
|
318
|
+
const typeName = linter.charAt(0).toUpperCase() +
|
|
319
|
+
linter.slice(1).replace(/-([a-z])/g, (_, c) => c.toUpperCase()) +
|
|
320
|
+
"Rule";
|
|
321
|
+
sections.push(``);
|
|
322
|
+
sections.push(` /** ${String(rules.length)} enabled ${linter} rules (via ${via}). */`);
|
|
323
|
+
sections.push(` export type ${typeName} = ${formatUnion(rules, " ")};`);
|
|
324
|
+
}
|
|
325
|
+
// Combined linter rule type
|
|
326
|
+
if (linters.length > 0) {
|
|
327
|
+
const allNames = linters.map((l) => l.linter.charAt(0).toUpperCase() +
|
|
328
|
+
l.linter
|
|
329
|
+
.slice(1)
|
|
330
|
+
.replace(/-([a-z])/g, (_, c) => c.toUpperCase()) +
|
|
331
|
+
"Rule");
|
|
332
|
+
sections.push(``);
|
|
333
|
+
sections.push(` /** All enabled linter rules across all detected linters. */`);
|
|
334
|
+
sections.push(` export type LinterRule = ${allNames.join(" | ")};`);
|
|
335
|
+
}
|
|
336
|
+
// NPM scripts
|
|
337
|
+
if (scripts.length > 0) {
|
|
338
|
+
sections.push(``);
|
|
339
|
+
sections.push(` /** ${String(scripts.length)} npm scripts from package.json. */`);
|
|
340
|
+
sections.push(` export type NpmScript = ${formatUnion(scripts, " ")};`);
|
|
341
|
+
}
|
|
342
|
+
// Project files
|
|
343
|
+
if (files.length > 0) {
|
|
344
|
+
sections.push(``);
|
|
345
|
+
sections.push(` /** ${String(files.length)} project files. */`);
|
|
346
|
+
sections.push(` export type ProjectFile = ${formatUnion(files, " ")};`);
|
|
347
|
+
}
|
|
348
|
+
sections.push(`}`);
|
|
349
|
+
// ---------------------------------------------------------------------------
|
|
350
|
+
// vigiles/spec augmentation — populates KnownLinterRules, KnownProjectFiles,
|
|
351
|
+
// KnownNpmScripts interfaces so enforce(), file(), cmd() narrow automatically.
|
|
352
|
+
// ---------------------------------------------------------------------------
|
|
353
|
+
sections.push(``);
|
|
354
|
+
sections.push(`declare module "vigiles/spec" {`);
|
|
355
|
+
if (linters.length > 0) {
|
|
356
|
+
sections.push(` interface KnownLinterRules {`);
|
|
357
|
+
for (const { linter, rules } of linters) {
|
|
358
|
+
sections.push(` "${escapeForUnion(linter)}": ${formatUnion(rules, " ")};`);
|
|
359
|
+
}
|
|
360
|
+
sections.push(` }`);
|
|
361
|
+
}
|
|
362
|
+
if (files.length > 0) {
|
|
363
|
+
sections.push(` interface KnownProjectFiles {`);
|
|
364
|
+
sections.push(` files: ${formatUnion(files, " ")};`);
|
|
365
|
+
sections.push(` }`);
|
|
366
|
+
}
|
|
367
|
+
if (scripts.length > 0) {
|
|
368
|
+
sections.push(` interface KnownNpmScripts {`);
|
|
369
|
+
sections.push(` scripts: ${formatUnion(scripts, " ")};`);
|
|
370
|
+
sections.push(` }`);
|
|
371
|
+
}
|
|
372
|
+
sections.push(`}`);
|
|
373
|
+
sections.push(``);
|
|
374
|
+
return {
|
|
375
|
+
dts: sections.join("\n"),
|
|
376
|
+
linters,
|
|
377
|
+
scripts,
|
|
378
|
+
files,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
//# sourceMappingURL=generate-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-types.js","sourceRoot":"","sources":["../src/generate-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAgTH,sCAqIC;AAnbD,qCAAmD;AACnD,yCAAoC;AACpC,2DAA8C;AAC9C,+BAAgC;AAEhC,8EAA8E;AAC9E,0BAA0B;AAC1B,8EAA8E;AAE9E,SAAS,mBAAmB,CAAC,QAAgB,EAAE,OAAe;IAC5D,IAAI,CAAC,IAAA,oBAAU,EAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,IAAI,CAAC;QACH,OAAO,IAAA,sBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,CACL,IAAA,oBAAU,EAAC,IAAA,mBAAO,EAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC1C,IAAA,oBAAU,EAAC,IAAA,mBAAO,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC3C,mBAAmB,CAAC,IAAA,mBAAO,EAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE,YAAY,CAAC,CACvE,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,QAAgB;IACvC,OAAO,CACL,IAAA,oBAAU,EAAC,IAAA,mBAAO,EAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC1C,IAAA,oBAAU,EAAC,IAAA,mBAAO,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;Q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AQ,CAAC,GAAG,CAAC,CAAC;QAC7D,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,QAAQ,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QAC/C,QAAQ,CAAC,IAAI,CAAC,gBAAgB,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;QACjE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAElB,OAAO;QACL,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QACxB,OAAO;QACP,OAAO;QACP,KAAK;KACN,CAAC;AACJ,CAAC"}
|
package/dist/inline.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vigiles — Inline rule mode for gradual adoption.
|
|
3
|
+
*
|
|
4
|
+
* Parses `<!-- vigiles:enforce <linter>/<rule> "<why>" -->` HTML comments
|
|
5
|
+
* out of any markdown file, so a project can adopt vigiles one rule at a
|
|
6
|
+
* time without committing to a .spec.ts compile step. Every inline rule
|
|
7
|
+
* goes through the same `checkLinterRule` verification as rules declared
|
|
8
|
+
* in a .spec.ts — typos get closest-match suggestions, disabled rules are
|
|
9
|
+
* flagged, etc.
|
|
10
|
+
*
|
|
11
|
+
* Only `enforce` is supported inline. `guidance` would be a tautology: if
|
|
12
|
+
* you're editing the markdown, the prose around the comment already is
|
|
13
|
+
* the guidance — there's nothing extra for a tool to render.
|
|
14
|
+
*
|
|
15
|
+
* A file is in "inline mode" iff it contains at least one vigiles:enforce
|
|
16
|
+
* comment. Spec mode (`.md.spec.ts` sibling) takes precedence if both
|
|
17
|
+
* exist; the spec compiler emits a fresh file that may overwrite the
|
|
18
|
+
* inline markup, so users should pick one per file.
|
|
19
|
+
*/
|
|
20
|
+
export interface InlineRule {
|
|
21
|
+
/** Linter rule reference, e.g. "eslint/no-console". */
|
|
22
|
+
linterRule: string;
|
|
23
|
+
/** Why this rule is enforced (human-readable, shown in agent context). */
|
|
24
|
+
why: string;
|
|
25
|
+
/** 1-based line number of the comment in the source file. */
|
|
26
|
+
line: number;
|
|
27
|
+
}
|
|
28
|
+
export interface InlineParseResult {
|
|
29
|
+
rules: InlineRule[];
|
|
30
|
+
/** Lines that look like vigiles: markers but failed to parse. */
|
|
31
|
+
errors: {
|
|
32
|
+
line: number;
|
|
33
|
+
message: string;
|
|
34
|
+
raw: string;
|
|
35
|
+
}[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse inline vigiles rules out of a markdown file's contents.
|
|
39
|
+
* Does not touch the filesystem and does not verify the rules against
|
|
40
|
+
* any linter — callers can feed the returned rules into
|
|
41
|
+
* `checkLinterRule` themselves.
|
|
42
|
+
*
|
|
43
|
+
* Lines inside fenced code blocks (``` ... ``` or ~~~ ... ~~~) are
|
|
44
|
+
* skipped so illustrative examples in docs don't get treated as live
|
|
45
|
+
* rules.
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseInlineRules(content: string): InlineParseResult;
|
|
48
|
+
/**
|
|
49
|
+
* True if the content contains at least one parseable vigiles:enforce
|
|
50
|
+
* rule (ignoring fenced code blocks and malformed markers). Used by
|
|
51
|
+
* `require-spec` validation to treat inline mode as spec-equivalent.
|
|
52
|
+
*
|
|
53
|
+
* Deliberately delegates to `parseInlineRules` so a loose prefix regex
|
|
54
|
+
* can't satisfy require-spec with a malformed marker that produces no
|
|
55
|
+
* real enforceable rule.
|
|
56
|
+
*/
|
|
57
|
+
export declare function hasInlineRules(content: string): boolean;
|
|
58
|
+
//# sourceMappingURL=inline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../src/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,UAAU;IACzB,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,iEAAiE;IACjE,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1D;AAoBD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAuFnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
package/dist/inline.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* vigiles — Inline rule mode for gradual adoption.
|
|
4
|
+
*
|
|
5
|
+
* Parses `<!-- vigiles:enforce <linter>/<rule> "<why>" -->` HTML comments
|
|
6
|
+
* out of any markdown file, so a project can adopt vigiles one rule at a
|
|
7
|
+
* time without committing to a .spec.ts compile step. Every inline rule
|
|
8
|
+
* goes through the same `checkLinterRule` verification as rules declared
|
|
9
|
+
* in a .spec.ts — typos get closest-match suggestions, disabled rules are
|
|
10
|
+
* flagged, etc.
|
|
11
|
+
*
|
|
12
|
+
* Only `enforce` is supported inline. `guidance` would be a tautology: if
|
|
13
|
+
* you're editing the markdown, the prose around the comment already is
|
|
14
|
+
* the guidance — there's nothing extra for a tool to render.
|
|
15
|
+
*
|
|
16
|
+
* A file is in "inline mode" iff it contains at least one vigiles:enforce
|
|
17
|
+
* comment. Spec mode (`.md.spec.ts` sibling) takes precedence if both
|
|
18
|
+
* exist; the spec compiler emits a fresh file that may overwrite the
|
|
19
|
+
* inline markup, so users should pick one per file.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.parseInlineRules = parseInlineRules;
|
|
23
|
+
exports.hasInlineRules = hasInlineRules;
|
|
24
|
+
/**
|
|
25
|
+
* Match `<!-- vigiles:enforce <linter>/<rule> "<why>" -->`. The linter
|
|
26
|
+
* reference allows the same characters as the TS-side `SAFE_RULE_NAME_RE`
|
|
27
|
+
* plus `@` for scoped plugin names (e.g. `@typescript-eslint/...`).
|
|
28
|
+
* The `why` is a simple quoted string — if someone wants newlines or
|
|
29
|
+
* embedded quotes, they can move to spec mode.
|
|
30
|
+
*/
|
|
31
|
+
const ENFORCE_RE = /<!--\s*vigiles:enforce\s+([@A-Za-z0-9_/:.-]+)\s+"([^"\n]*)"\s*-->/;
|
|
32
|
+
/**
|
|
33
|
+
* Detects any `<!-- vigiles:<kind> -->` comment (valid or not) so we can
|
|
34
|
+
* surface errors for typos and reserved-but-unrecognized kinds. Uses a
|
|
35
|
+
* non-greedy match for the tail so a `-` inside the kind doesn't short-
|
|
36
|
+
* circuit the pattern.
|
|
37
|
+
*/
|
|
38
|
+
const MARKER_RE = /<!--\s*vigiles:([A-Za-z_-]+)[^]*?-->/;
|
|
39
|
+
/**
|
|
40
|
+
* Parse inline vigiles rules out of a markdown file's contents.
|
|
41
|
+
* Does not touch the filesystem and does not verify the rules against
|
|
42
|
+
* any linter — callers can feed the returned rules into
|
|
43
|
+
* `checkLinterRule` themselves.
|
|
44
|
+
*
|
|
45
|
+
* Lines inside fenced code blocks (``` ... ``` or ~~~ ... ~~~) are
|
|
46
|
+
* skipped so illustrative examples in docs don't get treated as live
|
|
47
|
+
* rules.
|
|
48
|
+
*/
|
|
49
|
+
function parseInlineRules(content) {
|
|
50
|
+
const rules = [];
|
|
51
|
+
const errors = [];
|
|
52
|
+
const lines = content.split("\n");
|
|
53
|
+
let fenceChar = null;
|
|
54
|
+
let fenceLen = 0;
|
|
55
|
+
for (let i = 0; i < lines.length; i++) {
|
|
56
|
+
const line = lines[i];
|
|
57
|
+
// Track fenced code blocks. CommonMark allows ``` or ~~~ fences
|
|
58
|
+
// with 3+ characters; the closing fence must use the same char and
|
|
59
|
+
// have length >= the opening fence's length. Info-string tokens
|
|
60
|
+
// after the opener are allowed.
|
|
61
|
+
const fenceMatch = /^(\s{0,3})(`{3,}|~{3,})(.*)$/.exec(line);
|
|
62
|
+
if (fenceMatch) {
|
|
63
|
+
const marker = fenceMatch[2];
|
|
64
|
+
const ch = marker[0];
|
|
65
|
+
const len = marker.length;
|
|
66
|
+
if (fenceChar === null) {
|
|
67
|
+
fenceChar = ch;
|
|
68
|
+
fenceLen = len;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
else if (ch === fenceChar && len >= fenceLen) {
|
|
72
|
+
// Closing fence — trailing info-string is not allowed per
|
|
73
|
+
// CommonMark; only treat it as a close if the rest of the
|
|
74
|
+
// line is whitespace.
|
|
75
|
+
if (fenceMatch[3].trim() === "") {
|
|
76
|
+
fenceChar = null;
|
|
77
|
+
fenceLen = 0;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (fenceChar !== null) {
|
|
83
|
+
// Inside a code block — ignore any vigiles markers on this line.
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
// Strip inline code spans (backtick-wrapped text) so illustrative
|
|
87
|
+
// markers in prose like `<!-- vigiles:enforce ... -->` don't get
|
|
88
|
+
// parsed. CommonMark opens with N backticks and closes with exactly
|
|
89
|
+
// N, so the backreference handles matching-length spans.
|
|
90
|
+
const scannable = line.replace(/(`+)[\s\S]*?\1/g, (m) => " ".repeat(m.length));
|
|
91
|
+
const enforceMatch = ENFORCE_RE.exec(scannable);
|
|
92
|
+
if (enforceMatch) {
|
|
93
|
+
rules.push({
|
|
94
|
+
linterRule: enforceMatch[1],
|
|
95
|
+
why: enforceMatch[2],
|
|
96
|
+
line: i + 1,
|
|
97
|
+
});
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
// Skip the compiled-file hash header (`<!-- vigiles:sha256:... -->`)
|
|
101
|
+
// entirely — it's not a rule marker and should not be reported.
|
|
102
|
+
if (/<!--\s*vigiles:sha\d+:/.test(scannable))
|
|
103
|
+
continue;
|
|
104
|
+
const markerMatch = MARKER_RE.exec(scannable);
|
|
105
|
+
if (markerMatch) {
|
|
106
|
+
// Looks like a vigiles marker but didn't parse as enforce —
|
|
107
|
+
// surface it so users catch typos like "vigile:enforce" or
|
|
108
|
+
// unquoted why.
|
|
109
|
+
const kind = markerMatch[1];
|
|
110
|
+
if (kind === "enforce") {
|
|
111
|
+
errors.push({
|
|
112
|
+
line: i + 1,
|
|
113
|
+
message: 'Malformed vigiles:enforce — expected `<!-- vigiles:enforce <linter>/<rule> "<why>" -->`',
|
|
114
|
+
raw: line.trim(),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
else if (kind !== "disable" && kind !== "ignore") {
|
|
118
|
+
// `vigiles:disable ...` / `vigiles:ignore ...` are reserved for
|
|
119
|
+
// future disable-comment support; don't complain about them.
|
|
120
|
+
errors.push({
|
|
121
|
+
line: i + 1,
|
|
122
|
+
message: `Unknown vigiles marker "${kind}". Only \`vigiles:enforce\` is supported.`,
|
|
123
|
+
raw: line.trim(),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return { rules, errors };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* True if the content contains at least one parseable vigiles:enforce
|
|
132
|
+
* rule (ignoring fenced code blocks and malformed markers). Used by
|
|
133
|
+
* `require-spec` validation to treat inline mode as spec-equivalent.
|
|
134
|
+
*
|
|
135
|
+
* Deliberately delegates to `parseInlineRules` so a loose prefix regex
|
|
136
|
+
* can't satisfy require-spec with a malformed marker that produces no
|
|
137
|
+
* real enforceable rule.
|
|
138
|
+
*/
|
|
139
|
+
function hasInlineRules(content) {
|
|
140
|
+
return parseInlineRules(content).rules.length > 0;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=inline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../src/inline.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;AA6CH,4CAuFC;AAWD,wCAEC;AAhID;;;;;;GAMG;AACH,MAAM,UAAU,GACd,mEAAmE,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,SAAS,GAAG,sCAAsC,CAAC;AAEzD;;;;;;;;;GASG;AACH,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,MAAM,KAAK,GAAiB,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAgC,EAAE,CAAC;IAE/C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,SAAS,GAAqB,IAAI,CAAC;IACvC,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtB,gEAAgE;QAChE,mEAAmE;QACnE,gEAAgE;QAChE,gCAAgC;QAChC,MAAM,UAAU,GAAG,8BAA8B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7B,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAc,CAAC;YAClC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;YAC1B,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;gBACvB,SAAS,GAAG,EA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