@mcgrapeng/ccg 3.1.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,110 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(bash --version)",
5
+ "Bash(bash -c ' *)",
6
+ "Bash(bash *)",
7
+ "Bash(/bin/zsh *)",
8
+ "Bash(grep -n 'ccg_risk_score \"$CCG_DIR\\\\|99 테스트\\\\|99개\\\\|Slash command\\\\|슬래시 명령\\\\|L6 + L4\\\\|L6 \\(원장\\)\\\\|L6(' /Users/zhangpeng/workspace/liaohe/ccg/docs/ARCHITECTURE.ko.md)",
9
+ "Bash(git tag *)",
10
+ "Bash(git push *)",
11
+ "Bash(npm publish *)",
12
+ "Bash(npm whoami *)",
13
+ "Bash(git add *)",
14
+ "Bash(git commit -m 'chore: remove npm publishing — curl-only distribution *)",
15
+ "Bash(gh release *)",
16
+ "Bash(curl -fsSL https://github.com/mcgrapeng/ccg/archive/refs/tags/v3.2.0.tar.gz)",
17
+ "Bash(tar -tzf -)",
18
+ "Bash(git archive *)",
19
+ "Bash(curl -fsSL --connect-timeout 15 --max-time 30 https://cdn.jsdelivr.net/gh/mcgrapeng/ccg@v3.2.0/ccg.sh)",
20
+ "Bash(git commit -m 'fix\\(install\\): use jsdelivr CDN + single-file download for cross-region reliability *)",
21
+ "Bash(git commit -m 'docs: drop self-reflective phrasing from ARCHITECTURE *)",
22
+ "Bash(rtk ls *)",
23
+ "Bash(rtk grep *)",
24
+ "Bash(command -v svn)",
25
+ "Bash(command -v svnadmin)",
26
+ "Bash(svn --version --quiet)",
27
+ "Bash(brew --prefix subversion)",
28
+ "Bash(rtk brew *)",
29
+ "Bash(rtk read *)",
30
+ "Bash(/opt/homebrew/var/homebrew/tmp/.cellar/subversion/1.14.5_4/bin/svn --version --quiet)",
31
+ "Bash(/opt/homebrew/var/homebrew/tmp/.cellar/subversion/1.14.5_4/bin/svnadmin --version --quiet)",
32
+ "Bash(brew link *)",
33
+ "Bash(brew reinstall *)",
34
+ "Bash(PATH=\"/opt/homebrew/opt/subversion/bin:$PATH\" bash *)",
35
+ "Bash(node bin/innies.js --help)",
36
+ "Bash(awk 'NR>=1820 && NR<=1908 {print NR\": \"$0}' /Users/zhangpeng/workspace/liaohe/ccg/ccg.sh)",
37
+ "Bash(rtk wc *)",
38
+ "Read(//private/tmp/ccg-reality-test/testrepo/**)",
39
+ "Bash(rtk git *)",
40
+ "Bash(cd *)",
41
+ "Bash(awk NR>=2049 && NR<=2110 {print NR\": \"$0} *)",
42
+ "Bash(awk NR>=1980 && NR<=2025 {print NR\": \"$0} *)",
43
+ "Bash(awk NR>=1405 && NR<=1475 {print NR\": \"$0} *)",
44
+ "Bash(awk NR>=1555 && NR<=1615 {print NR\": \"$0} *)",
45
+ "Bash(/usr/bin/git log *)",
46
+ "Bash(/usr/bin/git branch *)",
47
+ "Read(//private/tmp/ccg-reality-test/testrepo2/**)",
48
+ "Bash(/usr/bin/git merge *)",
49
+ "Bash(/usr/bin/git switch *)",
50
+ "Bash(/usr/bin/git status *)",
51
+ "Bash(mktemp -d -t \"ccg.XXXXXXXX\")",
52
+ "Bash(echo \"exit=$?\")",
53
+ "Bash(grep -n \"git checkout \\\\\"\\\\$\\\\|git branch \\\\\"\\\\$\\\\|git fetch origin \\\\\"\\\\$\" /Users/zhangpeng/workspace/liaohe/ccg/ccg.sh)",
54
+ "Bash(echo \"---ec=$?---\")",
55
+ "Bash(chmod +x /Users/zhangpeng/workspace/liaohe/ccg/tests/test_ccg_round4.sh)",
56
+ "Bash(awk -F: '{print $1}')",
57
+ "Bash(echo \"EXIT: $?\")",
58
+ "Bash(chmod +x *)",
59
+ "Bash(grep -E \"^-.*\\\\.sh$\")",
60
+ "Read(//private/tmp/test-ccg/**)",
61
+ "Bash(CCG_GATE_OFFLINE=1 bash /Users/zhangpeng/workspace/liaohe/ccg/ccg.sh -c \"ccg_risk_score /tmp/test-ccg/.git/index\")",
62
+ "Bash(CCG_MODE=cost bash /Users/zhangpeng/workspace/liaohe/ccg/ccg config)",
63
+ "Bash(CCG_MODE=balanced bash /Users/zhangpeng/workspace/liaohe/ccg/ccg config)",
64
+ "Bash(CCG_MODE=quality bash /Users/zhangpeng/workspace/liaohe/ccg/ccg config)",
65
+ "Bash(rtk tree *)",
66
+ "Bash(CCG_PROVIDERS=\"claude gemini\" bash /Users/zhangpeng/workspace/liaohe/ccg/ccg config)",
67
+ "Bash(CCG_PROVIDERS=\"bailian:qwen-3.7 bailian:deepseek-v4\" bash /Users/zhangpeng/workspace/liaohe/ccg/ccg config)",
68
+ "Bash(rtk shellcheck *)",
69
+ "Bash(grep -rn -E '\\\\$\\\\{[A-Za-z_][A-Za-z0-9_]*\\(\\\\^\\\\^|,,|\\\\^|,\\)' --include=\"*.sh\" . ccg)",
70
+ "Bash(grep -rn -E '\\\\$\\\\{!' --include=\"*.sh\" . ccg)",
71
+ "Bash(echo \"\\(exit $?\\)\")",
72
+ "Bash(grep -rn -E '\\\\$\\\\{[A-Za-z_][A-Za-z0-9_]*\\\\[@\\\\]\\\\}|\\\\$\\\\{#[A-Za-z_][A-Za-z0-9_]*\\\\[@\\\\]\\\\}|\\\\+=\\\\\\(' ccg.sh ccg-multi-provider.sh ccg-bailian-models.sh ccg-bailian-integration.sh)",
73
+ "Bash(/bin/bash -c 'set -u; a=\\(\\); echo \"count=${#a[@]}\"; echo \"count-OK\"')",
74
+ "Bash(/bin/bash -c 'set -u; pids=\\(\\); if [ ${#pids[@]} -eq 0 ]; then echo \"guard-ok\"; fi; for p in \"${pids[@]}\"; do :; done; echo reached')",
75
+ "Bash(/bin/bash -c 'set -u; providers=\\(\\); for i in \"${!providers[@]}\"; do :; done; echo \"idx-OK\"')",
76
+ "Bash(echo \"\\(grep exit $?\\)\")",
77
+ "Bash(echo \"EXIT=$?\")",
78
+ "Bash(grep -E '\\\\$\\\\{[A-Za-z_]')",
79
+ "Bash(brew --prefix)",
80
+ "Bash(grep -n 'reasons=\"${reasons}')",
81
+ "Bash(grep -nE '_cec|_gec|validate_resolution|cat \\\\\"\\\\$cresult\\\\\"|cat \\\\\"\\\\$gresult\\\\\"|Codex preferred|NEEDS_HUMAN|Pick best')",
82
+ "Bash(awk '/^_ccg_resolve_one_conflict\\\\\\(\\\\\\)/{f=1} f{print NR\": \"$0} /Pick best|NEEDS_HUMAN_DECISION/{if\\(f\\)c++} f&&/^}/{print \"---END---\"; exit}')",
83
+ "Bash(/bin/bash --version)",
84
+ "Bash(/bin/bash -uc 'a=\\(\\); for x in \"${a[@]}\"; do echo \"$x\"; done; echo \"survived empty-array\"')",
85
+ "Bash(/bin/bash -uc 'a=\\(\\); for x in ${a[@]+\"${a[@]}\"}; do echo \"$x\"; done; echo \"survived guarded\"')",
86
+ "Bash(grep -nE 'reasons=\"\\\\$\\\\{reasons\\\\}')",
87
+ "Bash(grep -viE '^\\\\.\\\\.\\\\. .*PASS$')",
88
+ "Bash(grep -vE '\\\\|\\\\||return|tmp=\\\\$\\\\\\(mktemp|workdir=\\\\$\\\\\\(mktemp|\\\\\\) \\\\|\\\\|')",
89
+ "Bash(rtk find *)",
90
+ "Bash(/bin/ls *)",
91
+ "Bash(rtk proxy *)",
92
+ "Bash(echo \"\\(exit $? — grep exit 1 = no matches = good\\)\")",
93
+ "Bash(sed -n '1,13p' README.md)",
94
+ "Bash(sed -n '4,15p' package.json)",
95
+ "Bash(node -e \"const p=require\\('./package.json'\\); console.log\\('VALID JSON ✅'\\); console.log\\('keywords:', JSON.stringify\\(p.keywords\\)\\); console.log\\('description:', p.description\\);\")",
96
+ "Bash(git commit *)",
97
+ "Bash(pip3 install *)",
98
+ "Bash(git rebase *)",
99
+ "Bash(cat)",
100
+ "Bash(/tmp/fix-secret.sh)",
101
+ "mcp__memory__create_entities",
102
+ "Bash(git *)",
103
+ "Bash(npm org *)",
104
+ "Bash(npm view *)",
105
+ "Bash(npm config *)",
106
+ "Bash(npm token *)",
107
+ "Bash(NPM_TOKEN=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 npm publish *)"
108
+ ]
109
+ }
110
+ }
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="MypySettings">
4
+ <option name="arguments" value="--follow-imports silent --exclude \.pyi$" />
5
+ <option name="projectDirectory" value="$PROJECT_DIR$" />
6
+ </component>
7
+ </project>
package/.idea/ccg.iml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="jdk" jdkName="Python 3.13 (liaohe-admin)" jdkType="Python SDK" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
@@ -0,0 +1,23 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="ourVersions">
6
+ <value>
7
+ <list size="3">
8
+ <item index="0" class="java.lang.String" itemvalue="3.14" />
9
+ <item index="1" class="java.lang.String" itemvalue="3.13" />
10
+ <item index="2" class="java.lang.String" itemvalue="3.12" />
11
+ </list>
12
+ </value>
13
+ </option>
14
+ </inspection_tool>
15
+ <inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
16
+ <option name="ignoredErrors">
17
+ <list>
18
+ <option value="E262" />
19
+ </list>
20
+ </option>
21
+ </inspection_tool>
22
+ </profile>
23
+ </component>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
package/.idea/misc.xml ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="Python 3.13 (liaohe-admin)" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (liaohe-admin)" project-jdk-type="Python SDK" />
7
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/ccg.iml" filepath="$PROJECT_DIR$/.idea/ccg.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/ruff.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="RuffConfigService">
4
+ <option name="globalRuffExecutablePath" value="/Library/Frameworks/Python.framework/Versions/3.13/bin/ruff" />
5
+ </component>
6
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
package/.plan.md ADDED
@@ -0,0 +1,62 @@
1
+ # 实现计划:支持各模型提供商独立官方API配置
2
+
3
+ ## 目标
4
+
5
+ 为每个模型提供商添加独立的官方API配置支持,不与百炼平台配置冲突。
6
+
7
+ ## 环境变量设计
8
+
9
+ ### 新增环境变量
10
+
11
+ | 提供商 | API Key | Base URL | 说明 |
12
+ |--------|---------|----------|------|
13
+ | minimax | `MINIMAX_API_KEY` | `CCG_MINIMAX_BASE_URL` | MiniMax 官方 API |
14
+ | deepseek | `DEEPSEEK_API_KEY` | `CCG_DEEPSEEK_BASE_URL` | DeepSeek 官方 API |
15
+ | kimi | `KIMI_API_KEY` | `CCG_KIMI_BASE_URL` | Kimi (Moonshot) 官方 API |
16
+ | glm | `GLM_API_KEY` | `CCG_GLM_BASE_URL` | GLM (智谱) 官方 API |
17
+ | mimo | `MIMO_API_KEY` | `CCG_MIMO_BASE_URL` | Mimo 官方 API |
18
+
19
+ ### 默认 Base URL
20
+
21
+ | 提供商 | 默认 Base URL | 说明 |
22
+ |--------|---------------|------|
23
+ | minimax | `https://api.minimax.chat/v1` | MiniMax 官方 |
24
+ | deepseek | `https://api.deepseek.com/v1` | DeepSeek 官方 |
25
+ | kimi | `https://api.moonshot.cn/v1` | Kimi (Moonshot) 官方 |
26
+ | glm | `https://open.bigmodel.cn/api/paas/v4` | GLM (智谱) 官方 |
27
+ | mimo | 待确认 | 需要确认官方端点 |
28
+
29
+ ## 实现步骤
30
+
31
+ ### 1. 修改 `ccg.sh`
32
+
33
+ - 添加新环境变量定义
34
+ - 添加 `_ccg_resolve_<provider>_model()` 函数
35
+ - 添加 `ccg_<provider>()` 主调用函数
36
+ - 添加 `_ccg_<provider>_retry()` 重试包装
37
+ - 修改 `ccg_preflight()` 添加预检
38
+ - 修改 `_ccg_price()` 添加定价
39
+ - 修改 `_ccg_vendor_of()` 添加厂商识别
40
+
41
+ ### 2. 修改 `ccg-multi-provider.sh`
42
+
43
+ - 修改 `_ccg_resolve_model()` 添加新提供商
44
+ - 修改 `_ccg_validate_provider()` 添加验证
45
+ - 修改 `ccg_show_config()` 添加配置展示
46
+
47
+ ### 3. 修改 `ccg-workflow.sh`
48
+
49
+ - 修改 `ccg_review()` 的 provider 调度
50
+
51
+ ### 4. 更新文档
52
+
53
+ - 更新 `README.md` 环境变量表
54
+ - 更新 `docs/CAPABILITIES.md` 配置说明
55
+ - 更新各语言 README
56
+
57
+ ## 设计原则
58
+
59
+ 1. **向后兼容**:现有百炼配置继续工作
60
+ 2. **优先级明确**:官方API > 百炼平台
61
+ 3. **配置简洁**:每个提供商只需2个环境变量
62
+ 4. **代码复用**:复用现有API调用逻辑(OpenAI兼容格式)