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
package/dist/chunks/sessions.mjs
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import a from './index5.mjs';
|
|
2
|
-
import { t as taskPersistence } from '../shared/ccjk.CNhnT6uQ.mjs';
|
|
3
|
-
import '../shared/ccjk.BAGoDD49.mjs';
|
|
4
|
-
import 'node:fs';
|
|
5
|
-
import 'better-sqlite3';
|
|
6
|
-
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
7
|
-
|
|
8
|
-
async function sessionsCommand(options = {}) {
|
|
9
|
-
if (options.list) {
|
|
10
|
-
const sessions = taskPersistence.listSessions(20);
|
|
11
|
-
if (sessions.length === 0) {
|
|
12
|
-
console.log(a.yellow("\n\u26A0\uFE0F No sessions found\n"));
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
console.log(a.cyan.bold("\n\u{1F4CB} Brain Sessions\n"));
|
|
16
|
-
for (const session of sessions) {
|
|
17
|
-
const date = new Date(session.createdAt).toLocaleString();
|
|
18
|
-
console.log(a.white(` ${session.id}`));
|
|
19
|
-
console.log(a.gray(` Created: ${date}`));
|
|
20
|
-
if (session.metadata.rootTask) {
|
|
21
|
-
console.log(a.gray(` Task: ${session.metadata.rootTask}`));
|
|
22
|
-
}
|
|
23
|
-
console.log();
|
|
24
|
-
}
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (options.show) {
|
|
28
|
-
const context = taskPersistence.restoreContext(options.show);
|
|
29
|
-
if (!context) {
|
|
30
|
-
console.log(a.red(`
|
|
31
|
-
\u274C Session not found: ${options.show}
|
|
32
|
-
`));
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
console.log(a.cyan.bold(`
|
|
36
|
-
\u{1F4CA} Session: ${context.sessionId}
|
|
37
|
-
`));
|
|
38
|
-
console.log(a.white(`Tasks: ${context.tasks.length}`));
|
|
39
|
-
console.log();
|
|
40
|
-
for (const task of context.tasks) {
|
|
41
|
-
const statusIcon = {
|
|
42
|
-
pending: "\u23F3",
|
|
43
|
-
running: "\u{1F504}",
|
|
44
|
-
completed: "\u2705",
|
|
45
|
-
failed: "\u274C"
|
|
46
|
-
}[task.status];
|
|
47
|
-
console.log(` ${statusIcon} ${task.name}`);
|
|
48
|
-
console.log(a.gray(` Status: ${task.status}`));
|
|
49
|
-
console.log(a.gray(` Priority: ${task.priority}`));
|
|
50
|
-
if (task.dependencies.length > 0) {
|
|
51
|
-
console.log(a.gray(` Depends on: ${task.dependencies.join(", ")}`));
|
|
52
|
-
}
|
|
53
|
-
if (task.error) {
|
|
54
|
-
const error = JSON.parse(task.error);
|
|
55
|
-
console.log(a.red(` Error: ${error.message}`));
|
|
56
|
-
}
|
|
57
|
-
console.log();
|
|
58
|
-
}
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (options.restore) {
|
|
62
|
-
const context = taskPersistence.restoreContext(options.restore);
|
|
63
|
-
if (!context) {
|
|
64
|
-
console.log(a.red(`
|
|
65
|
-
\u274C Session not found: ${options.restore}
|
|
66
|
-
`));
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
console.log(a.cyan.bold(`
|
|
70
|
-
\u{1F504} Restoring session: ${context.sessionId}
|
|
71
|
-
`));
|
|
72
|
-
const incompleteTasks = context.tasks.filter(
|
|
73
|
-
(t) => t.status === "pending" || t.status === "running"
|
|
74
|
-
);
|
|
75
|
-
if (incompleteTasks.length === 0) {
|
|
76
|
-
console.log(a.green("\u2705 All tasks completed, nothing to restore\n"));
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
console.log(a.yellow(`Found ${incompleteTasks.length} incomplete tasks:
|
|
80
|
-
`));
|
|
81
|
-
for (const task of incompleteTasks) {
|
|
82
|
-
console.log(` \u23F3 ${task.name}`);
|
|
83
|
-
}
|
|
84
|
-
console.log();
|
|
85
|
-
console.log(a.gray("\u{1F4A1} To resume execution, use:"));
|
|
86
|
-
console.log(a.cyan(` ccjk brain execute --session ${context.sessionId}`));
|
|
87
|
-
console.log();
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
if (options.cleanup) {
|
|
91
|
-
const deleted = taskPersistence.cleanup(7);
|
|
92
|
-
console.log(a.green(`
|
|
93
|
-
\u2705 Cleaned up ${deleted} old records (kept last 7 days)
|
|
94
|
-
`));
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
console.log(a.cyan.bold("\n\u{1F4CB} Brain Sessions Management\n"));
|
|
98
|
-
console.log(a.white("Usage:"));
|
|
99
|
-
console.log(a.gray(" ccjk sessions --list # List all sessions"));
|
|
100
|
-
console.log(a.gray(" ccjk sessions --show <id> # Show session details"));
|
|
101
|
-
console.log(a.gray(" ccjk sessions --restore <id> # Restore incomplete session"));
|
|
102
|
-
console.log(a.gray(" ccjk sessions --cleanup # Clean up old sessions"));
|
|
103
|
-
console.log();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export { sessionsCommand };
|
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync, appendFileSync, unlinkSync, mkdirSync } from 'node:fs';
|
|
2
|
-
import { platform } from 'node:os';
|
|
3
|
-
import process__default from 'node:process';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { CCJK_CONFIG_DIR } from './constants.mjs';
|
|
6
|
-
import { getCloudState, updateCloudState } from './auto-bootstrap.mjs';
|
|
7
|
-
import { j as join, d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
8
|
-
import './index2.mjs';
|
|
9
|
-
import 'node:crypto';
|
|
10
|
-
|
|
11
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
-
const __dirname = dirname(__filename);
|
|
13
|
-
const UPGRADE_LOG_DIR = join(CCJK_CONFIG_DIR, "cloud", "logs");
|
|
14
|
-
const UPGRADE_LOG_FILE = join(UPGRADE_LOG_DIR, "upgrades.log");
|
|
15
|
-
const UPGRADE_LOCK_FILE = join(CCJK_CONFIG_DIR, "cloud", ".upgrade.lock");
|
|
16
|
-
const UPGRADE_CHECK_INTERVAL = 6 * 60 * 60 * 1e3;
|
|
17
|
-
const UPGRADE_TIMEOUT = 5 * 60 * 1e3;
|
|
18
|
-
async function checkAllToolVersions() {
|
|
19
|
-
const results = [];
|
|
20
|
-
const [ccjk, claudeCode, ccr] = await Promise.all([
|
|
21
|
-
checkCcjkVersion(),
|
|
22
|
-
checkClaudeCodeVersion(),
|
|
23
|
-
checkCcrVersion()
|
|
24
|
-
]);
|
|
25
|
-
results.push(ccjk, claudeCode, ccr);
|
|
26
|
-
return results;
|
|
27
|
-
}
|
|
28
|
-
async function checkCcjkVersion() {
|
|
29
|
-
try {
|
|
30
|
-
const currentVersion = getCurrentCcjkVersion();
|
|
31
|
-
const latestVersion = await fetchLatestNpmVersion("ccjk");
|
|
32
|
-
return {
|
|
33
|
-
tool: "ccjk",
|
|
34
|
-
installed: true,
|
|
35
|
-
currentVersion,
|
|
36
|
-
latestVersion,
|
|
37
|
-
needsUpdate: latestVersion ? isNewerVersion(latestVersion, currentVersion) : false,
|
|
38
|
-
installMethod: "npm"
|
|
39
|
-
};
|
|
40
|
-
} catch {
|
|
41
|
-
return {
|
|
42
|
-
tool: "ccjk",
|
|
43
|
-
installed: true,
|
|
44
|
-
currentVersion: getCurrentCcjkVersion(),
|
|
45
|
-
latestVersion: null,
|
|
46
|
-
needsUpdate: false,
|
|
47
|
-
installMethod: "npm"
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
async function checkClaudeCodeVersion() {
|
|
52
|
-
try {
|
|
53
|
-
const { exec } = await import('./main.mjs');
|
|
54
|
-
const result = await exec("claude", ["--version"], { timeout: 5e3 });
|
|
55
|
-
if (result.exitCode !== 0) {
|
|
56
|
-
return {
|
|
57
|
-
tool: "claude-code",
|
|
58
|
-
installed: false,
|
|
59
|
-
currentVersion: null,
|
|
60
|
-
latestVersion: null,
|
|
61
|
-
needsUpdate: false,
|
|
62
|
-
installMethod: "unknown"
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
const currentVersion = result.stdout.trim().replace(/^v/, "");
|
|
66
|
-
const latestVersion = await fetchLatestNpmVersion("@anthropic-ai/claude-code");
|
|
67
|
-
const installMethod = await detectClaudeCodeInstallMethod();
|
|
68
|
-
return {
|
|
69
|
-
tool: "claude-code",
|
|
70
|
-
installed: true,
|
|
71
|
-
currentVersion,
|
|
72
|
-
latestVersion,
|
|
73
|
-
needsUpdate: latestVersion ? isNewerVersion(latestVersion, currentVersion) : false,
|
|
74
|
-
installMethod
|
|
75
|
-
};
|
|
76
|
-
} catch {
|
|
77
|
-
return {
|
|
78
|
-
tool: "claude-code",
|
|
79
|
-
installed: false,
|
|
80
|
-
currentVersion: null,
|
|
81
|
-
latestVersion: null,
|
|
82
|
-
needsUpdate: false,
|
|
83
|
-
installMethod: "unknown"
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
async function checkCcrVersion() {
|
|
88
|
-
try {
|
|
89
|
-
const { exec } = await import('./main.mjs');
|
|
90
|
-
const result = await exec("ccr", ["--version"], { timeout: 5e3 });
|
|
91
|
-
if (result.exitCode !== 0) {
|
|
92
|
-
return {
|
|
93
|
-
tool: "ccr",
|
|
94
|
-
installed: false,
|
|
95
|
-
currentVersion: null,
|
|
96
|
-
latestVersion: null,
|
|
97
|
-
needsUpdate: false,
|
|
98
|
-
installMethod: "unknown"
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
const currentVersion = result.stdout.trim().replace(/^v/, "");
|
|
102
|
-
const latestVersion = await fetchLatestNpmVersion("@musistudio/claude-code-router");
|
|
103
|
-
return {
|
|
104
|
-
tool: "ccr",
|
|
105
|
-
installed: true,
|
|
106
|
-
currentVersion,
|
|
107
|
-
latestVersion,
|
|
108
|
-
needsUpdate: latestVersion ? isNewerVersion(latestVersion, currentVersion) : false,
|
|
109
|
-
installMethod: "npm"
|
|
110
|
-
};
|
|
111
|
-
} catch {
|
|
112
|
-
return {
|
|
113
|
-
tool: "ccr",
|
|
114
|
-
installed: false,
|
|
115
|
-
currentVersion: null,
|
|
116
|
-
latestVersion: null,
|
|
117
|
-
needsUpdate: false,
|
|
118
|
-
installMethod: "unknown"
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function getCurrentCcjkVersion() {
|
|
123
|
-
try {
|
|
124
|
-
const packagePath = join(__dirname, "../../../package.json");
|
|
125
|
-
if (existsSync(packagePath)) {
|
|
126
|
-
const pkg = JSON.parse(readFileSync(packagePath, "utf-8"));
|
|
127
|
-
return pkg.version || "unknown";
|
|
128
|
-
}
|
|
129
|
-
} catch {
|
|
130
|
-
}
|
|
131
|
-
return "unknown";
|
|
132
|
-
}
|
|
133
|
-
async function fetchLatestNpmVersion(packageName) {
|
|
134
|
-
const controller = new AbortController();
|
|
135
|
-
const timeoutId = setTimeout(() => controller.abort(), 1e4);
|
|
136
|
-
try {
|
|
137
|
-
const response = await fetch(`https://registry.npmjs.org/${packageName}/latest`, {
|
|
138
|
-
signal: controller.signal
|
|
139
|
-
});
|
|
140
|
-
if (response.ok) {
|
|
141
|
-
const data = await response.json();
|
|
142
|
-
return data.version;
|
|
143
|
-
}
|
|
144
|
-
} catch {
|
|
145
|
-
} finally {
|
|
146
|
-
clearTimeout(timeoutId);
|
|
147
|
-
}
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
async function detectClaudeCodeInstallMethod() {
|
|
151
|
-
try {
|
|
152
|
-
const { exec } = await import('./main.mjs');
|
|
153
|
-
if (platform() === "darwin") {
|
|
154
|
-
const brewResult = await exec("brew", ["list", "--cask", "claude-code"], { timeout: 5e3 });
|
|
155
|
-
if (brewResult.exitCode === 0) {
|
|
156
|
-
return "homebrew";
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
const npmResult = await exec("npm", ["list", "-g", "@anthropic-ai/claude-code"], { timeout: 5e3 });
|
|
160
|
-
if (npmResult.exitCode === 0 && npmResult.stdout.includes("@anthropic-ai/claude-code")) {
|
|
161
|
-
return "npm";
|
|
162
|
-
}
|
|
163
|
-
return "curl";
|
|
164
|
-
} catch {
|
|
165
|
-
return "unknown";
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
function isNewerVersion(latest, current) {
|
|
169
|
-
if (!latest || !current || current === "unknown")
|
|
170
|
-
return false;
|
|
171
|
-
const latestParts = latest.split(".").map(Number);
|
|
172
|
-
const currentParts = current.split(".").map(Number);
|
|
173
|
-
for (let i = 0; i < 3; i++) {
|
|
174
|
-
const l = latestParts[i] || 0;
|
|
175
|
-
const c = currentParts[i] || 0;
|
|
176
|
-
if (l > c)
|
|
177
|
-
return true;
|
|
178
|
-
if (l < c)
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
return false;
|
|
182
|
-
}
|
|
183
|
-
async function performSilentUpgradeAll() {
|
|
184
|
-
const startTime = Date.now();
|
|
185
|
-
const results = [];
|
|
186
|
-
if (isUpgradeLocked()) {
|
|
187
|
-
return {
|
|
188
|
-
success: false,
|
|
189
|
-
results: [],
|
|
190
|
-
totalDuration: 0,
|
|
191
|
-
upgradedCount: 0,
|
|
192
|
-
failedCount: 0
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
try {
|
|
196
|
-
createUpgradeLock();
|
|
197
|
-
const versions = await checkAllToolVersions();
|
|
198
|
-
const toolsToUpgrade = versions.filter((v) => v.needsUpdate && v.installed);
|
|
199
|
-
for (const tool of toolsToUpgrade) {
|
|
200
|
-
const result = await upgradeTool(tool);
|
|
201
|
-
results.push(result);
|
|
202
|
-
logUpgrade({
|
|
203
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
204
|
-
tool: tool.tool,
|
|
205
|
-
fromVersion: tool.currentVersion || "unknown",
|
|
206
|
-
toVersion: tool.latestVersion || "unknown",
|
|
207
|
-
success: result.success,
|
|
208
|
-
error: result.error,
|
|
209
|
-
duration: result.duration
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
const totalDuration = Date.now() - startTime;
|
|
213
|
-
const upgradedCount = results.filter((r) => r.upgraded).length;
|
|
214
|
-
const failedCount = results.filter((r) => !r.success).length;
|
|
215
|
-
const state = getCloudState();
|
|
216
|
-
updateCloudState({
|
|
217
|
-
lastUpgradeCheckAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
218
|
-
upgradeStats: {
|
|
219
|
-
totalChecks: state.upgradeStats.totalChecks + 1,
|
|
220
|
-
upgradesApplied: state.upgradeStats.upgradesApplied + upgradedCount,
|
|
221
|
-
upgradesFailed: state.upgradeStats.upgradesFailed + failedCount
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
return {
|
|
225
|
-
success: failedCount === 0,
|
|
226
|
-
results,
|
|
227
|
-
totalDuration,
|
|
228
|
-
upgradedCount,
|
|
229
|
-
failedCount
|
|
230
|
-
};
|
|
231
|
-
} finally {
|
|
232
|
-
releaseUpgradeLock();
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
async function upgradeTool(info) {
|
|
236
|
-
const startTime = Date.now();
|
|
237
|
-
try {
|
|
238
|
-
switch (info.tool) {
|
|
239
|
-
case "ccjk":
|
|
240
|
-
return await upgradeCcjk(info, startTime);
|
|
241
|
-
case "claude-code":
|
|
242
|
-
return await upgradeClaudeCode(info, startTime);
|
|
243
|
-
case "ccr":
|
|
244
|
-
return await upgradeCcr(info, startTime);
|
|
245
|
-
default:
|
|
246
|
-
return {
|
|
247
|
-
tool: info.tool,
|
|
248
|
-
success: false,
|
|
249
|
-
upgraded: false,
|
|
250
|
-
error: "Unknown tool",
|
|
251
|
-
duration: Date.now() - startTime
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
} catch (error) {
|
|
255
|
-
return {
|
|
256
|
-
tool: info.tool,
|
|
257
|
-
success: false,
|
|
258
|
-
upgraded: false,
|
|
259
|
-
error: error instanceof Error ? error.message : "Unknown error",
|
|
260
|
-
duration: Date.now() - startTime
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
async function upgradeCcjk(info, startTime) {
|
|
265
|
-
const { exec } = await import('./main.mjs');
|
|
266
|
-
const result = await exec("npm", ["update", "-g", "ccjk"], {
|
|
267
|
-
timeout: UPGRADE_TIMEOUT
|
|
268
|
-
});
|
|
269
|
-
return {
|
|
270
|
-
tool: "ccjk",
|
|
271
|
-
success: result.exitCode === 0,
|
|
272
|
-
upgraded: result.exitCode === 0,
|
|
273
|
-
fromVersion: info.currentVersion || void 0,
|
|
274
|
-
toVersion: info.latestVersion || void 0,
|
|
275
|
-
error: result.exitCode !== 0 ? result.stderr : void 0,
|
|
276
|
-
duration: Date.now() - startTime
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
async function upgradeClaudeCode(info, startTime) {
|
|
280
|
-
const { exec } = await import('./main.mjs');
|
|
281
|
-
let result;
|
|
282
|
-
switch (info.installMethod) {
|
|
283
|
-
case "homebrew":
|
|
284
|
-
result = await exec("brew", ["upgrade", "--cask", "claude-code"], {
|
|
285
|
-
timeout: UPGRADE_TIMEOUT
|
|
286
|
-
});
|
|
287
|
-
break;
|
|
288
|
-
case "npm":
|
|
289
|
-
result = await exec("npm", ["update", "-g", "@anthropic-ai/claude-code"], {
|
|
290
|
-
timeout: UPGRADE_TIMEOUT
|
|
291
|
-
});
|
|
292
|
-
break;
|
|
293
|
-
case "curl":
|
|
294
|
-
default:
|
|
295
|
-
result = await exec("claude", ["update"], {
|
|
296
|
-
timeout: UPGRADE_TIMEOUT
|
|
297
|
-
});
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
return {
|
|
301
|
-
tool: "claude-code",
|
|
302
|
-
success: result.exitCode === 0,
|
|
303
|
-
upgraded: result.exitCode === 0,
|
|
304
|
-
fromVersion: info.currentVersion || void 0,
|
|
305
|
-
toVersion: info.latestVersion || void 0,
|
|
306
|
-
error: result.exitCode !== 0 ? result.stderr : void 0,
|
|
307
|
-
duration: Date.now() - startTime
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
async function upgradeCcr(info, startTime) {
|
|
311
|
-
const { exec } = await import('./main.mjs');
|
|
312
|
-
const result = await exec("npm", ["update", "-g", "@musistudio/claude-code-router"], {
|
|
313
|
-
timeout: UPGRADE_TIMEOUT
|
|
314
|
-
});
|
|
315
|
-
return {
|
|
316
|
-
tool: "ccr",
|
|
317
|
-
success: result.exitCode === 0,
|
|
318
|
-
upgraded: result.exitCode === 0,
|
|
319
|
-
fromVersion: info.currentVersion || void 0,
|
|
320
|
-
toVersion: info.latestVersion || void 0,
|
|
321
|
-
error: result.exitCode !== 0 ? result.stderr : void 0,
|
|
322
|
-
duration: Date.now() - startTime
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
function isUpgradeLocked() {
|
|
326
|
-
if (!existsSync(UPGRADE_LOCK_FILE)) {
|
|
327
|
-
return false;
|
|
328
|
-
}
|
|
329
|
-
try {
|
|
330
|
-
const lockData = JSON.parse(readFileSync(UPGRADE_LOCK_FILE, "utf-8"));
|
|
331
|
-
const lockTime = new Date(lockData.timestamp).getTime();
|
|
332
|
-
const now = Date.now();
|
|
333
|
-
if (now - lockTime > 10 * 60 * 1e3) {
|
|
334
|
-
releaseUpgradeLock();
|
|
335
|
-
return false;
|
|
336
|
-
}
|
|
337
|
-
return true;
|
|
338
|
-
} catch {
|
|
339
|
-
return false;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
function createUpgradeLock() {
|
|
343
|
-
ensureLogDir();
|
|
344
|
-
writeFileSync(UPGRADE_LOCK_FILE, JSON.stringify({
|
|
345
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
346
|
-
pid: process__default.pid
|
|
347
|
-
}));
|
|
348
|
-
}
|
|
349
|
-
function releaseUpgradeLock() {
|
|
350
|
-
try {
|
|
351
|
-
if (existsSync(UPGRADE_LOCK_FILE)) {
|
|
352
|
-
unlinkSync(UPGRADE_LOCK_FILE);
|
|
353
|
-
}
|
|
354
|
-
} catch {
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function ensureLogDir() {
|
|
358
|
-
if (!existsSync(UPGRADE_LOG_DIR)) {
|
|
359
|
-
mkdirSync(UPGRADE_LOG_DIR, { recursive: true });
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
function logUpgrade(entry) {
|
|
363
|
-
ensureLogDir();
|
|
364
|
-
const logLine = [
|
|
365
|
-
entry.timestamp,
|
|
366
|
-
entry.tool,
|
|
367
|
-
entry.fromVersion,
|
|
368
|
-
"->",
|
|
369
|
-
entry.toVersion,
|
|
370
|
-
entry.success ? "SUCCESS" : "FAILED",
|
|
371
|
-
entry.error || "",
|
|
372
|
-
`${entry.duration}ms`
|
|
373
|
-
].join(" | ");
|
|
374
|
-
appendFileSync(UPGRADE_LOG_FILE, `${logLine}
|
|
375
|
-
`);
|
|
376
|
-
}
|
|
377
|
-
function shouldCheckForUpgrades() {
|
|
378
|
-
const state = getCloudState();
|
|
379
|
-
if (!state.silentUpgradeEnabled) {
|
|
380
|
-
return false;
|
|
381
|
-
}
|
|
382
|
-
if (!state.lastUpgradeCheckAt) {
|
|
383
|
-
return true;
|
|
384
|
-
}
|
|
385
|
-
const lastCheck = new Date(state.lastUpgradeCheckAt).getTime();
|
|
386
|
-
const now = Date.now();
|
|
387
|
-
return now - lastCheck >= UPGRADE_CHECK_INTERVAL;
|
|
388
|
-
}
|
|
389
|
-
async function checkAndUpgradeIfNeeded() {
|
|
390
|
-
if (!shouldCheckForUpgrades()) {
|
|
391
|
-
return null;
|
|
392
|
-
}
|
|
393
|
-
return performSilentUpgradeAll();
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
export { UPGRADE_CHECK_INTERVAL, UPGRADE_LOCK_FILE, UPGRADE_LOG_DIR, UPGRADE_LOG_FILE, UPGRADE_TIMEOUT, checkAndUpgradeIfNeeded as autoUpgrade, checkAllToolVersions, checkAndUpgradeIfNeeded, checkAllToolVersions as checkVersions, performSilentUpgradeAll, shouldCheckForUpgrades, performSilentUpgradeAll as upgradeAll };
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
-
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import { exec as q } from './main.mjs';
|
|
4
|
-
import { r as resolveClaudeFamilySettingsTarget, n as normalizeClaudeFamilySettings } from '../shared/ccjk.DDL-4C-k.mjs';
|
|
5
|
-
import { ensureDir, writeFileAtomic } from './fs-operations.mjs';
|
|
6
|
-
import { m as mergeAndCleanPermissions } from './config.mjs';
|
|
7
|
-
import { a as getPlatform } from './platform.mjs';
|
|
8
|
-
import { j as join, d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
9
|
-
import 'module';
|
|
10
|
-
import 'node:child_process';
|
|
11
|
-
import 'node:path';
|
|
12
|
-
import 'node:process';
|
|
13
|
-
import 'node:stream';
|
|
14
|
-
import 'node:readline';
|
|
15
|
-
import './constants.mjs';
|
|
16
|
-
import 'node:os';
|
|
17
|
-
import './index2.mjs';
|
|
18
|
-
import './ccjk-config.mjs';
|
|
19
|
-
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
20
|
-
import './index3.mjs';
|
|
21
|
-
import './json-config.mjs';
|
|
22
|
-
import '../shared/ccjk.RyizuzOI.mjs';
|
|
23
|
-
import '../shared/ccjk.BAGoDD49.mjs';
|
|
24
|
-
import 'node:crypto';
|
|
25
|
-
import 'node:fs/promises';
|
|
26
|
-
import './index5.mjs';
|
|
27
|
-
import './index6.mjs';
|
|
28
|
-
import 'stream';
|
|
29
|
-
import 'node:tty';
|
|
30
|
-
import 'node:async_hooks';
|
|
31
|
-
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
32
|
-
import 'node:util';
|
|
33
|
-
import 'tty';
|
|
34
|
-
import 'fs';
|
|
35
|
-
import 'child_process';
|
|
36
|
-
import 'buffer';
|
|
37
|
-
import 'string_decoder';
|
|
38
|
-
import './claude-config.mjs';
|
|
39
|
-
|
|
40
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
41
|
-
function getTemplateSettings() {
|
|
42
|
-
const templatePath = join(__dirname, "../../templates/claude-code/common/settings.json");
|
|
43
|
-
const content = readFileSync(templatePath, "utf-8");
|
|
44
|
-
return JSON.parse(content);
|
|
45
|
-
}
|
|
46
|
-
function loadCurrentSettings(target = resolveClaudeFamilySettingsTarget()) {
|
|
47
|
-
if (!existsSync(target.settingsFile)) {
|
|
48
|
-
return {};
|
|
49
|
-
}
|
|
50
|
-
try {
|
|
51
|
-
const content = readFileSync(target.settingsFile, "utf-8");
|
|
52
|
-
return JSON.parse(content);
|
|
53
|
-
} catch {
|
|
54
|
-
return {};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function saveSettings(settings, target = resolveClaudeFamilySettingsTarget()) {
|
|
58
|
-
ensureDir(target.configDir);
|
|
59
|
-
normalizeClaudeFamilySettings(settings);
|
|
60
|
-
writeFileAtomic(target.settingsFile, JSON.stringify(settings, null, 2));
|
|
61
|
-
}
|
|
62
|
-
async function importRecommendedEnv() {
|
|
63
|
-
const target = resolveClaudeFamilySettingsTarget();
|
|
64
|
-
const templateSettings = getTemplateSettings();
|
|
65
|
-
const currentSettings = loadCurrentSettings(target);
|
|
66
|
-
currentSettings.env = {
|
|
67
|
-
...currentSettings.env,
|
|
68
|
-
...templateSettings.env
|
|
69
|
-
};
|
|
70
|
-
saveSettings(currentSettings, target);
|
|
71
|
-
}
|
|
72
|
-
async function importRecommendedPermissions() {
|
|
73
|
-
const target = resolveClaudeFamilySettingsTarget();
|
|
74
|
-
const templateSettings = getTemplateSettings();
|
|
75
|
-
const currentSettings = loadCurrentSettings(target);
|
|
76
|
-
if (templateSettings.permissions && templateSettings.permissions.allow) {
|
|
77
|
-
currentSettings.permissions = {
|
|
78
|
-
...templateSettings.permissions,
|
|
79
|
-
allow: mergeAndCleanPermissions(
|
|
80
|
-
templateSettings.permissions.allow,
|
|
81
|
-
currentSettings.permissions?.allow
|
|
82
|
-
)
|
|
83
|
-
};
|
|
84
|
-
} else {
|
|
85
|
-
currentSettings.permissions = templateSettings.permissions;
|
|
86
|
-
}
|
|
87
|
-
saveSettings(currentSettings, target);
|
|
88
|
-
}
|
|
89
|
-
async function openSettingsJson() {
|
|
90
|
-
const target = resolveClaudeFamilySettingsTarget();
|
|
91
|
-
ensureDir(target.configDir);
|
|
92
|
-
if (!existsSync(target.settingsFile)) {
|
|
93
|
-
saveSettings({}, target);
|
|
94
|
-
}
|
|
95
|
-
const platform = getPlatform();
|
|
96
|
-
let command;
|
|
97
|
-
switch (platform) {
|
|
98
|
-
case "macos":
|
|
99
|
-
command = "open";
|
|
100
|
-
break;
|
|
101
|
-
case "windows":
|
|
102
|
-
command = "start";
|
|
103
|
-
break;
|
|
104
|
-
default:
|
|
105
|
-
command = "xdg-open";
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
await q(command, [target.settingsFile]);
|
|
109
|
-
} catch {
|
|
110
|
-
try {
|
|
111
|
-
await q("code", [target.settingsFile]);
|
|
112
|
-
} catch {
|
|
113
|
-
try {
|
|
114
|
-
await q("vim", [target.settingsFile]);
|
|
115
|
-
} catch {
|
|
116
|
-
await q("nano", [target.settingsFile]);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export { importRecommendedEnv, importRecommendedPermissions, openSettingsJson };
|