@open-agent-toolkit/cli 0.3.34 → 0.3.35

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 CHANGED
@@ -49,7 +49,7 @@ For an approved fresh reader model, pass `--ia-preset <preset> --planned-pages <
49
49
 
50
50
  Fumadocs static exports include `llms.txt`, `llms-full.txt` and `llms/<page-slugs>/content.md` (root `llms/content.md`) for loaded `.md` readers. These retain authored Markdown and source-relative-link guidance; configured non-readers and MDX are excluded. Use authored Contents maps and `oat docs nav sync`, followed by `--check`, for navigation changes.
51
51
 
52
- `oat docs check [--target-dir <dir>] [--rule <id>...] [--json]` performs read-only reader, navigation, contributor-command and Mermaid/SVG checks without a site build. Errors exit 1; warnings exit 0. Configure validated severities, numeric thresholds and reason-bearing exceptions under `documentation.check`. Mermaid syntax parsing lazily uses a real DOM with strict sanitization and no script/resource execution; Node 22.17 remains the minimum. See [checker rules and configuration](../../apps/oat-docs/docs/docs-tooling/check.md).
52
+ `oat docs check [--target-dir <dir>] [--rule <id>...] [--json]` performs read-only reader, navigation, contributor-command and Mermaid/SVG checks without a site build. Errors exit 1; warnings exit 0. Configure validated severities, numeric thresholds and reason-bearing exceptions under `documentation.check`. Mermaid syntax parsing lazily loads the pinned Pele parser, which needs no DOM and never renders; Node 22.17 remains the minimum. See [checker rules and configuration](../../apps/oat-docs/docs/docs-tooling/check.md).
53
53
 
54
54
  `oat docs literals [--target-dir <dir>] --page <content-relative-reader.md> --source-root <repo-relative-dir> [--source-exclude <pattern>] --json` supplies read-only inline-code occurrence candidates for a matching triad IA mirror. Repeat each single-value selection flag as needed. Sources stay within narrow explicit implementation roots; searched/skipped evidence and first source physical lines are reported. Once-only strict HTML entity decoding and case-sensitive line-local substring matching do not establish runtime validity; analyze judges canonical relevance and authored IA acceptance. Completed not-found/not-applicable exits 0, input/config errors 1, unexpected failures 2. See [literal helper scope and limits](../../apps/oat-docs/docs/docs-tooling/commands.md#oat-docs-literals).
55
55
 
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "oatVersion": "0.3.34"
3
+ "oatVersion": "0.3.35"
4
4
  }
@@ -107,7 +107,7 @@ recursive tabs participate.
107
107
  | `contents-separator` | Warn when Contents descriptions mix separators in a tree. |
108
108
  | `navigation` | Error for explicit navigation drift. Nav-sync freshness stays strict; hand-authored/undeclared compare membership and order only (separators, labels, links and borrows are not compared), and absent optional meta/pages/nav skips comparison. Markdown skips it. |
109
109
  | `commands` | Error for missing literal contributor scripts; framework app targets try the app package first, then the repository root. Implicit pnpm shorthand also accepts installed package/workspace `.bin` entries. Explicit pnpm run/npm run stays script-only; unresolved context errors; echo scripts warn. |
110
- | `mermaid` | Parse every real Mermaid fence using the pinned Mermaid parser. Invalid syntax errors. |
110
+ | `mermaid` | Parse every real Mermaid fence with the pinned Pele parser. Invalid syntax errors, with the diagram line and column. |
111
111
  | `diagram-pairs` | Diagram light/dark SVG siblings and both page references are required. Conventional diagram paths and explicit paired references participate; ordinary logos are not diagrams. |
112
112
  | `diagram-accessibility` | Mermaid missing `accTitle`/`accDescr` warns. SVGs require `role="img"`, nonempty title/desc. Rendered diagrams without page-visible explanatory text or an associated long description warn. |
113
113
  | `diagram-freshness` | Warn when changed Mermaid lacks both associated SVG changes; association follows the actual section/tab group. Missing usable Git comparison is explicitly unverified. |
@@ -140,9 +140,9 @@ binary shorthand may be reported missing. Use `pnpm exec` for explicit binary ex
140
140
 
141
141
  ## Diagram comparison and limits
142
142
 
143
- Syntax validation lazily loads the pinned Mermaid parser with a real Node DOM
144
- and strict sanitization; script execution and resource loading stay disabled.
145
- It does not render or prove semantic/visual correctness. Inspect both themes
143
+ Syntax validation lazily loads the pinned Pele parser, which reads Mermaid
144
+ syntax without a DOM and never renders, runs scripts or loads resources.
145
+ It does not prove semantic/visual correctness. Inspect both themes
146
146
  for important diagrams. Put meaningful `accTitle` and `accDescr` in Mermaid,
147
147
  keep SVG title/desc and page explanations, and change both theme SVGs with source.
148
148
 
@@ -1,6 +1,6 @@
1
1
  {
2
- "cli": "0.3.34",
3
- "docs-config": "0.3.34",
4
- "docs-theme": "0.3.34",
5
- "docs-transforms": "0.3.34"
2
+ "cli": "0.3.35",
3
+ "docs-config": "0.3.35",
4
+ "docs-theme": "0.3.35",
5
+ "docs-transforms": "0.3.35"
6
6
  }
@@ -1,3 +1,3 @@
1
- /** Lazy, real Node DOM for Mermaid syntax parsing only. Never renders SVG. */
1
+ /** Mermaid syntax check with the pinned, DOM-free Pele parser. Never renders. */
2
2
  export declare function parseMermaid(source: string): Promise<void>;
3
3
  //# sourceMappingURL=mermaid-runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mermaid-runtime.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/check/mermaid-runtime.ts"],"names":[],"mappings":"AA6CA,8EAA8E;AAC9E,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAehE"}
1
+ {"version":3,"file":"mermaid-runtime.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/check/mermaid-runtime.ts"],"names":[],"mappings":"AAyBA,iFAAiF;AACjF,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhE"}
@@ -1,57 +1,32 @@
1
1
  let runtime;
2
- let queue = Promise.resolve();
3
- async function withDom(dom, action) {
4
- const keys = ['window', 'document'];
5
- const saved = keys.map((key) => Object.getOwnPropertyDescriptor(globalThis, key));
6
- Object.defineProperty(globalThis, 'window', {
7
- configurable: true,
8
- value: dom.window,
9
- });
10
- Object.defineProperty(globalThis, 'document', {
11
- configurable: true,
12
- value: dom.window.document,
13
- });
14
- try {
15
- return await action();
16
- }
17
- finally {
18
- keys.forEach((key, index) => {
19
- const descriptor = saved[index];
20
- if (descriptor)
21
- Object.defineProperty(globalThis, key, descriptor);
22
- else
23
- Reflect.deleteProperty(globalThis, key);
24
- });
25
- }
2
+ /**
3
+ * Pele reports syntax errors in Mermaid's multi-line form: a "Parse error on
4
+ * line N:" header, the offending source line, a caret line and the expected
5
+ * tokens. Keep only the explanation and append the diagram-relative position.
6
+ */
7
+ function conciseMessage(error) {
8
+ const message = error.snippet
9
+ ? error.message.replace(error.snippet, '')
10
+ : error.message;
11
+ const detail = message
12
+ .split('\n')
13
+ .map((line) => line.trim())
14
+ .filter((line) => line && !/^Parse error on line \d+:?$/.test(line))
15
+ .join(' ');
16
+ return error.line > 0
17
+ ? `${detail} (diagram line ${error.line}, column ${error.column})`
18
+ : detail;
26
19
  }
27
- async function loadRuntime() {
28
- const { JSDOM } = await import('jsdom');
29
- // Defaults intentionally disable script execution and external resources.
30
- const dom = new JSDOM('');
20
+ /** Mermaid syntax check with the pinned, DOM-free Pele parser. Never renders. */
21
+ export async function parseMermaid(source) {
22
+ runtime ??= import('pele');
23
+ const pele = await runtime;
31
24
  try {
32
- const mermaid = await withDom(dom, async () => (await import('mermaid')).default);
33
- process.once('beforeExit', () => dom.window.close());
34
- return { dom, mermaid };
25
+ pele.parse(source);
35
26
  }
36
27
  catch (error) {
37
- dom.window.close();
28
+ if (error instanceof pele.PeleError)
29
+ throw new Error(conciseMessage(error), { cause: error });
38
30
  throw error;
39
31
  }
40
32
  }
41
- /** Lazy, real Node DOM for Mermaid syntax parsing only. Never renders SVG. */
42
- export async function parseMermaid(source) {
43
- const result = queue.then(async () => {
44
- runtime ??= loadRuntime();
45
- const { dom, mermaid } = await runtime;
46
- await withDom(dom, async () => {
47
- mermaid.initialize({
48
- startOnLoad: false,
49
- securityLevel: 'strict',
50
- logLevel: 'fatal',
51
- });
52
- await mermaid.parse(source);
53
- });
54
- });
55
- queue = result.catch(() => undefined);
56
- await result;
57
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-agent-toolkit/cli",
3
- "version": "0.3.34",
3
+ "version": "0.3.35",
4
4
  "private": false,
5
5
  "description": "Open Agent Toolkit CLI",
6
6
  "homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
@@ -32,21 +32,19 @@
32
32
  "commander": "^12.1.0",
33
33
  "entities": "6.0.1",
34
34
  "github-slugger": "2.0.0",
35
- "jsdom": "29.1.1",
36
35
  "jsonc-parser": "3.2.1",
37
- "mermaid": "11.12.3",
38
36
  "ora": "^9.0.0",
39
37
  "parse5": "7.3.0",
38
+ "pele": "1.10.0",
40
39
  "remark-gfm": "4.0.1",
41
40
  "remark-parse": "11.0.0",
42
41
  "unified": "11.0.5",
43
42
  "yaml": "2.8.2",
44
43
  "zod": "^3.25.76",
45
- "@open-agent-toolkit/control-plane": "0.3.34",
46
- "@open-agent-toolkit/docs-transforms": "0.3.34"
44
+ "@open-agent-toolkit/control-plane": "0.3.35",
45
+ "@open-agent-toolkit/docs-transforms": "0.3.35"
47
46
  },
48
47
  "devDependencies": {
49
- "@types/jsdom": "28.0.3",
50
48
  "@types/node": "^22.10.0",
51
49
  "tsc-alias": "^1.8.10",
52
50
  "tsx": "^4.21.0",