aios-core 4.2.15 → 4.4.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/cli/commands/validate/index.js +1 -1
- package/.aios-core/core/code-intel/code-intel-client.js +19 -5
- package/.aios-core/core/code-intel/helpers/creation-helper.js +183 -0
- package/.aios-core/core/code-intel/helpers/devops-helper.js +166 -0
- package/.aios-core/core/code-intel/helpers/planning-helper.js +248 -0
- package/.aios-core/core/code-intel/helpers/qa-helper.js +187 -0
- package/.aios-core/core/code-intel/helpers/story-helper.js +146 -0
- package/.aios-core/core/code-intel/hook-runtime.js +186 -0
- package/.aios-core/core/code-intel/index.js +2 -0
- package/.aios-core/core/code-intel/providers/code-graph-provider.js +8 -0
- package/.aios-core/core/code-intel/providers/provider-interface.js +9 -0
- package/.aios-core/core/code-intel/providers/registry-provider.js +515 -0
- package/.aios-core/core/config/schemas/framework-config.schema.json +155 -7
- package/.aios-core/core/config/schemas/project-config.schema.json +329 -15
- package/.aios-core/core/config/template-overrides.js +84 -0
- package/.aios-core/core/docs/troubleshooting-guide.md +1 -1
- package/.aios-core/core/doctor/checks/agent-memory.js +63 -0
- package/.aios-core/core/doctor/checks/claude-md.js +56 -0
- package/.aios-core/core/doctor/checks/code-intel.js +131 -0
- package/.aios-core/core/doctor/checks/commands-count.js +81 -0
- package/.aios-core/core/doctor/checks/core-config.js +53 -0
- package/.aios-core/core/doctor/checks/entity-registry.js +53 -0
- package/.aios-core/core/doctor/checks/git-hooks.js +50 -0
- package/.aios-core/core/doctor/checks/graph-dashboard.js +48 -0
- package/.aios-core/core/doctor/checks/hooks-claude-count.js +118 -0
- package/.aios-core/core/doctor/checks/ide-sync.js +85 -0
- package/.aios-core/core/doctor/checks/index.js +46 -0
- package/.aios-core/core/doctor/checks/node-version.js +33 -0
- package/.aios-core/core/doctor/checks/npm-packages.js +35 -0
- package/.aios-core/core/doctor/checks/rules-files.js +61 -0
- package/.aios-core/core/doctor/checks/settings-json.js +121 -0
- package/.aios-core/core/doctor/checks/skills-count.js +72 -0
- package/.aios-core/core/doctor/fix-handler.js +165 -0
- package/.aios-core/core/doctor/formatters/json.js +14 -0
- package/.aios-core/core/doctor/formatters/text.js +59 -0
- package/.aios-core/core/doctor/index.js +94 -0
- package/.aios-core/core/graph-dashboard/cli.js +361 -0
- package/.aios-core/core/graph-dashboard/data-sources/code-intel-source.js +234 -0
- package/.aios-core/core/graph-dashboard/data-sources/metrics-source.js +95 -0
- package/.aios-core/core/graph-dashboard/data-sources/registry-source.js +106 -0
- package/.aios-core/core/graph-dashboard/formatters/dot-formatter.js +45 -0
- package/.aios-core/core/graph-dashboard/formatters/html-formatter.js +1437 -0
- package/.aios-core/core/graph-dashboard/formatters/json-formatter.js +13 -0
- package/.aios-core/core/graph-dashboard/formatters/mermaid-formatter.js +59 -0
- package/.aios-core/core/graph-dashboard/index.js +21 -0
- package/.aios-core/core/graph-dashboard/renderers/stats-renderer.js +217 -0
- package/.aios-core/core/graph-dashboard/renderers/status-renderer.js +125 -0
- package/.aios-core/core/graph-dashboard/renderers/tree-renderer.js +119 -0
- package/.aios-core/core/health-check/base-check.js +1 -1
- package/.aios-core/core/health-check/check-registry.js +1 -1
- package/.aios-core/core/health-check/checks/deployment/build-config.js +1 -1
- package/.aios-core/core/health-check/checks/deployment/ci-config.js +1 -1
- package/.aios-core/core/health-check/checks/deployment/deployment-readiness.js +1 -1
- package/.aios-core/core/health-check/checks/deployment/docker-config.js +1 -1
- package/.aios-core/core/health-check/checks/deployment/env-file.js +1 -1
- package/.aios-core/core/health-check/checks/deployment/index.js +1 -1
- package/.aios-core/core/health-check/checks/index.js +1 -1
- package/.aios-core/core/health-check/checks/local/disk-space.js +1 -1
- package/.aios-core/core/health-check/checks/local/environment-vars.js +1 -1
- package/.aios-core/core/health-check/checks/local/git-install.js +1 -1
- package/.aios-core/core/health-check/checks/local/ide-detection.js +1 -1
- package/.aios-core/core/health-check/checks/local/index.js +1 -1
- package/.aios-core/core/health-check/checks/local/memory.js +1 -1
- package/.aios-core/core/health-check/checks/local/network.js +1 -1
- package/.aios-core/core/health-check/checks/local/npm-install.js +1 -1
- package/.aios-core/core/health-check/checks/local/shell-environment.js +1 -1
- package/.aios-core/core/health-check/checks/project/agent-config.js +1 -1
- package/.aios-core/core/health-check/checks/project/aios-directory.js +1 -1
- package/.aios-core/core/health-check/checks/project/dependencies.js +1 -1
- package/.aios-core/core/health-check/checks/project/framework-config.js +1 -1
- package/.aios-core/core/health-check/checks/project/index.js +1 -1
- package/.aios-core/core/health-check/checks/project/node-version.js +1 -1
- package/.aios-core/core/health-check/checks/project/package-json.js +1 -1
- package/.aios-core/core/health-check/checks/project/task-definitions.js +1 -1
- package/.aios-core/core/health-check/checks/project/workflow-dependencies.js +1 -1
- package/.aios-core/core/health-check/checks/repository/branch-protection.js +1 -1
- package/.aios-core/core/health-check/checks/repository/commit-history.js +1 -1
- package/.aios-core/core/health-check/checks/repository/conflicts.js +1 -1
- package/.aios-core/core/health-check/checks/repository/git-repo.js +1 -1
- package/.aios-core/core/health-check/checks/repository/git-status.js +1 -1
- package/.aios-core/core/health-check/checks/repository/gitignore.js +1 -1
- package/.aios-core/core/health-check/checks/repository/index.js +1 -1
- package/.aios-core/core/health-check/checks/repository/large-files.js +1 -1
- package/.aios-core/core/health-check/checks/repository/lockfile-integrity.js +1 -1
- package/.aios-core/core/health-check/checks/services/api-endpoints.js +1 -1
- package/.aios-core/core/health-check/checks/services/claude-code.js +1 -1
- package/.aios-core/core/health-check/checks/services/gemini-cli.js +1 -1
- package/.aios-core/core/health-check/checks/services/github-cli.js +1 -1
- package/.aios-core/core/health-check/checks/services/index.js +1 -1
- package/.aios-core/core/health-check/checks/services/mcp-integration.js +1 -1
- package/.aios-core/core/health-check/engine.js +1 -1
- package/.aios-core/core/health-check/healers/backup-manager.js +1 -1
- package/.aios-core/core/health-check/healers/index.js +1 -1
- package/.aios-core/core/health-check/index.js +9 -2
- package/.aios-core/core/health-check/reporters/console.js +1 -1
- package/.aios-core/core/health-check/reporters/index.js +1 -1
- package/.aios-core/core/health-check/reporters/json.js +1 -1
- package/.aios-core/core/health-check/reporters/markdown.js +1 -1
- package/.aios-core/core/ids/layer-classifier.js +65 -0
- package/.aios-core/core/ids/registry-updater.js +49 -0
- package/.aios-core/core/index.esm.js +1 -1
- package/.aios-core/core/index.js +1 -1
- package/.aios-core/core/session/context-detector.js +2 -7
- package/.aios-core/core/synapse/context/context-tracker.js +9 -1
- package/.aios-core/core/synapse/engine.js +33 -13
- package/.aios-core/core/synapse/memory/memory-bridge.js +17 -43
- package/.aios-core/core/synapse/memory/synapse-memory-provider.js +201 -0
- package/.aios-core/core/synapse/runtime/hook-runtime.js +40 -2
- package/.aios-core/core/synapse/session/session-manager.js +3 -2
- package/.aios-core/core/synapse/utils/atomic-write.js +79 -0
- package/.aios-core/core-config.yaml +34 -1
- package/.aios-core/data/aios-kb.md +2 -2
- package/.aios-core/data/capability-detection.js +290 -0
- package/.aios-core/data/entity-registry.yaml +10450 -2129
- package/.aios-core/data/mcp-discipline.js +166 -0
- package/.aios-core/data/mcp-tool-examples.yaml +215 -0
- package/.aios-core/data/tok2-validation.js +168 -0
- package/.aios-core/data/tok3-token-comparison.js +123 -0
- package/.aios-core/data/tool-registry.yaml +648 -0
- package/.aios-core/data/tool-search-validation.js +174 -0
- package/.aios-core/data/workflow-chains.yaml +156 -0
- package/.aios-core/development/agents/aios-master.md +17 -10
- package/.aios-core/development/agents/analyst/MEMORY.md +33 -0
- package/.aios-core/development/agents/analyst.md +17 -10
- package/.aios-core/development/agents/architect/MEMORY.md +39 -0
- package/.aios-core/development/agents/architect.md +17 -10
- package/.aios-core/development/agents/data-engineer/MEMORY.md +32 -0
- package/.aios-core/development/agents/data-engineer.md +17 -10
- package/.aios-core/development/agents/dev/MEMORY.md +46 -0
- package/.aios-core/development/agents/dev.md +18 -11
- package/.aios-core/development/agents/devops/MEMORY.md +39 -0
- package/.aios-core/development/agents/devops.md +44 -10
- package/.aios-core/development/agents/pm/MEMORY.md +38 -0
- package/.aios-core/development/agents/pm.md +17 -10
- package/.aios-core/development/agents/po/MEMORY.md +45 -0
- package/.aios-core/development/agents/po.md +17 -10
- package/.aios-core/development/agents/qa/MEMORY.md +42 -0
- package/.aios-core/development/agents/qa.md +18 -11
- package/.aios-core/development/agents/sm/MEMORY.md +31 -0
- package/.aios-core/development/agents/sm.md +17 -10
- package/.aios-core/development/agents/squad-creator.md +18 -9
- package/.aios-core/development/agents/ux/MEMORY.md +31 -0
- package/.aios-core/development/agents/ux-design-expert.md +16 -9
- package/.aios-core/development/checklists/issue-triage-checklist.md +35 -0
- package/.aios-core/development/checklists/memory-audit-checklist.md +53 -0
- package/.aios-core/development/scripts/issue-triage.js +171 -0
- package/.aios-core/development/scripts/populate-entity-registry.js +412 -19
- package/.aios-core/development/scripts/unified-activation-pipeline.js +31 -10
- package/.aios-core/development/tasks/analyze-project-structure.md +48 -0
- package/.aios-core/development/tasks/apply-qa-fixes.md +7 -0
- package/.aios-core/development/tasks/architect-analyze-impact.md +8 -1
- package/.aios-core/development/tasks/brownfield-create-epic.md +41 -0
- package/.aios-core/development/tasks/brownfield-create-story.md +7 -0
- package/.aios-core/development/tasks/build-autonomous.md +7 -0
- package/.aios-core/development/tasks/create-deep-research-prompt.md +7 -0
- package/.aios-core/development/tasks/create-doc.md +44 -0
- package/.aios-core/development/tasks/create-next-story.md +17 -0
- package/.aios-core/development/tasks/create-suite.md +7 -0
- package/.aios-core/development/tasks/dev-develop-story.md +9 -1
- package/.aios-core/development/tasks/execute-checklist.md +7 -0
- package/.aios-core/development/tasks/github-devops-github-pr-automation.md +56 -0
- package/.aios-core/development/tasks/github-devops-pre-push-quality-gate.md +70 -0
- package/.aios-core/development/tasks/github-issue-triage.md +118 -0
- package/.aios-core/development/tasks/health-check.yaml +206 -171
- package/.aios-core/development/tasks/kb-mode-interaction.md +3 -3
- package/.aios-core/development/tasks/plan-create-context.md +47 -1
- package/.aios-core/development/tasks/plan-create-implementation.md +55 -0
- package/.aios-core/development/tasks/po-close-story.md +7 -0
- package/.aios-core/development/tasks/pr-automation.md +5 -5
- package/.aios-core/development/tasks/qa-create-fix-request.md +7 -0
- package/.aios-core/development/tasks/qa-fix-issues.md +7 -0
- package/.aios-core/development/tasks/qa-gate.md +56 -0
- package/.aios-core/development/tasks/qa-review-story.md +32 -1
- package/.aios-core/development/tasks/release-management.md +7 -0
- package/.aios-core/development/tasks/resolve-github-issue.md +608 -0
- package/.aios-core/development/tasks/review-contributor-pr.md +152 -0
- package/.aios-core/development/tasks/setup-llm-routing.md +1 -1
- package/.aios-core/development/tasks/spec-critique.md +8 -0
- package/.aios-core/development/tasks/spec-gather-requirements.md +7 -0
- package/.aios-core/development/tasks/spec-research-dependencies.md +4 -0
- package/.aios-core/development/tasks/spec-write-spec.md +5 -0
- package/.aios-core/development/tasks/triage-github-issues.md +356 -0
- package/.aios-core/development/tasks/validate-agents.md +4 -0
- package/.aios-core/development/tasks/validate-next-story.md +17 -0
- package/.aios-core/development/templates/agent-handoff-tmpl.yaml +48 -0
- package/.aios-core/development/templates/code-intel-integration-pattern.md +199 -0
- package/.aios-core/development/templates/ptc-entity-validation.md +113 -0
- package/.aios-core/development/templates/ptc-qa-gate.md +100 -0
- package/.aios-core/development/templates/ptc-research-aggregation.md +94 -0
- package/.aios-core/development/templates/service-template/README.md.hbs +158 -158
- package/.aios-core/development/templates/service-template/__tests__/index.test.ts.hbs +237 -237
- package/.aios-core/development/templates/service-template/client.ts.hbs +403 -403
- package/.aios-core/development/templates/service-template/errors.ts.hbs +182 -182
- package/.aios-core/development/templates/service-template/index.ts.hbs +120 -120
- package/.aios-core/development/templates/service-template/package.json.hbs +87 -87
- package/.aios-core/development/templates/service-template/types.ts.hbs +145 -145
- package/.aios-core/development/templates/squad/agent-template.md +11 -0
- package/.aios-core/development/templates/squad/task-template.md +21 -0
- package/.aios-core/development/templates/squad-template/LICENSE +21 -21
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-COMPLETE.md +1 -1
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.2-SUMMARY.md +1 -1
- package/.aios-core/framework-config.yaml +8 -0
- package/.aios-core/index.esm.js +1 -1
- package/.aios-core/index.js +1 -1
- package/.aios-core/infrastructure/integrations/ai-providers/index.js +1 -1
- package/.aios-core/infrastructure/schemas/task-v3-schema.json +6 -0
- package/.aios-core/infrastructure/scripts/collect-tool-usage.js +311 -0
- package/.aios-core/infrastructure/scripts/generate-optimization-report.js +497 -0
- package/.aios-core/infrastructure/scripts/generate-settings-json.js +300 -0
- package/.aios-core/infrastructure/scripts/git-config-detector.js +65 -9
- package/.aios-core/infrastructure/scripts/ide-sync/index.js +3 -1
- package/.aios-core/infrastructure/scripts/ide-sync/transformers/github-copilot.js +184 -0
- package/.aios-core/infrastructure/scripts/repository-detector.js +3 -3
- package/.aios-core/infrastructure/templates/aios-sync.yaml.template +182 -182
- package/.aios-core/infrastructure/templates/coderabbit.yaml.template +279 -279
- package/.aios-core/infrastructure/templates/github-workflows/ci.yml.template +169 -169
- package/.aios-core/infrastructure/templates/github-workflows/pr-automation.yml.template +330 -330
- package/.aios-core/infrastructure/templates/github-workflows/release.yml.template +196 -196
- package/.aios-core/infrastructure/templates/gitignore/gitignore-aios-base.tmpl +63 -63
- package/.aios-core/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +18 -18
- package/.aios-core/infrastructure/templates/gitignore/gitignore-node.tmpl +85 -85
- package/.aios-core/infrastructure/templates/gitignore/gitignore-python.tmpl +145 -145
- package/.aios-core/install-manifest.yaml +613 -305
- package/.aios-core/lib/build.json +1 -0
- package/.aios-core/local-config.yaml.template +71 -71
- package/.aios-core/monitor/hooks/lib/__init__.py +1 -1
- package/.aios-core/monitor/hooks/lib/enrich.py +58 -58
- package/.aios-core/monitor/hooks/lib/send_event.py +47 -47
- package/.aios-core/monitor/hooks/notification.py +29 -29
- package/.aios-core/monitor/hooks/post_tool_use.py +45 -45
- package/.aios-core/monitor/hooks/pre_compact.py +29 -29
- package/.aios-core/monitor/hooks/pre_tool_use.py +40 -40
- package/.aios-core/monitor/hooks/stop.py +29 -29
- package/.aios-core/monitor/hooks/subagent_stop.py +29 -29
- package/.aios-core/monitor/hooks/user_prompt_submit.py +38 -38
- package/.aios-core/product/templates/adr.hbs +125 -125
- package/.aios-core/product/templates/dbdr.hbs +241 -241
- package/.aios-core/product/templates/epic.hbs +212 -212
- package/.aios-core/product/templates/ide-rules/claude-rules.md +125 -0
- package/.aios-core/product/templates/pmdr.hbs +186 -186
- package/.aios-core/product/templates/prd-v2.0.hbs +216 -216
- package/.aios-core/product/templates/prd.hbs +201 -201
- package/.aios-core/product/templates/story.hbs +263 -263
- package/.aios-core/product/templates/task.hbs +170 -170
- package/.aios-core/product/templates/tmpl-comment-on-examples.sql +158 -158
- package/.aios-core/product/templates/tmpl-migration-script.sql +91 -91
- package/.aios-core/product/templates/tmpl-rls-granular-policies.sql +104 -104
- package/.aios-core/product/templates/tmpl-rls-kiss-policy.sql +10 -10
- package/.aios-core/product/templates/tmpl-rls-roles.sql +135 -135
- package/.aios-core/product/templates/tmpl-rls-simple.sql +77 -77
- package/.aios-core/product/templates/tmpl-rls-tenant.sql +152 -152
- package/.aios-core/product/templates/tmpl-rollback-script.sql +77 -77
- package/.aios-core/product/templates/tmpl-seed-data.sql +140 -140
- package/.aios-core/product/templates/tmpl-smoke-test.sql +16 -16
- package/.aios-core/product/templates/tmpl-staging-copy-merge.sql +139 -139
- package/.aios-core/product/templates/tmpl-stored-proc.sql +140 -140
- package/.aios-core/product/templates/tmpl-trigger.sql +152 -152
- package/.aios-core/product/templates/tmpl-view-materialized.sql +133 -133
- package/.aios-core/product/templates/tmpl-view.sql +177 -177
- package/.aios-core/scripts/pm.sh +0 -0
- package/.aios-core/user-guide.md +15 -15
- package/.aios-core/utils/filters/constants.js +10 -0
- package/.aios-core/utils/filters/content-filter.js +223 -0
- package/.aios-core/utils/filters/field-filter.js +126 -0
- package/.aios-core/utils/filters/index.js +180 -0
- package/.aios-core/utils/filters/schema-filter.js +157 -0
- package/.claude/CLAUDE.md +62 -0
- package/.claude/hooks/enforce-architecture-first.py +196 -196
- package/.claude/hooks/enforce-git-push-authority.sh +33 -0
- package/.claude/hooks/mind-clone-governance.py +192 -192
- package/.claude/hooks/read-protection.py +151 -151
- package/.claude/hooks/slug-validation.py +176 -176
- package/.claude/hooks/sql-governance.py +182 -182
- package/.claude/hooks/synapse-engine.cjs +28 -5
- package/.claude/hooks/write-path-validation.py +194 -194
- package/.claude/rules/agent-authority.md +105 -0
- package/.claude/rules/agent-handoff.md +97 -0
- package/.claude/rules/agent-memory-imports.md +15 -0
- package/.claude/rules/coderabbit-integration.md +101 -0
- package/.claude/rules/ids-principles.md +119 -0
- package/.claude/rules/story-lifecycle.md +145 -0
- package/.claude/rules/tool-examples.md +64 -0
- package/.claude/rules/tool-response-filtering.md +57 -0
- package/.claude/rules/workflow-execution.md +150 -0
- package/LICENSE +33 -33
- package/bin/aios-graph.js +9 -0
- package/bin/aios-init.js +2 -2
- package/bin/aios-minimal.js +0 -0
- package/bin/aios.js +17 -221
- package/bin/utils/detect-fsmonitor.js +70 -0
- package/bin/utils/framework-guard.js +238 -0
- package/bin/utils/validate-publish.js +108 -0
- package/package.json +6 -3
- package/packages/aios-install/bin/aios-install.js +0 -0
- package/packages/aios-install/bin/edmcp.js +0 -0
- package/packages/aios-pro-cli/bin/aios-pro.js +2 -0
- package/packages/installer/src/config/templates/core-config-template.js +25 -0
- package/packages/installer/src/installer/brownfield-upgrader.js +68 -5
- package/packages/installer/src/merger/index.js +3 -0
- package/packages/installer/src/merger/strategies/index.js +6 -0
- package/packages/installer/src/merger/strategies/yaml-merger.js +181 -0
- package/packages/installer/src/updater/index.js +4 -4
- package/packages/installer/src/wizard/i18n.js +321 -3
- package/packages/installer/src/wizard/ide-config-generator.js +173 -25
- package/packages/installer/src/wizard/index.js +119 -1
- package/packages/installer/src/wizard/pro-setup.js +137 -121
- package/packages/installer/tests/unit/artifact-copy-pipeline/artifact-copy-pipeline.test.js +271 -0
- package/packages/installer/tests/unit/claude-md-template-v5/claude-md-template-v5.test.js +192 -0
- package/packages/installer/tests/unit/doctor/doctor-checks.test.js +610 -0
- package/packages/installer/tests/unit/doctor/doctor-orchestrator.test.js +134 -0
- package/packages/installer/tests/unit/entity-registry-bootstrap.test.js +186 -0
- package/packages/installer/tests/unit/generate-settings-json/generate-settings-json.test.js +309 -0
- package/packages/installer/tests/unit/ide-sync-integration/ide-sync-integration.test.js +230 -0
- package/packages/installer/tests/unit/merger/strategies.test.js +2 -2
- package/packages/installer/tests/unit/merger/yaml-merger.test.js +327 -0
- package/scripts/check-markdown-links.py +352 -352
- package/scripts/dashboard-parallel-dev.sh +0 -0
- package/scripts/dashboard-parallel-phase3.sh +0 -0
- package/scripts/dashboard-parallel-phase4.sh +0 -0
- package/scripts/install-monitor-hooks.sh +0 -0
- package/scripts/package-synapse.js +2 -1
- package/pro/README.md +0 -66
- package/pro/license/degradation.js +0 -220
- package/pro/license/errors.js +0 -450
- package/pro/license/feature-gate.js +0 -354
- package/pro/license/index.js +0 -181
- package/pro/license/license-api.js +0 -651
- package/pro/license/license-cache.js +0 -523
- package/pro/license/license-crypto.js +0 -303
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
const { createSpinner, showSuccess, showError, showWarning, showInfo } = require('./feedback');
|
|
19
19
|
const { colors, status } = require('../utils/aios-colors');
|
|
20
|
+
const { t, tf } = require('./i18n');
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Gold color for Pro branding.
|
|
@@ -30,6 +31,11 @@ try {
|
|
|
30
31
|
gold = (text) => text;
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* License server base URL (same source of truth as license-api.js CONFIG.BASE_URL).
|
|
36
|
+
*/
|
|
37
|
+
const LICENSE_SERVER_URL = process.env.AIOS_LICENSE_API_URL || 'https://aios-license-server.vercel.app';
|
|
38
|
+
|
|
33
39
|
/**
|
|
34
40
|
* License key format: PRO-XXXX-XXXX-XXXX-XXXX
|
|
35
41
|
*/
|
|
@@ -109,11 +115,20 @@ function validateKeyFormat(key) {
|
|
|
109
115
|
* Show the Pro branding header.
|
|
110
116
|
*/
|
|
111
117
|
function showProHeader() {
|
|
118
|
+
const title = t('proWizardTitle');
|
|
119
|
+
const subtitle = t('proWizardSubtitle');
|
|
120
|
+
const maxLen = Math.max(title.length, subtitle.length) + 10;
|
|
121
|
+
const pad = (str) => {
|
|
122
|
+
const totalPad = maxLen - str.length;
|
|
123
|
+
const left = Math.floor(totalPad / 2);
|
|
124
|
+
const right = totalPad - left;
|
|
125
|
+
return ' '.repeat(left) + str + ' '.repeat(right);
|
|
126
|
+
};
|
|
112
127
|
console.log('');
|
|
113
|
-
console.log(gold('
|
|
114
|
-
console.log(gold(' ║
|
|
115
|
-
console.log(gold(' ║
|
|
116
|
-
console.log(gold('
|
|
128
|
+
console.log(gold(' ╔' + '═'.repeat(maxLen) + '╗'));
|
|
129
|
+
console.log(gold(' ║' + pad(title) + '║'));
|
|
130
|
+
console.log(gold(' ║' + pad(subtitle) + '║'));
|
|
131
|
+
console.log(gold(' ╚' + '═'.repeat(maxLen) + '╝'));
|
|
117
132
|
console.log('');
|
|
118
133
|
}
|
|
119
134
|
|
|
@@ -186,7 +201,7 @@ function loadProScaffolder() {
|
|
|
186
201
|
* @returns {Promise<Object>} Result with { success, key, activationResult }
|
|
187
202
|
*/
|
|
188
203
|
async function stepLicenseGate(options = {}) {
|
|
189
|
-
showStep(1, 3, '
|
|
204
|
+
showStep(1, 3, t('proLicenseActivation'));
|
|
190
205
|
|
|
191
206
|
const isCI = isCIEnvironment();
|
|
192
207
|
|
|
@@ -212,14 +227,14 @@ async function stepLicenseGate(options = {}) {
|
|
|
212
227
|
{
|
|
213
228
|
type: 'list',
|
|
214
229
|
name: 'method',
|
|
215
|
-
message: colors.primary('
|
|
230
|
+
message: colors.primary(t('proHowActivate')),
|
|
216
231
|
choices: [
|
|
217
232
|
{
|
|
218
|
-
name: '
|
|
233
|
+
name: t('proLoginOrCreate'),
|
|
219
234
|
value: 'email',
|
|
220
235
|
},
|
|
221
236
|
{
|
|
222
|
-
name: '
|
|
237
|
+
name: t('proEnterKey'),
|
|
223
238
|
value: 'key',
|
|
224
239
|
},
|
|
225
240
|
],
|
|
@@ -257,7 +272,7 @@ async function stepLicenseGateCI(options) {
|
|
|
257
272
|
|
|
258
273
|
return {
|
|
259
274
|
success: false,
|
|
260
|
-
error: '
|
|
275
|
+
error: t('proCISetEnv'),
|
|
261
276
|
};
|
|
262
277
|
}
|
|
263
278
|
|
|
@@ -280,13 +295,13 @@ async function stepLicenseGateWithEmail() {
|
|
|
280
295
|
{
|
|
281
296
|
type: 'input',
|
|
282
297
|
name: 'email',
|
|
283
|
-
message: colors.primary('
|
|
298
|
+
message: colors.primary(t('proEmailLabel')),
|
|
284
299
|
validate: (input) => {
|
|
285
300
|
if (!input || !input.trim()) {
|
|
286
|
-
return '
|
|
301
|
+
return t('proEmailRequired');
|
|
287
302
|
}
|
|
288
303
|
if (!EMAIL_PATTERN.test(input.trim())) {
|
|
289
|
-
return '
|
|
304
|
+
return t('proEmailInvalid');
|
|
290
305
|
}
|
|
291
306
|
return true;
|
|
292
307
|
},
|
|
@@ -302,7 +317,7 @@ async function stepLicenseGateWithEmail() {
|
|
|
302
317
|
if (!licenseModule) {
|
|
303
318
|
return {
|
|
304
319
|
success: false,
|
|
305
|
-
error: '
|
|
320
|
+
error: t('proModuleNotAvailable'),
|
|
306
321
|
};
|
|
307
322
|
}
|
|
308
323
|
|
|
@@ -314,39 +329,39 @@ async function stepLicenseGateWithEmail() {
|
|
|
314
329
|
if (!online) {
|
|
315
330
|
return {
|
|
316
331
|
success: false,
|
|
317
|
-
error: '
|
|
332
|
+
error: t('proServerUnreachable'),
|
|
318
333
|
};
|
|
319
334
|
}
|
|
320
335
|
|
|
321
|
-
const checkSpinner = createSpinner('
|
|
336
|
+
const checkSpinner = createSpinner(t('proVerifyingAccess'));
|
|
322
337
|
checkSpinner.start();
|
|
323
338
|
|
|
324
339
|
let checkResult;
|
|
325
340
|
try {
|
|
326
341
|
checkResult = await client.checkEmail(trimmedEmail);
|
|
327
342
|
} catch (checkError) {
|
|
328
|
-
checkSpinner.fail(
|
|
343
|
+
checkSpinner.fail(tf('proVerificationFailed', { message: checkError.message }));
|
|
329
344
|
return { success: false, error: checkError.message };
|
|
330
345
|
}
|
|
331
346
|
|
|
332
347
|
// Step 2a: NOT a buyer → stop
|
|
333
348
|
if (!checkResult.isBuyer) {
|
|
334
|
-
checkSpinner.fail('
|
|
349
|
+
checkSpinner.fail(t('proNoAccess'));
|
|
335
350
|
console.log('');
|
|
336
|
-
showInfo('
|
|
337
|
-
showInfo('
|
|
338
|
-
showInfo('
|
|
339
|
-
return { success: false, error: '
|
|
351
|
+
showInfo(t('proContactSupport'));
|
|
352
|
+
showInfo(' Issues: https://github.com/SynkraAI/aios-core/issues');
|
|
353
|
+
showInfo(' ' + t('proPurchase'));
|
|
354
|
+
return { success: false, error: t('proEmailNotBuyer') };
|
|
340
355
|
}
|
|
341
356
|
|
|
342
357
|
// Step 2b: IS a buyer
|
|
343
358
|
if (checkResult.hasAccount) {
|
|
344
|
-
checkSpinner.succeed('
|
|
359
|
+
checkSpinner.succeed(t('proAccessConfirmedAccount'));
|
|
345
360
|
// Flow 3: Existing account → Login with password (retry loop)
|
|
346
361
|
return loginWithRetry(client, trimmedEmail);
|
|
347
362
|
}
|
|
348
363
|
|
|
349
|
-
checkSpinner.succeed('
|
|
364
|
+
checkSpinner.succeed(t('proAccessConfirmedCreate'));
|
|
350
365
|
// Flow 4: New account → Create account flow
|
|
351
366
|
return createAccountFlow(client, trimmedEmail);
|
|
352
367
|
}
|
|
@@ -366,23 +381,23 @@ async function loginWithRetry(client, email) {
|
|
|
366
381
|
{
|
|
367
382
|
type: 'password',
|
|
368
383
|
name: 'password',
|
|
369
|
-
message: colors.primary('
|
|
384
|
+
message: colors.primary(t('proPasswordLabel')),
|
|
370
385
|
mask: '*',
|
|
371
386
|
validate: (input) => {
|
|
372
387
|
if (!input || input.length < MIN_PASSWORD_LENGTH) {
|
|
373
|
-
return
|
|
388
|
+
return tf('proPasswordMin', { min: MIN_PASSWORD_LENGTH });
|
|
374
389
|
}
|
|
375
390
|
return true;
|
|
376
391
|
},
|
|
377
392
|
},
|
|
378
393
|
]);
|
|
379
394
|
|
|
380
|
-
const spinner = createSpinner('
|
|
395
|
+
const spinner = createSpinner(t('proAuthenticating'));
|
|
381
396
|
spinner.start();
|
|
382
397
|
|
|
383
398
|
try {
|
|
384
399
|
const loginResult = await client.login(email, password);
|
|
385
|
-
spinner.succeed('
|
|
400
|
+
spinner.succeed(t('proAuthSuccess'));
|
|
386
401
|
|
|
387
402
|
// Wait for email verification if needed
|
|
388
403
|
if (!loginResult.emailVerified) {
|
|
@@ -397,15 +412,15 @@ async function loginWithRetry(client, email) {
|
|
|
397
412
|
} catch (loginError) {
|
|
398
413
|
if (loginError.code === 'EMAIL_NOT_VERIFIED') {
|
|
399
414
|
// Email not verified — poll by retrying login until verified
|
|
400
|
-
spinner.info('
|
|
401
|
-
console.log(colors.dim('
|
|
415
|
+
spinner.info(t('proEmailNotVerified'));
|
|
416
|
+
console.log(colors.dim(' ' + t('proCheckingEvery')));
|
|
402
417
|
|
|
403
418
|
const startTime = Date.now();
|
|
404
419
|
while (Date.now() - startTime < VERIFY_POLL_TIMEOUT_MS) {
|
|
405
420
|
await new Promise((resolve) => setTimeout(resolve, VERIFY_POLL_INTERVAL_MS));
|
|
406
421
|
try {
|
|
407
422
|
const retryLogin = await client.login(email, password);
|
|
408
|
-
showSuccess('
|
|
423
|
+
showSuccess(t('proEmailVerified'));
|
|
409
424
|
if (!retryLogin.emailVerified) {
|
|
410
425
|
const verifyResult = await waitForEmailVerification(client, retryLogin.sessionToken, email);
|
|
411
426
|
if (!verifyResult.success) return verifyResult;
|
|
@@ -419,9 +434,9 @@ async function loginWithRetry(client, email) {
|
|
|
419
434
|
}
|
|
420
435
|
}
|
|
421
436
|
|
|
422
|
-
showError('
|
|
423
|
-
showInfo('
|
|
424
|
-
return { success: false, error: '
|
|
437
|
+
showError(t('proVerificationTimeout'));
|
|
438
|
+
showInfo(t('proRunAgain'));
|
|
439
|
+
return { success: false, error: t('proVerificationTimeout') };
|
|
425
440
|
} else if (loginError.code === 'INVALID_CREDENTIALS') {
|
|
426
441
|
const remaining = MAX_RETRIES - attempt;
|
|
427
442
|
if (remaining > 0) {
|
|
@@ -437,13 +452,13 @@ async function loginWithRetry(client, email) {
|
|
|
437
452
|
spinner.fail(loginError.message);
|
|
438
453
|
return { success: false, error: loginError.message };
|
|
439
454
|
} else {
|
|
440
|
-
spinner.fail(
|
|
455
|
+
spinner.fail(tf('proAuthFailed', { message: loginError.message }));
|
|
441
456
|
return { success: false, error: loginError.message };
|
|
442
457
|
}
|
|
443
458
|
}
|
|
444
459
|
}
|
|
445
460
|
|
|
446
|
-
return { success: false, error: '
|
|
461
|
+
return { success: false, error: t('proMaxAttempts') };
|
|
447
462
|
}
|
|
448
463
|
|
|
449
464
|
/**
|
|
@@ -459,18 +474,18 @@ async function createAccountFlow(client, email) {
|
|
|
459
474
|
const inquirer = require('inquirer');
|
|
460
475
|
|
|
461
476
|
console.log('');
|
|
462
|
-
showInfo('
|
|
477
|
+
showInfo(t('proCreateAccount'));
|
|
463
478
|
|
|
464
479
|
// Ask for password with confirmation
|
|
465
480
|
const { newPassword } = await inquirer.prompt([
|
|
466
481
|
{
|
|
467
482
|
type: 'password',
|
|
468
483
|
name: 'newPassword',
|
|
469
|
-
message: colors.primary('
|
|
484
|
+
message: colors.primary(t('proChoosePassword')),
|
|
470
485
|
mask: '*',
|
|
471
486
|
validate: (input) => {
|
|
472
487
|
if (!input || input.length < MIN_PASSWORD_LENGTH) {
|
|
473
|
-
return
|
|
488
|
+
return tf('proPasswordMin', { min: MIN_PASSWORD_LENGTH });
|
|
474
489
|
}
|
|
475
490
|
return true;
|
|
476
491
|
},
|
|
@@ -481,11 +496,11 @@ async function createAccountFlow(client, email) {
|
|
|
481
496
|
{
|
|
482
497
|
type: 'password',
|
|
483
498
|
name: 'confirmPassword',
|
|
484
|
-
message: colors.primary('
|
|
499
|
+
message: colors.primary(t('proConfirmPassword')),
|
|
485
500
|
mask: '*',
|
|
486
501
|
validate: (input) => {
|
|
487
502
|
if (input !== newPassword) {
|
|
488
|
-
return '
|
|
503
|
+
return t('proPasswordsNoMatch');
|
|
489
504
|
}
|
|
490
505
|
return true;
|
|
491
506
|
},
|
|
@@ -493,25 +508,25 @@ async function createAccountFlow(client, email) {
|
|
|
493
508
|
]);
|
|
494
509
|
|
|
495
510
|
// Create account
|
|
496
|
-
const spinner = createSpinner('
|
|
511
|
+
const spinner = createSpinner(t('proCreatingAccount'));
|
|
497
512
|
spinner.start();
|
|
498
513
|
|
|
499
514
|
let sessionToken;
|
|
500
515
|
try {
|
|
501
516
|
await client.signup(email, confirmPassword);
|
|
502
|
-
spinner.succeed('
|
|
517
|
+
spinner.succeed(t('proAccountCreated'));
|
|
503
518
|
} catch (signupError) {
|
|
504
519
|
if (signupError.code === 'EMAIL_ALREADY_REGISTERED') {
|
|
505
|
-
spinner.info('
|
|
520
|
+
spinner.info(t('proAccountExists'));
|
|
506
521
|
return loginWithRetry(client, email);
|
|
507
522
|
}
|
|
508
|
-
spinner.fail(
|
|
523
|
+
spinner.fail(tf('proAccountFailed', { message: signupError.message }));
|
|
509
524
|
return { success: false, error: signupError.message };
|
|
510
525
|
}
|
|
511
526
|
|
|
512
527
|
// Wait for email verification
|
|
513
528
|
console.log('');
|
|
514
|
-
showInfo('
|
|
529
|
+
showInfo(t('proCheckEmail'));
|
|
515
530
|
|
|
516
531
|
// Login after signup to get session token
|
|
517
532
|
try {
|
|
@@ -528,8 +543,8 @@ async function createAccountFlow(client, email) {
|
|
|
528
543
|
}
|
|
529
544
|
} else {
|
|
530
545
|
// Need to wait for verification then login
|
|
531
|
-
showInfo('
|
|
532
|
-
showInfo('
|
|
546
|
+
showInfo(t('proWaitingVerification'));
|
|
547
|
+
showInfo(t('proAfterVerifying'));
|
|
533
548
|
|
|
534
549
|
// Poll by trying to login periodically
|
|
535
550
|
const startTime = Date.now();
|
|
@@ -554,9 +569,9 @@ async function createAccountFlow(client, email) {
|
|
|
554
569
|
}
|
|
555
570
|
|
|
556
571
|
if (!sessionToken) {
|
|
557
|
-
showError('
|
|
558
|
-
showInfo('
|
|
559
|
-
return { success: false, error: '
|
|
572
|
+
showError(t('proVerificationTimeout'));
|
|
573
|
+
showInfo(t('proRunAgain'));
|
|
574
|
+
return { success: false, error: t('proVerificationTimeout') };
|
|
560
575
|
}
|
|
561
576
|
}
|
|
562
577
|
|
|
@@ -581,7 +596,7 @@ async function authenticateWithEmail(email, password) {
|
|
|
581
596
|
if (!licenseModule) {
|
|
582
597
|
return {
|
|
583
598
|
success: false,
|
|
584
|
-
error: '
|
|
599
|
+
error: t('proModuleNotAvailable'),
|
|
585
600
|
};
|
|
586
601
|
}
|
|
587
602
|
|
|
@@ -593,27 +608,27 @@ async function authenticateWithEmail(email, password) {
|
|
|
593
608
|
if (!online) {
|
|
594
609
|
return {
|
|
595
610
|
success: false,
|
|
596
|
-
error: '
|
|
611
|
+
error: t('proServerUnreachable'),
|
|
597
612
|
};
|
|
598
613
|
}
|
|
599
614
|
|
|
600
615
|
// CI mode: check buyer first, then try login or auto-signup
|
|
601
|
-
const checkSpinner = createSpinner('
|
|
616
|
+
const checkSpinner = createSpinner(t('proVerifyingAccessShort'));
|
|
602
617
|
checkSpinner.start();
|
|
603
618
|
|
|
604
619
|
try {
|
|
605
620
|
const checkResult = await client.checkEmail(email);
|
|
606
621
|
if (!checkResult.isBuyer) {
|
|
607
|
-
checkSpinner.fail('
|
|
608
|
-
return { success: false, error: '
|
|
622
|
+
checkSpinner.fail(t('proNoAccess'));
|
|
623
|
+
return { success: false, error: t('proEmailNotBuyer') };
|
|
609
624
|
}
|
|
610
|
-
checkSpinner.succeed('
|
|
625
|
+
checkSpinner.succeed(t('proAccessConfirmed'));
|
|
611
626
|
} catch {
|
|
612
|
-
checkSpinner.info('
|
|
627
|
+
checkSpinner.info(t('proBuyerCheckUnavailable'));
|
|
613
628
|
}
|
|
614
629
|
|
|
615
630
|
// Try login
|
|
616
|
-
const spinner = createSpinner('
|
|
631
|
+
const spinner = createSpinner(t('proAuthenticating'));
|
|
617
632
|
spinner.start();
|
|
618
633
|
|
|
619
634
|
let sessionToken;
|
|
@@ -623,31 +638,31 @@ async function authenticateWithEmail(email, password) {
|
|
|
623
638
|
const loginResult = await client.login(email, password);
|
|
624
639
|
sessionToken = loginResult.sessionToken;
|
|
625
640
|
emailVerified = loginResult.emailVerified;
|
|
626
|
-
spinner.succeed('
|
|
641
|
+
spinner.succeed(t('proAuthSuccess'));
|
|
627
642
|
} catch (loginError) {
|
|
628
643
|
if (loginError.code === 'INVALID_CREDENTIALS') {
|
|
629
|
-
spinner.info('
|
|
644
|
+
spinner.info(t('proLoginFailedSignup'));
|
|
630
645
|
try {
|
|
631
646
|
await client.signup(email, password);
|
|
632
|
-
showSuccess('
|
|
647
|
+
showSuccess(t('proAccountCreatedVerify'));
|
|
633
648
|
emailVerified = false;
|
|
634
649
|
const loginAfterSignup = await client.login(email, password);
|
|
635
650
|
sessionToken = loginAfterSignup.sessionToken;
|
|
636
651
|
} catch (signupError) {
|
|
637
652
|
if (signupError.code === 'EMAIL_ALREADY_REGISTERED') {
|
|
638
|
-
showError('
|
|
639
|
-
return { success: false, error: '
|
|
653
|
+
showError(t('proAccountExistsWrongPw'));
|
|
654
|
+
return { success: false, error: t('proAccountExistsWrongPw') };
|
|
640
655
|
}
|
|
641
656
|
return { success: false, error: signupError.message };
|
|
642
657
|
}
|
|
643
658
|
} else {
|
|
644
|
-
spinner.fail(
|
|
659
|
+
spinner.fail(tf('proAuthFailed', { message: loginError.message }));
|
|
645
660
|
return { success: false, error: loginError.message };
|
|
646
661
|
}
|
|
647
662
|
}
|
|
648
663
|
|
|
649
664
|
if (!sessionToken) {
|
|
650
|
-
return { success: false, error: '
|
|
665
|
+
return { success: false, error: t('proAuthFailedShort') };
|
|
651
666
|
}
|
|
652
667
|
|
|
653
668
|
// Wait for email verification if needed
|
|
@@ -675,12 +690,12 @@ async function authenticateWithEmail(email, password) {
|
|
|
675
690
|
*/
|
|
676
691
|
async function waitForEmailVerification(client, sessionToken, email) {
|
|
677
692
|
console.log('');
|
|
678
|
-
showInfo('
|
|
679
|
-
showInfo('
|
|
680
|
-
console.log(colors.dim('
|
|
693
|
+
showInfo(t('proWaitingVerification'));
|
|
694
|
+
showInfo(t('proCheckEmail'));
|
|
695
|
+
console.log(colors.dim(' ' + t('proCheckingEvery')));
|
|
681
696
|
|
|
682
697
|
if (!isCIEnvironment()) {
|
|
683
|
-
console.log(colors.dim('
|
|
698
|
+
console.log(colors.dim(' ' + t('proPressResend')));
|
|
684
699
|
}
|
|
685
700
|
|
|
686
701
|
const startTime = Date.now();
|
|
@@ -721,9 +736,9 @@ async function waitForEmailVerification(client, sessionToken, email) {
|
|
|
721
736
|
resendHint = false;
|
|
722
737
|
try {
|
|
723
738
|
await client.resendVerification(email);
|
|
724
|
-
showInfo('
|
|
739
|
+
showInfo(t('proVerificationResent'));
|
|
725
740
|
} catch (error) {
|
|
726
|
-
showWarning(
|
|
741
|
+
showWarning(tf('proCouldNotResend', { message: error.message }));
|
|
727
742
|
}
|
|
728
743
|
}
|
|
729
744
|
|
|
@@ -731,7 +746,7 @@ async function waitForEmailVerification(client, sessionToken, email) {
|
|
|
731
746
|
try {
|
|
732
747
|
const status = await client.checkEmailVerified(sessionToken);
|
|
733
748
|
if (status.verified) {
|
|
734
|
-
showSuccess('
|
|
749
|
+
showSuccess(t('proEmailVerified'));
|
|
735
750
|
return { success: true };
|
|
736
751
|
}
|
|
737
752
|
} catch {
|
|
@@ -743,9 +758,9 @@ async function waitForEmailVerification(client, sessionToken, email) {
|
|
|
743
758
|
}
|
|
744
759
|
|
|
745
760
|
// Timeout
|
|
746
|
-
showError('
|
|
747
|
-
showInfo('
|
|
748
|
-
return { success: false, error: '
|
|
761
|
+
showError(t('proVerificationTimeout'));
|
|
762
|
+
showInfo(t('proRunAgainRetry'));
|
|
763
|
+
return { success: false, error: t('proVerificationTimeout') };
|
|
749
764
|
} finally {
|
|
750
765
|
cleanupKeyListener();
|
|
751
766
|
}
|
|
@@ -759,7 +774,7 @@ async function waitForEmailVerification(client, sessionToken, email) {
|
|
|
759
774
|
* @returns {Promise<Object>} Result with { success, key, activationResult }
|
|
760
775
|
*/
|
|
761
776
|
async function activateProByAuth(client, sessionToken) {
|
|
762
|
-
const spinner = createSpinner('
|
|
777
|
+
const spinner = createSpinner(t('proValidatingSubscription'));
|
|
763
778
|
spinner.start();
|
|
764
779
|
|
|
765
780
|
try {
|
|
@@ -786,26 +801,26 @@ async function activateProByAuth(client, sessionToken) {
|
|
|
786
801
|
|
|
787
802
|
const activationResult = await client.activateByAuth(sessionToken, machineId, aiosCoreVersion);
|
|
788
803
|
|
|
789
|
-
spinner.succeed(
|
|
804
|
+
spinner.succeed(tf('proSubscriptionConfirmed', { key: maskLicenseKey(activationResult.key) }));
|
|
790
805
|
return { success: true, key: activationResult.key, activationResult };
|
|
791
806
|
} catch (error) {
|
|
792
807
|
if (error.code === 'NOT_A_BUYER') {
|
|
793
|
-
spinner.fail('
|
|
794
|
-
showInfo('
|
|
808
|
+
spinner.fail(t('proNoSubscription'));
|
|
809
|
+
showInfo(t('proPurchaseAt'));
|
|
795
810
|
return { success: false, error: error.message };
|
|
796
811
|
}
|
|
797
812
|
if (error.code === 'SEAT_LIMIT_EXCEEDED') {
|
|
798
813
|
spinner.fail(error.message);
|
|
799
|
-
showInfo('
|
|
814
|
+
showInfo(t('proSeatLimit'));
|
|
800
815
|
return { success: false, error: error.message };
|
|
801
816
|
}
|
|
802
817
|
if (error.code === 'ALREADY_ACTIVATED') {
|
|
803
818
|
// License already exists — treat as success (re-install scenario)
|
|
804
|
-
spinner.succeed('
|
|
819
|
+
spinner.succeed(t('proAlreadyActivated'));
|
|
805
820
|
return { success: true, key: 'existing', activationResult: { reactivation: true } };
|
|
806
821
|
}
|
|
807
822
|
|
|
808
|
-
spinner.fail(
|
|
823
|
+
spinner.fail(tf('proActivationFailed', { message: error.message }));
|
|
809
824
|
return { success: false, error: error.message };
|
|
810
825
|
}
|
|
811
826
|
}
|
|
@@ -823,14 +838,14 @@ async function stepLicenseGateWithKeyInteractive() {
|
|
|
823
838
|
{
|
|
824
839
|
type: 'password',
|
|
825
840
|
name: 'licenseKey',
|
|
826
|
-
message: colors.primary('
|
|
841
|
+
message: colors.primary(t('proEnterKeyPrompt')),
|
|
827
842
|
mask: '*',
|
|
828
843
|
validate: (input) => {
|
|
829
844
|
if (!input || !input.trim()) {
|
|
830
|
-
return '
|
|
845
|
+
return t('proKeyRequired');
|
|
831
846
|
}
|
|
832
847
|
if (!validateKeyFormat(input)) {
|
|
833
|
-
return '
|
|
848
|
+
return t('proKeyInvalid');
|
|
834
849
|
}
|
|
835
850
|
return true;
|
|
836
851
|
},
|
|
@@ -841,7 +856,7 @@ async function stepLicenseGateWithKeyInteractive() {
|
|
|
841
856
|
const result = await validateKeyWithApi(key);
|
|
842
857
|
|
|
843
858
|
if (result.success) {
|
|
844
|
-
showSuccess(
|
|
859
|
+
showSuccess(tf('proKeyValidated', { key: maskLicenseKey(key) }));
|
|
845
860
|
return { success: true, key, activationResult: result.data };
|
|
846
861
|
}
|
|
847
862
|
|
|
@@ -867,17 +882,17 @@ async function stepLicenseGateWithKey(key) {
|
|
|
867
882
|
if (!validateKeyFormat(key)) {
|
|
868
883
|
return {
|
|
869
884
|
success: false,
|
|
870
|
-
error:
|
|
885
|
+
error: tf('proInvalidKeyFormat', { key: maskLicenseKey(key) }),
|
|
871
886
|
};
|
|
872
887
|
}
|
|
873
888
|
|
|
874
|
-
const spinner = createSpinner(
|
|
889
|
+
const spinner = createSpinner(tf('proValidatingKey', { key: maskLicenseKey(key) }));
|
|
875
890
|
spinner.start();
|
|
876
891
|
|
|
877
892
|
const result = await validateKeyWithApi(key);
|
|
878
893
|
|
|
879
894
|
if (result.success) {
|
|
880
|
-
spinner.succeed(
|
|
895
|
+
spinner.succeed(tf('proKeyValidated', { key: maskLicenseKey(key) }));
|
|
881
896
|
return { success: true, key, activationResult: result.data };
|
|
882
897
|
}
|
|
883
898
|
|
|
@@ -899,7 +914,7 @@ async function validateKeyWithApi(key) {
|
|
|
899
914
|
if (!licenseModule) {
|
|
900
915
|
return {
|
|
901
916
|
success: false,
|
|
902
|
-
error: '
|
|
917
|
+
error: t('proModuleNotAvailable'),
|
|
903
918
|
};
|
|
904
919
|
}
|
|
905
920
|
|
|
@@ -913,7 +928,7 @@ async function validateKeyWithApi(key) {
|
|
|
913
928
|
if (!online) {
|
|
914
929
|
return {
|
|
915
930
|
success: false,
|
|
916
|
-
error: '
|
|
931
|
+
error: t('proServerUnreachable'),
|
|
917
932
|
};
|
|
918
933
|
}
|
|
919
934
|
|
|
@@ -944,27 +959,27 @@ async function validateKeyWithApi(key) {
|
|
|
944
959
|
} catch (error) {
|
|
945
960
|
// Handle specific error codes from license-api
|
|
946
961
|
if (error.code === 'INVALID_KEY') {
|
|
947
|
-
return { success: false, error: '
|
|
962
|
+
return { success: false, error: t('proInvalidKey') };
|
|
948
963
|
}
|
|
949
964
|
if (error.code === 'EXPIRED_KEY') {
|
|
950
|
-
return { success: false, error: '
|
|
965
|
+
return { success: false, error: t('proExpiredKey') };
|
|
951
966
|
}
|
|
952
967
|
if (error.code === 'SEAT_LIMIT_EXCEEDED') {
|
|
953
|
-
return { success: false, error: '
|
|
968
|
+
return { success: false, error: t('proMaxActivations') };
|
|
954
969
|
}
|
|
955
970
|
if (error.code === 'RATE_LIMITED') {
|
|
956
|
-
return { success: false, error: '
|
|
971
|
+
return { success: false, error: t('proRateLimited') };
|
|
957
972
|
}
|
|
958
973
|
if (error.code === 'NETWORK_ERROR') {
|
|
959
974
|
return {
|
|
960
975
|
success: false,
|
|
961
|
-
error: '
|
|
976
|
+
error: t('proServerUnreachable'),
|
|
962
977
|
};
|
|
963
978
|
}
|
|
964
979
|
|
|
965
980
|
return {
|
|
966
981
|
success: false,
|
|
967
|
-
error:
|
|
982
|
+
error: tf('proValidationFailed', { message: error.message || 'Unknown error' }),
|
|
968
983
|
};
|
|
969
984
|
}
|
|
970
985
|
}
|
|
@@ -977,7 +992,7 @@ async function validateKeyWithApi(key) {
|
|
|
977
992
|
* @returns {Promise<Object>} Result with { success, scaffoldResult }
|
|
978
993
|
*/
|
|
979
994
|
async function stepInstallScaffold(targetDir, options = {}) {
|
|
980
|
-
showStep(2, 3, '
|
|
995
|
+
showStep(2, 3, t('proContentInstallation'));
|
|
981
996
|
|
|
982
997
|
const path = require('path');
|
|
983
998
|
const fs = require('fs');
|
|
@@ -988,20 +1003,20 @@ async function stepInstallScaffold(targetDir, options = {}) {
|
|
|
988
1003
|
// Step 2a: Ensure package.json exists (greenfield projects)
|
|
989
1004
|
const packageJsonPath = path.join(targetDir, 'package.json');
|
|
990
1005
|
if (!fs.existsSync(packageJsonPath)) {
|
|
991
|
-
const initSpinner = createSpinner('
|
|
1006
|
+
const initSpinner = createSpinner(t('proInitPackageJson'));
|
|
992
1007
|
initSpinner.start();
|
|
993
1008
|
try {
|
|
994
1009
|
execSync('npm init -y', { cwd: targetDir, stdio: 'pipe' });
|
|
995
|
-
initSpinner.succeed('
|
|
1010
|
+
initSpinner.succeed(t('proPackageJsonCreated'));
|
|
996
1011
|
} catch (err) {
|
|
997
|
-
initSpinner.fail('
|
|
998
|
-
return { success: false, error:
|
|
1012
|
+
initSpinner.fail(t('proPackageJsonFailed'));
|
|
1013
|
+
return { success: false, error: tf('proNpmInitFailed', { message: err.message }) };
|
|
999
1014
|
}
|
|
1000
1015
|
}
|
|
1001
1016
|
|
|
1002
1017
|
// Step 2b: Install @aios-fullstack/pro if not present
|
|
1003
1018
|
if (!fs.existsSync(proSourceDir)) {
|
|
1004
|
-
const installSpinner = createSpinner('
|
|
1019
|
+
const installSpinner = createSpinner(t('proInstallingPackage'));
|
|
1005
1020
|
installSpinner.start();
|
|
1006
1021
|
try {
|
|
1007
1022
|
execSync('npm install @aios-fullstack/pro', {
|
|
@@ -1009,12 +1024,12 @@ async function stepInstallScaffold(targetDir, options = {}) {
|
|
|
1009
1024
|
stdio: 'pipe',
|
|
1010
1025
|
timeout: 120000,
|
|
1011
1026
|
});
|
|
1012
|
-
installSpinner.succeed('
|
|
1027
|
+
installSpinner.succeed(t('proPackageInstalled'));
|
|
1013
1028
|
} catch (err) {
|
|
1014
|
-
installSpinner.fail('
|
|
1029
|
+
installSpinner.fail(t('proPackageInstallFailed'));
|
|
1015
1030
|
return {
|
|
1016
1031
|
success: false,
|
|
1017
|
-
error:
|
|
1032
|
+
error: tf('proNpmInstallFailed', { message: err.message }),
|
|
1018
1033
|
};
|
|
1019
1034
|
}
|
|
1020
1035
|
|
|
@@ -1022,7 +1037,7 @@ async function stepInstallScaffold(targetDir, options = {}) {
|
|
|
1022
1037
|
if (!fs.existsSync(proSourceDir)) {
|
|
1023
1038
|
return {
|
|
1024
1039
|
success: false,
|
|
1025
|
-
error: '
|
|
1040
|
+
error: t('proPackageNotFound'),
|
|
1026
1041
|
};
|
|
1027
1042
|
}
|
|
1028
1043
|
}
|
|
@@ -1031,25 +1046,25 @@ async function stepInstallScaffold(targetDir, options = {}) {
|
|
|
1031
1046
|
const scaffolderModule = loadProScaffolder();
|
|
1032
1047
|
|
|
1033
1048
|
if (!scaffolderModule) {
|
|
1034
|
-
showWarning('
|
|
1035
|
-
return { success: false, error: '
|
|
1049
|
+
showWarning(t('proScaffolderNotAvailable'));
|
|
1050
|
+
return { success: false, error: t('proScaffolderNotFound') };
|
|
1036
1051
|
}
|
|
1037
1052
|
|
|
1038
1053
|
const { scaffoldProContent } = scaffolderModule;
|
|
1039
1054
|
|
|
1040
|
-
const spinner = createSpinner('
|
|
1055
|
+
const spinner = createSpinner(t('proScaffolding'));
|
|
1041
1056
|
spinner.start();
|
|
1042
1057
|
|
|
1043
1058
|
try {
|
|
1044
1059
|
const scaffoldResult = await scaffoldProContent(targetDir, proSourceDir, {
|
|
1045
1060
|
onProgress: (progress) => {
|
|
1046
|
-
spinner.text =
|
|
1061
|
+
spinner.text = tf('proScaffoldingProgress', { message: progress.message });
|
|
1047
1062
|
},
|
|
1048
1063
|
force: options.force || false,
|
|
1049
1064
|
});
|
|
1050
1065
|
|
|
1051
1066
|
if (scaffoldResult.success) {
|
|
1052
|
-
spinner.succeed(
|
|
1067
|
+
spinner.succeed(tf('proContentInstalled', { count: scaffoldResult.copiedFiles.length }));
|
|
1053
1068
|
|
|
1054
1069
|
if (scaffoldResult.warnings.length > 0) {
|
|
1055
1070
|
for (const warning of scaffoldResult.warnings) {
|
|
@@ -1060,14 +1075,14 @@ async function stepInstallScaffold(targetDir, options = {}) {
|
|
|
1060
1075
|
return { success: true, scaffoldResult };
|
|
1061
1076
|
}
|
|
1062
1077
|
|
|
1063
|
-
spinner.fail('
|
|
1078
|
+
spinner.fail(t('proScaffoldFailed'));
|
|
1064
1079
|
for (const error of scaffoldResult.errors) {
|
|
1065
1080
|
showError(error);
|
|
1066
1081
|
}
|
|
1067
1082
|
|
|
1068
1083
|
return { success: false, error: scaffoldResult.errors.join('; '), scaffoldResult };
|
|
1069
1084
|
} catch (error) {
|
|
1070
|
-
spinner.fail(
|
|
1085
|
+
spinner.fail(tf('proScaffoldError', { message: error.message }));
|
|
1071
1086
|
return { success: false, error: error.message };
|
|
1072
1087
|
}
|
|
1073
1088
|
}
|
|
@@ -1079,7 +1094,7 @@ async function stepInstallScaffold(targetDir, options = {}) {
|
|
|
1079
1094
|
* @returns {Promise<Object>} Verification result
|
|
1080
1095
|
*/
|
|
1081
1096
|
async function stepVerify(scaffoldResult) {
|
|
1082
|
-
showStep(3, 3, '
|
|
1097
|
+
showStep(3, 3, t('proVerification'));
|
|
1083
1098
|
|
|
1084
1099
|
const result = {
|
|
1085
1100
|
success: true,
|
|
@@ -1098,7 +1113,7 @@ async function stepVerify(scaffoldResult) {
|
|
|
1098
1113
|
(f) => f.endsWith('.yaml') || f.endsWith('.json'),
|
|
1099
1114
|
);
|
|
1100
1115
|
|
|
1101
|
-
showInfo(
|
|
1116
|
+
showInfo(tf('proFilesInstalled', { count: files.length }));
|
|
1102
1117
|
|
|
1103
1118
|
if (result.squads.length > 0) {
|
|
1104
1119
|
// Extract unique squad names
|
|
@@ -1107,11 +1122,11 @@ async function stepVerify(scaffoldResult) {
|
|
|
1107
1122
|
.map((f) => f.split('/')[1])
|
|
1108
1123
|
.filter(Boolean),
|
|
1109
1124
|
)];
|
|
1110
|
-
showSuccess(
|
|
1125
|
+
showSuccess(tf('proSquads', { names: squadNames.join(', ') }));
|
|
1111
1126
|
}
|
|
1112
1127
|
|
|
1113
1128
|
if (result.configs.length > 0) {
|
|
1114
|
-
showSuccess(
|
|
1129
|
+
showSuccess(tf('proConfigs', { count: result.configs.length }));
|
|
1115
1130
|
}
|
|
1116
1131
|
}
|
|
1117
1132
|
|
|
@@ -1126,7 +1141,7 @@ async function stepVerify(scaffoldResult) {
|
|
|
1126
1141
|
result.features = available;
|
|
1127
1142
|
|
|
1128
1143
|
if (available.length > 0) {
|
|
1129
|
-
showSuccess(
|
|
1144
|
+
showSuccess(tf('proFeaturesUnlocked', { count: available.length }));
|
|
1130
1145
|
for (const feature of available.slice(0, 5)) {
|
|
1131
1146
|
console.log(colors.dim(` ${feature}`));
|
|
1132
1147
|
}
|
|
@@ -1139,7 +1154,7 @@ async function stepVerify(scaffoldResult) {
|
|
|
1139
1154
|
// Final status
|
|
1140
1155
|
console.log('');
|
|
1141
1156
|
console.log(gold(' ════════════════════════════════════════════════'));
|
|
1142
|
-
console.log(status.celebrate('
|
|
1157
|
+
console.log(status.celebrate(t('proInstallComplete')));
|
|
1143
1158
|
console.log(gold(' ════════════════════════════════════════════════'));
|
|
1144
1159
|
console.log('');
|
|
1145
1160
|
|
|
@@ -1188,7 +1203,7 @@ async function runProWizard(options = {}) {
|
|
|
1188
1203
|
showError(licenseResult.error);
|
|
1189
1204
|
|
|
1190
1205
|
if (!isCI) {
|
|
1191
|
-
showInfo('
|
|
1206
|
+
showInfo(t('proNeedHelp'));
|
|
1192
1207
|
}
|
|
1193
1208
|
|
|
1194
1209
|
result.error = licenseResult.error;
|
|
@@ -1243,6 +1258,7 @@ module.exports = {
|
|
|
1243
1258
|
loadLicenseApi,
|
|
1244
1259
|
loadFeatureGate,
|
|
1245
1260
|
loadProScaffolder,
|
|
1261
|
+
LICENSE_SERVER_URL,
|
|
1246
1262
|
MAX_RETRIES,
|
|
1247
1263
|
LICENSE_KEY_PATTERN,
|
|
1248
1264
|
EMAIL_PATTERN,
|