ccjk 14.2.2 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +75 -338
- package/dist/cli.js +89 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/detect.js +15 -0
- package/dist/commands/detect.js.map +1 -0
- package/dist/commands/doctor.js +68 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/git-install.js +50 -0
- package/dist/commands/git-install.js.map +1 -0
- package/dist/commands/init.js +165 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mcp.js +66 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/menu.js +42 -0
- package/dist/commands/menu.js.map +1 -0
- package/dist/commands/profile.js +138 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/core/detect.js +24 -0
- package/dist/core/detect.js.map +1 -0
- package/dist/core/lint.js +49 -0
- package/dist/core/lint.js.map +1 -0
- package/dist/core/mcp.js +41 -0
- package/dist/core/mcp.js.map +1 -0
- package/dist/core/paths.js +9 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/profiles.js +104 -0
- package/dist/core/profiles.js.map +1 -0
- package/dist/core/providers.js +53 -0
- package/dist/core/providers.js.map +1 -0
- package/dist/core/settings.js +31 -0
- package/dist/core/settings.js.map +1 -0
- package/dist/core/slash-templates.js +56 -0
- package/dist/core/slash-templates.js.map +1 -0
- package/dist/core/tools.js +27 -0
- package/dist/core/tools.js.map +1 -0
- package/package.json +43 -164
- package/README.HONEST.md +0 -176
- package/README.en.md +0 -67
- package/README.ja.md +0 -67
- package/README.ko.md +0 -67
- package/README.zh-CN.md +0 -86
- package/bin/ccjk.mjs +0 -5
- package/bin/ccjk.ts +0 -222
- package/dist/chunks/agent-teams.mjs +0 -145
- package/dist/chunks/agent.mjs +0 -1439
- package/dist/chunks/agents.mjs +0 -3783
- package/dist/chunks/api-cli.mjs +0 -135
- package/dist/chunks/api-config-selector.mjs +0 -159
- package/dist/chunks/api-providers.mjs +0 -144
- package/dist/chunks/api.mjs +0 -115
- package/dist/chunks/auto-bootstrap.mjs +0 -358
- package/dist/chunks/auto-fixer.mjs +0 -95
- package/dist/chunks/auto-updater.mjs +0 -507
- package/dist/chunks/banner.mjs +0 -173
- package/dist/chunks/bash.mjs +0 -187
- package/dist/chunks/boost.mjs +0 -474
- package/dist/chunks/brain-config.mjs +0 -75
- package/dist/chunks/brain-status.mjs +0 -89
- package/dist/chunks/ccjk-agents.mjs +0 -416
- package/dist/chunks/ccjk-all.mjs +0 -1046
- package/dist/chunks/ccjk-config.mjs +0 -445
- package/dist/chunks/ccjk-hooks.mjs +0 -1074
- package/dist/chunks/ccjk-mcp.mjs +0 -763
- package/dist/chunks/ccjk-setup.mjs +0 -765
- package/dist/chunks/ccjk-skills.mjs +0 -518
- package/dist/chunks/ccr.mjs +0 -109
- package/dist/chunks/ccu.mjs +0 -40
- package/dist/chunks/check-updates.mjs +0 -117
- package/dist/chunks/claude-code-incremental-manager.mjs +0 -761
- package/dist/chunks/claude-config.mjs +0 -606
- package/dist/chunks/claude-config2.mjs +0 -62
- package/dist/chunks/claude-wrapper.mjs +0 -85
- package/dist/chunks/clavue-config.mjs +0 -1454
- package/dist/chunks/cleanup-migration.mjs +0 -20
- package/dist/chunks/cli-hook.mjs +0 -4096
- package/dist/chunks/cloud-sync.mjs +0 -29
- package/dist/chunks/code-type-resolver.mjs +0 -880
- package/dist/chunks/codex-config-switch.mjs +0 -452
- package/dist/chunks/codex-provider-manager.mjs +0 -238
- package/dist/chunks/codex-uninstaller.mjs +0 -404
- package/dist/chunks/codex.mjs +0 -2141
- package/dist/chunks/commands.mjs +0 -108
- package/dist/chunks/commands2.mjs +0 -421
- package/dist/chunks/commit.mjs +0 -140
- package/dist/chunks/completion.mjs +0 -517
- package/dist/chunks/config-consolidator.mjs +0 -172
- package/dist/chunks/config-switch.mjs +0 -334
- package/dist/chunks/config.mjs +0 -558
- package/dist/chunks/config2.mjs +0 -484
- package/dist/chunks/config3.mjs +0 -486
- package/dist/chunks/constants.mjs +0 -323
- package/dist/chunks/context-opt.mjs +0 -444
- package/dist/chunks/context.mjs +0 -974
- package/dist/chunks/dashboard.mjs +0 -481
- package/dist/chunks/doctor.mjs +0 -1301
- package/dist/chunks/eval.mjs +0 -502
- package/dist/chunks/evolution.mjs +0 -322
- package/dist/chunks/features.mjs +0 -715
- package/dist/chunks/fish.mjs +0 -181
- package/dist/chunks/fs-operations.mjs +0 -180
- package/dist/chunks/health-alerts.mjs +0 -830
- package/dist/chunks/help.mjs +0 -341
- package/dist/chunks/hook-installer.mjs +0 -48
- package/dist/chunks/impact.mjs +0 -651
- package/dist/chunks/index.mjs +0 -23
- package/dist/chunks/index10.mjs +0 -19
- package/dist/chunks/index11.mjs +0 -1171
- package/dist/chunks/index12.mjs +0 -218
- package/dist/chunks/index13.mjs +0 -679
- package/dist/chunks/index14.mjs +0 -1009
- package/dist/chunks/index15.mjs +0 -194
- package/dist/chunks/index2.mjs +0 -7637
- package/dist/chunks/index3.mjs +0 -171
- package/dist/chunks/index4.mjs +0 -26
- package/dist/chunks/index5.mjs +0 -19
- package/dist/chunks/index6.mjs +0 -19092
- package/dist/chunks/index7.mjs +0 -616
- package/dist/chunks/index8.mjs +0 -1602
- package/dist/chunks/index9.mjs +0 -5384
- package/dist/chunks/init.mjs +0 -1911
- package/dist/chunks/installer.mjs +0 -757
- package/dist/chunks/installer2.mjs +0 -103
- package/dist/chunks/interview.mjs +0 -2927
- package/dist/chunks/json-config.mjs +0 -60
- package/dist/chunks/linux.mjs +0 -3863
- package/dist/chunks/macos.mjs +0 -69
- package/dist/chunks/main.mjs +0 -635
- package/dist/chunks/manager.mjs +0 -1048
- package/dist/chunks/marketplace.mjs +0 -265
- package/dist/chunks/mcp-cli.mjs +0 -205
- package/dist/chunks/mcp-performance.mjs +0 -187
- package/dist/chunks/mcp.mjs +0 -667
- package/dist/chunks/memory-check.mjs +0 -2973
- package/dist/chunks/memory-paths.mjs +0 -259
- package/dist/chunks/memory-sync.mjs +0 -209
- package/dist/chunks/memory.mjs +0 -354
- package/dist/chunks/metrics-display.mjs +0 -153
- package/dist/chunks/monitor.mjs +0 -1856
- package/dist/chunks/notification.mjs +0 -1864
- package/dist/chunks/onboarding.mjs +0 -386
- package/dist/chunks/package.mjs +0 -3
- package/dist/chunks/paradigm.mjs +0 -74
- package/dist/chunks/permission-manager.mjs +0 -250
- package/dist/chunks/permissions.mjs +0 -265
- package/dist/chunks/persistence-manager.mjs +0 -801
- package/dist/chunks/persistence.mjs +0 -707
- package/dist/chunks/platform.mjs +0 -395
- package/dist/chunks/plugin.mjs +0 -1936
- package/dist/chunks/powershell.mjs +0 -213
- package/dist/chunks/prompts.mjs +0 -244
- package/dist/chunks/providers.mjs +0 -263
- package/dist/chunks/quick-actions.mjs +0 -335
- package/dist/chunks/quick-provider.mjs +0 -755
- package/dist/chunks/quick-setup.mjs +0 -421
- package/dist/chunks/remote.mjs +0 -497
- package/dist/chunks/research.mjs +0 -1904
- package/dist/chunks/rollback.mjs +0 -38
- package/dist/chunks/session-manager.mjs +0 -1371
- package/dist/chunks/session.mjs +0 -878
- package/dist/chunks/sessions.mjs +0 -106
- package/dist/chunks/silent-updater.mjs +0 -396
- package/dist/chunks/simple-config.mjs +0 -122
- package/dist/chunks/skill.mjs +0 -117
- package/dist/chunks/skill2.mjs +0 -9052
- package/dist/chunks/skills-sync.mjs +0 -1343
- package/dist/chunks/skills.mjs +0 -577
- package/dist/chunks/slash-commands.mjs +0 -208
- package/dist/chunks/smart-guide.mjs +0 -247
- package/dist/chunks/snapshot.mjs +0 -58
- package/dist/chunks/startup.mjs +0 -487
- package/dist/chunks/stats.mjs +0 -191
- package/dist/chunks/status.mjs +0 -471
- package/dist/chunks/team.mjs +0 -63
- package/dist/chunks/thinking.mjs +0 -626
- package/dist/chunks/trace.mjs +0 -57
- package/dist/chunks/uninstall.mjs +0 -852
- package/dist/chunks/update.mjs +0 -174
- package/dist/chunks/upgrade-manager.mjs +0 -204
- package/dist/chunks/upgrade.mjs +0 -133
- package/dist/chunks/version-checker.mjs +0 -891
- package/dist/chunks/vim.mjs +0 -903
- package/dist/chunks/windows.mjs +0 -14
- package/dist/chunks/workflows.mjs +0 -633
- package/dist/chunks/wsl.mjs +0 -129
- package/dist/chunks/zero-config.mjs +0 -871
- package/dist/chunks/zsh.mjs +0 -182
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.mjs +0 -2684
- package/dist/i18n/locales/en/agent-teams.json +0 -18
- package/dist/i18n/locales/en/agentBrowser.json +0 -80
- package/dist/i18n/locales/en/agents.json +0 -135
- package/dist/i18n/locales/en/api.json +0 -63
- package/dist/i18n/locales/en/ccjk-agents.json +0 -33
- package/dist/i18n/locales/en/ccjk-all.json +0 -23
- package/dist/i18n/locales/en/ccjk-skills.json +0 -22
- package/dist/i18n/locales/en/ccjk.json +0 -276
- package/dist/i18n/locales/en/ccr.json +0 -65
- package/dist/i18n/locales/en/claude-md.json +0 -73
- package/dist/i18n/locales/en/cli.json +0 -148
- package/dist/i18n/locales/en/cloud-setup.json +0 -31
- package/dist/i18n/locales/en/cloud-sync.json +0 -147
- package/dist/i18n/locales/en/cloud.json +0 -40
- package/dist/i18n/locales/en/cloudPlugins.json +0 -118
- package/dist/i18n/locales/en/codex.json +0 -184
- package/dist/i18n/locales/en/cometix.json +0 -29
- package/dist/i18n/locales/en/common.json +0 -68
- package/dist/i18n/locales/en/config.json +0 -108
- package/dist/i18n/locales/en/configuration.json +0 -236
- package/dist/i18n/locales/en/context.json +0 -85
- package/dist/i18n/locales/en/dashboard.json +0 -78
- package/dist/i18n/locales/en/errors.json +0 -26
- package/dist/i18n/locales/en/evolution.json +0 -54
- package/dist/i18n/locales/en/hooks.json +0 -74
- package/dist/i18n/locales/en/hooksSync.json +0 -133
- package/dist/i18n/locales/en/installation.json +0 -83
- package/dist/i18n/locales/en/interview.json +0 -104
- package/dist/i18n/locales/en/language.json +0 -19
- package/dist/i18n/locales/en/lsp.json +0 -78
- package/dist/i18n/locales/en/marketplace.json +0 -116
- package/dist/i18n/locales/en/mcp.json +0 -180
- package/dist/i18n/locales/en/memory.json +0 -23
- package/dist/i18n/locales/en/menu.json +0 -299
- package/dist/i18n/locales/en/multi-config.json +0 -79
- package/dist/i18n/locales/en/notification.json +0 -307
- package/dist/i18n/locales/en/permissions.json +0 -95
- package/dist/i18n/locales/en/persistence.json +0 -127
- package/dist/i18n/locales/en/plugins.json +0 -146
- package/dist/i18n/locales/en/quick-actions.json +0 -78
- package/dist/i18n/locales/en/registry.json +0 -54
- package/dist/i18n/locales/en/remote.json +0 -93
- package/dist/i18n/locales/en/sandbox.json +0 -44
- package/dist/i18n/locales/en/setup.json +0 -44
- package/dist/i18n/locales/en/shencha.json +0 -14
- package/dist/i18n/locales/en/skills.json +0 -100
- package/dist/i18n/locales/en/skillsSync.json +0 -74
- package/dist/i18n/locales/en/smartGuide.json +0 -49
- package/dist/i18n/locales/en/stats.json +0 -20
- package/dist/i18n/locales/en/subagent.json +0 -69
- package/dist/i18n/locales/en/superpowers.json +0 -117
- package/dist/i18n/locales/en/team.json +0 -7
- package/dist/i18n/locales/en/thinking.json +0 -65
- package/dist/i18n/locales/en/tools.json +0 -42
- package/dist/i18n/locales/en/uninstall.json +0 -56
- package/dist/i18n/locales/en/updater.json +0 -29
- package/dist/i18n/locales/en/vim.json +0 -169
- package/dist/i18n/locales/en/workflow.json +0 -55
- package/dist/i18n/locales/en/workspace.json +0 -108
- package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
- package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -80
- package/dist/i18n/locales/zh-CN/agents.json +0 -135
- package/dist/i18n/locales/zh-CN/api.json +0 -63
- package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
- package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
- package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
- package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
- package/dist/i18n/locales/zh-CN/ccr.json +0 -65
- package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
- package/dist/i18n/locales/zh-CN/cli.json +0 -148
- package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
- package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
- package/dist/i18n/locales/zh-CN/cloud.json +0 -40
- package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
- package/dist/i18n/locales/zh-CN/codex.json +0 -184
- package/dist/i18n/locales/zh-CN/cometix.json +0 -29
- package/dist/i18n/locales/zh-CN/common.json +0 -68
- package/dist/i18n/locales/zh-CN/config.json +0 -108
- package/dist/i18n/locales/zh-CN/configuration.json +0 -234
- package/dist/i18n/locales/zh-CN/context.json +0 -85
- package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
- package/dist/i18n/locales/zh-CN/errors.json +0 -26
- package/dist/i18n/locales/zh-CN/evolution.json +0 -54
- package/dist/i18n/locales/zh-CN/hooks.json +0 -74
- package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
- package/dist/i18n/locales/zh-CN/installation.json +0 -83
- package/dist/i18n/locales/zh-CN/interview.json +0 -104
- package/dist/i18n/locales/zh-CN/language.json +0 -19
- package/dist/i18n/locales/zh-CN/lsp.json +0 -78
- package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
- package/dist/i18n/locales/zh-CN/mcp.json +0 -180
- package/dist/i18n/locales/zh-CN/memory.json +0 -23
- package/dist/i18n/locales/zh-CN/menu.json +0 -299
- package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
- package/dist/i18n/locales/zh-CN/notification.json +0 -307
- package/dist/i18n/locales/zh-CN/permissions.json +0 -95
- package/dist/i18n/locales/zh-CN/persistence.json +0 -127
- package/dist/i18n/locales/zh-CN/plugins.json +0 -146
- package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
- package/dist/i18n/locales/zh-CN/registry.json +0 -54
- package/dist/i18n/locales/zh-CN/remote.json +0 -93
- package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
- package/dist/i18n/locales/zh-CN/setup.json +0 -44
- package/dist/i18n/locales/zh-CN/shencha.json +0 -14
- package/dist/i18n/locales/zh-CN/skills.json +0 -100
- package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
- package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
- package/dist/i18n/locales/zh-CN/stats.json +0 -20
- package/dist/i18n/locales/zh-CN/subagent.json +0 -69
- package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
- package/dist/i18n/locales/zh-CN/team.json +0 -7
- package/dist/i18n/locales/zh-CN/thinking.json +0 -65
- package/dist/i18n/locales/zh-CN/tools.json +0 -42
- package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
- package/dist/i18n/locales/zh-CN/updater.json +0 -29
- package/dist/i18n/locales/zh-CN/vim.json +0 -169
- package/dist/i18n/locales/zh-CN/workflow.json +0 -55
- package/dist/i18n/locales/zh-CN/workspace.json +0 -108
- package/dist/index.d.mts +0 -5658
- package/dist/index.d.ts +0 -5658
- package/dist/index.mjs +0 -3732
- package/dist/shared/ccjk.5bEolFrk.mjs +0 -254
- package/dist/shared/ccjk.8oaxX4iR.mjs +0 -90
- package/dist/shared/ccjk.B2U7DsPy.mjs +0 -31
- package/dist/shared/ccjk.B2f-cwUP.mjs +0 -468
- package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
- package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
- package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
- package/dist/shared/ccjk.BLsIiTqO.mjs +0 -449
- package/dist/shared/ccjk.BXv8aYs1.mjs +0 -170
- package/dist/shared/ccjk.BnsY5WxD.mjs +0 -171
- package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
- package/dist/shared/ccjk.Bq8TqZG_.mjs +0 -189
- package/dist/shared/ccjk.BtrioX1Z.mjs +0 -25
- package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
- package/dist/shared/ccjk.BzPbSEP2.mjs +0 -115
- package/dist/shared/ccjk.C0WLUnFV.mjs +0 -293
- package/dist/shared/ccjk.C1hANZTu.mjs +0 -19
- package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
- package/dist/shared/ccjk.CNhnT6uQ.mjs +0 -636
- package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
- package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
- package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
- package/dist/shared/ccjk.CoCHVXl3.mjs +0 -3951
- package/dist/shared/ccjk.CwGZSTAK.mjs +0 -319
- package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
- package/dist/shared/ccjk.D-magaEx.mjs +0 -763
- package/dist/shared/ccjk.D0g2ABGg.mjs +0 -171
- package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
- package/dist/shared/ccjk.D75wivnp.mjs +0 -142
- package/dist/shared/ccjk.DDL-4C-k.mjs +0 -100
- package/dist/shared/ccjk.DFRPtmK_.mjs +0 -75
- package/dist/shared/ccjk.DMV3x5Sd.mjs +0 -299
- package/dist/shared/ccjk.DZ2LLOa-.mjs +0 -2195
- package/dist/shared/ccjk.DbigonEQ.mjs +0 -698
- package/dist/shared/ccjk.DcMvE7lf.mjs +0 -618
- package/dist/shared/ccjk.DeWpAShp.mjs +0 -1828
- package/dist/shared/ccjk.DhJ1kyDR.mjs +0 -30
- package/dist/shared/ccjk.DlTXS9rP.mjs +0 -224
- package/dist/shared/ccjk.DopKzo3z.mjs +0 -305
- package/dist/shared/ccjk.DsZsc4LR.mjs +0 -1280
- package/dist/shared/ccjk.DuzJZlgj.mjs +0 -418
- package/dist/shared/ccjk.Dxgd2vjc.mjs +0 -444
- package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
- package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
- package/dist/shared/ccjk.L7yC58_i.mjs +0 -225
- package/dist/shared/ccjk.MwtjAULc.mjs +0 -1447
- package/dist/shared/ccjk.OJKHVSOb.mjs +0 -2005
- package/dist/shared/ccjk.OTnevPNE.mjs +0 -225
- package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
- package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
- package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
- package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
- package/dist/shared/ccjk.i_vn-9C3.mjs +0 -317
- package/dist/shared/ccjk.lG3ccFjm.mjs +0 -885
- package/dist/shared/ccjk.wLJHO0Af.mjs +0 -244
- package/dist/shared/ccjk.y-a_1vK4.mjs +0 -5127
- package/dist/templates/agents/README.md +0 -78
- package/dist/templates/agents/fullstack-developer.json +0 -70
- package/dist/templates/agents/go-expert.json +0 -69
- package/dist/templates/agents/index.json +0 -64
- package/dist/templates/agents/python-expert.json +0 -69
- package/dist/templates/agents/react-specialist.json +0 -69
- package/dist/templates/agents/testing-automation-expert.json +0 -70
- package/dist/templates/agents/typescript-architect.json +0 -69
- package/dist/templates/claude-code/common/settings.json +0 -109
- package/dist/templates/common/error-prevention.md +0 -267
- package/dist/templates/common/karpathy-baseline.md +0 -83
- package/dist/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
- package/dist/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
- package/dist/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
- package/dist/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
- package/dist/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
- package/dist/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
- package/dist/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
- package/dist/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
- package/dist/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
- package/dist/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
- package/dist/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
- package/dist/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
- package/dist/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
- package/dist/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
- package/dist/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
- package/dist/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
- package/dist/templates/common/workflow/essential/en/feat.md +0 -92
- package/dist/templates/common/workflow/essential/en/goal.md +0 -147
- package/dist/templates/common/workflow/essential/en/init-project.md +0 -53
- package/dist/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
- package/dist/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
- package/dist/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
- package/dist/templates/common/workflow/essential/zh-CN/feat.md +0 -315
- package/dist/templates/common/workflow/essential/zh-CN/goal.md +0 -146
- package/dist/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
- package/dist/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
- package/dist/templates/common/workflow/git/en/git-commit.md +0 -205
- package/dist/templates/common/workflow/git/en/git-rollback.md +0 -90
- package/dist/templates/common/workflow/git/en/git-worktree.md +0 -276
- package/dist/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
- package/dist/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
- package/dist/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
- package/dist/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
- package/dist/templates/common/workflow/interview/en/interview.md +0 -67
- package/dist/templates/common/workflow/interview/zh-CN/interview.md +0 -67
- package/dist/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
- package/dist/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
- package/dist/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
- package/dist/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
- package/dist/templates/common/workflow/sixStep/en/workflow.md +0 -83
- package/dist/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
- package/dist/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
- package/dist/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
- package/dist/templates/hooks/README.md +0 -212
- package/dist/templates/hooks/git-workflow-hooks.md +0 -551
- package/dist/templates/hooks/post-test/coverage.json +0 -21
- package/dist/templates/hooks/post-test/summary.json +0 -21
- package/dist/templates/hooks/post-test-coverage.md +0 -434
- package/dist/templates/hooks/pre-commit/eslint.json +0 -22
- package/dist/templates/hooks/pre-commit/prettier.json +0 -22
- package/dist/templates/hooks/pre-commit-black.md +0 -274
- package/dist/templates/hooks/pre-commit-eslint.md +0 -153
- package/dist/templates/hooks/pre-commit-gofmt.md +0 -284
- package/dist/templates/hooks/pre-commit-prettier.md +0 -212
- package/dist/templates/hooks/pre-commit-type-check.md +0 -377
- package/dist/templates/skills/ccjk-init.md +0 -154
- package/dist/templates/skills/ccjk-mcp-setup.md +0 -205
- package/dist/templates/skills/ccjk-troubleshoot.md +0 -228
- package/dist/templates/skills/django-patterns.md +0 -1016
- package/dist/templates/skills/git-workflow.md +0 -748
- package/dist/templates/skills/go-idioms.md +0 -963
- package/dist/templates/skills/index.json +0 -132
- package/dist/templates/skills/nextjs-optimization.md +0 -694
- package/dist/templates/skills/python-pep8.md +0 -852
- package/dist/templates/skills/react-patterns.md +0 -686
- package/dist/templates/skills/rust-patterns.md +0 -1057
- package/dist/templates/skills/security-best-practices.md +0 -1413
- package/dist/templates/skills/testing-best-practices.md +0 -1315
- package/dist/templates/skills/ts-best-practices.md +0 -354
- package/templates/agents/README.md +0 -78
- package/templates/agents/fullstack-developer.json +0 -70
- package/templates/agents/go-expert.json +0 -69
- package/templates/agents/index.json +0 -64
- package/templates/agents/python-expert.json +0 -69
- package/templates/agents/react-specialist.json +0 -69
- package/templates/agents/testing-automation-expert.json +0 -70
- package/templates/agents/typescript-architect.json +0 -69
- package/templates/claude-code/common/settings.json +0 -109
- package/templates/common/error-prevention.md +0 -267
- package/templates/common/karpathy-baseline.md +0 -83
- package/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
- package/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
- package/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
- package/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
- package/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
- package/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
- package/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
- package/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
- package/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
- package/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
- package/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
- package/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
- package/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
- package/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
- package/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
- package/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
- package/templates/common/workflow/essential/en/feat.md +0 -92
- package/templates/common/workflow/essential/en/goal.md +0 -147
- package/templates/common/workflow/essential/en/init-project.md +0 -53
- package/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
- package/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
- package/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
- package/templates/common/workflow/essential/zh-CN/feat.md +0 -315
- package/templates/common/workflow/essential/zh-CN/goal.md +0 -146
- package/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
- package/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
- package/templates/common/workflow/git/en/git-commit.md +0 -205
- package/templates/common/workflow/git/en/git-rollback.md +0 -90
- package/templates/common/workflow/git/en/git-worktree.md +0 -276
- package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
- package/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
- package/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
- package/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
- package/templates/common/workflow/interview/en/interview.md +0 -67
- package/templates/common/workflow/interview/zh-CN/interview.md +0 -67
- package/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
- package/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
- package/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
- package/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
- package/templates/common/workflow/sixStep/en/workflow.md +0 -83
- package/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
- package/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
- package/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
- package/templates/hooks/README.md +0 -212
- package/templates/hooks/git-workflow-hooks.md +0 -551
- package/templates/hooks/post-test/coverage.json +0 -21
- package/templates/hooks/post-test/summary.json +0 -21
- package/templates/hooks/post-test-coverage.md +0 -434
- package/templates/hooks/pre-commit/eslint.json +0 -22
- package/templates/hooks/pre-commit/prettier.json +0 -22
- package/templates/hooks/pre-commit-black.md +0 -274
- package/templates/hooks/pre-commit-eslint.md +0 -153
- package/templates/hooks/pre-commit-gofmt.md +0 -284
- package/templates/hooks/pre-commit-prettier.md +0 -212
- package/templates/hooks/pre-commit-type-check.md +0 -377
- package/templates/skills/basic.hbs +0 -72
- package/templates/skills/ccjk-init.md +0 -154
- package/templates/skills/ccjk-mcp-setup.md +0 -205
- package/templates/skills/ccjk-troubleshoot.md +0 -228
- package/templates/skills/code-refactor.hbs +0 -133
- package/templates/skills/code-review.hbs +0 -141
- package/templates/skills/django-patterns.md +0 -1016
- package/templates/skills/git-workflow.md +0 -748
- package/templates/skills/go-idioms.md +0 -963
- package/templates/skills/index.json +0 -132
- package/templates/skills/nextjs-optimization.md +0 -694
- package/templates/skills/python-pep8.md +0 -852
- package/templates/skills/react-patterns.md +0 -686
- package/templates/skills/rust-patterns.md +0 -1057
- package/templates/skills/security-best-practices.md +0 -1413
- package/templates/skills/testing-best-practices.md +0 -1315
- package/templates/skills/ts-best-practices.md +0 -354
- package/templates/skills/type-fix.hbs +0 -132
|
@@ -1,765 +0,0 @@
|
|
|
1
|
-
import a from './index5.mjs';
|
|
2
|
-
import { c as consola, P as ProjectAnalyzer } from '../shared/ccjk.CoCHVXl3.mjs';
|
|
3
|
-
import { i18n, resolveSupportedLanguage } from './index2.mjs';
|
|
4
|
-
import { promises } from 'node:fs';
|
|
5
|
-
import { performance } from 'node:perf_hooks';
|
|
6
|
-
import { ccjkAgents } from './ccjk-agents.mjs';
|
|
7
|
-
import { ccjkHooks } from './ccjk-hooks.mjs';
|
|
8
|
-
import { ccjkMcp } from './ccjk-mcp.mjs';
|
|
9
|
-
import { ccjkSkills } from './ccjk-skills.mjs';
|
|
10
|
-
import { d as dayjs } from '../shared/ccjk.RyizuzOI.mjs';
|
|
11
|
-
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
12
|
-
import '../shared/ccjk.BAGoDD49.mjs';
|
|
13
|
-
import './index10.mjs';
|
|
14
|
-
import 'tinyglobby';
|
|
15
|
-
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
16
|
-
import './constants.mjs';
|
|
17
|
-
import 'node:os';
|
|
18
|
-
import 'node:process';
|
|
19
|
-
import 'node:url';
|
|
20
|
-
import '../shared/ccjk.CfKKcvWy.mjs';
|
|
21
|
-
import '../shared/ccjk.C2jHOZVP.mjs';
|
|
22
|
-
import './index6.mjs';
|
|
23
|
-
import 'node:readline';
|
|
24
|
-
import 'stream';
|
|
25
|
-
import 'node:tty';
|
|
26
|
-
import 'node:async_hooks';
|
|
27
|
-
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
28
|
-
import 'node:util';
|
|
29
|
-
import 'tty';
|
|
30
|
-
import 'fs';
|
|
31
|
-
import 'child_process';
|
|
32
|
-
import 'node:path';
|
|
33
|
-
import 'node:crypto';
|
|
34
|
-
import 'buffer';
|
|
35
|
-
import 'string_decoder';
|
|
36
|
-
import 'node:child_process';
|
|
37
|
-
import './claude-config.mjs';
|
|
38
|
-
import '../shared/ccjk.DDL-4C-k.mjs';
|
|
39
|
-
import './ccjk-config.mjs';
|
|
40
|
-
import './index3.mjs';
|
|
41
|
-
import './fs-operations.mjs';
|
|
42
|
-
import 'node:fs/promises';
|
|
43
|
-
import './json-config.mjs';
|
|
44
|
-
import './platform.mjs';
|
|
45
|
-
import './main.mjs';
|
|
46
|
-
import 'module';
|
|
47
|
-
import 'node:stream';
|
|
48
|
-
import '../shared/ccjk.i_vn-9C3.mjs';
|
|
49
|
-
|
|
50
|
-
async function createBackup(operation, options = {}) {
|
|
51
|
-
const timestamp = dayjs().format("YYYYMMDD-HHmmss");
|
|
52
|
-
const backupName = options.name || operation;
|
|
53
|
-
const backupDir = join(process.cwd(), ".ccjk-backups", `${backupName}-${timestamp}`);
|
|
54
|
-
try {
|
|
55
|
-
await promises.mkdir(backupDir, { recursive: true });
|
|
56
|
-
const filesToBackup = [
|
|
57
|
-
".claude.json",
|
|
58
|
-
".claude.md",
|
|
59
|
-
".claudeignore",
|
|
60
|
-
"claude.config.json",
|
|
61
|
-
"claude.config.toml",
|
|
62
|
-
".vscode/settings.json",
|
|
63
|
-
".github/workflows",
|
|
64
|
-
".git/hooks",
|
|
65
|
-
"package.json",
|
|
66
|
-
"pnpm-workspace.yaml",
|
|
67
|
-
".ccjk"
|
|
68
|
-
];
|
|
69
|
-
for (const file of filesToBackup) {
|
|
70
|
-
const sourcePath = join(process.cwd(), file);
|
|
71
|
-
const destPath = join(backupDir, file);
|
|
72
|
-
try {
|
|
73
|
-
const stats = await promises.stat(sourcePath);
|
|
74
|
-
if (stats.isDirectory()) {
|
|
75
|
-
await copyDirectory(sourcePath, destPath);
|
|
76
|
-
} else {
|
|
77
|
-
await promises.mkdir(join(destPath, ".."), { recursive: true });
|
|
78
|
-
await promises.copyFile(sourcePath, destPath);
|
|
79
|
-
}
|
|
80
|
-
} catch (_error) {
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
const manifest = {
|
|
84
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
85
|
-
operation,
|
|
86
|
-
files: filesToBackup,
|
|
87
|
-
cwd: process.cwd(),
|
|
88
|
-
nodeVersion: process.version
|
|
89
|
-
};
|
|
90
|
-
await promises.writeFile(
|
|
91
|
-
join(backupDir, "backup-manifest.json"),
|
|
92
|
-
JSON.stringify(manifest, null, 2),
|
|
93
|
-
"utf-8"
|
|
94
|
-
);
|
|
95
|
-
consola.success(i18n.t("backup.created", { path: backupDir }));
|
|
96
|
-
return backupDir;
|
|
97
|
-
} catch (error) {
|
|
98
|
-
consola.error(i18n.t("backup.failed"), error);
|
|
99
|
-
throw error;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
async function copyDirectory(src, dest) {
|
|
103
|
-
await promises.mkdir(dest, { recursive: true });
|
|
104
|
-
const entries = await promises.readdir(src, { withFileTypes: true });
|
|
105
|
-
for (const entry of entries) {
|
|
106
|
-
const srcPath = join(src, entry.name);
|
|
107
|
-
const destPath = join(dest, entry.name);
|
|
108
|
-
if (entry.isDirectory()) {
|
|
109
|
-
await copyDirectory(srcPath, destPath);
|
|
110
|
-
} else {
|
|
111
|
-
await promises.copyFile(srcPath, destPath);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function generateReport(result) {
|
|
117
|
-
const report = {
|
|
118
|
-
date: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
|
119
|
-
profile: result.installationPlan?.profile || "unknown",
|
|
120
|
-
duration: result.duration,
|
|
121
|
-
projectAnalysis: result.projectAnalysis,
|
|
122
|
-
installationPlan: result.installationPlan,
|
|
123
|
-
phases: result.phases,
|
|
124
|
-
summary: {
|
|
125
|
-
total: result.totalInstalled + result.totalSkipped + result.totalFailed,
|
|
126
|
-
installed: result.totalInstalled,
|
|
127
|
-
skipped: result.totalSkipped,
|
|
128
|
-
failed: result.totalFailed
|
|
129
|
-
},
|
|
130
|
-
nextSteps: generateNextSteps(result)
|
|
131
|
-
};
|
|
132
|
-
return formatReport(report);
|
|
133
|
-
}
|
|
134
|
-
function formatReport(report) {
|
|
135
|
-
const lines = [];
|
|
136
|
-
lines.push("# CCJK Setup Report");
|
|
137
|
-
lines.push("");
|
|
138
|
-
lines.push(`**Date**: ${report.date}`);
|
|
139
|
-
lines.push(`**Profile**: ${report.profile}`);
|
|
140
|
-
lines.push(`**Duration**: ${(report.duration / 1e3).toFixed(1)}s`);
|
|
141
|
-
lines.push("");
|
|
142
|
-
if (report.projectAnalysis) {
|
|
143
|
-
lines.push("## Project Analysis");
|
|
144
|
-
lines.push("");
|
|
145
|
-
lines.push(`- **Type**: ${report.projectAnalysis.type || "Unknown"}`);
|
|
146
|
-
lines.push(`- **Complexity**: ${report.projectAnalysis.complexity || "Unknown"}`);
|
|
147
|
-
if (report.projectAnalysis.teamSize) {
|
|
148
|
-
lines.push(`- **Team Size**: ${report.projectAnalysis.teamSize}`);
|
|
149
|
-
}
|
|
150
|
-
if (report.projectAnalysis.languages?.length) {
|
|
151
|
-
lines.push(`- **Languages**: ${report.projectAnalysis.languages.join(", ")}`);
|
|
152
|
-
}
|
|
153
|
-
if (report.projectAnalysis.frameworks?.length) {
|
|
154
|
-
lines.push(`- **Frameworks**: ${report.projectAnalysis.frameworks.join(", ")}`);
|
|
155
|
-
}
|
|
156
|
-
lines.push("");
|
|
157
|
-
}
|
|
158
|
-
lines.push("## Installation Summary");
|
|
159
|
-
lines.push("");
|
|
160
|
-
lines.push(`\u2705 **Total Installed**: ${report.summary.installed}`);
|
|
161
|
-
if (report.summary.skipped > 0) {
|
|
162
|
-
lines.push(`\u26A0\uFE0F **Total Skipped**: ${report.summary.skipped}`);
|
|
163
|
-
}
|
|
164
|
-
if (report.summary.failed > 0) {
|
|
165
|
-
lines.push(`\u274C **Total Failed**: ${report.summary.failed}`);
|
|
166
|
-
}
|
|
167
|
-
lines.push("");
|
|
168
|
-
for (const phase of report.phases) {
|
|
169
|
-
if (phase.installed === 0 && phase.skipped === 0 && phase.failed === 0) {
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
lines.push(`### ${phase.phase.charAt(0).toUpperCase() + phase.phase.slice(1)} Phase`);
|
|
173
|
-
lines.push("");
|
|
174
|
-
lines.push(`- **Status**: ${phase.success ? "\u2705 Success" : "\u274C Failed"}`);
|
|
175
|
-
lines.push(`- **Installed**: ${phase.installed}`);
|
|
176
|
-
if (phase.skipped > 0) {
|
|
177
|
-
lines.push(`- **Skipped**: ${phase.skipped}`);
|
|
178
|
-
}
|
|
179
|
-
if (phase.failed > 0) {
|
|
180
|
-
lines.push(`- **Failed**: ${phase.failed}`);
|
|
181
|
-
}
|
|
182
|
-
lines.push(`- **Duration**: ${(phase.duration / 1e3).toFixed(1)}s`);
|
|
183
|
-
if (phase.details?.resources) {
|
|
184
|
-
lines.push("");
|
|
185
|
-
lines.push("**Installed Resources**:");
|
|
186
|
-
for (const resource of phase.details.resources) {
|
|
187
|
-
lines.push(` - ${resource.id || resource.name} (${resource.priority || "unknown"})`);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
lines.push("");
|
|
191
|
-
}
|
|
192
|
-
if (report.nextSteps.length > 0) {
|
|
193
|
-
lines.push("## Next Steps");
|
|
194
|
-
lines.push("");
|
|
195
|
-
for (let i = 0; i < report.nextSteps.length; i++) {
|
|
196
|
-
lines.push(`${i + 1}. ${report.nextSteps[i]}`);
|
|
197
|
-
}
|
|
198
|
-
lines.push("");
|
|
199
|
-
}
|
|
200
|
-
if (report.installationPlan) {
|
|
201
|
-
lines.push("## Configuration Details");
|
|
202
|
-
lines.push("");
|
|
203
|
-
lines.push("```json");
|
|
204
|
-
lines.push(JSON.stringify(report.installationPlan, null, 2));
|
|
205
|
-
lines.push("```");
|
|
206
|
-
lines.push("");
|
|
207
|
-
}
|
|
208
|
-
return lines.join("\n");
|
|
209
|
-
}
|
|
210
|
-
function generateNextSteps(result) {
|
|
211
|
-
const steps = [];
|
|
212
|
-
if (result.totalInstalled > 0) {
|
|
213
|
-
steps.push("Start coding: Your CCJK configuration is ready to use");
|
|
214
|
-
const agentsPhase = result.phases.find((p) => p.phase === "agents");
|
|
215
|
-
if (agentsPhase?.installed && agentsPhase.installed > 0) {
|
|
216
|
-
steps.push("Run an agent: ccjk agent run <agent-name>");
|
|
217
|
-
}
|
|
218
|
-
const skillsPhase = result.phases.find((p) => p.phase === "skills");
|
|
219
|
-
if (skillsPhase?.installed && skillsPhase.installed > 0) {
|
|
220
|
-
steps.push("View available skills: ccjk skills list");
|
|
221
|
-
}
|
|
222
|
-
const mcpPhase = result.phases.find((p) => p.phase === "mcp");
|
|
223
|
-
if (mcpPhase?.installed && mcpPhase.installed > 0) {
|
|
224
|
-
steps.push("Check MCP services: ccjk mcp list");
|
|
225
|
-
}
|
|
226
|
-
const hooksPhase = result.phases.find((p) => p.phase === "hooks");
|
|
227
|
-
if (hooksPhase?.installed && hooksPhase.installed > 0) {
|
|
228
|
-
steps.push("Verify hooks: ccjk hooks list");
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
if (result.totalFailed > 0) {
|
|
232
|
-
steps.push("Review failed installations and try again with --verbose for details");
|
|
233
|
-
}
|
|
234
|
-
steps.push("Customize your setup anytime with: ccjk setup --profile custom");
|
|
235
|
-
return steps;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
class SetupOrchestrator {
|
|
239
|
-
analyzer;
|
|
240
|
-
logger = consola;
|
|
241
|
-
startTime;
|
|
242
|
-
backupPath;
|
|
243
|
-
constructor(analyzer) {
|
|
244
|
-
this.analyzer = analyzer;
|
|
245
|
-
this.startTime = performance.now();
|
|
246
|
-
}
|
|
247
|
-
async execute(options) {
|
|
248
|
-
this.startTime = performance.now();
|
|
249
|
-
const result = {
|
|
250
|
-
success: false,
|
|
251
|
-
totalInstalled: 0,
|
|
252
|
-
totalSkipped: 0,
|
|
253
|
-
totalFailed: 0,
|
|
254
|
-
duration: 0,
|
|
255
|
-
phases: [],
|
|
256
|
-
errors: []
|
|
257
|
-
};
|
|
258
|
-
try {
|
|
259
|
-
if (options.showProgress) {
|
|
260
|
-
this.logger.info(i18n.t("setup.analyzingProject"));
|
|
261
|
-
}
|
|
262
|
-
const projectAnalysis = await this.analyzer.analyze(options.projectPath || process.cwd());
|
|
263
|
-
result.projectAnalysis = projectAnalysis;
|
|
264
|
-
const installationPlan = await this.generateInstallationPlan(projectAnalysis, options);
|
|
265
|
-
result.installationPlan = installationPlan;
|
|
266
|
-
if (options.backup && !options.dryRun) {
|
|
267
|
-
if (options.showProgress) {
|
|
268
|
-
this.logger.info(i18n.t("setup.creatingBackup"));
|
|
269
|
-
}
|
|
270
|
-
this.backupPath = await createBackup("ccjk-setup");
|
|
271
|
-
result.backupPath = this.backupPath;
|
|
272
|
-
}
|
|
273
|
-
if (options.interactive && !options.autoConfirm && !options.dryRun) {
|
|
274
|
-
const confirmed = await this.showPlanAndConfirm(installationPlan, options);
|
|
275
|
-
if (!confirmed) {
|
|
276
|
-
this.logger.info(i18n.t("setup.cancelled"));
|
|
277
|
-
return {
|
|
278
|
-
...result,
|
|
279
|
-
success: true,
|
|
280
|
-
duration: performance.now() - this.startTime
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
if (!options.dryRun) {
|
|
285
|
-
const phases = await this.executePhases(installationPlan, options);
|
|
286
|
-
result.phases = phases;
|
|
287
|
-
result.totalInstalled = phases.reduce((sum, p) => sum + p.installed, 0);
|
|
288
|
-
result.totalSkipped = phases.reduce((sum, p) => sum + p.skipped, 0);
|
|
289
|
-
result.totalFailed = phases.reduce((sum, p) => sum + p.failed, 0);
|
|
290
|
-
result.errors = phases.flatMap((p) => p.errors);
|
|
291
|
-
result.success = result.totalFailed === 0 || !options.rollbackOnError;
|
|
292
|
-
} else {
|
|
293
|
-
result.success = true;
|
|
294
|
-
}
|
|
295
|
-
if (options.report && !options.dryRun) {
|
|
296
|
-
const reportPath = await this.generateReport(result);
|
|
297
|
-
result.reportPath = reportPath;
|
|
298
|
-
}
|
|
299
|
-
result.duration = performance.now() - this.startTime;
|
|
300
|
-
if (!result.success && options.rollbackOnError) {
|
|
301
|
-
await this.rollback(result);
|
|
302
|
-
}
|
|
303
|
-
return result;
|
|
304
|
-
} catch (error) {
|
|
305
|
-
result.errors.push(error);
|
|
306
|
-
result.duration = performance.now() - this.startTime;
|
|
307
|
-
if (options.rollbackOnError) {
|
|
308
|
-
await this.rollback(result);
|
|
309
|
-
}
|
|
310
|
-
return result;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
async generateInstallationPlan(projectAnalysis, options) {
|
|
314
|
-
const { profile = "recommended", resources = ["skills", "mcp", "agents", "hooks"] } = options;
|
|
315
|
-
const plan = {
|
|
316
|
-
profile,
|
|
317
|
-
projectType: projectAnalysis.type,
|
|
318
|
-
complexity: projectAnalysis.complexity,
|
|
319
|
-
estimatedTime: 0,
|
|
320
|
-
phases: {
|
|
321
|
-
skills: {
|
|
322
|
-
enabled: resources.includes("skills"),
|
|
323
|
-
resources: []
|
|
324
|
-
},
|
|
325
|
-
mcp: {
|
|
326
|
-
enabled: resources.includes("mcp"),
|
|
327
|
-
resources: []
|
|
328
|
-
},
|
|
329
|
-
agents: {
|
|
330
|
-
enabled: resources.includes("agents"),
|
|
331
|
-
resources: []
|
|
332
|
-
},
|
|
333
|
-
hooks: {
|
|
334
|
-
enabled: resources.includes("hooks"),
|
|
335
|
-
resources: []
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
if (plan.phases.skills.enabled) {
|
|
340
|
-
plan.phases.skills.resources = await this.selectSkills(profile, projectAnalysis);
|
|
341
|
-
}
|
|
342
|
-
if (plan.phases.mcp.enabled) {
|
|
343
|
-
plan.phases.mcp.resources = await this.selectMcpServices(profile, projectAnalysis);
|
|
344
|
-
}
|
|
345
|
-
if (plan.phases.agents.enabled) {
|
|
346
|
-
plan.phases.agents.resources = await this.selectAgents(profile, projectAnalysis);
|
|
347
|
-
}
|
|
348
|
-
if (plan.phases.hooks.enabled) {
|
|
349
|
-
plan.phases.hooks.resources = await this.selectHooks(profile, projectAnalysis);
|
|
350
|
-
}
|
|
351
|
-
const totalResources = plan.phases.skills.resources.length + plan.phases.mcp.resources.length + plan.phases.agents.resources.length + plan.phases.hooks.resources.length;
|
|
352
|
-
plan.estimatedTime = Math.max(1, Math.ceil(totalResources / 4));
|
|
353
|
-
return plan;
|
|
354
|
-
}
|
|
355
|
-
async selectSkills(profile, projectAnalysis) {
|
|
356
|
-
const skills = [];
|
|
357
|
-
if (profile !== "minimal") {
|
|
358
|
-
skills.push({ id: "git-workflow", priority: "essential" });
|
|
359
|
-
}
|
|
360
|
-
if (projectAnalysis.languages?.includes("typescript")) {
|
|
361
|
-
skills.push({ id: "ts-best-practices", priority: "essential" });
|
|
362
|
-
if (profile === "full") {
|
|
363
|
-
skills.push({ id: "ts-advanced-patterns", priority: "high" });
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
if (projectAnalysis.languages?.includes("javascript")) {
|
|
367
|
-
skills.push({ id: "js-best-practices", priority: "essential" });
|
|
368
|
-
}
|
|
369
|
-
if (projectAnalysis.frameworks?.includes("react")) {
|
|
370
|
-
skills.push({ id: "react-patterns", priority: "high" });
|
|
371
|
-
if (profile === "full") {
|
|
372
|
-
skills.push({ id: "react-performance", priority: "medium" });
|
|
373
|
-
skills.push({ id: "react-testing", priority: "medium" });
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
if (projectAnalysis.frameworks?.includes("nextjs")) {
|
|
377
|
-
skills.push({ id: "nextjs-optimization", priority: "high" });
|
|
378
|
-
}
|
|
379
|
-
if (projectAnalysis.hasTesting) {
|
|
380
|
-
skills.push({ id: "testing-best-practices", priority: "recommended" });
|
|
381
|
-
if (profile === "full") {
|
|
382
|
-
skills.push({ id: "tdd-workflow", priority: "medium" });
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
if (profile === "full") {
|
|
386
|
-
skills.push({ id: "performance-optimization", priority: "medium" });
|
|
387
|
-
skills.push({ id: "security-best-practices", priority: "medium" });
|
|
388
|
-
skills.push({ id: "api-design", priority: "low" });
|
|
389
|
-
}
|
|
390
|
-
return skills;
|
|
391
|
-
}
|
|
392
|
-
async selectMcpServices(profile, projectAnalysis) {
|
|
393
|
-
const services = [];
|
|
394
|
-
if (projectAnalysis.languages?.includes("typescript") || projectAnalysis.languages?.includes("javascript")) {
|
|
395
|
-
services.push({ id: "typescript-language-server", priority: "essential" });
|
|
396
|
-
}
|
|
397
|
-
if (projectAnalysis.hasLinting) {
|
|
398
|
-
services.push({ id: "eslint-mcp", priority: "essential" });
|
|
399
|
-
}
|
|
400
|
-
services.push({ id: "git-mcp", priority: "essential" });
|
|
401
|
-
if (profile !== "minimal") {
|
|
402
|
-
if (projectAnalysis.hasTesting) {
|
|
403
|
-
services.push({ id: "test-mcp", priority: "recommended" });
|
|
404
|
-
}
|
|
405
|
-
if (projectAnalysis.packageManager === "npm" || projectAnalysis.packageManager === "pnpm") {
|
|
406
|
-
services.push({ id: "package-json-mcp", priority: "recommended" });
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
if (profile === "full") {
|
|
410
|
-
services.push({ id: "file-system-mcp", priority: "medium" });
|
|
411
|
-
services.push({ id: "search-mcp", priority: "medium" });
|
|
412
|
-
if (projectAnalysis.hasDocker) {
|
|
413
|
-
services.push({ id: "docker-mcp", priority: "low" });
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
return services;
|
|
417
|
-
}
|
|
418
|
-
async selectAgents(profile, projectAnalysis) {
|
|
419
|
-
const agents = [];
|
|
420
|
-
if (projectAnalysis.languages?.includes("typescript")) {
|
|
421
|
-
agents.push({ id: "typescript-architect", priority: "essential" });
|
|
422
|
-
}
|
|
423
|
-
if (projectAnalysis.frameworks?.includes("react")) {
|
|
424
|
-
agents.push({ id: "react-specialist", priority: "high" });
|
|
425
|
-
}
|
|
426
|
-
if (projectAnalysis.frameworks?.includes("nextjs")) {
|
|
427
|
-
agents.push({ id: "nextjs-specialist", priority: "high" });
|
|
428
|
-
}
|
|
429
|
-
if (projectAnalysis.hasTesting && profile !== "minimal") {
|
|
430
|
-
agents.push({ id: "testing-automation-expert", priority: "recommended" });
|
|
431
|
-
}
|
|
432
|
-
if (profile === "full") {
|
|
433
|
-
agents.push({ id: "code-reviewer", priority: "medium" });
|
|
434
|
-
agents.push({ id: "performance-optimizer", priority: "medium" });
|
|
435
|
-
agents.push({ id: "security-expert", priority: "low" });
|
|
436
|
-
}
|
|
437
|
-
return agents;
|
|
438
|
-
}
|
|
439
|
-
async selectHooks(profile, projectAnalysis) {
|
|
440
|
-
const hooks = [];
|
|
441
|
-
if (projectAnalysis.hasLinting) {
|
|
442
|
-
hooks.push({ id: "pre-commit-eslint", priority: "essential" });
|
|
443
|
-
}
|
|
444
|
-
if (projectAnalysis.hasFormatting) {
|
|
445
|
-
hooks.push({ id: "pre-commit-prettier", priority: "essential" });
|
|
446
|
-
}
|
|
447
|
-
hooks.push({ id: "git-workflow-hooks", priority: "essential" });
|
|
448
|
-
if (profile !== "minimal") {
|
|
449
|
-
if (projectAnalysis.hasTesting) {
|
|
450
|
-
hooks.push({ id: "pre-push-tests", priority: "recommended" });
|
|
451
|
-
hooks.push({ id: "post-test-coverage", priority: "recommended" });
|
|
452
|
-
}
|
|
453
|
-
hooks.push({ id: "commit-message-validator", priority: "recommended" });
|
|
454
|
-
}
|
|
455
|
-
if (profile === "full") {
|
|
456
|
-
hooks.push({ id: "dependency-check", priority: "medium" });
|
|
457
|
-
hooks.push({ id: "security-audit", priority: "low" });
|
|
458
|
-
}
|
|
459
|
-
return hooks;
|
|
460
|
-
}
|
|
461
|
-
async showPlanAndConfirm(_plan, _options) {
|
|
462
|
-
return true;
|
|
463
|
-
}
|
|
464
|
-
async executePhases(plan, options) {
|
|
465
|
-
const phases = [];
|
|
466
|
-
const { parallel = true } = options;
|
|
467
|
-
if (parallel) {
|
|
468
|
-
const [skillsResult, mcpResult] = await Promise.all([
|
|
469
|
-
this.executeSkillsPhase(plan.phases.skills, options),
|
|
470
|
-
this.executeMcpPhase(plan.phases.mcp, options)
|
|
471
|
-
]);
|
|
472
|
-
phases.push(skillsResult, mcpResult);
|
|
473
|
-
const [agentsResult, hooksResult] = await Promise.all([
|
|
474
|
-
this.executeAgentsPhase(plan.phases.agents, options),
|
|
475
|
-
this.executeHooksPhase(plan.phases.hooks, options)
|
|
476
|
-
]);
|
|
477
|
-
phases.push(agentsResult, hooksResult);
|
|
478
|
-
} else {
|
|
479
|
-
phases.push(await this.executeSkillsPhase(plan.phases.skills, options));
|
|
480
|
-
phases.push(await this.executeMcpPhase(plan.phases.mcp, options));
|
|
481
|
-
phases.push(await this.executeAgentsPhase(plan.phases.agents, options));
|
|
482
|
-
phases.push(await this.executeHooksPhase(plan.phases.hooks, options));
|
|
483
|
-
}
|
|
484
|
-
return phases;
|
|
485
|
-
}
|
|
486
|
-
async executeSkillsPhase(phaseConfig, options) {
|
|
487
|
-
const startTime = performance.now();
|
|
488
|
-
const result = {
|
|
489
|
-
phase: "skills",
|
|
490
|
-
success: true,
|
|
491
|
-
installed: 0,
|
|
492
|
-
skipped: 0,
|
|
493
|
-
failed: 0,
|
|
494
|
-
duration: 0,
|
|
495
|
-
errors: [],
|
|
496
|
-
details: {}
|
|
497
|
-
};
|
|
498
|
-
if (!phaseConfig.enabled || phaseConfig.resources.length === 0) {
|
|
499
|
-
result.duration = performance.now() - startTime;
|
|
500
|
-
return result;
|
|
501
|
-
}
|
|
502
|
-
try {
|
|
503
|
-
const skillIds = phaseConfig.resources.map((r) => r.id);
|
|
504
|
-
const skillsOptions = {
|
|
505
|
-
lang: options.lang || "en",
|
|
506
|
-
interactive: false,
|
|
507
|
-
dryRun: false,
|
|
508
|
-
force: false,
|
|
509
|
-
targetDir: options.projectPath || process.cwd()
|
|
510
|
-
};
|
|
511
|
-
await ccjkSkills(skillsOptions);
|
|
512
|
-
result.installed = skillIds.length;
|
|
513
|
-
result.skipped = 0;
|
|
514
|
-
result.failed = 0;
|
|
515
|
-
result.details = { skillIds };
|
|
516
|
-
if (result.failed > 0) {
|
|
517
|
-
result.success = false;
|
|
518
|
-
result.errors.push(new Error(`Failed to install ${result.failed} skills`));
|
|
519
|
-
}
|
|
520
|
-
} catch (error) {
|
|
521
|
-
result.success = false;
|
|
522
|
-
result.errors.push(error);
|
|
523
|
-
result.failed = phaseConfig.resources.length;
|
|
524
|
-
}
|
|
525
|
-
result.duration = performance.now() - startTime;
|
|
526
|
-
return result;
|
|
527
|
-
}
|
|
528
|
-
async executeMcpPhase(phaseConfig, options) {
|
|
529
|
-
const startTime = performance.now();
|
|
530
|
-
const result = {
|
|
531
|
-
phase: "mcp",
|
|
532
|
-
success: true,
|
|
533
|
-
installed: 0,
|
|
534
|
-
skipped: 0,
|
|
535
|
-
failed: 0,
|
|
536
|
-
duration: 0,
|
|
537
|
-
errors: [],
|
|
538
|
-
details: {}
|
|
539
|
-
};
|
|
540
|
-
if (!phaseConfig.enabled || phaseConfig.resources.length === 0) {
|
|
541
|
-
result.duration = performance.now() - startTime;
|
|
542
|
-
return result;
|
|
543
|
-
}
|
|
544
|
-
try {
|
|
545
|
-
const mcpIds = phaseConfig.resources.map((r) => r.id);
|
|
546
|
-
const mcpOptions = {
|
|
547
|
-
services: mcpIds,
|
|
548
|
-
interactive: false,
|
|
549
|
-
lang: options.lang || "en",
|
|
550
|
-
dryRun: false,
|
|
551
|
-
force: false
|
|
552
|
-
};
|
|
553
|
-
const mcpResult = await ccjkMcp(mcpOptions);
|
|
554
|
-
result.installed = mcpResult.installed.length;
|
|
555
|
-
result.skipped = mcpResult.skipped.length;
|
|
556
|
-
result.failed = mcpResult.failed.length;
|
|
557
|
-
result.details = mcpResult;
|
|
558
|
-
if (result.failed > 0) {
|
|
559
|
-
result.success = false;
|
|
560
|
-
result.errors.push(new Error(`Failed to install ${result.failed} MCP services`));
|
|
561
|
-
}
|
|
562
|
-
} catch (error) {
|
|
563
|
-
result.success = false;
|
|
564
|
-
result.errors.push(error);
|
|
565
|
-
result.failed = phaseConfig.resources.length;
|
|
566
|
-
}
|
|
567
|
-
result.duration = performance.now() - startTime;
|
|
568
|
-
return result;
|
|
569
|
-
}
|
|
570
|
-
async executeAgentsPhase(phaseConfig, options) {
|
|
571
|
-
const startTime = performance.now();
|
|
572
|
-
const result = {
|
|
573
|
-
phase: "agents",
|
|
574
|
-
success: true,
|
|
575
|
-
installed: 0,
|
|
576
|
-
skipped: 0,
|
|
577
|
-
failed: 0,
|
|
578
|
-
duration: 0,
|
|
579
|
-
errors: [],
|
|
580
|
-
details: {}
|
|
581
|
-
};
|
|
582
|
-
if (!phaseConfig.enabled || phaseConfig.resources.length === 0) {
|
|
583
|
-
result.duration = performance.now() - startTime;
|
|
584
|
-
return result;
|
|
585
|
-
}
|
|
586
|
-
try {
|
|
587
|
-
const agentIds = phaseConfig.resources.map((r) => r.id);
|
|
588
|
-
const agentsOptions = {
|
|
589
|
-
lang: options.lang || "en",
|
|
590
|
-
dryRun: false,
|
|
591
|
-
json: false
|
|
592
|
-
};
|
|
593
|
-
await ccjkAgents(agentsOptions);
|
|
594
|
-
result.installed = agentIds.length;
|
|
595
|
-
result.skipped = 0;
|
|
596
|
-
result.failed = 0;
|
|
597
|
-
result.details = { agentIds };
|
|
598
|
-
if (result.failed > 0) {
|
|
599
|
-
result.success = false;
|
|
600
|
-
result.errors.push(new Error(`Failed to create ${result.failed} agents`));
|
|
601
|
-
}
|
|
602
|
-
} catch (error) {
|
|
603
|
-
result.success = false;
|
|
604
|
-
result.errors.push(error);
|
|
605
|
-
result.failed = phaseConfig.resources.length;
|
|
606
|
-
}
|
|
607
|
-
result.duration = performance.now() - startTime;
|
|
608
|
-
return result;
|
|
609
|
-
}
|
|
610
|
-
async executeHooksPhase(phaseConfig, options) {
|
|
611
|
-
const startTime = performance.now();
|
|
612
|
-
const result = {
|
|
613
|
-
phase: "hooks",
|
|
614
|
-
success: true,
|
|
615
|
-
installed: 0,
|
|
616
|
-
skipped: 0,
|
|
617
|
-
failed: 0,
|
|
618
|
-
duration: 0,
|
|
619
|
-
errors: [],
|
|
620
|
-
details: {}
|
|
621
|
-
};
|
|
622
|
-
if (!phaseConfig.enabled || phaseConfig.resources.length === 0) {
|
|
623
|
-
result.duration = performance.now() - startTime;
|
|
624
|
-
return result;
|
|
625
|
-
}
|
|
626
|
-
try {
|
|
627
|
-
const hookIds = phaseConfig.resources.map((r) => r.id);
|
|
628
|
-
const hooksOptions = {
|
|
629
|
-
dryRun: false,
|
|
630
|
-
json: false,
|
|
631
|
-
verbose: options.verbose || false
|
|
632
|
-
};
|
|
633
|
-
const hooksResult = await ccjkHooks(hooksOptions);
|
|
634
|
-
if (hooksResult && "installed" in hooksResult && hooksResult.installed) {
|
|
635
|
-
result.installed = hooksResult.installed.length;
|
|
636
|
-
result.skipped = 0;
|
|
637
|
-
result.failed = hooksResult.errors?.length || 0;
|
|
638
|
-
result.details = hooksResult;
|
|
639
|
-
} else {
|
|
640
|
-
result.installed = hookIds.length;
|
|
641
|
-
result.skipped = 0;
|
|
642
|
-
result.failed = 0;
|
|
643
|
-
result.details = { hookIds };
|
|
644
|
-
}
|
|
645
|
-
if (result.failed > 0) {
|
|
646
|
-
result.success = false;
|
|
647
|
-
result.errors.push(new Error(`Failed to install ${result.failed} hooks`));
|
|
648
|
-
}
|
|
649
|
-
} catch (error) {
|
|
650
|
-
result.success = false;
|
|
651
|
-
result.errors.push(error);
|
|
652
|
-
result.failed = phaseConfig.resources.length;
|
|
653
|
-
}
|
|
654
|
-
result.duration = performance.now() - startTime;
|
|
655
|
-
return result;
|
|
656
|
-
}
|
|
657
|
-
async generateReport(result) {
|
|
658
|
-
const report = generateReport(result);
|
|
659
|
-
const reportPath = join(process.cwd(), `setup-report-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/:/g, "")}.md`);
|
|
660
|
-
await promises.writeFile(reportPath, report, "utf-8");
|
|
661
|
-
return reportPath;
|
|
662
|
-
}
|
|
663
|
-
async rollback(result) {
|
|
664
|
-
this.logger.warn(i18n.t("setup.rollbackStarting"));
|
|
665
|
-
try {
|
|
666
|
-
for (const phase of ["hooks", "agents", "mcp", "skills"]) {
|
|
667
|
-
const phaseResult = result.phases.find((p) => p.phase === phase);
|
|
668
|
-
if (phaseResult && phaseResult.installed > 0) {
|
|
669
|
-
this.logger.info(i18n.t("setup.rollbackPhase", { phase }));
|
|
670
|
-
await this.rollbackPhase(phase, phaseResult);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
if (this.backupPath) {
|
|
674
|
-
this.logger.info(i18n.t("setup.restoringBackup"));
|
|
675
|
-
}
|
|
676
|
-
this.logger.info(i18n.t("setup.rollbackComplete"));
|
|
677
|
-
} catch (error) {
|
|
678
|
-
this.logger.error(i18n.t("setup.rollbackFailed"), error);
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
async rollbackPhase(phase, _phaseResult) {
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
async function ccjkSetup(options = {}) {
|
|
686
|
-
const lang = resolveSupportedLanguage(options.lang);
|
|
687
|
-
if (lang !== i18n.language) {
|
|
688
|
-
await i18n.changeLanguage(lang);
|
|
689
|
-
}
|
|
690
|
-
const isZh = i18n.language === "zh-CN";
|
|
691
|
-
const logger = options.verbose ? consola : consola.create({ level: 1 });
|
|
692
|
-
const analyzer = new ProjectAnalyzer();
|
|
693
|
-
const orchestrator = new SetupOrchestrator(analyzer);
|
|
694
|
-
if (options.json) {
|
|
695
|
-
const result = await orchestrator.execute({
|
|
696
|
-
...options,
|
|
697
|
-
showProgress: false,
|
|
698
|
-
interactive: false,
|
|
699
|
-
lang
|
|
700
|
-
});
|
|
701
|
-
console.log(JSON.stringify(result, null, 2));
|
|
702
|
-
return result.success ? 0 : 1;
|
|
703
|
-
}
|
|
704
|
-
logger.log("");
|
|
705
|
-
logger.log(a.cyan(a.bold(`\u{1F680} ${isZh ? "CCJK \u5B8C\u6574\u672C\u5730\u8BBE\u7F6E" : "CCJK Complete Local Setup"}`)));
|
|
706
|
-
logger.log(a.gray(isZh ? "\u57FA\u4E8E\u9879\u76EE\u5206\u6790\u7684\u667A\u80FD\u914D\u7F6E" : "Project-based intelligent setup"));
|
|
707
|
-
logger.log("");
|
|
708
|
-
try {
|
|
709
|
-
const result = await orchestrator.execute({
|
|
710
|
-
...options,
|
|
711
|
-
lang
|
|
712
|
-
});
|
|
713
|
-
await showResults(result, options, logger);
|
|
714
|
-
return result.success ? 0 : 1;
|
|
715
|
-
} catch (error) {
|
|
716
|
-
logger.error(isZh ? "\u8BBE\u7F6E\u5931\u8D25" : "Setup failed");
|
|
717
|
-
if (options.verbose) {
|
|
718
|
-
logger.error(error);
|
|
719
|
-
}
|
|
720
|
-
return 1;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
async function showResults(result, options, logger) {
|
|
724
|
-
const isZh = i18n.language === "zh-CN";
|
|
725
|
-
logger.log("");
|
|
726
|
-
if (result.success) {
|
|
727
|
-
logger.log(a.green(a.bold(isZh ? "\u2705 \u8BBE\u7F6E\u5B8C\u6210\uFF01" : "\u2705 Setup Complete!")));
|
|
728
|
-
logger.log("");
|
|
729
|
-
const skillsPhase = result.phases.find((p) => p.phase === "skills");
|
|
730
|
-
const mcpPhase = result.phases.find((p) => p.phase === "mcp");
|
|
731
|
-
const agentsPhase = result.phases.find((p) => p.phase === "agents");
|
|
732
|
-
const hooksPhase = result.phases.find((p) => p.phase === "hooks");
|
|
733
|
-
const summary = [
|
|
734
|
-
`${isZh ? "\u6280\u80FD" : "Skills"}: ${skillsPhase?.installed || 0} ${isZh ? "\u5DF2\u5B89\u88C5" : "installed"}`,
|
|
735
|
-
`${isZh ? "MCP" : "MCP"}: ${mcpPhase?.installed || 0} ${isZh ? "\u5DF2\u5B89\u88C5" : "installed"}`,
|
|
736
|
-
`${isZh ? "\u4EE3\u7406" : "Agents"}: ${agentsPhase?.installed || 0} ${isZh ? "\u5DF2\u521B\u5EFA" : "created"}`,
|
|
737
|
-
`${isZh ? "\u94A9\u5B50" : "Hooks"}: ${hooksPhase?.installed || 0} ${isZh ? "\u5DF2\u914D\u7F6E" : "configured"}`
|
|
738
|
-
];
|
|
739
|
-
logger.log(a.bold(isZh ? "\u6458\u8981:" : "Summary:"));
|
|
740
|
-
summary.forEach((line) => logger.log(` ${line}`));
|
|
741
|
-
logger.log("");
|
|
742
|
-
logger.log(a.bold(isZh ? "\u4E0B\u4E00\u6B65:" : "Next steps:"));
|
|
743
|
-
logger.log(` \u2022 ${isZh ? "\u4F7F\u7528 /ccjk:all \u83B7\u53D6\u4E91AI\u63A8\u8350" : "Use /ccjk:all for cloud AI recommendations"}`);
|
|
744
|
-
logger.log(` \u2022 ${isZh ? "\u91CD\u542F Claude Code \u4EE5\u5E94\u7528\u66F4\u6539" : "Restart Claude Code to apply changes"}`);
|
|
745
|
-
logger.log("");
|
|
746
|
-
} else {
|
|
747
|
-
logger.log(a.yellow(a.bold(isZh ? "\u26A0\uFE0F \u8BBE\u7F6E\u90E8\u5206\u5931\u8D25" : "\u26A0\uFE0F Setup Partially Failed")));
|
|
748
|
-
logger.log("");
|
|
749
|
-
if (result.errors && result.errors.length > 0) {
|
|
750
|
-
logger.log(a.bold(isZh ? "\u9519\u8BEF:" : "Errors:"));
|
|
751
|
-
result.errors.forEach((err) => logger.log(` \u2022 ${err}`));
|
|
752
|
-
logger.log("");
|
|
753
|
-
}
|
|
754
|
-
if (options.rollbackOnError) {
|
|
755
|
-
logger.log(isZh ? "\u{1F4A1} \u63D0\u793A: \u4F7F\u7528 --no-rollback \u4FDD\u7559\u5DF2\u5B89\u88C5\u7684\u8D44\u6E90" : "\u{1F4A1} Tip: Use --no-rollback to keep installed resources");
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
if (options.report && result.reportPath) {
|
|
759
|
-
logger.log(a.bold(isZh ? "\u{1F4CA} \u8BE6\u7EC6\u62A5\u544A:" : "\u{1F4CA} Detailed Report:"));
|
|
760
|
-
logger.log("");
|
|
761
|
-
logger.log(a.gray(`Report saved to: ${result.reportPath}`));
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
export { ccjkSetup };
|