stigmergy 1.0.68 → 1.0.70
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/README.en.md +306 -300
- package/README.md +469 -301
- package/package.json +97 -81
- package/scripts/publish.js +268 -0
- package/scripts/simple-publish.js +59 -0
- package/src/index.js +12 -0
- package/test/enhanced-main-alignment.test.js +298 -0
- package/test/hook-system-integration-test.js +307 -0
- package/test/natural-language-skills-test.js +320 -0
- package/test/nl-integration-test.js +179 -0
- package/test/parameter-parsing-test.js +143 -0
- package/test/real-test.js +435 -0
- package/test/system-compatibility-test.js +447 -0
- package/test/tdd-fixes-test.js +211 -0
- package/test/third-party-skills-test.js +321 -0
- package/test/tool-selection-integration-test.js +157 -0
- package/test/unit/cli-scanner.test.js +291 -0
- package/test/unit/cross-cli-executor.test.js +399 -0
- package/src/adapters/claude/__init__.py +0 -13
- package/src/adapters/claude/claude_skills_integration.py +0 -609
- package/src/adapters/claude/hook_adapter.py +0 -663
- package/src/adapters/claude/install_claude_integration.py +0 -265
- package/src/adapters/claude/skills_hook_adapter.py +0 -841
- package/src/adapters/claude/standalone_claude_adapter.py +0 -384
- package/src/adapters/cline/__init__.py +0 -20
- package/src/adapters/cline/config.py +0 -108
- package/src/adapters/cline/install_cline_integration.py +0 -617
- package/src/adapters/cline/mcp_server.py +0 -713
- package/src/adapters/cline/standalone_cline_adapter.py +0 -459
- package/src/adapters/codebuddy/__init__.py +0 -13
- package/src/adapters/codebuddy/buddy_adapter.py +0 -1125
- package/src/adapters/codebuddy/install_codebuddy_integration.py +0 -279
- package/src/adapters/codebuddy/skills_hook_adapter.py +0 -672
- package/src/adapters/codebuddy/skills_integration.py +0 -395
- package/src/adapters/codebuddy/standalone_codebuddy_adapter.py +0 -403
- package/src/adapters/codex/__init__.py +0 -11
- package/src/adapters/codex/base.py +0 -46
- package/src/adapters/codex/install_codex_integration.py +0 -311
- package/src/adapters/codex/mcp_server.py +0 -493
- package/src/adapters/codex/natural_language_parser.py +0 -82
- package/src/adapters/codex/slash_command_adapter.py +0 -326
- package/src/adapters/codex/standalone_codex_adapter.py +0 -362
- package/src/adapters/copilot/__init__.py +0 -13
- package/src/adapters/copilot/install_copilot_integration.py +0 -564
- package/src/adapters/copilot/mcp_adapter.py +0 -772
- package/src/adapters/copilot/mcp_server.py +0 -168
- package/src/adapters/copilot/standalone_copilot_adapter.py +0 -114
- package/src/adapters/gemini/__init__.py +0 -13
- package/src/adapters/gemini/extension_adapter.py +0 -690
- package/src/adapters/gemini/install_gemini_integration.py +0 -257
- package/src/adapters/gemini/standalone_gemini_adapter.py +0 -366
- package/src/adapters/iflow/__init__.py +0 -7
- package/src/adapters/iflow/hook_adapter.py +0 -1038
- package/src/adapters/iflow/hook_installer.py +0 -536
- package/src/adapters/iflow/install_iflow_integration.py +0 -271
- package/src/adapters/iflow/official_hook_adapter.py +0 -1272
- package/src/adapters/iflow/standalone_iflow_adapter.py +0 -48
- package/src/adapters/iflow/workflow_adapter.py +0 -793
- package/src/adapters/qoder/hook_installer.py +0 -732
- package/src/adapters/qoder/install_qoder_integration.py +0 -265
- package/src/adapters/qoder/notification_hook_adapter.py +0 -863
- package/src/adapters/qoder/standalone_qoder_adapter.py +0 -48
- package/src/adapters/qwen/__init__.py +0 -17
- package/src/adapters/qwencode/__init__.py +0 -13
- package/src/adapters/qwencode/inheritance_adapter.py +0 -818
- package/src/adapters/qwencode/install_qwencode_integration.py +0 -276
- package/src/adapters/qwencode/standalone_qwencode_adapter.py +0 -399
- package/src/atomic_collaboration_handler.py +0 -461
- package/src/cli_collaboration_agent.py +0 -697
- package/src/collaboration/hooks.py +0 -315
- package/src/core/__init__.py +0 -21
- package/src/core/ai_environment_scanner.py +0 -331
- package/src/core/base_adapter.py +0 -220
- package/src/core/cli_hook_integration.py +0 -406
- package/src/core/cross_cli_executor.py +0 -713
- package/src/core/cross_cli_mapping.py +0 -1165
- package/src/core/cross_platform_encoding.py +0 -365
- package/src/core/cross_platform_safe_cli.py +0 -894
- package/src/core/direct_cli_executor.py +0 -805
- package/src/core/direct_cli_hook_system.py +0 -958
- package/src/core/enhanced_init_processor.py +0 -467
- package/src/core/graceful_cli_executor.py +0 -912
- package/src/core/md_enhancer.py +0 -342
- package/src/core/md_generator.py +0 -619
- package/src/core/models.py +0 -218
- package/src/core/parser.py +0 -108
- package/src/core/real_cli_hook_system.py +0 -852
- package/src/core/real_cross_cli_system.py +0 -925
- package/src/core/verified_cross_cli_system.py +0 -961
- package/src/deploy.js +0 -737
- package/src/enhanced-main.js +0 -626
- package/src/enhanced_deploy.js +0 -303
- package/src/enhanced_universal_cli_setup.py +0 -930
- package/src/kimi_wrapper.py +0 -104
- package/src/main.js +0 -1309
- package/src/shell_integration.py +0 -398
- package/src/simple-main.js +0 -315
- package/src/smart_router_creator.py +0 -323
- package/src/universal_cli_setup.py +0 -1289
- package/src/utils/__init__.py +0 -12
- package/src/utils/cli_detector.py +0 -445
- package/src/utils/file_utils.py +0 -246
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
CodeBuddy CLI Skills集成安装脚本
|
|
3
|
-
为CodeBuddy CLI安装跨CLI协作感知能力
|
|
4
|
-
|
|
5
|
-
使用方法:
|
|
6
|
-
python install_codebuddy_integration.py [--verify|--uninstall]
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
import os
|
|
10
|
-
import sys
|
|
11
|
-
import json
|
|
12
|
-
import shutil
|
|
13
|
-
import argparse
|
|
14
|
-
from pathlib import Path
|
|
15
|
-
from datetime import datetime
|
|
16
|
-
|
|
17
|
-
# 获取当前文件目录
|
|
18
|
-
current_dir = Path(__file__).parent
|
|
19
|
-
project_root = current_dir.parent.parent.parent
|
|
20
|
-
|
|
21
|
-
# CodeBuddy CLI配置路径
|
|
22
|
-
CODEBUDDY_CONFIG_DIR = os.path.expanduser("~/.codebuddy")
|
|
23
|
-
CODEBUDDY_CONFIG_FILE = os.path.join(CODEBUDDY_CONFIG_DIR, "buddy_config.json")
|
|
24
|
-
|
|
25
|
-
def create_codebuddy_config_directory():
|
|
26
|
-
"""创建CodeBuddy配置目录"""
|
|
27
|
-
os.makedirs(CODEBUDDY_CONFIG_DIR, exist_ok=True)
|
|
28
|
-
print(f"[OK] 创建CodeBuddy配置目录: {CODEBUDDY_CONFIG_DIR}")
|
|
29
|
-
|
|
30
|
-
def install_codebuddy_skills():
|
|
31
|
-
"""安装CodeBuddy Skills配置"""
|
|
32
|
-
# 读取现有buddy_config配置
|
|
33
|
-
existing_config = {}
|
|
34
|
-
if os.path.exists(CODEBUDDY_CONFIG_FILE):
|
|
35
|
-
try:
|
|
36
|
-
with open(CODEBUDDY_CONFIG_FILE, 'r', encoding='utf-8') as f:
|
|
37
|
-
existing_config = json.load(f)
|
|
38
|
-
except Exception as e:
|
|
39
|
-
print(f"⚠️ 读取现有buddy_config配置失败: {e}")
|
|
40
|
-
existing_config = {}
|
|
41
|
-
|
|
42
|
-
# 定义跨CLI协作的Skills配置
|
|
43
|
-
cross_cli_skills = {
|
|
44
|
-
"cross_cli_skill": {
|
|
45
|
-
"name": "CrossCLICoordinationSkill",
|
|
46
|
-
"description": "Cross-CLI工具协调技能",
|
|
47
|
-
"module": "src.adapters.codebuddy.skills_hook_adapter",
|
|
48
|
-
"class": "CodeBuddySkillsHookAdapter",
|
|
49
|
-
"enabled": True,
|
|
50
|
-
"priority": 100,
|
|
51
|
-
"triggers": [
|
|
52
|
-
"on_skill_activation",
|
|
53
|
-
"on_user_command"
|
|
54
|
-
],
|
|
55
|
-
"config": {
|
|
56
|
-
"cross_cli_enabled": True,
|
|
57
|
-
"supported_clis": ["claude", "gemini", "qwencode", "iflow", "qoder", "copilot"],
|
|
58
|
-
"auto_route": True,
|
|
59
|
-
"timeout": 30,
|
|
60
|
-
"collaboration_mode": "active"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
# 合并配置(保留现有skills,添加协作功能)
|
|
66
|
-
merged_config = existing_config.copy()
|
|
67
|
-
if 'skills' not in merged_config:
|
|
68
|
-
merged_config['skills'] = []
|
|
69
|
-
|
|
70
|
-
# 检查是否已存在跨CLI协调技能
|
|
71
|
-
existing_skill_names = [skill.get('name') for skill in merged_config.get('skills', [])]
|
|
72
|
-
cross_cli_skill_name = "CrossCLICoordinationSkill"
|
|
73
|
-
|
|
74
|
-
if cross_cli_skill_name not in existing_skill_names:
|
|
75
|
-
merged_config['skills'].append(cross_cli_skills['cross_cli_skill'])
|
|
76
|
-
|
|
77
|
-
# 写入配置文件
|
|
78
|
-
try:
|
|
79
|
-
with open(CODEBUDDY_CONFIG_FILE, 'w', encoding='utf-8') as f:
|
|
80
|
-
json.dump(merged_config, f, indent=2, ensure_ascii=False)
|
|
81
|
-
|
|
82
|
-
print(f"[OK] CodeBuddy配置已安装: {CODEBUDDY_CONFIG_FILE}")
|
|
83
|
-
print("🔗 已安装的Skills:")
|
|
84
|
-
for skill in merged_config.get('skills', []):
|
|
85
|
-
status = "[OK]" if skill.get('enabled') else "❌"
|
|
86
|
-
print(f" - {skill.get('name')}: {status}")
|
|
87
|
-
|
|
88
|
-
return True
|
|
89
|
-
except Exception as e:
|
|
90
|
-
print(f"❌ 安装CodeBuddy配置失败: {e}")
|
|
91
|
-
return False
|
|
92
|
-
|
|
93
|
-
def copy_adapter_file():
|
|
94
|
-
"""复制适配器文件到CodeBuddy配置目录"""
|
|
95
|
-
try:
|
|
96
|
-
# 创建适配器目录
|
|
97
|
-
adapter_dir = CODEBUDDY_CONFIG_DIR
|
|
98
|
-
os.makedirs(adapter_dir, exist_ok=True)
|
|
99
|
-
|
|
100
|
-
# 复制适配器文件
|
|
101
|
-
adapter_files = [
|
|
102
|
-
"skills_hook_adapter.py",
|
|
103
|
-
"standalone_codebuddy_adapter.py"
|
|
104
|
-
]
|
|
105
|
-
|
|
106
|
-
for file_name in adapter_files:
|
|
107
|
-
src_file = current_dir / file_name
|
|
108
|
-
dst_file = os.path.join(adapter_dir, file_name)
|
|
109
|
-
|
|
110
|
-
if src_file.exists():
|
|
111
|
-
shutil.copy2(src_file, dst_file)
|
|
112
|
-
print(f"[OK] 复制适配器文件: {file_name}")
|
|
113
|
-
else:
|
|
114
|
-
print(f"⚠️ 适配器文件不存在: {file_name}")
|
|
115
|
-
|
|
116
|
-
return True
|
|
117
|
-
except Exception as e:
|
|
118
|
-
print(f"❌ 复制适配器文件失败: {e}")
|
|
119
|
-
return False
|
|
120
|
-
|
|
121
|
-
def verify_installation():
|
|
122
|
-
"""验证安装是否成功"""
|
|
123
|
-
print("\n🔍 验证CodeBuddy CLI集成安装...")
|
|
124
|
-
|
|
125
|
-
# 检查配置文件
|
|
126
|
-
if not os.path.exists(CODEBUDDY_CONFIG_FILE):
|
|
127
|
-
print(f"❌ 配置文件不存在: {CODEBUDDY_CONFIG_FILE}")
|
|
128
|
-
return False
|
|
129
|
-
|
|
130
|
-
try:
|
|
131
|
-
with open(CODEBUDDY_CONFIG_FILE, 'r', encoding='utf-8') as f:
|
|
132
|
-
config = json.load(f)
|
|
133
|
-
|
|
134
|
-
skills = config.get('skills', [])
|
|
135
|
-
cross_cli_skill = None
|
|
136
|
-
for skill in skills:
|
|
137
|
-
if skill.get('name') == 'CrossCLICoordinationSkill':
|
|
138
|
-
cross_cli_skill = skill
|
|
139
|
-
break
|
|
140
|
-
|
|
141
|
-
if cross_cli_skill:
|
|
142
|
-
print("[OK] 跨CLI协作Skill已安装")
|
|
143
|
-
print(f" - 技能名称: {cross_cli_skill.get('name')}")
|
|
144
|
-
print(f" - 描述: {cross_cli_skill.get('description')}")
|
|
145
|
-
print(f" - 启用状态: {'[OK]' if cross_cli_skill.get('enabled') else '❌'}")
|
|
146
|
-
print(f" - 支持的CLI工具: {cross_cli_skill.get('config', {}).get('supported_clis', [])}")
|
|
147
|
-
print(f" - 自动路由: {'[OK]' if cross_cli_skill.get('config', {}).get('auto_route') else '❌'}")
|
|
148
|
-
else:
|
|
149
|
-
print("❌ 跨CLI协作Skill未找到")
|
|
150
|
-
return False
|
|
151
|
-
|
|
152
|
-
# 检查适配器文件
|
|
153
|
-
required_files = ["skills_hook_adapter.py"]
|
|
154
|
-
missing_files = []
|
|
155
|
-
|
|
156
|
-
for file_name in required_files:
|
|
157
|
-
file_path = os.path.join(CODEBUDDY_CONFIG_DIR, file_name)
|
|
158
|
-
if not os.path.exists(file_path):
|
|
159
|
-
missing_files.append(file_name)
|
|
160
|
-
|
|
161
|
-
if missing_files:
|
|
162
|
-
print(f"❌ 缺失适配器文件: {missing_files}")
|
|
163
|
-
return False
|
|
164
|
-
else:
|
|
165
|
-
print("[OK] 适配器文件已复制")
|
|
166
|
-
|
|
167
|
-
return True
|
|
168
|
-
except Exception as e:
|
|
169
|
-
print(f"❌ 验证失败: {e}")
|
|
170
|
-
return False
|
|
171
|
-
|
|
172
|
-
def uninstall_codebuddy_integration():
|
|
173
|
-
"""卸载CodeBuddy集成"""
|
|
174
|
-
try:
|
|
175
|
-
# 备份现有配置
|
|
176
|
-
if os.path.exists(CODEBUDDY_CONFIG_FILE):
|
|
177
|
-
backup_file = f"{CODEBUDDY_CONFIG_FILE}.backup_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
|
|
178
|
-
shutil.copy2(CODEBUDDY_CONFIG_FILE, backup_file)
|
|
179
|
-
print(f"📦 已备份现有配置: {backup_file}")
|
|
180
|
-
|
|
181
|
-
# 移除跨CLI协作Skill
|
|
182
|
-
config_updated = False
|
|
183
|
-
if os.path.exists(CODEBUDDY_CONFIG_FILE):
|
|
184
|
-
with open(CODEBUDDY_CONFIG_FILE, 'r+', encoding='utf-8') as f:
|
|
185
|
-
config = json.load(f)
|
|
186
|
-
skills = config.get('skills', [])
|
|
187
|
-
|
|
188
|
-
# 移除跨CLI协作Skill
|
|
189
|
-
skills = [skill for skill in skills if skill.get('name') != 'CrossCLICoordinationSkill']
|
|
190
|
-
|
|
191
|
-
f.seek(0)
|
|
192
|
-
f.truncate()
|
|
193
|
-
json.dump({
|
|
194
|
-
'skills': skills,
|
|
195
|
-
'version': config.get('version', '1.0.0')
|
|
196
|
-
}, f, indent=2, ensure_ascii=False)
|
|
197
|
-
config_updated = True
|
|
198
|
-
|
|
199
|
-
print(f"🗑️ CodeBuddy跨CLI协作集成已卸载")
|
|
200
|
-
return True
|
|
201
|
-
except Exception as e:
|
|
202
|
-
print(f"❌ 卸载失败: {e}")
|
|
203
|
-
return False
|
|
204
|
-
|
|
205
|
-
def main():
|
|
206
|
-
parser = argparse.ArgumentParser(
|
|
207
|
-
description="CodeBuddy CLI跨CLI协作集成安装脚本",
|
|
208
|
-
formatter_class=argparse.RawDescriptionHelpFormatter
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
parser.add_argument(
|
|
212
|
-
"--install",
|
|
213
|
-
action="store_true",
|
|
214
|
-
help="安装CodeBuddy CLI跨CLI协作集成"
|
|
215
|
-
)
|
|
216
|
-
|
|
217
|
-
parser.add_argument(
|
|
218
|
-
"--verify",
|
|
219
|
-
action="store_true",
|
|
220
|
-
help="验证CodeBuddy CLI集成安装"
|
|
221
|
-
)
|
|
222
|
-
|
|
223
|
-
parser.add_argument(
|
|
224
|
-
"--uninstall",
|
|
225
|
-
action="store_true",
|
|
226
|
-
help="卸载CodeBuddy CLI跨CLI协作集成"
|
|
227
|
-
)
|
|
228
|
-
|
|
229
|
-
args = parser.parse_args()
|
|
230
|
-
|
|
231
|
-
print("[INSTALL] CodeBuddy CLI跨CLI协作集成安装器")
|
|
232
|
-
print("=" * 50)
|
|
233
|
-
|
|
234
|
-
if args.uninstall:
|
|
235
|
-
print("[UNINSTALL] 卸载模式...")
|
|
236
|
-
success = uninstall_codebuddy_integration()
|
|
237
|
-
elif args.verify:
|
|
238
|
-
print("[VERIFY] 验证模式...")
|
|
239
|
-
success = verify_installation()
|
|
240
|
-
elif args.install or len(sys.argv) == 1:
|
|
241
|
-
print("[INSTALL] 安装模式...")
|
|
242
|
-
|
|
243
|
-
# 1. 创建配置目录
|
|
244
|
-
print("Step 1. 创建配置目录...")
|
|
245
|
-
create_codebuddy_config_directory()
|
|
246
|
-
|
|
247
|
-
# 2. 安装Skills配置
|
|
248
|
-
print("Step 2. 安装Skills配置...")
|
|
249
|
-
config_success = install_codebuddy_skills()
|
|
250
|
-
|
|
251
|
-
# 3. 复制适配器文件
|
|
252
|
-
print("Step 3. 复制适配器文件...")
|
|
253
|
-
adapter_success = copy_adapter_file()
|
|
254
|
-
|
|
255
|
-
# 4. 验证安装
|
|
256
|
-
print("Step 4. 验证安装...")
|
|
257
|
-
verify_success = verify_installation()
|
|
258
|
-
|
|
259
|
-
success = config_success and adapter_success and verify_success
|
|
260
|
-
|
|
261
|
-
if success:
|
|
262
|
-
print("\n🎉 CodeBuddy CLI跨CLI协作集成安装成功!")
|
|
263
|
-
print("\n[INFO] 安装摘要:")
|
|
264
|
-
print(f" [OK] 配置目录: {CODEBUDDY_CONFIG_DIR}")
|
|
265
|
-
print(f" [OK] 配置文件: {CODEBUDDY_CONFIG_FILE}")
|
|
266
|
-
print(f" [OK] 适配器目录: {CODEBUDDY_CONFIG_DIR}")
|
|
267
|
-
print(f" [OK] 跨CLI协作Skill: 已启用")
|
|
268
|
-
|
|
269
|
-
print("\n[INSTALL] 下一步:")
|
|
270
|
-
print(" 1. 安装其他CLI工具的集成")
|
|
271
|
-
print(" 2. 使用 ai-cli-router deploy --all")
|
|
272
|
-
print(" 3. 使用 ai-cli-router init 初始化项目")
|
|
273
|
-
else:
|
|
274
|
-
print("\n❌ CodeBuddy CLI跨CLI协作集成安装失败")
|
|
275
|
-
else:
|
|
276
|
-
parser.print_help()
|
|
277
|
-
|
|
278
|
-
if __name__ == "__main__":
|
|
279
|
-
main()
|