@bytechain.cn/colamd-themes 0.5.1 → 0.5.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/README.md +25 -11
- package/cordis.patch.yml +9 -0
- package/dist/cli.js +3 -3
- package/dist/dsh-plugin.d.ts +44 -0
- package/dist/dsh-plugin.js +72 -0
- package/dist/dsh-plugin.js.map +1 -0
- package/dist/generator.d.ts +1 -1
- package/dist/generator.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +1 -1
- package/dist/models.js +1 -1
- package/dist/renderer.d.ts +2 -2
- package/dist/renderer.js +3 -3
- package/package.json +22 -2
- package/skills/build-skills.sh +5 -5
- package/skills/colamd-themes/SKILL.md +5 -5
- package/.claude/skills/colamd-themes-preview.skill.md +0 -333
- package/.claude/skills/colamd-themes.skill.md +0 -10
- package/.dsh/skills/colamd-themes/SKILL.md +0 -14
- package/.github/supported-topics.yml +0 -17
- package/.hermes/skills/tools/colamd-themes/SKILL.md +0 -14
- package/.openclaw/skills/colamd-themes/SKILL.md +0 -21
- package/.opencode/skills/colamd-themes/SKILL.md +0 -17
- package/.trae/rules/colamd-themes.md +0 -5
- package/CHANGELOG.md +0 -331
- package/DSH_SUPPORT_SUMMARY.md +0 -87
- package/README_CN.md +0 -412
- package/RELEASENOTE.md +0 -541
- package/mcp-server/dist/index.d.ts +0 -13
- package/mcp-server/dist/index.d.ts.map +0 -1
- package/mcp-server/dist/index.js.map +0 -1
- package/mcp-server/package-lock.json +0 -1759
- package/mcp-server/package.json +0 -24
- package/mcp-server/src/index.ts +0 -0
- package/mcp-server/tsconfig.json +0 -19
- package/src/cli.ts +0 -474
- package/src/color-systems.ts +0 -289
- package/src/color-utils.ts +0 -137
- package/src/contrast.ts +0 -66
- package/src/docx-style-paradigm.ts +0 -811
- package/src/export-cli.ts +0 -356
- package/src/extractors/base.ts +0 -8
- package/src/extractors/docx-extractor.ts +0 -417
- package/src/extractors/pdf-extractor.ts +0 -533
- package/src/extractors/url-extractor.ts +0 -846
- package/src/generator.ts +0 -197
- package/src/index.ts +0 -29
- package/src/models.ts +0 -212
- package/src/renderer.ts +0 -310
- package/src/templates/template.css +0 -220
- package/src/templates/theme-paradigm.md +0 -530
- package/src/templates/theme-template.hbs +0 -256
- package/src/theme-store.ts +0 -185
- package/src/types/pdf-parse.d.ts +0 -12
- package/src/utils/cli-utils.ts +0 -84
- package/src/utils/document-paradigm.ts +0 -118
- package/src/validators.ts +0 -298
- package/themes-preview/demo-content.md +0 -187
- package/tsconfig.json +0 -18
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ A theme development & export toolkit for [ColaMD](https://github.com/cola-md/col
|
|
|
22
22
|
- **`export-html`** — render Markdown to a standalone HTML document with theme CSS embedded, Mermaid diagrams and KaTeX math fully rendered
|
|
23
23
|
- **`export-pdf`** — render Markdown to PDF via Puppeteer (Chromium); theme colors are preserved with `print-color-adjust: exact`
|
|
24
24
|
- **`export`** — batch export multiple files or entire directories to HTML or PDF
|
|
25
|
-
- Powered by `@bytechain.cn/colamd/renderer` (2.x library build, requires `@bytechain.cn/colamd@^2.7.8-rc.
|
|
25
|
+
- Powered by `@bytechain.cn/colamd/renderer` (2.x library build, requires `@bytechain.cn/colamd@^2.7.8-rc.2`) — the same CM6 editor as the app runs headless via Puppeteer. Theme CSS is consumed directly as `:root` declarations, `buildExportHTML({ title })` serializes only contract live variables, and mermaid diagrams (Pele SVG) / KaTeX math stay fully rendered offline. Built-in theme names resolve their local contract CSS first. Generated themes target the **2.7.8-rc.2 contract**, so they carry over unchanged.
|
|
26
26
|
|
|
27
27
|
### Theme Management
|
|
28
28
|
|
|
@@ -36,8 +36,8 @@ A theme development & export toolkit for [ColaMD](https://github.com/cola-md/col
|
|
|
36
36
|
- **Contrast Engine** — WCAG 2.1 relative luminance & contrast ratio calculations
|
|
37
37
|
- **Paradigm Validator** — 15+ design constraint rules (CR, HR, SL, NT, BD, MP, FP, FS, SH) with auto-fix suggestions
|
|
38
38
|
- **Color System Library** — 15 predefined seed palettes across 5 families (Morandi, Macaron, Nordic, Vintage, Mint)
|
|
39
|
-
- **2.7.8-rc.
|
|
40
|
-
- **2.7.8-rc.
|
|
39
|
+
- **2.7.8-rc.2 CSS Contract Validator** — flags dead selectors (`#write`, `.ProseMirror`, `body.theme-custom`), dead variables (`--mermaid-*`, `--radius-*`, `--font-size-root`…), `pt` units, and vertical padding on quote/code lines
|
|
40
|
+
- **2.7.8-rc.2 Verified** — all 16 shipped themes audited against `@bytechain.cn/colamd@2.7.7` (contract unchanged through 2.7.8-rc.2) and smoke-tested on the 2.7.8-rc.2 export pipeline: zero `.cm-md-*` hook drift, all `:root` live variables and `--pele-*` overrides consumed, exports carry exactly the 27 contract live variables
|
|
41
41
|
- **Pele Diagram Colors** — 9 `--pele-*` variables derived from `--code-block-bg` / `--code-block-text` / `--link-color`, replacing the 20 Mermaid variables
|
|
42
42
|
|
|
43
43
|
### Security & Performance (v0.4.0+)
|
|
@@ -51,7 +51,7 @@ A theme development & export toolkit for [ColaMD](https://github.com/cola-md/col
|
|
|
51
51
|
|
|
52
52
|
### CSS Template Engine
|
|
53
53
|
|
|
54
|
-
Handlebars-powered template produces ColaMD 2.7.8-rc.
|
|
54
|
+
Handlebars-powered template produces ColaMD 2.7.8-rc.2 contract CSS (≤300 lines):
|
|
55
55
|
|
|
56
56
|
| Section | Content |
|
|
57
57
|
|---------|---------|
|
|
@@ -130,6 +130,18 @@ bash skills/build-skills.sh dsh
|
|
|
130
130
|
|
|
131
131
|
To customize: edit `skills/colamd-themes/SKILL.md`, then run `npm run build:skills`.
|
|
132
132
|
|
|
133
|
+
### DSH Plugin (dsh-market)
|
|
134
|
+
|
|
135
|
+
The package is also a **DSH (DeepSeek Harness) plugin bundle** installable from dsh-market:
|
|
136
|
+
|
|
137
|
+
- **Plugin contract** — `package.json` declares `dsh.bundle.patch` pointing to [`cordis.patch.yml`](cordis.patch.yml), which inserts the `colamd-themes` Cordis entry into the profile's composition
|
|
138
|
+
- **Host entry** — [`src/dsh-plugin.ts`](src/dsh-plugin.ts) exports the Cordis protocol (`name` / `inject: ["skills"]` / `apply`) and registers the bundled `skills/colamd-themes/SKILL.md` with the Harness `skills` service via `ctx.skills.registerProvider` (same provider protocol as the bundled dsh-ppt plugin)
|
|
139
|
+
- **CLI bins** — `colamd-themes` / `cthemes` ship with the package and become available to profile agents after install
|
|
140
|
+
- **Runtime compatibility** — `@deepseek-ai/dsh-skill` is declared as an *optional* peer (`^0.1.5-rc.1`): the market checks it against the DSH runtime version, while standalone `npm install` is unaffected
|
|
141
|
+
- **Bundle contents** — `dist/` (CLI + host entry), `themes/` (16 contract CSS themes), `skills/` (bundled skill), `cordis.patch.yml`
|
|
142
|
+
|
|
143
|
+
Install from a DSH profile (once published to npm): add `@bytechain.cn/colamd-themes` through the dsh-market UI or `dsh plugin --profile <name> add @bytechain.cn/colamd-themes`.
|
|
144
|
+
|
|
133
145
|
## Installation
|
|
134
146
|
|
|
135
147
|
```bash
|
|
@@ -247,7 +259,7 @@ cthemes set-theme my-brand --remove
|
|
|
247
259
|
| `extract <source>` | Auto-detect source type and extract theme |
|
|
248
260
|
| `color-systems` | List 15 built-in color systems |
|
|
249
261
|
| `list` | List all generated themes |
|
|
250
|
-
| `validate <file>` | Validate a theme against the 2.7.8-rc.
|
|
262
|
+
| `validate <file>` | Validate a theme against the 2.7.8-rc.2 contract and paradigm rules |
|
|
251
263
|
| `set-theme <name>` | Set, register, or remove export themes |
|
|
252
264
|
| `export-html <input>` | Export Markdown → standalone HTML |
|
|
253
265
|
| `export-pdf <input>` | Export Markdown → PDF |
|
|
@@ -288,12 +300,12 @@ Source (URL / .docx / .pdf)
|
|
|
288
300
|
▼
|
|
289
301
|
┌─────────────────────┐
|
|
290
302
|
│ Color System │ Match → 15 built-in palettes
|
|
291
|
-
│ Validators │ WCAG contrast + paradigm + 2.7.8-rc.
|
|
303
|
+
│ Validators │ WCAG contrast + paradigm + 2.7.8-rc.2 contract
|
|
292
304
|
└──────────┬──────────┘
|
|
293
305
|
│
|
|
294
306
|
▼
|
|
295
307
|
┌─────────────────────┐
|
|
296
|
-
│ Template Engine │ Handlebars → 2.7.8-rc.
|
|
308
|
+
│ Template Engine │ Handlebars → 2.7.8-rc.2 CSS (≤300 lines)
|
|
297
309
|
└──────────┬──────────┘
|
|
298
310
|
│
|
|
299
311
|
▼
|
|
@@ -326,7 +338,7 @@ Markdown file
|
|
|
326
338
|
└─────────────────────────────────────────────┘
|
|
327
339
|
```
|
|
328
340
|
|
|
329
|
-
## Design Paradigm (2.7.8-rc.
|
|
341
|
+
## Design Paradigm (2.7.8-rc.2 contract)
|
|
330
342
|
|
|
331
343
|
Full specification: [`templates/theme-paradigm.md`](src/templates/theme-paradigm.md).
|
|
332
344
|
|
|
@@ -363,6 +375,7 @@ ColaMD-themes/
|
|
|
363
375
|
├── .openclaw/skills/colamd-themes/SKILL.md # OpenClaw skill
|
|
364
376
|
├── .hermes/skills/tools/colamd-themes/ # Hermes skill
|
|
365
377
|
├── .trae/rules/colamd-themes.md # Trae rules
|
|
378
|
+
├── cordis.patch.yml # DSH plugin bundle patch (dsh-market)
|
|
366
379
|
├── package.json
|
|
367
380
|
├── tsconfig.json
|
|
368
381
|
├── themes/ # Generated CSS themes
|
|
@@ -374,6 +387,7 @@ ColaMD-themes/
|
|
|
374
387
|
│ ├── renderer.ts # Puppeteer HTML/PDF export engine
|
|
375
388
|
│ ├── export-cli.ts # Export CLI commands
|
|
376
389
|
│ ├── theme-store.ts # Theme config persistence (async API)
|
|
390
|
+
│ ├── dsh-plugin.ts # DSH host entry (Cordis skill provider)
|
|
377
391
|
│ ├── utils/
|
|
378
392
|
│ │ └── cli-utils.ts # Shared utilities & error handling
|
|
379
393
|
│ ├── color-utils.ts # Color manipulation utilities
|
|
@@ -388,7 +402,7 @@ ColaMD-themes/
|
|
|
388
402
|
│ │ └── pdf-extractor.ts # PDF → ThemeStyle
|
|
389
403
|
│ └── templates/
|
|
390
404
|
│ ├── template.css # Paradigm companion CSS
|
|
391
|
-
│ ├── theme-paradigm.md # v4.0 design specification (2.7.8-rc.
|
|
405
|
+
│ ├── theme-paradigm.md # v4.0 design specification (2.7.8-rc.2 contract)
|
|
392
406
|
│ └── theme-template.hbs # Handlebars CSS template
|
|
393
407
|
└── tests/
|
|
394
408
|
```
|
|
@@ -399,14 +413,14 @@ ColaMD-themes/
|
|
|
399
413
|
|-----------|---------|---------|
|
|
400
414
|
| Runtime | Node.js + TypeScript | ESM modules, strict typing |
|
|
401
415
|
| CLI framework | Commander.js | Argument parsing, subcommands |
|
|
402
|
-
| CSS templating | Handlebars | 2.7.8-rc.
|
|
416
|
+
| CSS templating | Handlebars | 2.7.8-rc.2 contract CSS generation |
|
|
403
417
|
| HTML parsing | Cheerio | DOM traversal for URL extraction |
|
|
404
418
|
| CSS parsing | css-tree | CSS rule AST parsing |
|
|
405
419
|
| DOCX parsing | Mammoth | Word → HTML conversion |
|
|
406
420
|
| PDF parsing | pdf-parse | PDF text extraction |
|
|
407
421
|
| HTTP client | Axios | Web page fetching |
|
|
408
422
|
| Browser engine | Puppeteer | Headless Chromium for HTML/PDF export |
|
|
409
|
-
| Editor engine | @bytechain.cn/colamd | CM6-based Markdown renderer (2.7.8-rc.
|
|
423
|
+
| Editor engine | @bytechain.cn/colamd | CM6-based Markdown renderer (2.7.8-rc.2 contract) |
|
|
410
424
|
| Terminal output | Chalk + Ora | Colored text + spinners |
|
|
411
425
|
|
|
412
426
|
## License
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# ColaMD Themes — dsh-market plugin bundle.
|
|
2
|
+
# Inserts the host entry that registers the bundled agent skill with the
|
|
3
|
+
# Harness `skills` service. The CLI bins (colamd-themes / cthemes) ship with
|
|
4
|
+
# the package itself and need no entry.
|
|
5
|
+
- insert:
|
|
6
|
+
- id: colamd-themes
|
|
7
|
+
name: '@bytechain.cn/colamd-themes'
|
|
8
|
+
config:
|
|
9
|
+
enabled: true
|
package/dist/cli.js
CHANGED
|
@@ -226,7 +226,7 @@ async function runExtraction(extractor, source, options) {
|
|
|
226
226
|
}
|
|
227
227
|
if (options.autoMatch)
|
|
228
228
|
style.colorSystemId = "";
|
|
229
|
-
spinner.text = "Generating CSS (2.7.8-rc.
|
|
229
|
+
spinner.text = "Generating CSS (2.7.8-rc.2 contract)...";
|
|
230
230
|
const outputPath = writeThemeFile(style, options.output || options.themesDir);
|
|
231
231
|
spinner.succeed(chalk.green(`Theme "${style.name}" generated: ${outputPath}`));
|
|
232
232
|
printSummary(style);
|
|
@@ -321,7 +321,7 @@ program
|
|
|
321
321
|
// ── validate ──
|
|
322
322
|
program
|
|
323
323
|
.command("validate")
|
|
324
|
-
.description("Validate a theme CSS against the 2.7.8-rc.
|
|
324
|
+
.description("Validate a theme CSS against the 2.7.8-rc.2 contract and paradigm rules")
|
|
325
325
|
.argument("<file>", "Path to theme CSS file")
|
|
326
326
|
.action((file) => {
|
|
327
327
|
if (!existsSync(file)) {
|
|
@@ -341,7 +341,7 @@ program
|
|
|
341
341
|
inkDim: extract("--seed-ink-dim"), border: extract("--seed-border"),
|
|
342
342
|
borderStrong: extract("--seed-border-strong"),
|
|
343
343
|
};
|
|
344
|
-
console.log(chalk.bold("CSS contract (ColaMD 2.7.8-rc.
|
|
344
|
+
console.log(chalk.bold("CSS contract (ColaMD 2.7.8-rc.2):"));
|
|
345
345
|
const cssIssues = validateThemeCss(css);
|
|
346
346
|
console.log(cssIssues.length === 0 ? chalk.green(" ✔ :root 根块与选择器契约通过") : summarizeIssues(cssIssues));
|
|
347
347
|
if (!seed.accent) {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH (DeepSeek Harness) host entry — declares this package as a dsh-market
|
|
3
|
+
* plugin bundle (cordis.patch.yml → dsh.bundle.patch).
|
|
4
|
+
*
|
|
5
|
+
* The entry registers the bundled agent skill (`skills/colamd-themes/SKILL.md`)
|
|
6
|
+
* with the Harness `skills` service, following the same provider protocol as
|
|
7
|
+
* the bundled dsh-ppt plugin. The Harness runtime imports the package root and
|
|
8
|
+
* consumes the `name / inject / apply` exports; the CLI never touches this
|
|
9
|
+
* module, and the skill service import happens only inside `apply()`, so
|
|
10
|
+
* standalone library consumers are unaffected.
|
|
11
|
+
*/
|
|
12
|
+
/** Cordis plugin identity. */
|
|
13
|
+
declare const name = "colamd-themes";
|
|
14
|
+
/** Required host services. */
|
|
15
|
+
declare const inject: string[];
|
|
16
|
+
interface SkillCandidate {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
invocation: {
|
|
20
|
+
modelInvocable: boolean;
|
|
21
|
+
userInvocable: boolean;
|
|
22
|
+
};
|
|
23
|
+
provider: string;
|
|
24
|
+
source: string;
|
|
25
|
+
rank: number;
|
|
26
|
+
locator: string;
|
|
27
|
+
}
|
|
28
|
+
interface SkillProvider {
|
|
29
|
+
name: string;
|
|
30
|
+
list(): Promise<SkillCandidate[]>;
|
|
31
|
+
get(selected: {
|
|
32
|
+
name: string;
|
|
33
|
+
}): Promise<(SkillCandidate & {
|
|
34
|
+
content: string;
|
|
35
|
+
}) | undefined>;
|
|
36
|
+
}
|
|
37
|
+
interface DshPluginContext {
|
|
38
|
+
skills: {
|
|
39
|
+
registerProvider(factory: () => SkillProvider): void;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** Compose the plugin: register the bundled skill provider. */
|
|
43
|
+
declare function apply(ctx: DshPluginContext): Promise<void>;
|
|
44
|
+
export { apply, inject, name };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH (DeepSeek Harness) host entry — declares this package as a dsh-market
|
|
3
|
+
* plugin bundle (cordis.patch.yml → dsh.bundle.patch).
|
|
4
|
+
*
|
|
5
|
+
* The entry registers the bundled agent skill (`skills/colamd-themes/SKILL.md`)
|
|
6
|
+
* with the Harness `skills` service, following the same provider protocol as
|
|
7
|
+
* the bundled dsh-ppt plugin. The Harness runtime imports the package root and
|
|
8
|
+
* consumes the `name / inject / apply` exports; the CLI never touches this
|
|
9
|
+
* module, and the skill service import happens only inside `apply()`, so
|
|
10
|
+
* standalone library consumers are unaffected.
|
|
11
|
+
*/
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
import { readFile } from "node:fs/promises";
|
|
15
|
+
// Ambient shape of the host-provided skill service lives in
|
|
16
|
+
// src/types/dsh-skill.d.ts — the package is never installed at build time.
|
|
17
|
+
/** Cordis plugin identity. */
|
|
18
|
+
const name = "colamd-themes";
|
|
19
|
+
/** Required host services. */
|
|
20
|
+
const inject = ["skills"];
|
|
21
|
+
const PROVIDER = "colamd-themes-bundled";
|
|
22
|
+
const SKILL_NAME = "colamd-themes";
|
|
23
|
+
const DESCRIPTION = "Generate, validate, export, and manage ColaMD 2.7.8-rc.2 contract CSS themes. " +
|
|
24
|
+
"Extract themes from URLs/DOCX/PDF; export Markdown to standalone HTML/PDF.";
|
|
25
|
+
/** Resolve the bundled skill rank; fall back when the host module differs. */
|
|
26
|
+
async function bundledSkillRank() {
|
|
27
|
+
try {
|
|
28
|
+
const mod = (await import("@deepseek-ai/dsh-skill"));
|
|
29
|
+
return mod.BUNDLED_SKILL_RANK ?? 100;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return 100;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Register the bundled ColaMD Themes skill with the Harness skill service. */
|
|
36
|
+
function registerSkill(ctx, skillRoot, rank) {
|
|
37
|
+
const skillPath = path.join(path.resolve(skillRoot), "SKILL.md");
|
|
38
|
+
const content = async () => (await readFile(skillPath, "utf8")).trimEnd();
|
|
39
|
+
const candidate = {
|
|
40
|
+
name: SKILL_NAME,
|
|
41
|
+
description: DESCRIPTION,
|
|
42
|
+
invocation: { modelInvocable: true, userInvocable: true },
|
|
43
|
+
provider: PROVIDER,
|
|
44
|
+
source: "bundled",
|
|
45
|
+
rank,
|
|
46
|
+
locator: skillPath,
|
|
47
|
+
};
|
|
48
|
+
const provider = {
|
|
49
|
+
name: PROVIDER,
|
|
50
|
+
async list() {
|
|
51
|
+
return content().then(() => [candidate]).catch(() => []);
|
|
52
|
+
},
|
|
53
|
+
async get(selected) {
|
|
54
|
+
if (selected.name !== SKILL_NAME)
|
|
55
|
+
return undefined;
|
|
56
|
+
try {
|
|
57
|
+
return { ...candidate, content: await content() };
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
ctx.skills.registerProvider(() => provider);
|
|
65
|
+
}
|
|
66
|
+
/** Compose the plugin: register the bundled skill provider. */
|
|
67
|
+
async function apply(ctx) {
|
|
68
|
+
const skillRoot = fileURLToPath(new URL("../skills/colamd-themes", import.meta.url));
|
|
69
|
+
registerSkill(ctx, skillRoot, await bundledSkillRank());
|
|
70
|
+
}
|
|
71
|
+
export { apply, inject, name };
|
|
72
|
+
//# sourceMappingURL=dsh-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dsh-plugin.js","sourceRoot":"","sources":["../src/dsh-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,4DAA4D;AAC5D,2EAA2E;AAE3E,8BAA8B;AAC9B,MAAM,IAAI,GAAG,eAAe,CAAC;AAE7B,8BAA8B;AAC9B,MAAM,MAAM,GAAG,CAAC,QAAQ,CAAC,CAAC;AAE1B,MAAM,QAAQ,GAAG,uBAAuB,CAAC;AACzC,MAAM,UAAU,GAAG,eAAe,CAAC;AACnC,MAAM,WAAW,GACf,gFAAgF;IAChF,4EAA4E,CAAC;AAwB/E,8EAA8E;AAC9E,KAAK,UAAU,gBAAgB;IAC7B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAoC,CAAC;QACxF,OAAO,GAAG,CAAC,kBAAkB,IAAI,GAAG,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC;AAED,+EAA+E;AAC/E,SAAS,aAAa,CAAC,GAAqB,EAAE,SAAiB,EAAE,IAAY;IAC3E,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC1E,MAAM,SAAS,GAAmB;QAChC,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,WAAW;QACxB,UAAU,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;QACzD,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,SAAS;QACjB,IAAI;QACJ,OAAO,EAAE,SAAS;KACnB,CAAC;IACF,MAAM,QAAQ,GAAkB;QAC9B,IAAI,EAAE,QAAQ;QACd,KAAK,CAAC,IAAI;YACR,OAAO,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,QAAQ;YAChB,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU;gBAAE,OAAO,SAAS,CAAC;YACnD,IAAI,CAAC;gBACH,OAAO,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,EAAE,EAAE,CAAC;YACpD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;KACF,CAAC;IACF,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED,+DAA+D;AAC/D,KAAK,UAAU,KAAK,CAAC,GAAqB;IACxC,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACrF,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,gBAAgB,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/generator.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CSS theme file generator — v4.0 seed palette pipeline (ColaMD 2.7.8-rc.
|
|
1
|
+
/** CSS theme file generator — v4.0 seed palette pipeline (ColaMD 2.7.8-rc.2 contract). */
|
|
2
2
|
import type { ThemeStyle } from "./models.js";
|
|
3
3
|
/**
|
|
4
4
|
* Clear all cached templates to free memory.
|
package/dist/generator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CSS theme file generator — v4.0 seed palette pipeline (ColaMD 2.7.8-rc.
|
|
1
|
+
/** CSS theme file generator — v4.0 seed palette pipeline (ColaMD 2.7.8-rc.2 contract). */
|
|
2
2
|
import Handlebars from "handlebars";
|
|
3
3
|
import { readFileSync, writeFileSync, mkdirSync, existsSync, statSync } from "node:fs";
|
|
4
4
|
import { join, dirname, isAbsolute } from "node:path";
|
|
@@ -130,7 +130,7 @@ export function generateCss(style) {
|
|
|
130
130
|
...style,
|
|
131
131
|
codeBlockText: pickCodeBlockText(style.seed.panelAlt, style.seed),
|
|
132
132
|
});
|
|
133
|
-
// 6. Self-check the rendered CSS against the 2.7.8-rc.
|
|
133
|
+
// 6. Self-check the rendered CSS against the 2.7.8-rc.2 contract
|
|
134
134
|
const cssIssues = validateThemeCss(css).filter((i) => i.level === "MUST" || i.level === "MUST_NOT");
|
|
135
135
|
if (cssIssues.length > 0) {
|
|
136
136
|
console.warn("CSS contract issues:", summarizeIssues(cssIssues));
|
package/dist/index.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export { PdfExtractor } from "./extractors/pdf-extractor.js";
|
|
|
8
8
|
export type { Extractor } from "./extractors/base.js";
|
|
9
9
|
export { ACADEMIC_PAPER_DEFAULTS, BUSINESS_REPORT_DEFAULTS, TECHNICAL_DOC_DEFAULTS, generatePrintFriendlyGrayscale, generateMorandiPrintPalette, validateDocumentStyle, normalizeForPrinting, getRecommendedPreset, DOCUMENT_STYLE_PRESETS, } from "./docx-style-paradigm.js";
|
|
10
10
|
export type { DocumentStyleParadigm, FontStyleDefinition, TableCellStyle, PrintOptimization, StyleValidationIssue, } from "./docx-style-paradigm.js";
|
|
11
|
+
export { apply, inject, name } from "./dsh-plugin.js";
|
package/dist/index.js
CHANGED
|
@@ -6,4 +6,6 @@ export { UrlExtractor } from "./extractors/url-extractor.js";
|
|
|
6
6
|
export { DocxExtractor } from "./extractors/docx-extractor.js";
|
|
7
7
|
export { PdfExtractor } from "./extractors/pdf-extractor.js";
|
|
8
8
|
export { ACADEMIC_PAPER_DEFAULTS, BUSINESS_REPORT_DEFAULTS, TECHNICAL_DOC_DEFAULTS, generatePrintFriendlyGrayscale, generateMorandiPrintPalette, validateDocumentStyle, normalizeForPrinting, getRecommendedPreset, DOCUMENT_STYLE_PRESETS, } from "./docx-style-paradigm.js";
|
|
9
|
+
// DSH (dsh-market) plugin protocol exports — consumed by the Harness runtime.
|
|
10
|
+
export { apply, inject, name } from "./dsh-plugin.js";
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAUlC,8EAA8E;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/models.d.ts
CHANGED
package/dist/models.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Theme style data models — v4.0 Seed Palette paradigm (ColaMD 2.7.8-rc.
|
|
1
|
+
/** Theme style data models — v4.0 Seed Palette paradigm (ColaMD 2.7.8-rc.2 contract). */
|
|
2
2
|
// ═══════════════════════════════════════════════════════════
|
|
3
3
|
// Defaults
|
|
4
4
|
// ═══════════════════════════════════════════════════════════
|
package/dist/renderer.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Puppeteer-based rendering engine for ColaMD HTML/PDF export.
|
|
3
3
|
*
|
|
4
4
|
* Uses the @bytechain.cn/colamd 2.x library build (dist/lib/colamd-renderer.js +
|
|
5
|
-
* colamd.css, requires ≥2.7.8-rc.
|
|
5
|
+
* colamd.css, requires ≥2.7.8-rc.2) to create a headless editor, apply themes,
|
|
6
6
|
* render mermaid/math, and export standalone HTML or PDF. Theme CSS targets the
|
|
7
|
-
* ColaMD 2.7.8-rc.
|
|
7
|
+
* ColaMD 2.7.8-rc.2 contract (machine-readable as themes/contract.json in the
|
|
8
8
|
* npm package) and is consumed directly as `:root` declarations.
|
|
9
9
|
*
|
|
10
10
|
* Architecture:
|
package/dist/renderer.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Puppeteer-based rendering engine for ColaMD HTML/PDF export.
|
|
3
3
|
*
|
|
4
4
|
* Uses the @bytechain.cn/colamd 2.x library build (dist/lib/colamd-renderer.js +
|
|
5
|
-
* colamd.css, requires ≥2.7.8-rc.
|
|
5
|
+
* colamd.css, requires ≥2.7.8-rc.2) to create a headless editor, apply themes,
|
|
6
6
|
* render mermaid/math, and export standalone HTML or PDF. Theme CSS targets the
|
|
7
|
-
* ColaMD 2.7.8-rc.
|
|
7
|
+
* ColaMD 2.7.8-rc.2 contract (machine-readable as themes/contract.json in the
|
|
8
8
|
* npm package) and is consumed directly as `:root` declarations.
|
|
9
9
|
*
|
|
10
10
|
* Architecture:
|
|
@@ -38,7 +38,7 @@ function findRendererPath() {
|
|
|
38
38
|
const version = JSON.parse(readFileSync(pkgJson, "utf-8")).version;
|
|
39
39
|
if (version.startsWith("2.")) {
|
|
40
40
|
throw new Error(`@bytechain.cn/colamd ${version} 不含 colamd-renderer.js 库入口(2.7.8 起恢复提供)。` +
|
|
41
|
-
"请升级: npm install @bytechain.cn/colamd@^2.7.8-rc.
|
|
41
|
+
"请升级: npm install @bytechain.cn/colamd@^2.7.8-rc.2");
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytechain.cn/colamd-themes",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Theme development & export tool for ColaMD — extract formatting, generate themes, and export Markdown to HTML/PDF",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"dsh",
|
|
23
|
+
"dsh-plugin",
|
|
23
24
|
"deepseek-harness",
|
|
24
25
|
"colamd",
|
|
25
26
|
"themes",
|
|
@@ -31,8 +32,27 @@
|
|
|
31
32
|
"ai-agent",
|
|
32
33
|
"agent-skill"
|
|
33
34
|
],
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"themes",
|
|
38
|
+
"skills",
|
|
39
|
+
"cordis.patch.yml"
|
|
40
|
+
],
|
|
41
|
+
"dsh": {
|
|
42
|
+
"bundle": {
|
|
43
|
+
"patch": "./cordis.patch.yml"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@deepseek-ai/dsh-skill": "^0.1.5-rc.1"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"@deepseek-ai/dsh-skill": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
34
54
|
"dependencies": {
|
|
35
|
-
"@bytechain.cn/colamd": "^2.7.8-rc.
|
|
55
|
+
"@bytechain.cn/colamd": "^2.7.8-rc.2",
|
|
36
56
|
"axios": "^1.7",
|
|
37
57
|
"chalk": "^5.3",
|
|
38
58
|
"cheerio": "^1.0",
|
package/skills/build-skills.sh
CHANGED
|
@@ -26,7 +26,7 @@ BODY=$(sed -n '/^$/,$ { /^# ColaMD/!p; }' "$SOURCE" | sed '1{/^$/d;}')
|
|
|
26
26
|
FRONT_CLAUDE='---
|
|
27
27
|
name: colamd-themes
|
|
28
28
|
description: >
|
|
29
|
-
Generate, validate, export, and manage ColaMD 2.7.
|
|
29
|
+
Generate, validate, export, and manage ColaMD 2.7.8-rc.2 contract CSS themes.
|
|
30
30
|
Extract formatting from URLs, DOCX, or PDF sources; export Markdown to
|
|
31
31
|
standalone HTML/PDF with themes applied; batch export; manage theme
|
|
32
32
|
configuration.
|
|
@@ -36,7 +36,7 @@ FRONT_OPENCODE='---
|
|
|
36
36
|
name: colamd-themes
|
|
37
37
|
version: "1.0.0"
|
|
38
38
|
description: >
|
|
39
|
-
Generate, validate, export, and manage ColaMD 2.7.
|
|
39
|
+
Generate, validate, export, and manage ColaMD 2.7.8-rc.2 contract CSS themes.
|
|
40
40
|
Extract from URLs/DOCX/PDF; export Markdown to HTML/PDF; batch export.
|
|
41
41
|
user-invocable: true
|
|
42
42
|
allowed-tools:
|
|
@@ -52,7 +52,7 @@ FRONT_OPENCLAW='---
|
|
|
52
52
|
id: colamd-themes
|
|
53
53
|
name: ColaMD Themes
|
|
54
54
|
description: >
|
|
55
|
-
Generate, validate, export, and manage ColaMD 2.7.
|
|
55
|
+
Generate, validate, export, and manage ColaMD 2.7.8-rc.2 contract CSS themes.
|
|
56
56
|
Extract from URLs/DOCX/PDF; export Markdown to HTML/PDF; batch export.
|
|
57
57
|
version: "1.0.0"
|
|
58
58
|
icon: "\U0001F3A8"
|
|
@@ -70,7 +70,7 @@ metadata:
|
|
|
70
70
|
|
|
71
71
|
FRONT_HERMES='---
|
|
72
72
|
name: colamd-themes
|
|
73
|
-
description: "Generate, validate, export, and manage ColaMD 2.7.
|
|
73
|
+
description: "Generate, validate, export, and manage ColaMD 2.7.8-rc.2 contract CSS themes."
|
|
74
74
|
version: 1.0.0
|
|
75
75
|
author: bytechain
|
|
76
76
|
license: MIT
|
|
@@ -85,7 +85,7 @@ FRONT_DSH='---
|
|
|
85
85
|
name: colamd-themes
|
|
86
86
|
version: "1.0.0"
|
|
87
87
|
description: >
|
|
88
|
-
Generate, validate, export, and manage ColaMD 2.7.
|
|
88
|
+
Generate, validate, export, and manage ColaMD 2.7.8-rc.2 contract CSS themes.
|
|
89
89
|
Extract from URLs/DOCX/PDF; export Markdown to HTML/PDF; batch export.
|
|
90
90
|
metadata:
|
|
91
91
|
dsh:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ColaMD Themes — Universal AI Agent Skill
|
|
2
2
|
|
|
3
|
-
Generate, validate, export, and manage ColaMD **2.7.
|
|
3
|
+
Generate, validate, export, and manage ColaMD **2.7.8-rc.2 contract** CSS themes. Extract formatting from URLs, DOCX, or PDF sources; export Markdown to standalone HTML/PDF with themes applied; batch export; manage theme configuration.
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
@@ -121,14 +121,14 @@ Export uses Puppeteer (headless Chromium) with `@bytechain.cn/colamd/renderer`:
|
|
|
121
121
|
|
|
122
122
|
1. Local HTTP server serves renderer ESM bundle (avoids CORS)
|
|
123
123
|
2. Puppeteer navigates to server page (same-origin)
|
|
124
|
-
3. `createColaMDEditor({ editable: false })` initializes
|
|
124
|
+
3. `createColaMDEditor({ editable: false })` initializes the CM6 editor
|
|
125
125
|
4. `applyTheme(name, customCSS?)` sets theme
|
|
126
126
|
5. `setMarkdown(content)` loads document
|
|
127
127
|
6. `ensureAllPluginsRendered()` waits for mermaid/KaTeX
|
|
128
128
|
7. `buildExportHTML()` → standalone HTML with embedded CSS
|
|
129
129
|
8. For PDF: `emulateMediaType('screen')` + `page.pdf()`
|
|
130
130
|
|
|
131
|
-
## 2.7.
|
|
131
|
+
## 2.7.8-rc.2 Contract Constraints
|
|
132
132
|
|
|
133
133
|
- Variables live in `:root`; anything in `body.theme-*` is ignored
|
|
134
134
|
- Live variables only: `--bg-color --text-color --text-secondary --text-muted --border-color --link-color --code-bg --code-block-bg --code-block-text --blockquote-border --blockquote-bg --table-header-bg --selection-bg --highlight-bg --font-body --font-mono --editor-font-size --editor-column-width` + `--pele-*`
|
|
@@ -172,9 +172,9 @@ Export uses Puppeteer (headless Chromium) with `@bytechain.cn/colamd/renderer`:
|
|
|
172
172
|
## Architecture
|
|
173
173
|
|
|
174
174
|
```
|
|
175
|
-
Source → Extractor → ThemeStyle → Color System + Pele + Validators → CSS (2.7.
|
|
175
|
+
Source → Extractor → ThemeStyle → Color System + Pele + Validators → CSS (2.7.8-rc.2 contract)
|
|
176
176
|
|
|
177
177
|
Markdown → Puppeteer + ColaMD renderer → HTML / PDF
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
> Export runs the
|
|
180
|
+
> Export runs the ColaMD 2.x library renderer (`@bytechain.cn/colamd@^2.7.8-rc.2` ships `dist/lib/colamd-renderer.js` + `colamd.css`); the same CM6 editor as the app runs headless via Puppeteer. Theme CSS is consumed directly as `:root` declarations and `buildExportHTML({ title })` serializes only contract live variables. Generated CSS targets the 2.7.8-rc.2 contract (unchanged since 2.7.7, machine-readable as `themes/contract.json` in the npm package), so it carries over unchanged.
|