ccjk 5.2.0 → 5.2.2
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/dist/chunks/api.mjs +6 -6
- package/dist/chunks/auto-updater.mjs +80 -133
- package/dist/chunks/ccm.mjs +7 -7
- package/dist/chunks/ccr.mjs +7 -4
- package/dist/chunks/ccu.mjs +6 -6
- package/dist/chunks/check-updates.mjs +3 -3
- package/dist/chunks/claude-code-incremental-manager.mjs +38 -38
- package/dist/chunks/cloud-v5.mjs +1651 -0
- package/dist/chunks/codex.mjs +70 -70
- package/dist/chunks/commands.mjs +25 -25
- package/dist/chunks/commit.mjs +16 -16
- package/dist/chunks/config-consolidator.mjs +9 -9
- package/dist/chunks/config-switch.mjs +39 -39
- package/dist/chunks/config.mjs +5 -5
- package/dist/chunks/config2.mjs +85 -85
- package/dist/chunks/context.mjs +2 -2
- package/dist/chunks/doctor.mjs +31 -31
- package/dist/chunks/features.mjs +84 -83
- package/dist/chunks/help.mjs +116 -116
- package/dist/chunks/index4.mjs +46 -46
- package/dist/chunks/init.mjs +214 -191
- package/dist/chunks/interview.mjs +102 -102
- package/dist/chunks/manager.mjs +238 -0
- package/dist/chunks/marketplace.mjs +59 -59
- package/dist/chunks/mcp.mjs +82 -82
- package/dist/chunks/menu.mjs +441 -379
- package/dist/chunks/notification.mjs +112 -112
- package/dist/chunks/onboarding.mjs +7 -7
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/permission-manager.mjs +8 -8
- package/dist/chunks/plugin.mjs +100 -100
- package/dist/chunks/prompts.mjs +15 -15
- package/dist/chunks/providers.mjs +65 -65
- package/dist/chunks/session.mjs +83 -83
- package/dist/chunks/skills-sync.mjs +72 -72
- package/dist/chunks/skills.mjs +88 -88
- package/dist/chunks/team.mjs +6 -6
- package/dist/chunks/uninstall.mjs +35 -35
- package/dist/chunks/update.mjs +6 -6
- package/dist/chunks/upgrade-manager.mjs +4 -4
- package/dist/chunks/workflows2.mjs +13 -13
- package/dist/cli.mjs +21 -0
- package/dist/i18n/locales/en/menu.json +16 -1
- package/dist/i18n/locales/en/skills.json +29 -0
- package/dist/i18n/locales/zh-CN/menu.json +16 -1
- package/dist/i18n/locales/zh-CN/skills.json +29 -0
- package/dist/index.mjs +4 -4
- package/dist/shared/{ccjk.f40us0yY.mjs → ccjk.BiJujy5w.mjs} +4 -4
- package/dist/shared/{ccjk.CQzwtnZ1.mjs → ccjk.C_3BYaWc.mjs} +50 -50
- package/dist/shared/{ccjk.Zwx-YR_P.mjs → ccjk.DjD9Rzxq.mjs} +32 -32
- package/dist/shared/{ccjk.DtWIPt8E.mjs → ccjk.XgW1H2t3.mjs} +68 -68
- package/dist/shared/{ccjk.BlPCiSHj.mjs → ccjk.tI4PJA0c.mjs} +30 -30
- package/package.json +3 -3
package/dist/chunks/manager.mjs
CHANGED
|
@@ -821,11 +821,249 @@ ccjk workflow logs <task-id> --tail 100
|
|
|
821
821
|
`
|
|
822
822
|
};
|
|
823
823
|
|
|
824
|
+
const commitSkill = {
|
|
825
|
+
id: "commit",
|
|
826
|
+
name: {
|
|
827
|
+
"zh-CN": "\u667A\u80FD\u63D0\u4EA4",
|
|
828
|
+
"en": "Smart Commit"
|
|
829
|
+
},
|
|
830
|
+
description: {
|
|
831
|
+
"zh-CN": "\u81EA\u52A8\u5206\u6790\u4EE3\u7801\u53D8\u66F4\uFF0C\u751F\u6210\u89C4\u8303\u7684 Git \u63D0\u4EA4\u4FE1\u606F",
|
|
832
|
+
"en": "Analyze code changes and generate conventional commit messages"
|
|
833
|
+
},
|
|
834
|
+
category: "git",
|
|
835
|
+
triggers: ["/commit", "/cm"],
|
|
836
|
+
enabled: true,
|
|
837
|
+
version: "1.0.0",
|
|
838
|
+
author: "CCJK Team",
|
|
839
|
+
tags: ["git", "commit", "workflow", "daily", "conventional-commits"],
|
|
840
|
+
template: `# Smart Commit Skill
|
|
841
|
+
|
|
842
|
+
\u667A\u80FD\u5206\u6790\u4EE3\u7801\u53D8\u66F4\u5E76\u751F\u6210\u7B26\u5408 Conventional Commits \u89C4\u8303\u7684 Git \u63D0\u4EA4\u4FE1\u606F\u3002
|
|
843
|
+
|
|
844
|
+
## \u4F7F\u7528\u65B9\u6CD5
|
|
845
|
+
|
|
846
|
+
### \u5206\u6790\u5F53\u524D\u53D8\u66F4
|
|
847
|
+
\`\`\`
|
|
848
|
+
/commit
|
|
849
|
+
\`\`\`
|
|
850
|
+
|
|
851
|
+
### \u81EA\u52A8\u5E94\u7528\u63D0\u4EA4
|
|
852
|
+
\`\`\`
|
|
853
|
+
/commit --auto
|
|
854
|
+
\`\`\`
|
|
855
|
+
|
|
856
|
+
### \u81EA\u5B9A\u4E49\u8F93\u5165
|
|
857
|
+
\`\`\`
|
|
858
|
+
/commit "\u6DFB\u52A0\u7528\u6237\u8BA4\u8BC1\u529F\u80FD"
|
|
859
|
+
\`\`\`
|
|
860
|
+
|
|
861
|
+
## \u63D0\u4EA4\u7C7B\u578B
|
|
862
|
+
|
|
863
|
+
\u652F\u6301\u4EE5\u4E0B Conventional Commits \u7C7B\u578B\uFF1A
|
|
864
|
+
- \`feat\` - \u65B0\u529F\u80FD
|
|
865
|
+
- \`fix\` - \u4FEE\u590D bug
|
|
866
|
+
- \`docs\` - \u6587\u6863\u66F4\u65B0
|
|
867
|
+
- \`style\` - \u4EE3\u7801\u683C\u5F0F\u8C03\u6574
|
|
868
|
+
- \`refactor\` - \u91CD\u6784
|
|
869
|
+
- \`test\` - \u6D4B\u8BD5\u76F8\u5173
|
|
870
|
+
- \`chore\` - \u6784\u5EFA/\u5DE5\u5177\u94FE\u76F8\u5173
|
|
871
|
+
- \`perf\` - \u6027\u80FD\u4F18\u5316
|
|
872
|
+
|
|
873
|
+
## \u9009\u9879
|
|
874
|
+
|
|
875
|
+
- \`--auto\` / \`-a\` - \u81EA\u52A8\u5E94\u7528\u751F\u6210\u7684\u63D0\u4EA4\u4FE1\u606F
|
|
876
|
+
- \`--type\` / \`-t\` - \u6307\u5B9A\u63D0\u4EA4\u7C7B\u578B
|
|
877
|
+
- \`--scope\` / \`-s\` - \u6307\u5B9A\u63D0\u4EA4\u8303\u56F4
|
|
878
|
+
|
|
879
|
+
## \u793A\u4F8B
|
|
880
|
+
|
|
881
|
+
\`\`\`bash
|
|
882
|
+
/commit # \u5206\u6790\u5F53\u524D\u53D8\u66F4
|
|
883
|
+
/cm --auto # \u81EA\u52A8\u751F\u6210\u5E76\u63D0\u4EA4
|
|
884
|
+
/cm -t feat -s api # \u6307\u5B9A\u7C7B\u578B\u548C\u8303\u56F4
|
|
885
|
+
/cm "\u6DFB\u52A0\u767B\u5F55\u529F\u80FD" # \u4F7F\u7528\u81EA\u5B9A\u4E49\u63CF\u8FF0
|
|
886
|
+
\`\`\`
|
|
887
|
+
|
|
888
|
+
## Claude Code \u7528\u6CD5
|
|
889
|
+
|
|
890
|
+
\`\`\`
|
|
891
|
+
\u4F7F\u7528 /commit \u6280\u80FD\u5206\u6790\u6211\u7684\u4EE3\u7801\u53D8\u66F4\uFF0C\u751F\u6210\u4E00\u4E2A\u89C4\u8303\u7684 Git \u63D0\u4EA4\u4FE1\u606F\u3002
|
|
892
|
+
\`\`\`
|
|
893
|
+
`
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
const debugSkill = {
|
|
897
|
+
id: "debug",
|
|
898
|
+
name: {
|
|
899
|
+
"zh-CN": "\u95EE\u9898\u8BCA\u65AD",
|
|
900
|
+
"en": "Debug Assistant"
|
|
901
|
+
},
|
|
902
|
+
description: {
|
|
903
|
+
"zh-CN": "\u667A\u80FD\u5206\u6790\u9519\u8BEF\u4FE1\u606F\uFF0C\u8BCA\u65AD\u95EE\u9898\u6839\u56E0\u5E76\u63D0\u4F9B\u4FEE\u590D\u65B9\u6848",
|
|
904
|
+
"en": "Intelligently analyze errors, diagnose root causes and provide fix suggestions"
|
|
905
|
+
},
|
|
906
|
+
category: "dev",
|
|
907
|
+
triggers: ["/debug", "/db"],
|
|
908
|
+
enabled: true,
|
|
909
|
+
version: "1.0.0",
|
|
910
|
+
author: "CCJK Team",
|
|
911
|
+
tags: ["debug", "error", "fix", "troubleshooting", "daily"],
|
|
912
|
+
template: `# Debug Assistant Skill
|
|
913
|
+
|
|
914
|
+
\u667A\u80FD\u5206\u6790\u9519\u8BEF\u4FE1\u606F\uFF0C\u8BCA\u65AD\u95EE\u9898\u6839\u56E0\uFF0C\u63D0\u4F9B\u4FEE\u590D\u65B9\u6848\u548C\u9884\u9632\u63AA\u65BD\u3002
|
|
915
|
+
|
|
916
|
+
## \u4F7F\u7528\u65B9\u6CD5
|
|
917
|
+
|
|
918
|
+
### \u5206\u6790\u6700\u8FD1\u7684\u9519\u8BEF
|
|
919
|
+
\`\`\`
|
|
920
|
+
/debug
|
|
921
|
+
\`\`\`
|
|
922
|
+
|
|
923
|
+
### \u8BCA\u65AD\u7279\u5B9A\u9519\u8BEF
|
|
924
|
+
\`\`\`
|
|
925
|
+
/debug "TypeError: Cannot read property 'x' of undefined"
|
|
926
|
+
\`\`\`
|
|
927
|
+
|
|
928
|
+
### \u81EA\u52A8\u4FEE\u590D\u5E38\u89C1\u95EE\u9898
|
|
929
|
+
\`\`\`
|
|
930
|
+
/debug --auto
|
|
931
|
+
\`\`\`
|
|
932
|
+
|
|
933
|
+
### \u5206\u6790\u9519\u8BEF\u65E5\u5FD7
|
|
934
|
+
\`\`\`
|
|
935
|
+
/debug --last
|
|
936
|
+
\`\`\`
|
|
937
|
+
|
|
938
|
+
## \u652F\u6301\u7684\u9519\u8BEF\u7C7B\u578B
|
|
939
|
+
|
|
940
|
+
### JavaScript/TypeScript
|
|
941
|
+
- \`TypeError\` - \u7C7B\u578B\u9519\u8BEF
|
|
942
|
+
- \`ReferenceError\` - \u5F15\u7528\u9519\u8BEF
|
|
943
|
+
- \`SyntaxError\` - \u8BED\u6CD5\u9519\u8BEF
|
|
944
|
+
- \`ModuleNotFoundError\` - \u6A21\u5757\u672A\u627E\u5230
|
|
945
|
+
|
|
946
|
+
### \u7F51\u7EDC/HTTP
|
|
947
|
+
- \`ECONNREFUSED\` - \u8FDE\u63A5\u88AB\u62D2\u7EDD
|
|
948
|
+
- \`ENOTFOUND\` - DNS \u89E3\u6790\u5931\u8D25
|
|
949
|
+
- \`404\` - \u8D44\u6E90\u672A\u627E\u5230
|
|
950
|
+
- \`500\` - \u670D\u52A1\u5668\u9519\u8BEF
|
|
951
|
+
|
|
952
|
+
### \u6743\u9650
|
|
953
|
+
- \`EACCES\` - \u6743\u9650\u62D2\u7EDD
|
|
954
|
+
- \`EPERM\` - \u64CD\u4F5C\u4E0D\u5141\u8BB8
|
|
955
|
+
|
|
956
|
+
## \u8BCA\u65AD\u8F93\u51FA
|
|
957
|
+
|
|
958
|
+
1. **\u95EE\u9898\u7C7B\u578B** - \u8BC6\u522B\u9519\u8BEF\u7C7B\u522B
|
|
959
|
+
2. **\u6839\u56E0\u5206\u6790** - \u89E3\u91CA\u95EE\u9898\u4EA7\u751F\u7684\u539F\u56E0
|
|
960
|
+
3. **\u89E3\u51B3\u65B9\u6848** - \u63D0\u4F9B\u5177\u4F53\u4FEE\u590D\u6B65\u9AA4
|
|
961
|
+
4. **\u9884\u9632\u63AA\u65BD** - \u907F\u514D\u518D\u6B21\u53D1\u751F\u7684\u5EFA\u8BAE
|
|
962
|
+
|
|
963
|
+
## Claude Code \u7528\u6CD5
|
|
964
|
+
|
|
965
|
+
\`\`\`
|
|
966
|
+
\u4F7F\u7528 /debug \u6280\u80FD\u5206\u6790\u4EE5\u4E0B\u9519\u8BEF\uFF1ATypeError: Cannot read property 'data' of undefined
|
|
967
|
+
\`\`\`
|
|
968
|
+
|
|
969
|
+
\`\`\`
|
|
970
|
+
\u4F7F\u7528 /debug \u8BCA\u65AD\u521A\u624D\u8FD0\u884C\u5931\u8D25\u7684\u539F\u56E0\uFF0C\u5E76\u7ED9\u51FA\u4FEE\u590D\u5EFA\u8BAE\u3002
|
|
971
|
+
\`\`\`
|
|
972
|
+
`
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
const reviewSkill = {
|
|
976
|
+
id: "review",
|
|
977
|
+
name: {
|
|
978
|
+
"zh-CN": "\u4EE3\u7801\u5BA1\u67E5",
|
|
979
|
+
"en": "Code Review"
|
|
980
|
+
},
|
|
981
|
+
description: {
|
|
982
|
+
"zh-CN": "\u5FEB\u901F\u5206\u6790\u4EE3\u7801\u8D28\u91CF\uFF0C\u63D0\u4F9B\u6539\u8FDB\u5EFA\u8BAE\u548C\u6700\u4F73\u5B9E\u8DF5\u6307\u5BFC",
|
|
983
|
+
"en": "Quick code quality analysis with improvement suggestions and best practices"
|
|
984
|
+
},
|
|
985
|
+
category: "review",
|
|
986
|
+
triggers: ["/review", "/rv"],
|
|
987
|
+
enabled: true,
|
|
988
|
+
version: "1.0.0",
|
|
989
|
+
author: "CCJK Team",
|
|
990
|
+
tags: ["review", "quality", "code", "daily", "best-practices"],
|
|
991
|
+
template: `# Code Review Skill
|
|
992
|
+
|
|
993
|
+
\u5BF9\u5F53\u524D\u4EE3\u7801\u8FDB\u884C\u5FEB\u901F\u8D28\u91CF\u5BA1\u67E5\uFF0C\u63D0\u4F9B\u6539\u8FDB\u5EFA\u8BAE\u548C\u6700\u4F73\u5B9E\u8DF5\u6307\u5BFC\u3002
|
|
994
|
+
|
|
995
|
+
## \u4F7F\u7528\u65B9\u6CD5
|
|
996
|
+
|
|
997
|
+
### \u5BA1\u67E5\u5F53\u524D\u6587\u4EF6
|
|
998
|
+
\`\`\`
|
|
999
|
+
/review
|
|
1000
|
+
\`\`\`
|
|
1001
|
+
|
|
1002
|
+
### \u6DF1\u5EA6\u5BA1\u67E5
|
|
1003
|
+
\`\`\`
|
|
1004
|
+
/review --deep
|
|
1005
|
+
\`\`\`
|
|
1006
|
+
|
|
1007
|
+
### \u5BA1\u67E5\u6307\u5B9A\u6587\u4EF6
|
|
1008
|
+
\`\`\`
|
|
1009
|
+
/review --file src/app.ts
|
|
1010
|
+
\`\`\`
|
|
1011
|
+
|
|
1012
|
+
### \u5173\u6CE8\u7279\u5B9A\u65B9\u9762
|
|
1013
|
+
\`\`\`
|
|
1014
|
+
/review --focus security # \u5B89\u5168\u6027\u5BA1\u67E5
|
|
1015
|
+
/review --focus performance # \u6027\u80FD\u5BA1\u67E5
|
|
1016
|
+
/review --focus maintain # \u53EF\u7EF4\u62A4\u6027\u5BA1\u67E5
|
|
1017
|
+
\`\`\`
|
|
1018
|
+
|
|
1019
|
+
## \u5BA1\u67E5\u7EF4\u5EA6
|
|
1020
|
+
|
|
1021
|
+
### \u4EE3\u7801\u8D28\u91CF
|
|
1022
|
+
- \u547D\u540D\u89C4\u8303
|
|
1023
|
+
- \u4EE3\u7801\u7ED3\u6784
|
|
1024
|
+
- \u6CE8\u91CA\u5B8C\u6574\u6027
|
|
1025
|
+
- \u9519\u8BEF\u5904\u7406
|
|
1026
|
+
|
|
1027
|
+
### \u6700\u4F73\u5B9E\u8DF5
|
|
1028
|
+
- \u8BBE\u8BA1\u6A21\u5F0F\u5E94\u7528
|
|
1029
|
+
- SOLID \u539F\u5219
|
|
1030
|
+
- DRY \u539F\u5219
|
|
1031
|
+
- \u6027\u80FD\u8003\u8651
|
|
1032
|
+
|
|
1033
|
+
### \u5B89\u5168\u6027
|
|
1034
|
+
- \u5E38\u89C1\u6F0F\u6D1E
|
|
1035
|
+
- \u8F93\u5165\u9A8C\u8BC1
|
|
1036
|
+
- \u6743\u9650\u68C0\u67E5
|
|
1037
|
+
|
|
1038
|
+
## Claude Code \u7528\u6CD5
|
|
1039
|
+
|
|
1040
|
+
\`\`\`
|
|
1041
|
+
\u4F7F\u7528 /review \u6280\u80FD\u5BF9\u5F53\u524D\u6587\u4EF6\u8FDB\u884C\u4EE3\u7801\u5BA1\u67E5\uFF0C\u91CD\u70B9\u68C0\u67E5\u5B89\u5168\u6027\u95EE\u9898\u3002
|
|
1042
|
+
\`\`\`
|
|
1043
|
+
|
|
1044
|
+
\`\`\`
|
|
1045
|
+
\u4F7F\u7528 /review \u5BF9 src/auth.ts \u8FDB\u884C\u6DF1\u5EA6\u5BA1\u67E5\uFF0C\u63D0\u4F9B\u91CD\u6784\u5EFA\u8BAE\u3002
|
|
1046
|
+
\`\`\`
|
|
1047
|
+
`
|
|
1048
|
+
};
|
|
1049
|
+
|
|
824
1050
|
const BUILTIN_SKILLS = [
|
|
1051
|
+
// 核心价值技能 (Core Daily Value Skills) - High priority, everyday use
|
|
1052
|
+
commitSkill,
|
|
1053
|
+
// /commit - 智能提交信息生成
|
|
1054
|
+
reviewSkill,
|
|
1055
|
+
// /review - 代码审查
|
|
1056
|
+
debugSkill,
|
|
1057
|
+
// /debug - 问题诊断
|
|
1058
|
+
// 技术管理技能 (Technical Management Skills) - Infrastructure
|
|
825
1059
|
cloudSyncSkill,
|
|
1060
|
+
// 云同步
|
|
826
1061
|
browserSkill,
|
|
1062
|
+
// 浏览器自动化
|
|
827
1063
|
marketplaceSkill,
|
|
1064
|
+
// 技能市场
|
|
828
1065
|
workflowSkill
|
|
1066
|
+
// 工作流
|
|
829
1067
|
];
|
|
830
1068
|
function getBuiltinSkill(id) {
|
|
831
1069
|
return BUILTIN_SKILLS.find((s) => s.id === id);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ansis__default from 'ansis';
|
|
2
2
|
import { i18n } from './index2.mjs';
|
|
3
3
|
import { g as getPackage, i as isPackageInstalled, a as getInstalledPackages, u as updatePackage, c as checkForUpdates, b as uninstallPackage, d as installPackage, s as searchPackages } from '../shared/ccjk.CGMs4Om4.mjs';
|
|
4
4
|
import 'node:fs';
|
|
@@ -18,27 +18,27 @@ import './fs-operations.mjs';
|
|
|
18
18
|
|
|
19
19
|
async function searchCommand(query, _options) {
|
|
20
20
|
try {
|
|
21
|
-
console.log(
|
|
21
|
+
console.log(ansis__default.green(i18n.t("marketplace:searching", { query })));
|
|
22
22
|
const results = await searchPackages({ query });
|
|
23
23
|
if (results.packages.length === 0) {
|
|
24
|
-
console.log(
|
|
24
|
+
console.log(ansis__default.yellow(i18n.t("marketplace:noResults")));
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
console.log(
|
|
27
|
+
console.log(ansis__default.green(i18n.t("marketplace:searchResults", { count: results.packages.length })));
|
|
28
28
|
console.log();
|
|
29
29
|
for (const pkg of results.packages) {
|
|
30
30
|
const installed = await isPackageInstalled(pkg.name);
|
|
31
|
-
const installedMark = installed ?
|
|
32
|
-
console.log(`${installedMark} ${
|
|
31
|
+
const installedMark = installed ? ansis__default.green("\u2713") : ansis__default.gray("\u25CB");
|
|
32
|
+
console.log(`${installedMark} ${ansis__default.bold(pkg.name)} ${ansis__default.gray(`v${pkg.version}`)}`);
|
|
33
33
|
console.log(` ${pkg.description.en || Object.values(pkg.description)[0]}`);
|
|
34
|
-
console.log(` ${
|
|
34
|
+
console.log(` ${ansis__default.gray(i18n.t("marketplace:packageInfo.category"))}: ${pkg.category}`);
|
|
35
35
|
if (pkg.verified === "verified") {
|
|
36
|
-
console.log(` ${
|
|
36
|
+
console.log(` ${ansis__default.green("\u2713")} ${i18n.t("marketplace:packageInfo.verified")}`);
|
|
37
37
|
}
|
|
38
38
|
console.log();
|
|
39
39
|
}
|
|
40
40
|
} catch (err) {
|
|
41
|
-
console.error(
|
|
41
|
+
console.error(ansis__default.red(i18n.t("marketplace:searchFailed")));
|
|
42
42
|
console.error(err);
|
|
43
43
|
throw err;
|
|
44
44
|
}
|
|
@@ -46,33 +46,33 @@ async function searchCommand(query, _options) {
|
|
|
46
46
|
async function installCommand(packageName, options) {
|
|
47
47
|
try {
|
|
48
48
|
if (await isPackageInstalled(packageName)) {
|
|
49
|
-
console.log(
|
|
49
|
+
console.log(ansis__default.yellow(`Package '${packageName}' is already installed`));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
const pkg = await getPackage(packageName);
|
|
53
53
|
if (!pkg) {
|
|
54
|
-
console.error(
|
|
54
|
+
console.error(ansis__default.red(i18n.t("marketplace:packageNotFound", { name: packageName })));
|
|
55
55
|
throw new Error(`Package not found: ${packageName}`);
|
|
56
56
|
}
|
|
57
|
-
console.log(
|
|
57
|
+
console.log(ansis__default.green(i18n.t("marketplace:installing", { name: packageName })));
|
|
58
58
|
const result = await installPackage(packageName, {
|
|
59
59
|
force: options.force,
|
|
60
60
|
skipVerification: options.skipVerification
|
|
61
61
|
});
|
|
62
62
|
if (result.success) {
|
|
63
|
-
console.log(
|
|
63
|
+
console.log(ansis__default.green(i18n.t("marketplace:installSuccess", { name: packageName })));
|
|
64
64
|
if (result.installedPath) {
|
|
65
|
-
console.log(
|
|
65
|
+
console.log(ansis__default.gray(`${i18n.t("marketplace:installedAt")}: ${result.installedPath}`));
|
|
66
66
|
}
|
|
67
67
|
} else {
|
|
68
|
-
console.error(
|
|
68
|
+
console.error(ansis__default.red(i18n.t("marketplace:installFailed", { name: packageName })));
|
|
69
69
|
if (result.error) {
|
|
70
|
-
console.error(
|
|
70
|
+
console.error(ansis__default.red(i18n.t("marketplace:errors.installError", { error: result.error })));
|
|
71
71
|
}
|
|
72
72
|
throw new Error(`Install failed: ${packageName}`);
|
|
73
73
|
}
|
|
74
74
|
} catch (err) {
|
|
75
|
-
console.error(
|
|
75
|
+
console.error(ansis__default.red(i18n.t("marketplace:installFailed", { name: packageName })));
|
|
76
76
|
console.error(err);
|
|
77
77
|
throw err;
|
|
78
78
|
}
|
|
@@ -80,24 +80,24 @@ async function installCommand(packageName, options) {
|
|
|
80
80
|
async function uninstallCommand(packageName, options) {
|
|
81
81
|
try {
|
|
82
82
|
if (!await isPackageInstalled(packageName)) {
|
|
83
|
-
console.error(
|
|
83
|
+
console.error(ansis__default.red(i18n.t("marketplace:packageNotInstalled", { name: packageName })));
|
|
84
84
|
throw new Error(`Package not installed: ${packageName}`);
|
|
85
85
|
}
|
|
86
|
-
console.log(
|
|
86
|
+
console.log(ansis__default.green(i18n.t("marketplace:uninstalling", { name: packageName })));
|
|
87
87
|
const result = await uninstallPackage(packageName, {
|
|
88
88
|
force: options.force
|
|
89
89
|
});
|
|
90
90
|
if (result.success) {
|
|
91
|
-
console.log(
|
|
91
|
+
console.log(ansis__default.green(i18n.t("marketplace:uninstallSuccess", { name: packageName })));
|
|
92
92
|
} else {
|
|
93
|
-
console.error(
|
|
93
|
+
console.error(ansis__default.red(i18n.t("marketplace:uninstallFailed", { name: packageName })));
|
|
94
94
|
if (result.error) {
|
|
95
|
-
console.error(
|
|
95
|
+
console.error(ansis__default.red(i18n.t("marketplace:errors.uninstallError", { error: result.error })));
|
|
96
96
|
}
|
|
97
97
|
throw new Error(`Uninstall failed: ${packageName}`);
|
|
98
98
|
}
|
|
99
99
|
} catch (err) {
|
|
100
|
-
console.error(
|
|
100
|
+
console.error(ansis__default.red(i18n.t("marketplace:uninstallFailed", { name: packageName })));
|
|
101
101
|
console.error(err);
|
|
102
102
|
throw err;
|
|
103
103
|
}
|
|
@@ -105,34 +105,34 @@ async function uninstallCommand(packageName, options) {
|
|
|
105
105
|
async function updateCommand(packageName, _options) {
|
|
106
106
|
try {
|
|
107
107
|
if (packageName) {
|
|
108
|
-
console.log(
|
|
108
|
+
console.log(ansis__default.green(i18n.t("marketplace:updating", { name: packageName })));
|
|
109
109
|
const result = await updatePackage(packageName);
|
|
110
110
|
if (result.success) {
|
|
111
|
-
console.log(
|
|
111
|
+
console.log(ansis__default.green(i18n.t("marketplace:updateSuccess", { name: packageName })));
|
|
112
112
|
} else {
|
|
113
|
-
console.error(
|
|
113
|
+
console.error(ansis__default.red(i18n.t("marketplace:updateFailed", { name: packageName })));
|
|
114
114
|
if (result.error) {
|
|
115
|
-
console.error(
|
|
115
|
+
console.error(ansis__default.red(result.error));
|
|
116
116
|
}
|
|
117
117
|
throw new Error(`Update failed: ${packageName}`);
|
|
118
118
|
}
|
|
119
119
|
} else {
|
|
120
|
-
console.log(
|
|
120
|
+
console.log(ansis__default.green(i18n.t("marketplace:checkingUpdates")));
|
|
121
121
|
const updates = await checkForUpdates();
|
|
122
122
|
if (updates.length === 0) {
|
|
123
|
-
console.log(
|
|
123
|
+
console.log(ansis__default.green(i18n.t("marketplace:noUpdates")));
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
|
-
console.log(
|
|
126
|
+
console.log(ansis__default.yellow(i18n.t("marketplace:updatesAvailable", { count: updates.length })));
|
|
127
127
|
console.log();
|
|
128
128
|
for (const update of updates) {
|
|
129
|
-
console.log(` ${
|
|
129
|
+
console.log(` ${ansis__default.bold(update.id)}: ${ansis__default.gray(update.currentVersion)} \u2192 ${ansis__default.green(update.latestVersion)}`);
|
|
130
130
|
}
|
|
131
131
|
console.log();
|
|
132
|
-
console.log(
|
|
132
|
+
console.log(ansis__default.gray(i18n.t("marketplace:updateHint")));
|
|
133
133
|
}
|
|
134
134
|
} catch (err) {
|
|
135
|
-
console.error(
|
|
135
|
+
console.error(ansis__default.red(i18n.t("marketplace:updateCheckFailed")));
|
|
136
136
|
console.error(err);
|
|
137
137
|
throw err;
|
|
138
138
|
}
|
|
@@ -141,20 +141,20 @@ async function listCommand(_options) {
|
|
|
141
141
|
try {
|
|
142
142
|
const installedList = await getInstalledPackages();
|
|
143
143
|
if (installedList.length === 0) {
|
|
144
|
-
console.log(
|
|
144
|
+
console.log(ansis__default.yellow(i18n.t("marketplace:noInstalled")));
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
console.log(
|
|
147
|
+
console.log(ansis__default.green(i18n.t("marketplace:installedPackages", { count: installedList.length })));
|
|
148
148
|
console.log();
|
|
149
149
|
for (const installed of installedList) {
|
|
150
150
|
const pkg = installed.package;
|
|
151
|
-
console.log(`${
|
|
151
|
+
console.log(`${ansis__default.green("\u2713")} ${ansis__default.bold(pkg.name)} ${ansis__default.gray(`v${pkg.version}`)}`);
|
|
152
152
|
console.log(` ${pkg.description.en || Object.values(pkg.description)[0]}`);
|
|
153
|
-
console.log(` ${
|
|
153
|
+
console.log(` ${ansis__default.gray(i18n.t("marketplace:packageInfo.category"))}: ${pkg.category}`);
|
|
154
154
|
console.log();
|
|
155
155
|
}
|
|
156
156
|
} catch (err) {
|
|
157
|
-
console.error(
|
|
157
|
+
console.error(ansis__default.red(i18n.t("marketplace:listFailed")));
|
|
158
158
|
console.error(err);
|
|
159
159
|
throw err;
|
|
160
160
|
}
|
|
@@ -163,45 +163,45 @@ async function infoCommand(packageName, _options) {
|
|
|
163
163
|
try {
|
|
164
164
|
const pkg = await getPackage(packageName);
|
|
165
165
|
if (!pkg) {
|
|
166
|
-
console.error(
|
|
166
|
+
console.error(ansis__default.red(i18n.t("marketplace:packageNotFound", { name: packageName })));
|
|
167
167
|
throw new Error(`Package not found: ${packageName}`);
|
|
168
168
|
}
|
|
169
169
|
const installed = await isPackageInstalled(packageName);
|
|
170
170
|
console.log();
|
|
171
|
-
console.log(
|
|
172
|
-
console.log(
|
|
171
|
+
console.log(ansis__default.bold.cyan(pkg.name));
|
|
172
|
+
console.log(ansis__default.gray("\u2500".repeat(50)));
|
|
173
173
|
console.log();
|
|
174
|
-
console.log(`${
|
|
175
|
-
console.log(`${
|
|
176
|
-
console.log(`${
|
|
174
|
+
console.log(`${ansis__default.bold(i18n.t("marketplace:packageInfo.description"))}: ${pkg.description.en || Object.values(pkg.description)[0]}`);
|
|
175
|
+
console.log(`${ansis__default.bold(i18n.t("marketplace:packageInfo.version"))}: ${pkg.version}`);
|
|
176
|
+
console.log(`${ansis__default.bold(i18n.t("marketplace:packageInfo.category"))}: ${pkg.category}`);
|
|
177
177
|
if (pkg.author) {
|
|
178
|
-
console.log(`${
|
|
178
|
+
console.log(`${ansis__default.bold(i18n.t("marketplace:packageInfo.author"))}: ${pkg.author}`);
|
|
179
179
|
}
|
|
180
180
|
if (pkg.license) {
|
|
181
|
-
console.log(`${
|
|
181
|
+
console.log(`${ansis__default.bold(i18n.t("marketplace:packageInfo.license"))}: ${pkg.license}`);
|
|
182
182
|
}
|
|
183
183
|
if (pkg.repository) {
|
|
184
|
-
console.log(`${
|
|
184
|
+
console.log(`${ansis__default.bold(i18n.t("marketplace:packageInfo.repository"))}: ${pkg.repository}`);
|
|
185
185
|
}
|
|
186
186
|
if (pkg.downloads !== void 0) {
|
|
187
|
-
console.log(`${
|
|
187
|
+
console.log(`${ansis__default.bold(i18n.t("marketplace:packageInfo.downloads"))}: ${pkg.downloads.toLocaleString()}`);
|
|
188
188
|
}
|
|
189
189
|
if (pkg.rating !== void 0) {
|
|
190
190
|
const stars = "\u2605".repeat(Math.round(pkg.rating));
|
|
191
191
|
const emptyStars = "\u2606".repeat(5 - Math.round(pkg.rating));
|
|
192
|
-
console.log(`${
|
|
192
|
+
console.log(`${ansis__default.bold(i18n.t("marketplace:packageInfo.rating"))}: ${ansis__default.yellow(stars)}${ansis__default.gray(emptyStars)} (${pkg.rating}/5)`);
|
|
193
193
|
}
|
|
194
194
|
if (pkg.keywords && pkg.keywords.length > 0) {
|
|
195
|
-
console.log(`${
|
|
195
|
+
console.log(`${ansis__default.bold(i18n.t("marketplace:packageInfo.keywords"))}: ${pkg.keywords.join(", ")}`);
|
|
196
196
|
}
|
|
197
197
|
if (pkg.verified === "verified") {
|
|
198
|
-
console.log(`${
|
|
198
|
+
console.log(`${ansis__default.green("\u2713")} ${i18n.t("marketplace:packageInfo.verified")}`);
|
|
199
199
|
}
|
|
200
200
|
console.log();
|
|
201
|
-
console.log(`${
|
|
201
|
+
console.log(`${ansis__default.bold("Status")}: ${installed ? ansis__default.green("Installed") : ansis__default.gray("Not installed")}`);
|
|
202
202
|
console.log();
|
|
203
203
|
} catch (err) {
|
|
204
|
-
console.error(
|
|
204
|
+
console.error(ansis__default.red(i18n.t("marketplace:infoFailed")));
|
|
205
205
|
console.error(err);
|
|
206
206
|
throw err;
|
|
207
207
|
}
|
|
@@ -209,7 +209,7 @@ async function infoCommand(packageName, _options) {
|
|
|
209
209
|
async function marketplaceMenu(action, options) {
|
|
210
210
|
const opts = options || {};
|
|
211
211
|
if (!action) {
|
|
212
|
-
console.log(
|
|
212
|
+
console.log(ansis__default.green("\n\u{1F6D2} Marketplace Commands:\n"));
|
|
213
213
|
console.log(" ccjk cloud plugins search <query> - Search packages");
|
|
214
214
|
console.log(" ccjk cloud plugins install <pkg> - Install package");
|
|
215
215
|
console.log(" ccjk cloud plugins uninstall <pkg> - Uninstall package");
|
|
@@ -226,19 +226,19 @@ async function marketplaceMenu(action, options) {
|
|
|
226
226
|
if (param)
|
|
227
227
|
await searchCommand(param);
|
|
228
228
|
else
|
|
229
|
-
console.log(
|
|
229
|
+
console.log(ansis__default.yellow("Usage: ccjk cloud plugins search <query>"));
|
|
230
230
|
break;
|
|
231
231
|
case "install":
|
|
232
232
|
if (param)
|
|
233
233
|
await installCommand(param, opts);
|
|
234
234
|
else
|
|
235
|
-
console.log(
|
|
235
|
+
console.log(ansis__default.yellow("Usage: ccjk cloud plugins install <package>"));
|
|
236
236
|
break;
|
|
237
237
|
case "uninstall":
|
|
238
238
|
if (param)
|
|
239
239
|
await uninstallCommand(param, opts);
|
|
240
240
|
else
|
|
241
|
-
console.log(
|
|
241
|
+
console.log(ansis__default.yellow("Usage: ccjk cloud plugins uninstall <package>"));
|
|
242
242
|
break;
|
|
243
243
|
case "update":
|
|
244
244
|
await updateCommand(param || void 0);
|
|
@@ -251,10 +251,10 @@ async function marketplaceMenu(action, options) {
|
|
|
251
251
|
if (param)
|
|
252
252
|
await infoCommand(param);
|
|
253
253
|
else
|
|
254
|
-
console.log(
|
|
254
|
+
console.log(ansis__default.yellow("Usage: ccjk cloud plugins info <package>"));
|
|
255
255
|
break;
|
|
256
256
|
default:
|
|
257
|
-
console.log(
|
|
257
|
+
console.log(ansis__default.yellow(`Unknown action: ${cmd}`));
|
|
258
258
|
await marketplaceMenu(void 0, opts);
|
|
259
259
|
}
|
|
260
260
|
}
|