dislop 1.1.0 → 1.1.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/action.yml +17 -2
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/packs/common/artifact-qa/scripts/index.mjs +37 -20
- package/packs/en/prose/scripts/index.mjs +2 -1
- package/packs/en/web-ui/scripts/index.mjs +8 -1
- package/packs/zh/web-ui/scripts/index.mjs +8 -1
- package/plugin.json +1 -1
- package/server.json +1 -1
- package/skills/dislop/SKILL.md +1 -1
- package/skills/dislop/references/web-ui.md +1 -1
- package/skills/dislop/references/web-ui.zh-CN.md +1 -1
- package/src/commands/doctor.mjs +10 -0
- package/src/kernel/document-model.mjs +174 -8
- package/src/kernel/file-discovery.mjs +7 -0
- package/src/kernel/pack-loader.mjs +8 -2
- package/src/kernel/pipeline.mjs +2 -2
- package/src/kernel/version.mjs +1 -1
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Official dislop plugin marketplace: pure-doc Agent Skill and Official Cloud MCP.",
|
|
9
|
-
"version": "1.1.
|
|
9
|
+
"version": "1.1.2"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "dislop",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Cutting AI slop is real productivity. Pluggable editorial and artifact linter (11 modular Packs across docs, web UI, slides, and Office) via pure-doc Skill, offline CLI, local stdio MCP, and Official Cloud MCP.",
|
|
16
|
-
"version": "1.1.
|
|
16
|
+
"version": "1.1.2",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "dislop-ai",
|
|
19
19
|
"url": "https://dislop.com"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dislop",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Cutting AI slop is real productivity. Pluggable editorial and artifact linter (11 modular Packs across docs, web UI, slides, and Office) via pure-doc Skill, offline CLI, local stdio MCP, and Official Cloud MCP.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "dislop-ai",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dislop",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Cutting AI slop is real productivity. Pluggable editorial and artifact linter (11 modular Packs across docs, web UI, slides, and Office) via pure-doc Skill, offline CLI, local stdio MCP, and Official Cloud MCP.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "dislop-ai",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dislop",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Cutting AI slop is real productivity. Pluggable editorial and artifact linter (11 modular Packs across docs, web UI, slides, and Office) via pure-doc Skill, offline CLI, local stdio MCP, and Official Cloud MCP.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "dislop-ai",
|
package/README.md
CHANGED
|
@@ -370,6 +370,8 @@ Shared repo `.dislop.json` files are isolated under untrusted linter rules (`rou
|
|
|
370
370
|
}
|
|
371
371
|
```
|
|
372
372
|
|
|
373
|
+
A `packs` list inside `overrides` replaces the scenario packs for matching files, while `common/artifact-qa` and the matching `en/artifact-qa` or `zh/artifact-qa` stay enabled (use `extraPacks` to append packs without replacing). Scans from a parent directory, `--changed`, and `--since` skip `.dislop/`; validate project packs with `dislop packs lint .dislop/<name>.pack.md`.
|
|
374
|
+
|
|
373
375
|
User config (`~/.config/dislop/config.json`) holds credentials & providers:
|
|
374
376
|
|
|
375
377
|
```json
|
package/README.zh-CN.md
CHANGED
|
@@ -407,6 +407,8 @@ dislop mcp 启动本地 stdio MCP 服务(亦
|
|
|
407
407
|
}
|
|
408
408
|
```
|
|
409
409
|
|
|
410
|
+
`overrides` 中的 `packs` 会替换匹配文件的场景规则包,但 `common/artifact-qa` 与对应语言的 `en/artifact-qa` 或 `zh/artifact-qa` 始终保留(仅需追加时请用 `extraPacks`)。从父目录扫描以及 `--changed`、`--since` 均会自动跳过 `.dislop/`;校验项目自带规则包请运行 `dislop packs lint .dislop/<name>.pack.md`。
|
|
411
|
+
|
|
410
412
|
个人配置(`~/.config/dislop/config.json`):
|
|
411
413
|
|
|
412
414
|
```json
|
package/action.yml
CHANGED
|
@@ -14,6 +14,14 @@ inputs:
|
|
|
14
14
|
description: "Optional comma-separated Pack names or paths (e.g., `en/prose,common/artifact-qa`)."
|
|
15
15
|
required: false
|
|
16
16
|
default: ""
|
|
17
|
+
fail-on:
|
|
18
|
+
description: "Minimum Defect severity to fail with Exit 1 (`none`, `error`, `warning`)."
|
|
19
|
+
required: false
|
|
20
|
+
default: "error"
|
|
21
|
+
since:
|
|
22
|
+
description: "Optional Git revision (e.g., `origin/main`) to inspect only changed deliverable files."
|
|
23
|
+
required: false
|
|
24
|
+
default: ""
|
|
17
25
|
level:
|
|
18
26
|
description: "Suggestion priority filter (`strong`, `moderate`, `hint`, `all`)."
|
|
19
27
|
required: false
|
|
@@ -44,6 +52,8 @@ runs:
|
|
|
44
52
|
env:
|
|
45
53
|
INPUT_PATHS: ${{ inputs.paths }}
|
|
46
54
|
INPUT_PACK: ${{ inputs.pack }}
|
|
55
|
+
INPUT_FAIL_ON: ${{ inputs.fail-on }}
|
|
56
|
+
INPUT_SINCE: ${{ inputs.since }}
|
|
47
57
|
INPUT_LEVEL: ${{ inputs.level }}
|
|
48
58
|
INPUT_FORMAT: ${{ inputs.format }}
|
|
49
59
|
INPUT_LANG: ${{ inputs.lang }}
|
|
@@ -51,10 +61,13 @@ runs:
|
|
|
51
61
|
ACTION_DIR: ${{ github.action_path }}
|
|
52
62
|
run: |
|
|
53
63
|
set -euo pipefail
|
|
54
|
-
ARGS=("check" "--no-llm" "--level" "${INPUT_LEVEL}" "--format" "${INPUT_FORMAT}" "--lang" "${INPUT_LANG}")
|
|
64
|
+
ARGS=("check" "--no-llm" "--fail-on" "${INPUT_FAIL_ON}" "--level" "${INPUT_LEVEL}" "--format" "${INPUT_FORMAT}" "--lang" "${INPUT_LANG}")
|
|
55
65
|
if [ -n "${INPUT_PACK}" ]; then
|
|
56
66
|
ARGS+=("--pack" "${INPUT_PACK}")
|
|
57
67
|
fi
|
|
68
|
+
if [ -n "${INPUT_SINCE}" ]; then
|
|
69
|
+
ARGS+=("--since" "${INPUT_SINCE}")
|
|
70
|
+
fi
|
|
58
71
|
NONEMPTY_LINES=()
|
|
59
72
|
while IFS= read -r line; do
|
|
60
73
|
trimmed="${line#"${line%%[![:space:]]*}"}"
|
|
@@ -67,7 +80,9 @@ runs:
|
|
|
67
80
|
done
|
|
68
81
|
elif [ "${#NONEMPTY_LINES[@]}" -eq 1 ]; then
|
|
69
82
|
only="${NONEMPTY_LINES[0]}"
|
|
70
|
-
if [ -
|
|
83
|
+
if [ -n "${INPUT_SINCE}" ] && [ "${only}" = "." ]; then
|
|
84
|
+
:
|
|
85
|
+
elif [ -e "${only}" ]; then
|
|
71
86
|
ARGS+=("${only}")
|
|
72
87
|
else
|
|
73
88
|
read -r -a words <<< "${only}"
|
package/gemini-extension.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dislop",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Cutting AI slop is real productivity. Pluggable editorial and artifact linter (11 modular Packs across docs, web UI, slides, and Office) via pure-doc Skill, offline CLI, local stdio MCP, and Official Cloud MCP.",
|
|
5
5
|
"mcpServers": {
|
|
6
6
|
"dislop": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dislop",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Pluggable Editorial & Artifact Linter (Node.js Micro-Kernel) — Dual-track Defect & Suggestion engine with local-first 3-Tier LLM routing, Fact Gate, interactive hunk review, and MCP.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://dislop.com",
|
|
@@ -12,7 +12,20 @@ const CITATION_ARTIFACT_RE =
|
|
|
12
12
|
/(?::contentReference\[oaicite:\d+\](?:\{[^}]*\})?|\[(?:oaicite|turn\d+search\d+|citation):\s*[^\]]+\])/i;
|
|
13
13
|
|
|
14
14
|
const LOCAL_HOME_PATH_RE =
|
|
15
|
-
/(?:file:\/\/\/(?:Users|home|private\/var|[A-Za-z]:)[^\s)"'
|
|
15
|
+
/(?:file:\/\/\/(?:Users|home|private\/var|[A-Za-z]:)[^\s)"'<>`\uFF0C\u3002\u3001\uFF09\uFF1B\uFF1A\u3011\u300D\u300F]*|\/(?:Users|home)\/[A-Za-z0-9._-]+\/[^\s)"'<>`\uFF0C\u3002\u3001\uFF09\uFF1B\uFF1A\u3011\u300D\u300F]*|[A-Za-z]:\\+Users\\[A-Za-z0-9._-]+\\+[^\s)"'<>`\uFF0C\u3002\u3001\uFF09\uFF1B\uFF1A\u3011\u300D\u300F]*)/;
|
|
16
|
+
|
|
17
|
+
const TRAILING_PATH_PUNCT = new Set([
|
|
18
|
+
".", ",", ";", ":", "!", "?", "*", "]", "}",
|
|
19
|
+
"\u2019", "\u201D", "\uFF01", "\uFF1F", "\u300B",
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
function trimTrailingPathPunct(str) {
|
|
23
|
+
let end = str.length;
|
|
24
|
+
while (end > 0 && TRAILING_PATH_PUNCT.has(str[end - 1])) {
|
|
25
|
+
end -= 1;
|
|
26
|
+
}
|
|
27
|
+
return str.slice(0, end);
|
|
28
|
+
}
|
|
16
29
|
|
|
17
30
|
function safeDecodeUriComponent(raw) {
|
|
18
31
|
try {
|
|
@@ -57,6 +70,7 @@ export default definePackScripts({
|
|
|
57
70
|
doc.format,
|
|
58
71
|
);
|
|
59
72
|
const reportedLeaks = new Set();
|
|
73
|
+
const reportedPaths = new Set();
|
|
60
74
|
|
|
61
75
|
for (const seg of doc.segments) {
|
|
62
76
|
const proseOnly = maskInlineCode(seg.text);
|
|
@@ -164,6 +178,7 @@ export default definePackScripts({
|
|
|
164
178
|
const leakKey = `${link.segmentId || "doc"}:${url}`;
|
|
165
179
|
if (!reportedLeaks.has(leakKey)) {
|
|
166
180
|
reportedLeaks.add(leakKey);
|
|
181
|
+
reportedPaths.add(url);
|
|
167
182
|
ctx.reportDefect({
|
|
168
183
|
ruleId: "local-path-leak",
|
|
169
184
|
severity: isRenderedArtifact ? "error" : "warning",
|
|
@@ -180,26 +195,28 @@ export default definePackScripts({
|
|
|
180
195
|
}
|
|
181
196
|
}
|
|
182
197
|
|
|
198
|
+
const globalLeakRe = new RegExp(LOCAL_HOME_PATH_RE.source, "g");
|
|
183
199
|
for (const seg of doc.segments || []) {
|
|
184
|
-
const m
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
for (const m of seg.text.matchAll(globalLeakRe)) {
|
|
201
|
+
const leakedPath = trimTrailingPathPunct(m[0]);
|
|
202
|
+
if (!leakedPath) continue;
|
|
203
|
+
const leakKey = `${seg.id}:${leakedPath}`;
|
|
204
|
+
const alreadyFromLink = reportedPaths.has(leakedPath) || reportedLeaks.has(`${seg.id}:${leakedPath}`);
|
|
205
|
+
if (alreadyFromLink || reportedLeaks.has(leakKey)) continue;
|
|
206
|
+
reportedLeaks.add(leakKey);
|
|
207
|
+
reportedPaths.add(leakedPath);
|
|
208
|
+
ctx.reportDefect({
|
|
209
|
+
ruleId: "local-path-leak",
|
|
210
|
+
severity: isRenderedArtifact ? "error" : "warning",
|
|
211
|
+
targetId: seg.id,
|
|
212
|
+
line: seg.line,
|
|
213
|
+
originalQuote: leakedPath,
|
|
214
|
+
fixSafety: "manual",
|
|
215
|
+
actionType: "prompt",
|
|
216
|
+
reason: `Personal or local machine filesystem path leaked in content ('${leakedPath}').`,
|
|
217
|
+
rewritePrompt: "Replace concrete local user path with a relative path, env placeholder, or public URL.",
|
|
218
|
+
});
|
|
219
|
+
}
|
|
203
220
|
}
|
|
204
221
|
|
|
205
222
|
for (const leak of doc.artifacts.rawFormattingLeaks || []) {
|
|
@@ -251,7 +251,8 @@ export default definePackScripts({
|
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
if (seg.id.endsWith("-S1") && (seg.blockKind === "list-item" || !seg.blockKind)) {
|
|
254
|
-
|
|
254
|
+
const boldLabel = text.match(/^\*\*([^*\n]{2,40})\*\*\s*[:\u2014-]/);
|
|
255
|
+
if (boldLabel && !/`|--/.test(boldLabel[1])) {
|
|
255
256
|
consecutiveBoldListItems += 1;
|
|
256
257
|
if (consecutiveBoldListItems === 1) boldWallAnchorSeg = seg;
|
|
257
258
|
if (consecutiveBoldListItems === 4 && boldWallAnchorSeg) {
|
|
@@ -21,6 +21,7 @@ export default definePackScripts({
|
|
|
21
21
|
for (const seg of doc.segments) {
|
|
22
22
|
const text = seg.text.trim();
|
|
23
23
|
const masked = maskInlineCode(text);
|
|
24
|
+
const isStatusGlyph = /^[\u2713-\u2718\u26A0\u2610-\u2612]/u.test(text);
|
|
24
25
|
|
|
25
26
|
if (EN_PLACEHOLDER_UI_COPY.test(masked)) {
|
|
26
27
|
ctx.reportDefect({
|
|
@@ -68,7 +69,13 @@ export default definePackScripts({
|
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
if (
|
|
72
|
+
if (
|
|
73
|
+
seg.blockKind !== "table-cell" &&
|
|
74
|
+
!seg.inTableCell &&
|
|
75
|
+
!isStatusGlyph &&
|
|
76
|
+
LEADING_EMOJI_RE.test(text) &&
|
|
77
|
+
text.length <= 60
|
|
78
|
+
) {
|
|
72
79
|
emojiPrefixedSegs.push(seg);
|
|
73
80
|
}
|
|
74
81
|
}
|
|
@@ -21,6 +21,7 @@ export default definePackScripts({
|
|
|
21
21
|
for (const seg of doc.segments) {
|
|
22
22
|
const text = seg.text.trim();
|
|
23
23
|
const masked = maskInlineCode(text);
|
|
24
|
+
const isStatusGlyph = /^[\u2713-\u2718\u26A0\u2610-\u2612]/u.test(text);
|
|
24
25
|
|
|
25
26
|
if (ZH_PLACEHOLDER_UI_COPY.test(masked)) {
|
|
26
27
|
ctx.reportDefect({
|
|
@@ -65,7 +66,13 @@ export default definePackScripts({
|
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
if (
|
|
69
|
+
if (
|
|
70
|
+
seg.blockKind !== "table-cell" &&
|
|
71
|
+
!seg.inTableCell &&
|
|
72
|
+
!isStatusGlyph &&
|
|
73
|
+
ZH_LEADING_EMOJI_RE.test(text) &&
|
|
74
|
+
text.length <= 36
|
|
75
|
+
) {
|
|
69
76
|
emojiPrefixedSegs.push(seg);
|
|
70
77
|
}
|
|
71
78
|
}
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "dislop",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"description": "Cutting AI slop is real productivity. Pluggable editorial and artifact linter (11 modular Packs across docs, web UI, slides, and Office) via pure-doc Skill, offline CLI, local stdio MCP, and Official Cloud MCP.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "dislop-ai",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.dislop-ai/dislop",
|
|
4
4
|
"title": "dislop",
|
|
5
5
|
"description": "Cutting AI slop is real productivity. Editorial and artifact linter for docs, web UI & slides.",
|
|
6
|
-
"version": "1.1.
|
|
6
|
+
"version": "1.1.2",
|
|
7
7
|
"websiteUrl": "https://dislop.com",
|
|
8
8
|
"icons": [
|
|
9
9
|
{
|
package/skills/dislop/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dislop
|
|
3
|
-
version: 1.1.
|
|
3
|
+
version: 1.1.2
|
|
4
4
|
description: "Use when drafting or revising text or deliverables a person will read: README, docs, PR descriptions, release notes, RFCs, postmortems, CLI help/errors, emails, essays, web pages and UI copy (HTML/CSS/JSX/SVG), or Word and PowerPoint files. Removes AI-sounding phrasing, chatbot leftovers, placeholders, and template layouts without changing facts."
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ CLI check: `dislop check <dir> --pack web-ui --format agent`
|
|
|
10
10
|
3. **Skip secondary fallback templates (`glassmorphism-overuse`, `placeholder-ui-copy`, `synthetic-testimonial-cliche`, `fabricated-stat-tile`, `redundant-feature-card-echo`, `verbose-cta-label`)**: Do not replace neon gradients with stacked `backdrop-blur` translucent cards, placeholder subcopy, fabricated stats, or chatty CTA labels.
|
|
11
11
|
4. **Use clean structural grammar**: Use `1px` rules, clear type scale, `tabular-nums` for aligned metrics, and restrained radii (`0–6px`). When revising existing UI, fix flagged issues in place without redesigning working layout or wrapping a snippet prompt in a full `<!DOCTYPE html>` shell unless asked.
|
|
12
12
|
5. **Keep UI copy exact**: State only requested labels, counts, states, and existing routes without inventing headings or file names.
|
|
13
|
-
6. **Respect non-UI graphic deliverables (posters, infographics,
|
|
13
|
+
6. **Respect non-UI graphic deliverables (posters, infographics, architecture diagrams)**: Standalone posters are not slide decks—never recommend moving text to speaker notes; diagram connectors and cycle arrows are structural graph edges, never treat them as nested `box-in-box` UI chrome.
|
|
14
14
|
|
|
15
15
|
## Contrast
|
|
16
16
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
3. **别退回第二代替代模板(`glassmorphism-overuse`、`placeholder-ui-copy`、`synthetic-testimonial-cliche`、`fabricated-stat-tile`、`redundant-card-subcopy`、`verbose-cta-label`)**:不要把紫粉渐变换成满屏半透明毛玻璃卡片、占位假文案、无来源背书数据、同义重复卡片描述或冗长客套按钮文案。
|
|
11
11
|
4. **用克制的版面结构呈现数据**:用 `1px` 细线、清晰字号层级与 `tabular-nums` 等宽数字对齐指标,保持按钮与面板克制圆角(`0–6px`)。要求输出片段时直接给组件片段,不要擅自套整页 `<!DOCTYPE html>` 壳;改旧页面时保留本来正常的布局,不无故重做。
|
|
12
12
|
5. **界面文案直说数字和路径**:只写需求给出的文案标签、计数、状态与真实路径,不塞宣传口号,不自己编维护时间或导出文件名。
|
|
13
|
-
6.
|
|
13
|
+
6. **区分网页组件与海报、信息图、架构流程图**:单张海报或信息图不是演示文稿,不要建议“挪进演讲备注”;架构图和流程图里的连线与回路箭头属于结构关系,不要误判成多层套盒边框。
|
|
14
14
|
|
|
15
15
|
## 三段对照
|
|
16
16
|
|
package/src/commands/doctor.mjs
CHANGED
|
@@ -16,6 +16,10 @@ import {
|
|
|
16
16
|
} from "../runtime/router.mjs";
|
|
17
17
|
import { isWorklogActive } from "../runtime/worklog.mjs";
|
|
18
18
|
|
|
19
|
+
function sanitizeTerminalText(val) {
|
|
20
|
+
return String(val || "").replace(/[\x00-\x1f\x7f-\x9f]/g, "?");
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
/**
|
|
20
24
|
* `dislop doctor [--json]` — zero-network diagnostic snapshot of config, active tier, auth, voice, and Packs.
|
|
21
25
|
*/
|
|
@@ -80,6 +84,9 @@ export async function runDoctorCommand(_positionals, flags, io = {}) {
|
|
|
80
84
|
retentionDays: config.worklog.retentionDays,
|
|
81
85
|
},
|
|
82
86
|
configuredPacks: config.packs || ["(auto by document format & language)"],
|
|
87
|
+
extraPacks: config.extraPacks || [],
|
|
88
|
+
overridesCount: (config.overrides || []).length,
|
|
89
|
+
declarativeRulesCount: (config.declarativeRules || []).length,
|
|
83
90
|
builtinPacks,
|
|
84
91
|
};
|
|
85
92
|
|
|
@@ -126,6 +133,9 @@ export async function runDoctorCommand(_positionals, flags, io = {}) {
|
|
|
126
133
|
: "disabled (local opt-in only)"
|
|
127
134
|
}\n`,
|
|
128
135
|
);
|
|
136
|
+
stdout.write(
|
|
137
|
+
` Project Rules : ${diagnosis.overridesCount} override(s), ${diagnosis.declarativeRulesCount} declarative rule(s), extraPacks=${diagnosis.extraPacks.map(sanitizeTerminalText).join(", ") || "(none)"}\n`,
|
|
138
|
+
);
|
|
129
139
|
stdout.write(` Built-in Packs : ${diagnosis.builtinPacks.join(", ")}\n`);
|
|
130
140
|
|
|
131
141
|
return 0;
|
|
@@ -588,6 +588,143 @@ function parseLengthPx(rawVal) {
|
|
|
588
588
|
return m ? Number(m[1]) : null;
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
+
function parseButtonAttributes(attrs) {
|
|
592
|
+
const list = [];
|
|
593
|
+
let i = 0;
|
|
594
|
+
const len = attrs.length;
|
|
595
|
+
while (i < len) {
|
|
596
|
+
while (i < len && /\s/.test(attrs[i])) i += 1;
|
|
597
|
+
if (i >= len || attrs[i] === "/") break;
|
|
598
|
+
const nameStart = i;
|
|
599
|
+
while (i < len && !/[\s=/>]/.test(attrs[i])) i += 1;
|
|
600
|
+
const name = attrs.slice(nameStart, i);
|
|
601
|
+
if (!name) {
|
|
602
|
+
i += 1;
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
while (i < len && /\s/.test(attrs[i])) i += 1;
|
|
606
|
+
let rawValue = null;
|
|
607
|
+
if (i < len && attrs[i] === "=") {
|
|
608
|
+
i += 1;
|
|
609
|
+
while (i < len && /\s/.test(attrs[i])) i += 1;
|
|
610
|
+
if (i < len && (attrs[i] === '"' || attrs[i] === "'")) {
|
|
611
|
+
const q = attrs[i];
|
|
612
|
+
const vStart = i;
|
|
613
|
+
i += 1;
|
|
614
|
+
while (i < len && attrs[i] !== q) {
|
|
615
|
+
if (attrs[i] === "\\" && i + 1 < len) i += 2;
|
|
616
|
+
else i += 1;
|
|
617
|
+
}
|
|
618
|
+
if (i < len) i += 1;
|
|
619
|
+
rawValue = attrs.slice(vStart, i);
|
|
620
|
+
} else if (i < len && attrs[i] === "{") {
|
|
621
|
+
const vStart = i;
|
|
622
|
+
let depth = 0;
|
|
623
|
+
let innerQ = null;
|
|
624
|
+
while (i < len) {
|
|
625
|
+
const ch = attrs[i];
|
|
626
|
+
if (innerQ) {
|
|
627
|
+
if (ch === "\\" && i + 1 < len) {
|
|
628
|
+
i += 2;
|
|
629
|
+
continue;
|
|
630
|
+
}
|
|
631
|
+
if (ch === innerQ) innerQ = null;
|
|
632
|
+
} else {
|
|
633
|
+
if (ch === '"' || ch === "'" || ch === "`") innerQ = ch;
|
|
634
|
+
else if (ch === "{") depth += 1;
|
|
635
|
+
else if (ch === "}") {
|
|
636
|
+
depth -= 1;
|
|
637
|
+
if (depth === 0) {
|
|
638
|
+
i += 1;
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
i += 1;
|
|
644
|
+
}
|
|
645
|
+
rawValue = attrs.slice(vStart, i);
|
|
646
|
+
} else {
|
|
647
|
+
const vStart = i;
|
|
648
|
+
while (i < len && !/[\s>]/.test(attrs[i])) i += 1;
|
|
649
|
+
rawValue = attrs.slice(vStart, i);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
list.push({ name, lowerName: name.toLowerCase(), rawValue });
|
|
653
|
+
}
|
|
654
|
+
return list;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
function unquoteAttrValue(rawValue) {
|
|
658
|
+
if (!rawValue) return "";
|
|
659
|
+
if (
|
|
660
|
+
(rawValue.startsWith('"') && rawValue.endsWith('"')) ||
|
|
661
|
+
(rawValue.startsWith("'") && rawValue.endsWith("'"))
|
|
662
|
+
) {
|
|
663
|
+
return rawValue.slice(1, -1);
|
|
664
|
+
}
|
|
665
|
+
return rawValue;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
function extractButtonElements(rawSource) {
|
|
669
|
+
const buttons = [];
|
|
670
|
+
const openRe = /<button(?=[\s>/])/gi;
|
|
671
|
+
const closeRe = /<\/button>/gi;
|
|
672
|
+
let noMoreClose = false;
|
|
673
|
+
let openMatch;
|
|
674
|
+
while ((openMatch = openRe.exec(rawSource)) !== null) {
|
|
675
|
+
const start = openMatch.index;
|
|
676
|
+
let i = start + 7;
|
|
677
|
+
let quote = null;
|
|
678
|
+
let braceDepth = 0;
|
|
679
|
+
let tagEnd = -1;
|
|
680
|
+
while (i < rawSource.length) {
|
|
681
|
+
const ch = rawSource[i];
|
|
682
|
+
if (quote) {
|
|
683
|
+
if (ch === "\\" && i + 1 < rawSource.length) {
|
|
684
|
+
i += 2;
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
if (ch === quote) quote = null;
|
|
688
|
+
} else {
|
|
689
|
+
if (ch === '"' || ch === "'" || ch === "`") quote = ch;
|
|
690
|
+
else if (ch === "{") braceDepth += 1;
|
|
691
|
+
else if (ch === "}" && braceDepth > 0) braceDepth -= 1;
|
|
692
|
+
else if (ch === ">" && braceDepth === 0) {
|
|
693
|
+
tagEnd = i;
|
|
694
|
+
break;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
i += 1;
|
|
698
|
+
}
|
|
699
|
+
if (tagEnd === -1) break;
|
|
700
|
+
const attrs = rawSource.slice(start + 7, tagEnd);
|
|
701
|
+
if (attrs.trimEnd().endsWith("/")) {
|
|
702
|
+
openRe.lastIndex = tagEnd + 1;
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
if (noMoreClose) {
|
|
706
|
+
openRe.lastIndex = tagEnd + 1;
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
closeRe.lastIndex = tagEnd + 1;
|
|
710
|
+
const closeMatch = closeRe.exec(rawSource);
|
|
711
|
+
if (!closeMatch) {
|
|
712
|
+
noMoreClose = true;
|
|
713
|
+
openRe.lastIndex = tagEnd + 1;
|
|
714
|
+
continue;
|
|
715
|
+
}
|
|
716
|
+
const closeIdx = closeMatch.index;
|
|
717
|
+
buttons.push({
|
|
718
|
+
attrs,
|
|
719
|
+
innerHtml: rawSource.slice(tagEnd + 1, closeIdx),
|
|
720
|
+
fullText: rawSource.slice(start, closeIdx + 9),
|
|
721
|
+
offset: start,
|
|
722
|
+
});
|
|
723
|
+
openRe.lastIndex = closeIdx + 9;
|
|
724
|
+
}
|
|
725
|
+
return buttons;
|
|
726
|
+
}
|
|
727
|
+
|
|
591
728
|
function collectUiSignals(rawSource, format, scriptText = "") {
|
|
592
729
|
const purplePinkGradients = [];
|
|
593
730
|
const glowBlobs = [];
|
|
@@ -644,23 +781,49 @@ function collectUiSignals(rawSource, format, scriptText = "") {
|
|
|
644
781
|
pillBadges.push({ text: m[0], offset: m.index });
|
|
645
782
|
}
|
|
646
783
|
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
784
|
+
for (const btn of extractButtonElements(rawSource)) {
|
|
785
|
+
const attrList = parseButtonAttributes(btn.attrs);
|
|
786
|
+
if (
|
|
787
|
+
attrList.some(
|
|
788
|
+
(a) => a.lowerName === "title" || a.lowerName === "aria-label" || a.lowerName === "aria-describedby",
|
|
789
|
+
)
|
|
790
|
+
) {
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
const disabledAttr = attrList.find((a) => a.lowerName === "disabled");
|
|
794
|
+
if (!disabledAttr) continue;
|
|
795
|
+
if (disabledAttr.rawValue && disabledAttr.rawValue.startsWith("{") && disabledAttr.rawValue.endsWith("}")) {
|
|
796
|
+
if (disabledAttr.rawValue.slice(1, -1).trim() !== "true") continue;
|
|
797
|
+
}
|
|
798
|
+
if (
|
|
799
|
+
format === "html" &&
|
|
800
|
+
attrList.some((a) => a.lowerName === "onclick" || a.lowerName === "@click" || a.lowerName === "v-on:click")
|
|
801
|
+
) {
|
|
802
|
+
continue;
|
|
803
|
+
}
|
|
804
|
+
const innerText = btn.innerHtml.replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
652
805
|
const isLoadingLabel =
|
|
653
806
|
/(?:\.\.\.|\u2026|\b(?:loading|pending|preparing|initializing|saving|submitting|connecting|please wait)\b|\u51c6\u5907\u4e2d|\u52a0\u8f7d\u4e2d|\u5904\u7406\u4e2d|\u751f\u6210\u4e2d|\u8bf7\u7a0d\u5019)/i.test(
|
|
654
807
|
innerText,
|
|
655
808
|
);
|
|
656
809
|
if (isLoadingLabel) continue;
|
|
657
|
-
const
|
|
658
|
-
const btnId =
|
|
810
|
+
const idAttr = attrList.find((a) => a.lowerName === "id");
|
|
811
|
+
const btnId = idAttr ? unquoteAttrValue(idAttr.rawValue) : "";
|
|
659
812
|
if (btnId && scriptText) {
|
|
660
813
|
const escId = btnId.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
661
814
|
if (new RegExp(`\\b${escId}\\b`).test(scriptText)) continue;
|
|
662
815
|
}
|
|
663
|
-
|
|
816
|
+
if (
|
|
817
|
+
scriptText &&
|
|
818
|
+
attrList.some((a) => {
|
|
819
|
+
if (!a.lowerName.startsWith("data-")) return false;
|
|
820
|
+
const escData = a.lowerName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
821
|
+
return new RegExp(`(?<![A-Za-z0-9_-])${escData}(?![A-Za-z0-9_-])`).test(scriptText);
|
|
822
|
+
})
|
|
823
|
+
) {
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
disabledButtonsWithoutTitle.push({ text: btn.fullText, offset: btn.offset });
|
|
664
827
|
}
|
|
665
828
|
|
|
666
829
|
if (format === "svg" && /<svg\b/i.test(rawSource)) {
|
|
@@ -807,6 +970,7 @@ function collectHtmlProseBlocks(rawText, proseMask) {
|
|
|
807
970
|
innerStart: popped.innerStart,
|
|
808
971
|
innerEnd,
|
|
809
972
|
rawInner,
|
|
973
|
+
inTableCell: stack.some((s) => s.tag === "td" || s.tag === "th"),
|
|
810
974
|
});
|
|
811
975
|
break;
|
|
812
976
|
}
|
|
@@ -964,6 +1128,7 @@ function parseMarkupOrStylesheet(rawText, filePath, format) {
|
|
|
964
1128
|
else if (blk.tag === "li") blockKind = "list-item";
|
|
965
1129
|
else if (blk.tag === "td" || blk.tag === "th") blockKind = "table-cell";
|
|
966
1130
|
else if (blk.tag === "button" || blk.tag === "label" || blk.tag === "a") blockKind = "ui-control";
|
|
1131
|
+
const inTableCell = blk.tag === "td" || blk.tag === "th" || Boolean(blk.inTableCell);
|
|
967
1132
|
|
|
968
1133
|
for (const piece of pieces) {
|
|
969
1134
|
const cleanSlice = piece.text;
|
|
@@ -999,6 +1164,7 @@ function parseMarkupOrStylesheet(rawText, filePath, format) {
|
|
|
999
1164
|
id,
|
|
1000
1165
|
paragraphId: blockId,
|
|
1001
1166
|
blockKind,
|
|
1167
|
+
...(inTableCell ? { inTableCell: true } : {}),
|
|
1002
1168
|
line,
|
|
1003
1169
|
text: sp.text,
|
|
1004
1170
|
locator,
|
|
@@ -6,6 +6,7 @@ import { detectFormatFromPath } from "./document-model.mjs";
|
|
|
6
6
|
|
|
7
7
|
const DEFAULT_IGNORED_DIRS = new Set([
|
|
8
8
|
".git",
|
|
9
|
+
".dislop",
|
|
9
10
|
"node_modules",
|
|
10
11
|
"dist",
|
|
11
12
|
"build",
|
|
@@ -287,6 +288,12 @@ export function discoverChangedFiles({
|
|
|
287
288
|
// Confine symlinked targets inside the canonical git repository root
|
|
288
289
|
if (relFromRoot.startsWith("..") || path.isAbsolute(relFromRoot)) continue;
|
|
289
290
|
if (!detectFormatFromPath(abs)) continue;
|
|
291
|
+
if (
|
|
292
|
+
rel.replace(/\\/g, "/").split("/").includes(".dislop") ||
|
|
293
|
+
relFromRoot.split("/").includes(".dislop")
|
|
294
|
+
) {
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
290
297
|
const relFromIgnore = path.relative(ignoreRoot, realAbs).replace(/\\/g, "/");
|
|
291
298
|
if (isIgnored(relFromIgnore, false) || isIgnored(relFromRoot, false)) continue;
|
|
292
299
|
resolved.add(abs);
|
|
@@ -666,8 +666,14 @@ export async function resolveActivePacks(
|
|
|
666
666
|
: defaultPackSpecifiersForDoc(doc, packsRoot).map((spec) => ({ spec, origin: "default" }));
|
|
667
667
|
|
|
668
668
|
if (packOrigin !== "cli" && packSpecifiers && packSpecifiers.length > 0) {
|
|
669
|
-
|
|
670
|
-
|
|
669
|
+
const qaDefaults = defaultPackSpecifiersForDoc(doc, packsRoot).filter((s) =>
|
|
670
|
+
s.endsWith("/artifact-qa"),
|
|
671
|
+
);
|
|
672
|
+
const missingQa = qaDefaults
|
|
673
|
+
.filter((s) => !requested.some((r) => r.spec === s))
|
|
674
|
+
.map((spec) => ({ spec, origin: "default" }));
|
|
675
|
+
if (missingQa.length > 0) {
|
|
676
|
+
requested = [...missingQa, ...requested];
|
|
671
677
|
}
|
|
672
678
|
}
|
|
673
679
|
if (extraPackSpecifiers && extraPackSpecifiers.length > 0) {
|
package/src/kernel/pipeline.mjs
CHANGED
|
@@ -200,9 +200,9 @@ function resolvePerFileSettings(filePath, cwd, config) {
|
|
|
200
200
|
routing = ov.routing;
|
|
201
201
|
overrideLocal = ov.routing === "local";
|
|
202
202
|
}
|
|
203
|
-
if (ov.packs !== undefined) {
|
|
203
|
+
if (ov.packs !== undefined && packOrigin !== "cli") {
|
|
204
204
|
packs = ov.packs;
|
|
205
|
-
|
|
205
|
+
packOrigin = ov.origin || "project";
|
|
206
206
|
}
|
|
207
207
|
if (ov.extraPacks !== undefined) {
|
|
208
208
|
for (const ep of ov.extraPacks) {
|
package/src/kernel/version.mjs
CHANGED