@research-copilot/plugin 1.1.17 → 1.1.19
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 +18 -9
- package/dist/.claude-plugin/plugin.json +1 -1
- package/dist/.codex-plugin/plugin.toml +1 -1
- package/dist/.cursor-plugin/plugin.json +1 -1
- package/dist/.gemini-plugin/plugin.json +1 -1
- package/dist/.opencode-plugin/plugin.json +1 -1
- package/dist/.windsurf-plugin/plugin.json +1 -1
- package/dist/skills/ablation-planner/SKILL.md +126 -0
- package/dist/skills/alphaxiv/SKILL.md +186 -0
- package/dist/skills/analyze-results/SKILL.md +45 -0
- package/dist/skills/arxiv/SKILL.md +210 -0
- package/dist/skills/auto-paper-improvement-loop/SKILL.md +574 -0
- package/dist/skills/auto-review-loop/SKILL.md +370 -0
- package/dist/skills/auto-review-loop-llm/SKILL.md +247 -0
- package/dist/skills/auto-review-loop-minimax/SKILL.md +290 -0
- package/dist/skills/benchmark-paper-template/SKILL.md +142 -0
- package/dist/skills/benchmark-paper-template/references/benchmark-design.md +180 -0
- package/dist/skills/benchmark-paper-template/references/checklist.md +113 -0
- package/dist/skills/benchmark-paper-template/references/construction-pipeline.md +127 -0
- package/dist/skills/benchmark-paper-template/references/experiments.md +159 -0
- package/dist/skills/benchmark-paper-template/references/gap-analysis.md +86 -0
- package/dist/skills/benchmark-paper-template/references/instantiation-template.md +194 -0
- package/dist/skills/benchmark-paper-template/references/orchestrator-notes.md +96 -0
- package/dist/skills/benchmark-paper-template/references/paper-structure.md +209 -0
- package/dist/skills/citation-audit/SKILL.md +494 -0
- package/dist/skills/claims-drafting/SKILL.md +239 -0
- package/dist/skills/comm-lit-review/SKILL.md +299 -0
- package/dist/skills/comm-lit-review/references/domain-taxonomy.md +57 -0
- package/dist/skills/comm-lit-review/references/output-template.md +37 -0
- package/dist/skills/comm-lit-review/references/source-policy.md +99 -0
- package/dist/skills/comm-lit-review/references/venue-tiering.md +112 -0
- package/dist/skills/composer/SKILL.md +840 -0
- package/dist/skills/composer/references/section_guides.md +675 -0
- package/dist/skills/composer/references/writing_standards.md +629 -0
- package/dist/skills/composer/scripts/chapter_quality_check.py +470 -0
- package/dist/skills/composer/scripts/final_evaluation.py +550 -0
- package/dist/skills/deepxiv/SKILL.md +142 -0
- package/dist/skills/dse-loop/SKILL.md +277 -0
- package/dist/skills/embodiment-description/SKILL.md +129 -0
- package/dist/skills/exa-search/SKILL.md +192 -0
- package/dist/skills/experiment-audit/SKILL.md +262 -0
- package/dist/skills/experiment-bridge/SKILL.md +316 -0
- package/dist/skills/experiment-plan/SKILL.md +249 -0
- package/dist/skills/experiment-queue/SKILL.md +380 -0
- package/dist/skills/experiment-queue/scripts/build_manifest.py +142 -0
- package/dist/skills/experiment-queue/scripts/queue_manager.py +426 -0
- package/dist/skills/feishu-notify/SKILL.md +155 -0
- package/dist/skills/figure-description/SKILL.md +138 -0
- package/dist/skills/figure-designer/SKILL.md +207 -0
- package/dist/skills/figure-designer/references/design-rules.md +99 -0
- package/dist/skills/figure-designer/references/experimental-results.md +127 -0
- package/dist/skills/figure-designer/references/motivated-example.md +138 -0
- package/dist/skills/figure-designer/references/solution-overview.md +145 -0
- package/dist/skills/figure-designer/references/tools.md +124 -0
- package/dist/skills/figure-spec/SKILL.md +252 -0
- package/dist/skills/figure-spec/scripts/figure_renderer.py +799 -0
- package/dist/skills/formula-derivation/SKILL.md +280 -0
- package/dist/skills/gemini-search/SKILL.md +205 -0
- package/dist/skills/grant-proposal/SKILL.md +625 -0
- package/dist/skills/humanizer/AGENTS.md +25 -0
- package/dist/skills/humanizer/SKILL.md +621 -0
- package/dist/skills/idea-creator/SKILL.md +311 -0
- package/dist/skills/idea-discovery/SKILL.md +340 -0
- package/dist/skills/idea-discovery-robot/SKILL.md +362 -0
- package/dist/skills/idea-evaluator/SKILL.md +265 -0
- package/dist/skills/idea-evaluator/references/fatal-flaws.md +192 -0
- package/dist/skills/idea-evaluator/references/five-dimensions.md +251 -0
- package/dist/skills/idea-evaluator/references/lifecycle-capability-matching.md +177 -0
- package/dist/skills/idea-evaluator/references/paradigm-elephant.md +112 -0
- package/dist/skills/idea-evaluator/references/paradigm-examples.md +107 -0
- package/dist/skills/idea-evaluator/references/paradigm-first-principles.md +115 -0
- package/dist/skills/idea-evaluator/references/paradigm-hamming.md +137 -0
- package/dist/skills/idea-evaluator/references/paradigm-shift-probe.md +160 -0
- package/dist/skills/idea-evaluator/references/paradigm-technology-cycle.md +116 -0
- package/dist/skills/idea-evaluator/references/worked-examples.md +206 -0
- package/dist/skills/interview-cheatsheet/SKILL.md +245 -0
- package/dist/skills/intro-drafter/SKILL.md +250 -0
- package/dist/skills/intro-drafter/references/contribution-patterns.md +116 -0
- package/dist/skills/intro-drafter/references/flowchart.md +204 -0
- package/dist/skills/intro-drafter/references/paper-types.md +155 -0
- package/dist/skills/intro-drafter/references/running-example.md +133 -0
- package/dist/skills/intro-drafter/references/worked-examples.md +161 -0
- package/dist/skills/invention-structuring/SKILL.md +188 -0
- package/dist/skills/jurisdiction-format/SKILL.md +192 -0
- package/dist/skills/kill-argument/SKILL.md +384 -0
- package/dist/skills/llm-wiki/.mise.toml +2 -0
- package/dist/skills/llm-wiki/.nvmrc +1 -0
- package/dist/skills/llm-wiki/AGENTS.md +132 -0
- package/dist/skills/llm-wiki/CHANGELOG.md +459 -0
- package/dist/skills/llm-wiki/CLAUDE.md +109 -0
- package/dist/skills/llm-wiki/HERMES.md +44 -0
- package/dist/skills/llm-wiki/SKILL.md +1133 -0
- package/dist/skills/llm-wiki/assets/graph-demo.gif +0 -0
- package/dist/skills/llm-wiki/assets/graph-preview.png +0 -0
- package/dist/skills/llm-wiki/deps/LICENSE-d3.txt +13 -0
- package/dist/skills/llm-wiki/deps/LICENSE-marked.txt +44 -0
- package/dist/skills/llm-wiki/deps/LICENSE-purify.txt +568 -0
- package/{LICENSE → dist/skills/llm-wiki/deps/LICENSE-roughjs.txt} +1 -1
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/SKILL.md +261 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/references/config/first-time-setup.md +106 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/cdp.ts +179 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/constants.ts +13 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/defuddle-converter.ts +58 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/html-to-markdown.ts +135 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/legacy-converter.ts +629 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/main.ts +314 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/markdown-conversion-shared.ts +305 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/media-localizer.ts +317 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/package.json +14 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/paths.ts +29 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/vendor/baoyu-chrome-cdp/package.json +9 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/vendor/baoyu-chrome-cdp/src/index.test.ts +307 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/vendor/baoyu-chrome-cdp/src/index.ts +523 -0
- package/dist/skills/llm-wiki/deps/d3.min.js +2 -0
- package/dist/skills/llm-wiki/deps/marked.min.js +6 -0
- package/dist/skills/llm-wiki/deps/purify.min.js +3 -0
- package/dist/skills/llm-wiki/deps/rough.min.js +7 -0
- package/dist/skills/llm-wiki/deps/youtube-transcript/SKILL.md +47 -0
- package/dist/skills/llm-wiki/deps/youtube-transcript/scripts/get_transcript.py +72 -0
- package/dist/skills/llm-wiki/docs/design/oriental-atlas/DESIGN.md +183 -0
- package/dist/skills/llm-wiki/docs/design/oriental-atlas/design-brief.md +170 -0
- package/dist/skills/llm-wiki/docs/design/oriental-atlas/oriental-editorial-atlas.html +1908 -0
- package/dist/skills/llm-wiki/docs/design/oriental-atlas/reviews/result-review.md +68 -0
- package/dist/skills/llm-wiki/docs/plans/2026-06-15-omp-tool-status-events-phased-plan.md +655 -0
- package/dist/skills/llm-wiki/docs/plans/2026-06-15-omp-tool-status-events-progress.json +913 -0
- package/dist/skills/llm-wiki/docs/spark/2026-06-15-omp-tool-status-events-design.md +174 -0
- package/dist/skills/llm-wiki/install.ps1 +87 -0
- package/dist/skills/llm-wiki/install.sh +722 -0
- package/dist/skills/llm-wiki/package-lock.json +10309 -0
- package/dist/skills/llm-wiki/package.json +24 -0
- package/dist/skills/llm-wiki/packages/graph-engine/package.json +33 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/anim/.gitkeep +1 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/anim/index.ts +179 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/diff.ts +121 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/graph-node.ts +37 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/index.ts +140 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/atlas.ts +18 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/index.ts +6 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/labels.ts +11 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/learning.ts +8 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/legacy-helpers.ts +1373 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/queue.ts +7 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/storage.ts +4 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/visibility.ts +9 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/.gitkeep +1 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/index.ts +59 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/legend.ts +25 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/model.ts +593 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/preview.ts +65 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/search.ts +48 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/static-renderer.ts +2783 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/toolbar.ts +40 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/viewport.ts +272 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/select/.gitkeep +1 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/select/index.ts +189 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/sim/index.ts +298 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/sim/pins.ts +96 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/themes/.gitkeep +1 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/themes/index.ts +8 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/themes/tokens.ts +107 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/types.ts +313 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/anim.test.ts +100 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/diff.test.ts +133 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/helpers.test.ts +275 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/learning.test.ts +259 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/preview.test.ts +56 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/queue.test.ts +114 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/render-model.test.ts +322 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/runtime-state.test.ts +281 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/search-and-legend.test.ts +111 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/select.test.ts +168 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/sim.test.ts +123 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/themes.test.ts +62 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/toolbar.test.ts +64 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/viewport.test.ts +167 -0
- package/dist/skills/llm-wiki/packages/graph-engine/tsconfig.json +17 -0
- package/dist/skills/llm-wiki/packages/graph-engine/vite.config.ts +15 -0
- package/dist/skills/llm-wiki/platforms/claude/CLAUDE.md +37 -0
- package/dist/skills/llm-wiki/platforms/claude/companions/llm-wiki-upgrade/SKILL.md +95 -0
- package/dist/skills/llm-wiki/platforms/codex/AGENTS.md +23 -0
- package/dist/skills/llm-wiki/scripts/adapter-state.sh +424 -0
- package/dist/skills/llm-wiki/scripts/build-graph-data.sh +395 -0
- package/dist/skills/llm-wiki/scripts/build-graph-html.sh +453 -0
- package/dist/skills/llm-wiki/scripts/cache.sh +352 -0
- package/dist/skills/llm-wiki/scripts/create-source-page.sh +100 -0
- package/dist/skills/llm-wiki/scripts/delete-helper.sh +68 -0
- package/dist/skills/llm-wiki/scripts/graph-analysis.js +732 -0
- package/dist/skills/llm-wiki/scripts/hook-session-start.sh +46 -0
- package/dist/skills/llm-wiki/scripts/init-wiki.sh +95 -0
- package/dist/skills/llm-wiki/scripts/lib/source-signal-eligibility.js +158 -0
- package/dist/skills/llm-wiki/scripts/lint-fix.sh +114 -0
- package/dist/skills/llm-wiki/scripts/lint-runner.sh +217 -0
- package/dist/skills/llm-wiki/scripts/runtime-context.sh +77 -0
- package/dist/skills/llm-wiki/scripts/shared-config.sh +83 -0
- package/dist/skills/llm-wiki/scripts/source-record-contract.tsv +10 -0
- package/dist/skills/llm-wiki/scripts/source-registry.sh +349 -0
- package/dist/skills/llm-wiki/scripts/source-registry.tsv +10 -0
- package/dist/skills/llm-wiki/scripts/source-signal-coverage.js +83 -0
- package/dist/skills/llm-wiki/scripts/validate-step1.sh +144 -0
- package/dist/skills/llm-wiki/scripts/wiki-compat.sh +267 -0
- package/dist/skills/llm-wiki/setup.sh +8 -0
- package/dist/skills/llm-wiki/templates/entity-template.md +30 -0
- package/dist/skills/llm-wiki/templates/graph-styles/wash/footer.html +27 -0
- package/dist/skills/llm-wiki/templates/graph-styles/wash/graph-wash-helpers.js +1326 -0
- package/dist/skills/llm-wiki/templates/graph-styles/wash/graph-wash.js +1009 -0
- package/dist/skills/llm-wiki/templates/graph-styles/wash/header.html +2002 -0
- package/dist/skills/llm-wiki/templates/index-en-template.md +51 -0
- package/dist/skills/llm-wiki/templates/index-template.md +51 -0
- package/dist/skills/llm-wiki/templates/log-en-template.md +11 -0
- package/dist/skills/llm-wiki/templates/log-template.md +11 -0
- package/dist/skills/llm-wiki/templates/overview-en-template.md +41 -0
- package/dist/skills/llm-wiki/templates/overview-template.md +41 -0
- package/dist/skills/llm-wiki/templates/purpose-en-template.md +16 -0
- package/dist/skills/llm-wiki/templates/purpose-template.md +16 -0
- package/dist/skills/llm-wiki/templates/query-template.md +19 -0
- package/dist/skills/llm-wiki/templates/schema-template.md +185 -0
- package/dist/skills/llm-wiki/templates/source-template.md +51 -0
- package/dist/skills/llm-wiki/templates/synthesis-template.md +25 -0
- package/dist/skills/llm-wiki/templates/topic-template.md +35 -0
- package/dist/skills/llm-wiki/tests/adapter-state.sh +338 -0
- package/dist/skills/llm-wiki/tests/browser/graph-density-preview.mjs +53 -0
- package/dist/skills/llm-wiki/tests/browser/graph-html-insights.mjs +41 -0
- package/dist/skills/llm-wiki/tests/browser/graph-node-slim.mjs +71 -0
- package/dist/skills/llm-wiki/tests/browser/graph-stage-4-5.mjs +717 -0
- package/dist/skills/llm-wiki/tests/expected/graph-data-empty.json +60 -0
- package/dist/skills/llm-wiki/tests/expected/graph-data-sample.json +396 -0
- package/dist/skills/llm-wiki/tests/expected/graph-interactive-basic.html +1736 -0
- package/dist/skills/llm-wiki/tests/expected/lint-output.txt +44 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/index.md +1 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/entities/Alpha.md +10 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/entities/Beta.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/entities/Delta.md +8 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/entities/Gamma.md +8 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/queries/20260422-abc.md +10 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/synthesis/Crystal.md +8 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/topics/Overview.md +9 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-empty-wiki/wiki/entities/.gitkeep +0 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/purpose.md +3 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/Attention.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/Decoder.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/Encoder.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/GPT.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/Transformer.md +13 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/sources/paper.md +9 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/topics/arch.md +12 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/topics/finetune.md +9 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-interactive-basic/wiki/graph-data.json +40 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-interactive-dense/wiki/graph-data.json +3965 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-interactive-multicomm/wiki/graph-data.json +212 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/index.md +14 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/entities/C++.md +6 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/entities/Lonely.md +4 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/entities/Other.md +8 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/entities/Real.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/sources/2026-01-01-test-source.md +15 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/sources/2026-02-01-inline-img.md +12 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/topics/AIbasic.md +3 -0
- package/dist/skills/llm-wiki/tests/graph-analysis-helper.regression-1.sh +237 -0
- package/dist/skills/llm-wiki/tests/graph-browser-stage-4-5.regression-1.sh +157 -0
- package/dist/skills/llm-wiki/tests/graph-build-failures.regression-1.sh +91 -0
- package/dist/skills/llm-wiki/tests/graph-data-confidence-merge.regression-1.sh +309 -0
- package/dist/skills/llm-wiki/tests/graph-data-source-paths.regression-1.sh +49 -0
- package/dist/skills/llm-wiki/tests/graph-html-a11y.regression-1.sh +47 -0
- package/dist/skills/llm-wiki/tests/graph-html-brand-link.regression-1.sh +47 -0
- package/dist/skills/llm-wiki/tests/graph-html-density.regression-1.sh +228 -0
- package/dist/skills/llm-wiki/tests/graph-html-drawer-neighbors.regression-1.sh +47 -0
- package/dist/skills/llm-wiki/tests/graph-html-insights.regression-1.sh +80 -0
- package/dist/skills/llm-wiki/tests/graph-html-long-label.regression-1.sh +92 -0
- package/dist/skills/llm-wiki/tests/graph-html-minimap.regression-1.sh +51 -0
- package/dist/skills/llm-wiki/tests/graph-html-mobile.regression-1.sh +48 -0
- package/dist/skills/llm-wiki/tests/graph-html-oriental-atlas-contract.regression-1.sh +94 -0
- package/dist/skills/llm-wiki/tests/graph-html-oriental-design-contract.regression-1.sh +82 -0
- package/dist/skills/llm-wiki/tests/graph-html-search.regression-1.sh +52 -0
- package/dist/skills/llm-wiki/tests/graph-html-styles.regression-1.sh +66 -0
- package/dist/skills/llm-wiki/tests/graph-html-toolbar.regression-1.sh +62 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-bootstrap.test.js +110 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-helpers.test.js +296 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-learning.test.js +260 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-queue.test.js +115 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-runtime-state.test.js +282 -0
- package/dist/skills/llm-wiki/tests/js/source-signal-coverage.test.js +48 -0
- package/dist/skills/llm-wiki/tests/js/source-signal-eligibility.test.js +202 -0
- package/dist/skills/llm-wiki/tests/lib/graph-html-engine-helpers.sh +110 -0
- package/dist/skills/llm-wiki/tests/lint-output.regression-1.sh +32 -0
- package/dist/skills/llm-wiki/tests/regression.sh +1754 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/.gitkeep +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/SKILL.md +590 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/__init__.py +1 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/accept_changes.py +135 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/comment.py +318 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/helpers/__init__.py +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/helpers/merge_runs.py +199 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/pack.py +159 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/soffice.py +183 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/unpack.py +132 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validate.py +111 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/__init__.py +15 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/base.py +847 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/docx.py +446 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/pptx.py +275 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/redlining.py +247 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/comments.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/people.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/SKILL.md +314 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/forms.md +294 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/reference.md +612 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/check_bounding_boxes.py +65 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/check_fillable_fields.py +11 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/create_validation_image.py +37 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/extract_form_field_info.py +122 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/extract_form_structure.py +115 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/fill_fillable_fields.py +98 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/SKILL.md +232 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/editing.md +205 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/pptxgenjs.md +420 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/__init__.py +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/add_slide.py +195 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/clean.py +286 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/helpers/__init__.py +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/helpers/merge_runs.py +199 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/pack.py +159 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/soffice.py +183 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/unpack.py +132 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validate.py +111 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/__init__.py +15 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/base.py +847 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/docx.py +446 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/pptx.py +275 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/redlining.py +247 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/thumbnail.py +289 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/SKILL.md +292 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/pack.py +159 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/soffice.py +183 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/unpack.py +132 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validate.py +111 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/__init__.py +15 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/base.py +847 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/docx.py +446 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/pptx.py +275 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/redlining.py +247 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/recalc.py +184 -0
- package/dist/skills/llm-wiki/workbench/AGENTS.md +110 -0
- package/dist/skills/llm-wiki/workbench/CLAUDE.md +54 -0
- package/dist/skills/llm-wiki/workbench/PRODUCT.md +1268 -0
- package/dist/skills/llm-wiki/workbench/docs/current-kb-retrieval-design.md +587 -0
- package/dist/skills/llm-wiki/workbench/docs/graph-evolution-1-design.md +210 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-2-design.md +1139 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-3-design.md +1269 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-3.5-design.md +1164 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-4-design.md +504 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-4.5-design.md +195 -0
- package/dist/skills/llm-wiki/workbench/docs/superpowers/specs/2026-05-28-resizable-preview-layout-design.md +165 -0
- package/dist/skills/llm-wiki/workbench/docs/superpowers/specs/2026-05-28-settings-panel-scroll-fix.md +50 -0
- package/dist/skills/llm-wiki/workbench/server/package.json +29 -0
- package/dist/skills/llm-wiki/workbench/server/src/agent.ts +457 -0
- package/dist/skills/llm-wiki/workbench/server/src/artifacts.ts +248 -0
- package/dist/skills/llm-wiki/workbench/server/src/auth.ts +164 -0
- package/dist/skills/llm-wiki/workbench/server/src/config.ts +130 -0
- package/dist/skills/llm-wiki/workbench/server/src/conversations.test.ts +121 -0
- package/dist/skills/llm-wiki/workbench/server/src/conversations.ts +255 -0
- package/dist/skills/llm-wiki/workbench/server/src/digest/batch.ts +189 -0
- package/dist/skills/llm-wiki/workbench/server/src/digest/concurrency.test.ts +36 -0
- package/dist/skills/llm-wiki/workbench/server/src/digest/concurrency.ts +31 -0
- package/dist/skills/llm-wiki/workbench/server/src/digest/subagent.ts +91 -0
- package/dist/skills/llm-wiki/workbench/server/src/extensions/artifacts.ts +81 -0
- package/dist/skills/llm-wiki/workbench/server/src/extensions/knowledge-base.ts +263 -0
- package/dist/skills/llm-wiki/workbench/server/src/extensions/new-wiki.ts +42 -0
- package/dist/skills/llm-wiki/workbench/server/src/extensions/synthesis.ts +172 -0
- package/dist/skills/llm-wiki/workbench/server/src/graph-watcher.test.ts +196 -0
- package/dist/skills/llm-wiki/workbench/server/src/graph.test.ts +84 -0
- package/dist/skills/llm-wiki/workbench/server/src/graph.ts +379 -0
- package/dist/skills/llm-wiki/workbench/server/src/index.ts +1148 -0
- package/dist/skills/llm-wiki/workbench/server/src/knowledge-bases.test.ts +30 -0
- package/dist/skills/llm-wiki/workbench/server/src/knowledge-bases.ts +321 -0
- package/dist/skills/llm-wiki/workbench/server/src/pages.test.ts +16 -0
- package/dist/skills/llm-wiki/workbench/server/src/pages.ts +158 -0
- package/dist/skills/llm-wiki/workbench/server/src/retrieval.test.ts +151 -0
- package/dist/skills/llm-wiki/workbench/server/src/retrieval.ts +427 -0
- package/dist/skills/llm-wiki/workbench/server/src/tool-status-events.test.ts +363 -0
- package/dist/skills/llm-wiki/workbench/server/src/tool-status-events.ts +616 -0
- package/dist/skills/llm-wiki/workbench/server/src/wiki-init.test.ts +19 -0
- package/dist/skills/llm-wiki/workbench/server/src/wiki-init.ts +188 -0
- package/dist/skills/llm-wiki/workbench/server/tsconfig.json +10 -0
- package/dist/skills/llm-wiki/workbench/tsconfig.json +20 -0
- package/dist/skills/llm-wiki/workbench/web/components.json +21 -0
- package/dist/skills/llm-wiki/workbench/web/eslint.config.js +22 -0
- package/dist/skills/llm-wiki/workbench/web/index.html +13 -0
- package/dist/skills/llm-wiki/workbench/web/package.json +48 -0
- package/dist/skills/llm-wiki/workbench/web/src/App.tsx +749 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/AddExternalDialog.tsx +373 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ArtifactView.tsx +15 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/BatchDigestPanel.tsx +106 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ChatPanel.tsx +821 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/CommandMenu.tsx +65 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ExportButtons.tsx +54 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/GraphPanel.tsx +516 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/GraphReader.tsx +48 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/GraphSelection.tsx +100 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/MarkdownView.tsx +56 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/NewWikiDialog.tsx +101 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/RefMenu.tsx +40 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/RightDrawer.tsx +227 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/SettingsPanel.tsx +331 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/Sidebar.tsx +436 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ToolHistorySummary.tsx +123 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ToolStatusRunway.tsx +90 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/renderers/DownloadOnlyRenderer.tsx +88 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/renderers/HtmlRenderer.tsx +92 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/button.tsx +52 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/command.tsx +50 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/dialog.tsx +156 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/input.tsx +21 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/tooltip.tsx +57 -0
- package/dist/skills/llm-wiki/workbench/web/src/index.css +1737 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/api.ts +648 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/drawer-state.ts +79 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/graph-reader.ts +25 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/graph-selection-drawer.ts +35 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/graph-selection.ts +96 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/legacy-tool-status.ts +113 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/sse.ts +72 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/tool-status-format.ts +170 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/tool-status-model.ts +392 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/utils.ts +10 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/wiki-links.ts +32 -0
- package/dist/skills/llm-wiki/workbench/web/src/main.tsx +10 -0
- package/dist/skills/llm-wiki/workbench/web/test/api.test.ts +61 -0
- package/dist/skills/llm-wiki/workbench/web/test/chat-panel-tool-status.test.tsx +26 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-drawer-state.test.ts +78 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-reader-request.test.ts +32 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-reader.test.ts +62 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-selection-drawer.test.ts +56 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-selection.test.ts +83 -0
- package/dist/skills/llm-wiki/workbench/web/test/tool-history-summary.test.tsx +124 -0
- package/dist/skills/llm-wiki/workbench/web/test/tool-status-format.test.ts +107 -0
- package/dist/skills/llm-wiki/workbench/web/test/tool-status-model.test.ts +324 -0
- package/dist/skills/llm-wiki/workbench/web/test/tool-status-runway.test.ts +134 -0
- package/dist/skills/llm-wiki/workbench/web/test/wiki-links.test.ts +23 -0
- package/dist/skills/llm-wiki/workbench/web/tsconfig.app.json +30 -0
- package/dist/skills/llm-wiki/workbench/web/tsconfig.json +7 -0
- package/dist/skills/llm-wiki/workbench/web/tsconfig.node.json +24 -0
- package/dist/skills/llm-wiki/workbench/web/vite.config.ts +26 -0
- package/dist/skills/mean-reviewer/SECURITY.md +23 -0
- package/dist/skills/mean-reviewer/SKILL.md +203 -0
- package/dist/skills/mean-reviewer/examples/13446_1000_Layer_Networks_for_.pdf +0 -0
- package/dist/skills/mean-reviewer/examples/13446_mean_reviewer.md +116 -0
- package/dist/skills/mean-reviewer/examples/13446_mean_reviewer_author_rebuttal_simulated.md +282 -0
- package/dist/skills/mean-reviewer/examples/13446_mean_reviewer_reply.md +91 -0
- package/dist/skills/mean-reviewer/examples/13446_official_review.json +973 -0
- package/dist/skills/mean-reviewer/examples/ChatGPT_AC_Roleplay.jpeg +0 -0
- package/dist/skills/medical-imaging-review/SKILL.md +295 -0
- package/dist/skills/medical-imaging-review/references/CITATION_INTEGRITY.md +233 -0
- package/dist/skills/medical-imaging-review/references/DOMAINS.md +302 -0
- package/dist/skills/medical-imaging-review/references/HALLUCINATION_PATTERNS.md +211 -0
- package/dist/skills/medical-imaging-review/references/MCP_SETUP.md +216 -0
- package/dist/skills/medical-imaging-review/references/PARADIGM.md +221 -0
- package/dist/skills/medical-imaging-review/references/QUALITY_CHECKLIST.md +169 -0
- package/dist/skills/medical-imaging-review/references/TEMPLATES.md +291 -0
- package/dist/skills/medical-imaging-review/references/WORKFLOW.md +289 -0
- package/dist/skills/mermaid-diagram/SKILL.md +379 -0
- package/dist/skills/meta-apply/SKILL.md +137 -0
- package/dist/skills/meta-optimize/SKILL.md +253 -0
- package/dist/skills/monitor-experiment/SKILL.md +98 -0
- package/dist/skills/novelty-check/SKILL.md +89 -0
- package/dist/skills/openalex/SKILL.md +228 -0
- package/dist/skills/overleaf-sync/SKILL.md +220 -0
- package/dist/skills/paper-claim-audit/SKILL.md +340 -0
- package/dist/skills/paper-compile/SKILL.md +253 -0
- package/dist/skills/paper-figure/SKILL.md +279 -0
- package/dist/skills/paper-illustration/SKILL.md +690 -0
- package/dist/skills/paper-illustration-image2/SKILL.md +383 -0
- package/dist/skills/paper-illustration-image2/scripts/paper_illustration_image2.py +255 -0
- package/dist/skills/paper-plan/SKILL.md +278 -0
- package/dist/skills/paper-poster/SKILL.md +19 -0
- package/dist/skills/paper-poster-html/DESIGN_FINAL.md +176 -0
- package/dist/skills/paper-poster-html/IMPLEMENTATION_CONVENTIONS.md +161 -0
- package/dist/skills/paper-poster-html/LICENSES/posterly-MIT.txt +21 -0
- package/dist/skills/paper-poster-html/NOTICE.md +57 -0
- package/dist/skills/paper-poster-html/SKILL.md +357 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/__init__.py +0 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/canvas.py +200 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/measure.py +588 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/polish.py +498 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/preflight.py +489 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/render.py +215 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/textutil.py +16 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/verify_final.py +171 -0
- package/dist/skills/paper-poster-html/scripts/asset_check.py +897 -0
- package/dist/skills/paper-poster-html/scripts/extract_pdf_figures.py +666 -0
- package/dist/skills/paper-poster-html/scripts/poster_check.py +251 -0
- package/dist/skills/paper-poster-html/scripts/preprocess_figures.py +238 -0
- package/dist/skills/paper-poster-html/scripts/render_preview.py +217 -0
- package/dist/skills/paper-poster-html/scripts/run_gates.py +556 -0
- package/dist/skills/paper-poster-html/scripts/style_check.py +1324 -0
- package/dist/skills/paper-poster-html/templates/COMPONENTS.md +462 -0
- package/dist/skills/paper-poster-html/templates/landscape_4col.html +1032 -0
- package/dist/skills/paper-poster-html/templates/landscape_hero.html +1046 -0
- package/dist/skills/paper-poster-html/templates/portrait_2col.html +947 -0
- package/dist/skills/paper-poster-html/templates/tokens/acl.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/cvpr.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/generic.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/iclr.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/icml.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/neurips.json +9 -0
- package/dist/skills/paper-slide-deck/SKILL.md +464 -0
- package/dist/skills/paper-slide-deck/references/analysis-framework.md +392 -0
- package/dist/skills/paper-slide-deck/references/base-prompt.md +70 -0
- package/dist/skills/paper-slide-deck/references/content-rules.md +95 -0
- package/dist/skills/paper-slide-deck/references/figure-container-template.md +177 -0
- package/dist/skills/paper-slide-deck/references/modification-guide.md +85 -0
- package/dist/skills/paper-slide-deck/references/outline-template.md +437 -0
- package/dist/skills/paper-slide-deck/references/styles/academic-paper.md +109 -0
- package/dist/skills/paper-slide-deck/references/styles/blueprint.md +67 -0
- package/dist/skills/paper-slide-deck/references/styles/bold-editorial.md +70 -0
- package/dist/skills/paper-slide-deck/references/styles/chalkboard.md +68 -0
- package/dist/skills/paper-slide-deck/references/styles/corporate.md +69 -0
- package/dist/skills/paper-slide-deck/references/styles/dark-atmospheric.md +69 -0
- package/dist/skills/paper-slide-deck/references/styles/editorial-infographic.md +73 -0
- package/dist/skills/paper-slide-deck/references/styles/fantasy-animation.md +69 -0
- package/dist/skills/paper-slide-deck/references/styles/intuition-machine.md +72 -0
- package/dist/skills/paper-slide-deck/references/styles/minimal.md +64 -0
- package/dist/skills/paper-slide-deck/references/styles/notion.md +69 -0
- package/dist/skills/paper-slide-deck/references/styles/pixel-art.md +67 -0
- package/dist/skills/paper-slide-deck/references/styles/scientific.md +73 -0
- package/dist/skills/paper-slide-deck/references/styles/sketch-notes.md +66 -0
- package/dist/skills/paper-slide-deck/references/styles/vector-illustration.md +72 -0
- package/dist/skills/paper-slide-deck/references/styles/vintage.md +73 -0
- package/dist/skills/paper-slide-deck/references/styles/watercolor.md +68 -0
- package/dist/skills/paper-slide-deck/scripts/apply-template.ts +282 -0
- package/dist/skills/paper-slide-deck/scripts/detect-figures.ts +283 -0
- package/dist/skills/paper-slide-deck/scripts/extract-figure.ts +140 -0
- package/dist/skills/paper-slide-deck/scripts/generate-slides.py +182 -0
- package/dist/skills/paper-slide-deck/scripts/merge-to-pdf.ts +116 -0
- package/dist/skills/paper-slide-deck/scripts/merge-to-pptx.ts +137 -0
- package/dist/skills/paper-slide-deck/scripts/package-lock.json +899 -0
- package/dist/skills/paper-slide-deck/scripts/package.json +8 -0
- package/dist/skills/paper-slides/SKILL.md +571 -0
- package/dist/skills/paper-talk/SKILL.md +381 -0
- package/dist/skills/paper-write/SKILL.md +411 -0
- package/dist/skills/paper-write/templates/IEEEtran.bst +2409 -0
- package/dist/skills/paper-write/templates/IEEEtran.cls +6347 -0
- package/dist/skills/paper-write/templates/aaai2026.bst +1493 -0
- package/dist/skills/paper-write/templates/aaai2026.sty +315 -0
- package/dist/skills/paper-write/templates/aaai2026.tex +952 -0
- package/dist/skills/paper-write/templates/acl.sty +312 -0
- package/dist/skills/paper-write/templates/acl2026.tex +377 -0
- package/dist/skills/paper-write/templates/acl_natbib.bst +1940 -0
- package/dist/skills/paper-write/templates/acm.bst +3081 -0
- package/dist/skills/paper-write/templates/acm_mm2026.tex +204 -0
- package/dist/skills/paper-write/templates/acmart.cls +3520 -0
- package/dist/skills/paper-write/templates/cvpr.bst +1448 -0
- package/dist/skills/paper-write/templates/cvpr.sty +508 -0
- package/dist/skills/paper-write/templates/cvpr2026.tex +63 -0
- package/dist/skills/paper-write/templates/iclr2026.tex +84 -0
- package/dist/skills/paper-write/templates/iclr2026_conference.bst +1440 -0
- package/dist/skills/paper-write/templates/iclr2026_conference.sty +246 -0
- package/dist/skills/paper-write/templates/icml2025.tex +87 -0
- package/dist/skills/paper-write/templates/icml2026.sty +767 -0
- package/dist/skills/paper-write/templates/icml2026.tex +662 -0
- package/dist/skills/paper-write/templates/ieee_conference.tex +89 -0
- package/dist/skills/paper-write/templates/ieee_journal.tex +93 -0
- package/dist/skills/paper-write/templates/math_commands.tex +48 -0
- package/dist/skills/paper-write/templates/neurips2025.tex +80 -0
- package/dist/skills/paper-write/templates/neurips2026.tex +493 -0
- package/dist/skills/paper-write/templates/neurips_2026.sty +437 -0
- package/dist/skills/paper-writing/SKILL.md +632 -0
- package/dist/skills/patent-novelty-check/SKILL.md +153 -0
- package/dist/skills/patent-pipeline/SKILL.md +344 -0
- package/dist/skills/patent-review/SKILL.md +202 -0
- package/dist/skills/pixel-art/SKILL.md +139 -0
- package/dist/skills/pre-submission-reviewer/SKILL.md +247 -0
- package/dist/skills/pre-submission-reviewer/references/forbidden-patterns.md +163 -0
- package/dist/skills/pre-submission-reviewer/references/grammar-rules.md +135 -0
- package/dist/skills/pre-submission-reviewer/references/latex-rules.md +158 -0
- package/dist/skills/pre-submission-reviewer/references/logic-and-structure.md +125 -0
- package/dist/skills/pre-submission-reviewer/references/section-guides.md +169 -0
- package/dist/skills/prior-art-search/SKILL.md +146 -0
- package/dist/skills/proof-checker/SKILL.md +499 -0
- package/dist/skills/proof-writer/SKILL.md +222 -0
- package/dist/skills/qzcli/SKILL.md +316 -0
- package/dist/skills/rebuttal/SKILL.md +304 -0
- package/dist/skills/render-html/SKILL.md +299 -0
- package/dist/skills/render-html/scripts/render_html.py +905 -0
- package/dist/skills/render-html/scripts/templates/academic.html +342 -0
- package/dist/skills/render-html/scripts/templates/dashboard.html +333 -0
- package/dist/skills/research-lit/SKILL.md +353 -0
- package/dist/skills/research-paper-writing/SKILL.md +99 -0
- package/dist/skills/research-paper-writing/agents/openai.yaml +4 -0
- package/dist/skills/research-paper-writing/references/abstract.md +102 -0
- package/dist/skills/research-paper-writing/references/conclusion.md +35 -0
- package/dist/skills/research-paper-writing/references/does-my-writing-flow-source.md +45 -0
- package/dist/skills/research-paper-writing/references/examples/abstract/template-a.md +21 -0
- package/dist/skills/research-paper-writing/references/examples/abstract/template-b.md +34 -0
- package/dist/skills/research-paper-writing/references/examples/abstract/template-c.md +28 -0
- package/dist/skills/research-paper-writing/references/examples/abstract-examples.md +13 -0
- package/dist/skills/research-paper-writing/references/examples/index.md +21 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/novel-task-challenge-decomposition.md +18 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-not-recommended-abstract-only.md +30 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-version-1-one-contribution-multi-advantages.md +30 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-version-2-two-contributions.md +34 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-version-3-new-module-on-existing-pipeline.md +18 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-version-4-observation-driven.md +16 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/technical-challenge-version-1-existing-task.md +32 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/technical-challenge-version-2-existing-task-insight-backed-by-traditional.md +33 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/technical-challenge-version-3-novel-task.md +21 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/version-1-task-then-application.md +14 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/version-2-application-first.md +10 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/version-3-general-to-specific-setting.md +14 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/version-4-open-with-challenge.md +20 -0
- package/dist/skills/research-paper-writing/references/examples/introduction-examples.md +25 -0
- package/dist/skills/research-paper-writing/references/examples/method/example-of-the-three-elements.md +67 -0
- package/dist/skills/research-paper-writing/references/examples/method/method-writing-common-issues-note.md +10 -0
- package/dist/skills/research-paper-writing/references/examples/method/module-design-instant-ngp.md +55 -0
- package/dist/skills/research-paper-writing/references/examples/method/module-motivation-patterns.md +15 -0
- package/dist/skills/research-paper-writing/references/examples/method/module-triad-neural-body.md +19 -0
- package/dist/skills/research-paper-writing/references/examples/method/neural-body-annotated-figure-text.md +66 -0
- package/dist/skills/research-paper-writing/references/examples/method/overview-template.md +30 -0
- package/dist/skills/research-paper-writing/references/examples/method/pre-writing-questions.md +17 -0
- package/dist/skills/research-paper-writing/references/examples/method/section-skeleton.md +9 -0
- package/dist/skills/research-paper-writing/references/examples/method-examples.md +24 -0
- package/dist/skills/research-paper-writing/references/experiments.md +102 -0
- package/dist/skills/research-paper-writing/references/introduction.md +408 -0
- package/dist/skills/research-paper-writing/references/method.md +196 -0
- package/dist/skills/research-paper-writing/references/paper-review.md +86 -0
- package/dist/skills/research-paper-writing/references/related-work.md +41 -0
- package/dist/skills/research-pipeline/SKILL.md +257 -0
- package/dist/skills/research-proposal/SKILL.md +573 -0
- package/dist/skills/research-proposal/assets/proposal_scaffold_en.md +323 -0
- package/dist/skills/research-proposal/assets/proposal_scaffold_zh.md +346 -0
- package/dist/skills/research-proposal/references/DOMAIN_TEMPLATES.md +518 -0
- package/dist/skills/research-proposal/references/LITERATURE_WORKFLOW.md +529 -0
- package/dist/skills/research-proposal/references/QUALITY_CHECKLIST.md +325 -0
- package/dist/skills/research-proposal/references/STRUCTURE_GUIDE.md +398 -0
- package/dist/skills/research-proposal/references/WRITING_STYLE_GUIDE.md +661 -0
- package/dist/skills/research-refine/SKILL.md +716 -0
- package/dist/skills/research-refine-pipeline/SKILL.md +186 -0
- package/dist/skills/research-review/SKILL.md +119 -0
- package/dist/skills/research-wiki/SKILL.md +373 -0
- package/dist/skills/resubmit-pipeline/SKILL.md +427 -0
- package/dist/skills/result-to-claim/SKILL.md +190 -0
- package/dist/skills/run-experiment/SKILL.md +227 -0
- package/dist/skills/scientific-figure-making/SKILL.md +38 -0
- package/dist/skills/scientific-figure-making/references/api.md +152 -0
- package/dist/skills/scientific-figure-making/references/common-patterns.md +74 -0
- package/dist/skills/scientific-figure-making/references/demos.md +30 -0
- package/dist/skills/scientific-figure-making/references/design-theory.md +138 -0
- package/dist/skills/scientific-figure-making/references/tutorials.md +135 -0
- package/dist/skills/semantic-scholar/SKILL.md +219 -0
- package/dist/skills/serverless-modal/SKILL.md +324 -0
- package/dist/skills/slides-polish/SKILL.md +563 -0
- package/dist/skills/specification-writing/SKILL.md +211 -0
- package/dist/skills/strategist/SKILL.md +670 -0
- package/dist/skills/strategist/references/quality_standards.md +336 -0
- package/dist/skills/strategist/references/search_strategy.md +459 -0
- package/dist/skills/strategist/scripts/evaluate_samples.py +300 -0
- package/dist/skills/strategist/scripts/gap_analysis.py +399 -0
- package/dist/skills/system-profile/SKILL.md +103 -0
- package/dist/skills/tech-paper-template/SKILL.md +192 -0
- package/dist/skills/tech-paper-template/references/consistency-checks.md +166 -0
- package/dist/skills/tech-paper-template/references/paper-types.md +127 -0
- package/dist/skills/tech-paper-template/references/thinking-template.md +194 -0
- package/dist/skills/tech-paper-template/references/worked-examples.md +124 -0
- package/dist/skills/training-check/SKILL.md +83 -0
- package/dist/skills/vast-gpu/SKILL.md +380 -0
- package/dist/skills/vibe-research-workflow/SKILL.md +189 -0
- package/dist/skills/vibe-research-workflow/references/behavior-guidelines.md +149 -0
- package/dist/skills/vibe-research-workflow/references/tool-selection.md +144 -0
- package/dist/skills/vibe-research-workflow/references/vibe-coding.md +154 -0
- package/dist/skills/vibe-research-workflow/references/vibe-figure.md +131 -0
- package/dist/skills/vibe-research-workflow/references/vibe-writing.md +181 -0
- package/dist/skills/wiki-enrich/SKILL.md +254 -0
- package/dist/skills/writing-systems-papers/SKILL.md +184 -0
- package/package.json +1 -1
|
@@ -0,0 +1,905 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""render_html.py — convert ARIS Markdown / JSON artifacts to single-file HTML.
|
|
3
|
+
|
|
4
|
+
Pure-stdlib Python. No external pip deps.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
render_html.py <input.md> [--template academic|dashboard]
|
|
8
|
+
[--out <output.html>]
|
|
9
|
+
[--title "..."] [--subtitle "..."]
|
|
10
|
+
[--eyebrow "..."]
|
|
11
|
+
[--state <state.json>]
|
|
12
|
+
[--json <sidecar.json>]
|
|
13
|
+
[--offline]
|
|
14
|
+
[--no-toc]
|
|
15
|
+
|
|
16
|
+
See skills/render-html/SKILL.md for the full contract.
|
|
17
|
+
|
|
18
|
+
Design invariants (see codex review consultation in commit message):
|
|
19
|
+
- Markdown / JSON is canonical source, HTML is generated view.
|
|
20
|
+
- HTML embeds source path + SHA256 + generated timestamp (drift detection).
|
|
21
|
+
- Single-file output. MathJax + highlight.js loaded from CDN unless --offline.
|
|
22
|
+
- Pure stdlib: re, html, hashlib, json, datetime, pathlib, argparse, sys.
|
|
23
|
+
- Conservative Markdown subset matching what ARIS artifacts actually emit.
|
|
24
|
+
"""
|
|
25
|
+
from __future__ import annotations
|
|
26
|
+
|
|
27
|
+
import argparse
|
|
28
|
+
import hashlib
|
|
29
|
+
import html as html_lib
|
|
30
|
+
import json
|
|
31
|
+
import re
|
|
32
|
+
import sys
|
|
33
|
+
from datetime import datetime, timezone
|
|
34
|
+
from pathlib import Path
|
|
35
|
+
|
|
36
|
+
TEMPLATES_DIR = Path(__file__).resolve().parent / "templates"
|
|
37
|
+
|
|
38
|
+
# ---------------------------------------------------------------------------
|
|
39
|
+
# Inline parsing
|
|
40
|
+
# ---------------------------------------------------------------------------
|
|
41
|
+
|
|
42
|
+
# Placeholders used to protect inline content during multi-pass rewriting.
|
|
43
|
+
# Two non-printable PUA chars + index to avoid collisions with real content.
|
|
44
|
+
_PH_OPEN = ""
|
|
45
|
+
_PH_CLOSE = ""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _ph(idx: int) -> str:
|
|
49
|
+
return f"{_PH_OPEN}{idx}{_PH_CLOSE}"
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
_RE_CODE_INLINE = re.compile(r"`([^`\n]+)`")
|
|
53
|
+
_RE_MATH_DISPLAY = re.compile(r"\$\$([^\n][\s\S]*?)\$\$")
|
|
54
|
+
_RE_MATH_INLINE = re.compile(r"(?<!\\)\$([^\$\n]+?)\$")
|
|
55
|
+
_RE_IMG = re.compile(r"!\[([^\]]*)\]\(([^)\s]+)(?:\s+\"([^\"]*)\")?\)")
|
|
56
|
+
_RE_LINK = re.compile(r"\[([^\]]+)\]\(([^)\s]+)(?:\s+\"([^\"]*)\")?\)")
|
|
57
|
+
_RE_BOLD = re.compile(r"\*\*([^\*\n]+)\*\*")
|
|
58
|
+
_RE_ITALIC = re.compile(r"(?<!\*)\*([^\*\n]+)\*(?!\*)")
|
|
59
|
+
_RE_ITALIC_UNDERSCORE = re.compile(r"(?<!\w)_([^_\n]+)_(?!\w)")
|
|
60
|
+
_RE_STRIKE = re.compile(r"~~([^~\n]+)~~")
|
|
61
|
+
|
|
62
|
+
# Inline HTML tags that should pass through inline (commonly used in ARIS docs).
|
|
63
|
+
_INLINE_HTML_TAGS = ("br", "img", "a", "span", "sub", "sup", "code", "kbd", "b", "i", "u", "strong", "em")
|
|
64
|
+
|
|
65
|
+
# URL schemes considered safe for href/src. javascript:, data:, vbscript: blocked.
|
|
66
|
+
_SAFE_URL_SCHEMES = ("http:", "https:", "mailto:", "ftp:", "tel:", "#", "/", "./", "../")
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _safe_url(url: str) -> str:
|
|
70
|
+
"""Return url if scheme is safe, else '#'. Defensive against javascript: links."""
|
|
71
|
+
s = url.strip().lower()
|
|
72
|
+
# Relative paths and fragments are fine
|
|
73
|
+
if s.startswith(("#", "/", "./", "../")) or s == "":
|
|
74
|
+
return url
|
|
75
|
+
if s.startswith(_SAFE_URL_SCHEMES):
|
|
76
|
+
return url
|
|
77
|
+
# Bare path like "foo/bar.md" or "page.html" — no scheme prefix, safe.
|
|
78
|
+
if ":" not in s.split("/", 1)[0]:
|
|
79
|
+
return url
|
|
80
|
+
# Block javascript:, data:, vbscript:, file:, etc.
|
|
81
|
+
return "#blocked-unsafe-url"
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Tags stripped wholesale from HTML passthrough (block and inline).
|
|
85
|
+
# Even if the workflow LLM hallucinates these, they never reach output.
|
|
86
|
+
_RE_STRIP_TAG = re.compile(
|
|
87
|
+
r"<\s*(script|style|iframe|object|embed|form|input|button|link|meta|base)\b[^>]*>.*?</\s*\1\s*>",
|
|
88
|
+
re.IGNORECASE | re.DOTALL,
|
|
89
|
+
)
|
|
90
|
+
_RE_STRIP_TAG_SELF = re.compile(
|
|
91
|
+
r"<\s*(script|style|iframe|object|embed|form|input|button|link|meta|base)\b[^>]*/?\s*>",
|
|
92
|
+
re.IGNORECASE,
|
|
93
|
+
)
|
|
94
|
+
# Event-handler attributes like onclick=, onload=, etc. — strip these.
|
|
95
|
+
_RE_STRIP_EVENT_ATTR = re.compile(
|
|
96
|
+
r"\s+on[a-z]+\s*=\s*(\"[^\"]*\"|'[^']*'|[^\s>]+)",
|
|
97
|
+
re.IGNORECASE,
|
|
98
|
+
)
|
|
99
|
+
# javascript:/vbscript:/data: in href/src — replace with #blocked.
|
|
100
|
+
_RE_STRIP_DANGEROUS_URL_ATTR = re.compile(
|
|
101
|
+
r"""(\b(?:href|src|action|formaction|poster)\s*=\s*["']?)\s*(?:javascript|vbscript|data)\s*:""",
|
|
102
|
+
re.IGNORECASE,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def sanitize_html(s: str) -> str:
|
|
107
|
+
"""Strip dangerous tags / event handlers / javascript: URLs from raw HTML.
|
|
108
|
+
|
|
109
|
+
Applied to: (a) inline-HTML spans we pass through, (b) block-HTML
|
|
110
|
+
passthrough content. Markdown text content is HTML-escaped separately
|
|
111
|
+
and never reaches this function. ARIS workflow artifacts should not
|
|
112
|
+
contain these tags; this is defense-in-depth in case an LLM hallucinates
|
|
113
|
+
one.
|
|
114
|
+
"""
|
|
115
|
+
s = _RE_STRIP_TAG.sub("", s)
|
|
116
|
+
s = _RE_STRIP_TAG_SELF.sub("", s)
|
|
117
|
+
s = _RE_STRIP_EVENT_ATTR.sub("", s)
|
|
118
|
+
s = _RE_STRIP_DANGEROUS_URL_ATTR.sub(r"\1#blocked-unsafe-url:", s)
|
|
119
|
+
return s
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def render_inline(text: str) -> str:
|
|
123
|
+
"""Convert Markdown inline syntax to HTML. Escape everything else.
|
|
124
|
+
|
|
125
|
+
Order matters:
|
|
126
|
+
1. Stash inline code, math (display+inline), and raw HTML tag-shaped
|
|
127
|
+
spans into placeholders (so we don't expand markdown inside them).
|
|
128
|
+
2. HTML-escape the remaining text.
|
|
129
|
+
3. Apply images, links, bold, italic, strike.
|
|
130
|
+
4. Restore placeholders.
|
|
131
|
+
"""
|
|
132
|
+
stash: list[str] = []
|
|
133
|
+
|
|
134
|
+
def store(replacement: str) -> str:
|
|
135
|
+
idx = len(stash)
|
|
136
|
+
stash.append(replacement)
|
|
137
|
+
return _ph(idx)
|
|
138
|
+
|
|
139
|
+
# 1a. Inline code -- escape inner content fully.
|
|
140
|
+
def _code_sub(m: re.Match[str]) -> str:
|
|
141
|
+
return store(f"<code>{html_lib.escape(m.group(1))}</code>")
|
|
142
|
+
|
|
143
|
+
text = _RE_CODE_INLINE.sub(_code_sub, text)
|
|
144
|
+
|
|
145
|
+
# 1b. Display math (passthrough; MathJax will render).
|
|
146
|
+
def _md_sub(m: re.Match[str]) -> str:
|
|
147
|
+
body = m.group(1)
|
|
148
|
+
return store(f"$${body}$$")
|
|
149
|
+
|
|
150
|
+
text = _RE_MATH_DISPLAY.sub(_md_sub, text)
|
|
151
|
+
|
|
152
|
+
# 1c. Inline math (passthrough).
|
|
153
|
+
def _mi_sub(m: re.Match[str]) -> str:
|
|
154
|
+
body = m.group(1)
|
|
155
|
+
return store(f"${body}$")
|
|
156
|
+
|
|
157
|
+
text = _RE_MATH_INLINE.sub(_mi_sub, text)
|
|
158
|
+
|
|
159
|
+
# 1d. Inline HTML spans (very limited allowlist + sanitize before stash).
|
|
160
|
+
_re_tag = re.compile(
|
|
161
|
+
r"<(/?)(" + "|".join(_INLINE_HTML_TAGS) + r")(\s[^<>]*)?>",
|
|
162
|
+
re.IGNORECASE,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
def _tag_sub(m: re.Match[str]) -> str:
|
|
166
|
+
return store(sanitize_html(m.group(0)))
|
|
167
|
+
|
|
168
|
+
text = _re_tag.sub(_tag_sub, text)
|
|
169
|
+
|
|
170
|
+
# 2. HTML-escape remainder.
|
|
171
|
+
text = html_lib.escape(text, quote=False)
|
|
172
|
+
|
|
173
|
+
# 3. Apply markdown emphasis & links.
|
|
174
|
+
def _img_sub(m: re.Match[str]) -> str:
|
|
175
|
+
alt = html_lib.escape(m.group(1), quote=True)
|
|
176
|
+
src = html_lib.escape(_safe_url(m.group(2)), quote=True)
|
|
177
|
+
title = m.group(3)
|
|
178
|
+
title_attr = f' title="{html_lib.escape(title, quote=True)}"' if title else ""
|
|
179
|
+
return f'<img src="{src}" alt="{alt}"{title_attr} />'
|
|
180
|
+
|
|
181
|
+
text = _RE_IMG.sub(_img_sub, text)
|
|
182
|
+
|
|
183
|
+
def _link_sub(m: re.Match[str]) -> str:
|
|
184
|
+
label = m.group(1) # inner label can still contain code placeholders; ok.
|
|
185
|
+
href = html_lib.escape(_safe_url(m.group(2)), quote=True)
|
|
186
|
+
title = m.group(3)
|
|
187
|
+
title_attr = f' title="{html_lib.escape(title, quote=True)}"' if title else ""
|
|
188
|
+
return f'<a href="{href}"{title_attr}>{label}</a>'
|
|
189
|
+
|
|
190
|
+
text = _RE_LINK.sub(_link_sub, text)
|
|
191
|
+
text = _RE_BOLD.sub(r"<strong>\1</strong>", text)
|
|
192
|
+
text = _RE_ITALIC.sub(r"<em>\1</em>", text)
|
|
193
|
+
text = _RE_ITALIC_UNDERSCORE.sub(r"<em>\1</em>", text)
|
|
194
|
+
text = _RE_STRIKE.sub(r"<del>\1</del>", text)
|
|
195
|
+
|
|
196
|
+
# 4. Restore placeholders.
|
|
197
|
+
def _restore(m: re.Match[str]) -> str:
|
|
198
|
+
idx = int(m.group(1))
|
|
199
|
+
return stash[idx]
|
|
200
|
+
|
|
201
|
+
text = re.sub(rf"{_PH_OPEN}(\d+){_PH_CLOSE}", _restore, text)
|
|
202
|
+
return text
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
# ---------------------------------------------------------------------------
|
|
206
|
+
# Block parsing
|
|
207
|
+
# ---------------------------------------------------------------------------
|
|
208
|
+
|
|
209
|
+
_RE_HEADING = re.compile(r"^(#{1,6})\s+(.+?)\s*#*\s*$")
|
|
210
|
+
_RE_HR = re.compile(r"^\s*(?:-{3,}|\*{3,}|_{3,})\s*$")
|
|
211
|
+
_RE_CODE_FENCE = re.compile(r"^```(\w+)?\s*$")
|
|
212
|
+
_RE_TABLE_DIVIDER = re.compile(r"^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$")
|
|
213
|
+
_RE_ORDERED = re.compile(r"^(\s*)(\d+)[.)]\s+(.*)$")
|
|
214
|
+
_RE_UNORDERED = re.compile(r"^(\s*)[-*+]\s+(.*)$")
|
|
215
|
+
_RE_BLOCKQUOTE = re.compile(r"^>\s?(.*)$")
|
|
216
|
+
_RE_HTML_BLOCK_OPEN = re.compile(
|
|
217
|
+
r"^\s*<(details|div|figure|table|p|ul|ol|nav|section|aside|header|footer|main|article|blockquote)(\s|>|/>)",
|
|
218
|
+
re.IGNORECASE,
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
_CALLOUT_PREFIX_MAP = [
|
|
222
|
+
# (regex on first content, css class, default title)
|
|
223
|
+
(re.compile(r"^[⚠️⚠]️?\s*"), "callout-warn", "Warning"),
|
|
224
|
+
(re.compile(r"^💡\s*"), "callout-info", "Tip"),
|
|
225
|
+
(re.compile(r"^✅\s*"), "callout-good", "OK"),
|
|
226
|
+
(re.compile(r"^✓\s*"), "callout-good", "OK"),
|
|
227
|
+
(re.compile(r"^❌\s*"), "callout-bad", "Blocked"),
|
|
228
|
+
(re.compile(r"^🔒\s*"), "callout-good", "Guarantee"),
|
|
229
|
+
(re.compile(r"^📝\s*"), "callout-info", "Note"),
|
|
230
|
+
(re.compile(r"^🚨\s*"), "callout-bad", "Critical"),
|
|
231
|
+
(re.compile(r"^🛠\s*"), "callout-info", "Note"),
|
|
232
|
+
(re.compile(r"^🆕\s*"), "callout-info", "New"),
|
|
233
|
+
(re.compile(r"^⚙️⚡?\s*"), "callout-info", "Config"),
|
|
234
|
+
(re.compile(r"^🔁\s*"), "callout-info", "Loop"),
|
|
235
|
+
(re.compile(r"^🌱\s*"), "callout-info", "Note"),
|
|
236
|
+
(re.compile(r"^📚\s*"), "callout-info", "Reference"),
|
|
237
|
+
(re.compile(r"^🧬\s*"), "callout-info", "Meta"),
|
|
238
|
+
]
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def _slugify(text: str) -> str:
|
|
242
|
+
text = re.sub(r"[`*_~$]", "", text)
|
|
243
|
+
text = re.sub(r"\s+", "-", text.strip().lower())
|
|
244
|
+
text = re.sub(r"[^a-z0-9一-鿿\-]", "", text)
|
|
245
|
+
return text.strip("-") or "section"
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def parse_blocks(lines: list[str]) -> list[dict]:
|
|
249
|
+
blocks: list[dict] = []
|
|
250
|
+
i = 0
|
|
251
|
+
n = len(lines)
|
|
252
|
+
while i < n:
|
|
253
|
+
line = lines[i]
|
|
254
|
+
stripped = line.rstrip()
|
|
255
|
+
|
|
256
|
+
# Blank line — skip.
|
|
257
|
+
if not stripped.strip():
|
|
258
|
+
i += 1
|
|
259
|
+
continue
|
|
260
|
+
|
|
261
|
+
# Code fence.
|
|
262
|
+
m = _RE_CODE_FENCE.match(stripped)
|
|
263
|
+
if m:
|
|
264
|
+
lang = (m.group(1) or "").strip()
|
|
265
|
+
body: list[str] = []
|
|
266
|
+
i += 1
|
|
267
|
+
while i < n and not _RE_CODE_FENCE.match(lines[i].rstrip()):
|
|
268
|
+
body.append(lines[i])
|
|
269
|
+
i += 1
|
|
270
|
+
if i < n: # consume closing fence
|
|
271
|
+
i += 1
|
|
272
|
+
blocks.append({"type": "code", "lang": lang, "content": "\n".join(body)})
|
|
273
|
+
continue
|
|
274
|
+
|
|
275
|
+
# ATX heading.
|
|
276
|
+
m = _RE_HEADING.match(stripped)
|
|
277
|
+
if m:
|
|
278
|
+
level = len(m.group(1))
|
|
279
|
+
text = m.group(2).strip()
|
|
280
|
+
blocks.append({"type": "heading", "level": level, "text": text})
|
|
281
|
+
i += 1
|
|
282
|
+
continue
|
|
283
|
+
|
|
284
|
+
# Horizontal rule.
|
|
285
|
+
if _RE_HR.match(stripped):
|
|
286
|
+
blocks.append({"type": "hr"})
|
|
287
|
+
i += 1
|
|
288
|
+
continue
|
|
289
|
+
|
|
290
|
+
# Table: current line has at least one `|`, AND next line is a divider.
|
|
291
|
+
if "|" in stripped and i + 1 < n and _RE_TABLE_DIVIDER.match(lines[i + 1].rstrip()):
|
|
292
|
+
header = stripped
|
|
293
|
+
divider = lines[i + 1].rstrip()
|
|
294
|
+
rows: list[str] = []
|
|
295
|
+
j = i + 2
|
|
296
|
+
while j < n and "|" in lines[j] and lines[j].strip():
|
|
297
|
+
rows.append(lines[j].rstrip())
|
|
298
|
+
j += 1
|
|
299
|
+
blocks.append({"type": "table", "header": header, "divider": divider, "rows": rows})
|
|
300
|
+
i = j
|
|
301
|
+
continue
|
|
302
|
+
|
|
303
|
+
# HTML block — passthrough until the closing tag is reached. Per
|
|
304
|
+
# CommonMark §4.6 (loosely): treat the block as ending on the first
|
|
305
|
+
# line that *starts* with the matching </tag>. We track depth only
|
|
306
|
+
# for opening/closing tags that appear at line start (after optional
|
|
307
|
+
# whitespace), so inline mentions like `<details>` inside backticks
|
|
308
|
+
# in a paragraph don't perturb the counter.
|
|
309
|
+
if _RE_HTML_BLOCK_OPEN.match(line):
|
|
310
|
+
tag_m = _RE_HTML_BLOCK_OPEN.match(line)
|
|
311
|
+
assert tag_m is not None
|
|
312
|
+
tag = tag_m.group(1).lower()
|
|
313
|
+
line_open_re = re.compile(rf"^\s*<{re.escape(tag)}(?=[\s/>])", re.IGNORECASE)
|
|
314
|
+
line_close_re = re.compile(rf"^\s*</{re.escape(tag)}(?=[\s>])", re.IGNORECASE)
|
|
315
|
+
body = [line]
|
|
316
|
+
depth = 1
|
|
317
|
+
# Self-closing tag on the same line: <tag .../>
|
|
318
|
+
if re.search(rf"<{re.escape(tag)}\b[^>]*/\s*>", line, re.IGNORECASE):
|
|
319
|
+
depth = 0
|
|
320
|
+
# Same-line full close: <tag>...</tag> or </tag> on same line as open
|
|
321
|
+
elif re.search(rf"</{re.escape(tag)}(?=[\s>])", line, re.IGNORECASE):
|
|
322
|
+
depth = 0
|
|
323
|
+
i += 1
|
|
324
|
+
while i < n and depth > 0:
|
|
325
|
+
cur = lines[i]
|
|
326
|
+
body.append(cur)
|
|
327
|
+
# Count nested opens/closes at line start only.
|
|
328
|
+
if line_open_re.match(cur):
|
|
329
|
+
depth += 1
|
|
330
|
+
if line_close_re.match(cur):
|
|
331
|
+
depth -= 1
|
|
332
|
+
i += 1
|
|
333
|
+
content = "\n".join(body)
|
|
334
|
+
# Sanitize: strip dangerous tags / event handlers / unsafe URL schemes.
|
|
335
|
+
content = sanitize_html(content)
|
|
336
|
+
blocks.append({"type": "html", "content": content})
|
|
337
|
+
continue
|
|
338
|
+
|
|
339
|
+
# Blockquote.
|
|
340
|
+
if _RE_BLOCKQUOTE.match(stripped):
|
|
341
|
+
quote_lines: list[str] = []
|
|
342
|
+
while i < n:
|
|
343
|
+
m_bq = _RE_BLOCKQUOTE.match(lines[i].rstrip())
|
|
344
|
+
if not m_bq:
|
|
345
|
+
break
|
|
346
|
+
quote_lines.append(m_bq.group(1))
|
|
347
|
+
i += 1
|
|
348
|
+
blocks.append({"type": "blockquote", "lines": quote_lines})
|
|
349
|
+
continue
|
|
350
|
+
|
|
351
|
+
# Ordered or unordered list. Indent-aware: a marker at the same
|
|
352
|
+
# indent as the first item starts a sibling; a marker at deeper
|
|
353
|
+
# indent (or any deeper-indented continuation line) becomes part
|
|
354
|
+
# of the current item's content and is re-parsed recursively in
|
|
355
|
+
# render_list (so nested lists / paragraphs / code blocks work).
|
|
356
|
+
if _RE_ORDERED.match(stripped) or _RE_UNORDERED.match(stripped):
|
|
357
|
+
first_m = _RE_ORDERED.match(lines[i]) or _RE_UNORDERED.match(lines[i])
|
|
358
|
+
base_indent = len(first_m.group(1))
|
|
359
|
+
ordered = bool(_RE_ORDERED.match(lines[i]))
|
|
360
|
+
items: list[str] = []
|
|
361
|
+
current: list[str] = []
|
|
362
|
+
while i < n:
|
|
363
|
+
cur_line = lines[i]
|
|
364
|
+
# Blank line — peek ahead to decide if list continues.
|
|
365
|
+
if cur_line.strip() == "":
|
|
366
|
+
if i + 1 < n:
|
|
367
|
+
nxt = lines[i + 1]
|
|
368
|
+
m_o_next = _RE_ORDERED.match(nxt)
|
|
369
|
+
m_u_next = _RE_UNORDERED.match(nxt)
|
|
370
|
+
if (m_o_next or m_u_next) and len(
|
|
371
|
+
(m_o_next or m_u_next).group(1)
|
|
372
|
+
) >= base_indent:
|
|
373
|
+
# Continue list; consume blank.
|
|
374
|
+
current.append("")
|
|
375
|
+
i += 1
|
|
376
|
+
continue
|
|
377
|
+
if nxt.startswith(" " * (base_indent + 2)) or nxt.startswith("\t"):
|
|
378
|
+
current.append("")
|
|
379
|
+
i += 1
|
|
380
|
+
continue
|
|
381
|
+
break
|
|
382
|
+
m_o = _RE_ORDERED.match(cur_line)
|
|
383
|
+
m_u = _RE_UNORDERED.match(cur_line)
|
|
384
|
+
if m_o or m_u:
|
|
385
|
+
marker_indent = len((m_o or m_u).group(1))
|
|
386
|
+
if marker_indent == base_indent:
|
|
387
|
+
# Sibling item at same level.
|
|
388
|
+
if current:
|
|
389
|
+
items.append("\n".join(current).rstrip())
|
|
390
|
+
current = []
|
|
391
|
+
current.append((m_o or m_u).group(3 if m_o else 2))
|
|
392
|
+
i += 1
|
|
393
|
+
continue
|
|
394
|
+
if marker_indent > base_indent:
|
|
395
|
+
# Nested item — append the line with reduced indent
|
|
396
|
+
# (strip base_indent + 2 spaces so the nested parse
|
|
397
|
+
# sees the marker at column 0 of its own context).
|
|
398
|
+
strip = base_indent + 2
|
|
399
|
+
current.append(
|
|
400
|
+
cur_line[strip:] if cur_line[:strip].strip() == "" else cur_line.lstrip()
|
|
401
|
+
)
|
|
402
|
+
i += 1
|
|
403
|
+
continue
|
|
404
|
+
# Marker at shallower indent — list ends here.
|
|
405
|
+
break
|
|
406
|
+
# Non-marker line: continuation of current item if indented
|
|
407
|
+
# past base_indent + 2 (or any indent for the "lazy continuation"
|
|
408
|
+
# convention).
|
|
409
|
+
if cur_line.startswith(" " * (base_indent + 2)) or cur_line.startswith("\t"):
|
|
410
|
+
strip = base_indent + 2
|
|
411
|
+
current.append(
|
|
412
|
+
cur_line[strip:] if cur_line[:strip].strip() == "" else cur_line.lstrip()
|
|
413
|
+
)
|
|
414
|
+
i += 1
|
|
415
|
+
continue
|
|
416
|
+
# Anything else at base_indent or shallower → list ends.
|
|
417
|
+
break
|
|
418
|
+
if current:
|
|
419
|
+
items.append("\n".join(current).rstrip())
|
|
420
|
+
blocks.append({"type": "list", "ordered": ordered, "items": items})
|
|
421
|
+
continue
|
|
422
|
+
|
|
423
|
+
# Paragraph: gather lines until blank or block boundary.
|
|
424
|
+
para: list[str] = [stripped]
|
|
425
|
+
i += 1
|
|
426
|
+
while i < n:
|
|
427
|
+
nxt = lines[i].rstrip()
|
|
428
|
+
if not nxt.strip():
|
|
429
|
+
break
|
|
430
|
+
if (_RE_HEADING.match(nxt) or _RE_CODE_FENCE.match(nxt) or _RE_HR.match(nxt) or
|
|
431
|
+
_RE_BLOCKQUOTE.match(nxt) or _RE_ORDERED.match(nxt) or
|
|
432
|
+
_RE_UNORDERED.match(nxt) or _RE_HTML_BLOCK_OPEN.match(lines[i]) or
|
|
433
|
+
("|" in nxt and i + 1 < n and _RE_TABLE_DIVIDER.match(lines[i + 1].rstrip()))):
|
|
434
|
+
break
|
|
435
|
+
para.append(nxt)
|
|
436
|
+
i += 1
|
|
437
|
+
blocks.append({"type": "paragraph", "text": " ".join(para)})
|
|
438
|
+
return blocks
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
# ---------------------------------------------------------------------------
|
|
442
|
+
# Block rendering
|
|
443
|
+
# ---------------------------------------------------------------------------
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
def render_table(header: str, divider: str, rows: list[str]) -> str:
|
|
447
|
+
def split_row(s: str) -> list[str]:
|
|
448
|
+
s = s.strip()
|
|
449
|
+
if s.startswith("|"):
|
|
450
|
+
s = s[1:]
|
|
451
|
+
if s.endswith("|"):
|
|
452
|
+
s = s[:-1]
|
|
453
|
+
return [c.strip() for c in s.split("|")]
|
|
454
|
+
|
|
455
|
+
header_cells = split_row(header)
|
|
456
|
+
align = []
|
|
457
|
+
for cell in split_row(divider):
|
|
458
|
+
cell = cell.strip()
|
|
459
|
+
if cell.startswith(":") and cell.endswith(":"):
|
|
460
|
+
align.append("center")
|
|
461
|
+
elif cell.endswith(":"):
|
|
462
|
+
align.append("right")
|
|
463
|
+
else:
|
|
464
|
+
align.append("left")
|
|
465
|
+
|
|
466
|
+
def cell_attr(idx: int) -> str:
|
|
467
|
+
if idx < len(align) and align[idx] != "left":
|
|
468
|
+
return f' style="text-align:{align[idx]}"'
|
|
469
|
+
return ""
|
|
470
|
+
|
|
471
|
+
out: list[str] = ["<table>", "<thead><tr>"]
|
|
472
|
+
for idx, cell in enumerate(header_cells):
|
|
473
|
+
out.append(f"<th{cell_attr(idx)}>{render_inline(cell)}</th>")
|
|
474
|
+
out.append("</tr></thead>")
|
|
475
|
+
out.append("<tbody>")
|
|
476
|
+
for row in rows:
|
|
477
|
+
out.append("<tr>")
|
|
478
|
+
for idx, cell in enumerate(split_row(row)):
|
|
479
|
+
out.append(f"<td{cell_attr(idx)}>{render_inline(cell)}</td>")
|
|
480
|
+
out.append("</tr>")
|
|
481
|
+
out.append("</tbody></table>")
|
|
482
|
+
return "".join(out)
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
def render_blockquote(quote_lines: list[str]) -> str:
|
|
486
|
+
"""Detect callout style (emoji prefix) and render with callout class."""
|
|
487
|
+
if not quote_lines:
|
|
488
|
+
return "<blockquote></blockquote>"
|
|
489
|
+
first = quote_lines[0]
|
|
490
|
+
css_class = None
|
|
491
|
+
title = None
|
|
492
|
+
body_lines = list(quote_lines)
|
|
493
|
+
# Try matching callout prefix on the first non-empty line.
|
|
494
|
+
first_nonempty_idx = 0
|
|
495
|
+
while first_nonempty_idx < len(body_lines) and not body_lines[first_nonempty_idx].strip():
|
|
496
|
+
first_nonempty_idx += 1
|
|
497
|
+
if first_nonempty_idx < len(body_lines):
|
|
498
|
+
line0 = body_lines[first_nonempty_idx].lstrip()
|
|
499
|
+
for pattern, klass, default_title in _CALLOUT_PREFIX_MAP:
|
|
500
|
+
m = pattern.match(line0)
|
|
501
|
+
if m:
|
|
502
|
+
css_class = klass
|
|
503
|
+
title = default_title
|
|
504
|
+
# Strip emoji + try to extract a **Bold:** title prefix.
|
|
505
|
+
rest = pattern.sub("", line0, count=1)
|
|
506
|
+
m_title = re.match(r"\*\*([^*\n]+?)\*\*[::\s\-—]+\s*", rest)
|
|
507
|
+
if m_title:
|
|
508
|
+
title = m_title.group(1)
|
|
509
|
+
rest = rest[m_title.end():]
|
|
510
|
+
body_lines[first_nonempty_idx] = rest
|
|
511
|
+
break
|
|
512
|
+
|
|
513
|
+
inner_md = "\n".join(body_lines).strip("\n")
|
|
514
|
+
inner_blocks = parse_blocks(inner_md.split("\n")) if inner_md else []
|
|
515
|
+
inner_html, _ = _render_blocks(inner_blocks, collect_toc=False)
|
|
516
|
+
if css_class:
|
|
517
|
+
title_html = f'<div class="callout-title">{html_lib.escape(title or "")}</div>' if title else ""
|
|
518
|
+
return f'<div class="callout {css_class}">{title_html}{inner_html}</div>'
|
|
519
|
+
return f"<blockquote>{inner_html}</blockquote>"
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
def render_list(ordered: bool, items: list[str]) -> str:
|
|
523
|
+
tag = "ol" if ordered else "ul"
|
|
524
|
+
out = [f"<{tag}>"]
|
|
525
|
+
for item in items:
|
|
526
|
+
# Nested lists are possible — parse the item body as blocks.
|
|
527
|
+
item_blocks = parse_blocks(item.split("\n"))
|
|
528
|
+
# Common case: single paragraph — emit inline directly.
|
|
529
|
+
if len(item_blocks) == 1 and item_blocks[0]["type"] == "paragraph":
|
|
530
|
+
out.append(f"<li>{render_inline(item_blocks[0]['text'])}</li>")
|
|
531
|
+
else:
|
|
532
|
+
inner, _ = _render_blocks(item_blocks, collect_toc=False)
|
|
533
|
+
out.append(f"<li>{inner}</li>")
|
|
534
|
+
out.append(f"</{tag}>")
|
|
535
|
+
return "".join(out)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
def render_code(lang: str, content: str) -> str:
|
|
539
|
+
escaped = html_lib.escape(content)
|
|
540
|
+
if lang:
|
|
541
|
+
return f'<pre><code class="language-{html_lib.escape(lang, quote=True)}">{escaped}</code></pre>'
|
|
542
|
+
# Heuristic: if content looks like an ASCII art diagram (mostly box-drawing
|
|
543
|
+
# chars and pipes), tag the surrounding <pre> with class="diagram".
|
|
544
|
+
diagram_chars = set("│─┌┐└┘├┤┬┴┼▲▼◀▶━┃┏┓┗┛╭╮╰╯═║╔╗╚╝╠╣╦╩╬║▶▼─")
|
|
545
|
+
sample = content[:200]
|
|
546
|
+
if sample and sum(1 for c in sample if c in diagram_chars) >= 4:
|
|
547
|
+
return f'<pre class="diagram"><code>{escaped}</code></pre>'
|
|
548
|
+
return f"<pre><code>{escaped}</code></pre>"
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
def _render_blocks(
|
|
552
|
+
blocks: list[dict],
|
|
553
|
+
collect_toc: bool,
|
|
554
|
+
used_ids: dict | None = None,
|
|
555
|
+
) -> tuple[str, list[dict]]:
|
|
556
|
+
if used_ids is None:
|
|
557
|
+
used_ids = {}
|
|
558
|
+
out: list[str] = []
|
|
559
|
+
toc: list[dict] = []
|
|
560
|
+
for b in blocks:
|
|
561
|
+
t = b["type"]
|
|
562
|
+
if t == "heading":
|
|
563
|
+
level = b["level"]
|
|
564
|
+
text = b["text"]
|
|
565
|
+
inline = render_inline(text)
|
|
566
|
+
base_id = _slugify(text)
|
|
567
|
+
uid = base_id
|
|
568
|
+
n = used_ids.get(base_id, 0)
|
|
569
|
+
if n > 0:
|
|
570
|
+
uid = f"{base_id}-{n}"
|
|
571
|
+
used_ids[base_id] = n + 1
|
|
572
|
+
out.append(f'<h{level} id="{uid}">{inline}</h{level}>')
|
|
573
|
+
if collect_toc and 2 <= level <= 3:
|
|
574
|
+
toc.append({"level": level, "id": uid, "text": text})
|
|
575
|
+
elif t == "paragraph":
|
|
576
|
+
out.append(f"<p>{render_inline(b['text'])}</p>")
|
|
577
|
+
elif t == "hr":
|
|
578
|
+
out.append("<hr />")
|
|
579
|
+
elif t == "code":
|
|
580
|
+
out.append(render_code(b.get("lang", ""), b["content"]))
|
|
581
|
+
elif t == "blockquote":
|
|
582
|
+
out.append(render_blockquote(b["lines"]))
|
|
583
|
+
elif t == "list":
|
|
584
|
+
out.append(render_list(b["ordered"], b["items"]))
|
|
585
|
+
elif t == "table":
|
|
586
|
+
out.append(render_table(b["header"], b["divider"], b["rows"]))
|
|
587
|
+
elif t == "html":
|
|
588
|
+
out.append(_render_html_block(b["content"]))
|
|
589
|
+
else:
|
|
590
|
+
out.append(f"<!-- unknown block: {html_lib.escape(t)} -->")
|
|
591
|
+
return "\n".join(out), toc
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
def _render_html_block(content: str) -> str:
|
|
595
|
+
"""For <details>...</details> blocks, parse the inner content as Markdown.
|
|
596
|
+
|
|
597
|
+
Matches GitHub-flavored convention: when a `<details>` block has a blank
|
|
598
|
+
line separating its `<summary>` from the body, the body is parsed as
|
|
599
|
+
markdown (lists, headings, code, callouts all work). For non-<details>
|
|
600
|
+
HTML blocks, content passes through verbatim.
|
|
601
|
+
"""
|
|
602
|
+
lines = content.split("\n")
|
|
603
|
+
if not lines or not lines[0].lstrip().lower().startswith("<details"):
|
|
604
|
+
return content
|
|
605
|
+
# Locate opening boundary: after </summary> if present, else after the
|
|
606
|
+
# <details> line itself.
|
|
607
|
+
open_end = 1 # default: just past the <details> line
|
|
608
|
+
summary_close_re = re.compile(r"</summary\s*>", re.IGNORECASE)
|
|
609
|
+
for j in range(1, len(lines)):
|
|
610
|
+
if summary_close_re.search(lines[j]):
|
|
611
|
+
open_end = j + 1
|
|
612
|
+
break
|
|
613
|
+
# If we hit non-summary content first, no `<summary>` block; stop scanning.
|
|
614
|
+
if lines[j].strip() and not re.match(r"\s*<summary", lines[j], re.IGNORECASE):
|
|
615
|
+
break
|
|
616
|
+
# Locate closing boundary: the last </details> line.
|
|
617
|
+
close_start = len(lines) - 1
|
|
618
|
+
close_re = re.compile(r"^\s*</details\s*>", re.IGNORECASE)
|
|
619
|
+
while close_start > 0 and not close_re.match(lines[close_start]):
|
|
620
|
+
close_start -= 1
|
|
621
|
+
if open_end >= close_start:
|
|
622
|
+
# Degenerate or empty body; emit raw.
|
|
623
|
+
return content
|
|
624
|
+
open_part = "\n".join(lines[:open_end])
|
|
625
|
+
inner_md = "\n".join(lines[open_end:close_start]).strip("\n")
|
|
626
|
+
close_part = "\n".join(lines[close_start:])
|
|
627
|
+
if not inner_md.strip():
|
|
628
|
+
return content
|
|
629
|
+
inner_blocks = parse_blocks(inner_md.split("\n"))
|
|
630
|
+
inner_html, _ = _render_blocks(inner_blocks, collect_toc=False)
|
|
631
|
+
return f"{open_part}\n{inner_html}\n{close_part}"
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
def render_toc(toc: list[dict]) -> str:
|
|
635
|
+
"""Render a nested TOC. Groups consecutive H3s under their preceding H2.
|
|
636
|
+
|
|
637
|
+
Orphan H3 (H3 without a preceding H2 in this run) is promoted to a
|
|
638
|
+
top-level <li>. Output is well-formed `<ol><li>...<ul><li>...</li></ul>...</li></ol>`.
|
|
639
|
+
"""
|
|
640
|
+
if not toc:
|
|
641
|
+
return ""
|
|
642
|
+
grouped: list[tuple[dict, list[dict]]] = [] # [(h2_entry, [h3_children])]
|
|
643
|
+
current_parent: dict | None = None
|
|
644
|
+
current_children: list[dict] = []
|
|
645
|
+
for entry in toc:
|
|
646
|
+
if entry["level"] == 2:
|
|
647
|
+
if current_parent is not None:
|
|
648
|
+
grouped.append((current_parent, current_children))
|
|
649
|
+
current_parent = entry
|
|
650
|
+
current_children = []
|
|
651
|
+
elif entry["level"] == 3:
|
|
652
|
+
if current_parent is None:
|
|
653
|
+
# Orphan H3 — promote to top level so the TOC stays well-formed.
|
|
654
|
+
grouped.append((entry, []))
|
|
655
|
+
else:
|
|
656
|
+
current_children.append(entry)
|
|
657
|
+
if current_parent is not None:
|
|
658
|
+
grouped.append((current_parent, current_children))
|
|
659
|
+
|
|
660
|
+
out: list[str] = ["<ol>"]
|
|
661
|
+
for parent, children in grouped:
|
|
662
|
+
pid = html_lib.escape(parent["id"], quote=True)
|
|
663
|
+
ptext = html_lib.escape(parent["text"])
|
|
664
|
+
out.append(f'<li><a href="#{pid}">{ptext}</a>')
|
|
665
|
+
if children:
|
|
666
|
+
out.append("<ul>")
|
|
667
|
+
for c in children:
|
|
668
|
+
cid = html_lib.escape(c["id"], quote=True)
|
|
669
|
+
ctext = html_lib.escape(c["text"])
|
|
670
|
+
out.append(f'<li><a href="#{cid}">{ctext}</a></li>')
|
|
671
|
+
out.append("</ul>")
|
|
672
|
+
out.append("</li>")
|
|
673
|
+
out.append("</ol>")
|
|
674
|
+
return "\n".join(out)
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
def strip_frontmatter(md: str) -> str:
|
|
678
|
+
"""Strip leading YAML frontmatter (--- ... ---) if present at start."""
|
|
679
|
+
md = md.lstrip("\ufeff")
|
|
680
|
+
lines = md.split("\n", 1)
|
|
681
|
+
if not lines or lines[0].strip() != "---":
|
|
682
|
+
return md
|
|
683
|
+
# find closing ---
|
|
684
|
+
rest = lines[1] if len(lines) > 1 else ""
|
|
685
|
+
parts = rest.split("\n---\n", 1)
|
|
686
|
+
if len(parts) == 2:
|
|
687
|
+
return parts[1].lstrip("\n")
|
|
688
|
+
# try also \n--- at the very end of a line
|
|
689
|
+
parts = rest.split("\n---", 1)
|
|
690
|
+
if len(parts) == 2 and (parts[1] == "" or parts[1].startswith("\n")):
|
|
691
|
+
return parts[1].lstrip("\n")
|
|
692
|
+
return md
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
# ---------------------------------------------------------------------------
|
|
696
|
+
# Template loading + main
|
|
697
|
+
# ---------------------------------------------------------------------------
|
|
698
|
+
|
|
699
|
+
CDN_BLOCK_FULL = """<!-- MathJax 3 -->
|
|
700
|
+
<script>
|
|
701
|
+
window.MathJax = {
|
|
702
|
+
tex: { inlineMath: [['$', '$'], ['\\\\(', '\\\\)']], displayMath: [['$$', '$$'], ['\\\\[', '\\\\]']], processEscapes: true },
|
|
703
|
+
options: { skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'] }
|
|
704
|
+
};
|
|
705
|
+
</script>
|
|
706
|
+
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
|
|
707
|
+
|
|
708
|
+
<!-- highlight.js -->
|
|
709
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/atom-one-light.min.css">
|
|
710
|
+
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
|
|
711
|
+
<script>document.addEventListener('DOMContentLoaded', () => hljs.highlightAll());</script>
|
|
712
|
+
"""
|
|
713
|
+
|
|
714
|
+
CDN_BLOCK_OFFLINE = "<!-- offline mode: MathJax + highlight.js skipped; math and code blocks render as plain text -->"
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
def load_template(name: str) -> str:
|
|
718
|
+
path = TEMPLATES_DIR / f"{name}.html"
|
|
719
|
+
if not path.exists():
|
|
720
|
+
raise SystemExit(
|
|
721
|
+
f"error: template '{name}' not found at {path}. "
|
|
722
|
+
f"Available: {[p.stem for p in TEMPLATES_DIR.glob('*.html')]}"
|
|
723
|
+
)
|
|
724
|
+
return path.read_text(encoding="utf-8")
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
def sha256_of(text: str) -> str:
|
|
728
|
+
return hashlib.sha256(text.encode("utf-8")).hexdigest()
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
def render_json_as_pre(json_path: Path) -> str:
|
|
732
|
+
"""Render a sidecar JSON file as a collapsed <details> block of pretty-printed JSON."""
|
|
733
|
+
try:
|
|
734
|
+
obj = json.loads(json_path.read_text(encoding="utf-8"))
|
|
735
|
+
except json.JSONDecodeError as e:
|
|
736
|
+
return f'<div class="callout callout-bad"><div class="callout-title">JSON parse error</div><p>{html_lib.escape(str(e))}</p></div>'
|
|
737
|
+
pretty = json.dumps(obj, ensure_ascii=False, indent=2, sort_keys=False)
|
|
738
|
+
return (
|
|
739
|
+
f'<details><summary>Sidecar JSON: <code>{html_lib.escape(str(json_path))}</code></summary>'
|
|
740
|
+
f'<pre><code class="language-json">{html_lib.escape(pretty)}</code></pre>'
|
|
741
|
+
f'</details>'
|
|
742
|
+
)
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
def substitute(template: str, vars: dict) -> str:
|
|
746
|
+
out = template
|
|
747
|
+
for k, v in vars.items():
|
|
748
|
+
out = out.replace("{{" + k + "}}", v)
|
|
749
|
+
return out
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
def _repo_relative(input_path: Path) -> str:
|
|
753
|
+
"""Return a display-friendly repo-relative path. Avoids leaking absolute
|
|
754
|
+
/Users/<name>/... in the generated HTML meta + footer.
|
|
755
|
+
|
|
756
|
+
Order: cwd-relative if input is under cwd; else git-root-relative if in
|
|
757
|
+
a git repo; else basename only (parent dirs stripped) so we never
|
|
758
|
+
surface the home directory.
|
|
759
|
+
"""
|
|
760
|
+
try:
|
|
761
|
+
return str(input_path.relative_to(Path.cwd()))
|
|
762
|
+
except ValueError:
|
|
763
|
+
pass
|
|
764
|
+
try:
|
|
765
|
+
import subprocess
|
|
766
|
+
result = subprocess.run(
|
|
767
|
+
["git", "rev-parse", "--show-toplevel"],
|
|
768
|
+
cwd=input_path.parent,
|
|
769
|
+
capture_output=True,
|
|
770
|
+
text=True,
|
|
771
|
+
check=False,
|
|
772
|
+
)
|
|
773
|
+
if result.returncode == 0:
|
|
774
|
+
git_root = Path(result.stdout.strip())
|
|
775
|
+
try:
|
|
776
|
+
return str(input_path.relative_to(git_root))
|
|
777
|
+
except ValueError:
|
|
778
|
+
pass
|
|
779
|
+
except Exception:
|
|
780
|
+
pass
|
|
781
|
+
return input_path.name
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
def main(argv: list[str] | None = None) -> int:
|
|
785
|
+
ap = argparse.ArgumentParser(
|
|
786
|
+
description="Render an ARIS Markdown artifact to single-file HTML.",
|
|
787
|
+
)
|
|
788
|
+
ap.add_argument("input", help="Path to input .md (or .json — wrapped in a <pre>)")
|
|
789
|
+
ap.add_argument("--template", default="academic", choices=["academic", "dashboard"])
|
|
790
|
+
ap.add_argument("--out", help="Output HTML path (default: <input>.html)")
|
|
791
|
+
ap.add_argument("--title", help="Page title (default: first H1, or filename)")
|
|
792
|
+
ap.add_argument("--subtitle", default="", help="Optional italic subtitle line")
|
|
793
|
+
ap.add_argument("--eyebrow", default="", help="Optional uppercase eyebrow above H1")
|
|
794
|
+
ap.add_argument("--author", default="", help="Optional author byline (e.g., 'Name (姓名), Affiliation')")
|
|
795
|
+
ap.add_argument("--lang", default="zh-CN", help='<html lang="…"> attribute (default zh-CN)')
|
|
796
|
+
ap.add_argument("--state", help="Optional sidecar state JSON to append as <details>")
|
|
797
|
+
ap.add_argument("--json", dest="json_sidecar", help="Optional sidecar JSON to append (e.g., KILL_ARGUMENT.json)")
|
|
798
|
+
ap.add_argument("--offline", action="store_true", help="Skip MathJax / highlight.js CDN blocks")
|
|
799
|
+
ap.add_argument("--no-toc", action="store_true", help="Skip TOC sidebar (forces TOC_LABEL/TOC_HTML to empty)")
|
|
800
|
+
args = ap.parse_args(argv)
|
|
801
|
+
|
|
802
|
+
input_path = Path(args.input).resolve()
|
|
803
|
+
if not input_path.exists():
|
|
804
|
+
print(f"error: input not found: {input_path}", file=sys.stderr)
|
|
805
|
+
return 2
|
|
806
|
+
display_source_path = _repo_relative(input_path)
|
|
807
|
+
|
|
808
|
+
raw = input_path.read_text(encoding="utf-8")
|
|
809
|
+
source_hash = sha256_of(raw)
|
|
810
|
+
|
|
811
|
+
# If the input is JSON, wrap it as a single code block.
|
|
812
|
+
is_json = input_path.suffix.lower() == ".json"
|
|
813
|
+
if is_json:
|
|
814
|
+
try:
|
|
815
|
+
obj = json.loads(raw)
|
|
816
|
+
pretty = json.dumps(obj, ensure_ascii=False, indent=2, sort_keys=False)
|
|
817
|
+
except json.JSONDecodeError:
|
|
818
|
+
pretty = raw
|
|
819
|
+
md_source = f"# {input_path.name}\n\n```json\n{pretty}\n```\n"
|
|
820
|
+
else:
|
|
821
|
+
md_source = strip_frontmatter(raw)
|
|
822
|
+
|
|
823
|
+
blocks = parse_blocks(md_source.split("\n"))
|
|
824
|
+
body_html, toc = _render_blocks(blocks, collect_toc=not args.no_toc)
|
|
825
|
+
|
|
826
|
+
# Title autodetection.
|
|
827
|
+
title = args.title
|
|
828
|
+
if not title:
|
|
829
|
+
# Look for first H1 block.
|
|
830
|
+
for b in blocks:
|
|
831
|
+
if b.get("type") == "heading" and b.get("level") == 1:
|
|
832
|
+
title = b["text"]
|
|
833
|
+
break
|
|
834
|
+
if not title:
|
|
835
|
+
title = input_path.stem.replace("_", " ").replace("-", " ").title()
|
|
836
|
+
|
|
837
|
+
# Append sidecar JSON if requested.
|
|
838
|
+
extra_html_blocks: list[str] = []
|
|
839
|
+
for label, path_str in (("state", args.state), ("json", args.json_sidecar)):
|
|
840
|
+
if path_str:
|
|
841
|
+
p = Path(path_str).resolve()
|
|
842
|
+
if p.exists():
|
|
843
|
+
extra_html_blocks.append(f'<h2 id="sidecar-{label}">Sidecar — <code>{html_lib.escape(p.name)}</code></h2>')
|
|
844
|
+
extra_html_blocks.append(render_json_as_pre(p))
|
|
845
|
+
else:
|
|
846
|
+
extra_html_blocks.append(
|
|
847
|
+
f'<div class="callout callout-warn"><div class="callout-title">Sidecar missing</div>'
|
|
848
|
+
f'<p><code>{html_lib.escape(path_str)}</code> not found.</p></div>'
|
|
849
|
+
)
|
|
850
|
+
|
|
851
|
+
body_html = body_html + ("\n" + "\n".join(extra_html_blocks) if extra_html_blocks else "")
|
|
852
|
+
|
|
853
|
+
template_str = load_template(args.template)
|
|
854
|
+
|
|
855
|
+
toc_html = render_toc(toc) if not args.no_toc else ""
|
|
856
|
+
toc_label = "Contents" if not args.no_toc else ""
|
|
857
|
+
if args.no_toc:
|
|
858
|
+
# Hide TOC entirely by emitting an empty <nav> (template has <nav>, we'd
|
|
859
|
+
# rather just leave structure intact; CSS won't visually break).
|
|
860
|
+
toc_html = ""
|
|
861
|
+
|
|
862
|
+
eyebrow_block = f'<div class="eyebrow">{html_lib.escape(args.eyebrow)}</div>' if args.eyebrow else ""
|
|
863
|
+
subtitle_block = f'<p class="subtitle">{html_lib.escape(args.subtitle)}</p>' if args.subtitle else ""
|
|
864
|
+
byline_block = (
|
|
865
|
+
f'<p class="byline">By <strong>{html_lib.escape(args.author)}</strong></p>'
|
|
866
|
+
if args.author else ""
|
|
867
|
+
)
|
|
868
|
+
|
|
869
|
+
generated_at = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M UTC")
|
|
870
|
+
|
|
871
|
+
vars_ = {
|
|
872
|
+
"LANG": html_lib.escape(args.lang, quote=True),
|
|
873
|
+
"TITLE": html_lib.escape(title),
|
|
874
|
+
"SUBTITLE_BLOCK": subtitle_block,
|
|
875
|
+
"EYEBROW_BLOCK": eyebrow_block,
|
|
876
|
+
"BYLINE_BLOCK": byline_block,
|
|
877
|
+
"SOURCE_PATH": html_lib.escape(display_source_path),
|
|
878
|
+
"SOURCE_SHA256": source_hash,
|
|
879
|
+
"SOURCE_SHA256_SHORT": source_hash[:12],
|
|
880
|
+
"GENERATED_AT": generated_at,
|
|
881
|
+
"HEAD_CDN": CDN_BLOCK_OFFLINE if args.offline else CDN_BLOCK_FULL,
|
|
882
|
+
"TOC_HTML": toc_html,
|
|
883
|
+
"TOC_LABEL": toc_label,
|
|
884
|
+
"BODY_HTML": body_html,
|
|
885
|
+
"EXTRA_META": "",
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
rendered = substitute(template_str, vars_)
|
|
889
|
+
|
|
890
|
+
out_path = Path(args.out).resolve() if args.out else input_path.with_suffix(".html")
|
|
891
|
+
if out_path.is_dir():
|
|
892
|
+
print(
|
|
893
|
+
f"error: --out points to a directory: {out_path}. "
|
|
894
|
+
f"Specify a file path ending in .html.",
|
|
895
|
+
file=sys.stderr,
|
|
896
|
+
)
|
|
897
|
+
return 2
|
|
898
|
+
out_path.parent.mkdir(parents=True, exist_ok=True)
|
|
899
|
+
out_path.write_text(rendered, encoding="utf-8")
|
|
900
|
+
print(f"wrote {out_path} ({len(rendered):,} bytes, {len(toc)} TOC entries, source sha256 {source_hash[:12]}...)")
|
|
901
|
+
return 0
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
if __name__ == "__main__":
|
|
905
|
+
sys.exit(main())
|