@monoes/monomindcli 2.16.3 → 2.16.5
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/.claude/agents/github/repo-architect.md +1 -1
- package/.claude/agents/specialists/integration-architect.md +9 -13
- package/.claude/commands/agents/agent-capabilities.md +1 -0
- package/.claude/commands/agents/agent-coordination.md +1 -0
- package/.claude/commands/agents/agent-spawning.md +1 -0
- package/.claude/commands/agents/agent-types.md +1 -0
- package/.claude/commands/analysis/bottleneck-detect.md +1 -0
- package/.claude/commands/analysis/performance-bottlenecks.md +1 -0
- package/.claude/commands/analysis/performance-report.md +1 -0
- package/.claude/commands/analysis/token-usage.md +1 -0
- package/.claude/commands/automation/README.md +1 -1
- package/.claude/commands/automation/auto-agent.md +1 -0
- package/.claude/commands/automation/self-healing.md +1 -0
- package/.claude/commands/automation/session-memory.md +1 -0
- package/.claude/commands/automation/smart-agents.md +1 -0
- package/.claude/commands/automation/smart-spawn.md +1 -0
- package/.claude/commands/automation/workflow-select.md +22 -27
- package/.claude/commands/coordination/README.md +2 -2
- package/.claude/commands/coordination/agent-spawn.md +1 -0
- package/.claude/commands/coordination/monoswarm-init.md +9 -8
- package/.claude/commands/coordination/task-orchestrate.md +6 -5
- package/.claude/commands/github/README.md +1 -1
- package/.claude/commands/github/github-modes.md +1 -0
- package/.claude/commands/github/issue-tracker.md +1 -0
- package/.claude/commands/github/pr-manager.md +1 -0
- package/.claude/commands/github/release-manager.md +1 -2
- package/.claude/commands/github/repo-architect.md +1 -0
- package/.claude/commands/github/sync-coordinator.md +1 -0
- package/.claude/commands/hooks/overview.md +1 -0
- package/.claude/commands/hooks/post-edit.md +1 -0
- package/.claude/commands/hooks/post-task.md +1 -0
- package/.claude/commands/hooks/pre-edit.md +1 -0
- package/.claude/commands/hooks/pre-task.md +1 -0
- package/.claude/commands/hooks/session-end.md +1 -0
- package/.claude/commands/hooks/setup.md +1 -0
- package/.claude/commands/mastermind/adr.md +3 -1
- package/.claude/commands/mastermind/brain.md +3 -1
- package/.claude/commands/mastermind/budget.md +3 -1
- package/.claude/commands/mastermind/code-review.md +3 -1
- package/.claude/commands/mastermind/content.md +3 -1
- package/.claude/commands/mastermind/createorg.md +4 -2
- package/.claude/commands/mastermind/createtask.md +6 -4
- package/.claude/commands/mastermind/debug.md +3 -1
- package/.claude/commands/mastermind/design.md +3 -1
- package/.claude/commands/mastermind/do.md +5 -3
- package/.claude/commands/mastermind/execute.md +3 -1
- package/.claude/commands/mastermind/finance.md +3 -1
- package/.claude/commands/mastermind/graph-status.md +3 -1
- package/.claude/commands/mastermind/help.md +17 -20
- package/.claude/commands/mastermind/idea.md +3 -1
- package/.claude/commands/mastermind/ideate.md +4 -2
- package/.claude/commands/mastermind/improve.md +4 -2
- package/.claude/commands/mastermind/loops.md +3 -1
- package/.claude/commands/mastermind/marketing.md +3 -1
- package/.claude/commands/mastermind/master.md +4 -3
- package/.claude/commands/mastermind/memory.md +8 -36
- package/.claude/commands/mastermind/monoswarm.md +3 -2
- package/.claude/commands/mastermind/okf-export.md +3 -1
- package/.claude/commands/mastermind/okf-import.md +3 -1
- package/.claude/commands/mastermind/ops.md +3 -1
- package/.claude/commands/mastermind/orgs.md +3 -1
- package/.claude/commands/mastermind/orgstatus.md +3 -1
- package/.claude/commands/mastermind/plan.md +3 -1
- package/.claude/commands/mastermind/receive-review.md +3 -1
- package/.claude/commands/mastermind/release.md +3 -1
- package/.claude/commands/mastermind/repeat.md +3 -1
- package/.claude/commands/mastermind/research.md +3 -1
- package/.claude/commands/mastermind/review.md +3 -1
- package/.claude/commands/mastermind/runorg.md +4 -2
- package/.claude/commands/mastermind/sales.md +3 -1
- package/.claude/commands/mastermind/skill-builder.md +3 -1
- package/.claude/commands/mastermind/specialagents.md +3 -1
- package/.claude/commands/mastermind/stoporg.md +9 -11
- package/.claude/commands/mastermind/techport.md +3 -1
- package/.claude/commands/mastermind/topology.md +4 -3
- package/.claude/commands/mastermind/understand.md +3 -1
- package/.claude/commands/mastermind/worktree.md +3 -1
- package/.claude/commands/memory/memory-search.md +1 -0
- package/.claude/commands/monitoring/README.md +1 -1
- package/.claude/commands/monitoring/agent-metrics.md +1 -0
- package/.claude/commands/monitoring/agents.md +1 -0
- package/.claude/commands/monitoring/status.md +1 -0
- package/.claude/commands/monoswarm/README.md +3 -3
- package/.claude/commands/monoswarm/analysis.md +2 -2
- package/.claude/commands/monoswarm/consensus.md +1 -0
- package/.claude/commands/monoswarm/development.md +3 -3
- package/.claude/commands/monoswarm/examples.md +4 -4
- package/.claude/commands/monoswarm/init.md +2 -1
- package/.claude/commands/monoswarm/maintenance.md +2 -2
- package/.claude/commands/monoswarm/memory.md +1 -0
- package/.claude/commands/monoswarm/monoswarm.md +5 -5
- package/.claude/commands/monoswarm/optimization.md +2 -2
- package/.claude/commands/monoswarm/research.md +2 -2
- package/.claude/commands/monoswarm/spawn.md +1 -0
- package/.claude/commands/monoswarm/status.md +2 -1
- package/.claude/commands/monoswarm/stop.md +2 -1
- package/.claude/commands/monoswarm/testing.md +2 -2
- package/.claude/commands/pair/README.md +8 -9
- package/.claude/commands/pair/examples.md +3 -4
- package/.claude/commands/pair/session.md +1 -1
- package/.claude/commands/workflows/README.md +45 -40
- package/.claude/commands/workflows/development.md +42 -55
- package/.claude/commands/workflows/research.md +41 -57
- package/.claude/commands/workflows/workflow-create.md +43 -45
- package/.claude/commands/workflows/workflow-execute.md +58 -68
- package/.claude/commands/workflows/workflow-export.md +37 -63
- package/.claude/helpers/agent-registry.cjs +434 -0
- package/.claude/helpers/build-skill-registry.cjs +10 -6
- package/.claude/helpers/handlers/pick-core.cjs +55 -26
- package/.claude/helpers/handlers/route-handler.cjs +11 -3
- package/.claude/helpers/handlers/session-restore-handler.cjs +4 -1
- package/.claude/helpers/hook-handler.cjs +4 -2
- package/.claude/helpers/jev-catalog.cjs +14 -6
- package/.claude/helpers/jev-picker.cjs +52 -8
- package/.claude/helpers/pick-rank.cjs +184 -6
- package/.claude/helpers/pick-stats.cjs +86 -2
- package/.claude/skills/agentic-jujutsu/SKILL.md +2 -3
- package/.claude/skills/github-toolkit/SKILL.md +1 -1
- package/.claude/skills/hooks-automation/SKILL.md +243 -938
- package/.claude/skills/mastermind-agent-detail/SKILL.md +1 -1
- package/.claude/skills/mastermind-agent-select/SKILL.md +16 -1
- package/.claude/skills/mastermind-agents/SKILL.md +31 -38
- package/.claude/skills/mastermind-createorg/SKILL.md +3 -3
- package/.claude/skills/mastermind-env/SKILL.md +4 -18
- package/.claude/skills/mastermind-inbox/SKILL.md +31 -52
- package/.claude/skills/mastermind-instance/SKILL.md +7 -5
- package/.claude/skills/mastermind-new-agent/SKILL.md +3 -3
- package/.claude/skills/mastermind-org-settings/SKILL.md +3 -4
- package/.claude/skills/mastermind-orgs/SKILL.md +26 -32
- package/.claude/skills/mastermind-orgstatus/SKILL.md +49 -140
- package/.claude/skills/mastermind-plugins/SKILL.md +1 -1
- package/.claude/skills/mastermind-release/SKILL.md +9 -1
- package/.claude/skills/mastermind-research/SKILL.md +9 -1
- package/.claude/skills/mastermind-review/SKILL.md +9 -1
- package/.claude/skills/mastermind-routine-detail/SKILL.md +1 -1
- package/.claude/skills/mastermind-runorg/SKILL.md +13 -13
- package/.claude/skills/mastermind-stoporg/SKILL.md +7 -62
- package/.claude/skills/mastermind-tasks/SKILL.md +6 -8
- package/.claude/skills/monodesign/SKILL.md +257 -0
- package/.claude/skills/monodesign/adapt.md +53 -0
- package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +100 -0
- package/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +103 -0
- package/.claude/skills/monodesign/animate.md +65 -0
- package/.claude/skills/monodesign/audit.md +89 -0
- package/.claude/skills/monodesign/bolder.md +50 -0
- package/.claude/skills/monodesign/clarify.md +64 -0
- package/.claude/skills/monodesign/colorize.md +68 -0
- package/.claude/skills/monodesign/craft.md +51 -0
- package/.claude/skills/monodesign/critique.md +66 -0
- package/.claude/skills/monodesign/delight.md +47 -0
- package/.claude/skills/monodesign/distill.md +56 -0
- package/.claude/skills/monodesign/document.md +83 -0
- package/.claude/skills/monodesign/extract.md +74 -0
- package/.claude/skills/monodesign/harden.md +65 -0
- package/.claude/skills/monodesign/init.md +30 -0
- package/.claude/skills/monodesign/layout.md +36 -0
- package/.claude/skills/monodesign/live.md +34 -0
- package/.claude/skills/monodesign/onboard.md +50 -0
- package/.claude/skills/monodesign/optimize.md +64 -0
- package/.claude/skills/monodesign/overdrive.md +56 -0
- package/.claude/skills/monodesign/polish.md +68 -0
- package/.claude/skills/monodesign/quieter.md +57 -0
- package/.claude/skills/monodesign/reference/adapt.md +312 -0
- package/.claude/skills/monodesign/reference/adapt.native.md +58 -0
- package/.claude/skills/monodesign/reference/android.md +40 -0
- package/.claude/skills/monodesign/reference/animate.md +203 -0
- package/.claude/skills/monodesign/reference/antipatterns-catalog.md +410 -0
- package/.claude/skills/monodesign/reference/audit.md +135 -0
- package/.claude/skills/monodesign/reference/audit.native.md +139 -0
- package/.claude/skills/monodesign/reference/bolder.md +120 -0
- package/.claude/skills/monodesign/reference/brand-workflow.md +180 -0
- package/.claude/skills/monodesign/reference/brand.md +108 -0
- package/.claude/skills/monodesign/reference/clarify.md +288 -0
- package/.claude/skills/monodesign/reference/codex.md +105 -0
- package/.claude/skills/monodesign/reference/cognitive-load.md +106 -0
- package/.claude/skills/monodesign/reference/color-and-contrast.md +105 -0
- package/.claude/skills/monodesign/reference/colorize.md +257 -0
- package/.claude/skills/monodesign/reference/component-specs.md +260 -0
- package/.claude/skills/monodesign/reference/component-states.md +274 -0
- package/.claude/skills/monodesign/reference/component-system.md +358 -0
- package/.claude/skills/monodesign/reference/copy-formulas.md +160 -0
- package/.claude/skills/monodesign/reference/craft.md +123 -0
- package/.claude/skills/monodesign/reference/critique.md +780 -0
- package/.claude/skills/monodesign/reference/delight.md +302 -0
- package/.claude/skills/monodesign/reference/design-principles.md +246 -0
- package/.claude/skills/monodesign/reference/distill.md +111 -0
- package/.claude/skills/monodesign/reference/document.md +429 -0
- package/.claude/skills/monodesign/reference/extract.md +69 -0
- package/.claude/skills/monodesign/reference/harden.md +347 -0
- package/.claude/skills/monodesign/reference/heuristics-scoring.md +234 -0
- package/.claude/skills/monodesign/reference/hooks.md +92 -0
- package/.claude/skills/monodesign/reference/image-prompts.md +130 -0
- package/.claude/skills/monodesign/reference/init.md +221 -0
- package/.claude/skills/monodesign/reference/interaction-design.md +189 -0
- package/.claude/skills/monodesign/reference/ios.md +45 -0
- package/.claude/skills/monodesign/reference/layout.md +185 -0
- package/.claude/skills/monodesign/reference/live.md +710 -0
- package/.claude/skills/monodesign/reference/motion-design.md +109 -0
- package/.claude/skills/monodesign/reference/onboard.md +234 -0
- package/.claude/skills/monodesign/reference/optimize.md +258 -0
- package/.claude/skills/monodesign/reference/overdrive.md +130 -0
- package/.claude/skills/monodesign/reference/personas.md +179 -0
- package/.claude/skills/monodesign/reference/polish.md +241 -0
- package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +108 -0
- package/.claude/skills/monodesign/reference/product.md +60 -0
- package/.claude/skills/monodesign/reference/quieter.md +99 -0
- package/.claude/skills/monodesign/reference/responsive-design.md +114 -0
- package/.claude/skills/monodesign/reference/shape.md +165 -0
- package/.claude/skills/monodesign/reference/spatial-design.md +100 -0
- package/.claude/skills/monodesign/reference/teach.md +10 -0
- package/.claude/skills/monodesign/reference/token-architecture.md +222 -0
- package/.claude/skills/monodesign/reference/typeset.md +301 -0
- package/.claude/skills/monodesign/reference/typography.md +159 -0
- package/.claude/skills/monodesign/reference/ux-research.md +143 -0
- package/.claude/skills/monodesign/reference/ux-rules.md +211 -0
- package/.claude/skills/monodesign/reference/ux-writing.md +107 -0
- package/.claude/skills/monodesign/scripts/command-metadata.json +94 -0
- package/.claude/skills/monodesign/scripts/context-signals.mjs +260 -0
- package/.claude/skills/monodesign/scripts/context.mjs +1065 -0
- package/.claude/skills/monodesign/scripts/critique-storage.mjs +416 -0
- package/.claude/skills/monodesign/scripts/detect-csp.mjs +193 -0
- package/.claude/skills/monodesign/scripts/detect.mjs +33 -0
- package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +1960 -0
- package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +321 -0
- package/.claude/skills/monodesign/scripts/detector/design-system.mjs +814 -0
- package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +5628 -0
- package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +50 -0
- package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +259 -0
- package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +339 -0
- package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +636 -0
- package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +1016 -0
- package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +253 -0
- package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +198 -0
- package/.claude/skills/monodesign/scripts/detector/findings.mjs +12 -0
- package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +181 -0
- package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +373 -0
- package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +426 -0
- package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +198 -0
- package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +166 -0
- package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +563 -0
- package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +3024 -0
- package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +124 -0
- package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +101 -0
- package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +30 -0
- package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +148 -0
- package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +7 -0
- package/.claude/skills/monodesign/scripts/hook-admin.mjs +694 -0
- package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +516 -0
- package/.claude/skills/monodesign/scripts/hook-lib.mjs +1785 -0
- package/.claude/skills/monodesign/scripts/hook.mjs +61 -0
- package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +809 -0
- package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +69 -0
- package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +640 -0
- package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +129 -0
- package/.claude/skills/monodesign/scripts/lib/provider.mjs +4 -0
- package/.claude/skills/monodesign/scripts/lib/target-args.mjs +42 -0
- package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +50 -0
- package/.claude/skills/monodesign/scripts/live/completion.mjs +19 -0
- package/.claude/skills/monodesign/scripts/live/event-validation.mjs +137 -0
- package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +458 -0
- package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +939 -0
- package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +357 -0
- package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +152 -0
- package/.claude/skills/monodesign/scripts/live/session-store.mjs +293 -0
- package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +826 -0
- package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +279 -0
- package/.claude/skills/monodesign/scripts/live/ui-core.mjs +180 -0
- package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +36 -0
- package/.claude/skills/monodesign/scripts/live-accept.mjs +812 -0
- package/.claude/skills/monodesign/scripts/live-browser-dom.js +147 -0
- package/.claude/skills/monodesign/scripts/live-browser-session.js +124 -0
- package/.claude/skills/monodesign/scripts/live-browser.js +11213 -0
- package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +1241 -0
- package/.claude/skills/monodesign/scripts/live-complete.mjs +75 -0
- package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +683 -0
- package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +51 -0
- package/.claude/skills/monodesign/scripts/live-inject.mjs +596 -0
- package/.claude/skills/monodesign/scripts/live-insert.mjs +272 -0
- package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +363 -0
- package/.claude/skills/monodesign/scripts/live-poll.mjs +384 -0
- package/.claude/skills/monodesign/scripts/live-resume.mjs +94 -0
- package/.claude/skills/monodesign/scripts/live-server.mjs +1210 -0
- package/.claude/skills/monodesign/scripts/live-status.mjs +61 -0
- package/.claude/skills/monodesign/scripts/live-target.mjs +30 -0
- package/.claude/skills/monodesign/scripts/live-wrap.mjs +884 -0
- package/.claude/skills/monodesign/scripts/live.mjs +297 -0
- package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +14 -0
- package/.claude/skills/monodesign/scripts/palette.mjs +635 -0
- package/.claude/skills/monodesign/scripts/pin.mjs +221 -0
- package/.claude/skills/monodesign/shape.md +71 -0
- package/.claude/skills/monodesign/teach.md +18 -0
- package/.claude/skills/monodesign/typeset.md +59 -0
- package/.claude/skills/monolean-audit/SKILL.md +4 -6
- package/.claude/skills/monolean-help/SKILL.md +0 -1
- package/.claude/skills/monoswarm/SKILL.md +17 -17
- package/.claude/skills/pair-programming/SKILL.md +127 -1100
- package/README.md +28 -43
- package/dist/src/agents/registry-builder.d.ts +58 -22
- package/dist/src/agents/registry-builder.d.ts.map +1 -1
- package/dist/src/agents/registry-builder.js +41 -341
- package/dist/src/agents/registry-builder.js.map +1 -1
- package/dist/src/agents/registry-freshness.d.ts +4 -4
- package/dist/src/agents/registry-freshness.d.ts.map +1 -1
- package/dist/src/agents/registry-freshness.js +11 -60
- package/dist/src/agents/registry-freshness.js.map +1 -1
- package/dist/src/commands/doc.d.ts.map +1 -1
- package/dist/src/commands/doc.js +6 -15
- package/dist/src/commands/doc.js.map +1 -1
- package/dist/src/commands/doctor-pick-checks.d.ts +20 -3
- package/dist/src/commands/doctor-pick-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-pick-checks.js +138 -45
- package/dist/src/commands/doctor-pick-checks.js.map +1 -1
- package/dist/src/commands/doctor-project-checks.d.ts +2 -2
- package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.js +21 -17
- package/dist/src/commands/doctor-project-checks.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +6 -4
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/hooks-routing-commands.d.ts.map +1 -1
- package/dist/src/commands/hooks-routing-commands.js +4 -3
- package/dist/src/commands/hooks-routing-commands.js.map +1 -1
- package/dist/src/commands/init-upgrade.d.ts.map +1 -1
- package/dist/src/commands/init-upgrade.js +10 -0
- package/dist/src/commands/init-upgrade.js.map +1 -1
- package/dist/src/commands/init-wizard.d.ts.map +1 -1
- package/dist/src/commands/init-wizard.js +7 -2
- package/dist/src/commands/init-wizard.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +27 -27
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/monograph.d.ts.map +1 -1
- package/dist/src/commands/monograph.js +16 -21
- package/dist/src/commands/monograph.js.map +1 -1
- package/dist/src/commands/org.js +1 -1
- package/dist/src/commands/org.js.map +1 -1
- package/dist/src/commands/pick.d.ts.map +1 -1
- package/dist/src/commands/pick.js +4 -3
- package/dist/src/commands/pick.js.map +1 -1
- package/dist/src/decision/jev.d.ts +20 -0
- package/dist/src/decision/jev.d.ts.map +1 -1
- package/dist/src/decision/jev.js +12 -0
- package/dist/src/decision/jev.js.map +1 -1
- package/dist/src/decision/pick-eval.d.ts +23 -0
- package/dist/src/decision/pick-eval.d.ts.map +1 -1
- package/dist/src/decision/pick-eval.js +24 -1
- package/dist/src/decision/pick-eval.js.map +1 -1
- package/dist/src/decision/pick-real.d.ts +93 -0
- package/dist/src/decision/pick-real.d.ts.map +1 -0
- package/dist/src/decision/pick-real.js +253 -0
- package/dist/src/decision/pick-real.js.map +1 -0
- package/dist/src/decision/picks.d.ts +6 -0
- package/dist/src/decision/picks.d.ts.map +1 -1
- package/dist/src/decision/picks.js +34 -11
- package/dist/src/decision/picks.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +1 -0
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/copy-assets.d.ts.map +1 -1
- package/dist/src/init/copy-assets.js +17 -9
- package/dist/src/init/copy-assets.js.map +1 -1
- package/dist/src/init/embeddings-step.d.ts +23 -0
- package/dist/src/init/embeddings-step.d.ts.map +1 -0
- package/dist/src/init/embeddings-step.js +53 -0
- package/dist/src/init/embeddings-step.js.map +1 -0
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +35 -5
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/file-guard.d.ts +93 -0
- package/dist/src/init/file-guard.d.ts.map +1 -0
- package/dist/src/init/file-guard.js +239 -0
- package/dist/src/init/file-guard.js.map +1 -0
- package/dist/src/init/helpers-generator.d.ts +7 -0
- package/dist/src/init/helpers-generator.d.ts.map +1 -1
- package/dist/src/init/helpers-generator.js +13 -0
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/init-memory.d.ts +10 -0
- package/dist/src/init/init-memory.d.ts.map +1 -1
- package/dist/src/init/init-memory.js +44 -1
- package/dist/src/init/init-memory.js.map +1 -1
- package/dist/src/init/managed-block.d.ts +3 -1
- package/dist/src/init/managed-block.d.ts.map +1 -1
- package/dist/src/init/managed-block.js +9 -2
- package/dist/src/init/managed-block.js.map +1 -1
- package/dist/src/init/mcp-generator.d.ts +9 -0
- package/dist/src/init/mcp-generator.d.ts.map +1 -1
- package/dist/src/init/mcp-generator.js +28 -0
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/project-indexes.d.ts +19 -0
- package/dist/src/init/project-indexes.d.ts.map +1 -0
- package/dist/src/init/project-indexes.js +44 -0
- package/dist/src/init/project-indexes.js.map +1 -0
- package/dist/src/init/runtime-config-merge.d.ts +21 -0
- package/dist/src/init/runtime-config-merge.d.ts.map +1 -0
- package/dist/src/init/runtime-config-merge.js +88 -0
- package/dist/src/init/runtime-config-merge.js.map +1 -0
- package/dist/src/init/settings-generator.js +1 -1
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/shared-instructions-generator.d.ts +3 -1
- package/dist/src/init/shared-instructions-generator.d.ts.map +1 -1
- package/dist/src/init/shared-instructions-generator.js +14 -39
- package/dist/src/init/shared-instructions-generator.js.map +1 -1
- package/dist/src/init/shared.d.ts +17 -2
- package/dist/src/init/shared.d.ts.map +1 -1
- package/dist/src/init/shared.js +39 -7
- package/dist/src/init/shared.js.map +1 -1
- package/dist/src/init/types.d.ts +22 -2
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +11 -3
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/init/upgrade.d.ts +7 -0
- package/dist/src/init/upgrade.d.ts.map +1 -1
- package/dist/src/init/upgrade.js +60 -48
- package/dist/src/init/upgrade.js.map +1 -1
- package/dist/src/init/write-antigravity.d.ts +1 -0
- package/dist/src/init/write-antigravity.d.ts.map +1 -1
- package/dist/src/init/write-antigravity.js +28 -4
- package/dist/src/init/write-antigravity.js.map +1 -1
- package/dist/src/init/write-claude.d.ts.map +1 -1
- package/dist/src/init/write-claude.js +47 -23
- package/dist/src/init/write-claude.js.map +1 -1
- package/dist/src/init/write-kimicode.d.ts +27 -0
- package/dist/src/init/write-kimicode.d.ts.map +1 -1
- package/dist/src/init/write-kimicode.js +119 -92
- package/dist/src/init/write-kimicode.js.map +1 -1
- package/dist/src/init/write-opencode.d.ts.map +1 -1
- package/dist/src/init/write-opencode.js +45 -6
- package/dist/src/init/write-opencode.js.map +1 -1
- package/dist/src/init/write-runtime-config.d.ts.map +1 -1
- package/dist/src/init/write-runtime-config.js +108 -81
- package/dist/src/init/write-runtime-config.js.map +1 -1
- package/dist/src/knowledge/eval/golden-set.js +0 -15
- package/dist/src/knowledge/eval/golden-set.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +14 -5
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.js +4 -3
- package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
- package/dist/src/mcp-tools/monograph/build-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph/build-tools.js +16 -9
- package/dist/src/mcp-tools/monograph/build-tools.js.map +1 -1
- package/dist/src/mcp-tools/org-skill-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/org-skill-tools.js +6 -2
- package/dist/src/mcp-tools/org-skill-tools.js.map +1 -1
- package/dist/src/mcp-tools/pick-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/pick-tools.js +13 -4
- package/dist/src/mcp-tools/pick-tools.js.map +1 -1
- package/dist/src/memory/embedding-operations.d.ts +0 -4
- package/dist/src/memory/embedding-operations.d.ts.map +1 -1
- package/dist/src/memory/embedding-operations.js +11 -85
- package/dist/src/memory/embedding-operations.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +7 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +15 -0
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/orgrt/bash-timeout.d.ts +17 -0
- package/dist/src/orgrt/bash-timeout.d.ts.map +1 -1
- package/dist/src/orgrt/bash-timeout.js +15 -0
- package/dist/src/orgrt/bash-timeout.js.map +1 -1
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +5 -2
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/src/orgrt/task-match.d.ts +3 -1
- package/dist/src/orgrt/task-match.d.ts.map +1 -1
- package/dist/src/orgrt/task-match.js +12 -4
- package/dist/src/orgrt/task-match.js.map +1 -1
- package/dist/src/platform-adapters/merge.d.ts +4 -3
- package/dist/src/platform-adapters/merge.d.ts.map +1 -1
- package/dist/src/platform-adapters/merge.js +18 -8
- package/dist/src/platform-adapters/merge.js.map +1 -1
- package/dist/src/platform-adapters/mutation.d.ts +6 -1
- package/dist/src/platform-adapters/mutation.d.ts.map +1 -1
- package/dist/src/platform-adapters/mutation.js +9 -3
- package/dist/src/platform-adapters/mutation.js.map +1 -1
- package/dist/src/platform-adapters/operations.d.ts.map +1 -1
- package/dist/src/platform-adapters/operations.js +14 -6
- package/dist/src/platform-adapters/operations.js.map +1 -1
- package/dist/src/platform-adapters/types.d.ts +5 -0
- package/dist/src/platform-adapters/types.d.ts.map +1 -1
- package/dist/src/routing/agent-pick.d.ts +9 -7
- package/dist/src/routing/agent-pick.d.ts.map +1 -1
- package/dist/src/routing/agent-pick.js +17 -17
- package/dist/src/routing/agent-pick.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/.claude/skills/github-issue-triage/SKILL.md +0 -354
- package/.claude/skills/github-repo-recap/SKILL.md +0 -207
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { loadDesignSystemForCwd } from '../design-system.mjs';
|
|
5
|
+
import { RULE_SCOPES, filterByScopes } from '../registry/antipatterns.mjs';
|
|
6
|
+
import { createBrowserDetector, detectUrl } from '../engines/browser/detect-url.mjs';
|
|
7
|
+
import { detectHtml } from '../engines/static-html/detect-html.mjs';
|
|
8
|
+
import { detectText } from '../engines/regex/detect-text.mjs';
|
|
9
|
+
import {
|
|
10
|
+
filterDetectionFindings,
|
|
11
|
+
readDetectionConfig,
|
|
12
|
+
shouldIgnoreDetectionFile,
|
|
13
|
+
} from '../../lib/monodesign-config.mjs';
|
|
14
|
+
import {
|
|
15
|
+
HTML_EXTENSIONS,
|
|
16
|
+
buildImportGraph,
|
|
17
|
+
detectFrameworkConfig,
|
|
18
|
+
isPortListening,
|
|
19
|
+
walkDir,
|
|
20
|
+
} from '../node/file-system.mjs';
|
|
21
|
+
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Output formatting
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
function formatFindingSummary(count) {
|
|
27
|
+
return `${count} anti-pattern${count === 1 ? '' : 's'} found.`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function formatFindings(findings, jsonMode) {
|
|
31
|
+
if (jsonMode) return JSON.stringify(findings, null, 2);
|
|
32
|
+
|
|
33
|
+
const grouped = {};
|
|
34
|
+
for (const f of findings) {
|
|
35
|
+
if (!grouped[f.file]) grouped[f.file] = [];
|
|
36
|
+
grouped[f.file].push(f);
|
|
37
|
+
}
|
|
38
|
+
const out = [];
|
|
39
|
+
for (const [file, items] of Object.entries(grouped)) {
|
|
40
|
+
const importNote = items[0]?.importedBy?.length ? ` (imported by ${items[0].importedBy.join(', ')})` : '';
|
|
41
|
+
out.push(`\n${file}${importNote}`);
|
|
42
|
+
for (const item of items) {
|
|
43
|
+
out.push(` ${item.line ? `line ${item.line}: ` : ''}[${item.antipattern}] ${item.snippet}`);
|
|
44
|
+
out.push(` → ${item.description}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
out.push(`\n${formatFindingSummary(findings.length)}`);
|
|
48
|
+
return out.join('\n');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
// Stdin handling
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
|
|
55
|
+
async function handleStdin(options = {}) {
|
|
56
|
+
const chunks = [];
|
|
57
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
58
|
+
const input = Buffer.concat(chunks).toString('utf-8');
|
|
59
|
+
try {
|
|
60
|
+
const parsed = JSON.parse(input);
|
|
61
|
+
const fp = parsed?.tool_input?.file_path;
|
|
62
|
+
if (fp && fs.existsSync(fp)) {
|
|
63
|
+
return HTML_EXTENSIONS.has(path.extname(fp).toLowerCase())
|
|
64
|
+
? detectHtml(fp, options) : detectText(fs.readFileSync(fp, 'utf-8'), fp, options);
|
|
65
|
+
}
|
|
66
|
+
} catch { /* not JSON */ }
|
|
67
|
+
return detectText(input, '<stdin>', options);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
// CLI
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
|
|
75
|
+
async function confirm(question) {
|
|
76
|
+
const rl = (await import('node:readline')).default.createInterface({
|
|
77
|
+
input: process.stdin, output: process.stderr,
|
|
78
|
+
});
|
|
79
|
+
return new Promise((resolve) => {
|
|
80
|
+
rl.question(`${question} [Y/n] `, (answer) => {
|
|
81
|
+
rl.close();
|
|
82
|
+
resolve(!answer || /^y(es)?$/i.test(answer.trim()));
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function printUsage() {
|
|
88
|
+
console.log(`Usage: monodesign detect [options] [file-or-dir-or-url...]
|
|
89
|
+
|
|
90
|
+
Scan files or URLs for UI anti-patterns and design quality issues.
|
|
91
|
+
|
|
92
|
+
Options:
|
|
93
|
+
--json Output results as JSON
|
|
94
|
+
--quiet In text mode, only print the final findings count
|
|
95
|
+
--gpt Also report GPT-specific provider tells (off by default)
|
|
96
|
+
--gemini Also report Gemini-specific provider tells (off by default)
|
|
97
|
+
--scope <name> Only report rules in the given design domain
|
|
98
|
+
(type, layout). Comma-separated.
|
|
99
|
+
--no-config Do not apply project config, detector ignores, inline
|
|
100
|
+
ignore comments, or DESIGN.md
|
|
101
|
+
--no-inline-ignores Do not honor in-file monodesign-disable* ignore comments
|
|
102
|
+
--no-design-system Do not load local DESIGN.md / .monodesign/design.json context
|
|
103
|
+
--help Show this help message
|
|
104
|
+
|
|
105
|
+
Project config:
|
|
106
|
+
Respects .monodesign/config.json and .monodesign/config.local.json detector
|
|
107
|
+
settings: detector.ignoreRules, detector.ignoreFiles, detector.ignoreValues,
|
|
108
|
+
and detector.designSystem.enabled.
|
|
109
|
+
|
|
110
|
+
Inline ignores:
|
|
111
|
+
In-file comments waive a finding where it lives and travel with the file:
|
|
112
|
+
<!-- monodesign-disable overused-font -- exported brand doc -->
|
|
113
|
+
.brand { font-family: Inter } /* monodesign-disable-line overused-font */
|
|
114
|
+
// monodesign-disable-next-line bounce-easing: intentional bounce
|
|
115
|
+
monodesign-disable applies to the whole file; -line / -next-line are scoped.
|
|
116
|
+
List one or more rule ids (comma-separated), or omit them / use * for all.
|
|
117
|
+
|
|
118
|
+
Detection modes:
|
|
119
|
+
HTML files Static HTML/CSS analysis (default, catches linked CSS)
|
|
120
|
+
Non-HTML files Regex pattern matching (CSS, JSX, TSX, etc.)
|
|
121
|
+
URLs Puppeteer full browser rendering (auto-detected)
|
|
122
|
+
|
|
123
|
+
Examples:
|
|
124
|
+
monodesign detect src/
|
|
125
|
+
monodesign detect index.html
|
|
126
|
+
monodesign detect https://example.com
|
|
127
|
+
monodesign detect --json .
|
|
128
|
+
monodesign detect --no-config src/`);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async function detectCli() {
|
|
132
|
+
let args = process.argv.slice(2).map(arg => {
|
|
133
|
+
if (arg === '-json') return '--json';
|
|
134
|
+
if (arg === '-fast') return '--fast';
|
|
135
|
+
return arg;
|
|
136
|
+
});
|
|
137
|
+
if (args[0] === 'detect') args = args.slice(1);
|
|
138
|
+
const jsonMode = args.includes('--json');
|
|
139
|
+
const quietMode = args.includes('--quiet');
|
|
140
|
+
const helpMode = args.includes('--help');
|
|
141
|
+
// --fast (regex-only) is deprecated: since the jsdom removal, the static
|
|
142
|
+
// HTML/CSS analysis is fast and covers every rule, so the regex-only path
|
|
143
|
+
// only loses coverage for no real speed win. Accept the flag for back-compat
|
|
144
|
+
// but ignore it and run the full scan.
|
|
145
|
+
if (args.includes('--fast')) {
|
|
146
|
+
process.stderr.write(
|
|
147
|
+
'Note: --fast is deprecated and ignored. The full scan is fast now and runs every rule.\n',
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
const configEnabled = !args.includes('--no-config');
|
|
151
|
+
const detectionConfig = configEnabled
|
|
152
|
+
? readDetectionConfig(process.cwd())
|
|
153
|
+
: { ignoreRules: [], ignoreFiles: [], ignoreValues: [] };
|
|
154
|
+
const providers = [];
|
|
155
|
+
if (args.includes('--gpt')) providers.push('gpt');
|
|
156
|
+
if (args.includes('--gemini')) providers.push('gemini');
|
|
157
|
+
const scopes = [];
|
|
158
|
+
for (let i = 0; i < args.length; i++) {
|
|
159
|
+
if (args[i] !== '--scope' && !args[i].startsWith('--scope=')) continue;
|
|
160
|
+
const inline = args[i].startsWith('--scope=');
|
|
161
|
+
const value = inline ? args[i].slice('--scope='.length) : args[i + 1];
|
|
162
|
+
const parsed = (value && !value.startsWith('--'))
|
|
163
|
+
? value.split(',').map(s => s.trim()).filter(Boolean)
|
|
164
|
+
: [];
|
|
165
|
+
// A bare `--scope` would otherwise fall out of `targets` and scan unscoped;
|
|
166
|
+
// fail loudly so a mistyped pre-scan never runs the wrong rule set.
|
|
167
|
+
if (parsed.length === 0) {
|
|
168
|
+
process.stderr.write(
|
|
169
|
+
`Error: --scope requires a value. Valid scopes: ${[...RULE_SCOPES].join(', ')}\n`,
|
|
170
|
+
);
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
scopes.push(...parsed);
|
|
174
|
+
args.splice(i, inline ? 1 : 2);
|
|
175
|
+
i -= 1;
|
|
176
|
+
}
|
|
177
|
+
const unknownScopes = scopes.filter(s => !RULE_SCOPES.has(s));
|
|
178
|
+
if (unknownScopes.length > 0) {
|
|
179
|
+
process.stderr.write(
|
|
180
|
+
`Error: unknown --scope value(s): ${unknownScopes.join(', ')}. Valid scopes: ${[...RULE_SCOPES].join(', ')}\n`,
|
|
181
|
+
);
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
const designSystemEnabled = configEnabled && !args.includes('--no-design-system') && detectionConfig.designSystem?.enabled !== false;
|
|
185
|
+
const designSystem = designSystemEnabled ? loadDesignSystemForCwd(process.cwd()) : null;
|
|
186
|
+
// Inline `monodesign-disable*` waivers are part of the scanned file, so they
|
|
187
|
+
// apply by default. `--no-config` (raw scan) and the dedicated
|
|
188
|
+
// `--no-inline-ignores` both turn them off.
|
|
189
|
+
const inlineIgnoresEnabled = configEnabled && !args.includes('--no-inline-ignores');
|
|
190
|
+
const scanOptions = { providers, inlineIgnores: inlineIgnoresEnabled };
|
|
191
|
+
if (designSystem) scanOptions.designSystem = designSystem;
|
|
192
|
+
const targets = args.filter(a => !a.startsWith('--'));
|
|
193
|
+
|
|
194
|
+
if (helpMode) { printUsage(); process.exit(0); }
|
|
195
|
+
|
|
196
|
+
let allFindings = [];
|
|
197
|
+
|
|
198
|
+
if (!process.stdin.isTTY && targets.length === 0) {
|
|
199
|
+
allFindings = await handleStdin(scanOptions);
|
|
200
|
+
} else {
|
|
201
|
+
const paths = targets.length > 0 ? targets : [process.cwd()];
|
|
202
|
+
const urlTargetCount = paths.filter(target => /^https?:\/\//i.test(target)).length;
|
|
203
|
+
const browserDetector = urlTargetCount > 1 ? await createBrowserDetector() : null;
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
for (const target of paths) {
|
|
207
|
+
if (/^https?:\/\//i.test(target)) {
|
|
208
|
+
try {
|
|
209
|
+
const scanner = browserDetector
|
|
210
|
+
? (url) => browserDetector.detectUrl(url, scanOptions)
|
|
211
|
+
: (url) => detectUrl(url, scanOptions);
|
|
212
|
+
allFindings.push(...await scanner(target));
|
|
213
|
+
} catch (e) { process.stderr.write(`Error: ${e.message}\n`); }
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const resolved = path.resolve(target);
|
|
218
|
+
let stat;
|
|
219
|
+
try { stat = fs.statSync(resolved); }
|
|
220
|
+
catch { process.stderr.write(`Warning: cannot access ${target}\n`); continue; }
|
|
221
|
+
|
|
222
|
+
if (stat.isDirectory()) {
|
|
223
|
+
// Check for framework dev server config (skip in JSON/quiet modes to avoid polluting output)
|
|
224
|
+
if (!jsonMode && !quietMode) {
|
|
225
|
+
const fwConfig = detectFrameworkConfig(resolved);
|
|
226
|
+
if (fwConfig) {
|
|
227
|
+
const probe = await isPortListening(fwConfig.port, fwConfig.fingerprint);
|
|
228
|
+
if (probe.listening && probe.matched) {
|
|
229
|
+
process.stderr.write(
|
|
230
|
+
`\n${fwConfig.name} dev server detected on localhost:${fwConfig.port}.\n` +
|
|
231
|
+
`For more accurate results, scan the running site:\n` +
|
|
232
|
+
` monomind design detect http://localhost:${fwConfig.port}\n\n`
|
|
233
|
+
);
|
|
234
|
+
} else if (probe.listening && !probe.matched) {
|
|
235
|
+
process.stderr.write(
|
|
236
|
+
`\n${fwConfig.name} project detected (${path.basename(fwConfig.configPath)}).\n` +
|
|
237
|
+
`Port ${fwConfig.port} is in use by another service. Start the ${fwConfig.name} dev server and scan via URL for best results.\n\n`
|
|
238
|
+
);
|
|
239
|
+
} else {
|
|
240
|
+
process.stderr.write(
|
|
241
|
+
`\n${fwConfig.name} project detected (${path.basename(fwConfig.configPath)}).\n` +
|
|
242
|
+
`Start the dev server and scan via URL for best results:\n` +
|
|
243
|
+
` monomind design detect http://localhost:${fwConfig.port}\n\n`
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const files = walkDir(resolved)
|
|
250
|
+
.filter(file => !shouldIgnoreDetectionFile(file, process.cwd(), detectionConfig));
|
|
251
|
+
const htmlCount = files.filter(f => HTML_EXTENSIONS.has(path.extname(f).toLowerCase())).length;
|
|
252
|
+
|
|
253
|
+
// Warn and confirm if scanning many files (static HTML/CSS processes each HTML file)
|
|
254
|
+
if (files.length > 50 && process.stdin.isTTY && !jsonMode && !quietMode) {
|
|
255
|
+
process.stderr.write(
|
|
256
|
+
`\nFound ${files.length} files (${htmlCount} HTML) in ${target}.\n` +
|
|
257
|
+
`Scanning may take a while${htmlCount > 10 ? ' (static HTML/CSS processes each HTML file individually)' : ''}.\n` +
|
|
258
|
+
`Target a specific subdirectory to narrow scope.\n`
|
|
259
|
+
);
|
|
260
|
+
const ok = await confirm('Continue?');
|
|
261
|
+
if (!ok) { process.stderr.write('Aborted.\n'); process.exit(0); }
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Build import graph for multi-file awareness
|
|
265
|
+
const graph = buildImportGraph(files);
|
|
266
|
+
// Build reverse map: file -> set of files that import it
|
|
267
|
+
const importedByMap = new Map();
|
|
268
|
+
for (const [importer, imports] of graph) {
|
|
269
|
+
for (const imported of imports) {
|
|
270
|
+
if (!importedByMap.has(imported)) importedByMap.set(imported, new Set());
|
|
271
|
+
importedByMap.get(imported).add(importer);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
for (const file of files) {
|
|
276
|
+
const ext = path.extname(file).toLowerCase();
|
|
277
|
+
let fileFindings;
|
|
278
|
+
if (HTML_EXTENSIONS.has(ext)) {
|
|
279
|
+
fileFindings = await detectHtml(file, scanOptions);
|
|
280
|
+
} else {
|
|
281
|
+
fileFindings = detectText(fs.readFileSync(file, 'utf-8'), file, scanOptions);
|
|
282
|
+
}
|
|
283
|
+
// Annotate findings with import context
|
|
284
|
+
const importers = importedByMap.get(file);
|
|
285
|
+
if (importers && importers.size > 0) {
|
|
286
|
+
const importerNames = [...importers].map(f => path.basename(f));
|
|
287
|
+
for (const f of fileFindings) {
|
|
288
|
+
f.importedBy = importerNames;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
allFindings.push(...fileFindings);
|
|
292
|
+
}
|
|
293
|
+
} else if (stat.isFile()) {
|
|
294
|
+
if (shouldIgnoreDetectionFile(resolved, process.cwd(), detectionConfig)) continue;
|
|
295
|
+
const ext = path.extname(resolved).toLowerCase();
|
|
296
|
+
if (HTML_EXTENSIONS.has(ext)) {
|
|
297
|
+
allFindings.push(...await detectHtml(resolved, scanOptions));
|
|
298
|
+
} else {
|
|
299
|
+
allFindings.push(...detectText(fs.readFileSync(resolved, 'utf-8'), resolved, scanOptions));
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
} finally {
|
|
304
|
+
if (browserDetector) await browserDetector.close();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
allFindings = filterDetectionFindings(allFindings, detectionConfig);
|
|
309
|
+
allFindings = filterByScopes(allFindings, scopes);
|
|
310
|
+
|
|
311
|
+
if (allFindings.length > 0) {
|
|
312
|
+
if (jsonMode) process.stdout.write(`${formatFindings(allFindings, true)}\n`);
|
|
313
|
+
else if (quietMode) process.stderr.write(`${formatFindingSummary(allFindings.length)}\n`);
|
|
314
|
+
else process.stderr.write(`${formatFindings(allFindings, false)}\n`);
|
|
315
|
+
process.exit(2);
|
|
316
|
+
}
|
|
317
|
+
if (jsonMode) process.stdout.write('[]\n');
|
|
318
|
+
process.exit(0);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export { formatFindings, handleStdin, confirm, printUsage, detectCli };
|