dislop 0.0.0-stage → 0.6.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/.agents/plugins/marketplace.json +20 -0
- package/.claude-plugin/marketplace.json +33 -0
- package/.claude-plugin/plugin.json +22 -0
- package/.codex-plugin/plugin.json +49 -0
- package/.mcp.json +12 -0
- package/.pre-commit-hooks.yaml +13 -0
- package/LICENSE +202 -0
- package/README.md +222 -2
- package/README.zh-CN.md +219 -0
- package/action.yml +90 -0
- package/assets/logo.svg +8 -0
- package/bin/dislop-mcp.mjs +5 -0
- package/bin/dislop.mjs +1967 -0
- package/gemini-extension.json +13 -0
- package/mcp.json +13 -0
- package/models/manifest.json +90 -0
- package/models/pocket-slop-v1.json +1 -0
- package/package.json +89 -4
- package/packs/business-brief/pack.json +598 -0
- package/packs/core/pack.json +192 -0
- package/packs/deck-and-ui/pack.json +290 -0
- package/packs/engineering-spec/pack.json +144 -0
- package/packs/executive-deck/pack.json +98 -0
- package/packs/literary-essay/pack.json +324 -0
- package/packs/regulated-comms/pack.json +99 -0
- package/patterns/README.md +39 -0
- package/patterns/banks/composite-fusion.json +36 -0
- package/patterns/banks/discourse-rhythm.json +95 -0
- package/patterns/banks/lexical-signals.json +74 -0
- package/patterns/banks/syntactic-frames.json +45 -0
- package/patterns/banks/visual-deck.json +37 -0
- package/patterns/dimensions/artifacts.json +121 -0
- package/patterns/dimensions/discourse.json +412 -0
- package/patterns/dimensions/lexical.json +172 -0
- package/patterns/dimensions/rhythm.json +206 -0
- package/patterns/dimensions/syntactic.json +285 -0
- package/patterns/dimensions/visual-and-deck.json +322 -0
- package/patterns/taxonomy.json +112 -0
- package/plugin.json +41 -0
- package/server.json +50 -0
- package/skills/dislop/SKILL.md +60 -0
- package/skills/dislop/agents/openai.yaml +6 -0
- package/skills/dislop/references/business-and-rfc.md +26 -0
- package/skills/dislop/references/editorial-and-essay.md +20 -0
- package/skills/dislop/references/regulated-and-precision.md +27 -0
- package/skills/dislop/references/web-ui-and-deck.md +26 -0
- package/src/binary-node.mjs +85 -0
- package/src/core.mjs +2488 -0
- package/src/local-model.mjs +977 -0
- package/src/pattern-engine.mjs +853 -0
- package/src/pocket-model.mjs +707 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Regulated External Comms & Rewrite Precision
|
|
2
|
+
|
|
3
|
+
Local progressive-disclosure reference bundled with `skills/dislop/` (0 network calls required).
|
|
4
|
+
|
|
5
|
+
## Recommended Built-in Pack
|
|
6
|
+
|
|
7
|
+
- Customer announcements, security or SLA briefs, investor updates, and regulated external copy: `--pack regulated-comms`
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
dislop check <draft.md> --pack regulated-comms --fail-on warning
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Regulated & External Copy Traps
|
|
14
|
+
|
|
15
|
+
1. **No absolute compliance promises (`reg-unsubstantiated-superlative`)**: Replace `"100% secure"`, `"zero-risk migration"`, or `"industry-leading guarantee"` with specific encryption standards, audit scope, and contracted SLA percentages (`99.95% monthly uptime`).
|
|
16
|
+
2. **No unanchored multipliers (`reg-unanchored-multiplier`)**: Never write `"10x faster"` or `"orders of magnitude better"` without stating the exact before and after baseline in the same sentence (`"cuts 40M-row queries from 19s to 1.9s"`).
|
|
17
|
+
|
|
18
|
+
## Precision Discipline During Manual & Automated Rewrites
|
|
19
|
+
|
|
20
|
+
When trimming AI clichés from technical or regulated drafts, keep four token classes untouched:
|
|
21
|
+
|
|
22
|
+
1. **Bounding qualifiers attached to numbers**: Keep `"up to 12 minutes"`, `"at least 99.95%"`, `"no more than 5%"`, and `"as of Q4"` intact. Dropping `"up to"` turns an upper bound into a false point guarantee.
|
|
23
|
+
2. **Exact numbers, units, versions, and percentiles**: Never replace `1,200 -> 4,800 TPS` or `P99 42ms` with vague words like `"massive speedup"`, and never invent numbers absent from the source.
|
|
24
|
+
3. **Inline code identifiers and file paths**: Preserve config keys, CLI flags, issue numbers, and file paths verbatim.
|
|
25
|
+
4. **URLs and citations**: Keep real links and `[n]` or `(Author, Year)` citations attached to their claims (`unsourced-attribution`).
|
|
26
|
+
|
|
27
|
+
Automated rewrites via `dislop deslop --local` or hosted cloud `dislop_deslop` run an internal numeric and qualifier retention guard automatically and revert any paragraph that alters protected figures.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Web UI, Front-End Components & Executive Slide Decks
|
|
2
|
+
|
|
3
|
+
Local progressive-disclosure reference bundled with `skills/dislop/` (0 network calls required).
|
|
4
|
+
|
|
5
|
+
## Recommended Built-in Packs
|
|
6
|
+
|
|
7
|
+
- Web pages, CSS, JSX/TSX components, and general slides: `--pack deck-and-ui`
|
|
8
|
+
- Board readouts, consulting decks, and strategy `.pptx` files: `--pack executive-deck`
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
dislop check <deck.pptx-or-dir> --pack executive-deck --fail-on warning
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Web UI Anti-Slop Rules
|
|
15
|
+
|
|
16
|
+
1. **Zero dead controls (`ui-dead-control`, severity `error`)**: Never ship `<a href="#">`, empty `href=""`, or unexplained `<button disabled>`. Wire real routes, add `title` or `aria-describedby` explaining why a control is disabled, or remove unbuilt mockup buttons.
|
|
17
|
+
2. **Skip both generations of default AI templates**:
|
|
18
|
+
- Generation 1: indigo-purple-pink neon gradients (`ui-ai-gradient`), `bg-clip-text text-transparent` hero titles, `> 6` `rounded-full` pill badges per view (`ui-pill-soup`), triple nested bordered boxes (`ui-box-in-box`), and `"AI-Powered"` or `"Zero Hallucination"` eyebrow badges (`ui-prompt-echo-badge`).
|
|
19
|
+
- Generation 2: generic warm-beige `#F7F5F0` cards with identical 3-column icon boxes.
|
|
20
|
+
3. **Positive layout grammar**: Favor explicit structural `1px` rules or clear typographic hierarchy, `tabular-nums` on aligned metrics, monotonic dark-mode surface lightness (`stage < sheet < raised`), and system or deliberate editorial type stacks.
|
|
21
|
+
|
|
22
|
+
## Slide Deck & `.pptx` Rules
|
|
23
|
+
|
|
24
|
+
1. **Conclusion-first headlines (`slide-weak-topic-title`, `slide-process-not-finding-title`)**: Replace `"Overview"`, `"Analysis of Q3 Churn"`, or `"Review of Deployment Pipeline"` with the one-sentence takeaway and measured delta (`"Simplified KYC Cut Week-1 Drop-off from 34% to 19%"`).
|
|
25
|
+
2. **Readable slide density**: Keep each visible slide `<= 120` words, `<= 5–6` bullets, and `100%` text scale (`normAutofit >= 80%`).
|
|
26
|
+
3. **Break cross-slide layout monotony (`pptx-layout-monotony`)**: Do not repeat identical plain-bullet skeletons across 4+ consecutive slides; convert comparisons into tables and trends into charts.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { inflateRawSync } from "node:zlib";
|
|
2
|
+
|
|
3
|
+
const MAX_ZIP_ENTRIES = 3000;
|
|
4
|
+
const MAX_UNCOMPRESSED_BYTES = 120 * 1024 * 1024; // 120 MB zip-bomb ceiling
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Pure Node.js standard-library ZIP reader for OOXML (`.docx`, `.pptx`).
|
|
8
|
+
* Parses the End of Central Directory (EOCD) and Central Directory entries.
|
|
9
|
+
*/
|
|
10
|
+
export function readZipXmlEntries(buffer) {
|
|
11
|
+
if (buffer.length < 22 || buffer[0] !== 0x50 || buffer[1] !== 0x4b) {
|
|
12
|
+
throw new Error("Invalid OOXML ZIP header");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Locate EOCD signature 0x06054b50 within last 65 KB
|
|
16
|
+
const minOffset = Math.max(0, buffer.length - 65557);
|
|
17
|
+
let eocdOffset = -1;
|
|
18
|
+
for (let i = buffer.length - 22; i >= minOffset; i -= 1) {
|
|
19
|
+
if (buffer.readUInt32LE(i) === 0x06054b50) {
|
|
20
|
+
eocdOffset = i;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (eocdOffset === -1) {
|
|
25
|
+
throw new Error("Could not locate ZIP End-of-Central-Directory record");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const totalEntries = buffer.readUInt16LE(eocdOffset + 10);
|
|
29
|
+
if (totalEntries > MAX_ZIP_ENTRIES) {
|
|
30
|
+
throw new Error(`Archive exceeds maximum entry cap (${totalEntries} > ${MAX_ZIP_ENTRIES})`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const cdSize = buffer.readUInt32LE(eocdOffset + 12);
|
|
34
|
+
const cdOffset = buffer.readUInt32LE(eocdOffset + 16);
|
|
35
|
+
if (cdOffset + cdSize > buffer.length) {
|
|
36
|
+
throw new Error("Truncated ZIP central directory");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const entries = {};
|
|
40
|
+
let totalUncompressed = 0;
|
|
41
|
+
let ptr = cdOffset;
|
|
42
|
+
|
|
43
|
+
for (let i = 0; i < totalEntries && ptr + 46 <= cdOffset + cdSize; i += 1) {
|
|
44
|
+
if (buffer.readUInt32LE(ptr) !== 0x02014b50) break;
|
|
45
|
+
const method = buffer.readUInt16LE(ptr + 10);
|
|
46
|
+
const compSize = buffer.readUInt32LE(ptr + 20);
|
|
47
|
+
const uncompSize = buffer.readUInt32LE(ptr + 24);
|
|
48
|
+
const nameLen = buffer.readUInt16LE(ptr + 28);
|
|
49
|
+
const extraLen = buffer.readUInt16LE(ptr + 30);
|
|
50
|
+
const commentLen = buffer.readUInt16LE(ptr + 32);
|
|
51
|
+
const localHeaderOffset = buffer.readUInt32LE(ptr + 42);
|
|
52
|
+
|
|
53
|
+
const name = buffer.subarray(ptr + 46, ptr + 46 + nameLen).toString("utf8");
|
|
54
|
+
ptr += 46 + nameLen + extraLen + commentLen;
|
|
55
|
+
|
|
56
|
+
if (!/\.(?:xml|rels)$/i.test(name)) continue;
|
|
57
|
+
|
|
58
|
+
totalUncompressed += uncompSize;
|
|
59
|
+
if (totalUncompressed > MAX_UNCOMPRESSED_BYTES) {
|
|
60
|
+
throw new Error("OOXML uncompressed XML payload exceeds 120 MB safety ceiling");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (localHeaderOffset + 30 > buffer.length || buffer.readUInt32LE(localHeaderOffset) !== 0x04034b50) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const localNameLen = buffer.readUInt16LE(localHeaderOffset + 26);
|
|
67
|
+
const localExtraLen = buffer.readUInt16LE(localHeaderOffset + 28);
|
|
68
|
+
const dataStart = localHeaderOffset + 30 + localNameLen + localExtraLen;
|
|
69
|
+
const dataEnd = dataStart + compSize;
|
|
70
|
+
if (dataEnd > buffer.length) continue;
|
|
71
|
+
|
|
72
|
+
const rawSlice = buffer.subarray(dataStart, dataEnd);
|
|
73
|
+
let outBuf;
|
|
74
|
+
if (method === 0) {
|
|
75
|
+
outBuf = rawSlice;
|
|
76
|
+
} else if (method === 8) {
|
|
77
|
+
outBuf = inflateRawSync(rawSlice, { maxOutputLength: MAX_UNCOMPRESSED_BYTES });
|
|
78
|
+
} else {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
entries[name] = outBuf.toString("utf8");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return entries;
|
|
85
|
+
}
|