ccjk 14.2.1 → 15.0.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 +58 -341
- package/dist/cli.js +59 -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 +102 -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 +33 -0
- package/dist/commands/menu.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/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 -1390
- 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 -234
- 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 -232
- 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.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.C1Be3aJN.mjs +0 -254
- package/dist/shared/ccjk.C1hANZTu.mjs +0 -19
- package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
- package/dist/shared/ccjk.C94P8gCY.mjs +0 -283
- package/dist/shared/ccjk.CNhnT6uQ.mjs +0 -636
- package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
- package/dist/shared/ccjk.CTr4yCZ1.mjs +0 -225
- 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.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/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/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,481 +0,0 @@
|
|
|
1
|
-
import { existsSync, statSync } from 'node:fs';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import process__default from 'node:process';
|
|
4
|
-
import a from './index5.mjs';
|
|
5
|
-
import { i18n } from './index2.mjs';
|
|
6
|
-
import { createHash } from 'node:crypto';
|
|
7
|
-
import { exec as q } from './main.mjs';
|
|
8
|
-
import { n as normalize, j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
9
|
-
import '../shared/ccjk.BAGoDD49.mjs';
|
|
10
|
-
import 'node:url';
|
|
11
|
-
import 'module';
|
|
12
|
-
import 'node:child_process';
|
|
13
|
-
import 'node:path';
|
|
14
|
-
import 'node:stream';
|
|
15
|
-
import 'node:readline';
|
|
16
|
-
|
|
17
|
-
async function generateProjectHash(projectPath) {
|
|
18
|
-
let normalizedPath = normalize(projectPath);
|
|
19
|
-
normalizedPath = normalizedPath.replace(/[/\\]+$/, "");
|
|
20
|
-
const gitInfo = await getGitInfo(normalizedPath);
|
|
21
|
-
const hashInput = [
|
|
22
|
-
normalizedPath,
|
|
23
|
-
gitInfo.remote || "",
|
|
24
|
-
gitInfo.branch || ""
|
|
25
|
-
].join("|");
|
|
26
|
-
const hash = createHash("sha256").update(hashInput).digest("hex").substring(0, 16);
|
|
27
|
-
return {
|
|
28
|
-
path: normalizedPath,
|
|
29
|
-
gitRemote: gitInfo.remote,
|
|
30
|
-
gitBranch: gitInfo.branch,
|
|
31
|
-
hash
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
async function getGitInfo(projectPath) {
|
|
35
|
-
try {
|
|
36
|
-
const gitDir = join(projectPath, ".git");
|
|
37
|
-
if (!existsSync(gitDir)) {
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
let remote;
|
|
41
|
-
try {
|
|
42
|
-
const remoteResult = await q("git", ["remote", "get-url", "origin"], {
|
|
43
|
-
nodeOptions: { cwd: projectPath }
|
|
44
|
-
});
|
|
45
|
-
remote = remoteResult.stdout?.trim();
|
|
46
|
-
} catch {
|
|
47
|
-
}
|
|
48
|
-
let branch;
|
|
49
|
-
try {
|
|
50
|
-
const branchResult = await q("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
51
|
-
nodeOptions: { cwd: projectPath }
|
|
52
|
-
});
|
|
53
|
-
branch = branchResult.stdout?.trim();
|
|
54
|
-
} catch {
|
|
55
|
-
}
|
|
56
|
-
return { remote, branch };
|
|
57
|
-
} catch {
|
|
58
|
-
return {};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
class ProjectHashCache {
|
|
62
|
-
cache = /* @__PURE__ */ new Map();
|
|
63
|
-
cacheTimeout = 5 * 60 * 1e3;
|
|
64
|
-
// 5 minutes
|
|
65
|
-
timestamps = /* @__PURE__ */ new Map();
|
|
66
|
-
/**
|
|
67
|
-
* Get or generate project identity
|
|
68
|
-
*
|
|
69
|
-
* @param projectPath - Project directory path
|
|
70
|
-
* @param forceRefresh - Force cache refresh
|
|
71
|
-
* @returns Project identity
|
|
72
|
-
*/
|
|
73
|
-
async get(projectPath, forceRefresh = false) {
|
|
74
|
-
let normalizedPath = normalize(projectPath);
|
|
75
|
-
normalizedPath = normalizedPath.replace(/[/\\]+$/, "");
|
|
76
|
-
const now = Date.now();
|
|
77
|
-
const timestamp = this.timestamps.get(normalizedPath);
|
|
78
|
-
if (!forceRefresh && timestamp && now - timestamp < this.cacheTimeout) {
|
|
79
|
-
const cached = this.cache.get(normalizedPath);
|
|
80
|
-
if (cached) {
|
|
81
|
-
return cached;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const identity = await generateProjectHash(normalizedPath);
|
|
85
|
-
this.cache.set(normalizedPath, identity);
|
|
86
|
-
this.timestamps.set(normalizedPath, now);
|
|
87
|
-
return identity;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Clear cache for specific project or all projects
|
|
91
|
-
*
|
|
92
|
-
* @param projectPath - Optional project path to clear
|
|
93
|
-
*/
|
|
94
|
-
clear(projectPath) {
|
|
95
|
-
if (projectPath) {
|
|
96
|
-
let normalizedPath = normalize(projectPath);
|
|
97
|
-
normalizedPath = normalizedPath.replace(/[/\\]+$/, "");
|
|
98
|
-
this.cache.delete(normalizedPath);
|
|
99
|
-
this.timestamps.delete(normalizedPath);
|
|
100
|
-
} else {
|
|
101
|
-
this.cache.clear();
|
|
102
|
-
this.timestamps.clear();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Get cache statistics
|
|
107
|
-
*/
|
|
108
|
-
getStats() {
|
|
109
|
-
const timestamps = Array.from(this.timestamps.values());
|
|
110
|
-
return {
|
|
111
|
-
size: this.cache.size,
|
|
112
|
-
oldestEntry: timestamps.length > 0 ? Math.min(...timestamps) : void 0
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
const projectHashCache = new ProjectHashCache();
|
|
117
|
-
async function getProjectIdentity(projectPath, forceRefresh = false) {
|
|
118
|
-
return projectHashCache.get(projectPath, forceRefresh);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const DB_PATH = join(homedir(), ".ccjk", "context", "contexts.db");
|
|
122
|
-
const WAL_PATH = `${DB_PATH}-wal`;
|
|
123
|
-
const BACKUP_DIR = join(homedir(), ".ccjk", "context", "backups");
|
|
124
|
-
const WAL_SIZE_WARNING = 10 * 1024 * 1024;
|
|
125
|
-
const WAL_SIZE_CRITICAL = 50 * 1024 * 1024;
|
|
126
|
-
const DB_SIZE_WARNING = 100 * 1024 * 1024;
|
|
127
|
-
const DB_SIZE_CRITICAL = 500 * 1024 * 1024;
|
|
128
|
-
function label(text) {
|
|
129
|
-
return a.gray(text);
|
|
130
|
-
}
|
|
131
|
-
function val(text) {
|
|
132
|
-
return a.white(text);
|
|
133
|
-
}
|
|
134
|
-
function heading(text) {
|
|
135
|
-
return a.cyan.bold(text);
|
|
136
|
-
}
|
|
137
|
-
function divider() {
|
|
138
|
-
return a.gray("\u2500".repeat(50));
|
|
139
|
-
}
|
|
140
|
-
function formatBytes(bytes) {
|
|
141
|
-
if (bytes === 0)
|
|
142
|
-
return "0 B";
|
|
143
|
-
const k = 1024;
|
|
144
|
-
const sizes = ["B", "KB", "MB", "GB"];
|
|
145
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
146
|
-
return `${(bytes / k ** i).toFixed(2)} ${sizes[i]}`;
|
|
147
|
-
}
|
|
148
|
-
function formatNumber(num) {
|
|
149
|
-
return num.toLocaleString();
|
|
150
|
-
}
|
|
151
|
-
function formatPercentage(ratio) {
|
|
152
|
-
return `${(ratio * 100).toFixed(1)}%`;
|
|
153
|
-
}
|
|
154
|
-
function formatDate(timestamp) {
|
|
155
|
-
const date = new Date(timestamp);
|
|
156
|
-
const now = Date.now();
|
|
157
|
-
const diff = now - timestamp;
|
|
158
|
-
if (diff < 6e4)
|
|
159
|
-
return "just now";
|
|
160
|
-
if (diff < 36e5)
|
|
161
|
-
return `${Math.floor(diff / 6e4)}m ago`;
|
|
162
|
-
if (diff < 864e5)
|
|
163
|
-
return `${Math.floor(diff / 36e5)}h ago`;
|
|
164
|
-
if (diff < 6048e5)
|
|
165
|
-
return `${Math.floor(diff / 864e5)}d ago`;
|
|
166
|
-
return date.toLocaleDateString();
|
|
167
|
-
}
|
|
168
|
-
function statusIcon(status) {
|
|
169
|
-
switch (status) {
|
|
170
|
-
case "green":
|
|
171
|
-
return a.green("\u25CF");
|
|
172
|
-
case "yellow":
|
|
173
|
-
return a.yellow("\u25CF");
|
|
174
|
-
case "red":
|
|
175
|
-
return a.red("\u25CF");
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
async function collectDashboardData() {
|
|
179
|
-
const isZh = i18n.language === "zh-CN";
|
|
180
|
-
const data = {
|
|
181
|
-
compression: {
|
|
182
|
-
sessionSavings: 0,
|
|
183
|
-
weeklySavings: 0,
|
|
184
|
-
monthlySavings: 0,
|
|
185
|
-
compressionRatio: 0
|
|
186
|
-
},
|
|
187
|
-
persistence: {
|
|
188
|
-
totalContexts: 0,
|
|
189
|
-
databaseSize: 0
|
|
190
|
-
},
|
|
191
|
-
health: {
|
|
192
|
-
status: "green",
|
|
193
|
-
message: isZh ? "\u6570\u636E\u5E93\u5065\u5EB7" : "Database healthy",
|
|
194
|
-
details: []
|
|
195
|
-
},
|
|
196
|
-
wal: {
|
|
197
|
-
size: 0,
|
|
198
|
-
needsCheckpoint: false,
|
|
199
|
-
message: isZh ? "WAL \u6B63\u5E38" : "WAL normal"
|
|
200
|
-
},
|
|
201
|
-
tiers: {
|
|
202
|
-
hot: 0,
|
|
203
|
-
warm: 0,
|
|
204
|
-
cold: 0
|
|
205
|
-
},
|
|
206
|
-
cacheHitRate: 0,
|
|
207
|
-
recommendations: []
|
|
208
|
-
};
|
|
209
|
-
try {
|
|
210
|
-
const { getContextPersistence } = await import('./persistence.mjs');
|
|
211
|
-
const persistence = getContextPersistence();
|
|
212
|
-
const stats = persistence.getStats();
|
|
213
|
-
data.persistence.totalContexts = stats.totalContexts;
|
|
214
|
-
data.persistence.databaseSize = stats.totalSize;
|
|
215
|
-
if (stats.totalOriginalTokens > 0) {
|
|
216
|
-
const _tokensSaved = stats.totalOriginalTokens - stats.totalCompressedTokens;
|
|
217
|
-
data.compression.compressionRatio = stats.averageCompressionRatio;
|
|
218
|
-
const oneHourAgo = Date.now() - 36e5;
|
|
219
|
-
const recentContexts = persistence.queryContexts({
|
|
220
|
-
startTime: oneHourAgo
|
|
221
|
-
});
|
|
222
|
-
data.compression.sessionSavings = recentContexts.reduce(
|
|
223
|
-
(sum, ctx) => sum + (ctx.originalTokens - ctx.compressedTokens),
|
|
224
|
-
0
|
|
225
|
-
);
|
|
226
|
-
const oneWeekAgo = Date.now() - 6048e5;
|
|
227
|
-
const weeklyContexts = persistence.queryContexts({
|
|
228
|
-
startTime: oneWeekAgo
|
|
229
|
-
});
|
|
230
|
-
data.compression.weeklySavings = weeklyContexts.reduce(
|
|
231
|
-
(sum, ctx) => sum + (ctx.originalTokens - ctx.compressedTokens),
|
|
232
|
-
0
|
|
233
|
-
);
|
|
234
|
-
const oneMonthAgo = Date.now() - 2592e6;
|
|
235
|
-
const monthlyContexts = persistence.queryContexts({
|
|
236
|
-
startTime: oneMonthAgo
|
|
237
|
-
});
|
|
238
|
-
data.compression.monthlySavings = monthlyContexts.reduce(
|
|
239
|
-
(sum, ctx) => sum + (ctx.originalTokens - ctx.compressedTokens),
|
|
240
|
-
0
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
try {
|
|
244
|
-
const projectIdentity = await getProjectIdentity(process__default.cwd());
|
|
245
|
-
const projectHash = projectIdentity.hash;
|
|
246
|
-
const hotContexts = persistence.getHotContexts(projectHash, 100);
|
|
247
|
-
const warmContexts = persistence.getWarmContexts(projectHash, 100);
|
|
248
|
-
const coldContexts = persistence.getColdContexts(projectHash, 100);
|
|
249
|
-
data.tiers.hot = hotContexts.length;
|
|
250
|
-
data.tiers.warm = warmContexts.length;
|
|
251
|
-
data.tiers.cold = coldContexts.length;
|
|
252
|
-
} catch {
|
|
253
|
-
}
|
|
254
|
-
data.cacheHitRate = 0.75;
|
|
255
|
-
} catch {
|
|
256
|
-
}
|
|
257
|
-
data.health = checkDatabaseHealth(data.persistence.databaseSize);
|
|
258
|
-
data.wal = checkWalStatus();
|
|
259
|
-
data.recommendations = generateRecommendations(data);
|
|
260
|
-
return data;
|
|
261
|
-
}
|
|
262
|
-
function checkDatabaseHealth(dbSize) {
|
|
263
|
-
const isZh = i18n.language === "zh-CN";
|
|
264
|
-
if (!existsSync(DB_PATH)) {
|
|
265
|
-
return {
|
|
266
|
-
status: "yellow",
|
|
267
|
-
message: isZh ? "\u6570\u636E\u5E93\u672A\u521D\u59CB\u5316" : "Database not initialized",
|
|
268
|
-
details: [isZh ? "\u9996\u6B21\u4F7F\u7528\u65F6\u4F1A\u81EA\u52A8\u521B\u5EFA" : "Will be created on first use"]
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
if (dbSize > DB_SIZE_CRITICAL) {
|
|
272
|
-
return {
|
|
273
|
-
status: "red",
|
|
274
|
-
message: isZh ? "\u6570\u636E\u5E93\u8FC7\u5927" : "Database too large",
|
|
275
|
-
details: [
|
|
276
|
-
isZh ? `\u5F53\u524D\u5927\u5C0F: ${formatBytes(dbSize)}` : `Current size: ${formatBytes(dbSize)}`,
|
|
277
|
-
isZh ? "\u5EFA\u8BAE\u8FD0\u884C VACUUM \u6E05\u7406" : "Recommend running VACUUM"
|
|
278
|
-
]
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
if (dbSize > DB_SIZE_WARNING) {
|
|
282
|
-
return {
|
|
283
|
-
status: "yellow",
|
|
284
|
-
message: isZh ? "\u6570\u636E\u5E93\u8F83\u5927" : "Database size warning",
|
|
285
|
-
details: [
|
|
286
|
-
isZh ? `\u5F53\u524D\u5927\u5C0F: ${formatBytes(dbSize)}` : `Current size: ${formatBytes(dbSize)}`,
|
|
287
|
-
isZh ? "\u8003\u8651\u6E05\u7406\u65E7\u6570\u636E" : "Consider cleaning old data"
|
|
288
|
-
]
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
return {
|
|
292
|
-
status: "green",
|
|
293
|
-
message: isZh ? "\u6570\u636E\u5E93\u5065\u5EB7" : "Database healthy",
|
|
294
|
-
details: [isZh ? `\u5927\u5C0F: ${formatBytes(dbSize)}` : `Size: ${formatBytes(dbSize)}`]
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
function checkWalStatus() {
|
|
298
|
-
const isZh = i18n.language === "zh-CN";
|
|
299
|
-
if (!existsSync(WAL_PATH)) {
|
|
300
|
-
return {
|
|
301
|
-
size: 0,
|
|
302
|
-
needsCheckpoint: false,
|
|
303
|
-
message: isZh ? "WAL \u6B63\u5E38" : "WAL normal"
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
const walSize = statSync(WAL_PATH).size;
|
|
307
|
-
if (walSize > WAL_SIZE_CRITICAL) {
|
|
308
|
-
return {
|
|
309
|
-
size: walSize,
|
|
310
|
-
needsCheckpoint: true,
|
|
311
|
-
message: isZh ? "WAL \u8FC7\u5927\uFF0C\u9700\u8981\u68C0\u67E5\u70B9" : "WAL too large, checkpoint needed"
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
if (walSize > WAL_SIZE_WARNING) {
|
|
315
|
-
return {
|
|
316
|
-
size: walSize,
|
|
317
|
-
needsCheckpoint: true,
|
|
318
|
-
message: isZh ? "WAL \u8F83\u5927\uFF0C\u5EFA\u8BAE\u68C0\u67E5\u70B9" : "WAL size warning, checkpoint recommended"
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
return {
|
|
322
|
-
size: walSize,
|
|
323
|
-
needsCheckpoint: false,
|
|
324
|
-
message: isZh ? "WAL \u6B63\u5E38" : "WAL normal"
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
function generateRecommendations(data) {
|
|
328
|
-
const isZh = i18n.language === "zh-CN";
|
|
329
|
-
const recommendations = [];
|
|
330
|
-
if (data.health.status === "red") {
|
|
331
|
-
recommendations.push({
|
|
332
|
-
priority: "high",
|
|
333
|
-
title: isZh ? "\u6E05\u7406\u6570\u636E\u5E93" : "Clean database",
|
|
334
|
-
description: isZh ? "\u6570\u636E\u5E93\u8FC7\u5927\uFF0C\u8FD0\u884C VACUUM \u56DE\u6536\u7A7A\u95F4" : "Database too large, run VACUUM to reclaim space",
|
|
335
|
-
command: "ccjk brain vacuum"
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
if (data.wal.needsCheckpoint) {
|
|
339
|
-
recommendations.push({
|
|
340
|
-
priority: data.wal.size > WAL_SIZE_CRITICAL ? "high" : "medium",
|
|
341
|
-
title: isZh ? "\u6267\u884C\u68C0\u67E5\u70B9" : "Run checkpoint",
|
|
342
|
-
description: isZh ? "WAL \u6587\u4EF6\u8FC7\u5927\uFF0C\u6267\u884C\u68C0\u67E5\u70B9\u5408\u5E76\u5230\u4E3B\u6570\u636E\u5E93" : "WAL file too large, run checkpoint to merge into main database",
|
|
343
|
-
command: "ccjk brain checkpoint"
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
if (!existsSync(BACKUP_DIR) || data.persistence.totalContexts > 100) {
|
|
347
|
-
const lastBackup = data.persistence.lastBackup;
|
|
348
|
-
const needsBackup = !lastBackup || Date.now() - lastBackup > 6048e5;
|
|
349
|
-
if (needsBackup) {
|
|
350
|
-
recommendations.push({
|
|
351
|
-
priority: "medium",
|
|
352
|
-
title: isZh ? "\u5907\u4EFD\u6570\u636E\u5E93" : "Backup database",
|
|
353
|
-
description: isZh ? "\u5EFA\u8BAE\u5B9A\u671F\u5907\u4EFD\u4E0A\u4E0B\u6587\u6570\u636E\u5E93" : "Recommend regular database backups",
|
|
354
|
-
command: "ccjk brain backup"
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
if (data.compression.compressionRatio < 0.3 && data.persistence.totalContexts > 10) {
|
|
359
|
-
recommendations.push({
|
|
360
|
-
priority: "low",
|
|
361
|
-
title: isZh ? "\u4F18\u5316\u538B\u7F29\u7B56\u7565" : "Optimize compression",
|
|
362
|
-
description: isZh ? "\u538B\u7F29\u7387\u8F83\u4F4E\uFF0C\u8003\u8651\u8C03\u6574\u538B\u7F29\u7B56\u7565" : "Low compression ratio, consider adjusting strategy",
|
|
363
|
-
command: "ccjk brain config"
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
return recommendations;
|
|
367
|
-
}
|
|
368
|
-
function renderCompressionSection(data) {
|
|
369
|
-
const isZh = i18n.language === "zh-CN";
|
|
370
|
-
const lines = [];
|
|
371
|
-
lines.push(heading(isZh ? "\u{1F4CA} \u538B\u7F29\u6307\u6807" : "\u{1F4CA} Compression Metrics"));
|
|
372
|
-
lines.push("");
|
|
373
|
-
if (data.persistence.totalContexts === 0) {
|
|
374
|
-
lines.push(` ${a.gray(isZh ? "\u6682\u65E0\u538B\u7F29\u6570\u636E" : "No compression data yet")}`);
|
|
375
|
-
return lines;
|
|
376
|
-
}
|
|
377
|
-
lines.push(` ${label((isZh ? "\u4F1A\u8BDD\u8282\u7701:" : "Session savings:").padEnd(20))} ${val(formatNumber(data.compression.sessionSavings))} ${a.gray("tokens")}`);
|
|
378
|
-
lines.push(` ${label((isZh ? "\u672C\u5468\u8282\u7701:" : "Weekly savings:").padEnd(20))} ${val(formatNumber(data.compression.weeklySavings))} ${a.gray("tokens")}`);
|
|
379
|
-
lines.push(` ${label((isZh ? "\u672C\u6708\u8282\u7701:" : "Monthly savings:").padEnd(20))} ${val(formatNumber(data.compression.monthlySavings))} ${a.gray("tokens")}`);
|
|
380
|
-
lines.push(` ${label((isZh ? "\u538B\u7F29\u7387:" : "Compression ratio:").padEnd(20))} ${val(formatPercentage(data.compression.compressionRatio))}`);
|
|
381
|
-
return lines;
|
|
382
|
-
}
|
|
383
|
-
function renderPersistenceSection(data) {
|
|
384
|
-
const isZh = i18n.language === "zh-CN";
|
|
385
|
-
const lines = [];
|
|
386
|
-
lines.push(heading(isZh ? "\u{1F4BE} \u6301\u4E45\u5316\u7EDF\u8BA1" : "\u{1F4BE} Persistence Stats"));
|
|
387
|
-
lines.push("");
|
|
388
|
-
lines.push(` ${label((isZh ? "\u5B58\u50A8\u4E0A\u4E0B\u6587:" : "Stored contexts:").padEnd(20))} ${val(formatNumber(data.persistence.totalContexts))}`);
|
|
389
|
-
lines.push(` ${label((isZh ? "\u6570\u636E\u5E93\u5927\u5C0F:" : "Database size:").padEnd(20))} ${val(formatBytes(data.persistence.databaseSize))}`);
|
|
390
|
-
if (data.persistence.lastBackup) {
|
|
391
|
-
lines.push(` ${label((isZh ? "\u6700\u540E\u5907\u4EFD:" : "Last backup:").padEnd(20))} ${val(formatDate(data.persistence.lastBackup))}`);
|
|
392
|
-
} else {
|
|
393
|
-
lines.push(` ${label((isZh ? "\u6700\u540E\u5907\u4EFD:" : "Last backup:").padEnd(20))} ${a.gray(isZh ? "\u4ECE\u672A\u5907\u4EFD" : "Never")}`);
|
|
394
|
-
}
|
|
395
|
-
return lines;
|
|
396
|
-
}
|
|
397
|
-
function renderHealthSection(data) {
|
|
398
|
-
const isZh = i18n.language === "zh-CN";
|
|
399
|
-
const lines = [];
|
|
400
|
-
lines.push(heading(isZh ? "\u{1F3E5} \u5065\u5EB7\u72B6\u6001" : "\u{1F3E5} Health Status"));
|
|
401
|
-
lines.push("");
|
|
402
|
-
lines.push(` ${label((isZh ? "\u6570\u636E\u5E93\u5B8C\u6574\u6027:" : "Database integrity:").padEnd(20))} ${statusIcon(data.health.status)} ${val(data.health.message)}`);
|
|
403
|
-
for (const detail of data.health.details) {
|
|
404
|
-
lines.push(` ${a.gray(detail)}`);
|
|
405
|
-
}
|
|
406
|
-
lines.push(` ${label((isZh ? "WAL \u72B6\u6001:" : "WAL status:").padEnd(20))} ${statusIcon(data.wal.needsCheckpoint ? "yellow" : "green")} ${val(data.wal.message)}`);
|
|
407
|
-
if (data.wal.size > 0) {
|
|
408
|
-
lines.push(` ${a.gray(`${isZh ? "\u5927\u5C0F" : "Size"}: ${formatBytes(data.wal.size)}`)}`);
|
|
409
|
-
}
|
|
410
|
-
const diskStatus = data.persistence.databaseSize > DB_SIZE_WARNING ? "yellow" : "green";
|
|
411
|
-
lines.push(` ${label((isZh ? "\u78C1\u76D8\u4F7F\u7528:" : "Disk utilization:").padEnd(20))} ${statusIcon(diskStatus)} ${val(formatBytes(data.persistence.databaseSize))}`);
|
|
412
|
-
return lines;
|
|
413
|
-
}
|
|
414
|
-
function renderTierSection(data) {
|
|
415
|
-
const isZh = i18n.language === "zh-CN";
|
|
416
|
-
const lines = [];
|
|
417
|
-
lines.push(heading(isZh ? "\u{1F525} \u5C42\u7EA7\u5206\u5E03" : "\u{1F525} Tier Distribution"));
|
|
418
|
-
lines.push("");
|
|
419
|
-
const total = data.tiers.hot + data.tiers.warm + data.tiers.cold;
|
|
420
|
-
if (total === 0) {
|
|
421
|
-
lines.push(` ${a.gray(isZh ? "\u6682\u65E0\u5C42\u7EA7\u6570\u636E" : "No tier data yet")}`);
|
|
422
|
-
return lines;
|
|
423
|
-
}
|
|
424
|
-
lines.push(` ${label((isZh ? "L0 (\u70ED):" : "L0 (Hot):").padEnd(20))} ${val(formatNumber(data.tiers.hot))} ${a.gray(`(${formatPercentage(data.tiers.hot / total)})`)}`);
|
|
425
|
-
lines.push(` ${label((isZh ? "L1 (\u6E29):" : "L1 (Warm):").padEnd(20))} ${val(formatNumber(data.tiers.warm))} ${a.gray(`(${formatPercentage(data.tiers.warm / total)})`)}`);
|
|
426
|
-
lines.push(` ${label((isZh ? "L2 (\u51B7):" : "L2 (Cold):").padEnd(20))} ${val(formatNumber(data.tiers.cold))} ${a.gray(`(${formatPercentage(data.tiers.cold / total)})`)}`);
|
|
427
|
-
lines.push(` ${label((isZh ? "\u7F13\u5B58\u547D\u4E2D\u7387:" : "Cache hit rate:").padEnd(20))} ${val(formatPercentage(data.cacheHitRate))}`);
|
|
428
|
-
return lines;
|
|
429
|
-
}
|
|
430
|
-
function renderRecommendationsSection(data) {
|
|
431
|
-
const isZh = i18n.language === "zh-CN";
|
|
432
|
-
const lines = [];
|
|
433
|
-
if (data.recommendations.length === 0) {
|
|
434
|
-
return lines;
|
|
435
|
-
}
|
|
436
|
-
lines.push("");
|
|
437
|
-
lines.push(a.yellow.bold(isZh ? "\u{1F4A1} \u5EFA\u8BAE" : "\u{1F4A1} Recommendations"));
|
|
438
|
-
lines.push("");
|
|
439
|
-
for (const rec of data.recommendations) {
|
|
440
|
-
const priority = rec.priority === "high" ? a.red("!") : rec.priority === "medium" ? a.yellow("\u2022") : a.gray("\xB7");
|
|
441
|
-
lines.push(` ${priority} ${a.bold(rec.title)}`);
|
|
442
|
-
lines.push(` ${a.gray(rec.description)}`);
|
|
443
|
-
if (rec.command) {
|
|
444
|
-
lines.push(` ${a.gray("\u2192")} ${a.cyan(rec.command)}`);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
return lines;
|
|
448
|
-
}
|
|
449
|
-
async function dashboardCommand(options = {}) {
|
|
450
|
-
try {
|
|
451
|
-
const data = await collectDashboardData();
|
|
452
|
-
if (options.json) {
|
|
453
|
-
console.log(JSON.stringify(data, null, 2));
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
const sections = [];
|
|
457
|
-
sections.push(renderCompressionSection(data));
|
|
458
|
-
sections.push(renderPersistenceSection(data));
|
|
459
|
-
sections.push(renderHealthSection(data));
|
|
460
|
-
sections.push(renderTierSection(data));
|
|
461
|
-
const recommendations = renderRecommendationsSection(data);
|
|
462
|
-
if (recommendations.length > 0) {
|
|
463
|
-
sections.push(recommendations);
|
|
464
|
-
}
|
|
465
|
-
console.log();
|
|
466
|
-
for (let i = 0; i < sections.length; i++) {
|
|
467
|
-
console.log(sections[i].join("\n"));
|
|
468
|
-
if (i < sections.length - 1) {
|
|
469
|
-
console.log();
|
|
470
|
-
console.log(divider());
|
|
471
|
-
console.log();
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
console.log();
|
|
475
|
-
} catch (error) {
|
|
476
|
-
console.error(a.red("Error running dashboard command:"), error);
|
|
477
|
-
process__default.exit(1);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
export { dashboardCommand };
|