aios-core 2.1.0
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/.aios-core/.session/current-session.json +14 -0
- package/.aios-core/cli/commands/generate/index.js +222 -0
- package/.aios-core/cli/commands/manifest/index.js +46 -0
- package/.aios-core/cli/commands/manifest/regenerate.js +96 -0
- package/.aios-core/cli/commands/manifest/validate.js +66 -0
- package/.aios-core/cli/commands/mcp/add.js +234 -0
- package/.aios-core/cli/commands/mcp/index.js +76 -0
- package/.aios-core/cli/commands/mcp/link.js +217 -0
- package/.aios-core/cli/commands/mcp/setup.js +164 -0
- package/.aios-core/cli/commands/mcp/status.js +183 -0
- package/.aios-core/cli/commands/metrics/cleanup.js +91 -0
- package/.aios-core/cli/commands/metrics/index.js +65 -0
- package/.aios-core/cli/commands/metrics/record.js +154 -0
- package/.aios-core/cli/commands/metrics/seed.js +126 -0
- package/.aios-core/cli/commands/metrics/show.js +209 -0
- package/.aios-core/cli/commands/migrate/analyze.js +353 -0
- package/.aios-core/cli/commands/migrate/backup.js +352 -0
- package/.aios-core/cli/commands/migrate/execute.js +292 -0
- package/.aios-core/cli/commands/migrate/index.js +441 -0
- package/.aios-core/cli/commands/migrate/rollback.js +323 -0
- package/.aios-core/cli/commands/migrate/update-imports.js +396 -0
- package/.aios-core/cli/commands/migrate/validate.js +452 -0
- package/.aios-core/cli/commands/qa/index.js +56 -0
- package/.aios-core/cli/commands/qa/run.js +163 -0
- package/.aios-core/cli/commands/qa/status.js +195 -0
- package/.aios-core/cli/commands/workers/formatters/info-formatter.js +274 -0
- package/.aios-core/cli/commands/workers/formatters/list-table.js +265 -0
- package/.aios-core/cli/commands/workers/formatters/list-tree.js +159 -0
- package/.aios-core/cli/commands/workers/index.js +56 -0
- package/.aios-core/cli/commands/workers/info.js +194 -0
- package/.aios-core/cli/commands/workers/list.js +214 -0
- package/.aios-core/cli/commands/workers/search-filters.js +185 -0
- package/.aios-core/cli/commands/workers/search-keyword.js +310 -0
- package/.aios-core/cli/commands/workers/search-semantic.js +293 -0
- package/.aios-core/cli/commands/workers/search.js +154 -0
- package/.aios-core/cli/commands/workers/utils/pagination.js +102 -0
- package/.aios-core/cli/index.js +128 -0
- package/.aios-core/cli/utils/output-formatter-cli.js +232 -0
- package/.aios-core/cli/utils/score-calculator.js +221 -0
- package/.aios-core/core/README.md +229 -0
- package/.aios-core/core/config/config-cache.js +233 -0
- package/.aios-core/core/config/config-loader.js +277 -0
- package/.aios-core/core/data/agent-config-requirements.yaml +368 -0
- package/.aios-core/core/data/aios-kb.md +924 -0
- package/.aios-core/core/data/workflow-patterns.yaml +267 -0
- package/.aios-core/core/docs/SHARD-TRANSLATION-GUIDE.md +335 -0
- package/.aios-core/core/docs/component-creation-guide.md +458 -0
- package/.aios-core/core/docs/session-update-pattern.md +307 -0
- package/.aios-core/core/docs/template-syntax.md +267 -0
- package/.aios-core/core/docs/troubleshooting-guide.md +625 -0
- package/.aios-core/core/elicitation/agent-elicitation.js +272 -0
- package/.aios-core/core/elicitation/elicitation-engine.js +479 -0
- package/.aios-core/core/elicitation/session-manager.js +320 -0
- package/.aios-core/core/elicitation/task-elicitation.js +281 -0
- package/.aios-core/core/elicitation/workflow-elicitation.js +315 -0
- package/.aios-core/core/index.esm.js +42 -0
- package/.aios-core/core/index.js +76 -0
- package/.aios-core/core/manifest/manifest-generator.js +386 -0
- package/.aios-core/core/manifest/manifest-validator.js +429 -0
- package/.aios-core/core/mcp/config-migrator.js +340 -0
- package/.aios-core/core/mcp/global-config-manager.js +369 -0
- package/.aios-core/core/mcp/index.js +34 -0
- package/.aios-core/core/mcp/os-detector.js +188 -0
- package/.aios-core/core/mcp/symlink-manager.js +413 -0
- package/.aios-core/core/migration/migration-config.yaml +83 -0
- package/.aios-core/core/migration/module-mapping.yaml +89 -0
- package/.aios-core/core/quality-gates/base-layer.js +134 -0
- package/.aios-core/core/quality-gates/checklist-generator.js +329 -0
- package/.aios-core/core/quality-gates/focus-area-recommender.js +359 -0
- package/.aios-core/core/quality-gates/human-review-orchestrator.js +529 -0
- package/.aios-core/core/quality-gates/layer1-precommit.js +336 -0
- package/.aios-core/core/quality-gates/layer2-pr-automation.js +324 -0
- package/.aios-core/core/quality-gates/layer3-human-review.js +348 -0
- package/.aios-core/core/quality-gates/notification-manager.js +550 -0
- package/.aios-core/core/quality-gates/quality-gate-config.yaml +86 -0
- package/.aios-core/core/quality-gates/quality-gate-manager.js +601 -0
- package/.aios-core/core/registry/README.md +179 -0
- package/.aios-core/core/registry/build-registry.js +452 -0
- package/.aios-core/core/registry/registry-loader.js +330 -0
- package/.aios-core/core/registry/registry-schema.json +166 -0
- package/.aios-core/core/registry/service-registry.json +6586 -0
- package/.aios-core/core/registry/validate-registry.js +340 -0
- package/.aios-core/core/session/context-detector.js +229 -0
- package/.aios-core/core/session/context-loader.js +288 -0
- package/.aios-core/core/utils/output-formatter.js +298 -0
- package/.aios-core/core/utils/security-utils.js +333 -0
- package/.aios-core/core/utils/yaml-validator.js +419 -0
- package/.aios-core/core-config.yaml +382 -0
- package/.aios-core/data/agent-config-requirements.yaml +368 -0
- package/.aios-core/data/aios-kb.md +924 -0
- package/.aios-core/data/technical-preferences.md +4 -0
- package/.aios-core/data/workflow-patterns.yaml +267 -0
- package/.aios-core/development/README.md +142 -0
- package/.aios-core/development/agent-teams/team-all.yaml +15 -0
- package/.aios-core/development/agent-teams/team-fullstack.yaml +18 -0
- package/.aios-core/development/agent-teams/team-ide-minimal.yaml +10 -0
- package/.aios-core/development/agent-teams/team-no-ui.yaml +13 -0
- package/.aios-core/development/agent-teams/team-qa-focused.yaml +155 -0
- package/.aios-core/development/agents/aios-master.md +339 -0
- package/.aios-core/development/agents/analyst.md +195 -0
- package/.aios-core/development/agents/architect.md +359 -0
- package/.aios-core/development/agents/data-engineer.md +468 -0
- package/.aios-core/development/agents/dev.md +390 -0
- package/.aios-core/development/agents/devops.md +398 -0
- package/.aios-core/development/agents/pm.md +198 -0
- package/.aios-core/development/agents/po.md +256 -0
- package/.aios-core/development/agents/qa.md +312 -0
- package/.aios-core/development/agents/sm.md +220 -0
- package/.aios-core/development/agents/ux-design-expert.md +451 -0
- package/.aios-core/development/scripts/agent-assignment-resolver.js +231 -0
- package/.aios-core/development/scripts/agent-config-loader.js +624 -0
- package/.aios-core/development/scripts/agent-exit-hooks.js +96 -0
- package/.aios-core/development/scripts/apply-inline-greeting-all-agents.js +146 -0
- package/.aios-core/development/scripts/audit-agent-config.js +380 -0
- package/.aios-core/development/scripts/backlog-manager.js +404 -0
- package/.aios-core/development/scripts/batch-update-agents-session-context.js +95 -0
- package/.aios-core/development/scripts/decision-context.js +228 -0
- package/.aios-core/development/scripts/decision-log-generator.js +293 -0
- package/.aios-core/development/scripts/decision-log-indexer.js +284 -0
- package/.aios-core/development/scripts/decision-recorder.js +168 -0
- package/.aios-core/development/scripts/dev-context-loader.js +297 -0
- package/.aios-core/development/scripts/generate-greeting.js +160 -0
- package/.aios-core/development/scripts/greeting-builder.js +866 -0
- package/.aios-core/development/scripts/greeting-config-cli.js +85 -0
- package/.aios-core/development/scripts/greeting-preference-manager.js +145 -0
- package/.aios-core/development/scripts/migrate-task-to-v2.js +377 -0
- package/.aios-core/development/scripts/story-index-generator.js +337 -0
- package/.aios-core/development/scripts/story-manager.js +375 -0
- package/.aios-core/development/scripts/story-update-hook.js +259 -0
- package/.aios-core/development/scripts/task-identifier-resolver.js +145 -0
- package/.aios-core/development/scripts/test-greeting-system.js +142 -0
- package/.aios-core/development/scripts/validate-task-v2.js +319 -0
- package/.aios-core/development/scripts/workflow-navigator.js +214 -0
- package/.aios-core/development/tasks/add-mcp.md +319 -0
- package/.aios-core/development/tasks/advanced-elicitation.md +319 -0
- package/.aios-core/development/tasks/analyst-facilitate-brainstorming.md +342 -0
- package/.aios-core/development/tasks/analyze-framework.md +697 -0
- package/.aios-core/development/tasks/analyze-performance.md +637 -0
- package/.aios-core/development/tasks/apply-qa-fixes.md +340 -0
- package/.aios-core/development/tasks/architect-analyze-impact.md +827 -0
- package/.aios-core/development/tasks/audit-codebase.md +429 -0
- package/.aios-core/development/tasks/audit-tailwind-config.md +270 -0
- package/.aios-core/development/tasks/audit-utilities.md +358 -0
- package/.aios-core/development/tasks/bootstrap-shadcn-library.md +286 -0
- package/.aios-core/development/tasks/brownfield-create-epic.md +486 -0
- package/.aios-core/development/tasks/brownfield-create-story.md +357 -0
- package/.aios-core/development/tasks/build-component.md +478 -0
- package/.aios-core/development/tasks/calculate-roi.md +455 -0
- package/.aios-core/development/tasks/ci-cd-configuration.md +764 -0
- package/.aios-core/development/tasks/cleanup-utilities.md +670 -0
- package/.aios-core/development/tasks/collaborative-edit.md +1109 -0
- package/.aios-core/development/tasks/compose-molecule.md +284 -0
- package/.aios-core/development/tasks/consolidate-patterns.md +414 -0
- package/.aios-core/development/tasks/correct-course.md +280 -0
- package/.aios-core/development/tasks/create-agent.md +322 -0
- package/.aios-core/development/tasks/create-brownfield-story.md +727 -0
- package/.aios-core/development/tasks/create-deep-research-prompt.md +499 -0
- package/.aios-core/development/tasks/create-doc.md +316 -0
- package/.aios-core/development/tasks/create-next-story.md +774 -0
- package/.aios-core/development/tasks/create-suite.md +284 -0
- package/.aios-core/development/tasks/create-task.md +372 -0
- package/.aios-core/development/tasks/create-workflow.md +371 -0
- package/.aios-core/development/tasks/db-analyze-hotpaths.md +572 -0
- package/.aios-core/development/tasks/db-apply-migration.md +381 -0
- package/.aios-core/development/tasks/db-bootstrap.md +642 -0
- package/.aios-core/development/tasks/db-domain-modeling.md +693 -0
- package/.aios-core/development/tasks/db-dry-run.md +293 -0
- package/.aios-core/development/tasks/db-env-check.md +260 -0
- package/.aios-core/development/tasks/db-expansion-pack-integration.md +663 -0
- package/.aios-core/development/tasks/db-explain.md +631 -0
- package/.aios-core/development/tasks/db-impersonate.md +495 -0
- package/.aios-core/development/tasks/db-load-csv.md +593 -0
- package/.aios-core/development/tasks/db-policy-apply.md +653 -0
- package/.aios-core/development/tasks/db-rls-audit.md +411 -0
- package/.aios-core/development/tasks/db-rollback.md +739 -0
- package/.aios-core/development/tasks/db-run-sql.md +613 -0
- package/.aios-core/development/tasks/db-schema-audit.md +1011 -0
- package/.aios-core/development/tasks/db-seed.md +390 -0
- package/.aios-core/development/tasks/db-smoke-test.md +351 -0
- package/.aios-core/development/tasks/db-snapshot.md +569 -0
- package/.aios-core/development/tasks/db-supabase-setup.md +712 -0
- package/.aios-core/development/tasks/db-verify-order.md +515 -0
- package/.aios-core/development/tasks/deprecate-component.md +957 -0
- package/.aios-core/development/tasks/dev-apply-qa-fixes.md +318 -0
- package/.aios-core/development/tasks/dev-backlog-debt.md +469 -0
- package/.aios-core/development/tasks/dev-develop-story.md +846 -0
- package/.aios-core/development/tasks/dev-improve-code-quality.md +873 -0
- package/.aios-core/development/tasks/dev-optimize-performance.md +1034 -0
- package/.aios-core/development/tasks/dev-suggest-refactoring.md +871 -0
- package/.aios-core/development/tasks/dev-validate-next-story.md +349 -0
- package/.aios-core/development/tasks/document-project.md +553 -0
- package/.aios-core/development/tasks/environment-bootstrap.md +1311 -0
- package/.aios-core/development/tasks/execute-checklist.md +301 -0
- package/.aios-core/development/tasks/export-design-tokens-dtcg.md +274 -0
- package/.aios-core/development/tasks/extend-pattern.md +269 -0
- package/.aios-core/development/tasks/extract-tokens.md +467 -0
- package/.aios-core/development/tasks/facilitate-brainstorming-session.md +518 -0
- package/.aios-core/development/tasks/generate-ai-frontend-prompt.md +261 -0
- package/.aios-core/development/tasks/generate-documentation.md +284 -0
- package/.aios-core/development/tasks/generate-migration-strategy.md +522 -0
- package/.aios-core/development/tasks/generate-shock-report.md +501 -0
- package/.aios-core/development/tasks/github-devops-github-pr-automation.md +427 -0
- package/.aios-core/development/tasks/github-devops-pre-push-quality-gate.md +733 -0
- package/.aios-core/development/tasks/github-devops-repository-cleanup.md +374 -0
- package/.aios-core/development/tasks/github-devops-version-management.md +483 -0
- package/.aios-core/development/tasks/improve-self.md +823 -0
- package/.aios-core/development/tasks/index-docs.md +388 -0
- package/.aios-core/development/tasks/init-project-status.md +506 -0
- package/.aios-core/development/tasks/integrate-expansion-pack.md +314 -0
- package/.aios-core/development/tasks/kb-mode-interaction.md +284 -0
- package/.aios-core/development/tasks/learn-patterns.md +901 -0
- package/.aios-core/development/tasks/mcp-workflow.md +437 -0
- package/.aios-core/development/tasks/modify-agent.md +382 -0
- package/.aios-core/development/tasks/modify-task.md +425 -0
- package/.aios-core/development/tasks/modify-workflow.md +466 -0
- package/.aios-core/development/tasks/po-backlog-add.md +370 -0
- package/.aios-core/development/tasks/po-manage-story-backlog.md +523 -0
- package/.aios-core/development/tasks/po-pull-story-from-clickup.md +540 -0
- package/.aios-core/development/tasks/po-pull-story.md +316 -0
- package/.aios-core/development/tasks/po-stories-index.md +351 -0
- package/.aios-core/development/tasks/po-sync-story-to-clickup.md +457 -0
- package/.aios-core/development/tasks/po-sync-story.md +303 -0
- package/.aios-core/development/tasks/pr-automation.md +701 -0
- package/.aios-core/development/tasks/propose-modification.md +843 -0
- package/.aios-core/development/tasks/qa-backlog-add-followup.md +425 -0
- package/.aios-core/development/tasks/qa-gate.md +374 -0
- package/.aios-core/development/tasks/qa-generate-tests.md +1175 -0
- package/.aios-core/development/tasks/qa-nfr-assess.md +558 -0
- package/.aios-core/development/tasks/qa-review-proposal.md +1158 -0
- package/.aios-core/development/tasks/qa-review-story.md +683 -0
- package/.aios-core/development/tasks/qa-risk-profile.md +567 -0
- package/.aios-core/development/tasks/qa-run-tests.md +277 -0
- package/.aios-core/development/tasks/qa-test-design.md +388 -0
- package/.aios-core/development/tasks/qa-trace-requirements.md +477 -0
- package/.aios-core/development/tasks/release-management.md +723 -0
- package/.aios-core/development/tasks/security-audit.md +554 -0
- package/.aios-core/development/tasks/security-scan.md +790 -0
- package/.aios-core/development/tasks/setup-database.md +741 -0
- package/.aios-core/development/tasks/setup-design-system.md +462 -0
- package/.aios-core/development/tasks/setup-github.md +874 -0
- package/.aios-core/development/tasks/setup-llm-routing.md +229 -0
- package/.aios-core/development/tasks/setup-mcp-docker.md +584 -0
- package/.aios-core/development/tasks/shard-doc.md +538 -0
- package/.aios-core/development/tasks/sm-create-next-story.md +480 -0
- package/.aios-core/development/tasks/sync-documentation.md +865 -0
- package/.aios-core/development/tasks/tailwind-upgrade.md +294 -0
- package/.aios-core/development/tasks/test-as-user.md +621 -0
- package/.aios-core/development/tasks/test-validation-task.md +171 -0
- package/.aios-core/development/tasks/undo-last.md +347 -0
- package/.aios-core/development/tasks/update-manifest.md +410 -0
- package/.aios-core/development/tasks/ux-create-wireframe.md +617 -0
- package/.aios-core/development/tasks/ux-ds-scan-artifact.md +672 -0
- package/.aios-core/development/tasks/ux-user-research.md +559 -0
- package/.aios-core/development/tasks/validate-next-story.md +423 -0
- package/.aios-core/development/tasks/validate-structure.md +243 -0
- package/.aios-core/development/workflows/README.md +84 -0
- package/.aios-core/development/workflows/brownfield-fullstack.yaml +297 -0
- package/.aios-core/development/workflows/brownfield-service.yaml +187 -0
- package/.aios-core/development/workflows/brownfield-ui.yaml +197 -0
- package/.aios-core/development/workflows/greenfield-fullstack.yaml +333 -0
- package/.aios-core/development/workflows/greenfield-service.yaml +206 -0
- package/.aios-core/development/workflows/greenfield-ui.yaml +235 -0
- package/.aios-core/docs/SHARD-TRANSLATION-GUIDE.md +335 -0
- package/.aios-core/docs/component-creation-guide.md +458 -0
- package/.aios-core/docs/session-update-pattern.md +307 -0
- package/.aios-core/docs/standards/AGENT-PERSONALIZATION-STANDARD-V1.md +572 -0
- package/.aios-core/docs/standards/AIOS-COLOR-PALETTE-QUICK-REFERENCE.md +185 -0
- package/.aios-core/docs/standards/AIOS-COLOR-PALETTE-V2.1.md +354 -0
- package/.aios-core/docs/standards/AIOS-FRAMEWORK-MASTER.md +1963 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-COMPLETE.md +821 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-SUMMARY.md +1190 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1.md +439 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.2-SUMMARY.md +1339 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO.md +5398 -0
- package/.aios-core/docs/standards/EXECUTOR-DECISION-TREE.md +697 -0
- package/.aios-core/docs/standards/OPEN-SOURCE-VS-SERVICE-DIFFERENCES.md +511 -0
- package/.aios-core/docs/standards/QUALITY-GATES-SPECIFICATION.md +556 -0
- package/.aios-core/docs/standards/STANDARDS-INDEX.md +210 -0
- package/.aios-core/docs/standards/STORY-TEMPLATE-V2-SPECIFICATION.md +550 -0
- package/.aios-core/docs/standards/TASK-FORMAT-SPECIFICATION-V1.md +1414 -0
- package/.aios-core/docs/standards/V3-ARCHITECTURAL-DECISIONS.md +523 -0
- package/.aios-core/docs/template-syntax.md +267 -0
- package/.aios-core/docs/troubleshooting-guide.md +625 -0
- package/.aios-core/elicitation/agent-elicitation.js +272 -0
- package/.aios-core/elicitation/task-elicitation.js +281 -0
- package/.aios-core/elicitation/workflow-elicitation.js +315 -0
- package/.aios-core/index.d.ts +8 -0
- package/.aios-core/index.esm.js +16 -0
- package/.aios-core/index.js +16 -0
- package/.aios-core/infrastructure/README.md +126 -0
- package/.aios-core/infrastructure/index.js +199 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/README.md +59 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/clickup-adapter.js +345 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/github-adapter.js +392 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/jira-adapter.js +448 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/local-adapter.js +175 -0
- package/.aios-core/infrastructure/scripts/_archived/final-todo-count.js +122 -0
- package/.aios-core/infrastructure/scripts/_archived/fix-yaml-formatting.js +89 -0
- package/.aios-core/infrastructure/scripts/_archived/migration-generator.js +780 -0
- package/.aios-core/infrastructure/scripts/_archived/migration-path-generator.js +950 -0
- package/.aios-core/infrastructure/scripts/_archived/phase2-entrada-saida-errors.js +425 -0
- package/.aios-core/infrastructure/scripts/_archived/phase2-spot-check.js +132 -0
- package/.aios-core/infrastructure/scripts/_archived/phase3-tools-scripts-validation.js +381 -0
- package/.aios-core/infrastructure/scripts/_archived/phase4-metadata-performance.js +203 -0
- package/.aios-core/infrastructure/scripts/_archived/test-yaml-parsing.js +24 -0
- package/.aios-core/infrastructure/scripts/_archived/verify-yaml-fix.js +51 -0
- package/.aios-core/infrastructure/scripts/aios-validator.js +294 -0
- package/.aios-core/infrastructure/scripts/approval-workflow.js +643 -0
- package/.aios-core/infrastructure/scripts/atomic-layer-classifier.js +308 -0
- package/.aios-core/infrastructure/scripts/backup-manager.js +607 -0
- package/.aios-core/infrastructure/scripts/batch-creator.js +608 -0
- package/.aios-core/infrastructure/scripts/branch-manager.js +391 -0
- package/.aios-core/infrastructure/scripts/capability-analyzer.js +535 -0
- package/.aios-core/infrastructure/scripts/clickup-helpers.js +226 -0
- package/.aios-core/infrastructure/scripts/code-quality-improver.js +1312 -0
- package/.aios-core/infrastructure/scripts/commit-message-generator.js +850 -0
- package/.aios-core/infrastructure/scripts/component-generator.js +738 -0
- package/.aios-core/infrastructure/scripts/component-metadata.js +627 -0
- package/.aios-core/infrastructure/scripts/component-search.js +277 -0
- package/.aios-core/infrastructure/scripts/config-cache.js +322 -0
- package/.aios-core/infrastructure/scripts/config-loader.js +349 -0
- package/.aios-core/infrastructure/scripts/conflict-resolver.js +675 -0
- package/.aios-core/infrastructure/scripts/coverage-analyzer.js +882 -0
- package/.aios-core/infrastructure/scripts/dependency-analyzer.js +638 -0
- package/.aios-core/infrastructure/scripts/dependency-impact-analyzer.js +703 -0
- package/.aios-core/infrastructure/scripts/diff-generator.js +129 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/brownfield-analyzer.js +501 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/config-generator.js +329 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/deployment-config-loader.js +282 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/doc-generator.js +331 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/gitignore-generator.js +313 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/index.js +74 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/mode-detector.js +358 -0
- package/.aios-core/infrastructure/scripts/documentation-synchronizer.js +1432 -0
- package/.aios-core/infrastructure/scripts/framework-analyzer.js +746 -0
- package/.aios-core/infrastructure/scripts/git-config-detector.js +293 -0
- package/.aios-core/infrastructure/scripts/git-wrapper.js +443 -0
- package/.aios-core/infrastructure/scripts/improvement-engine.js +758 -0
- package/.aios-core/infrastructure/scripts/improvement-validator.js +710 -0
- package/.aios-core/infrastructure/scripts/llm-routing/install-llm-routing.js +267 -0
- package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-free.cmd +80 -0
- package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-free.sh +62 -0
- package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-max.cmd +26 -0
- package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-max.sh +18 -0
- package/.aios-core/infrastructure/scripts/modification-risk-assessment.js +970 -0
- package/.aios-core/infrastructure/scripts/modification-validator.js +555 -0
- package/.aios-core/infrastructure/scripts/output-formatter.js +297 -0
- package/.aios-core/infrastructure/scripts/performance-analyzer.js +758 -0
- package/.aios-core/infrastructure/scripts/performance-and-error-resolver.js +258 -0
- package/.aios-core/infrastructure/scripts/performance-optimizer.js +1902 -0
- package/.aios-core/infrastructure/scripts/performance-tracker.js +452 -0
- package/.aios-core/infrastructure/scripts/pm-adapter-factory.js +181 -0
- package/.aios-core/infrastructure/scripts/pm-adapter.js +134 -0
- package/.aios-core/infrastructure/scripts/project-status-loader.js +445 -0
- package/.aios-core/infrastructure/scripts/refactoring-suggester.js +1139 -0
- package/.aios-core/infrastructure/scripts/repository-detector.js +64 -0
- package/.aios-core/infrastructure/scripts/sandbox-tester.js +618 -0
- package/.aios-core/infrastructure/scripts/security-checker.js +359 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/index.js +375 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/manifest-generator.js +410 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/rules/naming-rules.yaml +285 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/rules/placement-rules.yaml +262 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/validator.js +468 -0
- package/.aios-core/infrastructure/scripts/spot-check-validator.js +149 -0
- package/.aios-core/infrastructure/scripts/status-mapper.js +115 -0
- package/.aios-core/infrastructure/scripts/template-engine.js +240 -0
- package/.aios-core/infrastructure/scripts/template-validator.js +279 -0
- package/.aios-core/infrastructure/scripts/test-generator.js +844 -0
- package/.aios-core/infrastructure/scripts/test-quality-assessment.js +1081 -0
- package/.aios-core/infrastructure/scripts/test-utilities-fast.js +126 -0
- package/.aios-core/infrastructure/scripts/test-utilities.js +200 -0
- package/.aios-core/infrastructure/scripts/tool-resolver.js +360 -0
- package/.aios-core/infrastructure/scripts/transaction-manager.js +590 -0
- package/.aios-core/infrastructure/scripts/usage-analytics.js +634 -0
- package/.aios-core/infrastructure/scripts/validate-output-pattern.js +213 -0
- package/.aios-core/infrastructure/scripts/visual-impact-generator.js +1056 -0
- package/.aios-core/infrastructure/scripts/yaml-validator.js +397 -0
- package/.aios-core/infrastructure/templates/coderabbit.yaml.template +279 -0
- package/.aios-core/infrastructure/templates/core-config/core-config-brownfield.tmpl.yaml +182 -0
- package/.aios-core/infrastructure/templates/core-config/core-config-greenfield.tmpl.yaml +127 -0
- package/.aios-core/infrastructure/templates/github-workflows/README.md +109 -0
- package/.aios-core/infrastructure/templates/github-workflows/ci.yml.template +169 -0
- package/.aios-core/infrastructure/templates/github-workflows/pr-automation.yml.template +330 -0
- package/.aios-core/infrastructure/templates/github-workflows/release.yml.template +196 -0
- package/.aios-core/infrastructure/templates/gitignore/gitignore-aios-base.tmpl +63 -0
- package/.aios-core/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +18 -0
- package/.aios-core/infrastructure/templates/gitignore/gitignore-node.tmpl +85 -0
- package/.aios-core/infrastructure/templates/gitignore/gitignore-python.tmpl +145 -0
- package/.aios-core/infrastructure/templates/project-docs/coding-standards-tmpl.md +346 -0
- package/.aios-core/infrastructure/templates/project-docs/source-tree-tmpl.md +177 -0
- package/.aios-core/infrastructure/templates/project-docs/tech-stack-tmpl.md +267 -0
- package/.aios-core/infrastructure/tests/project-status-loader.test.js +394 -0
- package/.aios-core/infrastructure/tests/regression-suite-v2.md +621 -0
- package/.aios-core/infrastructure/tests/utilities-audit-results.json +501 -0
- package/.aios-core/infrastructure/tests/validate-module.js +97 -0
- package/.aios-core/infrastructure/tools/README.md +222 -0
- package/.aios-core/infrastructure/tools/cli/github-cli.yaml +200 -0
- package/.aios-core/infrastructure/tools/cli/llm-routing.yaml +126 -0
- package/.aios-core/infrastructure/tools/cli/railway-cli.yaml +260 -0
- package/.aios-core/infrastructure/tools/cli/supabase-cli.yaml +224 -0
- package/.aios-core/infrastructure/tools/local/ffmpeg.yaml +261 -0
- package/.aios-core/infrastructure/tools/mcp/21st-dev-magic.yaml +127 -0
- package/.aios-core/infrastructure/tools/mcp/browser.yaml +103 -0
- package/.aios-core/infrastructure/tools/mcp/clickup.yaml +534 -0
- package/.aios-core/infrastructure/tools/mcp/context7.yaml +78 -0
- package/.aios-core/infrastructure/tools/mcp/desktop-commander.yaml +180 -0
- package/.aios-core/infrastructure/tools/mcp/exa.yaml +103 -0
- package/.aios-core/infrastructure/tools/mcp/google-workspace.yaml +930 -0
- package/.aios-core/infrastructure/tools/mcp/n8n.yaml +551 -0
- package/.aios-core/infrastructure/tools/mcp/supabase.yaml +808 -0
- package/.aios-core/install-manifest.yaml +347 -0
- package/.aios-core/manifests/agents.csv +1 -0
- package/.aios-core/manifests/schema/manifest-schema.json +190 -0
- package/.aios-core/manifests/tasks.csv +121 -0
- package/.aios-core/manifests/workers.csv +204 -0
- package/.aios-core/package.json +103 -0
- package/.aios-core/product/README.md +56 -0
- package/.aios-core/product/checklists/architect-checklist.md +444 -0
- package/.aios-core/product/checklists/change-checklist.md +183 -0
- package/.aios-core/product/checklists/database-design-checklist.md +119 -0
- package/.aios-core/product/checklists/dba-predeploy-checklist.md +97 -0
- package/.aios-core/product/checklists/dba-rollback-checklist.md +99 -0
- package/.aios-core/product/checklists/pm-checklist.md +376 -0
- package/.aios-core/product/checklists/po-master-checklist.md +442 -0
- package/.aios-core/product/checklists/pre-push-checklist.md +108 -0
- package/.aios-core/product/checklists/release-checklist.md +122 -0
- package/.aios-core/product/checklists/story-dod-checklist.md +102 -0
- package/.aios-core/product/checklists/story-draft-checklist.md +216 -0
- package/.aios-core/product/data/brainstorming-techniques.md +37 -0
- package/.aios-core/product/data/elicitation-methods.md +135 -0
- package/.aios-core/product/data/mode-selection-best-practices.md +471 -0
- package/.aios-core/product/data/test-levels-framework.md +149 -0
- package/.aios-core/product/data/test-priorities-matrix.md +175 -0
- package/.aios-core/product/templates/1mcp-config.yaml +225 -0
- package/.aios-core/product/templates/activation-instructions-inline-greeting.yaml +63 -0
- package/.aios-core/product/templates/activation-instructions-template.md +258 -0
- package/.aios-core/product/templates/adr.hbs +125 -0
- package/.aios-core/product/templates/agent-template.yaml +121 -0
- package/.aios-core/product/templates/architecture-tmpl.yaml +651 -0
- package/.aios-core/product/templates/brainstorming-output-tmpl.yaml +156 -0
- package/.aios-core/product/templates/brownfield-architecture-tmpl.yaml +476 -0
- package/.aios-core/product/templates/brownfield-prd-tmpl.yaml +280 -0
- package/.aios-core/product/templates/changelog-template.md +134 -0
- package/.aios-core/product/templates/command-rationalization-matrix.md +152 -0
- package/.aios-core/product/templates/competitor-analysis-tmpl.yaml +293 -0
- package/.aios-core/product/templates/component-react-tmpl.tsx +98 -0
- package/.aios-core/product/templates/dbdr.hbs +241 -0
- package/.aios-core/product/templates/design-story-tmpl.yaml +587 -0
- package/.aios-core/product/templates/ds-artifact-analysis.md +70 -0
- package/.aios-core/product/templates/engine/elicitation.js +298 -0
- package/.aios-core/product/templates/engine/index.js +308 -0
- package/.aios-core/product/templates/engine/loader.js +231 -0
- package/.aios-core/product/templates/engine/renderer.js +343 -0
- package/.aios-core/product/templates/engine/schemas/adr.schema.json +102 -0
- package/.aios-core/product/templates/engine/schemas/dbdr.schema.json +205 -0
- package/.aios-core/product/templates/engine/schemas/epic.schema.json +175 -0
- package/.aios-core/product/templates/engine/schemas/pmdr.schema.json +175 -0
- package/.aios-core/product/templates/engine/schemas/prd-v2.schema.json +300 -0
- package/.aios-core/product/templates/engine/schemas/prd.schema.json +152 -0
- package/.aios-core/product/templates/engine/schemas/story.schema.json +222 -0
- package/.aios-core/product/templates/engine/schemas/task.schema.json +154 -0
- package/.aios-core/product/templates/engine/validator.js +294 -0
- package/.aios-core/product/templates/epic.hbs +212 -0
- package/.aios-core/product/templates/eslintrc-security.json +32 -0
- package/.aios-core/product/templates/front-end-architecture-tmpl.yaml +206 -0
- package/.aios-core/product/templates/front-end-spec-tmpl.yaml +349 -0
- package/.aios-core/product/templates/fullstack-architecture-tmpl.yaml +805 -0
- package/.aios-core/product/templates/github-actions-cd.yml +212 -0
- package/.aios-core/product/templates/github-actions-ci.yml +172 -0
- package/.aios-core/product/templates/github-pr-template.md +67 -0
- package/.aios-core/product/templates/gordon-mcp.yaml +140 -0
- package/.aios-core/product/templates/ide-rules/antigravity-rules.md +115 -0
- package/.aios-core/product/templates/ide-rules/claude-rules.md +221 -0
- package/.aios-core/product/templates/ide-rules/cline-rules.md +84 -0
- package/.aios-core/product/templates/ide-rules/copilot-rules.md +92 -0
- package/.aios-core/product/templates/ide-rules/cursor-rules.md +115 -0
- package/.aios-core/product/templates/ide-rules/gemini-rules.md +85 -0
- package/.aios-core/product/templates/ide-rules/roo-rules.md +86 -0
- package/.aios-core/product/templates/ide-rules/trae-rules.md +104 -0
- package/.aios-core/product/templates/ide-rules/windsurf-rules.md +80 -0
- package/.aios-core/product/templates/index-strategy-tmpl.yaml +53 -0
- package/.aios-core/product/templates/market-research-tmpl.yaml +252 -0
- package/.aios-core/product/templates/mcp-workflow.js +271 -0
- package/.aios-core/product/templates/migration-plan-tmpl.yaml +1022 -0
- package/.aios-core/product/templates/migration-strategy-tmpl.md +524 -0
- package/.aios-core/product/templates/personalized-agent-template.md +258 -0
- package/.aios-core/product/templates/personalized-checklist-template.md +340 -0
- package/.aios-core/product/templates/personalized-task-template-v2.md +905 -0
- package/.aios-core/product/templates/personalized-task-template.md +344 -0
- package/.aios-core/product/templates/personalized-template-file.yaml +322 -0
- package/.aios-core/product/templates/personalized-workflow-template.yaml +460 -0
- package/.aios-core/product/templates/pmdr.hbs +186 -0
- package/.aios-core/product/templates/prd-tmpl.yaml +202 -0
- package/.aios-core/product/templates/prd-v2.0.hbs +216 -0
- package/.aios-core/product/templates/prd.hbs +201 -0
- package/.aios-core/product/templates/project-brief-tmpl.yaml +221 -0
- package/.aios-core/product/templates/qa-gate-tmpl.yaml +240 -0
- package/.aios-core/product/templates/rls-policies-tmpl.yaml +1203 -0
- package/.aios-core/product/templates/schema-design-tmpl.yaml +428 -0
- package/.aios-core/product/templates/shock-report-tmpl.html +502 -0
- package/.aios-core/product/templates/state-persistence-tmpl.yaml +219 -0
- package/.aios-core/product/templates/story-tmpl.yaml +332 -0
- package/.aios-core/product/templates/story.hbs +263 -0
- package/.aios-core/product/templates/task-execution-report.md +495 -0
- package/.aios-core/product/templates/task-template.md +123 -0
- package/.aios-core/product/templates/task.hbs +170 -0
- package/.aios-core/product/templates/tmpl-comment-on-examples.sql +158 -0
- package/.aios-core/product/templates/tmpl-migration-script.sql +91 -0
- package/.aios-core/product/templates/tmpl-rls-granular-policies.sql +104 -0
- package/.aios-core/product/templates/tmpl-rls-kiss-policy.sql +10 -0
- package/.aios-core/product/templates/tmpl-rls-roles.sql +135 -0
- package/.aios-core/product/templates/tmpl-rls-simple.sql +77 -0
- package/.aios-core/product/templates/tmpl-rls-tenant.sql +152 -0
- package/.aios-core/product/templates/tmpl-rollback-script.sql +77 -0
- package/.aios-core/product/templates/tmpl-seed-data.sql +140 -0
- package/.aios-core/product/templates/tmpl-smoke-test.sql +16 -0
- package/.aios-core/product/templates/tmpl-staging-copy-merge.sql +139 -0
- package/.aios-core/product/templates/tmpl-stored-proc.sql +140 -0
- package/.aios-core/product/templates/tmpl-trigger.sql +152 -0
- package/.aios-core/product/templates/tmpl-view-materialized.sql +133 -0
- package/.aios-core/product/templates/tmpl-view.sql +177 -0
- package/.aios-core/product/templates/token-exports-css-tmpl.css +240 -0
- package/.aios-core/product/templates/token-exports-tailwind-tmpl.js +395 -0
- package/.aios-core/product/templates/tokens-schema-tmpl.yaml +305 -0
- package/.aios-core/product/templates/workflow-template.yaml +134 -0
- package/.aios-core/quality/metrics-collector.js +572 -0
- package/.aios-core/quality/metrics-hook.js +260 -0
- package/.aios-core/quality/schemas/quality-metrics.schema.json +233 -0
- package/.aios-core/quality/seed-metrics.js +336 -0
- package/.aios-core/scripts/README.md +354 -0
- package/.aios-core/scripts/aios-doc-template.md +325 -0
- package/.aios-core/scripts/batch-migrate-phase1.ps1 +36 -0
- package/.aios-core/scripts/batch-migrate-phase2.ps1 +88 -0
- package/.aios-core/scripts/batch-migrate-phase3.ps1 +45 -0
- package/.aios-core/scripts/command-execution-hook.js +201 -0
- package/.aios-core/scripts/context-detector.js +226 -0
- package/.aios-core/scripts/elicitation-engine.js +385 -0
- package/.aios-core/scripts/elicitation-session-manager.js +300 -0
- package/.aios-core/scripts/migrate-framework-docs.sh +300 -0
- package/.aios-core/scripts/session-context-loader.js +286 -0
- package/.aios-core/scripts/test-template-system.js +941 -0
- package/.aios-core/scripts/validate-phase1.ps1 +35 -0
- package/.aios-core/scripts/workflow-management.md +69 -0
- package/.aios-core/tasks/find-component.md.legacy +391 -0
- package/.aios-core/tasks/generate-commit-message.md.legacy +426 -0
- package/.aios-core/tasks/generate-migration.md.legacy +382 -0
- package/.aios-core/tasks/rollback-modification.md.legacy +307 -0
- package/.aios-core/tasks/update-tests.md.legacy +283 -0
- package/.aios-core/user-guide.md +1413 -0
- package/.aios-core/working-in-the-brownfield.md +361 -0
- package/.claude/CLAUDE.md +221 -0
- package/LICENSE +48 -0
- package/README.md +703 -0
- package/bin/aios-init-old.js +532 -0
- package/bin/aios-init-v4.js +390 -0
- package/bin/aios-init.backup-v1.1.4.js +352 -0
- package/bin/aios-init.js +736 -0
- package/bin/aios-minimal.js +26 -0
- package/bin/aios.js +279 -0
- package/bin/migrate-pm-config.js +219 -0
- package/bin/modules/env-config.js +436 -0
- package/bin/modules/mcp-installer.js +383 -0
- package/bin/utils/install-errors.js +339 -0
- package/bin/utils/install-transaction.js +445 -0
- package/index.d.ts +19 -0
- package/index.esm.js +21 -0
- package/index.js +94 -0
- package/package.json +161 -0
- package/packages/installer/package.json +39 -0
- package/packages/installer/src/config/configure-environment.js +312 -0
- package/packages/installer/src/config/templates/core-config-template.js +183 -0
- package/packages/installer/src/config/templates/env-template.js +127 -0
- package/packages/installer/src/config/validation/config-validator.js +243 -0
- package/packages/installer/src/detection/detect-project-type.js +81 -0
- package/packages/installer/src/wizard/wizard.js +244 -0
- package/packages/installer/tests/integration/environment-configuration.test.js +328 -0
- package/packages/installer/tests/integration/wizard-detection.test.js +349 -0
- package/packages/installer/tests/unit/config-validator.test.js +315 -0
- package/packages/installer/tests/unit/detection/detect-project-type.test.js +401 -0
- package/packages/installer/tests/unit/env-template.test.js +185 -0
- package/src/config/ide-configs.js +189 -0
- package/src/installer/aios-core-installer.js +319 -0
- package/src/installer/dependency-installer.js +335 -0
- package/src/utils/aios-colors.js +234 -0
- package/src/wizard/feedback.js +218 -0
- package/src/wizard/ide-config-generator.js +488 -0
- package/src/wizard/ide-selector.js +84 -0
- package/src/wizard/index.js +589 -0
- package/src/wizard/questions.js +249 -0
- package/src/wizard/validation/index.js +120 -0
- package/src/wizard/validation/report-generator.js +269 -0
- package/src/wizard/validation/troubleshooting-system.js +346 -0
- package/src/wizard/validation/validators/config-validator.js +362 -0
- package/src/wizard/validation/validators/dependency-validator.js +333 -0
- package/src/wizard/validation/validators/file-structure-validator.js +181 -0
- package/src/wizard/validation/validators/mcp-health-checker.js +310 -0
- package/src/wizard/validators.js +274 -0
- package/templates/squad/LICENSE +21 -0
- package/templates/squad/README.md +37 -0
- package/templates/squad/agents/example-agent.yaml +36 -0
- package/templates/squad/package.json +19 -0
- package/templates/squad/squad.yaml +25 -0
- package/templates/squad/tasks/example-task.yaml +46 -0
- package/templates/squad/templates/example-template.md +24 -0
- package/templates/squad/tests/example-agent.test.js +53 -0
- package/templates/squad/workflows/example-workflow.yaml +54 -0
- package/tools/package-builder.js +35 -0
|
@@ -0,0 +1,1056 @@
|
|
|
1
|
+
const fs = require('fs').promises;
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Visual impact generator for AIOS-FULLSTACK framework
|
|
7
|
+
* Creates visual representations of impact analysis results
|
|
8
|
+
*/
|
|
9
|
+
class VisualImpactGenerator {
|
|
10
|
+
constructor(options = {}) {
|
|
11
|
+
this.rootPath = options.rootPath || process.cwd();
|
|
12
|
+
this.visualCache = new Map();
|
|
13
|
+
this.generationHistory = [];
|
|
14
|
+
this.visualTemplates = new Map();
|
|
15
|
+
this.initializeTemplates();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Initialize visual templates
|
|
20
|
+
*/
|
|
21
|
+
initializeTemplates() {
|
|
22
|
+
// ASCII graph templates for different visualization types
|
|
23
|
+
this.visualTemplates.set('impact_tree', {
|
|
24
|
+
root: '📦',
|
|
25
|
+
branch: '├──',
|
|
26
|
+
lastBranch: '└──',
|
|
27
|
+
vertical: '│',
|
|
28
|
+
horizontal: '─',
|
|
29
|
+
riskLevels: {
|
|
30
|
+
critical: '🔴',
|
|
31
|
+
high: '🟠',
|
|
32
|
+
medium: '🟡',
|
|
33
|
+
low: '🟢',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
this.visualTemplates.set('dependency_graph', {
|
|
38
|
+
target: '🎯',
|
|
39
|
+
component: '📄',
|
|
40
|
+
agent: '🤖',
|
|
41
|
+
workflow: '🔄',
|
|
42
|
+
task: '⚡',
|
|
43
|
+
util: '🔧',
|
|
44
|
+
connection: '→',
|
|
45
|
+
impact: {
|
|
46
|
+
critical: '‼️',
|
|
47
|
+
high: '❗',
|
|
48
|
+
medium: '⚠️',
|
|
49
|
+
low: 'ℹ️',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Generate comprehensive impact visualization
|
|
56
|
+
*/
|
|
57
|
+
async generateImpactVisualization(impactReport, options = {}) {
|
|
58
|
+
const visualId = `visual-${Date.now()}`;
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
console.log(chalk.blue('🎨 Generating visual impact representation...'));
|
|
62
|
+
|
|
63
|
+
const config = {
|
|
64
|
+
format: options.format || 'visual',
|
|
65
|
+
includeInteractive: options.includeInteractive || false,
|
|
66
|
+
maxNodes: options.maxNodes || 50,
|
|
67
|
+
showDetails: options.showDetails !== false,
|
|
68
|
+
colorScheme: options.colorScheme || 'default',
|
|
69
|
+
...options,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const visualization = {
|
|
73
|
+
visualId: visualId,
|
|
74
|
+
format: config.format,
|
|
75
|
+
timestamp: new Date().toISOString(),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Generate different visualization types based on format
|
|
79
|
+
switch (config.format) {
|
|
80
|
+
case 'visual':
|
|
81
|
+
case 'ascii':
|
|
82
|
+
visualization.asciiGraph = await this.generateAsciiVisualization(impactReport, config);
|
|
83
|
+
break;
|
|
84
|
+
case 'html':
|
|
85
|
+
visualization.htmlContent = await this.generateHtmlVisualization(impactReport, config);
|
|
86
|
+
visualization.asciiGraph = await this.generateAsciiVisualization(impactReport, config);
|
|
87
|
+
break;
|
|
88
|
+
case 'json':
|
|
89
|
+
visualization.jsonData = await this.generateJsonVisualization(impactReport, config);
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
visualization.asciiGraph = await this.generateAsciiVisualization(impactReport, config);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Generate impact summary
|
|
96
|
+
visualization.impactSummary = this.generateImpactSummary(impactReport);
|
|
97
|
+
|
|
98
|
+
// Generate component relationship map
|
|
99
|
+
visualization.relationshipMap = await this.generateRelationshipMap(impactReport, config);
|
|
100
|
+
|
|
101
|
+
// Generate risk heatmap
|
|
102
|
+
visualization.riskHeatmap = this.generateRiskHeatmap(impactReport, config);
|
|
103
|
+
|
|
104
|
+
// Cache the visualization
|
|
105
|
+
this.visualCache.set(visualId, visualization);
|
|
106
|
+
|
|
107
|
+
// Add to generation history
|
|
108
|
+
this.generationHistory.push({
|
|
109
|
+
visualId: visualId,
|
|
110
|
+
targetComponent: impactReport.targetComponent.path,
|
|
111
|
+
format: config.format,
|
|
112
|
+
componentsVisualized: impactReport.dependencyAnalysis.affectedComponents.length,
|
|
113
|
+
timestamp: visualization.timestamp,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
console.log(chalk.green('✅ Visual impact representation generated'));
|
|
117
|
+
console.log(chalk.gray(` Format: ${config.format}`));
|
|
118
|
+
console.log(chalk.gray(` Components visualized: ${impactReport.dependencyAnalysis.affectedComponents.length}`));
|
|
119
|
+
|
|
120
|
+
return visualization;
|
|
121
|
+
|
|
122
|
+
} catch (error) {
|
|
123
|
+
console.error(chalk.red(`Visual generation failed: ${error.message}`));
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Generate ASCII-based visualization
|
|
130
|
+
*/
|
|
131
|
+
async generateAsciiVisualization(impactReport, config) {
|
|
132
|
+
const lines = [];
|
|
133
|
+
const template = this.visualTemplates.get('impact_tree');
|
|
134
|
+
|
|
135
|
+
// Header
|
|
136
|
+
lines.push('');
|
|
137
|
+
lines.push('📊 IMPACT ANALYSIS VISUALIZATION');
|
|
138
|
+
lines.push('═'.repeat(50));
|
|
139
|
+
lines.push('');
|
|
140
|
+
|
|
141
|
+
// Target component
|
|
142
|
+
const targetIcon = this.getComponentIcon(impactReport.targetComponent.type);
|
|
143
|
+
const riskIcon = template.riskLevels[impactReport.riskAssessment.overallRisk] || '⚪';
|
|
144
|
+
|
|
145
|
+
lines.push(`${targetIcon} Target Component: ${impactReport.targetComponent.path}`);
|
|
146
|
+
lines.push(`${riskIcon} Risk Level: ${impactReport.riskAssessment.overallRisk.toUpperCase()}`);
|
|
147
|
+
lines.push(`🔄 Modification: ${impactReport.modificationType}`);
|
|
148
|
+
lines.push('');
|
|
149
|
+
|
|
150
|
+
// Impact summary
|
|
151
|
+
lines.push('📈 IMPACT SUMMARY');
|
|
152
|
+
lines.push('─'.repeat(30));
|
|
153
|
+
const summary = impactReport.summary;
|
|
154
|
+
lines.push(`Affected Components: ${summary.affectedComponents}`);
|
|
155
|
+
lines.push(`Propagation Depth: ${summary.propagationDepth}`);
|
|
156
|
+
lines.push(`Critical Issues: ${summary.criticalIssues}`);
|
|
157
|
+
lines.push('');
|
|
158
|
+
|
|
159
|
+
// Dependency tree
|
|
160
|
+
if (impactReport.dependencyAnalysis.affectedComponents.length > 0) {
|
|
161
|
+
lines.push('🌳 DEPENDENCY IMPACT TREE');
|
|
162
|
+
lines.push('─'.repeat(30));
|
|
163
|
+
|
|
164
|
+
const dependencyTree = this.buildDependencyTree(impactReport.dependencyAnalysis.affectedComponents);
|
|
165
|
+
const treeLines = this.renderDependencyTree(dependencyTree, config);
|
|
166
|
+
lines.push(...treeLines);
|
|
167
|
+
lines.push('');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Risk breakdown
|
|
171
|
+
if (impactReport.riskAssessment.riskFactors.length > 0) {
|
|
172
|
+
lines.push('⚠️ RISK BREAKDOWN');
|
|
173
|
+
lines.push('─'.repeat(30));
|
|
174
|
+
|
|
175
|
+
impactReport.riskAssessment.riskFactors.slice(0, 8).forEach(factor => {
|
|
176
|
+
const riskIcon = this.getRiskIcon(factor.severity);
|
|
177
|
+
lines.push(`${riskIcon} ${factor.category}: ${factor.description}`);
|
|
178
|
+
if (factor.factors.length > 0) {
|
|
179
|
+
factor.factors.slice(0, 2).forEach(f => {
|
|
180
|
+
lines.push(` • ${f}`);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
lines.push('');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Propagation paths
|
|
188
|
+
if (impactReport.propagationAnalysis.criticalPaths?.length > 0) {
|
|
189
|
+
lines.push('🛤️ CRITICAL PROPAGATION PATHS');
|
|
190
|
+
lines.push('─'.repeat(30));
|
|
191
|
+
|
|
192
|
+
impactReport.propagationAnalysis.criticalPaths.slice(0, 3).forEach((path, index) => {
|
|
193
|
+
lines.push(`Path ${index + 1}: Impact ${path.totalImpact}/10, Depth ${path.maxDepth}`);
|
|
194
|
+
if (path.effects && path.effects.length > 0) {
|
|
195
|
+
path.effects.slice(0, 3).forEach(effect => {
|
|
196
|
+
const componentIcon = this.getComponentIcon(effect.affectedComponentType);
|
|
197
|
+
lines.push(` ${componentIcon} ${effect.affectedComponent}`);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
lines.push('');
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Recommendations
|
|
205
|
+
if (impactReport.riskAssessment.recommendations.length > 0) {
|
|
206
|
+
lines.push('💡 KEY RECOMMENDATIONS');
|
|
207
|
+
lines.push('─'.repeat(30));
|
|
208
|
+
|
|
209
|
+
impactReport.riskAssessment.recommendations.slice(0, 5).forEach((rec, index) => {
|
|
210
|
+
const priorityIcon = this.getPriorityIcon(rec.priority);
|
|
211
|
+
lines.push(`${priorityIcon} ${index + 1}. ${rec.title}`);
|
|
212
|
+
lines.push(` ${rec.description}`);
|
|
213
|
+
lines.push('');
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Footer
|
|
218
|
+
lines.push('═'.repeat(50));
|
|
219
|
+
lines.push(`Generated: ${new Date().toLocaleString()}`);
|
|
220
|
+
lines.push('');
|
|
221
|
+
|
|
222
|
+
return lines.join('\n');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Generate HTML visualization
|
|
227
|
+
*/
|
|
228
|
+
async generateHtmlVisualization(impactReport, config) {
|
|
229
|
+
const htmlTemplate = `
|
|
230
|
+
<!DOCTYPE html>
|
|
231
|
+
<html lang="en">
|
|
232
|
+
<head>
|
|
233
|
+
<meta charset="UTF-8">
|
|
234
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
235
|
+
<title>Impact Analysis - ${impactReport.targetComponent.path}</title>
|
|
236
|
+
<style>
|
|
237
|
+
body {
|
|
238
|
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
239
|
+
margin: 0;
|
|
240
|
+
padding: 20px;
|
|
241
|
+
background-color: #f5f7fa;
|
|
242
|
+
color: #333;
|
|
243
|
+
}
|
|
244
|
+
.container {
|
|
245
|
+
max-width: 1200px;
|
|
246
|
+
margin: 0 auto;
|
|
247
|
+
background: white;
|
|
248
|
+
border-radius: 12px;
|
|
249
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
250
|
+
overflow: hidden;
|
|
251
|
+
}
|
|
252
|
+
.header {
|
|
253
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
254
|
+
color: white;
|
|
255
|
+
padding: 30px;
|
|
256
|
+
text-align: center;
|
|
257
|
+
}
|
|
258
|
+
.header h1 {
|
|
259
|
+
margin: 0;
|
|
260
|
+
font-size: 2.5em;
|
|
261
|
+
font-weight: 300;
|
|
262
|
+
}
|
|
263
|
+
.header .subtitle {
|
|
264
|
+
margin: 10px 0 0 0;
|
|
265
|
+
opacity: 0.9;
|
|
266
|
+
font-size: 1.1em;
|
|
267
|
+
}
|
|
268
|
+
.risk-badge {
|
|
269
|
+
display: inline-block;
|
|
270
|
+
padding: 8px 16px;
|
|
271
|
+
border-radius: 20px;
|
|
272
|
+
font-weight: bold;
|
|
273
|
+
margin: 10px 5px 0 5px;
|
|
274
|
+
font-size: 0.9em;
|
|
275
|
+
}
|
|
276
|
+
.risk-low { background-color: #d4edda; color: #155724; }
|
|
277
|
+
.risk-medium { background-color: #fff3cd; color: #856404; }
|
|
278
|
+
.risk-high { background-color: #f8d7da; color: #721c24; }
|
|
279
|
+
.risk-critical { background-color: #721c24; color: white; }
|
|
280
|
+
.content {
|
|
281
|
+
padding: 30px;
|
|
282
|
+
}
|
|
283
|
+
.section {
|
|
284
|
+
margin-bottom: 40px;
|
|
285
|
+
}
|
|
286
|
+
.section h2 {
|
|
287
|
+
color: #4a5568;
|
|
288
|
+
border-bottom: 2px solid #e2e8f0;
|
|
289
|
+
padding-bottom: 10px;
|
|
290
|
+
margin-bottom: 20px;
|
|
291
|
+
}
|
|
292
|
+
.stats-grid {
|
|
293
|
+
display: grid;
|
|
294
|
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
295
|
+
gap: 20px;
|
|
296
|
+
margin-bottom: 30px;
|
|
297
|
+
}
|
|
298
|
+
.stat-card {
|
|
299
|
+
background: #f7fafc;
|
|
300
|
+
padding: 20px;
|
|
301
|
+
border-radius: 8px;
|
|
302
|
+
text-align: center;
|
|
303
|
+
border-left: 4px solid #667eea;
|
|
304
|
+
}
|
|
305
|
+
.stat-card .number {
|
|
306
|
+
font-size: 2em;
|
|
307
|
+
font-weight: bold;
|
|
308
|
+
color: #667eea;
|
|
309
|
+
margin-bottom: 5px;
|
|
310
|
+
}
|
|
311
|
+
.stat-card .label {
|
|
312
|
+
color: #718096;
|
|
313
|
+
font-size: 0.9em;
|
|
314
|
+
}
|
|
315
|
+
.component-list {
|
|
316
|
+
max-height: 400px;
|
|
317
|
+
overflow-y: auto;
|
|
318
|
+
border: 1px solid #e2e8f0;
|
|
319
|
+
border-radius: 8px;
|
|
320
|
+
}
|
|
321
|
+
.component-item {
|
|
322
|
+
padding: 15px;
|
|
323
|
+
border-bottom: 1px solid #e2e8f0;
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
justify-content: space-between;
|
|
327
|
+
transition: background-color 0.2s;
|
|
328
|
+
}
|
|
329
|
+
.component-item:hover {
|
|
330
|
+
background-color: #f7fafc;
|
|
331
|
+
}
|
|
332
|
+
.component-item:last-child {
|
|
333
|
+
border-bottom: none;
|
|
334
|
+
}
|
|
335
|
+
.component-info {
|
|
336
|
+
flex: 1;
|
|
337
|
+
}
|
|
338
|
+
.component-name {
|
|
339
|
+
font-weight: 600;
|
|
340
|
+
color: #2d3748;
|
|
341
|
+
margin-bottom: 5px;
|
|
342
|
+
}
|
|
343
|
+
.component-description {
|
|
344
|
+
color: #718096;
|
|
345
|
+
font-size: 0.9em;
|
|
346
|
+
}
|
|
347
|
+
.impact-score {
|
|
348
|
+
background: #667eea;
|
|
349
|
+
color: white;
|
|
350
|
+
padding: 4px 12px;
|
|
351
|
+
border-radius: 20px;
|
|
352
|
+
font-weight: bold;
|
|
353
|
+
font-size: 0.8em;
|
|
354
|
+
}
|
|
355
|
+
.recommendations {
|
|
356
|
+
background: #f0fff4;
|
|
357
|
+
border-left: 4px solid #38a169;
|
|
358
|
+
padding: 20px;
|
|
359
|
+
border-radius: 0 8px 8px 0;
|
|
360
|
+
}
|
|
361
|
+
.recommendation {
|
|
362
|
+
margin-bottom: 15px;
|
|
363
|
+
padding-bottom: 15px;
|
|
364
|
+
border-bottom: 1px solid #c6f6d5;
|
|
365
|
+
}
|
|
366
|
+
.recommendation:last-child {
|
|
367
|
+
margin-bottom: 0;
|
|
368
|
+
padding-bottom: 0;
|
|
369
|
+
border-bottom: none;
|
|
370
|
+
}
|
|
371
|
+
.recommendation-title {
|
|
372
|
+
font-weight: 600;
|
|
373
|
+
color: #2f855a;
|
|
374
|
+
margin-bottom: 5px;
|
|
375
|
+
}
|
|
376
|
+
.recommendation-desc {
|
|
377
|
+
color: #276749;
|
|
378
|
+
font-size: 0.95em;
|
|
379
|
+
}
|
|
380
|
+
.risk-factors {
|
|
381
|
+
display: grid;
|
|
382
|
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
383
|
+
gap: 15px;
|
|
384
|
+
}
|
|
385
|
+
.risk-factor {
|
|
386
|
+
background: white;
|
|
387
|
+
border: 1px solid #e2e8f0;
|
|
388
|
+
border-radius: 8px;
|
|
389
|
+
padding: 15px;
|
|
390
|
+
}
|
|
391
|
+
.risk-factor-header {
|
|
392
|
+
display: flex;
|
|
393
|
+
align-items: center;
|
|
394
|
+
justify-content: between;
|
|
395
|
+
margin-bottom: 10px;
|
|
396
|
+
}
|
|
397
|
+
.risk-factor-name {
|
|
398
|
+
font-weight: 600;
|
|
399
|
+
color: #2d3748;
|
|
400
|
+
}
|
|
401
|
+
.risk-factor-score {
|
|
402
|
+
background: #fed7d7;
|
|
403
|
+
color: #c53030;
|
|
404
|
+
padding: 2px 8px;
|
|
405
|
+
border-radius: 12px;
|
|
406
|
+
font-size: 0.8em;
|
|
407
|
+
font-weight: bold;
|
|
408
|
+
margin-left: auto;
|
|
409
|
+
}
|
|
410
|
+
.risk-factor-desc {
|
|
411
|
+
color: #718096;
|
|
412
|
+
font-size: 0.9em;
|
|
413
|
+
margin-bottom: 10px;
|
|
414
|
+
}
|
|
415
|
+
.risk-factor-list {
|
|
416
|
+
list-style: none;
|
|
417
|
+
padding: 0;
|
|
418
|
+
margin: 0;
|
|
419
|
+
}
|
|
420
|
+
.risk-factor-list li {
|
|
421
|
+
color: #4a5568;
|
|
422
|
+
font-size: 0.85em;
|
|
423
|
+
margin-bottom: 5px;
|
|
424
|
+
padding-left: 15px;
|
|
425
|
+
position: relative;
|
|
426
|
+
}
|
|
427
|
+
.risk-factor-list li:before {
|
|
428
|
+
content: "•";
|
|
429
|
+
color: #e53e3e;
|
|
430
|
+
position: absolute;
|
|
431
|
+
left: 0;
|
|
432
|
+
}
|
|
433
|
+
.footer {
|
|
434
|
+
background: #f7fafc;
|
|
435
|
+
padding: 20px 30px;
|
|
436
|
+
text-align: center;
|
|
437
|
+
color: #718096;
|
|
438
|
+
font-size: 0.9em;
|
|
439
|
+
}
|
|
440
|
+
${config.includeInteractive ? this.getInteractiveStyles() : ''}
|
|
441
|
+
</style>
|
|
442
|
+
${config.includeInteractive ? this.getInteractiveScripts() : ''}
|
|
443
|
+
</head>
|
|
444
|
+
<body>
|
|
445
|
+
<div class="container">
|
|
446
|
+
<div class="header">
|
|
447
|
+
<h1>Impact Analysis Report</h1>
|
|
448
|
+
<div class="subtitle">${impactReport.targetComponent.path}</div>
|
|
449
|
+
<div class="risk-badge risk-${impactReport.riskAssessment.overallRisk}">
|
|
450
|
+
${impactReport.riskAssessment.overallRisk.toUpperCase()} RISK
|
|
451
|
+
</div>
|
|
452
|
+
<div class="risk-badge" style="background-color: #4299e1; color: white;">
|
|
453
|
+
${impactReport.modificationType.toUpperCase()}
|
|
454
|
+
</div>
|
|
455
|
+
</div>
|
|
456
|
+
|
|
457
|
+
<div class="content">
|
|
458
|
+
<div class="section">
|
|
459
|
+
<div class="stats-grid">
|
|
460
|
+
<div class="stat-card">
|
|
461
|
+
<div class="number">${impactReport.summary.affectedComponents}</div>
|
|
462
|
+
<div class="label">Affected Components</div>
|
|
463
|
+
</div>
|
|
464
|
+
<div class="stat-card">
|
|
465
|
+
<div class="number">${impactReport.summary.propagationDepth}</div>
|
|
466
|
+
<div class="label">Propagation Depth</div>
|
|
467
|
+
</div>
|
|
468
|
+
<div class="stat-card">
|
|
469
|
+
<div class="number">${impactReport.summary.criticalIssues}</div>
|
|
470
|
+
<div class="label">Critical Issues</div>
|
|
471
|
+
</div>
|
|
472
|
+
<div class="stat-card">
|
|
473
|
+
<div class="number">${impactReport.riskAssessment.riskScore.toFixed(1)}</div>
|
|
474
|
+
<div class="label">Risk Score</div>
|
|
475
|
+
</div>
|
|
476
|
+
</div>
|
|
477
|
+
</div>
|
|
478
|
+
|
|
479
|
+
<div class="section">
|
|
480
|
+
<h2>🔗 Affected Components</h2>
|
|
481
|
+
<div class="component-list">
|
|
482
|
+
${this.generateComponentListHtml(impactReport.dependencyAnalysis.affectedComponents)}
|
|
483
|
+
</div>
|
|
484
|
+
</div>
|
|
485
|
+
|
|
486
|
+
<div class="section">
|
|
487
|
+
<h2>⚠️ Risk Factors</h2>
|
|
488
|
+
<div class="risk-factors">
|
|
489
|
+
${this.generateRiskFactorsHtml(impactReport.riskAssessment.riskFactors)}
|
|
490
|
+
</div>
|
|
491
|
+
</div>
|
|
492
|
+
|
|
493
|
+
<div class="section">
|
|
494
|
+
<h2>💡 Recommendations</h2>
|
|
495
|
+
<div class="recommendations">
|
|
496
|
+
${this.generateRecommendationsHtml(impactReport.riskAssessment.recommendations)}
|
|
497
|
+
</div>
|
|
498
|
+
</div>
|
|
499
|
+
</div>
|
|
500
|
+
|
|
501
|
+
<div class="footer">
|
|
502
|
+
Generated on ${new Date().toLocaleString()} | AIOS-FULLSTACK Impact Analysis
|
|
503
|
+
</div>
|
|
504
|
+
</div>
|
|
505
|
+
</body>
|
|
506
|
+
</html>`;
|
|
507
|
+
|
|
508
|
+
return htmlTemplate;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Generate JSON visualization data
|
|
513
|
+
*/
|
|
514
|
+
async generateJsonVisualization(impactReport, config) {
|
|
515
|
+
return {
|
|
516
|
+
metadata: {
|
|
517
|
+
visualizationType: 'impact_analysis',
|
|
518
|
+
targetComponent: impactReport.targetComponent,
|
|
519
|
+
generatedAt: new Date().toISOString(),
|
|
520
|
+
riskLevel: impactReport.riskAssessment.overallRisk,
|
|
521
|
+
},
|
|
522
|
+
nodes: this.generateNodes(impactReport),
|
|
523
|
+
edges: this.generateEdges(impactReport),
|
|
524
|
+
clusters: this.generateClusters(impactReport),
|
|
525
|
+
riskHeatmap: this.generateRiskHeatmap(impactReport, config),
|
|
526
|
+
timeline: this.generateTimelineData(impactReport),
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Generate impact summary visualization
|
|
532
|
+
*/
|
|
533
|
+
generateImpactSummary(impactReport) {
|
|
534
|
+
return {
|
|
535
|
+
target: {
|
|
536
|
+
name: impactReport.targetComponent.path,
|
|
537
|
+
type: impactReport.targetComponent.type,
|
|
538
|
+
modification: impactReport.modificationType,
|
|
539
|
+
},
|
|
540
|
+
metrics: {
|
|
541
|
+
overall_risk: impactReport.riskAssessment.overallRisk,
|
|
542
|
+
risk_score: impactReport.riskAssessment.riskScore,
|
|
543
|
+
affected_components: impactReport.summary.affectedComponents,
|
|
544
|
+
propagation_depth: impactReport.summary.propagationDepth,
|
|
545
|
+
critical_issues: impactReport.summary.criticalIssues,
|
|
546
|
+
},
|
|
547
|
+
distribution: {
|
|
548
|
+
risk_levels: this.calculateRiskDistribution(impactReport),
|
|
549
|
+
component_types: this.calculateComponentTypeDistribution(impactReport),
|
|
550
|
+
impact_categories: this.calculateImpactCategoryDistribution(impactReport),
|
|
551
|
+
},
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Generate component relationship map
|
|
557
|
+
*/
|
|
558
|
+
async generateRelationshipMap(impactReport, config) {
|
|
559
|
+
const map = {
|
|
560
|
+
target: impactReport.targetComponent.path,
|
|
561
|
+
relationships: [],
|
|
562
|
+
clusters: [],
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
// Direct relationships
|
|
566
|
+
impactReport.dependencyAnalysis.affectedComponents.forEach(component => {
|
|
567
|
+
map.relationships.push({
|
|
568
|
+
source: impactReport.targetComponent.path,
|
|
569
|
+
target: component.path,
|
|
570
|
+
type: component.dependencyType || 'dependency',
|
|
571
|
+
impact: component.impactScore,
|
|
572
|
+
risk: component.severity,
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
// Propagation relationships
|
|
577
|
+
if (impactReport.propagationAnalysis.directEffects) {
|
|
578
|
+
impactReport.propagationAnalysis.directEffects.forEach(effect => {
|
|
579
|
+
map.relationships.push({
|
|
580
|
+
source: effect.targetComponent,
|
|
581
|
+
target: effect.affectedComponent,
|
|
582
|
+
type: 'propagation',
|
|
583
|
+
impact: effect.impact,
|
|
584
|
+
confidence: effect.confidence,
|
|
585
|
+
});
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
// Component type clusters
|
|
590
|
+
const typeGroups = {};
|
|
591
|
+
impactReport.dependencyAnalysis.affectedComponents.forEach(component => {
|
|
592
|
+
if (!typeGroups[component.type]) {
|
|
593
|
+
typeGroups[component.type] = [];
|
|
594
|
+
}
|
|
595
|
+
typeGroups[component.type].push(component.path);
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
Object.entries(typeGroups).forEach(([type, components]) => {
|
|
599
|
+
map.clusters.push({
|
|
600
|
+
id: `cluster_${type}`,
|
|
601
|
+
type: type,
|
|
602
|
+
components: components,
|
|
603
|
+
size: components.length,
|
|
604
|
+
});
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
return map;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Generate risk heatmap
|
|
612
|
+
*/
|
|
613
|
+
generateRiskHeatmap(impactReport, config) {
|
|
614
|
+
const heatmap = {
|
|
615
|
+
dimensions: [],
|
|
616
|
+
components: [],
|
|
617
|
+
riskMatrix: [],
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
// Risk dimensions from risk assessment
|
|
621
|
+
if (impactReport.riskAssessment.riskDimensions) {
|
|
622
|
+
Object.entries(impactReport.riskAssessment.riskDimensions).forEach(([dimension, data]) => {
|
|
623
|
+
heatmap.dimensions.push({
|
|
624
|
+
name: dimension,
|
|
625
|
+
score: data.score,
|
|
626
|
+
severity: data.severity,
|
|
627
|
+
description: data.description,
|
|
628
|
+
});
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// Component risk scores
|
|
633
|
+
impactReport.dependencyAnalysis.affectedComponents.slice(0, 20).forEach(component => {
|
|
634
|
+
heatmap.components.push({
|
|
635
|
+
name: component.path,
|
|
636
|
+
type: component.type,
|
|
637
|
+
impactScore: component.impactScore,
|
|
638
|
+
severity: component.severity,
|
|
639
|
+
riskLevel: this.scoresToRiskLevel(component.impactScore),
|
|
640
|
+
});
|
|
641
|
+
});
|
|
642
|
+
|
|
643
|
+
// Risk matrix (dimensions vs components)
|
|
644
|
+
heatmap.riskMatrix = this.calculateRiskMatrix(impactReport);
|
|
645
|
+
|
|
646
|
+
return heatmap;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// Helper methods for visualization generation
|
|
650
|
+
|
|
651
|
+
buildDependencyTree(affectedComponents) {
|
|
652
|
+
const tree = { name: 'Impact Tree', children: [] };
|
|
653
|
+
|
|
654
|
+
// Group by impact level
|
|
655
|
+
const byImpact = {
|
|
656
|
+
critical: affectedComponents.filter(c => c.impactScore >= 9),
|
|
657
|
+
high: affectedComponents.filter(c => c.impactScore >= 7 && c.impactScore < 9),
|
|
658
|
+
medium: affectedComponents.filter(c => c.impactScore >= 4 && c.impactScore < 7),
|
|
659
|
+
low: affectedComponents.filter(c => c.impactScore < 4),
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
Object.entries(byImpact).forEach(([level, components]) => {
|
|
663
|
+
if (components.length > 0) {
|
|
664
|
+
const levelNode = {
|
|
665
|
+
name: `${level.toUpperCase()} Impact (${components.length})`,
|
|
666
|
+
level: level,
|
|
667
|
+
children: components.slice(0, 10).map(c => ({
|
|
668
|
+
name: c.path,
|
|
669
|
+
type: c.type,
|
|
670
|
+
score: c.impactScore,
|
|
671
|
+
reason: c.reason,
|
|
672
|
+
})),
|
|
673
|
+
};
|
|
674
|
+
tree.children.push(levelNode);
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
return tree;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
renderDependencyTree(tree, config, depth = 0, isLast = true) {
|
|
682
|
+
const lines = [];
|
|
683
|
+
const template = this.visualTemplates.get('impact_tree');
|
|
684
|
+
const indent = ' '.repeat(depth);
|
|
685
|
+
const connector = isLast ? template.lastBranch : template.branch;
|
|
686
|
+
|
|
687
|
+
if (depth === 0) {
|
|
688
|
+
lines.push(`${template.root} ${tree.name}`);
|
|
689
|
+
} else {
|
|
690
|
+
const icon = tree.level ? this.getRiskIcon(tree.level) : this.getComponentIcon(tree.type);
|
|
691
|
+
const scoreText = tree.score ? ` (${tree.score}/10)` : '';
|
|
692
|
+
lines.push(`${indent}${connector} ${icon} ${tree.name}${scoreText}`);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
if (tree.children) {
|
|
696
|
+
tree.children.forEach((child, index) => {
|
|
697
|
+
const childIsLast = index === tree.children.length - 1;
|
|
698
|
+
const childLines = this.renderDependencyTree(child, config, depth + 1, childIsLast);
|
|
699
|
+
lines.push(...childLines);
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
return lines;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
generateComponentListHtml(components) {
|
|
707
|
+
return components.slice(0, 20).map(component => `
|
|
708
|
+
<div class="component-item">
|
|
709
|
+
<div class="component-info">
|
|
710
|
+
<div class="component-name">${this.getComponentIcon(component.type)} ${component.path}</div>
|
|
711
|
+
<div class="component-description">${component.reason || 'Dependency impact'}</div>
|
|
712
|
+
</div>
|
|
713
|
+
<div class="impact-score">${component.impactScore}/10</div>
|
|
714
|
+
</div>
|
|
715
|
+
`).join('');
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
generateRiskFactorsHtml(riskFactors) {
|
|
719
|
+
return riskFactors.slice(0, 8).map(factor => `
|
|
720
|
+
<div class="risk-factor">
|
|
721
|
+
<div class="risk-factor-header">
|
|
722
|
+
<div class="risk-factor-name">${factor.category}</div>
|
|
723
|
+
<div class="risk-factor-score">${factor.score}/10</div>
|
|
724
|
+
</div>
|
|
725
|
+
<div class="risk-factor-desc">${factor.description}</div>
|
|
726
|
+
<ul class="risk-factor-list">
|
|
727
|
+
${factor.factors.slice(0, 3).map(f => `<li>${f}</li>`).join('')}
|
|
728
|
+
</ul>
|
|
729
|
+
</div>
|
|
730
|
+
`).join('');
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
generateRecommendationsHtml(recommendations) {
|
|
734
|
+
return recommendations.slice(0, 6).map(rec => `
|
|
735
|
+
<div class="recommendation">
|
|
736
|
+
<div class="recommendation-title">${this.getPriorityIcon(rec.priority)} ${rec.title}</div>
|
|
737
|
+
<div class="recommendation-desc">${rec.description}</div>
|
|
738
|
+
</div>
|
|
739
|
+
`).join('');
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
generateNodes(impactReport) {
|
|
743
|
+
const nodes = [];
|
|
744
|
+
|
|
745
|
+
// Target node
|
|
746
|
+
nodes.push({
|
|
747
|
+
id: impactReport.targetComponent.path,
|
|
748
|
+
type: 'target',
|
|
749
|
+
componentType: impactReport.targetComponent.type,
|
|
750
|
+
label: impactReport.targetComponent.path,
|
|
751
|
+
risk: impactReport.riskAssessment.overallRisk,
|
|
752
|
+
modification: impactReport.modificationType,
|
|
753
|
+
});
|
|
754
|
+
|
|
755
|
+
// Affected component nodes
|
|
756
|
+
impactReport.dependencyAnalysis.affectedComponents.forEach(component => {
|
|
757
|
+
nodes.push({
|
|
758
|
+
id: component.path,
|
|
759
|
+
type: 'affected',
|
|
760
|
+
componentType: component.type,
|
|
761
|
+
label: component.path,
|
|
762
|
+
impact: component.impactScore,
|
|
763
|
+
severity: component.severity,
|
|
764
|
+
reason: component.reason,
|
|
765
|
+
});
|
|
766
|
+
});
|
|
767
|
+
|
|
768
|
+
return nodes;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
generateEdges(impactReport) {
|
|
772
|
+
const edges = [];
|
|
773
|
+
|
|
774
|
+
// Dependency edges
|
|
775
|
+
impactReport.dependencyAnalysis.affectedComponents.forEach(component => {
|
|
776
|
+
edges.push({
|
|
777
|
+
source: impactReport.targetComponent.path,
|
|
778
|
+
target: component.path,
|
|
779
|
+
type: 'dependency',
|
|
780
|
+
impact: component.impactScore,
|
|
781
|
+
dependencyType: component.dependencyType,
|
|
782
|
+
});
|
|
783
|
+
});
|
|
784
|
+
|
|
785
|
+
// Propagation edges
|
|
786
|
+
if (impactReport.propagationAnalysis.directEffects) {
|
|
787
|
+
impactReport.propagationAnalysis.directEffects.forEach(effect => {
|
|
788
|
+
edges.push({
|
|
789
|
+
source: effect.targetComponent,
|
|
790
|
+
target: effect.affectedComponent,
|
|
791
|
+
type: 'propagation',
|
|
792
|
+
impact: effect.impact,
|
|
793
|
+
confidence: effect.confidence,
|
|
794
|
+
});
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
return edges;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
generateClusters(impactReport) {
|
|
802
|
+
const clusters = [];
|
|
803
|
+
|
|
804
|
+
// Group by component type
|
|
805
|
+
const typeGroups = {};
|
|
806
|
+
impactReport.dependencyAnalysis.affectedComponents.forEach(component => {
|
|
807
|
+
if (!typeGroups[component.type]) {
|
|
808
|
+
typeGroups[component.type] = [];
|
|
809
|
+
}
|
|
810
|
+
typeGroups[component.type].push(component.path);
|
|
811
|
+
});
|
|
812
|
+
|
|
813
|
+
Object.entries(typeGroups).forEach(([type, components]) => {
|
|
814
|
+
clusters.push({
|
|
815
|
+
id: type,
|
|
816
|
+
label: `${type} components`,
|
|
817
|
+
nodes: components,
|
|
818
|
+
color: this.getTypeColor(type),
|
|
819
|
+
});
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
return clusters;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
generateTimelineData(impactReport) {
|
|
826
|
+
const timeline = [];
|
|
827
|
+
|
|
828
|
+
if (impactReport.riskAssessment.riskProjection?.risk_timeline) {
|
|
829
|
+
impactReport.riskAssessment.riskProjection.risk_timeline.forEach(event => {
|
|
830
|
+
timeline.push({
|
|
831
|
+
time: event.time,
|
|
832
|
+
event: event.event,
|
|
833
|
+
riskLevel: event.risk_level,
|
|
834
|
+
description: `Risk level: ${event.risk_level}/10`,
|
|
835
|
+
});
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
return timeline;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// Icon and color helper methods
|
|
843
|
+
|
|
844
|
+
getComponentIcon(type) {
|
|
845
|
+
const icons = {
|
|
846
|
+
agent: '🤖',
|
|
847
|
+
workflow: '🔄',
|
|
848
|
+
task: '⚡',
|
|
849
|
+
util: '🔧',
|
|
850
|
+
unknown: '📄',
|
|
851
|
+
};
|
|
852
|
+
return icons[type] || icons.unknown;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
getRiskIcon(severity) {
|
|
856
|
+
const icons = {
|
|
857
|
+
critical: '🔴',
|
|
858
|
+
high: '🟠',
|
|
859
|
+
medium: '🟡',
|
|
860
|
+
low: '🟢',
|
|
861
|
+
};
|
|
862
|
+
return icons[severity] || '⚪';
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
getPriorityIcon(priority) {
|
|
866
|
+
const icons = {
|
|
867
|
+
critical: '🚨',
|
|
868
|
+
high: '⚠️',
|
|
869
|
+
medium: '📋',
|
|
870
|
+
low: 'ℹ️',
|
|
871
|
+
};
|
|
872
|
+
return icons[priority] || '📋';
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
getTypeColor(type) {
|
|
876
|
+
const colors = {
|
|
877
|
+
agent: '#4299e1',
|
|
878
|
+
workflow: '#48bb78',
|
|
879
|
+
task: '#ed8936',
|
|
880
|
+
util: '#9f7aea',
|
|
881
|
+
unknown: '#718096',
|
|
882
|
+
};
|
|
883
|
+
return colors[type] || colors.unknown;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
scoresToRiskLevel(score) {
|
|
887
|
+
if (score >= 9) return 'critical';
|
|
888
|
+
if (score >= 7) return 'high';
|
|
889
|
+
if (score >= 4) return 'medium';
|
|
890
|
+
return 'low';
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// Distribution calculation helpers
|
|
894
|
+
|
|
895
|
+
calculateRiskDistribution(impactReport) {
|
|
896
|
+
const distribution = { low: 0, medium: 0, high: 0, critical: 0 };
|
|
897
|
+
|
|
898
|
+
impactReport.dependencyAnalysis.affectedComponents.forEach(component => {
|
|
899
|
+
const riskLevel = this.scoresToRiskLevel(component.impactScore);
|
|
900
|
+
distribution[riskLevel]++;
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
return distribution;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
calculateComponentTypeDistribution(impactReport) {
|
|
907
|
+
const distribution = {};
|
|
908
|
+
|
|
909
|
+
impactReport.dependencyAnalysis.affectedComponents.forEach(component => {
|
|
910
|
+
distribution[component.type] = (distribution[component.type] || 0) + 1;
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
return distribution;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
calculateImpactCategoryDistribution(impactReport) {
|
|
917
|
+
const categories = impactReport.dependencyAnalysis.impactCategories || {};
|
|
918
|
+
return {
|
|
919
|
+
critical: categories.critical?.length || 0,
|
|
920
|
+
high: categories.high?.length || 0,
|
|
921
|
+
medium: categories.medium?.length || 0,
|
|
922
|
+
low: categories.low?.length || 0,
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
calculateRiskMatrix(impactReport) {
|
|
927
|
+
// Simple risk matrix implementation
|
|
928
|
+
const matrix = [];
|
|
929
|
+
const dimensions = Object.keys(impactReport.riskAssessment.riskDimensions || {});
|
|
930
|
+
const components = impactReport.dependencyAnalysis.affectedComponents.slice(0, 10);
|
|
931
|
+
|
|
932
|
+
components.forEach(component => {
|
|
933
|
+
const row = {
|
|
934
|
+
component: component.path,
|
|
935
|
+
scores: {},
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
dimensions.forEach(dimension => {
|
|
939
|
+
// Simplified calculation - in practice would be more sophisticated
|
|
940
|
+
row.scores[dimension] = Math.min(10, component.impactScore + Math.random() * 2);
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
matrix.push(row);
|
|
944
|
+
});
|
|
945
|
+
|
|
946
|
+
return matrix;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
getInteractiveStyles() {
|
|
950
|
+
return `
|
|
951
|
+
.interactive-controls {
|
|
952
|
+
background: #f7fafc;
|
|
953
|
+
padding: 20px;
|
|
954
|
+
margin: 20px 0;
|
|
955
|
+
border-radius: 8px;
|
|
956
|
+
border: 1px solid #e2e8f0;
|
|
957
|
+
}
|
|
958
|
+
.filter-button {
|
|
959
|
+
background: #667eea;
|
|
960
|
+
color: white;
|
|
961
|
+
border: none;
|
|
962
|
+
padding: 8px 16px;
|
|
963
|
+
border-radius: 4px;
|
|
964
|
+
margin: 5px;
|
|
965
|
+
cursor: pointer;
|
|
966
|
+
transition: background-color 0.2s;
|
|
967
|
+
}
|
|
968
|
+
.filter-button:hover {
|
|
969
|
+
background: #5a67d8;
|
|
970
|
+
}
|
|
971
|
+
.filter-button.active {
|
|
972
|
+
background: #4c51bf;
|
|
973
|
+
}
|
|
974
|
+
`;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
getInteractiveScripts() {
|
|
978
|
+
return `
|
|
979
|
+
<script>
|
|
980
|
+
// Interactive filtering and visualization controls
|
|
981
|
+
function filterComponents(riskLevel) {
|
|
982
|
+
const components = document.querySelectorAll('.component-item');
|
|
983
|
+
components.forEach(item => {
|
|
984
|
+
const score = parseInt(item.querySelector('.impact-score').textContent);
|
|
985
|
+
const shouldShow = riskLevel === 'all' ||
|
|
986
|
+
(riskLevel === 'critical' && score >= 9) ||
|
|
987
|
+
(riskLevel === 'high' && score >= 7 && score < 9) ||
|
|
988
|
+
(riskLevel === 'medium' && score >= 4 && score < 7) ||
|
|
989
|
+
(riskLevel === 'low' && score < 4);
|
|
990
|
+
|
|
991
|
+
item.style.display = shouldShow ? 'flex' : 'none';
|
|
992
|
+
});
|
|
993
|
+
|
|
994
|
+
// Update filter button states
|
|
995
|
+
document.querySelectorAll('.filter-button').forEach(btn => {
|
|
996
|
+
btn.classList.remove('active');
|
|
997
|
+
});
|
|
998
|
+
document.querySelector(\`[data-filter="\${riskLevel}"]\`).classList.add('active');
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
// Add filter controls
|
|
1002
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
1003
|
+
const componentSection = document.querySelector('.component-list').parentNode;
|
|
1004
|
+
const controls = document.createElement('div');
|
|
1005
|
+
controls.className = 'interactive-controls';
|
|
1006
|
+
controls.innerHTML = \`
|
|
1007
|
+
<strong>Filter by Risk Level:</strong>
|
|
1008
|
+
<button class="filter-button active" data-filter="all" onclick="filterComponents('all')">All</button>
|
|
1009
|
+
<button class="filter-button" data-filter="critical" onclick="filterComponents('critical')">Critical</button>
|
|
1010
|
+
<button class="filter-button" data-filter="high" onclick="filterComponents('high')">High</button>
|
|
1011
|
+
<button class="filter-button" data-filter="medium" onclick="filterComponents('medium')">Medium</button>
|
|
1012
|
+
<button class="filter-button" data-filter="low" onclick="filterComponents('low')">Low</button>
|
|
1013
|
+
\`;
|
|
1014
|
+
componentSection.insertBefore(controls, document.querySelector('.component-list'));
|
|
1015
|
+
});
|
|
1016
|
+
</script>
|
|
1017
|
+
`;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* Get cached visualization
|
|
1022
|
+
*/
|
|
1023
|
+
getCachedVisualization(visualId) {
|
|
1024
|
+
return this.visualCache.get(visualId);
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Clear visualization cache
|
|
1029
|
+
*/
|
|
1030
|
+
clearCache() {
|
|
1031
|
+
this.visualCache.clear();
|
|
1032
|
+
console.log(chalk.gray('Visual impact generator cache cleared'));
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Get generation statistics
|
|
1037
|
+
*/
|
|
1038
|
+
getGenerationStats() {
|
|
1039
|
+
return {
|
|
1040
|
+
total_visualizations: this.generationHistory.length,
|
|
1041
|
+
cached_visualizations: this.visualCache.size,
|
|
1042
|
+
format_distribution: this.calculateFormatDistribution(),
|
|
1043
|
+
recent_generations: this.generationHistory.slice(-10),
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
calculateFormatDistribution() {
|
|
1048
|
+
const distribution = {};
|
|
1049
|
+
this.generationHistory.forEach(gen => {
|
|
1050
|
+
distribution[gen.format] = (distribution[gen.format] || 0) + 1;
|
|
1051
|
+
});
|
|
1052
|
+
return distribution;
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
module.exports = VisualImpactGenerator;
|