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,263 +0,0 @@
|
|
|
1
|
-
import a from './index5.mjs';
|
|
2
|
-
import { getApiProviderPresets } from './api-providers.mjs';
|
|
3
|
-
import { i18n } from './index2.mjs';
|
|
4
|
-
import { P as ProviderHealthMonitor } from '../shared/ccjk.J8YiPsOw.mjs';
|
|
5
|
-
import '../shared/ccjk.BAGoDD49.mjs';
|
|
6
|
-
import './constants.mjs';
|
|
7
|
-
import 'node:os';
|
|
8
|
-
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
9
|
-
import 'node:fs';
|
|
10
|
-
import 'node:process';
|
|
11
|
-
import 'node:url';
|
|
12
|
-
|
|
13
|
-
function isClaudeFamilyCodeType(codeType) {
|
|
14
|
-
return codeType === "claude-code" || codeType === "clavue";
|
|
15
|
-
}
|
|
16
|
-
async function listProviders(options = {}) {
|
|
17
|
-
const isZh = i18n.language === "zh-CN";
|
|
18
|
-
const codeType = options.codeType || "claude-code";
|
|
19
|
-
console.log("");
|
|
20
|
-
console.log(a.bold.cyan(isZh ? "\u{1F4CB} \u53EF\u7528\u7684 API \u4F9B\u5E94\u5546" : "\u{1F4CB} Available API Providers"));
|
|
21
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
22
|
-
console.log("");
|
|
23
|
-
try {
|
|
24
|
-
const providers = await getApiProviderPresets(codeType);
|
|
25
|
-
if (providers.length === 0) {
|
|
26
|
-
console.log(a.yellow(isZh ? "\u672A\u627E\u5230\u4F9B\u5E94\u5546" : "No providers found"));
|
|
27
|
-
console.log("");
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const cloudProviders = providers.filter((p) => p.isCloud);
|
|
31
|
-
const localProviders = providers.filter((p) => !p.isCloud);
|
|
32
|
-
if (cloudProviders.length > 0) {
|
|
33
|
-
console.log(a.bold.green(isZh ? "\u2601\uFE0F \u4E91\u7AEF\u4F9B\u5E94\u5546" : "\u2601\uFE0F Cloud Providers"));
|
|
34
|
-
console.log("");
|
|
35
|
-
for (const provider of cloudProviders) {
|
|
36
|
-
displayProvider(provider, codeType, options.verbose || false, isZh);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (localProviders.length > 0) {
|
|
40
|
-
if (cloudProviders.length > 0) {
|
|
41
|
-
console.log("");
|
|
42
|
-
}
|
|
43
|
-
console.log(a.bold.blue(isZh ? "\u{1F4BE} \u672C\u5730\u4F9B\u5E94\u5546" : "\u{1F4BE} Local Providers"));
|
|
44
|
-
console.log("");
|
|
45
|
-
for (const provider of localProviders) {
|
|
46
|
-
displayProvider(provider, codeType, options.verbose || false, isZh);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
console.log("");
|
|
50
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
51
|
-
console.log(a.dim(isZh ? `\u603B\u8BA1: ${providers.length} \u4E2A\u4F9B\u5E94\u5546 (${cloudProviders.length} \u4E91\u7AEF, ${localProviders.length} \u672C\u5730)` : `Total: ${providers.length} providers (${cloudProviders.length} cloud, ${localProviders.length} local)`));
|
|
52
|
-
console.log("");
|
|
53
|
-
} catch (error) {
|
|
54
|
-
console.error(a.red(isZh ? "\u274C \u83B7\u53D6\u4F9B\u5E94\u5546\u5217\u8868\u5931\u8D25" : "\u274C Failed to fetch providers"));
|
|
55
|
-
if (options.verbose && error instanceof Error) {
|
|
56
|
-
console.error(a.dim(error.message));
|
|
57
|
-
}
|
|
58
|
-
console.log("");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function displayProvider(provider, codeType, verbose, isZh) {
|
|
62
|
-
const config = codeType === "codex" ? provider.codex : provider.claudeCode;
|
|
63
|
-
console.log(` ${a.bold(provider.name)} ${a.dim(`(${provider.id})`)}`);
|
|
64
|
-
if (provider.description) {
|
|
65
|
-
console.log(` ${a.dim(provider.description)}`);
|
|
66
|
-
}
|
|
67
|
-
if (config) {
|
|
68
|
-
console.log(` ${a.green(isZh ? "\u63A5\u53E3\u5730\u5740" : "Base URL")}: ${config.baseUrl}`);
|
|
69
|
-
if (isClaudeFamilyCodeType(codeType) && config.authType) {
|
|
70
|
-
console.log(` ${a.green(isZh ? "\u8BA4\u8BC1\u65B9\u5F0F" : "Auth Type")}: ${config.authType}`);
|
|
71
|
-
}
|
|
72
|
-
if (codeType === "codex" && config.wireApi) {
|
|
73
|
-
console.log(` ${a.green(isZh ? "\u534F\u8BAE\u7C7B\u578B" : "Wire API")}: ${config.wireApi}`);
|
|
74
|
-
}
|
|
75
|
-
if (verbose) {
|
|
76
|
-
if (config.defaultModels && config.defaultModels.length > 0) {
|
|
77
|
-
console.log(` ${a.green(isZh ? "\u9ED8\u8BA4\u6A21\u578B" : "Default Models")}: ${config.defaultModels.join(", ")}`);
|
|
78
|
-
}
|
|
79
|
-
if (config.defaultModel) {
|
|
80
|
-
console.log(` ${a.green(isZh ? "\u9ED8\u8BA4\u6A21\u578B" : "Default Model")}: ${config.defaultModel}`);
|
|
81
|
-
}
|
|
82
|
-
if (provider.website) {
|
|
83
|
-
console.log(` ${a.green(isZh ? "\u5B98\u7F51" : "Website")}: ${provider.website}`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
console.log("");
|
|
88
|
-
}
|
|
89
|
-
async function checkProvidersHealth(options = {}) {
|
|
90
|
-
const isZh = i18n.language === "zh-CN";
|
|
91
|
-
const codeType = options.codeType || "claude-code";
|
|
92
|
-
console.log("");
|
|
93
|
-
console.log(a.bold.cyan(isZh ? "\u{1F3E5} \u4F9B\u5E94\u5546\u5065\u5EB7\u68C0\u67E5" : "\u{1F3E5} Provider Health Check"));
|
|
94
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
95
|
-
console.log("");
|
|
96
|
-
try {
|
|
97
|
-
const providers = await getApiProviderPresets(codeType);
|
|
98
|
-
if (providers.length === 0) {
|
|
99
|
-
console.log(a.yellow(isZh ? "\u672A\u627E\u5230\u4F9B\u5E94\u5546" : "No providers found"));
|
|
100
|
-
console.log("");
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const monitor = new ProviderHealthMonitor({
|
|
104
|
-
timeout: 5e3,
|
|
105
|
-
degradedLatencyThreshold: 1e3,
|
|
106
|
-
unhealthyLatencyThreshold: 3e3
|
|
107
|
-
});
|
|
108
|
-
monitor.setProviders(providers);
|
|
109
|
-
console.log(a.dim(isZh ? "\u6B63\u5728\u68C0\u67E5\u4F9B\u5E94\u5546\u5065\u5EB7\u72B6\u6001..." : "Checking provider health..."));
|
|
110
|
-
console.log("");
|
|
111
|
-
const results = await Promise.all(
|
|
112
|
-
providers.map(async (provider) => {
|
|
113
|
-
const result = await monitor.checkHealth(provider);
|
|
114
|
-
return { provider, result };
|
|
115
|
-
})
|
|
116
|
-
);
|
|
117
|
-
for (const { provider, result } of results) {
|
|
118
|
-
const statusIcon = result.success ? a.green("\u2705") : a.red("\u274C");
|
|
119
|
-
const latencyColor = result.latency < 1e3 ? a.green : result.latency < 3e3 ? a.yellow : a.red;
|
|
120
|
-
console.log(`${statusIcon} ${a.bold(provider.name)}`);
|
|
121
|
-
if (result.success) {
|
|
122
|
-
console.log(` ${a.green(isZh ? "\u5EF6\u8FDF" : "Latency")}: ${latencyColor(`${result.latency}ms`)}`);
|
|
123
|
-
console.log(` ${a.green(isZh ? "\u72B6\u6001: \u6B63\u5E38" : "Status: Healthy")}`);
|
|
124
|
-
} else {
|
|
125
|
-
console.log(` ${a.red(isZh ? "\u72B6\u6001: \u4E0D\u53EF\u7528" : "Status: Unavailable")}`);
|
|
126
|
-
if (result.error) {
|
|
127
|
-
console.log(` ${a.dim(isZh ? "\u9519\u8BEF" : "Error")}: ${result.error}`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
console.log("");
|
|
131
|
-
}
|
|
132
|
-
const healthyCount = results.filter((r) => r.result.success).length;
|
|
133
|
-
const unhealthyCount = results.length - healthyCount;
|
|
134
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
135
|
-
console.log(a.bold(isZh ? "\u6458\u8981" : "Summary"));
|
|
136
|
-
console.log(` ${a.green("\u2705")} ${isZh ? "\u5065\u5EB7" : "Healthy"}: ${healthyCount}`);
|
|
137
|
-
console.log(` ${a.red("\u274C")} ${isZh ? "\u4E0D\u53EF\u7528" : "Unavailable"}: ${unhealthyCount}`);
|
|
138
|
-
console.log("");
|
|
139
|
-
} catch (error) {
|
|
140
|
-
console.error(a.red(isZh ? "\u274C \u5065\u5EB7\u68C0\u67E5\u5931\u8D25" : "\u274C Health check failed"));
|
|
141
|
-
if (options.verbose && error instanceof Error) {
|
|
142
|
-
console.error(a.dim(error.message));
|
|
143
|
-
}
|
|
144
|
-
console.log("");
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
async function recommendProvider(options = {}) {
|
|
148
|
-
const isZh = i18n.language === "zh-CN";
|
|
149
|
-
const codeType = options.codeType || "claude-code";
|
|
150
|
-
console.log("");
|
|
151
|
-
console.log(a.bold.cyan(isZh ? "\u{1F3AF} \u4F9B\u5E94\u5546\u63A8\u8350" : "\u{1F3AF} Provider Recommendation"));
|
|
152
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
153
|
-
console.log("");
|
|
154
|
-
try {
|
|
155
|
-
const providers = await getApiProviderPresets(codeType);
|
|
156
|
-
if (providers.length === 0) {
|
|
157
|
-
console.log(a.yellow(isZh ? "\u672A\u627E\u5230\u4F9B\u5E94\u5546" : "No providers found"));
|
|
158
|
-
console.log("");
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
const monitor = new ProviderHealthMonitor({
|
|
162
|
-
timeout: 5e3,
|
|
163
|
-
degradedLatencyThreshold: 1e3,
|
|
164
|
-
unhealthyLatencyThreshold: 3e3
|
|
165
|
-
});
|
|
166
|
-
monitor.setProviders(providers);
|
|
167
|
-
console.log(a.dim(isZh ? "\u6B63\u5728\u5206\u6790\u4F9B\u5E94\u5546\u6027\u80FD..." : "Analyzing provider performance..."));
|
|
168
|
-
console.log("");
|
|
169
|
-
await Promise.all(
|
|
170
|
-
providers.map(async (provider) => {
|
|
171
|
-
const result = await monitor.checkHealth(provider);
|
|
172
|
-
return result;
|
|
173
|
-
})
|
|
174
|
-
);
|
|
175
|
-
const sortedProviders = monitor.getProvidersByHealth();
|
|
176
|
-
const bestProvider = sortedProviders[0];
|
|
177
|
-
if (!bestProvider) {
|
|
178
|
-
console.log(a.yellow(isZh ? "\u65E0\u6CD5\u786E\u5B9A\u6700\u4F73\u4F9B\u5E94\u5546" : "Unable to determine best provider"));
|
|
179
|
-
console.log("");
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
console.log(a.bold.green(isZh ? "\u{1F3C6} \u63A8\u8350\u4F9B\u5E94\u5546" : "\u{1F3C6} Recommended Provider"));
|
|
183
|
-
console.log("");
|
|
184
|
-
console.log(` ${a.bold.cyan(bestProvider.name)} ${a.dim(`(${bestProvider.id})`)}`);
|
|
185
|
-
if (bestProvider.description) {
|
|
186
|
-
console.log(` ${a.dim(bestProvider.description)}`);
|
|
187
|
-
}
|
|
188
|
-
const health = monitor.getProviderHealth(bestProvider.id);
|
|
189
|
-
if (health) {
|
|
190
|
-
console.log("");
|
|
191
|
-
console.log(a.bold(isZh ? "\u6027\u80FD\u6307\u6807" : "Performance Metrics"));
|
|
192
|
-
console.log(` ${a.green(isZh ? "\u5EF6\u8FDF" : "Latency")}: ${health.latency.toFixed(0)}ms`);
|
|
193
|
-
console.log(` ${a.green(isZh ? "\u6210\u529F\u7387" : "Success Rate")}: ${(health.successRate * 100).toFixed(1)}%`);
|
|
194
|
-
console.log(` ${a.green(isZh ? "\u72B6\u6001" : "Status")}: ${getStatusDisplay(health.status, isZh)}`);
|
|
195
|
-
}
|
|
196
|
-
if (sortedProviders.length > 1) {
|
|
197
|
-
console.log("");
|
|
198
|
-
console.log(a.bold(isZh ? "\u5907\u9009\u4F9B\u5E94\u5546" : "Alternative Providers"));
|
|
199
|
-
console.log("");
|
|
200
|
-
for (let i = 1; i < Math.min(4, sortedProviders.length); i++) {
|
|
201
|
-
const provider = sortedProviders[i];
|
|
202
|
-
const health2 = monitor.getProviderHealth(provider.id);
|
|
203
|
-
console.log(` ${i}. ${a.bold(provider.name)} ${a.dim(`(${provider.id})`)}`);
|
|
204
|
-
if (health2) {
|
|
205
|
-
console.log(` ${a.dim(`${health2.latency.toFixed(0)}ms | ${(health2.successRate * 100).toFixed(1)}% | ${health2.status}`)}`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
console.log("");
|
|
210
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
211
|
-
console.log(a.dim(isZh ? '\u{1F4A1} \u63D0\u793A: \u4F7F\u7528 "ccjk config set provider <id>" \u5207\u6362\u4F9B\u5E94\u5546' : '\u{1F4A1} Tip: Use "ccjk config set provider <id>" to switch provider'));
|
|
212
|
-
console.log("");
|
|
213
|
-
} catch (error) {
|
|
214
|
-
console.error(a.red(isZh ? "\u274C \u63A8\u8350\u5931\u8D25" : "\u274C Recommendation failed"));
|
|
215
|
-
if (options.verbose && error instanceof Error) {
|
|
216
|
-
console.error(a.dim(error.message));
|
|
217
|
-
}
|
|
218
|
-
console.log("");
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
function getStatusDisplay(status, isZh) {
|
|
222
|
-
const statusMap = {
|
|
223
|
-
healthy: { en: "Healthy", zh: "\u5065\u5EB7", color: a.green },
|
|
224
|
-
degraded: { en: "Degraded", zh: "\u964D\u7EA7", color: a.yellow },
|
|
225
|
-
unhealthy: { en: "Unhealthy", zh: "\u4E0D\u5065\u5EB7", color: a.red },
|
|
226
|
-
unknown: { en: "Unknown", zh: "\u672A\u77E5", color: a.dim }
|
|
227
|
-
};
|
|
228
|
-
const info = statusMap[status] || statusMap.unknown;
|
|
229
|
-
const text = isZh ? info.zh : info.en;
|
|
230
|
-
return info.color(text);
|
|
231
|
-
}
|
|
232
|
-
async function providersCommand(action, options = {}) {
|
|
233
|
-
switch (action) {
|
|
234
|
-
case "list":
|
|
235
|
-
case "ls":
|
|
236
|
-
await listProviders(options);
|
|
237
|
-
break;
|
|
238
|
-
case "health":
|
|
239
|
-
case "check":
|
|
240
|
-
await checkProvidersHealth(options);
|
|
241
|
-
break;
|
|
242
|
-
case "recommend":
|
|
243
|
-
case "rec":
|
|
244
|
-
await recommendProvider(options);
|
|
245
|
-
break;
|
|
246
|
-
default: {
|
|
247
|
-
const isZh = i18n.language === "zh-CN";
|
|
248
|
-
console.log("");
|
|
249
|
-
console.log(a.bold.cyan(isZh ? "\u{1F4E6} \u4F9B\u5E94\u5546\u7BA1\u7406\u547D\u4EE4" : "\u{1F4E6} Provider Management Commands"));
|
|
250
|
-
console.log("");
|
|
251
|
-
console.log(` ${a.green("ccjk providers list")} ${isZh ? "\u5217\u51FA\u6240\u6709\u4F9B\u5E94\u5546" : "List all providers"}`);
|
|
252
|
-
console.log(` ${a.green("ccjk providers health")} ${isZh ? "\u68C0\u67E5\u4F9B\u5E94\u5546\u5065\u5EB7\u72B6\u6001" : "Check provider health"}`);
|
|
253
|
-
console.log(` ${a.green("ccjk providers recommend")} ${isZh ? "\u63A8\u8350\u6700\u4F73\u4F9B\u5E94\u5546" : "Recommend best provider"}`);
|
|
254
|
-
console.log("");
|
|
255
|
-
console.log(a.bold(isZh ? "\u9009\u9879" : "Options"));
|
|
256
|
-
console.log(` ${a.green("--code-type, -T")} <type> ${isZh ? "\u4EE3\u7801\u5DE5\u5177\u7C7B\u578B (claude-code, clavue, codex)" : "Code tool type (claude-code, clavue, codex)"}`);
|
|
257
|
-
console.log(` ${a.green("--verbose, -v")} ${isZh ? "\u8BE6\u7EC6\u8F93\u51FA" : "Verbose output"}`);
|
|
258
|
-
console.log("");
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
export { checkProvidersHealth, listProviders, providersCommand, recommendProvider };
|
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import a from './index5.mjs';
|
|
4
|
-
import { MetricsDisplay } from './metrics-display.mjs';
|
|
5
|
-
import { getContextPersistence } from './persistence.mjs';
|
|
6
|
-
import { r as runHealthCheck } from '../shared/ccjk.Dxgd2vjc.mjs';
|
|
7
|
-
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
8
|
-
import '../shared/ccjk.BAGoDD49.mjs';
|
|
9
|
-
import 'better-sqlite3';
|
|
10
|
-
import './constants.mjs';
|
|
11
|
-
import './index2.mjs';
|
|
12
|
-
import 'node:process';
|
|
13
|
-
import 'node:url';
|
|
14
|
-
import './memory-check.mjs';
|
|
15
|
-
import 'node:path';
|
|
16
|
-
import 'fs';
|
|
17
|
-
import 'constants';
|
|
18
|
-
import 'stream';
|
|
19
|
-
import 'util';
|
|
20
|
-
import 'assert';
|
|
21
|
-
import 'path';
|
|
22
|
-
import './memory-paths.mjs';
|
|
23
|
-
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
24
|
-
import './index3.mjs';
|
|
25
|
-
import './fs-operations.mjs';
|
|
26
|
-
import 'node:crypto';
|
|
27
|
-
import 'node:fs/promises';
|
|
28
|
-
|
|
29
|
-
const HABIT_FILE = join(homedir(), ".ccjk", "habits.json");
|
|
30
|
-
function loadHabitStats() {
|
|
31
|
-
try {
|
|
32
|
-
if (!existsSync(HABIT_FILE)) {
|
|
33
|
-
return {
|
|
34
|
-
totalCommands: 0,
|
|
35
|
-
lastUsed: 0,
|
|
36
|
-
streak: 0,
|
|
37
|
-
longestStreak: 0,
|
|
38
|
-
commandCounts: {},
|
|
39
|
-
firstUsed: Date.now()
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return JSON.parse(readFileSync(HABIT_FILE, "utf-8"));
|
|
43
|
-
} catch {
|
|
44
|
-
return {
|
|
45
|
-
totalCommands: 0,
|
|
46
|
-
lastUsed: 0,
|
|
47
|
-
streak: 0,
|
|
48
|
-
longestStreak: 0,
|
|
49
|
-
commandCounts: {},
|
|
50
|
-
firstUsed: Date.now()
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function saveHabitStats(stats) {
|
|
55
|
-
try {
|
|
56
|
-
const dir = join(homedir(), ".ccjk");
|
|
57
|
-
if (!existsSync(dir)) {
|
|
58
|
-
require("node:fs").mkdirSync(dir, { recursive: true });
|
|
59
|
-
}
|
|
60
|
-
writeFileSync(HABIT_FILE, JSON.stringify(stats, null, 2), "utf-8");
|
|
61
|
-
} catch {
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function updateHabitStats(command) {
|
|
65
|
-
const stats = loadHabitStats();
|
|
66
|
-
const now = Date.now();
|
|
67
|
-
const lastUsedDate = new Date(stats.lastUsed).toDateString();
|
|
68
|
-
const todayDate = new Date(now).toDateString();
|
|
69
|
-
const yesterdayDate = new Date(now - 24 * 60 * 60 * 1e3).toDateString();
|
|
70
|
-
if (lastUsedDate === todayDate) ; else if (lastUsedDate === yesterdayDate) {
|
|
71
|
-
stats.streak++;
|
|
72
|
-
} else {
|
|
73
|
-
stats.streak = 1;
|
|
74
|
-
}
|
|
75
|
-
if (stats.streak > stats.longestStreak) {
|
|
76
|
-
stats.longestStreak = stats.streak;
|
|
77
|
-
}
|
|
78
|
-
stats.commandCounts[command] = (stats.commandCounts[command] || 0) + 1;
|
|
79
|
-
stats.totalCommands++;
|
|
80
|
-
stats.lastUsed = now;
|
|
81
|
-
saveHabitStats(stats);
|
|
82
|
-
return stats;
|
|
83
|
-
}
|
|
84
|
-
function getDaysUsed() {
|
|
85
|
-
const stats = loadHabitStats();
|
|
86
|
-
if (stats.totalCommands === 0)
|
|
87
|
-
return 0;
|
|
88
|
-
const firstDate = new Date(stats.firstUsed);
|
|
89
|
-
const now = /* @__PURE__ */ new Date();
|
|
90
|
-
const diffTime = Math.abs(now.getTime() - firstDate.getTime());
|
|
91
|
-
const diffDays = Math.ceil(diffTime / (1e3 * 60 * 60 * 24));
|
|
92
|
-
return diffDays;
|
|
93
|
-
}
|
|
94
|
-
function getMotivationalMessage(stats, tokensSaved, costSavings) {
|
|
95
|
-
const messages = [];
|
|
96
|
-
if (stats.streak >= 7) {
|
|
97
|
-
messages.push(a.green.bold(`\u{1F389} ${stats.streak}-day streak! You're on fire!`));
|
|
98
|
-
} else if (stats.streak >= 3) {
|
|
99
|
-
messages.push(a.cyan(`\u{1F525} ${stats.streak}-day streak! Keep it going!`));
|
|
100
|
-
} else if (stats.streak === 1) {
|
|
101
|
-
messages.push(a.yellow(`\u2728 New streak started! Come back tomorrow!`));
|
|
102
|
-
}
|
|
103
|
-
if (costSavings >= 50) {
|
|
104
|
-
messages.push(a.green.bold(`\u{1F4B0} You've saved $${costSavings.toFixed(2)} this week!`));
|
|
105
|
-
} else if (costSavings >= 10) {
|
|
106
|
-
messages.push(a.cyan(`\u{1F4B5} $${costSavings.toFixed(2)} saved this week!`));
|
|
107
|
-
}
|
|
108
|
-
if (tokensSaved >= 1e5) {
|
|
109
|
-
messages.push(a.magenta.bold(`\u{1F680} ${MetricsDisplay.formatTokenCount(tokensSaved)} tokens saved!`));
|
|
110
|
-
} else if (tokensSaved >= 1e4) {
|
|
111
|
-
messages.push(a.blue(`\u{1F4CA} ${MetricsDisplay.formatTokenCount(tokensSaved)} tokens saved!`));
|
|
112
|
-
}
|
|
113
|
-
if (stats.totalCommands === 10) {
|
|
114
|
-
messages.push(a.yellow(`\u{1F3AF} 10 commands milestone! You're getting the hang of it!`));
|
|
115
|
-
} else if (stats.totalCommands === 50) {
|
|
116
|
-
messages.push(a.green(`\u{1F3C6} 50 commands milestone! You're a power user!`));
|
|
117
|
-
} else if (stats.totalCommands === 100) {
|
|
118
|
-
messages.push(a.magenta.bold(`\u{1F451} 100 commands milestone! You're a CCJK master!`));
|
|
119
|
-
}
|
|
120
|
-
if (stats.longestStreak >= 30) {
|
|
121
|
-
messages.push(a.magenta.bold(`\u{1F3C5} Longest streak: ${stats.longestStreak} days! Legendary!`));
|
|
122
|
-
} else if (stats.longestStreak >= 14) {
|
|
123
|
-
messages.push(a.green(`\u{1F3C5} Longest streak: ${stats.longestStreak} days!`));
|
|
124
|
-
}
|
|
125
|
-
return messages.length > 0 ? messages.join("\n ") : "";
|
|
126
|
-
}
|
|
127
|
-
function getSuggestion(stats) {
|
|
128
|
-
const now = Date.now();
|
|
129
|
-
const lastUsed = stats.lastUsed;
|
|
130
|
-
const hoursSinceLastUse = (now - lastUsed) / (1e3 * 60 * 60);
|
|
131
|
-
if (hoursSinceLastUse >= 168) {
|
|
132
|
-
return a.yellow(`\u{1F4A1} Tip: Run ${a.cyan("ccjk cleanup")} weekly to keep DB healthy`);
|
|
133
|
-
}
|
|
134
|
-
if (hoursSinceLastUse >= 24) {
|
|
135
|
-
return a.yellow(`\u{1F4A1} Tip: Run ${a.cyan("ccjk review")} to see your daily stats`);
|
|
136
|
-
}
|
|
137
|
-
if ((stats.commandCounts.commit || 0) < 5) {
|
|
138
|
-
return a.yellow(`\u{1F4A1} Tip: Try ${a.cyan("ccjk commit")} for smart commits with compression stats`);
|
|
139
|
-
}
|
|
140
|
-
const tips = [
|
|
141
|
-
`\u{1F4A1} Tip: ${a.cyan("ccjk morning")} gives you a quick health check`,
|
|
142
|
-
`\u{1F4A1} Tip: ${a.cyan("ccjk review")} shows your token savings`,
|
|
143
|
-
`\u{1F4A1} Tip: ${a.cyan("ccjk cleanup")} keeps your database optimized`
|
|
144
|
-
];
|
|
145
|
-
return tips[Math.floor(Math.random() * tips.length)];
|
|
146
|
-
}
|
|
147
|
-
async function morningCommand(options = {}) {
|
|
148
|
-
const stats = updateHabitStats("morning");
|
|
149
|
-
if (!options.silent) {
|
|
150
|
-
console.log();
|
|
151
|
-
console.log(a.cyan.bold("\u2600\uFE0F Good morning! Here's your CCJK status:"));
|
|
152
|
-
console.log();
|
|
153
|
-
}
|
|
154
|
-
try {
|
|
155
|
-
const health = await runHealthCheck();
|
|
156
|
-
const persistence = getContextPersistence();
|
|
157
|
-
const metrics = persistence.getCompressionMetricsStats();
|
|
158
|
-
if (options.json) {
|
|
159
|
-
console.log(JSON.stringify({
|
|
160
|
-
health,
|
|
161
|
-
metrics,
|
|
162
|
-
habits: stats
|
|
163
|
-
}, null, 2));
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
const gradeColor = health.grade === "S" ? a.magenta.bold : health.grade === "A" ? a.green.bold : health.grade === "B" ? a.cyan.bold : health.grade === "C" ? a.yellow.bold : a.red.bold;
|
|
167
|
-
console.log(` ${a.gray("Health Score:")} ${gradeColor(health.grade)} ${a.gray(`(${health.totalScore}/100)`)}`);
|
|
168
|
-
if (metrics.totalCompressions > 0) {
|
|
169
|
-
console.log(` ${a.gray("Total Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.totalTokensSaved))} tokens`);
|
|
170
|
-
console.log(` ${a.gray("Cost Savings:")} ${a.green.bold(MetricsDisplay.formatCost(metrics.estimatedCostSavings))}`);
|
|
171
|
-
if (metrics.sessionStats && metrics.sessionStats.compressions > 0) {
|
|
172
|
-
console.log(` ${a.gray("Last 24h:")} ${a.white(metrics.sessionStats.compressions)} compressions, ${a.green(MetricsDisplay.formatCost(metrics.sessionStats.costSavings))} saved`);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
if (stats.streak > 0) {
|
|
176
|
-
console.log(` ${a.gray("Streak:")} ${a.yellow(`${stats.streak} day${stats.streak > 1 ? "s" : ""}`)}`);
|
|
177
|
-
}
|
|
178
|
-
console.log();
|
|
179
|
-
const message = getMotivationalMessage(stats, metrics.totalTokensSaved, metrics.weeklyStats?.costSavings || 0);
|
|
180
|
-
if (message) {
|
|
181
|
-
console.log(` ${message}`);
|
|
182
|
-
console.log();
|
|
183
|
-
}
|
|
184
|
-
if (health.recommendations.length > 0) {
|
|
185
|
-
console.log(a.yellow.bold(" \u{1F4CB} Top Recommendations:"));
|
|
186
|
-
for (const rec of health.recommendations.slice(0, 2)) {
|
|
187
|
-
const priority = rec.priority === "high" ? a.red("!") : rec.priority === "medium" ? a.yellow("\u2022") : a.gray("\xB7");
|
|
188
|
-
console.log(` ${priority} ${rec.title}`);
|
|
189
|
-
if (rec.command) {
|
|
190
|
-
console.log(` ${a.gray("\u2192")} ${a.cyan(rec.command)}`);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
console.log();
|
|
194
|
-
}
|
|
195
|
-
const suggestion = getSuggestion(stats);
|
|
196
|
-
if (suggestion) {
|
|
197
|
-
console.log(` ${suggestion}`);
|
|
198
|
-
console.log();
|
|
199
|
-
}
|
|
200
|
-
} catch (error) {
|
|
201
|
-
console.error(a.red("Error running morning command:"), error);
|
|
202
|
-
process.exit(1);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
async function reviewCommand(options = {}) {
|
|
206
|
-
const stats = updateHabitStats("review");
|
|
207
|
-
if (!options.silent) {
|
|
208
|
-
console.log();
|
|
209
|
-
console.log(a.cyan.bold("\u{1F4CA} Daily Review"));
|
|
210
|
-
console.log();
|
|
211
|
-
}
|
|
212
|
-
try {
|
|
213
|
-
const persistence = getContextPersistence();
|
|
214
|
-
const metrics = persistence.getCompressionMetricsStats();
|
|
215
|
-
if (options.json) {
|
|
216
|
-
console.log(JSON.stringify({
|
|
217
|
-
metrics,
|
|
218
|
-
habits: stats
|
|
219
|
-
}, null, 2));
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
console.log(a.cyan.bold(" Overall Statistics"));
|
|
223
|
-
console.log(` ${a.gray("Total Compressions:")} ${a.white(metrics.totalCompressions)}`);
|
|
224
|
-
console.log(` ${a.gray("Total Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.totalTokensSaved))} tokens`);
|
|
225
|
-
console.log(` ${a.gray("Avg Reduction:")} ${a.yellow(MetricsDisplay.formatRatio(metrics.averageCompressionRatio))}`);
|
|
226
|
-
console.log(` ${a.gray("Cost Savings:")} ${a.green.bold(MetricsDisplay.formatCost(metrics.estimatedCostSavings))}`);
|
|
227
|
-
console.log();
|
|
228
|
-
if (metrics.sessionStats && metrics.sessionStats.compressions > 0) {
|
|
229
|
-
console.log(a.cyan.bold(" Last 24 Hours"));
|
|
230
|
-
console.log(` ${a.gray("Compressions:")} ${a.white(metrics.sessionStats.compressions)}`);
|
|
231
|
-
console.log(` ${a.gray("Tokens Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.sessionStats.tokensSaved))}`);
|
|
232
|
-
console.log(` ${a.gray("Cost Savings:")} ${a.green(MetricsDisplay.formatCost(metrics.sessionStats.costSavings))}`);
|
|
233
|
-
console.log();
|
|
234
|
-
}
|
|
235
|
-
if (metrics.weeklyStats && metrics.weeklyStats.compressions > 0) {
|
|
236
|
-
console.log(a.cyan.bold(" Last 7 Days"));
|
|
237
|
-
console.log(` ${a.gray("Compressions:")} ${a.white(metrics.weeklyStats.compressions)}`);
|
|
238
|
-
console.log(` ${a.gray("Tokens Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.weeklyStats.tokensSaved))}`);
|
|
239
|
-
console.log(` ${a.gray("Cost Savings:")} ${a.green(MetricsDisplay.formatCost(metrics.weeklyStats.costSavings))}`);
|
|
240
|
-
console.log();
|
|
241
|
-
}
|
|
242
|
-
if (metrics.monthlyStats && metrics.monthlyStats.compressions > 0) {
|
|
243
|
-
console.log(a.cyan.bold(" Last 30 Days"));
|
|
244
|
-
console.log(` ${a.gray("Compressions:")} ${a.white(metrics.monthlyStats.compressions)}`);
|
|
245
|
-
console.log(` ${a.gray("Tokens Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.monthlyStats.tokensSaved))}`);
|
|
246
|
-
console.log(` ${a.gray("Cost Savings:")} ${a.green(MetricsDisplay.formatCost(metrics.monthlyStats.costSavings))}`);
|
|
247
|
-
console.log();
|
|
248
|
-
}
|
|
249
|
-
console.log(a.cyan.bold(" Your Habits"));
|
|
250
|
-
console.log(` ${a.gray("Total Commands:")} ${a.white(stats.totalCommands)}`);
|
|
251
|
-
console.log(` ${a.gray("Current Streak:")} ${a.yellow(`${stats.streak} day${stats.streak !== 1 ? "s" : ""}`)}`);
|
|
252
|
-
console.log(` ${a.gray("Longest Streak:")} ${a.yellow(`${stats.longestStreak} day${stats.longestStreak !== 1 ? "s" : ""}`)}`);
|
|
253
|
-
console.log(` ${a.gray("Days Active:")} ${a.white(getDaysUsed())}`);
|
|
254
|
-
console.log();
|
|
255
|
-
const message = getMotivationalMessage(stats, metrics.totalTokensSaved, metrics.weeklyStats?.costSavings || 0);
|
|
256
|
-
if (message) {
|
|
257
|
-
console.log(` ${message}`);
|
|
258
|
-
console.log();
|
|
259
|
-
}
|
|
260
|
-
const suggestion = getSuggestion(stats);
|
|
261
|
-
if (suggestion) {
|
|
262
|
-
console.log(` ${suggestion}`);
|
|
263
|
-
console.log();
|
|
264
|
-
}
|
|
265
|
-
} catch (error) {
|
|
266
|
-
console.error(a.red("Error running review command:"), error);
|
|
267
|
-
process.exit(1);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
async function cleanupCommand(options = {}) {
|
|
271
|
-
const stats = updateHabitStats("cleanup");
|
|
272
|
-
if (!options.silent) {
|
|
273
|
-
console.log();
|
|
274
|
-
console.log(a.cyan.bold("\u{1F9F9} Database Cleanup"));
|
|
275
|
-
console.log();
|
|
276
|
-
}
|
|
277
|
-
try {
|
|
278
|
-
const persistence = getContextPersistence();
|
|
279
|
-
const statsBefore = persistence.getStats();
|
|
280
|
-
if (!options.silent) {
|
|
281
|
-
console.log(` ${a.gray("Database size before:")} ${a.white(MetricsDisplay.formatBytes(statsBefore.totalSize))}`);
|
|
282
|
-
console.log(` ${a.gray("Total contexts:")} ${a.white(statsBefore.totalContexts)}`);
|
|
283
|
-
console.log();
|
|
284
|
-
}
|
|
285
|
-
const maxAge = 30 * 24 * 60 * 60 * 1e3;
|
|
286
|
-
const deletedContexts = persistence.cleanup(maxAge);
|
|
287
|
-
if (!options.silent && deletedContexts > 0) {
|
|
288
|
-
console.log(` ${a.green("\u2713")} Deleted ${a.white(deletedContexts)} old context${deletedContexts !== 1 ? "s" : ""}`);
|
|
289
|
-
}
|
|
290
|
-
const metricsMaxAge = 90 * 24 * 60 * 60 * 1e3;
|
|
291
|
-
const deletedMetrics = persistence.cleanupCompressionMetrics(metricsMaxAge);
|
|
292
|
-
if (!options.silent && deletedMetrics > 0) {
|
|
293
|
-
console.log(` ${a.green("\u2713")} Deleted ${a.white(deletedMetrics)} old metric${deletedMetrics !== 1 ? "s" : ""}`);
|
|
294
|
-
}
|
|
295
|
-
if (!options.silent) {
|
|
296
|
-
console.log(` ${a.gray("Running VACUUM...")}`);
|
|
297
|
-
}
|
|
298
|
-
persistence.vacuum();
|
|
299
|
-
const statsAfter = persistence.getStats();
|
|
300
|
-
const sizeSaved = statsBefore.totalSize - statsAfter.totalSize;
|
|
301
|
-
if (!options.silent) {
|
|
302
|
-
console.log(` ${a.green("\u2713")} VACUUM complete`);
|
|
303
|
-
console.log();
|
|
304
|
-
console.log(` ${a.gray("Database size after:")} ${a.white(MetricsDisplay.formatBytes(statsAfter.totalSize))}`);
|
|
305
|
-
console.log(` ${a.gray("Space reclaimed:")} ${a.green(MetricsDisplay.formatBytes(sizeSaved))}`);
|
|
306
|
-
console.log(` ${a.gray("Total contexts:")} ${a.white(statsAfter.totalContexts)}`);
|
|
307
|
-
console.log();
|
|
308
|
-
console.log(` ${a.green.bold("\u2713 Cleanup complete!")}`);
|
|
309
|
-
console.log();
|
|
310
|
-
}
|
|
311
|
-
if (options.json) {
|
|
312
|
-
console.log(JSON.stringify({
|
|
313
|
-
deletedContexts,
|
|
314
|
-
deletedMetrics,
|
|
315
|
-
sizeSaved,
|
|
316
|
-
statsBefore,
|
|
317
|
-
statsAfter
|
|
318
|
-
}, null, 2));
|
|
319
|
-
}
|
|
320
|
-
if (!options.silent) {
|
|
321
|
-
const message = getMotivationalMessage(stats, 0, 0);
|
|
322
|
-
if (message) {
|
|
323
|
-
console.log(` ${message}`);
|
|
324
|
-
console.log();
|
|
325
|
-
}
|
|
326
|
-
console.log(` ${a.yellow(`\u{1F4A1} Tip: Run cleanup weekly to keep your database healthy`)}`);
|
|
327
|
-
console.log();
|
|
328
|
-
}
|
|
329
|
-
} catch (error) {
|
|
330
|
-
console.error(a.red("Error running cleanup command:"), error);
|
|
331
|
-
process.exit(1);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
export { cleanupCommand, morningCommand, reviewCommand };
|