prjct-cli 1.22.0 → 1.24.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/CHANGELOG.md +230 -0
- package/bin/prjct +30 -13
- package/dist/bin/prjct-core.mjs +1748 -0
- package/dist/bin/prjct.mjs +17 -36672
- package/dist/cli/linear.mjs +14 -0
- package/dist/daemon/entry.mjs +1429 -0
- package/dist/templates.json +1 -0
- package/package.json +4 -5
- package/bin/prjct.ts +0 -342
- package/core/__tests__/agentic/analysis-injection.test.ts +0 -377
- package/core/__tests__/agentic/cache-eviction.test.ts +0 -294
- package/core/__tests__/agentic/command-context.test.ts +0 -281
- package/core/__tests__/agentic/command-executor.test.ts +0 -659
- package/core/__tests__/agentic/domain-classifier.test.ts +0 -330
- package/core/__tests__/agentic/injection-validator.test.ts +0 -255
- package/core/__tests__/agentic/memory-system.test.ts +0 -281
- package/core/__tests__/agentic/plan-mode.test.ts +0 -386
- package/core/__tests__/agentic/prompt-assembly.test.ts +0 -298
- package/core/__tests__/agentic/prompt-builder.test.ts +0 -243
- package/core/__tests__/agentic/response-validator.test.ts +0 -263
- package/core/__tests__/agentic/semantic-matching.test.ts +0 -131
- package/core/__tests__/agentic/smart-context.test.ts +0 -372
- package/core/__tests__/agentic/tech-normalizer.test.ts +0 -136
- package/core/__tests__/agentic/token-budget.test.ts +0 -294
- package/core/__tests__/ai-tools/formatters.test.ts +0 -476
- package/core/__tests__/domain/bm25.test.ts +0 -225
- package/core/__tests__/domain/change-propagator.test.ts +0 -100
- package/core/__tests__/domain/fibonacci.test.ts +0 -113
- package/core/__tests__/domain/file-hasher.test.ts +0 -146
- package/core/__tests__/domain/file-ranker.test.ts +0 -169
- package/core/__tests__/domain/git-cochange.test.ts +0 -121
- package/core/__tests__/domain/import-graph.test.ts +0 -156
- package/core/__tests__/domain/velocity.test.ts +0 -623
- package/core/__tests__/infrastructure/performance-tracker.test.ts +0 -328
- package/core/__tests__/schemas/model.test.ts +0 -272
- package/core/__tests__/services/dependency-validator.test.ts +0 -175
- package/core/__tests__/services/hierarchical-agent-resolver.test.ts +0 -359
- package/core/__tests__/services/nested-context-resolver.test.ts +0 -443
- package/core/__tests__/services/project-index.test.ts +0 -355
- package/core/__tests__/services/staleness-checker.test.ts +0 -204
- package/core/__tests__/storage/analysis-storage.test.ts +0 -641
- package/core/__tests__/storage/archive-storage.test.ts +0 -455
- package/core/__tests__/storage/safe-reader.test.ts +0 -262
- package/core/__tests__/storage/sqlite-migration.test.ts +0 -1016
- package/core/__tests__/storage/state-storage-feedback.test.ts +0 -463
- package/core/__tests__/storage/state-storage-history.test.ts +0 -469
- package/core/__tests__/storage/storage-manager.test.ts +0 -383
- package/core/__tests__/storage/subtask-handoff.test.ts +0 -237
- package/core/__tests__/types/fs.test.ts +0 -125
- package/core/__tests__/utils/date-helper.test.ts +0 -449
- package/core/__tests__/utils/output.test.ts +0 -278
- package/core/__tests__/utils/preserve-sections.test.ts +0 -216
- package/core/__tests__/utils/project-commands.test.ts +0 -71
- package/core/__tests__/utils/retry.test.ts +0 -381
- package/core/__tests__/workflow/state-machine.test.ts +0 -216
- package/core/agentic/agent-router.ts +0 -150
- package/core/agentic/anti-hallucination.ts +0 -141
- package/core/agentic/chain-of-thought.ts +0 -234
- package/core/agentic/command-classifier.ts +0 -141
- package/core/agentic/command-context.ts +0 -168
- package/core/agentic/command-executor.ts +0 -471
- package/core/agentic/context-builder.ts +0 -285
- package/core/agentic/domain-classifier.ts +0 -525
- package/core/agentic/environment-block.ts +0 -102
- package/core/agentic/ground-truth.ts +0 -706
- package/core/agentic/index.ts +0 -193
- package/core/agentic/injection-validator.ts +0 -208
- package/core/agentic/loop-detector.ts +0 -451
- package/core/agentic/memory-system.ts +0 -1547
- package/core/agentic/orchestrator-executor.ts +0 -579
- package/core/agentic/plan-mode.ts +0 -525
- package/core/agentic/prompt-builder.ts +0 -1069
- package/core/agentic/response-validator.ts +0 -98
- package/core/agentic/services.ts +0 -167
- package/core/agentic/skill-loader.ts +0 -106
- package/core/agentic/smart-context.ts +0 -393
- package/core/agentic/tech-normalizer.ts +0 -167
- package/core/agentic/template-executor.ts +0 -272
- package/core/agentic/template-loader.ts +0 -109
- package/core/agentic/token-budget.ts +0 -226
- package/core/agentic/tool-registry.ts +0 -146
- package/core/agents/index.ts +0 -28
- package/core/agents/performance.ts +0 -429
- package/core/ai-tools/formatters.ts +0 -341
- package/core/ai-tools/generator.ts +0 -144
- package/core/ai-tools/index.ts +0 -15
- package/core/ai-tools/registry.ts +0 -201
- package/core/bus/bus.ts +0 -314
- package/core/bus/index.ts +0 -8
- package/core/cli/linear.ts +0 -500
- package/core/cli/lint-meta-commentary.ts +0 -177
- package/core/cli/start.ts +0 -386
- package/core/commands/analysis.ts +0 -1274
- package/core/commands/analytics.ts +0 -342
- package/core/commands/base.ts +0 -118
- package/core/commands/cleanup.ts +0 -157
- package/core/commands/command-data.ts +0 -463
- package/core/commands/commands.ts +0 -306
- package/core/commands/context.ts +0 -238
- package/core/commands/design.ts +0 -77
- package/core/commands/index.ts +0 -19
- package/core/commands/maintenance.ts +0 -77
- package/core/commands/performance.ts +0 -114
- package/core/commands/planning.ts +0 -662
- package/core/commands/register.ts +0 -127
- package/core/commands/registry.ts +0 -444
- package/core/commands/setup.ts +0 -280
- package/core/commands/shipping.ts +0 -267
- package/core/commands/snapshots.ts +0 -297
- package/core/commands/uninstall.ts +0 -542
- package/core/commands/velocity.ts +0 -149
- package/core/commands/workflow.ts +0 -505
- package/core/config/command-context.config.json +0 -66
- package/core/constants/index.ts +0 -379
- package/core/context/generator.ts +0 -368
- package/core/context-tools/files-tool.ts +0 -577
- package/core/context-tools/imports-tool.ts +0 -400
- package/core/context-tools/index.ts +0 -434
- package/core/context-tools/recent-tool.ts +0 -301
- package/core/context-tools/signatures-tool.ts +0 -495
- package/core/context-tools/summary-tool.ts +0 -301
- package/core/context-tools/token-counter.ts +0 -273
- package/core/context-tools/types.ts +0 -253
- package/core/domain/agent-generator.ts +0 -186
- package/core/domain/agent-loader.ts +0 -419
- package/core/domain/analyzer.ts +0 -387
- package/core/domain/architecture-generator.ts +0 -108
- package/core/domain/bm25.ts +0 -525
- package/core/domain/change-propagator.ts +0 -162
- package/core/domain/context-estimator.ts +0 -175
- package/core/domain/fibonacci.ts +0 -128
- package/core/domain/file-hasher.ts +0 -296
- package/core/domain/file-ranker.ts +0 -151
- package/core/domain/git-cochange.ts +0 -250
- package/core/domain/import-graph.ts +0 -315
- package/core/domain/snapshot-manager.ts +0 -415
- package/core/domain/task-stack.ts +0 -578
- package/core/domain/velocity.ts +0 -470
- package/core/errors.ts +0 -335
- package/core/events/events.ts +0 -85
- package/core/events/index.ts +0 -8
- package/core/index.ts +0 -481
- package/core/infrastructure/agent-detector.ts +0 -135
- package/core/infrastructure/ai-provider.ts +0 -578
- package/core/infrastructure/author-detector.ts +0 -133
- package/core/infrastructure/capability-installer.ts +0 -76
- package/core/infrastructure/claude-agent.ts +0 -297
- package/core/infrastructure/command-installer.ts +0 -752
- package/core/infrastructure/config-manager.ts +0 -364
- package/core/infrastructure/editors-config.ts +0 -172
- package/core/infrastructure/path-manager.ts +0 -571
- package/core/infrastructure/performance-tracker.ts +0 -326
- package/core/infrastructure/permission-manager.ts +0 -289
- package/core/infrastructure/setup.ts +0 -1061
- package/core/infrastructure/update-checker.ts +0 -246
- package/core/integrations/issue-tracker/enricher.ts +0 -271
- package/core/integrations/issue-tracker/index.ts +0 -8
- package/core/integrations/issue-tracker/manager.ts +0 -286
- package/core/integrations/issue-tracker/types.ts +0 -310
- package/core/integrations/jira/cache.ts +0 -57
- package/core/integrations/jira/client.ts +0 -688
- package/core/integrations/jira/index.ts +0 -23
- package/core/integrations/jira/service.ts +0 -244
- package/core/integrations/linear/cache.ts +0 -68
- package/core/integrations/linear/client.ts +0 -436
- package/core/integrations/linear/index.ts +0 -20
- package/core/integrations/linear/service.ts +0 -260
- package/core/integrations/linear/sync.ts +0 -314
- package/core/outcomes/analyzer.ts +0 -286
- package/core/outcomes/index.ts +0 -34
- package/core/outcomes/recorder.ts +0 -195
- package/core/plugin/builtin/webhook.ts +0 -148
- package/core/plugin/hooks.ts +0 -315
- package/core/plugin/index.ts +0 -50
- package/core/plugin/loader.ts +0 -354
- package/core/plugin/registry.ts +0 -326
- package/core/schemas/agents.ts +0 -27
- package/core/schemas/analysis.ts +0 -530
- package/core/schemas/classification.ts +0 -91
- package/core/schemas/command-context.ts +0 -29
- package/core/schemas/enriched-task.ts +0 -291
- package/core/schemas/ideas.ts +0 -114
- package/core/schemas/index.ts +0 -53
- package/core/schemas/issues.ts +0 -159
- package/core/schemas/llm-output.ts +0 -170
- package/core/schemas/metrics.ts +0 -143
- package/core/schemas/model.ts +0 -153
- package/core/schemas/outcomes.ts +0 -487
- package/core/schemas/performance.ts +0 -128
- package/core/schemas/permissions.ts +0 -180
- package/core/schemas/prd.ts +0 -450
- package/core/schemas/project.ts +0 -57
- package/core/schemas/roadmap.ts +0 -322
- package/core/schemas/schemas.ts +0 -38
- package/core/schemas/shipped.ts +0 -109
- package/core/schemas/state.ts +0 -284
- package/core/schemas/velocity.ts +0 -103
- package/core/server/index.ts +0 -21
- package/core/server/routes-extended.ts +0 -566
- package/core/server/routes.ts +0 -176
- package/core/server/server.ts +0 -149
- package/core/server/sse.ts +0 -192
- package/core/services/agent-generator.ts +0 -385
- package/core/services/agent-service.ts +0 -168
- package/core/services/breakdown-service.ts +0 -124
- package/core/services/context-generator.ts +0 -445
- package/core/services/context-selector.ts +0 -429
- package/core/services/dependency-validator.ts +0 -318
- package/core/services/diff-generator.ts +0 -313
- package/core/services/doctor-service.ts +0 -423
- package/core/services/file-categorizer.ts +0 -448
- package/core/services/file-scorer.ts +0 -270
- package/core/services/git-analyzer.ts +0 -293
- package/core/services/hierarchical-agent-resolver.ts +0 -236
- package/core/services/hooks-service.ts +0 -685
- package/core/services/index.ts +0 -46
- package/core/services/local-state-generator.ts +0 -158
- package/core/services/memory-service.ts +0 -181
- package/core/services/nested-context-resolver.ts +0 -842
- package/core/services/project-index.ts +0 -911
- package/core/services/project-service.ts +0 -155
- package/core/services/session-tracker.ts +0 -287
- package/core/services/skill-installer.ts +0 -447
- package/core/services/skill-lock.ts +0 -132
- package/core/services/skill-service.ts +0 -306
- package/core/services/stack-detector.ts +0 -229
- package/core/services/staleness-checker.ts +0 -327
- package/core/services/sync-service.ts +0 -1515
- package/core/services/sync-verifier.ts +0 -253
- package/core/services/watch-service.ts +0 -312
- package/core/session/compaction.ts +0 -248
- package/core/session/index.ts +0 -35
- package/core/session/log-migration.ts +0 -88
- package/core/session/metrics.ts +0 -323
- package/core/session/session-log-manager.ts +0 -307
- package/core/session/task-session-manager.ts +0 -404
- package/core/session/utils.ts +0 -51
- package/core/storage/analysis-storage.ts +0 -373
- package/core/storage/archive-storage.ts +0 -205
- package/core/storage/database.ts +0 -575
- package/core/storage/ideas-storage.ts +0 -298
- package/core/storage/index-storage.ts +0 -523
- package/core/storage/index.ts +0 -79
- package/core/storage/metrics-storage.ts +0 -321
- package/core/storage/migrate-json.ts +0 -720
- package/core/storage/queue-storage.ts +0 -336
- package/core/storage/safe-reader.ts +0 -105
- package/core/storage/shipped-storage.ts +0 -253
- package/core/storage/state-storage.ts +0 -1035
- package/core/storage/storage-manager.ts +0 -205
- package/core/storage/storage.ts +0 -177
- package/core/storage/velocity-storage.ts +0 -149
- package/core/sync/auth-config.ts +0 -138
- package/core/sync/index.ts +0 -31
- package/core/sync/oauth-handler.ts +0 -143
- package/core/sync/sync-client.ts +0 -251
- package/core/sync/sync-manager.ts +0 -327
- package/core/tsconfig.json +0 -22
- package/core/types/agentic.ts +0 -760
- package/core/types/agents.ts +0 -150
- package/core/types/bus.ts +0 -193
- package/core/types/citations.ts +0 -22
- package/core/types/commands.ts +0 -399
- package/core/types/config.ts +0 -92
- package/core/types/core.ts +0 -96
- package/core/types/diff.ts +0 -41
- package/core/types/domain.ts +0 -71
- package/core/types/errors.ts +0 -111
- package/core/types/events.ts +0 -42
- package/core/types/fs.ts +0 -72
- package/core/types/index.ts +0 -510
- package/core/types/infrastructure.ts +0 -210
- package/core/types/integrations.ts +0 -31
- package/core/types/jira.ts +0 -51
- package/core/types/logger.ts +0 -17
- package/core/types/memory.ts +0 -313
- package/core/types/outcomes.ts +0 -190
- package/core/types/output.ts +0 -47
- package/core/types/plugin.ts +0 -25
- package/core/types/project-sync.ts +0 -129
- package/core/types/provider.ts +0 -163
- package/core/types/server.ts +0 -71
- package/core/types/services.ts +0 -84
- package/core/types/session.ts +0 -135
- package/core/types/stack.ts +0 -19
- package/core/types/storage.ts +0 -318
- package/core/types/sync-verifier.ts +0 -33
- package/core/types/sync.ts +0 -121
- package/core/types/task.ts +0 -72
- package/core/types/template.ts +0 -24
- package/core/types/utils.ts +0 -92
- package/core/types/workflow.ts +0 -23
- package/core/utils/agent-stream.ts +0 -140
- package/core/utils/animations.ts +0 -251
- package/core/utils/branding.ts +0 -88
- package/core/utils/cache.ts +0 -187
- package/core/utils/citations.ts +0 -39
- package/core/utils/collection-filters.ts +0 -209
- package/core/utils/date-helper.ts +0 -176
- package/core/utils/error-messages.ts +0 -38
- package/core/utils/file-helper.ts +0 -277
- package/core/utils/fs-helpers.ts +0 -14
- package/core/utils/help.ts +0 -314
- package/core/utils/jsonl-helper.ts +0 -290
- package/core/utils/keychain.ts +0 -127
- package/core/utils/logger.ts +0 -77
- package/core/utils/markdown-builder.ts +0 -280
- package/core/utils/next-steps.ts +0 -95
- package/core/utils/output.ts +0 -403
- package/core/utils/preserve-sections.ts +0 -218
- package/core/utils/project-commands.ts +0 -126
- package/core/utils/project-credentials.ts +0 -143
- package/core/utils/provider-cache.ts +0 -49
- package/core/utils/retry.ts +0 -318
- package/core/utils/runtime.ts +0 -108
- package/core/utils/session-helper.ts +0 -278
- package/core/utils/subtask-table.ts +0 -227
- package/core/utils/version.ts +0 -128
- package/core/wizard/index.ts +0 -13
- package/core/wizard/onboarding.ts +0 -633
- package/core/workflow/index.ts +0 -7
- package/core/workflow/state-machine.ts +0 -198
- package/core/workflow/workflow-preferences.ts +0 -294
- package/dist/core/infrastructure/command-installer.js +0 -1141
- package/dist/core/infrastructure/editors-config.js +0 -177
- package/dist/core/infrastructure/setup.js +0 -2244
- package/dist/core/utils/version.js +0 -141
- package/templates/agentic/agent-routing.md +0 -45
- package/templates/agentic/agents/uxui.md +0 -63
- package/templates/agentic/checklist-routing.md +0 -98
- package/templates/agentic/orchestrator.md +0 -68
- package/templates/agentic/task-fragmentation.md +0 -89
- package/templates/agents/AGENTS.md +0 -68
- package/templates/analysis/analyze.md +0 -84
- package/templates/analysis/patterns.md +0 -60
- package/templates/antigravity/SKILL.md +0 -39
- package/templates/architect/discovery.md +0 -67
- package/templates/architect/phases.md +0 -59
- package/templates/checklists/architecture.md +0 -28
- package/templates/checklists/code-quality.md +0 -28
- package/templates/checklists/data.md +0 -33
- package/templates/checklists/documentation.md +0 -33
- package/templates/checklists/infrastructure.md +0 -33
- package/templates/checklists/performance.md +0 -33
- package/templates/checklists/security.md +0 -33
- package/templates/checklists/testing.md +0 -33
- package/templates/checklists/ux-ui.md +0 -37
- package/templates/commands/analyze.md +0 -56
- package/templates/commands/auth.md +0 -234
- package/templates/commands/bug.md +0 -163
- package/templates/commands/cleanup.md +0 -19
- package/templates/commands/dash.md +0 -99
- package/templates/commands/design.md +0 -15
- package/templates/commands/done.md +0 -291
- package/templates/commands/enrich.md +0 -174
- package/templates/commands/git.md +0 -295
- package/templates/commands/history.md +0 -389
- package/templates/commands/idea.md +0 -88
- package/templates/commands/impact.md +0 -864
- package/templates/commands/init.md +0 -54
- package/templates/commands/jira.md +0 -278
- package/templates/commands/linear.md +0 -288
- package/templates/commands/merge.md +0 -206
- package/templates/commands/next.md +0 -80
- package/templates/commands/p.md +0 -67
- package/templates/commands/p.toml +0 -37
- package/templates/commands/pause.md +0 -136
- package/templates/commands/plan.md +0 -696
- package/templates/commands/prd.md +0 -356
- package/templates/commands/resume.md +0 -171
- package/templates/commands/review.md +0 -276
- package/templates/commands/serve.md +0 -118
- package/templates/commands/setup.md +0 -91
- package/templates/commands/ship.md +0 -475
- package/templates/commands/skill.md +0 -259
- package/templates/commands/spec.md +0 -218
- package/templates/commands/status.md +0 -207
- package/templates/commands/sync.md +0 -104
- package/templates/commands/task.md +0 -312
- package/templates/commands/test.md +0 -93
- package/templates/commands/update.md +0 -63
- package/templates/commands/verify.md +0 -204
- package/templates/commands/workflow.md +0 -150
- package/templates/config/skill-mappings.json +0 -82
- package/templates/context/dashboard.md +0 -256
- package/templates/context/roadmap.md +0 -221
- package/templates/cursor/commands/bug.md +0 -8
- package/templates/cursor/commands/done.md +0 -4
- package/templates/cursor/commands/pause.md +0 -6
- package/templates/cursor/commands/resume.md +0 -4
- package/templates/cursor/commands/ship.md +0 -8
- package/templates/cursor/commands/sync.md +0 -4
- package/templates/cursor/commands/task.md +0 -8
- package/templates/cursor/p.md +0 -29
- package/templates/cursor/router.mdc +0 -28
- package/templates/design/api.md +0 -95
- package/templates/design/architecture.md +0 -77
- package/templates/design/component.md +0 -89
- package/templates/design/database.md +0 -78
- package/templates/design/flow.md +0 -94
- package/templates/global/ANTIGRAVITY.md +0 -254
- package/templates/global/CLAUDE.md +0 -497
- package/templates/global/CURSOR.mdc +0 -266
- package/templates/global/GEMINI.md +0 -293
- package/templates/global/STORAGE-SPEC.md +0 -391
- package/templates/global/WINDSURF.md +0 -266
- package/templates/global/modules/CLAUDE-commands.md +0 -70
- package/templates/global/modules/CLAUDE-core.md +0 -105
- package/templates/global/modules/CLAUDE-git.md +0 -50
- package/templates/global/modules/CLAUDE-intelligence.md +0 -92
- package/templates/global/modules/CLAUDE-storage.md +0 -50
- package/templates/global/modules/module-config.json +0 -36
- package/templates/mcp-config.json +0 -19
- package/templates/permissions/default.jsonc +0 -60
- package/templates/permissions/permissive.jsonc +0 -49
- package/templates/permissions/strict.jsonc +0 -58
- package/templates/planning-methodology.md +0 -195
- package/templates/skills/code-review.md +0 -47
- package/templates/skills/debug.md +0 -61
- package/templates/skills/refactor.md +0 -47
- package/templates/subagents/agent-base.md +0 -20
- package/templates/subagents/domain/backend.md +0 -109
- package/templates/subagents/domain/database.md +0 -121
- package/templates/subagents/domain/devops.md +0 -152
- package/templates/subagents/domain/frontend.md +0 -103
- package/templates/subagents/domain/testing.md +0 -169
- package/templates/subagents/pm-expert.md +0 -366
- package/templates/subagents/workflow/chief-architect.md +0 -657
- package/templates/subagents/workflow/prjct-planner.md +0 -159
- package/templates/subagents/workflow/prjct-shipper.md +0 -188
- package/templates/subagents/workflow/prjct-workflow.md +0 -98
- package/templates/tools/bash.txt +0 -22
- package/templates/tools/edit.txt +0 -18
- package/templates/tools/glob.txt +0 -19
- package/templates/tools/grep.txt +0 -21
- package/templates/tools/read.txt +0 -14
- package/templates/tools/task.txt +0 -20
- package/templates/tools/webfetch.txt +0 -16
- package/templates/tools/websearch.txt +0 -18
- package/templates/tools/write.txt +0 -17
- package/templates/windsurf/router.md +0 -28
- package/templates/windsurf/workflows/bug.md +0 -8
- package/templates/windsurf/workflows/done.md +0 -4
- package/templates/windsurf/workflows/pause.md +0 -4
- package/templates/windsurf/workflows/resume.md +0 -4
- package/templates/windsurf/workflows/ship.md +0 -8
- package/templates/windsurf/workflows/sync.md +0 -4
- package/templates/windsurf/workflows/task.md +0 -8
|
@@ -1,633 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OnboardingWizard - Interactive first-run setup experience
|
|
3
|
-
*
|
|
4
|
-
* Guides new users through project setup in ~60 seconds:
|
|
5
|
-
* 1. Project type detection + confirmation
|
|
6
|
-
* 2. AI agent selection (multi-select)
|
|
7
|
-
* 3. Stack confirmation
|
|
8
|
-
* 4. Preferences collection
|
|
9
|
-
* 5. Generation + summary
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import chalk from 'chalk'
|
|
13
|
-
import prompts from 'prompts'
|
|
14
|
-
import out from '../utils/output'
|
|
15
|
-
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// Types
|
|
18
|
-
// ============================================================================
|
|
19
|
-
|
|
20
|
-
export type ProjectType =
|
|
21
|
-
| 'web-app'
|
|
22
|
-
| 'api-backend'
|
|
23
|
-
| 'fullstack'
|
|
24
|
-
| 'cli-tool'
|
|
25
|
-
| 'library'
|
|
26
|
-
| 'monorepo'
|
|
27
|
-
| 'unknown'
|
|
28
|
-
|
|
29
|
-
export type AIAgent = 'claude' | 'cursor' | 'windsurf' | 'copilot' | 'gemini'
|
|
30
|
-
|
|
31
|
-
export interface DetectedStack {
|
|
32
|
-
language: string
|
|
33
|
-
framework?: string
|
|
34
|
-
runtime?: string
|
|
35
|
-
packageManager?: string
|
|
36
|
-
technologies: string[]
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface WizardPreferences {
|
|
40
|
-
verbosity: 'minimal' | 'normal' | 'verbose'
|
|
41
|
-
autoSync: boolean
|
|
42
|
-
telemetry: boolean
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface WizardResult {
|
|
46
|
-
projectType: ProjectType
|
|
47
|
-
agents: AIAgent[]
|
|
48
|
-
stack: DetectedStack
|
|
49
|
-
preferences: WizardPreferences
|
|
50
|
-
skipped: boolean
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface WizardStep {
|
|
54
|
-
id: string
|
|
55
|
-
title: string
|
|
56
|
-
run: () => Promise<boolean> // Returns true if should continue, false to abort
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// ============================================================================
|
|
60
|
-
// Constants
|
|
61
|
-
// ============================================================================
|
|
62
|
-
|
|
63
|
-
const PROJECT_TYPES: { value: ProjectType; title: string; description: string }[] = [
|
|
64
|
-
{ value: 'web-app', title: 'Web Application', description: 'React, Vue, Angular, Next.js, etc.' },
|
|
65
|
-
{
|
|
66
|
-
value: 'api-backend',
|
|
67
|
-
title: 'API / Backend Service',
|
|
68
|
-
description: 'Express, Hono, FastAPI, etc.',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
value: 'fullstack',
|
|
72
|
-
title: 'Full-Stack (Monorepo)',
|
|
73
|
-
description: 'Frontend + Backend in one repo',
|
|
74
|
-
},
|
|
75
|
-
{ value: 'cli-tool', title: 'CLI Tool', description: 'Command-line application' },
|
|
76
|
-
{ value: 'library', title: 'Library / Package', description: 'Reusable npm/pip/cargo package' },
|
|
77
|
-
{
|
|
78
|
-
value: 'monorepo',
|
|
79
|
-
title: 'Monorepo (Multiple Projects)',
|
|
80
|
-
description: 'Turborepo, Nx, Lerna, etc.',
|
|
81
|
-
},
|
|
82
|
-
]
|
|
83
|
-
|
|
84
|
-
const AI_AGENTS: { value: AIAgent; title: string; description: string }[] = [
|
|
85
|
-
{ value: 'claude', title: 'Claude Code', description: "Anthropic's Claude in VS Code/CLI" },
|
|
86
|
-
{ value: 'cursor', title: 'Cursor', description: 'AI-first code editor' },
|
|
87
|
-
{ value: 'windsurf', title: 'Windsurf', description: "Codeium's AI IDE" },
|
|
88
|
-
{ value: 'copilot', title: 'GitHub Copilot', description: "GitHub's AI pair programmer" },
|
|
89
|
-
{ value: 'gemini', title: 'Gemini CLI', description: "Google's Gemini in terminal" },
|
|
90
|
-
]
|
|
91
|
-
|
|
92
|
-
// ============================================================================
|
|
93
|
-
// OnboardingWizard Class
|
|
94
|
-
// ============================================================================
|
|
95
|
-
|
|
96
|
-
export class OnboardingWizard {
|
|
97
|
-
private projectPath: string
|
|
98
|
-
private currentStep: number = 0
|
|
99
|
-
private totalSteps: number = 5
|
|
100
|
-
private aborted: boolean = false
|
|
101
|
-
|
|
102
|
-
// Collected data
|
|
103
|
-
private detectedType: ProjectType = 'unknown'
|
|
104
|
-
private confirmedType: ProjectType = 'unknown'
|
|
105
|
-
private selectedAgents: AIAgent[] = []
|
|
106
|
-
private detectedStack: DetectedStack = { language: 'Unknown', technologies: [] }
|
|
107
|
-
private confirmedStack: DetectedStack = { language: 'Unknown', technologies: [] }
|
|
108
|
-
private preferences: WizardPreferences = {
|
|
109
|
-
verbosity: 'normal',
|
|
110
|
-
autoSync: true,
|
|
111
|
-
telemetry: false,
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
constructor(projectPath: string = process.cwd()) {
|
|
115
|
-
this.projectPath = projectPath
|
|
116
|
-
|
|
117
|
-
// Handle Ctrl+C gracefully
|
|
118
|
-
prompts.override({})
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// ==========================================================================
|
|
122
|
-
// Public API
|
|
123
|
-
// ==========================================================================
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Run the full wizard flow
|
|
127
|
-
*/
|
|
128
|
-
async run(): Promise<WizardResult> {
|
|
129
|
-
this.printWelcome()
|
|
130
|
-
|
|
131
|
-
const steps: WizardStep[] = [
|
|
132
|
-
{ id: 'project-type', title: 'Project Type', run: () => this.stepProjectType() },
|
|
133
|
-
{ id: 'ai-agents', title: 'AI Agents', run: () => this.stepAIAgents() },
|
|
134
|
-
{ id: 'stack', title: 'Stack Confirmation', run: () => this.stepStack() },
|
|
135
|
-
{ id: 'preferences', title: 'Preferences', run: () => this.stepPreferences() },
|
|
136
|
-
{ id: 'summary', title: 'Summary', run: () => this.stepSummary() },
|
|
137
|
-
]
|
|
138
|
-
|
|
139
|
-
for (const step of steps) {
|
|
140
|
-
this.currentStep++
|
|
141
|
-
this.printStepHeader(step.title)
|
|
142
|
-
|
|
143
|
-
const shouldContinue = await step.run()
|
|
144
|
-
|
|
145
|
-
if (!shouldContinue || this.aborted) {
|
|
146
|
-
return this.buildResult(true)
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return this.buildResult(false)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Run in non-interactive mode (--yes flag)
|
|
155
|
-
* Uses all auto-detected values without prompting
|
|
156
|
-
*/
|
|
157
|
-
async runNonInteractive(): Promise<WizardResult> {
|
|
158
|
-
out.spin('Auto-detecting project configuration...')
|
|
159
|
-
|
|
160
|
-
// Auto-detect everything
|
|
161
|
-
this.detectedType = await this.detectProjectType()
|
|
162
|
-
this.confirmedType = this.detectedType
|
|
163
|
-
this.selectedAgents = ['claude'] // Default to Claude
|
|
164
|
-
this.detectedStack = await this.detectStack()
|
|
165
|
-
this.confirmedStack = this.detectedStack
|
|
166
|
-
// Use default preferences
|
|
167
|
-
|
|
168
|
-
out.done('Configuration detected')
|
|
169
|
-
|
|
170
|
-
return this.buildResult(false)
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// ==========================================================================
|
|
174
|
-
// Step Implementations
|
|
175
|
-
// ==========================================================================
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Step 1: Project Type Detection + Confirmation
|
|
179
|
-
*/
|
|
180
|
-
private async stepProjectType(): Promise<boolean> {
|
|
181
|
-
this.detectedType = await this.detectProjectType()
|
|
182
|
-
|
|
183
|
-
const response = await prompts(
|
|
184
|
-
{
|
|
185
|
-
type: 'select',
|
|
186
|
-
name: 'projectType',
|
|
187
|
-
message:
|
|
188
|
-
this.detectedType !== 'unknown'
|
|
189
|
-
? `Detected: ${this.getProjectTypeLabel(this.detectedType)}. Is this correct?`
|
|
190
|
-
: 'What type of project is this?',
|
|
191
|
-
choices: PROJECT_TYPES.map((pt) => ({
|
|
192
|
-
title: pt.title,
|
|
193
|
-
description: pt.description,
|
|
194
|
-
value: pt.value,
|
|
195
|
-
selected: pt.value === this.detectedType,
|
|
196
|
-
})),
|
|
197
|
-
initial: PROJECT_TYPES.findIndex((pt) => pt.value === this.detectedType),
|
|
198
|
-
},
|
|
199
|
-
{ onCancel: () => this.handleCancel() }
|
|
200
|
-
)
|
|
201
|
-
|
|
202
|
-
if (this.aborted) return false
|
|
203
|
-
|
|
204
|
-
this.confirmedType = response.projectType || this.detectedType
|
|
205
|
-
return true
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Step 2: AI Agent Selection (multi-select)
|
|
210
|
-
*/
|
|
211
|
-
private async stepAIAgents(): Promise<boolean> {
|
|
212
|
-
const detectedAgents = await this.detectInstalledAgents()
|
|
213
|
-
|
|
214
|
-
const response = await prompts(
|
|
215
|
-
{
|
|
216
|
-
type: 'multiselect',
|
|
217
|
-
name: 'agents',
|
|
218
|
-
message: 'Which AI agents do you use?',
|
|
219
|
-
choices: AI_AGENTS.map((agent) => ({
|
|
220
|
-
title: agent.title,
|
|
221
|
-
description: agent.description,
|
|
222
|
-
value: agent.value,
|
|
223
|
-
selected: detectedAgents.includes(agent.value),
|
|
224
|
-
})),
|
|
225
|
-
hint: '- Space to select, Enter to confirm',
|
|
226
|
-
instructions: false,
|
|
227
|
-
min: 1,
|
|
228
|
-
},
|
|
229
|
-
{ onCancel: () => this.handleCancel() }
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
if (this.aborted) return false
|
|
233
|
-
|
|
234
|
-
this.selectedAgents = response.agents || ['claude']
|
|
235
|
-
return true
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Step 3: Stack Detection + Confirmation
|
|
240
|
-
*/
|
|
241
|
-
private async stepStack(): Promise<boolean> {
|
|
242
|
-
this.detectedStack = await this.detectStack()
|
|
243
|
-
|
|
244
|
-
const stackDisplay = this.formatStackDisplay(this.detectedStack)
|
|
245
|
-
console.log(chalk.dim(`\n Detected: ${stackDisplay}\n`))
|
|
246
|
-
|
|
247
|
-
const response = await prompts(
|
|
248
|
-
{
|
|
249
|
-
type: 'confirm',
|
|
250
|
-
name: 'confirmed',
|
|
251
|
-
message: 'Is this stack correct?',
|
|
252
|
-
initial: true,
|
|
253
|
-
},
|
|
254
|
-
{ onCancel: () => this.handleCancel() }
|
|
255
|
-
)
|
|
256
|
-
|
|
257
|
-
if (this.aborted) return false
|
|
258
|
-
|
|
259
|
-
if (response.confirmed) {
|
|
260
|
-
this.confirmedStack = this.detectedStack
|
|
261
|
-
} else {
|
|
262
|
-
// Allow manual override
|
|
263
|
-
const manualResponse = await prompts(
|
|
264
|
-
[
|
|
265
|
-
{
|
|
266
|
-
type: 'text',
|
|
267
|
-
name: 'language',
|
|
268
|
-
message: 'Primary language:',
|
|
269
|
-
initial: this.detectedStack.language,
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
type: 'text',
|
|
273
|
-
name: 'framework',
|
|
274
|
-
message: 'Framework (optional):',
|
|
275
|
-
initial: this.detectedStack.framework || '',
|
|
276
|
-
},
|
|
277
|
-
],
|
|
278
|
-
{ onCancel: () => this.handleCancel() }
|
|
279
|
-
)
|
|
280
|
-
|
|
281
|
-
if (this.aborted) return false
|
|
282
|
-
|
|
283
|
-
this.confirmedStack = {
|
|
284
|
-
...this.detectedStack,
|
|
285
|
-
language: manualResponse.language || this.detectedStack.language,
|
|
286
|
-
framework: manualResponse.framework || undefined,
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
return true
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Step 4: Preferences Collection
|
|
295
|
-
*/
|
|
296
|
-
private async stepPreferences(): Promise<boolean> {
|
|
297
|
-
const response = await prompts(
|
|
298
|
-
[
|
|
299
|
-
{
|
|
300
|
-
type: 'select',
|
|
301
|
-
name: 'verbosity',
|
|
302
|
-
message: 'Output verbosity:',
|
|
303
|
-
choices: [
|
|
304
|
-
{ title: 'Minimal', description: 'Essential output only', value: 'minimal' },
|
|
305
|
-
{ title: 'Normal (Recommended)', description: 'Balanced information', value: 'normal' },
|
|
306
|
-
{ title: 'Verbose', description: 'Detailed logging', value: 'verbose' },
|
|
307
|
-
],
|
|
308
|
-
initial: 1,
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
type: 'confirm',
|
|
312
|
-
name: 'autoSync',
|
|
313
|
-
message: 'Auto-sync context on file changes?',
|
|
314
|
-
initial: true,
|
|
315
|
-
},
|
|
316
|
-
],
|
|
317
|
-
{ onCancel: () => this.handleCancel() }
|
|
318
|
-
)
|
|
319
|
-
|
|
320
|
-
if (this.aborted) return false
|
|
321
|
-
|
|
322
|
-
this.preferences = {
|
|
323
|
-
verbosity: response.verbosity || 'normal',
|
|
324
|
-
autoSync: response.autoSync ?? true,
|
|
325
|
-
telemetry: false, // Default off, can be enabled later
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return true
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Step 5: Summary + Generation
|
|
333
|
-
*/
|
|
334
|
-
private async stepSummary(): Promise<boolean> {
|
|
335
|
-
console.log('')
|
|
336
|
-
console.log(chalk.bold(' Configuration Summary'))
|
|
337
|
-
console.log(chalk.dim(` ${'─'.repeat(40)}`))
|
|
338
|
-
console.log(` ${chalk.cyan('Project Type:')} ${this.getProjectTypeLabel(this.confirmedType)}`)
|
|
339
|
-
console.log(
|
|
340
|
-
` ${chalk.cyan('AI Agents:')} ${this.selectedAgents.map((a) => this.getAgentLabel(a)).join(', ')}`
|
|
341
|
-
)
|
|
342
|
-
console.log(` ${chalk.cyan('Stack:')} ${this.formatStackDisplay(this.confirmedStack)}`)
|
|
343
|
-
console.log(` ${chalk.cyan('Verbosity:')} ${this.preferences.verbosity}`)
|
|
344
|
-
console.log(` ${chalk.cyan('Auto-sync:')} ${this.preferences.autoSync ? 'Yes' : 'No'}`)
|
|
345
|
-
console.log('')
|
|
346
|
-
|
|
347
|
-
const response = await prompts(
|
|
348
|
-
{
|
|
349
|
-
type: 'confirm',
|
|
350
|
-
name: 'proceed',
|
|
351
|
-
message: 'Generate configuration with these settings?',
|
|
352
|
-
initial: true,
|
|
353
|
-
},
|
|
354
|
-
{ onCancel: () => this.handleCancel() }
|
|
355
|
-
)
|
|
356
|
-
|
|
357
|
-
if (this.aborted || !response.proceed) {
|
|
358
|
-
return false
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
return true
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
// ==========================================================================
|
|
365
|
-
// Detection Methods
|
|
366
|
-
// ==========================================================================
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Detect project type from file system
|
|
370
|
-
*/
|
|
371
|
-
async detectProjectType(): Promise<ProjectType> {
|
|
372
|
-
const fs = await import('node:fs/promises')
|
|
373
|
-
const path = await import('node:path')
|
|
374
|
-
|
|
375
|
-
try {
|
|
376
|
-
const files = await fs.readdir(this.projectPath)
|
|
377
|
-
|
|
378
|
-
// Check for monorepo indicators
|
|
379
|
-
if (
|
|
380
|
-
files.includes('turbo.json') ||
|
|
381
|
-
files.includes('lerna.json') ||
|
|
382
|
-
files.includes('nx.json')
|
|
383
|
-
) {
|
|
384
|
-
return 'monorepo'
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// Check for package.json
|
|
388
|
-
if (files.includes('package.json')) {
|
|
389
|
-
const pkgPath = path.join(this.projectPath, 'package.json')
|
|
390
|
-
const pkgContent = await fs.readFile(pkgPath, 'utf-8')
|
|
391
|
-
const pkg = JSON.parse(pkgContent)
|
|
392
|
-
|
|
393
|
-
const deps = { ...pkg.dependencies, ...pkg.devDependencies }
|
|
394
|
-
|
|
395
|
-
// CLI tool indicators
|
|
396
|
-
if (pkg.bin) return 'cli-tool'
|
|
397
|
-
|
|
398
|
-
// Library indicators
|
|
399
|
-
if (pkg.main && !deps.react && !deps.vue && !deps.angular && !deps.express && !deps.hono) {
|
|
400
|
-
return 'library'
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
// Full-stack indicators
|
|
404
|
-
if ((deps.react || deps.vue) && (deps.express || deps.hono || deps.fastify)) {
|
|
405
|
-
return 'fullstack'
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// Frontend indicators
|
|
409
|
-
if (deps.react || deps.vue || deps['@angular/core'] || deps.next || deps.nuxt) {
|
|
410
|
-
return 'web-app'
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// Backend indicators
|
|
414
|
-
if (deps.express || deps.hono || deps.fastify || deps.koa || deps.nestjs) {
|
|
415
|
-
return 'api-backend'
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
// Python project detection
|
|
420
|
-
if (files.includes('pyproject.toml') || files.includes('setup.py')) {
|
|
421
|
-
const hasServer = files.some((f) => ['main.py', 'app.py', 'server.py'].includes(f))
|
|
422
|
-
return hasServer ? 'api-backend' : 'library'
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
// Go project detection
|
|
426
|
-
if (files.includes('go.mod')) {
|
|
427
|
-
return files.includes('main.go') ? 'cli-tool' : 'library'
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// Rust project detection
|
|
431
|
-
if (files.includes('Cargo.toml')) {
|
|
432
|
-
return 'cli-tool' // Most Rust CLIs
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
return 'unknown'
|
|
436
|
-
} catch {
|
|
437
|
-
return 'unknown'
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Detect installed AI agents from config files
|
|
443
|
-
*/
|
|
444
|
-
async detectInstalledAgents(): Promise<AIAgent[]> {
|
|
445
|
-
const fs = await import('node:fs/promises')
|
|
446
|
-
const path = await import('node:path')
|
|
447
|
-
const os = await import('node:os')
|
|
448
|
-
|
|
449
|
-
const agents: AIAgent[] = []
|
|
450
|
-
|
|
451
|
-
// Claude Code: Check ~/.claude directory
|
|
452
|
-
try {
|
|
453
|
-
await fs.access(path.join(os.homedir(), '.claude'))
|
|
454
|
-
agents.push('claude')
|
|
455
|
-
} catch {
|
|
456
|
-
/* not installed */
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
// Cursor: Check for .cursorrules in project
|
|
460
|
-
try {
|
|
461
|
-
await fs.access(path.join(this.projectPath, '.cursorrules'))
|
|
462
|
-
agents.push('cursor')
|
|
463
|
-
} catch {
|
|
464
|
-
/* not installed */
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
// Windsurf: Check for .windsurfrules
|
|
468
|
-
try {
|
|
469
|
-
await fs.access(path.join(this.projectPath, '.windsurfrules'))
|
|
470
|
-
agents.push('windsurf')
|
|
471
|
-
} catch {
|
|
472
|
-
/* not installed */
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
// Copilot: Check for .github/copilot-instructions.md
|
|
476
|
-
try {
|
|
477
|
-
await fs.access(path.join(this.projectPath, '.github', 'copilot-instructions.md'))
|
|
478
|
-
agents.push('copilot')
|
|
479
|
-
} catch {
|
|
480
|
-
/* not installed */
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
// Gemini: Check ~/.gemini
|
|
484
|
-
try {
|
|
485
|
-
await fs.access(path.join(os.homedir(), '.gemini'))
|
|
486
|
-
agents.push('gemini')
|
|
487
|
-
} catch {
|
|
488
|
-
/* not installed */
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
// Default to Claude if nothing detected
|
|
492
|
-
return agents.length > 0 ? agents : ['claude']
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* Detect tech stack from project files
|
|
497
|
-
*/
|
|
498
|
-
async detectStack(): Promise<DetectedStack> {
|
|
499
|
-
const fs = await import('node:fs/promises')
|
|
500
|
-
const path = await import('node:path')
|
|
501
|
-
|
|
502
|
-
const stack: DetectedStack = {
|
|
503
|
-
language: 'Unknown',
|
|
504
|
-
technologies: [],
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
try {
|
|
508
|
-
const files = await fs.readdir(this.projectPath)
|
|
509
|
-
|
|
510
|
-
// Language detection
|
|
511
|
-
if (files.includes('package.json')) {
|
|
512
|
-
const pkgPath = path.join(this.projectPath, 'package.json')
|
|
513
|
-
const pkgContent = await fs.readFile(pkgPath, 'utf-8')
|
|
514
|
-
const pkg = JSON.parse(pkgContent)
|
|
515
|
-
|
|
516
|
-
const deps = { ...pkg.dependencies, ...pkg.devDependencies }
|
|
517
|
-
|
|
518
|
-
// TypeScript check
|
|
519
|
-
stack.language = deps.typescript ? 'TypeScript' : 'JavaScript'
|
|
520
|
-
|
|
521
|
-
// Framework detection
|
|
522
|
-
if (deps.next) stack.framework = 'Next.js'
|
|
523
|
-
else if (deps.nuxt) stack.framework = 'Nuxt'
|
|
524
|
-
else if (deps.react) stack.framework = 'React'
|
|
525
|
-
else if (deps.vue) stack.framework = 'Vue'
|
|
526
|
-
else if (deps['@angular/core']) stack.framework = 'Angular'
|
|
527
|
-
else if (deps.express) stack.framework = 'Express'
|
|
528
|
-
else if (deps.hono) stack.framework = 'Hono'
|
|
529
|
-
else if (deps.fastify) stack.framework = 'Fastify'
|
|
530
|
-
else if (deps.nestjs || deps['@nestjs/core']) stack.framework = 'NestJS'
|
|
531
|
-
|
|
532
|
-
// Runtime detection
|
|
533
|
-
if (deps.bun || deps['@types/bun']) stack.runtime = 'Bun'
|
|
534
|
-
else if (pkg.engines?.bun) stack.runtime = 'Bun'
|
|
535
|
-
else stack.runtime = 'Node.js'
|
|
536
|
-
|
|
537
|
-
// Package manager detection
|
|
538
|
-
if (files.includes('bun.lockb')) stack.packageManager = 'Bun'
|
|
539
|
-
else if (files.includes('pnpm-lock.yaml')) stack.packageManager = 'pnpm'
|
|
540
|
-
else if (files.includes('yarn.lock')) stack.packageManager = 'Yarn'
|
|
541
|
-
else if (files.includes('package-lock.json')) stack.packageManager = 'npm'
|
|
542
|
-
|
|
543
|
-
// Additional technologies
|
|
544
|
-
if (deps.prisma || deps['@prisma/client']) stack.technologies.push('Prisma')
|
|
545
|
-
if (deps.drizzle || deps['drizzle-orm']) stack.technologies.push('Drizzle')
|
|
546
|
-
if (deps.tailwindcss) stack.technologies.push('Tailwind CSS')
|
|
547
|
-
if (deps.zod) stack.technologies.push('Zod')
|
|
548
|
-
if (deps.trpc || deps['@trpc/server']) stack.technologies.push('tRPC')
|
|
549
|
-
} else if (files.includes('pyproject.toml') || files.includes('requirements.txt')) {
|
|
550
|
-
stack.language = 'Python'
|
|
551
|
-
// Could parse pyproject.toml for framework detection
|
|
552
|
-
} else if (files.includes('go.mod')) {
|
|
553
|
-
stack.language = 'Go'
|
|
554
|
-
} else if (files.includes('Cargo.toml')) {
|
|
555
|
-
stack.language = 'Rust'
|
|
556
|
-
} else if (files.includes('pom.xml') || files.includes('build.gradle')) {
|
|
557
|
-
stack.language = 'Java'
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
return stack
|
|
561
|
-
} catch {
|
|
562
|
-
return stack
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
// ==========================================================================
|
|
567
|
-
// Helper Methods
|
|
568
|
-
// ==========================================================================
|
|
569
|
-
|
|
570
|
-
private printWelcome(): void {
|
|
571
|
-
console.log('')
|
|
572
|
-
console.log(chalk.bold.cyan(' Welcome to prjct-cli!'))
|
|
573
|
-
console.log(chalk.dim(" Let's set up your project in 60 seconds."))
|
|
574
|
-
console.log('')
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
private printStepHeader(title: string): void {
|
|
578
|
-
console.log('')
|
|
579
|
-
console.log(chalk.dim(` Step ${this.currentStep}/${this.totalSteps}: ${title}`))
|
|
580
|
-
console.log('')
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
private handleCancel(): void {
|
|
584
|
-
this.aborted = true
|
|
585
|
-
console.log(chalk.yellow('\n Setup cancelled. Run again anytime.\n'))
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
private getProjectTypeLabel(type: ProjectType): string {
|
|
589
|
-
return PROJECT_TYPES.find((pt) => pt.value === type)?.title || 'Unknown'
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
private getAgentLabel(agent: AIAgent): string {
|
|
593
|
-
return AI_AGENTS.find((a) => a.value === agent)?.title || agent
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
private formatStackDisplay(stack: DetectedStack): string {
|
|
597
|
-
const parts = [stack.language]
|
|
598
|
-
if (stack.framework) parts.push(stack.framework)
|
|
599
|
-
if (stack.runtime && stack.runtime !== 'Node.js') parts.push(stack.runtime)
|
|
600
|
-
if (stack.technologies.length > 0) {
|
|
601
|
-
parts.push(`+ ${stack.technologies.slice(0, 3).join(', ')}`)
|
|
602
|
-
}
|
|
603
|
-
return parts.join(' / ')
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
private buildResult(skipped: boolean): WizardResult {
|
|
607
|
-
return {
|
|
608
|
-
projectType: this.confirmedType,
|
|
609
|
-
agents: this.selectedAgents,
|
|
610
|
-
stack: this.confirmedStack,
|
|
611
|
-
preferences: this.preferences,
|
|
612
|
-
skipped,
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
// ==========================================================================
|
|
617
|
-
// Getters for external access
|
|
618
|
-
// ==========================================================================
|
|
619
|
-
|
|
620
|
-
getSelectedAgents(): AIAgent[] {
|
|
621
|
-
return this.selectedAgents
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
getConfirmedStack(): DetectedStack {
|
|
625
|
-
return this.confirmedStack
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
getPreferences(): WizardPreferences {
|
|
629
|
-
return this.preferences
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
export default OnboardingWizard
|