ccjk 14.2.2 → 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 -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,871 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import a from './index5.mjs';
|
|
3
|
-
import { i as inquirer } from './index6.mjs';
|
|
4
|
-
import { randomUUID, createHash } from 'node:crypto';
|
|
5
|
-
import { ensureDir, writeFileAtomic } from './fs-operations.mjs';
|
|
6
|
-
import { c as createConfigSnapshot } from '../shared/ccjk.BzPbSEP2.mjs';
|
|
7
|
-
import { d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
8
|
-
import { isCodeToolType, isClaudeFamilyCodeTool, CODEX_CONFIG_FILE, ZCF_CONFIG_FILE } from './constants.mjs';
|
|
9
|
-
import { i18n } from './index2.mjs';
|
|
10
|
-
import { readZcfConfig, buildUpdatedTomlConfig, stringifyTomlConfig } from './ccjk-config.mjs';
|
|
11
|
-
import { e as ensureClaudeFamilyCoreFeatures } from '../shared/ccjk.5bEolFrk.mjs';
|
|
12
|
-
import { r as resolveClaudeFamilySettingsTarget, a as applyTrustedOperatorPermissions, n as normalizeClaudeFamilySettings } from '../shared/ccjk.DDL-4C-k.mjs';
|
|
13
|
-
import { h as buildCodexGoalsFeatureConfigContent } from './codex.mjs';
|
|
14
|
-
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
15
|
-
import '../shared/ccjk.BAGoDD49.mjs';
|
|
16
|
-
import 'node:readline';
|
|
17
|
-
import 'stream';
|
|
18
|
-
import 'node:tty';
|
|
19
|
-
import 'node:process';
|
|
20
|
-
import 'node:async_hooks';
|
|
21
|
-
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
22
|
-
import 'node:util';
|
|
23
|
-
import 'tty';
|
|
24
|
-
import 'fs';
|
|
25
|
-
import 'child_process';
|
|
26
|
-
import 'node:path';
|
|
27
|
-
import 'node:os';
|
|
28
|
-
import 'buffer';
|
|
29
|
-
import 'string_decoder';
|
|
30
|
-
import 'node:fs/promises';
|
|
31
|
-
import 'node:url';
|
|
32
|
-
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
33
|
-
import './index3.mjs';
|
|
34
|
-
import './json-config.mjs';
|
|
35
|
-
import '../shared/ccjk.RyizuzOI.mjs';
|
|
36
|
-
import './claude-config.mjs';
|
|
37
|
-
import 'node:child_process';
|
|
38
|
-
import './platform.mjs';
|
|
39
|
-
import './main.mjs';
|
|
40
|
-
import 'module';
|
|
41
|
-
import 'node:stream';
|
|
42
|
-
import '../shared/ccjk.BLsIiTqO.mjs';
|
|
43
|
-
import '../shared/ccjk.DFRPtmK_.mjs';
|
|
44
|
-
import './auto-updater.mjs';
|
|
45
|
-
import './index8.mjs';
|
|
46
|
-
import '../shared/ccjk.DeWpAShp.mjs';
|
|
47
|
-
import '../shared/ccjk.DZ2LLOa-.mjs';
|
|
48
|
-
import './version-checker.mjs';
|
|
49
|
-
import '../shared/ccjk.CxpGa6MC.mjs';
|
|
50
|
-
import '../shared/ccjk.C0WLUnFV.mjs';
|
|
51
|
-
import './config.mjs';
|
|
52
|
-
import './prompts.mjs';
|
|
53
|
-
import '../shared/ccjk.gDEDGD_t.mjs';
|
|
54
|
-
|
|
55
|
-
function generateDiff(oldContent, newContent, contextLines = 3) {
|
|
56
|
-
const oldLines = oldContent.split("\n");
|
|
57
|
-
const newLines = newContent.split("\n");
|
|
58
|
-
const lcs = computeLCS(oldLines, newLines);
|
|
59
|
-
const hunks = generateHunks(oldLines, newLines, lcs, contextLines);
|
|
60
|
-
let additions = 0;
|
|
61
|
-
let deletions = 0;
|
|
62
|
-
for (const hunk of hunks) {
|
|
63
|
-
for (const line of hunk.lines) {
|
|
64
|
-
if (line.type === "add")
|
|
65
|
-
additions++;
|
|
66
|
-
if (line.type === "remove")
|
|
67
|
-
deletions++;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
hunks,
|
|
72
|
-
additions,
|
|
73
|
-
deletions,
|
|
74
|
-
hasChanges: additions > 0 || deletions > 0
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function computeLCS(oldLines, newLines) {
|
|
78
|
-
const m = oldLines.length;
|
|
79
|
-
const n = newLines.length;
|
|
80
|
-
const dp = Array.from({ length: m + 1 }, () => new Array(n + 1).fill(0));
|
|
81
|
-
for (let i = 1; i <= m; i++) {
|
|
82
|
-
for (let j = 1; j <= n; j++) {
|
|
83
|
-
if (oldLines[i - 1] === newLines[j - 1]) {
|
|
84
|
-
dp[i][j] = dp[i - 1][j - 1] + 1;
|
|
85
|
-
} else {
|
|
86
|
-
dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return dp;
|
|
91
|
-
}
|
|
92
|
-
function generateHunks(oldLines, newLines, dp, contextLines) {
|
|
93
|
-
const changes = [];
|
|
94
|
-
let i = oldLines.length;
|
|
95
|
-
let j = newLines.length;
|
|
96
|
-
while (i > 0 || j > 0) {
|
|
97
|
-
if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) {
|
|
98
|
-
changes.unshift({ type: "same", oldIdx: i - 1, newIdx: j - 1 });
|
|
99
|
-
i--;
|
|
100
|
-
j--;
|
|
101
|
-
} else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
|
|
102
|
-
changes.unshift({ type: "add", newIdx: j - 1 });
|
|
103
|
-
j--;
|
|
104
|
-
} else {
|
|
105
|
-
changes.unshift({ type: "remove", oldIdx: i - 1 });
|
|
106
|
-
i--;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
const hunks = [];
|
|
110
|
-
let currentHunk = null;
|
|
111
|
-
let contextCount = 0;
|
|
112
|
-
for (let idx = 0; idx < changes.length; idx++) {
|
|
113
|
-
const change = changes[idx];
|
|
114
|
-
const isChange = change.type !== "same";
|
|
115
|
-
const needsNewHunk = isChange && (!currentHunk || contextCount > contextLines * 2);
|
|
116
|
-
if (needsNewHunk) {
|
|
117
|
-
const startIdx = Math.max(0, idx - contextLines);
|
|
118
|
-
currentHunk = {
|
|
119
|
-
oldStart: changes[startIdx].oldIdx ?? 0,
|
|
120
|
-
oldLines: 0,
|
|
121
|
-
newStart: changes[startIdx].newIdx ?? 0,
|
|
122
|
-
newLines: 0,
|
|
123
|
-
lines: []
|
|
124
|
-
};
|
|
125
|
-
for (let c = startIdx; c < idx; c++) {
|
|
126
|
-
const ctx = changes[c];
|
|
127
|
-
if (ctx.type === "same" && ctx.oldIdx !== void 0) {
|
|
128
|
-
currentHunk.lines.push({
|
|
129
|
-
type: "context",
|
|
130
|
-
content: oldLines[ctx.oldIdx],
|
|
131
|
-
oldLineNumber: ctx.oldIdx + 1,
|
|
132
|
-
newLineNumber: ctx.newIdx + 1
|
|
133
|
-
});
|
|
134
|
-
currentHunk.oldLines++;
|
|
135
|
-
currentHunk.newLines++;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
hunks.push(currentHunk);
|
|
139
|
-
contextCount = 0;
|
|
140
|
-
}
|
|
141
|
-
if (currentHunk) {
|
|
142
|
-
if (change.type === "same") {
|
|
143
|
-
contextCount++;
|
|
144
|
-
if (contextCount <= contextLines) {
|
|
145
|
-
currentHunk.lines.push({
|
|
146
|
-
type: "context",
|
|
147
|
-
content: oldLines[change.oldIdx],
|
|
148
|
-
oldLineNumber: change.oldIdx + 1,
|
|
149
|
-
newLineNumber: change.newIdx + 1
|
|
150
|
-
});
|
|
151
|
-
currentHunk.oldLines++;
|
|
152
|
-
currentHunk.newLines++;
|
|
153
|
-
} else if (contextCount > contextLines * 2) {
|
|
154
|
-
currentHunk = null;
|
|
155
|
-
}
|
|
156
|
-
} else {
|
|
157
|
-
contextCount = 0;
|
|
158
|
-
if (change.type === "remove") {
|
|
159
|
-
currentHunk.lines.push({
|
|
160
|
-
type: "remove",
|
|
161
|
-
content: oldLines[change.oldIdx],
|
|
162
|
-
oldLineNumber: change.oldIdx + 1
|
|
163
|
-
});
|
|
164
|
-
currentHunk.oldLines++;
|
|
165
|
-
} else {
|
|
166
|
-
currentHunk.lines.push({
|
|
167
|
-
type: "add",
|
|
168
|
-
content: newLines[change.newIdx],
|
|
169
|
-
newLineNumber: change.newIdx + 1
|
|
170
|
-
});
|
|
171
|
-
currentHunk.newLines++;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return hunks;
|
|
177
|
-
}
|
|
178
|
-
function formatDiff(diff, filePath, options = {}) {
|
|
179
|
-
const { color = true, lineNumbers = true } = options;
|
|
180
|
-
const lines = [];
|
|
181
|
-
if (filePath) {
|
|
182
|
-
lines.push(color ? a.bold(`--- a/${filePath}`) : `--- a/${filePath}`);
|
|
183
|
-
lines.push(color ? a.bold(`+++ b/${filePath}`) : `+++ b/${filePath}`);
|
|
184
|
-
}
|
|
185
|
-
for (const hunk of diff.hunks) {
|
|
186
|
-
const hunkHeader = `@@ -${hunk.oldStart + 1},${hunk.oldLines} +${hunk.newStart + 1},${hunk.newLines} @@`;
|
|
187
|
-
lines.push(color ? a.cyan(hunkHeader) : hunkHeader);
|
|
188
|
-
for (const line of hunk.lines) {
|
|
189
|
-
let lineStr = line.content;
|
|
190
|
-
if (line.type === "add") {
|
|
191
|
-
if (color)
|
|
192
|
-
lineStr = a.green(`+${line.content}`);
|
|
193
|
-
else lineStr = `+${line.content}`;
|
|
194
|
-
} else if (line.type === "remove") {
|
|
195
|
-
if (color)
|
|
196
|
-
lineStr = a.red(`-${line.content}`);
|
|
197
|
-
else lineStr = `-${line.content}`;
|
|
198
|
-
} else {
|
|
199
|
-
lineStr = ` ${line.content}`;
|
|
200
|
-
}
|
|
201
|
-
if (lineNumbers) {
|
|
202
|
-
const oldNum = line.oldLineNumber?.toString().padStart(4, " ") ?? " ";
|
|
203
|
-
const newNum = line.newLineNumber?.toString().padStart(4, " ") ?? " ";
|
|
204
|
-
const numPrefix = color ? a.dim(`${oldNum} ${newNum} \u2502`) : `${oldNum} ${newNum} \u2502`;
|
|
205
|
-
lines.push(`${numPrefix}${lineStr}`);
|
|
206
|
-
} else {
|
|
207
|
-
lines.push(lineStr);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return lines.join("\n");
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function hashContent(content) {
|
|
215
|
-
return createHash("sha256").update(content).digest("hex");
|
|
216
|
-
}
|
|
217
|
-
function readFileContentIfExists(path) {
|
|
218
|
-
if (!existsSync(path)) {
|
|
219
|
-
return "";
|
|
220
|
-
}
|
|
221
|
-
try {
|
|
222
|
-
return readFileSync(path, "utf-8");
|
|
223
|
-
} catch {
|
|
224
|
-
return "";
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
function getPlanRisk(changes) {
|
|
228
|
-
if (changes.some((change) => change.risk === "dangerous")) {
|
|
229
|
-
return "dangerous";
|
|
230
|
-
}
|
|
231
|
-
if (changes.some((change) => change.risk === "medium")) {
|
|
232
|
-
return "medium";
|
|
233
|
-
}
|
|
234
|
-
return "safe";
|
|
235
|
-
}
|
|
236
|
-
function createFileChange(input) {
|
|
237
|
-
const beforeExists = existsSync(input.file);
|
|
238
|
-
const beforeContent = input.beforeContent ?? readFileContentIfExists(input.file);
|
|
239
|
-
const afterContent = input.afterContent;
|
|
240
|
-
return {
|
|
241
|
-
id: randomUUID(),
|
|
242
|
-
target: input.target,
|
|
243
|
-
file: input.file,
|
|
244
|
-
operation: input.operation,
|
|
245
|
-
risk: input.risk,
|
|
246
|
-
reason: input.reason,
|
|
247
|
-
beforeHash: hashContent(beforeContent),
|
|
248
|
-
afterHash: hashContent(afterContent),
|
|
249
|
-
beforeExists,
|
|
250
|
-
reversible: true,
|
|
251
|
-
rollbackCommand: "ccjk rollback <snapshot-id>",
|
|
252
|
-
beforeContent,
|
|
253
|
-
afterContent
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
function createConfigPlan(input) {
|
|
257
|
-
return {
|
|
258
|
-
id: randomUUID(),
|
|
259
|
-
title: input.title,
|
|
260
|
-
description: input.description,
|
|
261
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
262
|
-
risk: getPlanRisk(input.changes),
|
|
263
|
-
requiresApproval: input.requiresApproval ?? false,
|
|
264
|
-
changes: input.changes
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
function hasConfigChange(change) {
|
|
268
|
-
return change.beforeHash !== change.afterHash;
|
|
269
|
-
}
|
|
270
|
-
function getChangedConfigChanges(plan) {
|
|
271
|
-
return plan.changes.filter(hasConfigChange);
|
|
272
|
-
}
|
|
273
|
-
function formatConfigPlan(plan, options = {}) {
|
|
274
|
-
const { color = true, includeDiff = true } = options;
|
|
275
|
-
const changed = getChangedConfigChanges(plan);
|
|
276
|
-
const lines = [];
|
|
277
|
-
const riskLabel = color ? colorRisk(plan.risk) : plan.risk;
|
|
278
|
-
lines.push(color ? a.bold.cyan("Configuration Plan") : "Configuration Plan");
|
|
279
|
-
lines.push(`Plan: ${plan.title}`);
|
|
280
|
-
if (plan.description) {
|
|
281
|
-
lines.push(`Reason: ${plan.description}`);
|
|
282
|
-
}
|
|
283
|
-
lines.push(`Risk: ${riskLabel}`);
|
|
284
|
-
lines.push(`Changes: ${changed.length}/${plan.changes.length}`);
|
|
285
|
-
for (const change of plan.changes) {
|
|
286
|
-
const status = hasConfigChange(change) ? "change" : "no-op";
|
|
287
|
-
const target = color ? a.green(change.target) : change.target;
|
|
288
|
-
const statusText = color && status === "change" ? a.yellow(status) : status;
|
|
289
|
-
lines.push("");
|
|
290
|
-
lines.push(`${statusText}: ${target} ${change.operation}`);
|
|
291
|
-
lines.push(` File: ${change.file}`);
|
|
292
|
-
lines.push(` Why: ${change.reason}`);
|
|
293
|
-
if (includeDiff && hasConfigChange(change) && change.beforeContent !== void 0 && change.afterContent !== void 0) {
|
|
294
|
-
const diff = generateDiff(change.beforeContent, change.afterContent, 3);
|
|
295
|
-
if (diff.hasChanges) {
|
|
296
|
-
lines.push(formatDiff(diff, change.file, { color, lineNumbers: false }));
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
return lines.join("\n");
|
|
301
|
-
}
|
|
302
|
-
function applyConfigPlan(plan, options = {}) {
|
|
303
|
-
const changed = getChangedConfigChanges(plan);
|
|
304
|
-
const skippedChanges = plan.changes.filter((change) => !hasConfigChange(change));
|
|
305
|
-
let snapshotId;
|
|
306
|
-
let snapshotPath;
|
|
307
|
-
if (options.createSnapshot !== false && changed.length > 0) {
|
|
308
|
-
const snapshot = createConfigSnapshot(plan);
|
|
309
|
-
snapshotId = snapshot.id;
|
|
310
|
-
snapshotPath = snapshot.path;
|
|
311
|
-
}
|
|
312
|
-
for (const change of changed) {
|
|
313
|
-
if (change.operation === "delete-file") {
|
|
314
|
-
continue;
|
|
315
|
-
}
|
|
316
|
-
if (change.afterContent === void 0) {
|
|
317
|
-
throw new Error(`Missing afterContent for config change: ${change.file}`);
|
|
318
|
-
}
|
|
319
|
-
ensureDir(dirname(change.file));
|
|
320
|
-
writeFileAtomic(change.file, change.afterContent);
|
|
321
|
-
}
|
|
322
|
-
return {
|
|
323
|
-
appliedChanges: changed,
|
|
324
|
-
skippedChanges,
|
|
325
|
-
snapshotId,
|
|
326
|
-
snapshotPath
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
function colorRisk(risk) {
|
|
330
|
-
if (risk === "dangerous") {
|
|
331
|
-
return a.red(risk);
|
|
332
|
-
}
|
|
333
|
-
if (risk === "medium") {
|
|
334
|
-
return a.yellow(risk);
|
|
335
|
-
}
|
|
336
|
-
return a.green(risk);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
function isZeroConfigCodeTool(value) {
|
|
340
|
-
return value === "claude-code" || value === "clavue" || value === "codex";
|
|
341
|
-
}
|
|
342
|
-
const MAX_PRESET = {
|
|
343
|
-
id: "max",
|
|
344
|
-
name: "Maximum Permissions",
|
|
345
|
-
description: "All common commands, file operations, and MCP servers",
|
|
346
|
-
permissions: [
|
|
347
|
-
"Bash(*)",
|
|
348
|
-
"Bash(sips *)",
|
|
349
|
-
// Package managers
|
|
350
|
-
"Bash(pnpm *)",
|
|
351
|
-
"Bash(npm *)",
|
|
352
|
-
"Bash(npx *)",
|
|
353
|
-
"Bash(NODE_ENV=* pnpm *)",
|
|
354
|
-
"Bash(yarn *)",
|
|
355
|
-
"Bash(bun *)",
|
|
356
|
-
"Bash(deno *)",
|
|
357
|
-
// Version control
|
|
358
|
-
"Bash(git *)",
|
|
359
|
-
// Build tools
|
|
360
|
-
"Bash(make *)",
|
|
361
|
-
"Bash(cmake *)",
|
|
362
|
-
"Bash(cargo *)",
|
|
363
|
-
"Bash(go *)",
|
|
364
|
-
"Bash(rustc *)",
|
|
365
|
-
// Container tools
|
|
366
|
-
"Bash(docker *)",
|
|
367
|
-
"Bash(docker-compose *)",
|
|
368
|
-
"Bash(podman *)",
|
|
369
|
-
// Programming languages
|
|
370
|
-
"Bash(python *)",
|
|
371
|
-
"Bash(python3 *)",
|
|
372
|
-
"Bash(node *)",
|
|
373
|
-
"Bash(ruby *)",
|
|
374
|
-
"Bash(php *)",
|
|
375
|
-
"Bash(java *)",
|
|
376
|
-
"Bash(javac *)",
|
|
377
|
-
// Shell utilities
|
|
378
|
-
"Bash(which *)",
|
|
379
|
-
"Bash(cat *)",
|
|
380
|
-
"Bash(ls *)",
|
|
381
|
-
"Bash(echo *)",
|
|
382
|
-
"Bash(grep *)",
|
|
383
|
-
"Bash(find *)",
|
|
384
|
-
"Bash(head *)",
|
|
385
|
-
"Bash(tail *)",
|
|
386
|
-
"Bash(wc *)",
|
|
387
|
-
"Bash(sort *)",
|
|
388
|
-
"Bash(uniq *)",
|
|
389
|
-
"Bash(cut *)",
|
|
390
|
-
"Bash(sed *)",
|
|
391
|
-
"Bash(awk *)",
|
|
392
|
-
"Bash(tr *)",
|
|
393
|
-
"Bash(xargs *)",
|
|
394
|
-
// File operations
|
|
395
|
-
"Bash(mkdir *)",
|
|
396
|
-
"Bash(touch *)",
|
|
397
|
-
"Bash(cp *)",
|
|
398
|
-
"Bash(mv *)",
|
|
399
|
-
"Bash(chmod *)",
|
|
400
|
-
"Bash(chown *)",
|
|
401
|
-
"Bash(ln *)",
|
|
402
|
-
// Network tools
|
|
403
|
-
"Bash(curl *)",
|
|
404
|
-
"Bash(wget *)",
|
|
405
|
-
"Bash(ping *)",
|
|
406
|
-
"Bash(netstat *)",
|
|
407
|
-
"Bash(ss *)",
|
|
408
|
-
// System info
|
|
409
|
-
"Bash(ps *)",
|
|
410
|
-
"Bash(top *)",
|
|
411
|
-
"Bash(htop *)",
|
|
412
|
-
"Bash(df *)",
|
|
413
|
-
"Bash(du *)",
|
|
414
|
-
"Bash(free *)",
|
|
415
|
-
"Bash(uname *)",
|
|
416
|
-
// Text editors
|
|
417
|
-
"Bash(vim *)",
|
|
418
|
-
"Bash(nano *)",
|
|
419
|
-
"Bash(emacs *)",
|
|
420
|
-
"Bash(code *)",
|
|
421
|
-
// Compression
|
|
422
|
-
"Bash(tar *)",
|
|
423
|
-
"Bash(gzip *)",
|
|
424
|
-
"Bash(gunzip *)",
|
|
425
|
-
"Bash(zip *)",
|
|
426
|
-
"Bash(unzip *)",
|
|
427
|
-
// Package managers (system)
|
|
428
|
-
"Bash(brew *)",
|
|
429
|
-
"Bash(apt *)",
|
|
430
|
-
"Bash(apt-get *)",
|
|
431
|
-
"Bash(yum *)",
|
|
432
|
-
"Bash(dnf *)",
|
|
433
|
-
"Bash(pacman *)",
|
|
434
|
-
// File operations (Claude Code tools)
|
|
435
|
-
"Read(*)",
|
|
436
|
-
"Edit(*)",
|
|
437
|
-
"Write(*)",
|
|
438
|
-
"NotebookEdit(*)",
|
|
439
|
-
// Web access
|
|
440
|
-
"WebFetch(*)",
|
|
441
|
-
// MCP servers (wildcard for all)
|
|
442
|
-
"MCP(*)"
|
|
443
|
-
],
|
|
444
|
-
env: {
|
|
445
|
-
ANTHROPIC_MODEL: "",
|
|
446
|
-
ANTHROPIC_DEFAULT_HAIKU_MODEL: "",
|
|
447
|
-
ANTHROPIC_DEFAULT_SONNET_MODEL: "",
|
|
448
|
-
ANTHROPIC_DEFAULT_OPUS_MODEL: ""
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
const DEV_PRESET = {
|
|
452
|
-
id: "dev",
|
|
453
|
-
name: "Developer Preset",
|
|
454
|
-
description: "Build tools, git, package managers, and file operations",
|
|
455
|
-
permissions: [
|
|
456
|
-
"Bash(*)",
|
|
457
|
-
"Bash(sips *)",
|
|
458
|
-
// Package managers
|
|
459
|
-
"Bash(pnpm *)",
|
|
460
|
-
"Bash(npm *)",
|
|
461
|
-
"Bash(npx *)",
|
|
462
|
-
"Bash(NODE_ENV=* pnpm *)",
|
|
463
|
-
"Bash(yarn *)",
|
|
464
|
-
"Bash(bun *)",
|
|
465
|
-
// Version control
|
|
466
|
-
"Bash(git *)",
|
|
467
|
-
// Build tools
|
|
468
|
-
"Bash(make *)",
|
|
469
|
-
"Bash(cargo *)",
|
|
470
|
-
"Bash(go *)",
|
|
471
|
-
// Programming languages
|
|
472
|
-
"Bash(python *)",
|
|
473
|
-
"Bash(python3 *)",
|
|
474
|
-
"Bash(node *)",
|
|
475
|
-
// Shell utilities
|
|
476
|
-
"Bash(which *)",
|
|
477
|
-
"Bash(cat *)",
|
|
478
|
-
"Bash(ls *)",
|
|
479
|
-
"Bash(echo *)",
|
|
480
|
-
"Bash(grep *)",
|
|
481
|
-
"Bash(find *)",
|
|
482
|
-
"Bash(head *)",
|
|
483
|
-
"Bash(tail *)",
|
|
484
|
-
"Bash(wc *)",
|
|
485
|
-
"Bash(sort *)",
|
|
486
|
-
// File operations
|
|
487
|
-
"Bash(mkdir *)",
|
|
488
|
-
"Bash(touch *)",
|
|
489
|
-
"Bash(cp *)",
|
|
490
|
-
"Bash(mv *)",
|
|
491
|
-
"Bash(chmod *)",
|
|
492
|
-
// File operations (Claude Code tools)
|
|
493
|
-
"Read(*)",
|
|
494
|
-
"Edit(*)",
|
|
495
|
-
"Write(*)",
|
|
496
|
-
"NotebookEdit(*)",
|
|
497
|
-
// Web access for docs
|
|
498
|
-
"WebFetch(*)"
|
|
499
|
-
],
|
|
500
|
-
env: {
|
|
501
|
-
ANTHROPIC_MODEL: ""
|
|
502
|
-
}
|
|
503
|
-
};
|
|
504
|
-
const SAFE_PRESET = {
|
|
505
|
-
id: "safe",
|
|
506
|
-
name: "Safe Preset",
|
|
507
|
-
description: "Read-only commands, no file modifications",
|
|
508
|
-
permissions: [
|
|
509
|
-
// Read-only shell utilities
|
|
510
|
-
"Bash(which *)",
|
|
511
|
-
"Bash(cat *)",
|
|
512
|
-
"Bash(ls *)",
|
|
513
|
-
"Bash(echo *)",
|
|
514
|
-
"Bash(grep *)",
|
|
515
|
-
"Bash(find *)",
|
|
516
|
-
"Bash(head *)",
|
|
517
|
-
"Bash(tail *)",
|
|
518
|
-
"Bash(wc *)",
|
|
519
|
-
"Bash(sort *)",
|
|
520
|
-
"Bash(uniq *)",
|
|
521
|
-
"Bash(cut *)",
|
|
522
|
-
// System info (read-only)
|
|
523
|
-
"Bash(ps *)",
|
|
524
|
-
"Bash(df *)",
|
|
525
|
-
"Bash(du *)",
|
|
526
|
-
"Bash(uname *)",
|
|
527
|
-
// Git read operations
|
|
528
|
-
"Bash(git status *)",
|
|
529
|
-
"Bash(git log *)",
|
|
530
|
-
"Bash(git diff *)",
|
|
531
|
-
"Bash(git show *)",
|
|
532
|
-
"Bash(git branch *)",
|
|
533
|
-
// File operations (read-only)
|
|
534
|
-
"Read(*)",
|
|
535
|
-
// Web access
|
|
536
|
-
"WebFetch(*)"
|
|
537
|
-
]
|
|
538
|
-
};
|
|
539
|
-
const PRESETS = [MAX_PRESET, DEV_PRESET, SAFE_PRESET];
|
|
540
|
-
function getArchetypeProfile(archetype = "pc-dev") {
|
|
541
|
-
switch (archetype) {
|
|
542
|
-
case "app-dev":
|
|
543
|
-
return {
|
|
544
|
-
id: "app-dev",
|
|
545
|
-
name: "Application Development",
|
|
546
|
-
goal: "Plan, build, verify, and ship application features with a product-focused workflow"
|
|
547
|
-
};
|
|
548
|
-
case "text-studio":
|
|
549
|
-
return {
|
|
550
|
-
id: "text-studio",
|
|
551
|
-
name: "Text Studio",
|
|
552
|
-
goal: "Research, draft, edit, and review text-heavy work with a documentation-first workflow"
|
|
553
|
-
};
|
|
554
|
-
case "service-ops":
|
|
555
|
-
return {
|
|
556
|
-
id: "service-ops",
|
|
557
|
-
name: "Service Operations",
|
|
558
|
-
goal: "Inspect, operate, and maintain services safely with verification and controlled changes"
|
|
559
|
-
};
|
|
560
|
-
case "research":
|
|
561
|
-
return {
|
|
562
|
-
id: "research",
|
|
563
|
-
name: "Research and Analysis",
|
|
564
|
-
goal: "Investigate code, docs, and technical options before applying targeted changes"
|
|
565
|
-
};
|
|
566
|
-
case "automation":
|
|
567
|
-
return {
|
|
568
|
-
id: "automation",
|
|
569
|
-
name: "Automation and Scripting",
|
|
570
|
-
goal: "Automate repetitive development and operations tasks with reliable execution flows"
|
|
571
|
-
};
|
|
572
|
-
case "custom":
|
|
573
|
-
return {
|
|
574
|
-
id: "custom",
|
|
575
|
-
name: "Custom Workflow",
|
|
576
|
-
goal: "Adapt CCJK to a custom working style and toolchain combination"
|
|
577
|
-
};
|
|
578
|
-
case "pc-dev":
|
|
579
|
-
default:
|
|
580
|
-
return {
|
|
581
|
-
id: "pc-dev",
|
|
582
|
-
name: "PC Software Development",
|
|
583
|
-
goal: "Build, debug, test, and ship software efficiently"
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
function getCapabilityProfile(archetype = "pc-dev") {
|
|
588
|
-
return {
|
|
589
|
-
coding: archetype !== "text-studio" && archetype !== "research",
|
|
590
|
-
planning: true,
|
|
591
|
-
taskTracking: true,
|
|
592
|
-
memory: true,
|
|
593
|
-
browserAutomation: false,
|
|
594
|
-
research: true,
|
|
595
|
-
documentAuthoring: archetype === "text-studio" || archetype === "research",
|
|
596
|
-
serviceOps: archetype === "service-ops",
|
|
597
|
-
multiAgent: archetype !== "custom"
|
|
598
|
-
};
|
|
599
|
-
}
|
|
600
|
-
function getOperatorMode(archetype = "pc-dev") {
|
|
601
|
-
if (archetype === "research" || archetype === "text-studio") {
|
|
602
|
-
return "planning-first";
|
|
603
|
-
}
|
|
604
|
-
if (archetype === "custom") {
|
|
605
|
-
return "conversational";
|
|
606
|
-
}
|
|
607
|
-
return "execution-first";
|
|
608
|
-
}
|
|
609
|
-
function loadCurrentSettings(target = resolveClaudeFamilySettingsTarget()) {
|
|
610
|
-
if (!existsSync(target.settingsFile)) {
|
|
611
|
-
return {};
|
|
612
|
-
}
|
|
613
|
-
try {
|
|
614
|
-
const content = readFileSync(target.settingsFile, "utf-8");
|
|
615
|
-
return JSON.parse(content);
|
|
616
|
-
} catch {
|
|
617
|
-
return {};
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
function stringifySettings(settings) {
|
|
621
|
-
normalizeClaudeFamilySettings(settings);
|
|
622
|
-
return JSON.stringify(settings, null, 2);
|
|
623
|
-
}
|
|
624
|
-
function applyPreset(preset, currentSettings) {
|
|
625
|
-
const newSettings = structuredClone(currentSettings || {});
|
|
626
|
-
if (!newSettings.permissions) {
|
|
627
|
-
newSettings.permissions = { allow: [] };
|
|
628
|
-
}
|
|
629
|
-
const existingPermissions = Array.isArray(newSettings.permissions.allow) ? newSettings.permissions.allow.filter((permission) => typeof permission === "string") : [];
|
|
630
|
-
newSettings.permissions.allow = [
|
|
631
|
-
...existingPermissions,
|
|
632
|
-
...preset.permissions.filter((permission) => !existingPermissions.includes(permission))
|
|
633
|
-
];
|
|
634
|
-
if (preset.id === "dev" || preset.id === "max") {
|
|
635
|
-
applyTrustedOperatorPermissions(newSettings);
|
|
636
|
-
}
|
|
637
|
-
if (preset.env) {
|
|
638
|
-
newSettings.env = { ...newSettings.env };
|
|
639
|
-
for (const [key, value] of Object.entries(preset.env)) {
|
|
640
|
-
if (value === "") {
|
|
641
|
-
continue;
|
|
642
|
-
}
|
|
643
|
-
if (newSettings.env[key] === void 0 || newSettings.env[key] === "") {
|
|
644
|
-
newSettings.env[key] = value;
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
return newSettings;
|
|
649
|
-
}
|
|
650
|
-
function buildAdaptationPresetUpdates(preset, archetype = "pc-dev") {
|
|
651
|
-
const safetyLevel = preset.id === "safe" ? "safe" : preset.id === "max" ? "max" : "dev";
|
|
652
|
-
return {
|
|
653
|
-
codex: {
|
|
654
|
-
goalsFeatureEnabled: true
|
|
655
|
-
},
|
|
656
|
-
adaptation: {
|
|
657
|
-
archetypeProfile: getArchetypeProfile(archetype),
|
|
658
|
-
capabilityProfile: getCapabilityProfile(archetype),
|
|
659
|
-
policyProfile: {
|
|
660
|
-
permissionPreset: safetyLevel,
|
|
661
|
-
verificationMode: safetyLevel === "safe" ? "manual" : "required",
|
|
662
|
-
destructiveActionPolicy: safetyLevel === "max" ? "confirm" : "confirm",
|
|
663
|
-
workflowFallbackMode: "graceful"
|
|
664
|
-
},
|
|
665
|
-
contextProfile: {
|
|
666
|
-
memoryMode: archetype === "custom" ? "session-only" : "project-aware",
|
|
667
|
-
compressionMode: "runtime-native",
|
|
668
|
-
instructionLayering: "runtime-first"
|
|
669
|
-
},
|
|
670
|
-
profileSelection: {
|
|
671
|
-
workflowPack: archetype === "service-ops" ? "service-operations" : "desktop-engineering",
|
|
672
|
-
toolPack: archetype === "text-studio" ? "document-authoring" : "typescript-node-react"
|
|
673
|
-
},
|
|
674
|
-
uiProfile: {
|
|
675
|
-
language: i18n.language === "zh-CN" ? "zh-CN" : "en",
|
|
676
|
-
outputStyle: "concise",
|
|
677
|
-
operatorMode: getOperatorMode(archetype)
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
function createZeroConfigPlan(preset, target, codeTool, currentSettings, archetype = "pc-dev") {
|
|
683
|
-
const adaptationUpdates = buildAdaptationPresetUpdates(preset, archetype);
|
|
684
|
-
const nextToml = buildUpdatedTomlConfig(ZCF_CONFIG_FILE, adaptationUpdates);
|
|
685
|
-
const nextTomlContent = stringifyTomlConfig(nextToml);
|
|
686
|
-
const changes = [];
|
|
687
|
-
if (target) {
|
|
688
|
-
const nextSettings = applyPreset(preset, currentSettings);
|
|
689
|
-
const nextSettingsContent = stringifySettings(nextSettings);
|
|
690
|
-
changes.push(
|
|
691
|
-
createFileChange({
|
|
692
|
-
target: target.codeTool,
|
|
693
|
-
file: target.settingsFile,
|
|
694
|
-
operation: existsSync(target.settingsFile) ? "merge-json" : "create-file",
|
|
695
|
-
risk: preset.id === "max" ? "medium" : "safe",
|
|
696
|
-
reason: `Merge ${preset.name} permissions into ${target.displayName} settings.`,
|
|
697
|
-
afterContent: nextSettingsContent
|
|
698
|
-
})
|
|
699
|
-
);
|
|
700
|
-
}
|
|
701
|
-
if (codeTool === "codex") {
|
|
702
|
-
const currentCodexContent = existsSync(CODEX_CONFIG_FILE) ? readFileSync(CODEX_CONFIG_FILE, "utf-8") : "";
|
|
703
|
-
const nextCodexContent = buildCodexGoalsFeatureConfigContent(currentCodexContent);
|
|
704
|
-
changes.push(
|
|
705
|
-
createFileChange({
|
|
706
|
-
target: "codex",
|
|
707
|
-
file: CODEX_CONFIG_FILE,
|
|
708
|
-
operation: existsSync(CODEX_CONFIG_FILE) ? "merge-toml" : "create-file",
|
|
709
|
-
risk: "safe",
|
|
710
|
-
reason: "Enable Codex native /goal support for planning and task-tracking workflows.",
|
|
711
|
-
beforeContent: currentCodexContent,
|
|
712
|
-
afterContent: nextCodexContent
|
|
713
|
-
})
|
|
714
|
-
);
|
|
715
|
-
}
|
|
716
|
-
changes.push(
|
|
717
|
-
createFileChange({
|
|
718
|
-
target: "ccjk",
|
|
719
|
-
file: ZCF_CONFIG_FILE,
|
|
720
|
-
operation: existsSync(ZCF_CONFIG_FILE) ? "merge-toml" : "create-file",
|
|
721
|
-
risk: "safe",
|
|
722
|
-
reason: "Record the selected zero-config product profile and runtime-native goal support for future diagnostics.",
|
|
723
|
-
afterContent: nextTomlContent
|
|
724
|
-
})
|
|
725
|
-
);
|
|
726
|
-
return createConfigPlan({
|
|
727
|
-
title: `Apply zero-config preset: ${preset.name}`,
|
|
728
|
-
description: `Configure ${codeTool === "codex" ? "Codex" : target?.displayName} with the ${getArchetypeProfile(archetype).name} product profile.`,
|
|
729
|
-
changes
|
|
730
|
-
});
|
|
731
|
-
}
|
|
732
|
-
function showPresetDiff(preset, currentSettings) {
|
|
733
|
-
const isZh = i18n.language === "zh-CN";
|
|
734
|
-
const currentPermissions = new Set(currentSettings.permissions?.allow || []);
|
|
735
|
-
const newPermissions = preset.permissions.filter((p) => !currentPermissions.has(p));
|
|
736
|
-
console.log("");
|
|
737
|
-
console.log(a.bold.cyan(isZh ? "\u{1F4CB} \u9884\u8BBE\u8BE6\u60C5" : "\u{1F4CB} Preset Details"));
|
|
738
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
739
|
-
console.log(`${a.green("Name:")} ${preset.name}`);
|
|
740
|
-
console.log(`${a.green("Description:")} ${preset.description}`);
|
|
741
|
-
console.log("");
|
|
742
|
-
if (newPermissions.length > 0) {
|
|
743
|
-
console.log(a.bold.yellow(isZh ? "\u2728 \u5C06\u6DFB\u52A0\u7684\u6743\u9650:" : "\u2728 Permissions to be added:"));
|
|
744
|
-
console.log(a.dim(` ${isZh ? "\u603B\u8BA1" : "Total"}: ${newPermissions.length} ${isZh ? "\u9879" : "items"}`));
|
|
745
|
-
const bashPerms = newPermissions.filter((p) => p.startsWith("Bash("));
|
|
746
|
-
const filePerms = newPermissions.filter((p) => ["Read", "Edit", "Write", "NotebookEdit"].some((t) => p.startsWith(t)));
|
|
747
|
-
const otherPerms = newPermissions.filter((p) => !bashPerms.includes(p) && !filePerms.includes(p));
|
|
748
|
-
if (bashPerms.length > 0) {
|
|
749
|
-
console.log(` ${a.cyan("Bash:")} ${bashPerms.length} ${isZh ? "\u4E2A\u547D\u4EE4" : "commands"}`);
|
|
750
|
-
}
|
|
751
|
-
if (filePerms.length > 0) {
|
|
752
|
-
console.log(` ${a.cyan("File:")} ${filePerms.length} ${isZh ? "\u4E2A\u64CD\u4F5C" : "operations"}`);
|
|
753
|
-
}
|
|
754
|
-
if (otherPerms.length > 0) {
|
|
755
|
-
console.log(` ${a.cyan("Other:")} ${otherPerms.length} ${isZh ? "\u9879" : "items"}`);
|
|
756
|
-
}
|
|
757
|
-
} else {
|
|
758
|
-
console.log(a.yellow(isZh ? "\u2713 \u6240\u6709\u6743\u9650\u5DF2\u5B58\u5728" : "\u2713 All permissions already exist"));
|
|
759
|
-
}
|
|
760
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
761
|
-
console.log("");
|
|
762
|
-
}
|
|
763
|
-
async function zeroConfig(options = {}) {
|
|
764
|
-
const isZh = i18n.language === "zh-CN";
|
|
765
|
-
const requestedCodeTool = isCodeToolType(options.codeTool) ? options.codeTool : void 0;
|
|
766
|
-
const savedCodeTool = readZcfConfig()?.codeToolType;
|
|
767
|
-
const codeTool = isZeroConfigCodeTool(requestedCodeTool) ? requestedCodeTool : isZeroConfigCodeTool(savedCodeTool) ? savedCodeTool : "claude-code";
|
|
768
|
-
const target = isClaudeFamilyCodeTool(codeTool) ? resolveClaudeFamilySettingsTarget(codeTool) : null;
|
|
769
|
-
if (options.list) {
|
|
770
|
-
console.log("");
|
|
771
|
-
console.log(a.bold.cyan(isZh ? "\u{1F4E6} \u53EF\u7528\u7684\u6743\u9650\u9884\u8BBE" : "\u{1F4E6} Available Permission Presets"));
|
|
772
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
773
|
-
for (const preset of PRESETS) {
|
|
774
|
-
console.log(` ${a.green(preset.id.padEnd(8))} - ${preset.name}`);
|
|
775
|
-
console.log(` ${a.dim(" ".repeat(10))}${preset.description}`);
|
|
776
|
-
console.log(` ${a.dim(" ".repeat(10))}${preset.permissions.length} ${isZh ? "\u9879\u6743\u9650" : "permissions"}`);
|
|
777
|
-
console.log("");
|
|
778
|
-
}
|
|
779
|
-
console.log(a.dim("\u2500".repeat(60)));
|
|
780
|
-
console.log(a.gray(isZh ? "\u4F7F\u7528: npx ccjk zc --preset=<id>" : "Usage: npx ccjk zc --preset=<id>"));
|
|
781
|
-
console.log("");
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
let selectedPreset;
|
|
785
|
-
if (options.preset) {
|
|
786
|
-
selectedPreset = PRESETS.find((p) => p.id === options.preset);
|
|
787
|
-
if (!selectedPreset) {
|
|
788
|
-
console.error(a.red(isZh ? `\u9519\u8BEF: \u672A\u627E\u5230\u9884\u8BBE "${options.preset}"` : `Error: Preset "${options.preset}" not found`));
|
|
789
|
-
console.log(a.gray(isZh ? "\u4F7F\u7528 --list \u67E5\u770B\u53EF\u7528\u9884\u8BBE" : "Use --list to see available presets"));
|
|
790
|
-
return;
|
|
791
|
-
}
|
|
792
|
-
} else {
|
|
793
|
-
const { presetId } = await inquirer.prompt({
|
|
794
|
-
type: "list",
|
|
795
|
-
name: "presetId",
|
|
796
|
-
message: isZh ? "\u9009\u62E9\u6743\u9650\u9884\u8BBE:" : "Select permission preset:",
|
|
797
|
-
choices: addNumbersToChoices(
|
|
798
|
-
PRESETS.map((p) => ({
|
|
799
|
-
name: `${p.name} - ${a.gray(p.description)}`,
|
|
800
|
-
value: p.id,
|
|
801
|
-
short: p.name
|
|
802
|
-
}))
|
|
803
|
-
)
|
|
804
|
-
});
|
|
805
|
-
selectedPreset = PRESETS.find((p) => p.id === presetId);
|
|
806
|
-
if (!selectedPreset) {
|
|
807
|
-
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
808
|
-
return;
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
const currentSettings = target ? loadCurrentSettings(target) : {};
|
|
812
|
-
const plan = createZeroConfigPlan(
|
|
813
|
-
selectedPreset,
|
|
814
|
-
target,
|
|
815
|
-
codeTool,
|
|
816
|
-
currentSettings,
|
|
817
|
-
options.archetype
|
|
818
|
-
);
|
|
819
|
-
showPresetDiff(selectedPreset, currentSettings);
|
|
820
|
-
if (options.dryRun) {
|
|
821
|
-
console.log(formatConfigPlan(plan));
|
|
822
|
-
return;
|
|
823
|
-
}
|
|
824
|
-
if (!options.preset) {
|
|
825
|
-
const { confirm } = await inquirer.prompt({
|
|
826
|
-
type: "confirm",
|
|
827
|
-
name: "confirm",
|
|
828
|
-
message: isZh ? "\u786E\u8BA4\u5E94\u7528\u6B64\u9884\u8BBE?" : "Confirm applying this preset?",
|
|
829
|
-
default: true
|
|
830
|
-
});
|
|
831
|
-
if (!confirm) {
|
|
832
|
-
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
const applyResult = applyConfigPlan(plan, { createSnapshot: !options.skipBackup });
|
|
837
|
-
if (applyResult.snapshotId) {
|
|
838
|
-
console.log(a.gray(`\u2714 ${isZh ? "\u5DF2\u521B\u5EFA\u5FEB\u7167" : "Snapshot created"}: ${applyResult.snapshotId}`));
|
|
839
|
-
}
|
|
840
|
-
console.log("");
|
|
841
|
-
console.log(a.green(`\u2705 ${isZh ? "\u6743\u9650\u9884\u8BBE\u5DF2\u5E94\u7528" : "Permission preset applied"}: ${selectedPreset.name}`));
|
|
842
|
-
if (target) {
|
|
843
|
-
console.log(a.gray(` ${isZh ? "\u914D\u7F6E\u6587\u4EF6" : "Config file"}: ${target.settingsFile}`));
|
|
844
|
-
}
|
|
845
|
-
if (codeTool === "codex") {
|
|
846
|
-
console.log(a.gray(` ${isZh ? "Codex \u914D\u7F6E" : "Codex config"}: ${CODEX_CONFIG_FILE}`));
|
|
847
|
-
console.log(a.gray(` ${isZh ? "\u5DF2\u542F\u7528" : "Enabled"}: [features].goals = true`));
|
|
848
|
-
}
|
|
849
|
-
if (applyResult.snapshotId) {
|
|
850
|
-
console.log(a.gray(` ${isZh ? "\u56DE\u6EDA\u547D\u4EE4" : "Rollback"}: npx ccjk rollback ${applyResult.snapshotId}`));
|
|
851
|
-
}
|
|
852
|
-
if (target) {
|
|
853
|
-
const featureResults = await ensureClaudeFamilyCoreFeatures({
|
|
854
|
-
codeTool: target.codeTool,
|
|
855
|
-
configLang: "en",
|
|
856
|
-
installCcr: options.installCcr !== false
|
|
857
|
-
});
|
|
858
|
-
console.log(a.bold.cyan(isZh ? "\u6838\u5FC3\u529F\u80FD\u68C0\u67E5" : "Core feature check"));
|
|
859
|
-
for (const result of featureResults) {
|
|
860
|
-
const ok = result.status !== "failed";
|
|
861
|
-
const marker = ok ? a.green("\u2714") : a.red("\u2716");
|
|
862
|
-
console.log(`${marker} ${result.feature}: ${result.message}`);
|
|
863
|
-
if (result.error) {
|
|
864
|
-
console.log(a.dim(` ${result.error}`));
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
console.log("");
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
export { zeroConfig };
|