@litfamily/litclaude 1.0.10 → 1.0.13
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/CHANGELOG.md +36 -0
- package/README.md +436 -45
- package/README_ko-KR.md +403 -17
- package/bin/install-ownership.mjs +155 -18
- package/bin/litclaude-ai.js +91 -9
- package/docs/ab/S11-baseline-desktop.webp +0 -0
- package/docs/ab/S11-baseline-phone.webp +0 -0
- package/docs/ab/S11-litclaude-desktop.webp +0 -0
- package/docs/ab/S11-litclaude-phone.webp +0 -0
- package/docs/ab/S3-baseline-desktop.webp +0 -0
- package/docs/ab/S3-baseline-phone.webp +0 -0
- package/docs/ab/S3-litclaude-desktop.webp +0 -0
- package/docs/ab/S3-litclaude-phone.webp +0 -0
- package/docs/ab/S4-baseline-desktop.webp +0 -0
- package/docs/ab/S4-baseline-phone.webp +0 -0
- package/docs/ab/S4-litclaude-desktop.webp +0 -0
- package/docs/ab/S4-litclaude-phone.webp +0 -0
- package/docs/ab/S5-baseline-pages.webp +0 -0
- package/docs/ab/S5-baseline-slides.webp +0 -0
- package/docs/ab/S5-litclaude-pages.webp +0 -0
- package/docs/ab/S5-litclaude-slides.webp +0 -0
- package/docs/ab/S7-litclaude-diagram.webp +0 -0
- package/docs/ab/S8-baseline-slides.webp +0 -0
- package/docs/ab/S8-litclaude-slides.webp +0 -0
- package/docs/ab/S9-litclaude-pages.webp +0 -0
- package/docs/agents.md +10 -7
- package/docs/assets/cover-motion-still.webp +0 -0
- package/docs/assets/cover-motion.webp +0 -0
- package/docs/assets/readme/badge-version.svg +1 -1
- package/docs/assets/skills/autoconference.webp +0 -0
- package/docs/assets/skills/automatic-checks.webp +0 -0
- package/docs/assets/skills/autoresearch.webp +0 -0
- package/docs/assets/skills/browser-drive.webp +0 -0
- package/docs/assets/skills/debugging.webp +0 -0
- package/docs/assets/skills/deep-interview.webp +0 -0
- package/docs/assets/skills/frontend-ui-ux.webp +0 -0
- package/docs/assets/skills/lit-burnoff-file.webp +0 -0
- package/docs/assets/skills/lit-burnoff.webp +0 -0
- package/docs/assets/skills/lit-code.webp +0 -0
- package/docs/assets/skills/lit-commit.webp +0 -0
- package/docs/assets/skills/lit-comprehend.webp +0 -0
- package/docs/assets/skills/lit-crucible.webp +0 -0
- package/docs/assets/skills/lit-diagram-drawer.webp +0 -0
- package/docs/assets/skills/lit-docx.webp +0 -0
- package/docs/assets/skills/lit-handoff.webp +0 -0
- package/docs/assets/skills/lit-humanizer.webp +0 -0
- package/docs/assets/skills/lit-init.webp +0 -0
- package/docs/assets/skills/lit-loop.webp +0 -0
- package/docs/assets/skills/lit-plan.webp +0 -0
- package/docs/assets/skills/lit-pptx.webp +0 -0
- package/docs/assets/skills/lit-recap.webp +0 -0
- package/docs/assets/skills/lit-scientific-visualization.webp +0 -0
- package/docs/assets/skills/lit-team.webp +0 -0
- package/docs/assets/skills/lit-typographic-motion.webp +0 -0
- package/docs/assets/skills/litgoal.webp +0 -0
- package/docs/assets/skills/litresearch.webp +0 -0
- package/docs/assets/skills/litwork.webp +0 -0
- package/docs/assets/skills/lsp-setup.webp +0 -0
- package/docs/assets/skills/readme-studio.webp +0 -0
- package/docs/assets/skills/refactor.webp +0 -0
- package/docs/assets/skills/review-work.webp +0 -0
- package/docs/assets/skills/start-work.webp +0 -0
- package/docs/assets/skills/structural-search.webp +0 -0
- package/docs/assets/skills/visual-qa.webp +0 -0
- package/docs/assets/skills/wikify.webp +0 -0
- package/docs/hooks.md +185 -41
- package/docs/migration.md +6 -3
- package/docs/privacy.md +6 -1
- package/package.json +4 -2
- package/plugins/litclaude/.claude-plugin/plugin.json +1 -1
- package/plugins/litclaude/agents/korean-prose-editor.md +1 -0
- package/plugins/litclaude/agents/korean-style-analyzer.md +1 -0
- package/plugins/litclaude/agents/meaning-preservation-auditor.md +1 -0
- package/plugins/litclaude/agents/native-flow-reviewer.md +1 -0
- package/plugins/litclaude/agents/polish-orchestrator.md +1 -0
- package/plugins/litclaude/bin/litclaude-hook.js +347 -35
- package/plugins/litclaude/bin/litclaude-hud.js +29 -1
- package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
- package/plugins/litclaude/bundled-rules/lit-humanizer.md +14 -0
- package/plugins/litclaude/commands/korean-ai-slop-remover.md +2 -2
- package/plugins/litclaude/commands/lit-comprehend.md +11 -11
- package/plugins/litclaude/commands/lit-humanizer.md +75 -0
- package/plugins/litclaude/commands/lit-korean.md +4 -130
- package/plugins/litclaude/commands/litresearch.md +12 -10
- package/plugins/litclaude/hooks/hooks.json +1 -1
- package/plugins/litclaude/lib/canonical-runtime-commitments.mjs +2 -2
- package/plugins/litclaude/lib/canonical-skill-catalog.mjs +5 -1
- package/plugins/litclaude/lib/canonical-skill-resources.mjs +618 -13
- package/plugins/litclaude/lib/deliverable-hedge-guard.mjs +256 -350
- package/plugins/litclaude/lib/hud-accent-palette.mjs +33 -0
- package/plugins/litclaude/lib/interface-mode.mjs +33 -0
- package/plugins/litclaude/lib/interface-probe-gate.mjs +125 -0
- package/plugins/litclaude/lib/jev-skill-hint.mjs +445 -0
- package/plugins/litclaude/lib/motion-render-gate.mjs +164 -0
- package/plugins/litclaude/lib/mutated-file-paths.mjs +32 -1
- package/plugins/litclaude/lib/office-runtime-lock/package-lock.json +745 -0
- package/plugins/litclaude/lib/office-runtime-lock/package.json +12 -0
- package/plugins/litclaude/lib/office-runtime-lock/requirements.lock +15 -0
- package/plugins/litclaude/lib/office-runtime.mjs +255 -0
- package/plugins/litclaude/lib/office_data.py +493 -0
- package/plugins/litclaude/lib/office_runtime_bootstrap.py +61 -0
- package/plugins/litclaude/lib/ooxml_integrity.py +199 -0
- package/plugins/litclaude/lib/rename-aliases.mjs +3 -1
- package/plugins/litclaude/lib/render_pages.py +105 -0
- package/plugins/litclaude/skills/autoconference/SKILL.md +2 -0
- package/plugins/litclaude/skills/browser-drive/SKILL.md +19 -6
- package/plugins/litclaude/skills/browser-drive/scripts/capability-probe.mjs +44 -8
- package/plugins/litclaude/skills/frontend-ui-ux/ATTRIBUTION.md +26 -0
- package/plugins/litclaude/skills/frontend-ui-ux/SKILL.md +50 -16
- package/plugins/litclaude/skills/frontend-ui-ux/examples/phase-3-readme-ab/README.md +9 -0
- package/plugins/litclaude/skills/frontend-ui-ux/references/complete-contract.md +32 -6
- package/plugins/litclaude/skills/frontend-ui-ux/references/craft-floor.md +257 -0
- package/plugins/litclaude/skills/frontend-ui-ux/references/default-editorial-pixel.json +6 -0
- package/plugins/litclaude/skills/frontend-ui-ux/references/interaction-motion.md +34 -88
- package/plugins/litclaude/skills/frontend-ui-ux/references/motion-guide.md +130 -0
- package/plugins/litclaude/skills/frontend-ui-ux/references/slop-register.md +150 -0
- package/plugins/litclaude/skills/frontend-ui-ux/references/visual-reconstruction.md +39 -85
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe-page.mjs +1534 -0
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe-rules.mjs +141 -0
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe-server.mjs +57 -0
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe-static.mjs +129 -0
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe.mjs +316 -0
- package/plugins/litclaude/skills/lit-comprehend/SKILL.md +34 -43
- package/plugins/litclaude/skills/lit-comprehend/references/artifact-template.md +5 -44
- package/plugins/litclaude/skills/lit-comprehend/scripts/verify-explainer.mjs +6 -16
- package/plugins/litclaude/skills/lit-diagram-drawer/NOTICE +33 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/SKILL.md +123 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-architecture-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-architecture-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-architecture-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-bar-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-bar-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-bar-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-beeswarm-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-beeswarm-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-beeswarm-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-bubble-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-bubble-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-bubble-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-bump-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-bump-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-bump-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-data-flow-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-data-flow-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-data-flow-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-datalake-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-datalake-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-datalake-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-db-schema-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-db-schema-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-db-schema-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-dependency-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-dependency-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-dependency-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-deployment-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-deployment-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-deployment-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-dp-integration-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-dp-integration-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-dp-integration-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-er-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-er-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-er-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-fishbone-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-fishbone-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-fishbone-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-flowchart-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-flowchart-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-flowchart-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-gantt-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-gantt-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-gantt-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-heatmap-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-heatmap-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-heatmap-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-high-level-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-high-level-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-high-level-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-import-drawio-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-import-drawio-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-import-drawio-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-it-state-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-it-state-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-it-state-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-journey-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-journey-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-journey-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-kanban-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-kanban-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-kanban-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-layers-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-layers-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-layers-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-line-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-line-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-line-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-loop-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-loop-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-loop-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-marimekko-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-marimekko-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-marimekko-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-medallion-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-medallion-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-medallion-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-nested-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-nested-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-nested-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-org-chart-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-org-chart-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-org-chart-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-polar-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-polar-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-polar-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-process-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-process-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-process-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-pyramid-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-pyramid-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-pyramid-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-quadrant-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-quadrant-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-quadrant-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-queue-animated-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-queue-animated-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-queue-animated-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-radar-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-radar-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-radar-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-ridgeline-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-ridgeline-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-ridgeline-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-sankey-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-sankey-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-sankey-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-scatter-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-scatter-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-scatter-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-sequence-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-sequence-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-sequence-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-slopegraph-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-slopegraph-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-slopegraph-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-state-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-state-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-state-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-story-map-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-story-map-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-story-map-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-streamgraph-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-streamgraph-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-streamgraph-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-swimlane-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-swimlane-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-swimlane-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-timeline-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-timeline-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-timeline-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-tree-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-tree-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-tree-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-treemap-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-treemap-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-treemap-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-uml-class-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-uml-class-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-uml-class-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-venn-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-venn-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-venn-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-wardley-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-wardley-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-wardley-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-waterfall-dark.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-waterfall-full.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/examples/type-waterfall-light.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/fonts/OFL.txt +94 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/fonts/PretendardVariable.woff2 +0 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/fonts/provenance.json +22 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/icons.html +231 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/index.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/licenses/devicon-MIT.txt +20 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/licenses/diagram-design-MIT.txt +21 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/licenses/log-z-MIT.txt +21 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/licenses/simple-icons-CC0.md +30 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/assets/licenses/tabler-MIT.txt +21 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/01-service-architecture/after.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/01-service-architecture/brief.md +33 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/02-release-decision/after.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/02-release-decision/brief.md +18 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/03-data-retention/after.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/03-data-retention/brief.md +19 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/04-oauth-sequence/after.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/04-oauth-sequence/brief.md +17 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/05-review-lanes/after.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/05-review-lanes/brief.md +17 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/06-rollout-gates/after.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/06-rollout-gates/brief.md +17 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/07-deployment-boundary/after.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/07-deployment-boundary/brief.md +19 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/08-policy-traces/after.html +1 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/examples/08-policy-traces/brief.md +20 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/accessibility.md +37 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/export.md +29 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/import-drawio.md +21 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/import-excalidraw.md +14 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/import-mermaid.md +18 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/import-schema.md +28 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/korean-typography.md +34 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/motion.md +29 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/office-pptx-docx.md +42 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/output-spec.md +48 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/primitive-annotation.md +12 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/primitive-icons.md +21 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/primitive-sketchy.md +11 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/primitive-terminal.md +11 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/profiles.md +24 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/semantic-patterns.md +27 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/style-guide.md +67 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-architecture.md +51 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-bar.md +51 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-beeswarm.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-bubble.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-bump.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-catalog.json +1433 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-data-flow.md +51 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-datalake.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-db-schema.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-dependency.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-deployment.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-dp-integration.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-dp-security-matrix.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-er.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-fishbone.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-flowchart.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-gantt.md +49 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-heatmap.md +53 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-high-level-vertical.md +53 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-high-level.md +53 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-import-drawio.md +53 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-import-excalidraw.md +53 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-import-mermaid.md +53 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-it-state.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-journey.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-kanban.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-layers.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-line.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-loop-terminal.md +53 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-loop.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-marimekko.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-medallion.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-nested.md +59 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-org-chart.md +58 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-paved-road-animated.md +72 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-polar.md +67 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-policy-trace-animated.md +69 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-process.md +58 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-pyramid.md +59 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-quadrant-consultant.md +60 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-quadrant.md +57 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-queue-animated.md +63 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-radar.md +57 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-ridgeline.md +63 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-sankey.md +68 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-scatter.md +60 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-sequence-oauth.md +66 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-sequence.md +63 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-slopegraph.md +65 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-state-lifecycle.md +53 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-state.md +59 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-story-map.md +52 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-streamgraph.md +53 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-swimlane.md +52 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-timeline.md +52 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-tree-block-decomposition.md +57 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-tree.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-treemap.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-uml-class.md +52 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-venn.md +51 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-wardley.md +52 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-waterfall.md +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/references/verifier-guide.md +66 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/block-registry.mjs +43 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/brief-contract.mjs +94 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/check-visible-text.mjs +15 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/diagram-metrics.mjs +223 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/doctor.mjs +35 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/drawio-extract.mjs +635 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/excalidraw-extract.mjs +319 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/export.mjs +116 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/mermaid-extract.mjs +438 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/office-safety.mjs +54 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/renderer.mjs +33 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/verify-all.mjs +58 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/verify-brief.mjs +22 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/verify-coverage.mjs +56 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/verify-diagram.mjs +27 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/verify-motion.mjs +12 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/verify-type.mjs +48 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/visual-quality.mjs +376 -0
- package/plugins/litclaude/skills/lit-docx/NOTICE +33 -0
- package/plugins/litclaude/skills/lit-docx/SKILL.md +170 -0
- package/plugins/litclaude/skills/lit-docx/references/frontmatter_schema.md +42 -0
- package/plugins/litclaude/skills/lit-docx/references/journal_style_spec.md +17 -0
- package/plugins/litclaude/skills/lit-docx/references/markdown_quality_checklist.md +37 -0
- package/plugins/litclaude/skills/lit-docx/references/slop_phrase_list.yaml +58 -0
- package/plugins/litclaude/skills/lit-docx/references/slop_rules.md +35 -0
- package/plugins/litclaude/skills/lit-docx/scripts/clean_markdown.py +95 -0
- package/plugins/litclaude/skills/lit-docx/scripts/convert_md_to_docx.py +1194 -0
- package/plugins/litclaude/skills/lit-docx/scripts/convert_md_to_pdf.py +290 -0
- package/plugins/litclaude/skills/lit-docx/scripts/convert_pdf.py +139 -0
- package/plugins/litclaude/skills/lit-docx/scripts/edit_docx.py +306 -0
- package/plugins/litclaude/skills/lit-docx/scripts/embed_images.py +78 -0
- package/plugins/litclaude/skills/lit-docx/scripts/generate_docx_templates.py +500 -0
- package/plugins/litclaude/skills/lit-docx/scripts/qa_docx.py +177 -0
- package/plugins/litclaude/skills/lit-docx/scripts/slop_lint.py +561 -0
- package/plugins/litclaude/skills/lit-docx/scripts/visual_audit.py +48 -0
- package/plugins/litclaude/skills/lit-docx/templates/docx/acs.docx +0 -0
- package/plugins/litclaude/skills/lit-docx/templates/docx/elsevier.docx +0 -0
- package/plugins/litclaude/skills/lit-docx/templates/docx/ieee.docx +0 -0
- package/plugins/litclaude/skills/lit-docx/templates/docx/korean-generic.docx +0 -0
- package/plugins/litclaude/skills/lit-docx/templates/docx/nature.docx +0 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/acs/README.md +5 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/acs/template.tex +37 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/elsevier/README.md +5 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/elsevier/template.tex +38 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/ieee/README.md +5 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/ieee/template.tex +37 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/korean-generic/README.md +5 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/korean-generic/template.tex +37 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/nature/README.md +5 -0
- package/plugins/litclaude/skills/lit-docx/templates/latex/nature/template.tex +37 -0
- package/plugins/litclaude/skills/lit-docx/templates/registry.yaml +1366 -0
- package/plugins/litclaude/skills/lit-humanizer/NOTICE +160 -0
- package/plugins/litclaude/skills/lit-humanizer/SKILL.md +164 -0
- package/plugins/litclaude/skills/lit-humanizer/assets/always-on-rule.md +9 -0
- package/plugins/litclaude/skills/lit-humanizer/assets/report-skeleton.md +25 -0
- package/plugins/litclaude/skills/lit-humanizer/assets/slide-text-skeleton.md +28 -0
- package/plugins/litclaude/skills/lit-humanizer/bench/prompts.md +73 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/accessibility-note/after.md +7 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/accessibility-note/before.md +7 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/api-reference/after.md +9 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/api-reference/before.md +15 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/changelog/after.md +5 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/changelog/before.md +12 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/code-comments/after.md +10 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/code-comments/before.md +19 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/commit/after.md +5 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/commit/before.md +7 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/data-release/after.md +7 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/data-release/before.md +9 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/english-essay/after.md +5 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/english-essay/before.md +5 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/incident-update/after.md +7 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/incident-update/before.md +7 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/ko-essay/after.md +7 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/ko-essay/before.md +9 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/ko-report/after.md +9 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/ko-report/before.md +13 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/ko-slide/after.md +19 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/ko-slide/before.md +21 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/meeting-brief/after.md +9 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/meeting-brief/before.md +11 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/policy-faq/after.md +9 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/policy-faq/before.md +9 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/pr/after.md +15 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/pr/before.md +17 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/project-update/after.md +7 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/project-update/before.md +9 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/readme/after.md +12 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/readme/before.md +14 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/report/after.md +13 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/report/before.md +11 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/research-abstract/after.md +5 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/research-abstract/before.md +5 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/slides/after.md +19 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/slides/before.md +19 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/troubleshooting/after.md +11 -0
- package/plugins/litclaude/skills/lit-humanizer/examples/troubleshooting/before.md +11 -0
- package/plugins/litclaude/skills/lit-humanizer/motion-guide.md +123 -0
- package/plugins/litclaude/skills/lit-humanizer/references/code-patterns.md +468 -0
- package/plugins/litclaude/skills/lit-humanizer/references/deliverable-channels.md +111 -0
- package/plugins/litclaude/skills/lit-humanizer/references/en-patterns-checklist.md +43 -0
- package/plugins/litclaude/skills/lit-humanizer/references/en-patterns-content.md +243 -0
- package/plugins/litclaude/skills/lit-humanizer/references/en-patterns-structure.md +375 -0
- package/plugins/litclaude/skills/lit-humanizer/references/en-patterns.md +57 -0
- package/plugins/litclaude/skills/lit-humanizer/references/ko-metrics.md +33 -0
- package/plugins/litclaude/skills/lit-humanizer/references/ko-patterns-a-d.md +659 -0
- package/plugins/litclaude/skills/lit-humanizer/references/ko-patterns-e-j.md +387 -0
- package/plugins/litclaude/skills/lit-humanizer/references/ko-patterns.md +31 -0
- package/plugins/litclaude/skills/lit-humanizer/references/rewrite-playbook.md +54 -0
- package/plugins/litclaude/skills/lit-humanizer/references/taxonomy.md +153 -0
- package/plugins/litclaude/skills/lit-humanizer/rules.json +884 -0
- package/plugins/litclaude/skills/lit-humanizer/scripts/artifact-text.mjs +38 -0
- package/plugins/litclaude/skills/lit-humanizer/scripts/core.mjs +207 -0
- package/plugins/litclaude/skills/lit-humanizer/scripts/detect.mjs +64 -0
- package/plugins/litclaude/skills/lit-humanizer/scripts/extract_office_text.py +112 -0
- package/plugins/litclaude/skills/lit-humanizer/scripts/ko-metrics.mjs +124 -0
- package/plugins/litclaude/skills/lit-humanizer/scripts/scan-input.mjs +29 -0
- package/plugins/litclaude/skills/lit-loop/SKILL.md +30 -1
- package/plugins/litclaude/skills/lit-plan/SKILL.md +4 -1
- package/plugins/litclaude/skills/lit-pptx/NOTICE +38 -0
- package/plugins/litclaude/skills/lit-pptx/SKILL.md +207 -0
- package/plugins/litclaude/skills/lit-pptx/assets/azure/circle-lg.png +0 -0
- package/plugins/litclaude/skills/lit-pptx/assets/azure/circle-md.png +0 -0
- package/plugins/litclaude/skills/lit-pptx/assets/azure/circle-sm.png +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/a2z/A2Z-Black.otf +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/a2z/A2Z-Bold.otf +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/a2z/A2Z-Light.otf +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/a2z/A2Z-Medium.otf +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/a2z/A2Z-Regular.otf +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/a2z/OFL.txt +94 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/a2z/SOURCE.md +29 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/pretendard/OFL.txt +94 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/pretendard/Pretendard-Bold.otf +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/pretendard/Pretendard-Regular.otf +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/provenance.json +78 -0
- package/plugins/litclaude/skills/lit-pptx/references/agents/analyst.md +49 -0
- package/plugins/litclaude/skills/lit-pptx/references/agents/antithesis.md +59 -0
- package/plugins/litclaude/skills/lit-pptx/references/agents/architect.md +44 -0
- package/plugins/litclaude/skills/lit-pptx/references/agents/critic.md +42 -0
- package/plugins/litclaude/skills/lit-pptx/references/agents/synthesizer.md +47 -0
- package/plugins/litclaude/skills/lit-pptx/references/agents/thesis.md +33 -0
- package/plugins/litclaude/skills/lit-pptx/references/anti-slop-checklist.md +81 -0
- package/plugins/litclaude/skills/lit-pptx/references/authoring-guide.md +173 -0
- package/plugins/litclaude/skills/lit-pptx/references/consensus-protocol.md +125 -0
- package/plugins/litclaude/skills/lit-pptx/references/data-display-cookbook.md +45 -0
- package/plugins/litclaude/skills/lit-pptx/references/design-system-azure.md +58 -0
- package/plugins/litclaude/skills/lit-pptx/references/interview-protocol.md +113 -0
- package/plugins/litclaude/skills/lit-pptx/references/stages/autopilot.md +48 -0
- package/plugins/litclaude/skills/lit-pptx/references/stages/interview.md +52 -0
- package/plugins/litclaude/skills/lit-pptx/references/stages/plan.md +42 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/compile-deck.js +414 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/craft_extras.py +373 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/deck_craft.py +321 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/embed_fonts.py +215 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/forbidden-terms.json +55 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/layout_inventory.py +418 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/learn_template.py +446 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/derive-palette.js +176 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/directive-parser.js +244 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/font-map.js +79 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/gen-bg.js +86 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/gen-gradient-assets.js +37 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/layout-resolver.js +768 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/markdown-loader.js +136 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/render-adapter-html.js +356 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/render-adapter-pptx.js +2094 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/runtime-require.js +28 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/slide-ast.js +561 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/spec-validator.js +94 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/template-registry.js +394 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/package.json +4 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/qa_deck.py +766 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/validate_pptx.py +215 -0
- package/plugins/litclaude/skills/lit-pptx/specs/markdown-slide-spec-v1.md +251 -0
- package/plugins/litclaude/skills/lit-pptx/specs/markdown-slide-spec-v2.md +214 -0
- package/plugins/litclaude/skills/lit-pptx/specs/slide-ast-v1.schema.json +229 -0
- package/plugins/litclaude/skills/lit-pptx/specs/slide-ast-v2.schema.json +144 -0
- package/plugins/litclaude/skills/lit-pptx/specs/template-enrollment-contract.md +382 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/AZURE-A2Z/capabilities.yaml +146 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/AZURE-A2Z/layout-mapping.yaml +454 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/AZURE-A2Z/template.yaml +37 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/AZURE-PRO/capabilities.yaml +154 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/AZURE-PRO/layout-mapping.yaml +475 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/AZURE-PRO/template.yaml +37 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/capabilities.yaml +179 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/layout-mapping.yaml +299 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/template.yaml +45 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/capabilities.yaml +181 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/layout-mapping.yaml +299 -0
- package/plugins/litclaude/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/template.yaml +44 -0
- package/plugins/litclaude/skills/lit-scientific-visualization/SKILL.md +1 -0
- package/plugins/litclaude/skills/lit-typographic-motion/SKILL.md +131 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/NOTICE +23 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +56 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/audio/beat_grid.py +56 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/audio/requirements.lock +1084 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/constants.mjs +211 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/contrast.mjs +90 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/events.mjs +46 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/flash.mjs +211 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/gate-rules.mjs +550 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/presets.mjs +123 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/text.mjs +100 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/timeline.mjs +142 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/util.mjs +167 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/voices.mjs +19 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/models/word-timing.json +198 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/analysis.mjs +108 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/brief.mjs +158 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/chrome.mjs +330 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/coverage.mjs +83 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/done.mjs +104 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/encode.mjs +104 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/frame-worker.mjs +36 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/look.mjs +128 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/pipeline.mjs +592 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/png.mjs +112 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/report.mjs +66 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/runtime.mjs +330 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/session.mjs +145 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/sound-cli.mjs +60 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/sound.mjs +641 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage-capture.mjs +178 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage-gate.mjs +122 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage-qa.mjs +295 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage-serve.mjs +278 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage.mjs +503 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stills.mjs +100 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/treatment.mjs +343 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/ws-server.mjs +132 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/package-lock.json +25 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/package.json +10 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/stage/init.js +288 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/stage/qa.js +157 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/stage/stage-kit.js +701 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/boot.mjs +123 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/engine.mjs +281 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/gl.mjs +319 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/glsl-common.mjs +78 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/index.html +6 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/lines.mjs +112 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/passes/crt.mjs +98 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/passes/dither.mjs +49 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/passes/glitch.mjs +77 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/passes/swiss-grid.mjs +61 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/passes/terminal-ui.mjs +88 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/passes/tidal-gradient.mjs +86 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/post.mjs +165 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/scale.mjs +15 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/scene.mjs +82 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/scenes/end-card.mjs +30 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/scenes/index.mjs +16 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/scenes/karaoke-line.mjs +47 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/scenes/kinetic-list.mjs +45 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/scenes/number-counter.mjs +29 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/scenes/signature.mjs +73 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/scenes/title-slam.mjs +73 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/stroke.mjs +236 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/web/type.mjs +180 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-400.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-700.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-900.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-400.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-700.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-900.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-400.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-700.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-900.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/archivo/OFL.txt +93 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/manifest.json +437 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/silkscreen/OFL.txt +93 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/silkscreen/Silkscreen-Bold.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/silkscreen/Silkscreen-Regular.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/stroke/CREDITS +42 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/stroke/EMSAllure.svg +216 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/stroke/EMSFelix.svg +216 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/stroke/EMSOsmotron.svg +216 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/stroke/EMSReadability.svg +216 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/stroke/EMSTech.svg +217 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/stroke/OFL.txt +91 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/vt323/OFL.txt +93 -0
- package/plugins/litclaude/skills/lit-typographic-motion/fonts/vt323/VT323-Regular.ttf +0 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/brief-schema.md +91 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/craft-loop.md +69 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/engine-contract.md +104 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/look.md +106 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/runtime.md +65 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/sound.md +83 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/stage.md +192 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/style-bibles.md +117 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/treatment.md +114 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/type-craft.md +79 -0
- package/plugins/litclaude/skills/lit-typographic-motion/scripts/motion-doctor.mjs +78 -0
- package/plugins/litclaude/skills/lit-typographic-motion/scripts/motion-runtime.mjs +67 -0
- package/plugins/litclaude/skills/lit-typographic-motion/scripts/motion.mjs +132 -0
- package/plugins/litclaude/skills/litresearch/SKILL.md +54 -18
- package/scripts/doctor.mjs +5 -0
- package/scripts/postinstall.mjs +1 -0
- package/plugins/litclaude/skills/lit-korean/SKILL.md +0 -327
- /package/plugins/litclaude/skills/{lit-korean/references/fidelity-checklist.md → lit-humanizer/references/litclaude-fidelity-checklist.md} +0 -0
- /package/plugins/litclaude/skills/{lit-korean/references/rewrite-rules.md → lit-humanizer/references/litclaude-rewrite-rules.md} +0 -0
- /package/plugins/litclaude/skills/{lit-korean/references/style-patterns.md → lit-humanizer/references/litclaude-style-patterns.md} +0 -0
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Bounded stdlib-only draw.io extraction; labels are inert and never executed.
|
|
3
|
+
import { closeSync, openSync, readSync } from "node:fs";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import zlib from "node:zlib";
|
|
7
|
+
|
|
8
|
+
const MAX_INPUT = 16 * 1024 * 1024;
|
|
9
|
+
const MAX_DECODED = 32 * 1024 * 1024;
|
|
10
|
+
const MAX_NODES = 2_000;
|
|
11
|
+
const MAX_EDGES = 5_000;
|
|
12
|
+
const MAX_DEPTH = 64;
|
|
13
|
+
const PNG_MAGIC = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
|
|
14
|
+
const URL_RE = /\b(?:https?|ftp|file|javascript|data):[^\s<>"']+/gi;
|
|
15
|
+
const TAG_RE = /<[^>]*>/g;
|
|
16
|
+
const BREAK_RE = /<br\s*\/?>|<\/(?:p|div)\s*>/gi;
|
|
17
|
+
const EXEC_RE = /<\s*(?:script|iframe|object|embed)\b|\bon[a-z]+\s*=/is;
|
|
18
|
+
const SAFE_ID_RE = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
|
|
19
|
+
const DTD_RE = /<!DOCTYPE|<!ENTITY/i;
|
|
20
|
+
const SHAPE_ALIASES = [
|
|
21
|
+
["rhombus", "diamond"], ["diamond", "diamond"], ["ellipse", "ellipse"], ["actor", "ellipse"],
|
|
22
|
+
["cylinder", "cylinder"], ["database", "cylinder"], ["swimlane", "container"], ["text", "text"],
|
|
23
|
+
["group", "group"], ["table", "table"], ["hexagon", "hexagon"], ["cloud", "cloud"],
|
|
24
|
+
["parallelogram", "parallelogram"], ["document", "document"], ["image", "image"],
|
|
25
|
+
];
|
|
26
|
+
const NAMED_ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'" };
|
|
27
|
+
|
|
28
|
+
class ImportFailure extends Error {}
|
|
29
|
+
|
|
30
|
+
function reject(message) {
|
|
31
|
+
throw new ImportFailure(message);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const CRC_TABLE = (() => {
|
|
35
|
+
const table = new Uint32Array(256);
|
|
36
|
+
for (let n = 0; n < 256; n += 1) {
|
|
37
|
+
let c = n;
|
|
38
|
+
for (let k = 0; k < 8; k += 1) c = c & 1 ? (0xedb88320 ^ (c >>> 1)) : c >>> 1;
|
|
39
|
+
table[n] = c >>> 0;
|
|
40
|
+
}
|
|
41
|
+
return table;
|
|
42
|
+
})();
|
|
43
|
+
|
|
44
|
+
function crc32(buffer) {
|
|
45
|
+
let crc = 0xffffffff;
|
|
46
|
+
for (let i = 0; i < buffer.length; i += 1) crc = CRC_TABLE[(crc ^ buffer[i]) & 0xff] ^ (crc >>> 8);
|
|
47
|
+
return (crc ^ 0xffffffff) >>> 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function sha256Hex(buffer) {
|
|
51
|
+
return createHash("sha256").update(buffer).digest("hex");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function readBounded(filePath, maxBytes) {
|
|
55
|
+
let fd;
|
|
56
|
+
try {
|
|
57
|
+
fd = openSync(filePath, "r");
|
|
58
|
+
} catch (error) {
|
|
59
|
+
reject(`cannot read input: ${error.code === "ENOENT" ? "No such file or directory" : (error.message || "I/O error")}`);
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const cap = maxBytes + 1;
|
|
63
|
+
const buffer = Buffer.alloc(cap);
|
|
64
|
+
let total = 0;
|
|
65
|
+
while (total < cap) {
|
|
66
|
+
const bytesRead = readSync(fd, buffer, total, cap - total, null);
|
|
67
|
+
if (bytesRead === 0) break;
|
|
68
|
+
total += bytesRead;
|
|
69
|
+
}
|
|
70
|
+
return buffer.subarray(0, total);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
reject(`cannot read input: ${error.message || "I/O error"}`);
|
|
73
|
+
return undefined;
|
|
74
|
+
} finally {
|
|
75
|
+
closeSync(fd);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function safeId(sourceId, used) {
|
|
80
|
+
if (!sourceId) reject("diagram contains an element without an id");
|
|
81
|
+
const candidate = SAFE_ID_RE.test(sourceId) ? sourceId : `n-${sha256Hex(Buffer.from(sourceId, "utf8")).slice(0, 16)}`;
|
|
82
|
+
if (used.has(candidate)) reject("diagram contains duplicate element ids");
|
|
83
|
+
used.add(candidate);
|
|
84
|
+
return candidate;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function htmlUnescape(text) {
|
|
88
|
+
if (!text.includes("&")) return text;
|
|
89
|
+
return text.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos|nbsp);/g, (match, ent) => {
|
|
90
|
+
if (ent[0] === "#") {
|
|
91
|
+
const isHex = ent[1] === "x" || ent[1] === "X";
|
|
92
|
+
const codePoint = isHex ? Number.parseInt(ent.slice(2), 16) : Number.parseInt(ent.slice(1), 10);
|
|
93
|
+
if (!Number.isFinite(codePoint) || codePoint < 0 || codePoint > 0x10ffff) return match;
|
|
94
|
+
try {
|
|
95
|
+
return String.fromCodePoint(codePoint);
|
|
96
|
+
} catch {
|
|
97
|
+
return match;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (ent === "nbsp") return " ";
|
|
101
|
+
return NAMED_ENTITIES[ent];
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function plainLabel(value) {
|
|
106
|
+
if (EXEC_RE.test(value)) reject("executable markup or event attributes in labels are unsupported");
|
|
107
|
+
const urlCount = (value.match(URL_RE) || []).length;
|
|
108
|
+
let text = value.replace(URL_RE, "");
|
|
109
|
+
text = text.replace(BREAK_RE, "\n");
|
|
110
|
+
text = text.replace(TAG_RE, "");
|
|
111
|
+
text = htmlUnescape(text).replaceAll(" ", " ");
|
|
112
|
+
const lines = text.split(/\r\n|\r|\n/).map((line) => line.replace(/[ \t]+/g, " ").trim());
|
|
113
|
+
return [lines.filter((line) => line).join("\n").slice(0, 2_000), urlCount];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function pyUnquote(text) {
|
|
117
|
+
if (!text.includes("%")) return text;
|
|
118
|
+
const isHex = (ch) => /[0-9a-fA-F]/.test(ch);
|
|
119
|
+
let out = "";
|
|
120
|
+
let bytes = [];
|
|
121
|
+
const flush = () => {
|
|
122
|
+
if (bytes.length) {
|
|
123
|
+
out += Buffer.from(bytes).toString("utf8");
|
|
124
|
+
bytes = [];
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const n = text.length;
|
|
128
|
+
let i = 0;
|
|
129
|
+
while (i < n) {
|
|
130
|
+
const ch = text[i];
|
|
131
|
+
if (ch === "%" && i + 2 < n && isHex(text[i + 1]) && isHex(text[i + 2])) {
|
|
132
|
+
bytes.push(Number.parseInt(text.slice(i + 1, i + 3), 16));
|
|
133
|
+
i += 3;
|
|
134
|
+
} else {
|
|
135
|
+
flush();
|
|
136
|
+
out += ch;
|
|
137
|
+
i += 1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
flush();
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function boundedInflate(buffer, mode, sizeMessage, malformedMessage) {
|
|
145
|
+
try {
|
|
146
|
+
return mode === "raw"
|
|
147
|
+
? zlib.inflateRawSync(buffer, { maxOutputLength: MAX_DECODED })
|
|
148
|
+
: zlib.inflateSync(buffer, { maxOutputLength: MAX_DECODED });
|
|
149
|
+
} catch (error) {
|
|
150
|
+
if (error && error.code === "ERR_BUFFER_TOO_LARGE") reject(sizeMessage);
|
|
151
|
+
reject(malformedMessage);
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function decodePage(payload) {
|
|
157
|
+
const compact = payload.replace(/\s+/g, "");
|
|
158
|
+
if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})?$/.test(compact)) {
|
|
159
|
+
reject("compressed draw.io page is not valid base64");
|
|
160
|
+
}
|
|
161
|
+
const packed = Buffer.from(compact, "base64");
|
|
162
|
+
const decoded = boundedInflate(
|
|
163
|
+
packed,
|
|
164
|
+
"raw",
|
|
165
|
+
"decoded draw.io page exceeds the size limit",
|
|
166
|
+
"compressed draw.io page is malformed or unsupported",
|
|
167
|
+
);
|
|
168
|
+
let text;
|
|
169
|
+
try {
|
|
170
|
+
text = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(decoded);
|
|
171
|
+
} catch {
|
|
172
|
+
reject("compressed draw.io page is not UTF-8");
|
|
173
|
+
}
|
|
174
|
+
return pyUnquote(text);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function splitBytes(buffer, byte, maxSplit) {
|
|
178
|
+
const parts = [];
|
|
179
|
+
let start = 0;
|
|
180
|
+
while (parts.length < maxSplit) {
|
|
181
|
+
const idx = buffer.indexOf(byte, start);
|
|
182
|
+
if (idx === -1) break;
|
|
183
|
+
parts.push(buffer.subarray(start, idx));
|
|
184
|
+
start = idx + 1;
|
|
185
|
+
}
|
|
186
|
+
parts.push(buffer.subarray(start));
|
|
187
|
+
return parts;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function pngEmbeddedXml(data) {
|
|
191
|
+
let pos = PNG_MAGIC.length;
|
|
192
|
+
while (pos + 12 <= data.length) {
|
|
193
|
+
const size = data.readUInt32BE(pos);
|
|
194
|
+
const kind = data.subarray(pos + 4, pos + 8);
|
|
195
|
+
const kindStr = kind.toString("latin1");
|
|
196
|
+
const end = pos + 8 + size;
|
|
197
|
+
if (end + 4 > data.length) reject("PNG has a truncated metadata chunk");
|
|
198
|
+
const payload = data.subarray(pos + 8, end);
|
|
199
|
+
const expectedCrc = data.readUInt32BE(end);
|
|
200
|
+
if (crc32(Buffer.concat([kind, payload])) !== expectedCrc) reject("PNG metadata chunk has an invalid CRC");
|
|
201
|
+
pos = end + 4;
|
|
202
|
+
if (!["tEXt", "zTXt", "iTXt"].includes(kindStr)) {
|
|
203
|
+
if (kindStr === "IEND") break;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
const nullIdx = payload.indexOf(0);
|
|
207
|
+
if (nullIdx === -1) continue;
|
|
208
|
+
const keyword = payload.subarray(0, nullIdx);
|
|
209
|
+
const rest = payload.subarray(nullIdx + 1);
|
|
210
|
+
if (keyword.toString("latin1").toLowerCase() !== "mxfile") continue;
|
|
211
|
+
let value;
|
|
212
|
+
try {
|
|
213
|
+
if (kindStr === "tEXt") {
|
|
214
|
+
value = rest.toString("latin1");
|
|
215
|
+
} else if (kindStr === "zTXt") {
|
|
216
|
+
if (rest.length === 0 || rest[0] !== 0) reject("PNG mxfile text uses an unsupported compression method");
|
|
217
|
+
const inflated = boundedInflate(
|
|
218
|
+
rest.subarray(1), "zlib",
|
|
219
|
+
"embedded draw.io payload exceeds the decoded size limit",
|
|
220
|
+
"embedded draw.io payload has invalid compression",
|
|
221
|
+
);
|
|
222
|
+
value = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(inflated);
|
|
223
|
+
} else {
|
|
224
|
+
if (rest.length < 4 || rest[1] !== 0) reject("PNG mxfile international text is malformed");
|
|
225
|
+
const compressionFlag = rest[0];
|
|
226
|
+
const fields = splitBytes(rest.subarray(2), 0, 2);
|
|
227
|
+
if (fields.length !== 3) reject("PNG mxfile international text is malformed");
|
|
228
|
+
const raw = compressionFlag === 1
|
|
229
|
+
? boundedInflate(fields[2], "zlib", "embedded draw.io payload exceeds the decoded size limit", "embedded draw.io payload has invalid compression")
|
|
230
|
+
: fields[2];
|
|
231
|
+
value = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(raw);
|
|
232
|
+
}
|
|
233
|
+
} catch (error) {
|
|
234
|
+
if (error instanceof ImportFailure) throw error;
|
|
235
|
+
reject("PNG mxfile metadata is not valid text");
|
|
236
|
+
}
|
|
237
|
+
const expanded = pyUnquote(value);
|
|
238
|
+
if (Buffer.byteLength(expanded, "utf8") > MAX_DECODED) reject("embedded draw.io payload exceeds the decoded size limit");
|
|
239
|
+
return expanded;
|
|
240
|
+
}
|
|
241
|
+
reject("PNG has no embedded mxfile diagram");
|
|
242
|
+
return undefined;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function localName(name) {
|
|
246
|
+
const idx = name.lastIndexOf(":");
|
|
247
|
+
return idx === -1 ? name : name.slice(idx + 1);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function iterElements(root) {
|
|
251
|
+
const result = [];
|
|
252
|
+
const stack = [root];
|
|
253
|
+
while (stack.length) {
|
|
254
|
+
const element = stack.pop();
|
|
255
|
+
result.push(element);
|
|
256
|
+
for (let i = element.children.length - 1; i >= 0; i -= 1) stack.push(element.children[i]);
|
|
257
|
+
}
|
|
258
|
+
return result;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function parseXml(text, maxDepth, malformedLabel) {
|
|
262
|
+
const n = text.length;
|
|
263
|
+
let i = 0;
|
|
264
|
+
let root = null;
|
|
265
|
+
let rootClosed = false;
|
|
266
|
+
const stack = [];
|
|
267
|
+
|
|
268
|
+
const fail = (detail) => reject(detail ? `${malformedLabel}: ${detail}` : malformedLabel);
|
|
269
|
+
const isSpace = (ch) => ch === " " || ch === "\t" || ch === "\n" || ch === "\r";
|
|
270
|
+
|
|
271
|
+
function decodeEntities(str) {
|
|
272
|
+
if (!str.includes("&")) return str;
|
|
273
|
+
return str.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|[A-Za-z]+);/g, (match, ent) => {
|
|
274
|
+
if (ent[0] === "#") {
|
|
275
|
+
const isHex = ent[1] === "x" || ent[1] === "X";
|
|
276
|
+
const codePoint = isHex ? Number.parseInt(ent.slice(2), 16) : Number.parseInt(ent.slice(1), 10);
|
|
277
|
+
if (!Number.isFinite(codePoint) || codePoint < 0 || codePoint > 0x10ffff) fail("invalid numeric character reference");
|
|
278
|
+
return String.fromCodePoint(codePoint);
|
|
279
|
+
}
|
|
280
|
+
switch (ent) {
|
|
281
|
+
case "amp": return "&";
|
|
282
|
+
case "lt": return "<";
|
|
283
|
+
case "gt": return ">";
|
|
284
|
+
case "quot": return '"';
|
|
285
|
+
case "apos": return "'";
|
|
286
|
+
default:
|
|
287
|
+
fail(`unknown entity reference &${ent};`);
|
|
288
|
+
return match;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function appendText(raw, decode) {
|
|
294
|
+
if (!raw) return;
|
|
295
|
+
const value = decode ? decodeEntities(raw) : raw;
|
|
296
|
+
if (!stack.length) {
|
|
297
|
+
if (value.trim() !== "") fail(root === null ? "text found before the document element" : "text found after the document element");
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const parent = stack[stack.length - 1];
|
|
301
|
+
if (parent.children.length === 0) parent.text += value;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function parseStartTag(start) {
|
|
305
|
+
let j = start + 1;
|
|
306
|
+
const nameStart = j;
|
|
307
|
+
while (j < n && !isSpace(text[j]) && text[j] !== "/" && text[j] !== ">") j += 1;
|
|
308
|
+
const name = text.slice(nameStart, j);
|
|
309
|
+
if (!name) fail("malformed start tag");
|
|
310
|
+
const attrib = {};
|
|
311
|
+
let selfClosing = false;
|
|
312
|
+
for (;;) {
|
|
313
|
+
while (j < n && isSpace(text[j])) j += 1;
|
|
314
|
+
if (j >= n) fail("unterminated start tag");
|
|
315
|
+
if (text[j] === "/") {
|
|
316
|
+
if (text[j + 1] !== ">") fail("malformed start tag");
|
|
317
|
+
selfClosing = true;
|
|
318
|
+
j += 2;
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
if (text[j] === ">") {
|
|
322
|
+
j += 1;
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
const attrNameStart = j;
|
|
326
|
+
while (j < n && !isSpace(text[j]) && text[j] !== "=" && text[j] !== "/" && text[j] !== ">") j += 1;
|
|
327
|
+
const attrName = text.slice(attrNameStart, j);
|
|
328
|
+
if (!attrName) fail("malformed attribute");
|
|
329
|
+
while (j < n && isSpace(text[j])) j += 1;
|
|
330
|
+
if (text[j] !== "=") fail("malformed attribute (expected =)");
|
|
331
|
+
j += 1;
|
|
332
|
+
while (j < n && isSpace(text[j])) j += 1;
|
|
333
|
+
const quote = text[j];
|
|
334
|
+
if (quote !== '"' && quote !== "'") fail("malformed attribute value (expected a quote)");
|
|
335
|
+
j += 1;
|
|
336
|
+
const valueStart = j;
|
|
337
|
+
const endQuote = text.indexOf(quote, j);
|
|
338
|
+
if (endQuote === -1) fail("unterminated attribute value");
|
|
339
|
+
const rawValue = text.slice(valueStart, endQuote);
|
|
340
|
+
if (rawValue.includes("<")) fail("malformed attribute value");
|
|
341
|
+
attrib[attrName] = decodeEntities(rawValue);
|
|
342
|
+
j = endQuote + 1;
|
|
343
|
+
}
|
|
344
|
+
return { name, attrib, selfClosing, nextIndex: j };
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
while (i < n) {
|
|
348
|
+
if (text.startsWith("<?", i)) {
|
|
349
|
+
const end = text.indexOf("?>", i + 2);
|
|
350
|
+
if (end === -1) fail("unterminated processing instruction");
|
|
351
|
+
i = end + 2;
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
if (text.startsWith("<!--", i)) {
|
|
355
|
+
const end = text.indexOf("-->", i + 4);
|
|
356
|
+
if (end === -1) fail("unterminated comment");
|
|
357
|
+
i = end + 3;
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
if (text.startsWith("<![CDATA[", i)) {
|
|
361
|
+
const end = text.indexOf("]]>", i + 9);
|
|
362
|
+
if (end === -1) fail("unterminated CDATA section");
|
|
363
|
+
appendText(text.slice(i + 9, end), false);
|
|
364
|
+
i = end + 3;
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
if (text.startsWith("<!", i)) fail("DTD and entity declarations are unsupported");
|
|
368
|
+
if (text.startsWith("</", i)) {
|
|
369
|
+
const end = text.indexOf(">", i + 2);
|
|
370
|
+
if (end === -1) fail("unterminated end tag");
|
|
371
|
+
const name = text.slice(i + 2, end).trim();
|
|
372
|
+
if (!stack.length) fail("unexpected closing tag");
|
|
373
|
+
const top = stack[stack.length - 1];
|
|
374
|
+
if (top.tag !== name) fail(`mismatched closing tag ${name}`);
|
|
375
|
+
stack.pop();
|
|
376
|
+
if (!stack.length) rootClosed = true;
|
|
377
|
+
i = end + 1;
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
if (text[i] === "<") {
|
|
381
|
+
if (rootClosed) fail("multiple document elements");
|
|
382
|
+
const parsed = parseStartTag(i);
|
|
383
|
+
const node = { tag: parsed.name, attrib: parsed.attrib, children: [], text: "" };
|
|
384
|
+
if (root === null) {
|
|
385
|
+
root = node;
|
|
386
|
+
} else {
|
|
387
|
+
const parent = stack[stack.length - 1];
|
|
388
|
+
if (!parent) fail("element found outside the document element");
|
|
389
|
+
parent.children.push(node);
|
|
390
|
+
}
|
|
391
|
+
if (parsed.selfClosing) {
|
|
392
|
+
if (!stack.length) rootClosed = true;
|
|
393
|
+
} else {
|
|
394
|
+
stack.push(node);
|
|
395
|
+
if (stack.length > maxDepth) fail("XML nesting exceeds the depth limit");
|
|
396
|
+
}
|
|
397
|
+
i = parsed.nextIndex;
|
|
398
|
+
continue;
|
|
399
|
+
}
|
|
400
|
+
const nextLt = text.indexOf("<", i);
|
|
401
|
+
const rawText = nextLt === -1 ? text.slice(i) : text.slice(i, nextLt);
|
|
402
|
+
appendText(rawText, true);
|
|
403
|
+
i = nextLt === -1 ? n : nextLt;
|
|
404
|
+
}
|
|
405
|
+
if (stack.length) fail("element was not closed");
|
|
406
|
+
if (root === null) fail("no document element");
|
|
407
|
+
return root;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function svgEmbeddedXml(text) {
|
|
411
|
+
const root = parseXml(text, MAX_DEPTH, "draw.io SVG is malformed");
|
|
412
|
+
for (const element of iterElements(root)) {
|
|
413
|
+
for (const [name, raw] of Object.entries(element.attrib)) {
|
|
414
|
+
if (localName(name).toLowerCase() !== "content") continue;
|
|
415
|
+
if (raw.includes("<mxfile") || raw.includes("<mxGraphModel")) {
|
|
416
|
+
if (Buffer.byteLength(raw, "utf8") > MAX_DECODED) reject("embedded draw.io payload exceeds the decoded size limit");
|
|
417
|
+
return raw;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
reject("SVG has no embedded draw.io diagram");
|
|
422
|
+
return undefined;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
function parseSource(filePath) {
|
|
426
|
+
const data = readBounded(filePath, MAX_INPUT);
|
|
427
|
+
if (data.length > MAX_INPUT) reject("input exceeds the 16 MiB limit");
|
|
428
|
+
let text;
|
|
429
|
+
if (data.length >= PNG_MAGIC.length && data.subarray(0, PNG_MAGIC.length).equals(PNG_MAGIC)) {
|
|
430
|
+
text = pngEmbeddedXml(data);
|
|
431
|
+
} else {
|
|
432
|
+
try {
|
|
433
|
+
text = new TextDecoder("utf-8", { fatal: true, ignoreBOM: false }).decode(data).trim();
|
|
434
|
+
} catch {
|
|
435
|
+
reject("input is not UTF-8 draw.io XML");
|
|
436
|
+
}
|
|
437
|
+
if (DTD_RE.test(text)) reject("DTD and entity declarations are unsupported");
|
|
438
|
+
if (text.startsWith("<svg")) {
|
|
439
|
+
text = svgEmbeddedXml(text);
|
|
440
|
+
} else if (!text.startsWith("<")) {
|
|
441
|
+
reject("unsupported form; provide draw.io XML, compressed XML, or an SVG/PNG with embedded mxfile data");
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
if (DTD_RE.test(text)) reject("DTD and entity declarations are unsupported");
|
|
445
|
+
const root = parseXml(text, MAX_DEPTH, "malformed draw.io XML");
|
|
446
|
+
const rootTag = localName(root.tag);
|
|
447
|
+
if (rootTag === "mxGraphModel") return { data, sourceRoot: root, pages: [root] };
|
|
448
|
+
if (rootTag !== "mxfile") reject("unsupported XML root; expected mxfile or mxGraphModel");
|
|
449
|
+
const pages = [];
|
|
450
|
+
for (const diagram of root.children) {
|
|
451
|
+
if (localName(diagram.tag) !== "diagram") continue;
|
|
452
|
+
let model = diagram.children.find((child) => localName(child.tag) === "mxGraphModel");
|
|
453
|
+
if (!model) {
|
|
454
|
+
const payload = (diagram.text || "").trim();
|
|
455
|
+
if (!payload) reject("draw.io page has no readable mxGraphModel");
|
|
456
|
+
const expanded = decodePage(payload);
|
|
457
|
+
if (DTD_RE.test(expanded)) reject("DTD and entity declarations are unsupported");
|
|
458
|
+
model = parseXml(expanded, MAX_DEPTH, "malformed compressed draw.io XML");
|
|
459
|
+
if (localName(model.tag) !== "mxGraphModel") reject("compressed page does not contain mxGraphModel");
|
|
460
|
+
}
|
|
461
|
+
pages.push(model);
|
|
462
|
+
}
|
|
463
|
+
if (!pages.length) reject("draw.io file contains no pages");
|
|
464
|
+
return { data, sourceRoot: root, pages };
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function shapeName(style) {
|
|
468
|
+
const match = /(?:^|;)shape=([^;]+)/.exec(style);
|
|
469
|
+
const raw = match ? match[1].toLowerCase() : "rect";
|
|
470
|
+
for (const [token, shape] of SHAPE_ALIASES) {
|
|
471
|
+
if (raw.includes(token)) return shape;
|
|
472
|
+
}
|
|
473
|
+
return "rectangle";
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function extract(filePath, pageIndex) {
|
|
477
|
+
const { data, sourceRoot, pages } = parseSource(filePath);
|
|
478
|
+
if (pageIndex < 0 || pageIndex >= pages.length) reject(`page index is out of range (file contains ${pages.length} page(s))`);
|
|
479
|
+
const model = pages[pageIndex];
|
|
480
|
+
const root = model.children.find((child) => localName(child.tag) === "root");
|
|
481
|
+
if (!root) reject("mxGraphModel has no root cell list");
|
|
482
|
+
|
|
483
|
+
const records = [];
|
|
484
|
+
for (const wrapper of root.children) {
|
|
485
|
+
const tag = localName(wrapper.tag);
|
|
486
|
+
const cell = tag === "mxCell" ? wrapper : wrapper.children.find((item) => localName(item.tag) === "mxCell");
|
|
487
|
+
if (!cell) continue;
|
|
488
|
+
const attrs = { ...wrapper.attrib, ...cell.attrib };
|
|
489
|
+
if (!("value" in attrs)) attrs.value = wrapper.attrib.label || "";
|
|
490
|
+
records.push(attrs);
|
|
491
|
+
}
|
|
492
|
+
if (records.length > MAX_NODES + MAX_EDGES) reject("diagram exceeds the 7,000 cell limit");
|
|
493
|
+
|
|
494
|
+
const used = new Set();
|
|
495
|
+
const idMap = new Map();
|
|
496
|
+
for (const attrs of records) {
|
|
497
|
+
const rawId = attrs.id || "";
|
|
498
|
+
if (idMap.has(rawId)) reject("diagram contains duplicate element ids");
|
|
499
|
+
idMap.set(rawId, safeId(rawId, used));
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
const vertices = records.filter((attrs) => attrs.vertex === "1");
|
|
503
|
+
const edgeRecords = records.filter((attrs) => attrs.edge === "1");
|
|
504
|
+
if (vertices.length > MAX_NODES || edgeRecords.length > MAX_EDGES) reject("diagram exceeds the node or relationship limit");
|
|
505
|
+
|
|
506
|
+
const nodeIds = new Set(vertices.map((attrs) => attrs.id));
|
|
507
|
+
const childIds = new Map();
|
|
508
|
+
for (const attrs of vertices) {
|
|
509
|
+
const parent = attrs.parent || "";
|
|
510
|
+
if (nodeIds.has(parent)) {
|
|
511
|
+
if (!childIds.has(parent)) childIds.set(parent, []);
|
|
512
|
+
childIds.get(parent).push(attrs.id);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
const discarded = { styles: 0, links: 0, urls: 0, assets: 0, unsupportedElements: 0, danglingRelationships: 0 };
|
|
517
|
+
const nodes = [];
|
|
518
|
+
const groups = [];
|
|
519
|
+
for (const attrs of vertices) {
|
|
520
|
+
const sourceId = attrs.id;
|
|
521
|
+
const [label, urlCount] = plainLabel(attrs.value || "");
|
|
522
|
+
discarded.urls += urlCount;
|
|
523
|
+
const style = attrs.style || "";
|
|
524
|
+
discarded.styles += style ? 1 : 0;
|
|
525
|
+
discarded.links += (attrs.link || attrs.href) ? 1 : 0;
|
|
526
|
+
discarded.assets += (style.toLowerCase().includes("image=") || shapeName(style) === "image") ? 1 : 0;
|
|
527
|
+
const children = childIds.get(sourceId) || [];
|
|
528
|
+
const sourceShape = shapeName(style);
|
|
529
|
+
const isGroup = children.length > 0 || sourceShape === "container" || sourceShape === "group";
|
|
530
|
+
const node = {
|
|
531
|
+
id: idMap.get(sourceId), label,
|
|
532
|
+
kind: isGroup ? "container" : "component",
|
|
533
|
+
shape: isGroup ? "container" : sourceShape,
|
|
534
|
+
};
|
|
535
|
+
const parent = attrs.parent || "";
|
|
536
|
+
if (nodeIds.has(parent)) node.parentId = idMap.get(parent);
|
|
537
|
+
nodes.push(node);
|
|
538
|
+
if (children.length) {
|
|
539
|
+
groups.push({ id: idMap.get(sourceId), label: label || "Group", nodeIds: children.map((child) => idMap.get(child)) });
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
const relationships = [];
|
|
544
|
+
for (const attrs of edgeRecords) {
|
|
545
|
+
const source = attrs.source || "";
|
|
546
|
+
const target = attrs.target || "";
|
|
547
|
+
if (!nodeIds.has(source) || !nodeIds.has(target)) {
|
|
548
|
+
discarded.danglingRelationships += 1;
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
const [label, urlCount] = plainLabel(attrs.value || "");
|
|
552
|
+
discarded.urls += urlCount;
|
|
553
|
+
const style = attrs.style || "";
|
|
554
|
+
discarded.styles += style ? 1 : 0;
|
|
555
|
+
discarded.links += (attrs.link || attrs.href) ? 1 : 0;
|
|
556
|
+
const startArrow = /(?:^|;)startArrow=(?!none(?:;|$))/.test(style);
|
|
557
|
+
const endArrow = /(?:^|;)endArrow=(?!none(?:;|$))/.test(style);
|
|
558
|
+
const direction = startArrow && endArrow ? "both" : startArrow ? "reverse" : endArrow ? "forward" : "none";
|
|
559
|
+
relationships.push({
|
|
560
|
+
from: idMap.get(source), to: idMap.get(target), label,
|
|
561
|
+
kind: direction !== "none" ? "flow" : "association", direction,
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const parents = new Map(vertices.map((attrs) => [attrs.id, attrs.parent || ""]));
|
|
566
|
+
for (const attrs of vertices) {
|
|
567
|
+
let parent = parents.get(attrs.id);
|
|
568
|
+
let depth = 0;
|
|
569
|
+
const seen = new Set([attrs.id]);
|
|
570
|
+
while (parents.has(parent)) {
|
|
571
|
+
if (seen.has(parent)) reject("container hierarchy contains a cycle");
|
|
572
|
+
seen.add(parent);
|
|
573
|
+
depth += 1;
|
|
574
|
+
if (depth > MAX_DEPTH) reject("container hierarchy exceeds the depth limit");
|
|
575
|
+
parent = parents.get(parent);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
const diagramChildren = sourceRoot.children.filter((item) => localName(item.tag) === "diagram");
|
|
580
|
+
const pageName = diagramChildren[pageIndex] ? (diagramChildren[pageIndex].attrib.name || "") : "";
|
|
581
|
+
const suggestedType = edgeRecords.length > 0 || nodes.some((node) => node.shape === "diamond") ? "flowchart" : "architecture";
|
|
582
|
+
|
|
583
|
+
return {
|
|
584
|
+
schemaVersion: 1,
|
|
585
|
+
sourceFormat: "drawio",
|
|
586
|
+
sourceDigest: sha256Hex(data),
|
|
587
|
+
title: plainLabel(pageName || path.parse(filePath).name)[0] || "Imported diagram",
|
|
588
|
+
suggestedType,
|
|
589
|
+
nodes, relationships, groups,
|
|
590
|
+
discarded,
|
|
591
|
+
warnings: ["Source styles and coordinates are omitted; label text is inert data."],
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function parseArgs(args) {
|
|
596
|
+
let file = null;
|
|
597
|
+
let page = 0;
|
|
598
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
599
|
+
const arg = args[i];
|
|
600
|
+
if (arg === "--page") {
|
|
601
|
+
i += 1;
|
|
602
|
+
const value = args[i];
|
|
603
|
+
if (value === undefined || !/^-?\d+$/.test(value)) reject("--page requires an integer value");
|
|
604
|
+
page = Number.parseInt(value, 10);
|
|
605
|
+
} else if (!arg.startsWith("--") && file === null) {
|
|
606
|
+
file = arg;
|
|
607
|
+
} else {
|
|
608
|
+
reject(`unknown argument: ${arg}`);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
if (!file) reject("usage: node scripts/drawio-extract.mjs <file> [--page N]");
|
|
612
|
+
return { file, page };
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
function main() {
|
|
616
|
+
let file;
|
|
617
|
+
let page;
|
|
618
|
+
try {
|
|
619
|
+
({ file, page } = parseArgs(process.argv.slice(2)));
|
|
620
|
+
} catch (error) {
|
|
621
|
+
process.stderr.write(`drawio_extract: ${error instanceof ImportFailure ? error.message : error.message}\n`);
|
|
622
|
+
return 2;
|
|
623
|
+
}
|
|
624
|
+
try {
|
|
625
|
+
const result = extract(file, page);
|
|
626
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
627
|
+
return 0;
|
|
628
|
+
} catch (error) {
|
|
629
|
+
const message = error instanceof ImportFailure ? error.message : (error && error.message ? error.message : String(error));
|
|
630
|
+
process.stderr.write(`drawio_extract: ${message}\n`);
|
|
631
|
+
return 2;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
process.exitCode = main();
|