dislop 1.0.1 → 1.1.1
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/PRODUCT.md +2 -2
- package/README.md +34 -33
- package/README.zh-CN.md +65 -61
- package/action.yml +17 -2
- package/gemini-extension.json +1 -1
- package/package.json +2 -2
- package/packs/common/artifact-qa/scripts/index.mjs +64 -2
- package/packs/en/artifact-qa/scripts/index.mjs +1 -1
- package/packs/en/prose/scripts/index.mjs +3 -0
- package/plugin.json +1 -1
- package/server.json +2 -2
- package/skills/dislop/SKILL.md +1 -1
- package/skills/dislop/agents/openai.yaml +1 -1
- package/skills/dislop/references/essay.md +5 -5
- package/skills/dislop/references/essay.zh-CN.md +5 -5
- package/skills/dislop/references/office.md +4 -4
- package/skills/dislop/references/office.zh-CN.md +4 -4
- package/skills/dislop/references/web-ui.md +4 -4
- package/skills/dislop/references/web-ui.zh-CN.md +4 -4
- package/skills/dislop/references/work-docs.md +6 -6
- package/skills/dislop/references/work-docs.zh-CN.md +6 -6
- package/src/cli-main.mjs +88 -6
- package/src/commands/check-fix.mjs +170 -15
- package/src/commands/doctor.mjs +23 -1
- package/src/commands/init.mjs +24 -18
- package/src/commands/packs.mjs +41 -4
- package/src/commands/verify.mjs +36 -4
- package/src/commands/voice.mjs +1 -1
- package/src/commands/worklog.mjs +424 -0
- package/src/kernel/config.mjs +546 -19
- package/src/kernel/document-model.mjs +30 -10
- package/src/kernel/fact-gate.mjs +160 -0
- package/src/kernel/file-discovery.mjs +168 -11
- package/src/kernel/ooxml-binary.mjs +86 -0
- package/src/kernel/pack-loader.mjs +107 -21
- package/src/kernel/pack-validator.mjs +491 -0
- package/src/kernel/patcher.mjs +177 -47
- package/src/kernel/pipeline.mjs +284 -21
- package/src/kernel/prompt-assembler.mjs +37 -8
- package/src/kernel/version.mjs +7 -0
- package/src/kernel/voice-profile.mjs +3 -0
- package/src/mcp/stdio-server.mjs +71 -1
- package/src/runners/auto-fix.mjs +17 -2
- package/src/runners/interactive-tty.mjs +32 -5
- package/src/runners/reporters.mjs +18 -2
- package/src/runtime/providers/cloud.mjs +4 -2
- package/src/runtime/providers/local-model.mjs +8 -0
- package/src/runtime/router.mjs +11 -2
- package/src/runtime/worklog.mjs +904 -0
package/skills/dislop/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dislop
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.1.1
|
|
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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "dislop"
|
|
3
|
-
short_description: "Cutting AI slop is real productivity —
|
|
3
|
+
short_description: "Cutting AI slop is real productivity — Pluggable Editorial & Artifact Linter"
|
|
4
4
|
default_prompt: "Use $dislop to check my draft for AI slop, replacement slogans, and template UI while keeping every number, link, and qualifier intact."
|
|
5
5
|
policy:
|
|
6
6
|
allow_implicit_invocation: true
|
|
@@ -5,11 +5,11 @@ CLI check: `dislop check <essay.md> --format agent` (optional personal voice bas
|
|
|
5
5
|
|
|
6
6
|
## Rules & Fixes
|
|
7
7
|
|
|
8
|
-
1. **
|
|
9
|
-
2. **Cut staged self-Q&A &
|
|
10
|
-
3. **Break
|
|
11
|
-
4. **End on the last concrete scene (`
|
|
12
|
-
5. **Restrain em-dashes & binary pivots (`excessive-em-dash
|
|
8
|
+
1. **Avoid low-information abstract filler (`stealth-vapor`, `hollow-transition`)**: Anchor clauses in supplied times, places, and physical actions without chopping prose into artificial short fragments (`staccato-slogan-run`).
|
|
9
|
+
2. **Cut staged self-Q&A & macro preambles (`rhetorical-self-qa`, `hollow-transition`)**: Remove `"Why does this matter?"`, `"The result?"`, `"In today's fast-paced world..."`, and balanced semicolon padding.
|
|
10
|
+
3. **Break sprawling comma-spliced sentences**: Split tangled multi-clause run-on sentences into 2–3 clear sentences when the subject gets lost.
|
|
11
|
+
4. **End on the last concrete scene (`moralizing-closer`)**: Cut closing paragraphs that zoom out into life lessons (`"Ultimately, this reminds us..."`). Stop on the final observed action or quote.
|
|
12
|
+
5. **Restrain em-dashes & binary pivots (`excessive-em-dash`, `unprompted-negation`)**: Replace stacked em-dashes (`3+` in one sentence) with commas or periods, and replace `"Not just X — it's Y"` pivots with plain action.
|
|
13
13
|
6. **Zero invented scene detail**: Use only objects, weather, bystanders, and quotes in the notes; develop those supplied details clearly to fit the target length without adding outside scenery.
|
|
14
14
|
|
|
15
15
|
## Contrast
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
## 常见问题与改法
|
|
7
7
|
|
|
8
|
-
1. **保持长短句自然错落(`
|
|
9
|
-
2.
|
|
10
|
-
3.
|
|
11
|
-
4. **停在最后一个现场画面,别强行升华(`
|
|
12
|
-
5. **纠回中文标点、否定转折腔与生硬译文腔(`
|
|
8
|
+
1. **保持长短句自然错落(`stealth-vapor`、`hollow-transition`)**:避免连续 5 句以上长度接近、缺少具体名词的空句子。按时间、地点和动作自然展开,不刻意切碎成三字短句口号。
|
|
9
|
+
2. **删掉设问过渡与宏大套话(`rhetorical-self-qa`、`hollow-transition`)**:删去 `为什么这一点如此重要?`、`这意味着什么?`、`在当今……浪潮下` 以及工整排比的三段分号句。
|
|
10
|
+
3. **只在失控长句处拆句**:一逗到底超过五六个分句且主语不清时再拆成 2 到 3 句,本身节奏通顺的流水句无需强行拆断。
|
|
11
|
+
4. **停在最后一个现场画面,别强行升华(`moralizing-closer`、`hollow-transition`)**:删掉 `在当今……` 开头和 `这或许就是……真正的意义所在` 结尾,落在最后一个动作或原话直接收笔。
|
|
12
|
+
5. **纠回中文标点、否定转折腔与生硬译文腔(`halfwidth-cjk-punctuation`、`unprompted-negation`)**:中文正文统一用全角逗号、句号和引号,删掉无语境支撑的 `不是……而是……` 句式,并避开生硬的欧化状语堆砌。
|
|
13
13
|
6. **只写笔记实情**:用素材已有的器物、动作、天气和对话自然展开来匹配目标篇幅,绝不外编路人、对话或心理活动凑字数。
|
|
14
14
|
|
|
15
15
|
## 三段对照
|
|
@@ -5,11 +5,11 @@ CLI check: `dislop check <file.docx-or-pptx> --format agent` (mounts `slide-deck
|
|
|
5
5
|
|
|
6
6
|
## Rules & Fixes
|
|
7
7
|
|
|
8
|
-
1. **Strip leaked Markdown
|
|
8
|
+
1. **Strip leaked Markdown, chat wrappers & placeholders (`raw-markdown-leak`, `chatbot-artifact`, `unfilled-placeholder`, `leaked-slide-directive`)**: Remove `**bold**`, `## Heading`, backticks, placeholder tags, `[Image suggestion: ...]`, and conversational wrapper sentences. Delete wrapper nouns whole—never glue partial headings onto body sentences.
|
|
9
9
|
2. **Keep XML structure, document-API styles & grammar intact**: Preserve valid XML tags (`<w:document>`, `<p:sld>`), document-API paragraph styles, tracked changes (`<w:ins>`, `<w:del>`), comments, and tables. Leave existing text runs and split numbers intact (for example `$18.` + `5M`) unless merging is necessary; after cutting hype modifiers (`Their faultless backup cluster`), keep determiner grammar intact (`Their backup cluster`).
|
|
10
|
-
3. **Write finding headlines (`slide-
|
|
11
|
-
4. **Keep slides scannable without repeating numbers (`slide-word-wall`, `slide-bullet-overload`, `slide-autofit-shrink`)**: When drafting slides, stay within 120 words and 5–6 bullets without `<a:normAutofit fontScale="65000"/>`, and avoid repeating the headline number inside bullets. When revising, keep all source facts intact.
|
|
12
|
-
5. **Break consecutive bullet skeletons (`
|
|
10
|
+
3. **Write finding headlines (`buzzword-slide-headline`, `vague-slide-headline`, `closing-slide-slogan`)**: Replace generic headings (`"Overview"`, `"Strategic Synergy"`) with the specific finding and source number (`"North Pier Pump Drew $42k Excess Power"`), and drop closing slogan slides.
|
|
11
|
+
4. **Keep slides scannable without repeating numbers (`slide-word-wall`, `slide-bullet-overload`, `slide-autofit-shrink`, `slide-prose-dump`)**: When drafting slides, stay within 120 words and 5–6 bullets without `<a:normAutofit fontScale="65000"/>`, and avoid repeating the headline number inside bullets. When revising, keep all source facts intact.
|
|
12
|
+
5. **Break consecutive bullet skeletons (`repetitive-slide-skeleton`)**: Across 4+ slides, vary layouts with tables for comparisons and charts for trends, and strip image workflow metadata (`image-ai-workflow-residue`).
|
|
13
13
|
|
|
14
14
|
## Contrast
|
|
15
15
|
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
## 常见问题与改法
|
|
7
7
|
|
|
8
|
-
1. **清掉裸 Markdown、寒暄与占位符(`markdown-leak`、`chatbot-artifact`、`unfilled-placeholder`)**:删掉 `**加粗**`、`## 标题`、`[待补充]` 和整句模型寒暄(如 `很高兴协助,下方是……`)。寒暄里的名词整句删掉,不要硬粘成 `总体说明:` 这类半截小标题。
|
|
8
|
+
1. **清掉裸 Markdown、寒暄与占位符(`raw-markdown-leak`、`chatbot-artifact`、`unfilled-placeholder`、`leaked-slide-directive`)**:删掉 `**加粗**`、`## 标题`、`[待补充]`、`[配图建议:...]` 和整句模型寒暄(如 `很高兴协助,下方是……`)。寒暄里的名词整句删掉,不要硬粘成 `总体说明:` 这类半截小标题。
|
|
9
9
|
2. **保住 XML 标签、文档接口样式与语法完整**:修改原始 XML 或通过办公软件文档接口编辑时,保持 `<w:document>/<w:body>/<w:p>/<w:r>/<w:t>` 等标签配平,保留审阅修订、批注、段落样式与真实表格。默认保留原有的 `<w:t>` / `<a:t>` 分段边界,留意跨节点拆开的数字(如 `84.` 与 `6 万千瓦时`)和前面限定词;删掉虚高修饰词后检查主语和限定词是否通顺。
|
|
10
|
-
3. **把弱标签改成结论标题(`slide-
|
|
11
|
-
4. **控住新建幻灯片密度且不重复数字(`slide-word-wall`、`slide-bullet-overload`、`slide-autofit-shrink`)**:起草单页控制在 120 字和 5–6 条要点以内,不用缩排硬塞,标题写过的数字不要在要点里反复重复;改旧稿时不要为了凑字数删掉原稿事实。
|
|
12
|
-
5. **打破连续同构模板页(`
|
|
10
|
+
3. **把弱标签改成结论标题(`buzzword-slide-headline`、`vague-slide-headline`、`closing-slide-slogan`)**:把 `顶层设计与生态赋能`、`项目整体概况` 改成一句带数据的结论(如 `西站 6 号闸机早高峰积压 18 分钟`),并清掉 `携手并进,共创辉煌未来!` 类口号末页。
|
|
11
|
+
4. **控住新建幻灯片密度且不重复数字(`slide-word-wall`、`slide-bullet-overload`、`slide-autofit-shrink`、`slide-prose-dump`)**:起草单页控制在 120 字和 5–6 条要点以内,不用缩排硬塞,标题写过的数字不要在要点里反复重复;改旧稿时不要为了凑字数删掉原稿事实。
|
|
12
|
+
5. **打破连续同构模板页(`repetitive-slide-skeleton`)**:不要连续 4 页全放纯文字要点,对比改表格、趋势改图表;配图同步清掉生成工具工作流元数据(`image-ai-workflow-residue`)。
|
|
13
13
|
|
|
14
14
|
## 三段对照
|
|
15
15
|
|
|
@@ -5,12 +5,12 @@ CLI check: `dislop check <dir> --pack web-ui --format agent`
|
|
|
5
5
|
|
|
6
6
|
## Rules & Fixes
|
|
7
7
|
|
|
8
|
-
1. **Zero dead controls (`
|
|
9
|
-
2. **Skip stock AI chrome (`
|
|
10
|
-
3. **Skip secondary fallback templates (`
|
|
8
|
+
1. **Zero dead controls (`placeholder-dead-link`, `empty-link-target`, `unexplained-disabled-button`, `svg-missing-viewbox`, severity `error`)**: Never emit `<a href="#">`, empty `href=""`, `<svg>` missing `viewBox`, or unexplained `<button disabled>`. Wire only real routes from the codebase or prompt; if an action is unbuilt, omit the control or explain why it is disabled with visible text linked via `aria-describedby`.
|
|
9
|
+
2. **Skip stock AI chrome (`neon-ai-gradient`, `glow-blob-backdrop`, `pill-badge-soup`, `prompt-echo-copy`, `emoji-feature-grid`)**: Avoid indigo-purple-pink neon gradients, `blur-3xl` glow orbs, `> 6` `rounded-full` pills per view, decorative emoji headings, and `"AI-Powered"` or `"Supercharge Your Workflow"` copy.
|
|
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
|
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
## 常见问题与改法
|
|
7
7
|
|
|
8
|
-
1. **清零死控件(`
|
|
9
|
-
2. **去掉第一代默认 AI 模板(`
|
|
10
|
-
3. **别退回第二代替代模板(`
|
|
8
|
+
1. **清零死控件(`placeholder-dead-link`、`empty-link-target`、`unexplained-disabled-button`、`svg-missing-viewbox`,硬伤)**:禁止输出 `<a href="#">`、空链接、缺少 `viewBox` 的 `<svg>`,或没有原因说明的 `<button disabled>`。链接只填需求或代码库里真实存在的路径;未实现的功能直接删掉按钮,或用可见说明文字配 `aria-describedby` 写清禁用原因。
|
|
9
|
+
2. **去掉第一代默认 AI 模板(`neon-ai-gradient`、`glow-blob-backdrop`、`pill-badge-soup`、`prompt-echo-copy`、`emoji-feature-grid`)**:不用蓝紫粉霓虹渐变、弥散发光光斑、单屏超过 6 个圆角胶囊标签、标题前置装饰 Emoji,以及 `AI 强力驱动`、`开启新纪元` 类空洞套话。
|
|
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
|
|
|
@@ -5,12 +5,12 @@ CLI check: `dislop check <path> --format agent` (verify edits via `dislop verify
|
|
|
5
5
|
|
|
6
6
|
## Rules & Fixes
|
|
7
7
|
|
|
8
|
-
1. **Strip chat wrappers
|
|
9
|
-
2. **Cut macro preambles & future-gazing (`
|
|
10
|
-
3. **Break low-fact buzzword clusters (`cooccurrence-
|
|
11
|
-
4. **Keep PRs, CLI copy & postmortems factual (`
|
|
12
|
-
5. **Cut absolute claims & unanchored multipliers
|
|
13
|
-
6. **No invented attribution or bold list walls (`
|
|
8
|
+
1. **Strip chat wrappers, citations, placeholders & broken links (`chatbot-artifact`, `chatbot-citation-leak`, `unfilled-placeholder`, `broken-local-link`, `disguised-placeholder-prose`, `unchosen-draft-options`)**: Delete opening conversational scaffolding, `[oaicite:1]` leaks, `[TBD]` markers, author-facing reminders, and unchosen `Option A / Option B` branches; start directly on the ticket, release, or decision.
|
|
9
|
+
2. **Cut macro preambles, throat-clearing & future-gazing (`hollow-transition`, `throat-clearing`, `moralizing-closer`)**: Drop trend openings (`"In today's fast-paced world..."`), `"It is worth noting that..."`, and vague outlooks (`"Looking ahead..."`).
|
|
10
|
+
3. **Break low-fact buzzword clusters (`cooccurrence-hype-cluster`, `stealth-vapor`)**: Replace stacked filler verbs (`harnesses`, `elevate`, `streamline`, `unlock potential`) with the exact mechanism stated in the notes.
|
|
11
|
+
4. **Keep PRs, CLI copy & postmortems factual (`unprompted-negation`, `rhetorical-self-qa`)**: Copy owners, flags, thresholds, and due dates verbatim; list missing ones as open questions. State the missing check or recovery step directly instead of writing `"This isn't just X — it's Y"` or `"Why does this matter?"`.
|
|
12
|
+
5. **Cut absolute claims & unanchored multipliers**: Delete unproven absolutes (`"always guaranteed"`, `"never fails"`) and bare multipliers (`"5x speed gain"`); cite a standard or baseline only when present in the source, and keep hedging words like `projected` intact.
|
|
13
|
+
6. **No invented attribution or bold list walls (`bold-lead-list-wall`)**: Drop filler such as `"Studies show"`, keep source evidence labels (`benchmarked`, `measured`) without upgrading them, and turn stacked `- **Label**: text` lists (`4+` items) into plain prose.
|
|
14
14
|
7. **Honest edits only**: Remove real filler while keeping every distinct point and mechanism intact; never compress multi-paragraph prose into a stub or add fake typos.
|
|
15
15
|
|
|
16
16
|
## Contrast
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
## 常见问题与改法
|
|
7
7
|
|
|
8
|
-
1.
|
|
9
|
-
2.
|
|
10
|
-
3. **拆散公文黑话与四字排比(`
|
|
11
|
-
4. **改实研发复盘、CLI 文案与改进项(`
|
|
12
|
-
5.
|
|
13
|
-
6. **保留原始出处标签,别堆加粗列表,别缩成残句(`
|
|
8
|
+
1. **清掉寒暄壳、引用泄漏、占位符与死链(`chatbot-artifact`、`chatbot-citation-leak`、`unfilled-placeholder`、`broken-local-link`、`disguised-placeholder-prose`、`unchosen-draft-options`)**:删掉 `你好,下面为你附上……`、`[oaicite:1]`、`[待填写]`、正文里的待办提醒与未定稿的 `方案 A / 方案 B`,第一句落到具体模块、单号或数字。
|
|
9
|
+
2. **删掉宏大空话、句首铺垫与口号结尾(`hollow-transition`、`throat-clearing`、`moralizing-closer`)**:删去 `在当今……浪潮下`、`值得注意的是,`、`展望未来……`、`这标志着……`。
|
|
10
|
+
3. **拆散公文黑话与四字排比(`four-char-slogan-triad`、`buzzword-cluster`、`cooccurrence-padding`)**:把 `重要抓手`、`全面赋能`、`精准高效、安全可靠、灵活易用`、`深度融合、充分释放` 换成笔记里的真实动作。
|
|
11
|
+
4. **改实研发复盘、CLI 文案与改进项(`unprompted-negation`、`rhetorical-self-qa`)**:笔记给了负责人、命令参数、阈值和日期就照抄;没给就单独列为待确认问题。直接写缺了哪道校验或具体排查步骤,不要写 `这不是……而是……` 或 `为什么这一点如此重要?`。
|
|
12
|
+
5. **删掉绝对承诺与悬空倍数**:删掉 `绝对安全`、`永不宕机`、`倍速跃升`;原文给了加密协议、合同可用性、预计目标或前后基线才保留。
|
|
13
|
+
6. **保留原始出处标签,别堆加粗列表,别缩成残句(`bold-lead-list-wall`)**:只删模型自己加的 `业内普遍认为` 等空壳背书;笔记里原有 `实测结果` 时直接写结论(如 `升级后……`),不添 `上线后实测`,也别把短列表全堆成 5 条及以上 `- **标签**:内容`;删掉空话时保留原句每个独立动作与数字,别硬压缩成一句话。
|
|
14
14
|
|
|
15
15
|
## 三段对照
|
|
16
16
|
|
package/src/cli-main.mjs
CHANGED
|
@@ -7,11 +7,13 @@ import { runModelCommand } from "./commands/model.mjs";
|
|
|
7
7
|
import { runPacksCommand } from "./commands/packs.mjs";
|
|
8
8
|
import { runVerifyCommand } from "./commands/verify.mjs";
|
|
9
9
|
import { runVoiceCommand } from "./commands/voice.mjs";
|
|
10
|
+
import { runWorklogCommand } from "./commands/worklog.mjs";
|
|
10
11
|
import { DislopConfigError } from "./kernel/config.mjs";
|
|
12
|
+
import { DISLOP_VERSION } from "./kernel/version.mjs";
|
|
11
13
|
import { startStdioMcpServer } from "./mcp/stdio-server.mjs";
|
|
12
14
|
import { detectOllamaBinary } from "./runtime/providers/local-model.mjs";
|
|
13
15
|
|
|
14
|
-
export const CLI_VERSION =
|
|
16
|
+
export const CLI_VERSION = DISLOP_VERSION;
|
|
15
17
|
|
|
16
18
|
export function buildHelpText(env = process.env) {
|
|
17
19
|
const ollama = detectOllamaBinary(env);
|
|
@@ -31,21 +33,27 @@ Usage:
|
|
|
31
33
|
dislop logout Remove saved Official Cloud credentials
|
|
32
34
|
dislop voice <extract|show|clear> [files] Manage personal voice baseline (voice.json)
|
|
33
35
|
dislop model <list|pull|rm> [name] Manage Tier 3 local models (requires Ollama)
|
|
34
|
-
dislop packs [--json]
|
|
36
|
+
dislop packs [list|lint <path>] [--json] List built-in Packs or lint external .pack.md / Pack dirs
|
|
35
37
|
dislop doctor [--json] Inspect active routing tier, Ollama status, auth, config, and Packs
|
|
38
|
+
dislop worklog <status|list|show|stats|reflect|clear> Inspect local dev worklog & reflection summaries
|
|
36
39
|
dislop mcp Start local stdio MCP server for coding & office agents
|
|
37
40
|
|
|
38
41
|
Options (check / fix):
|
|
39
42
|
--auto, -y (fix only) Apply verified fixSafety === "safe" items non-interactively
|
|
40
43
|
--json Emit pure dislop.report/1 JSON to stdout (diagnostics to stderr)
|
|
41
44
|
--format <text|diff|json|agent|sarif> Output format ('agent' = token-compact feed for AI agents)
|
|
45
|
+
--stdin-filename <name> Filename/extension hint when reading document from stdin ('-')
|
|
46
|
+
--changed Inspect git-modified, staged, and untracked deliverable files
|
|
47
|
+
--since <ref> Inspect deliverable files changed since git <ref>
|
|
48
|
+
--fail-on <none|error|warning> Minimum Defect severity to fail with Exit 1 (default: error; Suggestions always Exit 0)
|
|
42
49
|
--pack <names/paths...> Mount specific Packs (comma-separated or repeated)
|
|
43
50
|
--no-llm Run deterministic Script Packs (pack.check) only
|
|
44
51
|
--voice <files/globs...> Align review with hand-written voice reference files
|
|
45
52
|
--level <strong|moderate|hint|all> Filter Suggestion priority threshold (default: all)
|
|
46
|
-
--engine <local|auto|cloud|byok>
|
|
53
|
+
--engine <off|local|auto|cloud|byok> Routing tier (default: local; Tier 3 local LLM requires Ollama)
|
|
47
54
|
--provider <name> Select named or built-in provider (openai, anthropic, gemini)
|
|
48
55
|
--model <name> Override LLM model identifier for the active provider
|
|
56
|
+
--concurrency <n> Max parallel files during 'check' (1-16; default 4 for LLM)
|
|
49
57
|
--dry-run Preview unified diff without modifying files on disk
|
|
50
58
|
--backup Create <file>.bak before atomic write
|
|
51
59
|
--lang <auto|en|zh> Diagnostic language ('auto' matches target document language)
|
|
@@ -74,6 +82,46 @@ function splitCommaValues(values) {
|
|
|
74
82
|
.filter(Boolean);
|
|
75
83
|
}
|
|
76
84
|
|
|
85
|
+
const OPTIONS_WITH_VALUE = new Set([
|
|
86
|
+
"--format",
|
|
87
|
+
"--pack",
|
|
88
|
+
"--voice",
|
|
89
|
+
"--level",
|
|
90
|
+
"--engine",
|
|
91
|
+
"--provider",
|
|
92
|
+
"--model",
|
|
93
|
+
"--concurrency",
|
|
94
|
+
"--lang",
|
|
95
|
+
"--token",
|
|
96
|
+
"--endpoint",
|
|
97
|
+
"--since",
|
|
98
|
+
"--fail-on",
|
|
99
|
+
"--stdin-filename",
|
|
100
|
+
"--days",
|
|
101
|
+
"--limit",
|
|
102
|
+
"--command",
|
|
103
|
+
"--older-than",
|
|
104
|
+
]);
|
|
105
|
+
|
|
106
|
+
function countRemainingPositionals(tokens, startIndex) {
|
|
107
|
+
let count = 0;
|
|
108
|
+
for (let j = startIndex; j < tokens.length; j += 1) {
|
|
109
|
+
const tok = tokens[j];
|
|
110
|
+
if (tok === "--") {
|
|
111
|
+
count += tokens.length - j - 1;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
if (tok.startsWith("-")) {
|
|
115
|
+
if (OPTIONS_WITH_VALUE.has(tok) && !tok.includes("=")) {
|
|
116
|
+
j += 1;
|
|
117
|
+
}
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
count += 1;
|
|
121
|
+
}
|
|
122
|
+
return count;
|
|
123
|
+
}
|
|
124
|
+
|
|
77
125
|
/**
|
|
78
126
|
* Parse CLI arguments and execute the requested `dislop` subcommand.
|
|
79
127
|
* Returns integer process exit code (`0`, `1`, or `2`).
|
|
@@ -89,9 +137,9 @@ export async function runCli(argv = process.argv.slice(2), io = {}) {
|
|
|
89
137
|
const arg = argv[i];
|
|
90
138
|
if (arg === "--git") {
|
|
91
139
|
const next = argv[i + 1];
|
|
92
|
-
//
|
|
93
|
-
const
|
|
94
|
-
if (next && !next.startsWith("-") &&
|
|
140
|
+
// If another positional target follows `next`, `next` is the git ref; otherwise default to `HEAD`
|
|
141
|
+
const remainingAfterNext = next ? countRemainingPositionals(argv, i + 2) : 0;
|
|
142
|
+
if (next && !next.startsWith("-") && remainingAfterNext >= 1) {
|
|
95
143
|
normalizedArgv.push(`--git=${next}`);
|
|
96
144
|
i += 1;
|
|
97
145
|
} else {
|
|
@@ -115,6 +163,13 @@ export async function runCli(argv = process.argv.slice(2), io = {}) {
|
|
|
115
163
|
yes: { type: "boolean", short: "y" },
|
|
116
164
|
json: { type: "boolean" },
|
|
117
165
|
format: { type: "string" },
|
|
166
|
+
"stdin-filename": { type: "string" },
|
|
167
|
+
changed: { type: "boolean" },
|
|
168
|
+
since: { type: "string" },
|
|
169
|
+
"fail-on": { type: "string" },
|
|
170
|
+
patterns: { type: "boolean" },
|
|
171
|
+
ml: { type: "boolean" },
|
|
172
|
+
deep: { type: "boolean" },
|
|
118
173
|
pack: { type: "string", multiple: true },
|
|
119
174
|
"no-llm": { type: "boolean" },
|
|
120
175
|
voice: { type: "string", multiple: true },
|
|
@@ -122,6 +177,7 @@ export async function runCli(argv = process.argv.slice(2), io = {}) {
|
|
|
122
177
|
engine: { type: "string" },
|
|
123
178
|
provider: { type: "string" },
|
|
124
179
|
model: { type: "string" },
|
|
180
|
+
concurrency: { type: "string" },
|
|
125
181
|
"dry-run": { type: "boolean" },
|
|
126
182
|
backup: { type: "boolean" },
|
|
127
183
|
lang: { type: "string" },
|
|
@@ -130,6 +186,10 @@ export async function runCli(argv = process.argv.slice(2), io = {}) {
|
|
|
130
186
|
token: { type: "string" },
|
|
131
187
|
endpoint: { type: "string" },
|
|
132
188
|
git: { type: "string" },
|
|
189
|
+
days: { type: "string" },
|
|
190
|
+
limit: { type: "string" },
|
|
191
|
+
command: { type: "string" },
|
|
192
|
+
"older-than": { type: "string" },
|
|
133
193
|
},
|
|
134
194
|
});
|
|
135
195
|
} catch (err) {
|
|
@@ -138,6 +198,17 @@ export async function runCli(argv = process.argv.slice(2), io = {}) {
|
|
|
138
198
|
|
|
139
199
|
const { values, positionals } = parsed;
|
|
140
200
|
|
|
201
|
+
if (values.patterns) {
|
|
202
|
+
throw new DislopConfigError(
|
|
203
|
+
"Flag '--patterns' was removed in dislop v1.x. Use '--pack <names>' (for example '--pack en/prose' or '--pack common/artifact-qa').",
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
if (values.ml || values.deep) {
|
|
207
|
+
throw new DislopConfigError(
|
|
208
|
+
"Flags '--ml' and '--deep' were removed in dislop v1.x. Use '--engine <auto|local|cloud|byok>' or '--no-llm'.",
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
141
212
|
if (values.version) {
|
|
142
213
|
stdout.write(`${CLI_VERSION}\n`);
|
|
143
214
|
return 0;
|
|
@@ -163,14 +234,23 @@ export async function runCli(argv = process.argv.slice(2), io = {}) {
|
|
|
163
234
|
engine: values.engine || null,
|
|
164
235
|
provider: values.provider || null,
|
|
165
236
|
model: values.model || null,
|
|
237
|
+
concurrency: values.concurrency || null,
|
|
166
238
|
dryRun: Boolean(values["dry-run"]),
|
|
167
239
|
backup: Boolean(values.backup),
|
|
168
240
|
lang: values.lang || null,
|
|
241
|
+
stdinFilename: values["stdin-filename"] || null,
|
|
242
|
+
changed: Boolean(values.changed),
|
|
243
|
+
since: values.since || null,
|
|
244
|
+
failOn: values["fail-on"] || null,
|
|
169
245
|
global: Boolean(values.global),
|
|
170
246
|
force: Boolean(values.force),
|
|
171
247
|
token: values.token || null,
|
|
172
248
|
endpoint: values.endpoint || null,
|
|
173
249
|
git: values.git,
|
|
250
|
+
days: values.days || null,
|
|
251
|
+
limit: values.limit || null,
|
|
252
|
+
command: values.command || null,
|
|
253
|
+
olderThan: values["older-than"] || null,
|
|
174
254
|
};
|
|
175
255
|
|
|
176
256
|
switch (subcommand) {
|
|
@@ -194,6 +274,8 @@ export async function runCli(argv = process.argv.slice(2), io = {}) {
|
|
|
194
274
|
return await runPacksCommand(restPositionals, flags, io);
|
|
195
275
|
case "doctor":
|
|
196
276
|
return await runDoctorCommand(restPositionals, flags, io);
|
|
277
|
+
case "worklog":
|
|
278
|
+
return await runWorklogCommand(restPositionals, flags, io);
|
|
197
279
|
case "mcp":
|
|
198
280
|
startStdioMcpServer(io);
|
|
199
281
|
return 0;
|