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,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visual Feedback Helpers
|
|
3
|
+
*
|
|
4
|
+
* Spinners, progress bars, and status indicators using AIOS Color System v2.1
|
|
5
|
+
*
|
|
6
|
+
* @module wizard/feedback
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const ora = require('ora');
|
|
10
|
+
const cliProgress = require('cli-progress');
|
|
11
|
+
const { colors, status, headings } = require('../utils/aios-colors');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Create and start a spinner with AIOS styling
|
|
15
|
+
*
|
|
16
|
+
* @param {string} text - Spinner text
|
|
17
|
+
* @param {Object} options - Spinner options
|
|
18
|
+
* @returns {Object} Ora spinner instance
|
|
19
|
+
*/
|
|
20
|
+
function createSpinner(text, options = {}) {
|
|
21
|
+
return ora({
|
|
22
|
+
text,
|
|
23
|
+
color: 'cyan',
|
|
24
|
+
spinner: 'dots',
|
|
25
|
+
...options,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Show success message with checkmark
|
|
31
|
+
*
|
|
32
|
+
* @param {string} message - Success message
|
|
33
|
+
*/
|
|
34
|
+
function showSuccess(message) {
|
|
35
|
+
console.log(status.success(message));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Show error message with cross mark
|
|
40
|
+
*
|
|
41
|
+
* @param {string} message - Error message
|
|
42
|
+
*/
|
|
43
|
+
function showError(message) {
|
|
44
|
+
console.log(status.error(message));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Show warning message with warning symbol
|
|
49
|
+
*
|
|
50
|
+
* @param {string} message - Warning message
|
|
51
|
+
*/
|
|
52
|
+
function showWarning(message) {
|
|
53
|
+
console.log(status.warning(message));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Show info message
|
|
58
|
+
*
|
|
59
|
+
* @param {string} message - Info message
|
|
60
|
+
*/
|
|
61
|
+
function showInfo(message) {
|
|
62
|
+
console.log(status.info(message));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Show tip message
|
|
67
|
+
*
|
|
68
|
+
* @param {string} message - Tip message
|
|
69
|
+
*/
|
|
70
|
+
function showTip(message) {
|
|
71
|
+
console.log(status.tip(message));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Create progress bar with AIOS styling
|
|
76
|
+
*
|
|
77
|
+
* @param {number} total - Total steps
|
|
78
|
+
* @param {Object} options - Progress bar options
|
|
79
|
+
* @returns {Object} Progress bar instance
|
|
80
|
+
*/
|
|
81
|
+
function createProgressBar(total, options = {}) {
|
|
82
|
+
const progressBar = new cliProgress.SingleBar({
|
|
83
|
+
format: colors.primary('Progress |') + colors.tertiary('{bar}') + colors.primary('| {percentage}% | {value}/{total} | {task}'),
|
|
84
|
+
barCompleteChar: '\u2588',
|
|
85
|
+
barIncompleteChar: '\u2591',
|
|
86
|
+
hideCursor: true,
|
|
87
|
+
...options,
|
|
88
|
+
}, cliProgress.Presets.shades_classic);
|
|
89
|
+
|
|
90
|
+
progressBar.start(total, 0, { task: 'Initializing...' });
|
|
91
|
+
return progressBar;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Update progress bar
|
|
96
|
+
*
|
|
97
|
+
* @param {Object} progressBar - Progress bar instance
|
|
98
|
+
* @param {number} current - Current step
|
|
99
|
+
* @param {string} taskName - Current task name
|
|
100
|
+
*/
|
|
101
|
+
function updateProgress(progressBar, current, taskName) {
|
|
102
|
+
progressBar.update(current, { task: taskName });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Complete and hide progress bar
|
|
107
|
+
*
|
|
108
|
+
* @param {Object} progressBar - Progress bar instance
|
|
109
|
+
*/
|
|
110
|
+
function completeProgress(progressBar) {
|
|
111
|
+
progressBar.stop();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* ASCII Art Banner for AIOS-FULLSTACK
|
|
116
|
+
*/
|
|
117
|
+
const BANNER = `
|
|
118
|
+
█████╗ ██╗ ██████╗ ███████╗ ███████╗██╗ ██╗██╗ ██╗ ███████╗████████╗ █████╗ ██████╗██╗ ██╗
|
|
119
|
+
██╔══██╗██║██╔═══██╗██╔════╝ ██╔════╝██║ ██║██║ ██║ ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝
|
|
120
|
+
███████║██║██║ ██║███████╗█████╗█████╗ ██║ ██║██║ ██║ ███████╗ ██║ ███████║██║ █████╔╝
|
|
121
|
+
██╔══██║██║██║ ██║╚════██║╚════╝██╔══╝ ██║ ██║██║ ██║ ╚════██║ ██║ ██╔══██║██║ ██╔═██╗
|
|
122
|
+
██║ ██║██║╚██████╔╝███████║ ██║ ╚██████╔╝███████╗███████╗███████║ ██║ ██║ ██║╚██████╗██║ ██╗
|
|
123
|
+
╚═╝ ╚═╝╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
|
|
124
|
+
`;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Show welcome banner
|
|
128
|
+
*/
|
|
129
|
+
function showWelcome() {
|
|
130
|
+
// Get version from package.json
|
|
131
|
+
const path = require('path');
|
|
132
|
+
const fs = require('fs');
|
|
133
|
+
let version = '2.1.0';
|
|
134
|
+
try {
|
|
135
|
+
const pkgPath = path.join(__dirname, '..', '..', 'package.json');
|
|
136
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
137
|
+
version = pkg.version || version;
|
|
138
|
+
} catch (_e) {
|
|
139
|
+
// Use default version
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
console.log(colors.primary(BANNER));
|
|
143
|
+
console.log(colors.secondary('🚀 Universal AI Agent Framework for Any Domain'));
|
|
144
|
+
console.log(colors.tertiary(`✨ Installer v${version}`));
|
|
145
|
+
console.log('');
|
|
146
|
+
console.log(colors.dim('═'.repeat(80)));
|
|
147
|
+
console.log('');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Show completion message
|
|
152
|
+
*/
|
|
153
|
+
function showCompletion() {
|
|
154
|
+
console.log('\n' + headings.divider());
|
|
155
|
+
console.log(status.celebrate('Installation Complete!'));
|
|
156
|
+
console.log(colors.info('Your AIOS project is ready to use.'));
|
|
157
|
+
console.log(headings.divider() + '\n');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Show section header
|
|
162
|
+
*
|
|
163
|
+
* @param {string} title - Section title
|
|
164
|
+
*/
|
|
165
|
+
function showSection(title) {
|
|
166
|
+
console.log('\n' + headings.h2(title));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Show cancellation message
|
|
171
|
+
*/
|
|
172
|
+
function showCancellation() {
|
|
173
|
+
console.log('\n' + colors.warning('Installation cancelled.'));
|
|
174
|
+
console.log(colors.info('Run `npx aios-fullstack@latest init` to try again.\n'));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Estimate time remaining for progress
|
|
179
|
+
*
|
|
180
|
+
* @param {number} current - Current step
|
|
181
|
+
* @param {number} total - Total steps
|
|
182
|
+
* @param {number} startTime - Start timestamp
|
|
183
|
+
* @returns {string} Formatted time estimate
|
|
184
|
+
*/
|
|
185
|
+
function estimateTimeRemaining(current, total, startTime) {
|
|
186
|
+
if (current === 0) return 'Calculating...';
|
|
187
|
+
|
|
188
|
+
const elapsed = Date.now() - startTime;
|
|
189
|
+
const avgTimePerStep = elapsed / current;
|
|
190
|
+
const remaining = (total - current) * avgTimePerStep;
|
|
191
|
+
|
|
192
|
+
const seconds = Math.ceil(remaining / 1000);
|
|
193
|
+
|
|
194
|
+
if (seconds < 60) {
|
|
195
|
+
return `~${seconds}s remaining`;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const minutes = Math.ceil(seconds / 60);
|
|
199
|
+
return `~${minutes}m remaining`;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
module.exports = {
|
|
203
|
+
createSpinner,
|
|
204
|
+
showSuccess,
|
|
205
|
+
showError,
|
|
206
|
+
showWarning,
|
|
207
|
+
showInfo,
|
|
208
|
+
showTip,
|
|
209
|
+
createProgressBar,
|
|
210
|
+
updateProgress,
|
|
211
|
+
completeProgress,
|
|
212
|
+
showWelcome,
|
|
213
|
+
showCompletion,
|
|
214
|
+
showSection,
|
|
215
|
+
showCancellation,
|
|
216
|
+
estimateTimeRemaining,
|
|
217
|
+
};
|
|
218
|
+
|
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IDE Config Generator
|
|
3
|
+
*
|
|
4
|
+
* Story 1.4: IDE Selection
|
|
5
|
+
* Generates IDE-specific configuration files with validation and rollback
|
|
6
|
+
*
|
|
7
|
+
* @module wizard/ide-config-generator
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const fs = require('fs-extra');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const yaml = require('js-yaml');
|
|
13
|
+
const inquirer = require('inquirer');
|
|
14
|
+
const ora = require('ora');
|
|
15
|
+
const { getIDEConfig } = require('../config/ide-configs');
|
|
16
|
+
const { validateProjectName } = require('./validators');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Render template with variables
|
|
20
|
+
* @param {string} template - Template string
|
|
21
|
+
* @param {Object} variables - Variables to interpolate
|
|
22
|
+
* @returns {string} Rendered template
|
|
23
|
+
*/
|
|
24
|
+
function renderTemplate(template, variables) {
|
|
25
|
+
let rendered = template;
|
|
26
|
+
|
|
27
|
+
// Replace all {{variable}} patterns
|
|
28
|
+
for (const [key, value] of Object.entries(variables)) {
|
|
29
|
+
const regex = new RegExp(`{{${key}}}`, 'g');
|
|
30
|
+
rendered = rendered.replace(regex, value);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return rendered;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Validate config content based on format
|
|
38
|
+
* @param {string} content - Config file content
|
|
39
|
+
* @param {string} format - Format: 'json', 'yaml', or 'text'
|
|
40
|
+
* @throws {Error} If validation fails
|
|
41
|
+
*/
|
|
42
|
+
function validateConfigContent(content, format) {
|
|
43
|
+
if (format === 'json') {
|
|
44
|
+
try {
|
|
45
|
+
JSON.parse(content);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
throw new Error(`Invalid JSON: ${error.message}`);
|
|
48
|
+
}
|
|
49
|
+
} else if (format === 'yaml') {
|
|
50
|
+
try {
|
|
51
|
+
yaml.load(content);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
throw new Error(`Invalid YAML: ${error.message}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Text format doesn't need validation
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Create backup of existing file
|
|
61
|
+
* @param {string} filePath - Path to file to backup
|
|
62
|
+
* @returns {Promise<string>} Backup file path
|
|
63
|
+
*/
|
|
64
|
+
async function backupFile(filePath) {
|
|
65
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
66
|
+
const backupPath = `${filePath}.backup.${timestamp}`;
|
|
67
|
+
|
|
68
|
+
await fs.copy(filePath, backupPath);
|
|
69
|
+
return backupPath;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Prompt user for action when file exists
|
|
74
|
+
* @param {string} filePath - Path to existing file
|
|
75
|
+
* @returns {Promise<string>} Action: 'overwrite', 'skip', or 'backup'
|
|
76
|
+
*/
|
|
77
|
+
async function promptFileExists(filePath) {
|
|
78
|
+
const { action } = await inquirer.prompt([
|
|
79
|
+
{
|
|
80
|
+
type: 'list',
|
|
81
|
+
name: 'action',
|
|
82
|
+
message: `File ${path.basename(filePath)} already exists. What would you like to do?`,
|
|
83
|
+
choices: [
|
|
84
|
+
{ name: 'Overwrite', value: 'overwrite' },
|
|
85
|
+
{ name: 'Create backup and overwrite', value: 'backup' },
|
|
86
|
+
{ name: 'Skip', value: 'skip' },
|
|
87
|
+
],
|
|
88
|
+
default: 'backup',
|
|
89
|
+
},
|
|
90
|
+
]);
|
|
91
|
+
|
|
92
|
+
return action;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Sanitize and validate a candidate project name
|
|
97
|
+
* Converts unsafe directory names to safe project names
|
|
98
|
+
*
|
|
99
|
+
* @param {string} candidate - Candidate project name (e.g., from path.basename)
|
|
100
|
+
* @returns {string} Safe, validated project name
|
|
101
|
+
*/
|
|
102
|
+
function sanitizeProjectName(candidate) {
|
|
103
|
+
if (!candidate || typeof candidate !== 'string') {
|
|
104
|
+
return 'my-project';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Step 1: Convert to lowercase and replace spaces/special chars with dashes
|
|
108
|
+
let sanitized = candidate
|
|
109
|
+
.toLowerCase()
|
|
110
|
+
.trim()
|
|
111
|
+
.replace(/[^a-zA-Z0-9_-]/g, '-') // Replace non-alphanumeric (except dash/underscore) with dash
|
|
112
|
+
.replace(/[-_]+/g, '-') // Collapse multiple dashes/underscores into single dash
|
|
113
|
+
.replace(/^[-_]+|[-_]+$/g, ''); // Remove leading/trailing dashes/underscores
|
|
114
|
+
|
|
115
|
+
// Step 2: Ensure it starts with alphanumeric
|
|
116
|
+
sanitized = sanitized.replace(/^[^a-zA-Z0-9]+/, '');
|
|
117
|
+
|
|
118
|
+
// Step 3: Limit length (validateProjectName allows up to 100)
|
|
119
|
+
if (sanitized.length > 100) {
|
|
120
|
+
sanitized = sanitized.substring(0, 100);
|
|
121
|
+
// Remove trailing dash if truncation created one
|
|
122
|
+
sanitized = sanitized.replace(/-+$/, '');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Step 4: Validate the sanitized name
|
|
126
|
+
const validation = validateProjectName(sanitized);
|
|
127
|
+
|
|
128
|
+
if (validation === true && sanitized.length > 0) {
|
|
129
|
+
return sanitized;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Step 5: If validation fails, generate a safe alphanumeric slug
|
|
133
|
+
// Use first alphanumeric chars from original, or generate default
|
|
134
|
+
const alphanumericOnly = candidate.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
|
|
135
|
+
if (alphanumericOnly.length > 0 && alphanumericOnly.length <= 100) {
|
|
136
|
+
const fallbackValidation = validateProjectName(alphanumericOnly);
|
|
137
|
+
if (fallbackValidation === true) {
|
|
138
|
+
return alphanumericOnly;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Step 6: Ultimate fallback - safe default
|
|
143
|
+
return 'my-project';
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Generate template variables from wizard state
|
|
148
|
+
* @param {Object} wizardState - Current wizard state
|
|
149
|
+
* @returns {Object} Template variables
|
|
150
|
+
*/
|
|
151
|
+
function generateTemplateVariables(wizardState) {
|
|
152
|
+
const timestamp = new Date().toISOString();
|
|
153
|
+
|
|
154
|
+
// Safely get project name with validation
|
|
155
|
+
// If provided, validate it; otherwise sanitize fallback from directory name
|
|
156
|
+
let projectName;
|
|
157
|
+
if (wizardState.projectName) {
|
|
158
|
+
const validation = validateProjectName(wizardState.projectName);
|
|
159
|
+
if (validation === true) {
|
|
160
|
+
projectName = wizardState.projectName;
|
|
161
|
+
} else {
|
|
162
|
+
// If provided name is invalid, sanitize it
|
|
163
|
+
projectName = sanitizeProjectName(wizardState.projectName);
|
|
164
|
+
}
|
|
165
|
+
} else {
|
|
166
|
+
// No project name provided, sanitize fallback from directory name
|
|
167
|
+
projectName = sanitizeProjectName(path.basename(process.cwd()));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
projectName,
|
|
172
|
+
projectType: wizardState.projectType || 'greenfield',
|
|
173
|
+
timestamp,
|
|
174
|
+
aiosVersion: '2.1.0', // From package.json in real implementation
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Copy agent files from .aios-core/development/agents to IDE-specific agent folder
|
|
180
|
+
* v2.1 modular structure: agents are now in development/ module
|
|
181
|
+
* @param {string} projectRoot - Project root directory
|
|
182
|
+
* @param {string} agentFolder - Target folder for agent files (IDE-specific)
|
|
183
|
+
* @param {Object} ideConfig - IDE configuration object (optional, for special handling)
|
|
184
|
+
* @returns {Promise<string[]>} List of copied files
|
|
185
|
+
*/
|
|
186
|
+
async function copyAgentFiles(projectRoot, agentFolder, ideConfig = null) {
|
|
187
|
+
// v2.1: Agents are in development/agents/ (not root agents/)
|
|
188
|
+
const sourceDir = path.join(__dirname, '..', '..', '.aios-core', 'development', 'agents');
|
|
189
|
+
const targetDir = path.join(projectRoot, agentFolder);
|
|
190
|
+
const copiedFiles = [];
|
|
191
|
+
|
|
192
|
+
// Ensure target directory exists
|
|
193
|
+
await fs.ensureDir(targetDir);
|
|
194
|
+
|
|
195
|
+
// Get all agent files (excluding backup files)
|
|
196
|
+
const files = await fs.readdir(sourceDir);
|
|
197
|
+
const agentFiles = files.filter(file =>
|
|
198
|
+
file.endsWith('.md') &&
|
|
199
|
+
!file.includes('.backup') &&
|
|
200
|
+
!file.startsWith('test-'), // Exclude test agents
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
// Check if this is AntiGravity - needs workflow files instead of direct copy
|
|
204
|
+
const isAntiGravity = ideConfig && ideConfig.specialConfig && ideConfig.specialConfig.type === 'antigravity';
|
|
205
|
+
|
|
206
|
+
for (const file of agentFiles) {
|
|
207
|
+
const sourcePath = path.join(sourceDir, file);
|
|
208
|
+
const agentName = file.replace('.md', '');
|
|
209
|
+
|
|
210
|
+
// Only copy if source is a file (not directory)
|
|
211
|
+
const stat = await fs.stat(sourcePath);
|
|
212
|
+
if (stat.isFile()) {
|
|
213
|
+
if (isAntiGravity) {
|
|
214
|
+
// For AntiGravity: create workflow activation files
|
|
215
|
+
const workflowContent = generateAntiGravityWorkflow(agentName);
|
|
216
|
+
const targetPath = path.join(targetDir, file);
|
|
217
|
+
await fs.writeFile(targetPath, workflowContent, 'utf8');
|
|
218
|
+
copiedFiles.push(targetPath);
|
|
219
|
+
|
|
220
|
+
// Also copy the actual agent to .antigravity/agents
|
|
221
|
+
const agentsDir = path.join(projectRoot, ideConfig.specialConfig.agentsFolder);
|
|
222
|
+
await fs.ensureDir(agentsDir);
|
|
223
|
+
const agentTargetPath = path.join(agentsDir, file);
|
|
224
|
+
await fs.copy(sourcePath, agentTargetPath);
|
|
225
|
+
copiedFiles.push(agentTargetPath);
|
|
226
|
+
} else {
|
|
227
|
+
// Normal copy for other IDEs
|
|
228
|
+
const targetPath = path.join(targetDir, file);
|
|
229
|
+
await fs.copy(sourcePath, targetPath);
|
|
230
|
+
copiedFiles.push(targetPath);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return copiedFiles;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Generate AntiGravity workflow activation file content
|
|
240
|
+
* @param {string} agentName - Name of the agent (e.g., 'dev', 'architect')
|
|
241
|
+
* @returns {string} Workflow file content
|
|
242
|
+
*/
|
|
243
|
+
function generateAntiGravityWorkflow(agentName) {
|
|
244
|
+
// Capitalize first letter for display
|
|
245
|
+
const displayName = agentName.charAt(0).toUpperCase() + agentName.slice(1);
|
|
246
|
+
|
|
247
|
+
return `---
|
|
248
|
+
description: Ativa o agente ${displayName}
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
# Ativação do Agente ${displayName}
|
|
252
|
+
|
|
253
|
+
**INSTRUÇÕES CRÍTICAS PARA O ANTIGRAVITY:**
|
|
254
|
+
|
|
255
|
+
1. Leia COMPLETAMENTE o arquivo \`.antigravity/agents/${agentName}.md\`
|
|
256
|
+
2. Siga EXATAMENTE as \`activation-instructions\` definidas no bloco YAML do agente
|
|
257
|
+
3. Adote a persona conforme definido no agente
|
|
258
|
+
4. Execute a saudação conforme \`greeting_levels\` definido no agente
|
|
259
|
+
5. **MANTENHA esta persona até receber o comando \`*exit\`**
|
|
260
|
+
6. Responda aos comandos com prefixo \`*\` conforme definido no agente
|
|
261
|
+
7. Siga as regras globais do projeto em \`.antigravity/rules.md\`
|
|
262
|
+
|
|
263
|
+
**Comandos disponíveis:** Use \`*help\` para ver todos os comandos do agente.
|
|
264
|
+
`;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Create AntiGravity configuration JSON file
|
|
269
|
+
* @param {string} projectRoot - Project root directory
|
|
270
|
+
* @param {Object} ideConfig - AntiGravity IDE config
|
|
271
|
+
* @returns {Promise<string>} Path to created file
|
|
272
|
+
*/
|
|
273
|
+
async function createAntiGravityConfigJson(projectRoot, ideConfig) {
|
|
274
|
+
const configPath = path.join(projectRoot, ideConfig.specialConfig.configJsonPath);
|
|
275
|
+
const projectName = path.basename(projectRoot);
|
|
276
|
+
|
|
277
|
+
const config = {
|
|
278
|
+
version: '1.0',
|
|
279
|
+
project: projectName,
|
|
280
|
+
workspace: projectRoot.replace(/\\/g, '/'),
|
|
281
|
+
agents: {
|
|
282
|
+
enabled: true,
|
|
283
|
+
directory: ideConfig.specialConfig.agentsFolder,
|
|
284
|
+
default: 'aios-master',
|
|
285
|
+
},
|
|
286
|
+
rules: {
|
|
287
|
+
enabled: true,
|
|
288
|
+
file: ideConfig.configFile,
|
|
289
|
+
},
|
|
290
|
+
features: {
|
|
291
|
+
storyDrivenDevelopment: true,
|
|
292
|
+
agentActivation: true,
|
|
293
|
+
workflowAutomation: true,
|
|
294
|
+
},
|
|
295
|
+
paths: {
|
|
296
|
+
stories: 'docs/stories',
|
|
297
|
+
prd: 'docs/prd',
|
|
298
|
+
architecture: 'docs/architecture',
|
|
299
|
+
tasks: '.aios-core/tasks',
|
|
300
|
+
workflows: '.aios-core/workflows',
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
await fs.ensureDir(path.dirname(configPath));
|
|
305
|
+
await fs.writeFile(configPath, JSON.stringify(config, null, 4), 'utf8');
|
|
306
|
+
|
|
307
|
+
return configPath;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Generate IDE configuration files
|
|
312
|
+
*
|
|
313
|
+
* AC2: Creates appropriate config file for each selected IDE
|
|
314
|
+
* AC3: Validates config content before writing
|
|
315
|
+
* AC4: Handles existing files with user prompt
|
|
316
|
+
* AC5: Shows progress feedback
|
|
317
|
+
*
|
|
318
|
+
* @param {string[]} selectedIDEs - Array of IDE keys
|
|
319
|
+
* @param {Object} wizardState - Current wizard state
|
|
320
|
+
* @param {Object} options - Options
|
|
321
|
+
* @param {string} options.projectRoot - Project root directory (defaults to cwd)
|
|
322
|
+
* @returns {Promise<{success: boolean, files: string[], errors: Array}>}
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* const result = await generateIDEConfigs(['cursor', 'windsurf'], wizardState);
|
|
326
|
+
* console.log(result.files); // ['.cursorrules', '.windsurfrules']
|
|
327
|
+
*/
|
|
328
|
+
async function generateIDEConfigs(selectedIDEs, wizardState, options = {}) {
|
|
329
|
+
const projectRoot = options.projectRoot || process.cwd();
|
|
330
|
+
const createdFiles = [];
|
|
331
|
+
const createdFolders = [];
|
|
332
|
+
const backupFiles = [];
|
|
333
|
+
const errors = [];
|
|
334
|
+
|
|
335
|
+
// Generate template variables
|
|
336
|
+
const templateVars = generateTemplateVariables(wizardState);
|
|
337
|
+
|
|
338
|
+
const spinner = ora();
|
|
339
|
+
|
|
340
|
+
try {
|
|
341
|
+
for (const ideKey of selectedIDEs) {
|
|
342
|
+
const ide = getIDEConfig(ideKey);
|
|
343
|
+
|
|
344
|
+
if (!ide) {
|
|
345
|
+
errors.push({ ide: ideKey, error: 'IDE configuration not found' });
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
spinner.start(`Configuring ${ide.name}...`);
|
|
350
|
+
|
|
351
|
+
try {
|
|
352
|
+
// Create directory if needed
|
|
353
|
+
const configPath = path.join(projectRoot, ide.configFile);
|
|
354
|
+
const configDir = path.dirname(configPath);
|
|
355
|
+
|
|
356
|
+
if (ide.requiresDirectory) {
|
|
357
|
+
await fs.ensureDir(configDir);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Check if file exists
|
|
361
|
+
const exists = await fs.pathExists(configPath);
|
|
362
|
+
if (exists) {
|
|
363
|
+
spinner.stop();
|
|
364
|
+
const action = await promptFileExists(ide.configFile);
|
|
365
|
+
|
|
366
|
+
if (action === 'skip') {
|
|
367
|
+
spinner.succeed(`Skipped ${ide.name} (file exists)`);
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if (action === 'backup') {
|
|
372
|
+
const backupPath = await backupFile(configPath);
|
|
373
|
+
backupFiles.push(backupPath);
|
|
374
|
+
spinner.info(`Created backup: ${path.basename(backupPath)}`);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
spinner.start(`Configuring ${ide.name}...`);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// Load template from .aios-core/product/templates/
|
|
381
|
+
const templatePath = path.join(__dirname, '..', '..', '.aios-core', 'product', 'templates', ide.template);
|
|
382
|
+
|
|
383
|
+
if (!await fs.pathExists(templatePath)) {
|
|
384
|
+
throw new Error(`Template file not found: ${ide.template}`);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const template = await fs.readFile(templatePath, 'utf8');
|
|
388
|
+
|
|
389
|
+
// Render template
|
|
390
|
+
const rendered = renderTemplate(template, templateVars);
|
|
391
|
+
|
|
392
|
+
// Validate content
|
|
393
|
+
validateConfigContent(rendered, ide.format);
|
|
394
|
+
|
|
395
|
+
// Write file
|
|
396
|
+
await fs.writeFile(configPath, rendered, 'utf8');
|
|
397
|
+
createdFiles.push(configPath);
|
|
398
|
+
|
|
399
|
+
spinner.succeed(`Created ${ide.configFile}`);
|
|
400
|
+
|
|
401
|
+
// Copy agent files to IDE-specific agent folder
|
|
402
|
+
if (ide.agentFolder) {
|
|
403
|
+
spinner.start(`Copying agents to ${ide.agentFolder}...`);
|
|
404
|
+
const agentFiles = await copyAgentFiles(projectRoot, ide.agentFolder, ide);
|
|
405
|
+
createdFiles.push(...agentFiles);
|
|
406
|
+
createdFolders.push(path.join(projectRoot, ide.agentFolder));
|
|
407
|
+
|
|
408
|
+
// For AntiGravity, also create the antigravity.json config file
|
|
409
|
+
if (ide.specialConfig && ide.specialConfig.type === 'antigravity') {
|
|
410
|
+
const configJsonPath = await createAntiGravityConfigJson(projectRoot, ide);
|
|
411
|
+
createdFiles.push(configJsonPath);
|
|
412
|
+
spinner.succeed(`Created AntiGravity config and ${agentFiles.length} workflow files`);
|
|
413
|
+
} else {
|
|
414
|
+
spinner.succeed(`Copied ${agentFiles.length} agent files to ${ide.agentFolder}`);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
} catch (error) {
|
|
419
|
+
spinner.fail(`Failed to configure ${ide.name}`);
|
|
420
|
+
errors.push({ ide: ide.name, error: error.message });
|
|
421
|
+
|
|
422
|
+
// Rollback: Delete all created files
|
|
423
|
+
for (const file of createdFiles) {
|
|
424
|
+
await fs.remove(file).catch(() => {});
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// Rollback: Delete created folders
|
|
428
|
+
for (const folder of createdFolders) {
|
|
429
|
+
await fs.remove(folder).catch(() => {});
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// Restore backups
|
|
433
|
+
for (const backup of backupFiles) {
|
|
434
|
+
const original = backup.replace(/\.backup\.\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-\d{3}Z$/, '');
|
|
435
|
+
await fs.move(backup, original, { overwrite: true }).catch(() => {});
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
throw new Error(`IDE config generation failed for ${ide.name}: ${error.message}`);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return {
|
|
443
|
+
success: true,
|
|
444
|
+
files: createdFiles,
|
|
445
|
+
errors: errors.length > 0 ? errors : undefined,
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
} catch (error) {
|
|
449
|
+
return {
|
|
450
|
+
success: false,
|
|
451
|
+
files: [],
|
|
452
|
+
errors: [{ error: error.message }],
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Show success summary after config generation
|
|
459
|
+
* @param {Object} result - Result from generateIDEConfigs
|
|
460
|
+
*/
|
|
461
|
+
function showSuccessSummary(result) {
|
|
462
|
+
if (result.files.length === 0) {
|
|
463
|
+
console.log('\nNo IDE configurations created.');
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
console.log(`\n✅ Created ${result.files.length} IDE configuration(s):`);
|
|
468
|
+
|
|
469
|
+
for (const file of result.files) {
|
|
470
|
+
console.log(` - ${path.basename(file)}`);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
console.log('\n📋 Next Steps:');
|
|
474
|
+
console.log(' 1. Open your project in your selected IDE(s)');
|
|
475
|
+
console.log(' 2. The IDE should automatically recognize AIOS configuration');
|
|
476
|
+
console.log(' 3. Try activating an agent with @agent-name');
|
|
477
|
+
console.log(' 4. Use * commands to interact with agents\n');
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
module.exports = {
|
|
481
|
+
generateIDEConfigs,
|
|
482
|
+
showSuccessSummary,
|
|
483
|
+
renderTemplate,
|
|
484
|
+
validateConfigContent,
|
|
485
|
+
backupFile,
|
|
486
|
+
promptFileExists,
|
|
487
|
+
generateTemplateVariables,
|
|
488
|
+
};
|