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,271 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
iFlow CLI Hook集成安装脚本
|
|
3
|
-
为iFlow CLI安装跨CLI协作感知能力
|
|
4
|
-
|
|
5
|
-
使用方法:
|
|
6
|
-
python install_iflow_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
|
-
# iFlow CLI配置路径
|
|
22
|
-
IFLOW_CONFIG_DIR = os.path.expanduser("~/.config/iflow")
|
|
23
|
-
IFLOW_HOOKS_FILE = os.path.join(IFLOW_CONFIG_DIR, "hooks.yml")
|
|
24
|
-
|
|
25
|
-
def create_iflow_config_directory():
|
|
26
|
-
"""创建iFlow配置目录"""
|
|
27
|
-
os.makedirs(IFLOW_CONFIG_DIR, exist_ok=True)
|
|
28
|
-
print(f"[OK] 创建iFlow配置目录: {IFLOW_CONFIG_DIR}")
|
|
29
|
-
|
|
30
|
-
def install_iflow_hooks():
|
|
31
|
-
"""安装iFlow Hook配置"""
|
|
32
|
-
# 读取现有hooks配置
|
|
33
|
-
existing_hooks = {}
|
|
34
|
-
if os.path.exists(IFLOW_HOOKS_FILE):
|
|
35
|
-
try:
|
|
36
|
-
import yaml
|
|
37
|
-
with open(IFLOW_HOOKS_FILE, 'r', encoding='utf-8') as f:
|
|
38
|
-
existing_hooks = yaml.safe_load(f) or {}
|
|
39
|
-
except Exception as e:
|
|
40
|
-
print(f"⚠️ 读取现有hooks配置失败: {e}")
|
|
41
|
-
existing_hooks = {}
|
|
42
|
-
|
|
43
|
-
# 定义跨CLI协作的Hook配置
|
|
44
|
-
cross_cli_hooks = {
|
|
45
|
-
"cross_cli_hook_adapter": {
|
|
46
|
-
"name": "CrossCLIHookAdapter",
|
|
47
|
-
"module": "src.adapters.iflow.hook_adapter",
|
|
48
|
-
"class": "IFlowHookAdapter",
|
|
49
|
-
"enabled": True,
|
|
50
|
-
"priority": 100,
|
|
51
|
-
"hooks": [
|
|
52
|
-
"on_command_start",
|
|
53
|
-
"on_command_end",
|
|
54
|
-
"on_user_input",
|
|
55
|
-
"on_workflow_stage",
|
|
56
|
-
"on_pipeline_execute",
|
|
57
|
-
"on_output_render",
|
|
58
|
-
"on_error"
|
|
59
|
-
],
|
|
60
|
-
"config": {
|
|
61
|
-
"cross_cli_enabled": True,
|
|
62
|
-
"supported_clis": ["claude", "gemini", "qwencode", "qoder", "codebuddy", "copilot"],
|
|
63
|
-
"auto_detect": True,
|
|
64
|
-
"timeout": 30,
|
|
65
|
-
"error_handling": "continue",
|
|
66
|
-
"collaboration_mode": "active"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
# 合并配置(保留现有hooks,添加协作功能)
|
|
72
|
-
merged_hooks = existing_hooks.copy()
|
|
73
|
-
if 'plugins' not in merged_hooks:
|
|
74
|
-
merged_hooks['plugins'] = []
|
|
75
|
-
|
|
76
|
-
# 检查是否已存在跨CLI Hook
|
|
77
|
-
existing_plugin_names = [plugin.get('name') for plugin in merged_hooks.get('plugins', [])]
|
|
78
|
-
cross_cli_hook_exists = any(plugin_name == 'CrossCLIHookAdapter' for plugin_name in existing_plugin_names)
|
|
79
|
-
|
|
80
|
-
if not cross_cli_hook_exists:
|
|
81
|
-
merged_hooks['plugins'].append(cross_cli_hooks['cross_cli_hook_adapter'])
|
|
82
|
-
|
|
83
|
-
# 写入hooks配置文件
|
|
84
|
-
try:
|
|
85
|
-
import yaml
|
|
86
|
-
with open(IFLOW_HOOKS_FILE, 'w', encoding='utf-8') as f:
|
|
87
|
-
yaml.dump(merged_hooks, f, default_flow_style=False, allow_unicode=True)
|
|
88
|
-
|
|
89
|
-
print(f"[OK] iFlow Hook配置已安装: {IFLOW_HOOKS_FILE}")
|
|
90
|
-
print("🔗 已安装的Hook:")
|
|
91
|
-
for plugin in merged_hooks.get('plugins', []):
|
|
92
|
-
if plugin.get('name') == 'CrossCLIHookAdapter':
|
|
93
|
-
print(f" - {plugin['name']}: [OK] 跨CLI协作感知")
|
|
94
|
-
print(f" 支持的CLI: {', '.join(plugin['config'].get('supported_clis', []))}")
|
|
95
|
-
|
|
96
|
-
return True
|
|
97
|
-
except Exception as e:
|
|
98
|
-
print(f"❌ 安装iFlow Hook配置失败: {e}")
|
|
99
|
-
return False
|
|
100
|
-
|
|
101
|
-
def copy_adapter_file():
|
|
102
|
-
"""复制适配器文件到iFlow配置目录"""
|
|
103
|
-
try:
|
|
104
|
-
# 创建适配器目录
|
|
105
|
-
adapter_dir = os.path.join(IFLOW_CONFIG_DIR, "adapters")
|
|
106
|
-
os.makedirs(adapter_dir, exist_ok=True)
|
|
107
|
-
|
|
108
|
-
# 复制适配器文件
|
|
109
|
-
adapter_files = [
|
|
110
|
-
"hook_adapter.py",
|
|
111
|
-
"standalone_iflow_adapter.py"
|
|
112
|
-
]
|
|
113
|
-
|
|
114
|
-
for file_name in adapter_files:
|
|
115
|
-
src_file = current_dir / file_name
|
|
116
|
-
dst_file = os.path.join(adapter_dir, file_name)
|
|
117
|
-
|
|
118
|
-
if src_file.exists():
|
|
119
|
-
shutil.copy2(src_file, dst_file)
|
|
120
|
-
print(f"[OK] 复制适配器文件: {file_name}")
|
|
121
|
-
else:
|
|
122
|
-
print(f"⚠️ 适配器文件不存在: {file_name}")
|
|
123
|
-
|
|
124
|
-
return True
|
|
125
|
-
except Exception as e:
|
|
126
|
-
print(f"❌ 复制适配器文件失败: {e}")
|
|
127
|
-
return False
|
|
128
|
-
|
|
129
|
-
def verify_installation():
|
|
130
|
-
"""验证安装是否成功"""
|
|
131
|
-
print("\n🔍 验证iFlow CLI集成安装...")
|
|
132
|
-
|
|
133
|
-
# 检查配置目录
|
|
134
|
-
if not os.path.exists(IFLOW_CONFIG_DIR):
|
|
135
|
-
print(f"❌ 配置目录不存在: {IFLOW_CONFIG_DIR}")
|
|
136
|
-
return False
|
|
137
|
-
|
|
138
|
-
# 检查hooks文件
|
|
139
|
-
if not os.path.exists(IFLOW_HOOKS_FILE):
|
|
140
|
-
print(f"❌ Hooks配置文件不存在: {IFLOW_HOOKS_FILE}")
|
|
141
|
-
return False
|
|
142
|
-
|
|
143
|
-
# 检查适配器目录
|
|
144
|
-
adapter_dir = os.path.join(IFLOW_CONFIG_DIR, "adapters")
|
|
145
|
-
if not os.path.exists(adapter_dir):
|
|
146
|
-
print(f"❌ 适配器目录不存在: {adapter_dir}")
|
|
147
|
-
return False
|
|
148
|
-
|
|
149
|
-
# 读取并验证hooks配置
|
|
150
|
-
try:
|
|
151
|
-
import yaml
|
|
152
|
-
with open(IFLOW_HOOKS_FILE, 'r', encoding='utf-8') as f:
|
|
153
|
-
hooks_config = yaml.safe_load(f) or {}
|
|
154
|
-
|
|
155
|
-
plugins = hooks_config.get('plugins', [])
|
|
156
|
-
cross_cli_plugin = None
|
|
157
|
-
|
|
158
|
-
for plugin in plugins:
|
|
159
|
-
if plugin.get('name') == 'CrossCLIHookAdapter':
|
|
160
|
-
cross_cli_plugin = plugin
|
|
161
|
-
print(f"[OK] 跨CLI协作Hook: 已启用")
|
|
162
|
-
print(f"[OK] 支持的CLI工具: {', '.join(plugin.get('config', {}).get('supported_clis', []))}")
|
|
163
|
-
break
|
|
164
|
-
|
|
165
|
-
if not cross_cli_plugin:
|
|
166
|
-
print("❌ 跨CLI协作Hook: 未找到")
|
|
167
|
-
return False
|
|
168
|
-
|
|
169
|
-
except Exception as e:
|
|
170
|
-
print(f"❌ 读取hooks配置失败: {e}")
|
|
171
|
-
return False
|
|
172
|
-
|
|
173
|
-
def uninstall_iflow_integration():
|
|
174
|
-
"""卸载iFlow集成"""
|
|
175
|
-
try:
|
|
176
|
-
# 备份现有配置
|
|
177
|
-
if os.path.exists(IFLOW_HOOKS_FILE):
|
|
178
|
-
backup_file = f"{IFLOW_HOOKS_FILE}.backup_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
|
|
179
|
-
shutil.copy2(IFLOW_HOOKS_FILE, backup_file)
|
|
180
|
-
print(f"📦 已备份现有配置: {backup_file}")
|
|
181
|
-
|
|
182
|
-
# 移除跨CLI Hook
|
|
183
|
-
if os.path.exists(IFLOW_HOOKS_FILE):
|
|
184
|
-
import yaml
|
|
185
|
-
with open(IFLOW_HOOKS_FILE, 'r', encoding='utf-8') as f:
|
|
186
|
-
hooks_config = yaml.safe_load(f) or {}
|
|
187
|
-
|
|
188
|
-
if 'plugins' in hooks_config:
|
|
189
|
-
plugins = hooks_config['plugins']
|
|
190
|
-
# 移除跨CLI Hook
|
|
191
|
-
plugins = [p for p in plugins if p.get('name') != 'CrossCLIHookAdapter']
|
|
192
|
-
|
|
193
|
-
hooks_config['plugins'] = plugins
|
|
194
|
-
|
|
195
|
-
# 写回配置
|
|
196
|
-
with open(IFLOW_HOOKS_FILE, 'w', encoding='utf-8') as f:
|
|
197
|
-
yaml.dump(hooks_config, f, default_flow_style=False, allow_unicode=True)
|
|
198
|
-
|
|
199
|
-
print("[OK] iFlow跨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="iFlow CLI跨CLI协作集成安装脚本",
|
|
208
|
-
formatter_class=argparse.RawDescriptionHelpFormatter
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
parser.add_argument(
|
|
212
|
-
"--install",
|
|
213
|
-
action="store_true",
|
|
214
|
-
help="安装iFlow CLI跨CLI协作集成"
|
|
215
|
-
)
|
|
216
|
-
|
|
217
|
-
parser.add_argument(
|
|
218
|
-
"--verify",
|
|
219
|
-
action="store_true",
|
|
220
|
-
help="验证iFlow CLI集成安装"
|
|
221
|
-
)
|
|
222
|
-
|
|
223
|
-
parser.add_argument(
|
|
224
|
-
"--uninstall",
|
|
225
|
-
action="store_true",
|
|
226
|
-
help="卸载iFlow CLI跨CLI协作集成"
|
|
227
|
-
)
|
|
228
|
-
|
|
229
|
-
args = parser.parse_args()
|
|
230
|
-
|
|
231
|
-
print("[INSTALL] iFlow CLI跨CLI协作集成安装器")
|
|
232
|
-
print("=" * 60)
|
|
233
|
-
|
|
234
|
-
if args.uninstall:
|
|
235
|
-
print("[UNINSTALL] 卸载模式...")
|
|
236
|
-
success = uninstall_iflow_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_iflow_config_directory()
|
|
246
|
-
|
|
247
|
-
# 2. 安装hooks配置
|
|
248
|
-
print("Step 2. 安装hooks配置...")
|
|
249
|
-
hooks_success = install_iflow_hooks()
|
|
250
|
-
|
|
251
|
-
# 3. 复制适配器文件
|
|
252
|
-
print("Step 3. 复制适配器文件...")
|
|
253
|
-
adapter_success = copy_adapter_file()
|
|
254
|
-
|
|
255
|
-
success = hooks_success and adapter_success
|
|
256
|
-
|
|
257
|
-
if success:
|
|
258
|
-
print("\n🎉 iFlow CLI集成安装成功!")
|
|
259
|
-
print("\n[INFO] 安装摘要:")
|
|
260
|
-
print(f" [OK] 配置目录: {IFLOW_CONFIG_DIR}")
|
|
261
|
-
print(f" [OK] Hooks文件: {IFLOW_HOOKS_FILE}")
|
|
262
|
-
print(f" [OK] 适配器目录: {os.path.join(IFLOW_CONFIG_DIR, 'adapters')}")
|
|
263
|
-
print(f" [OK] 跨CLI协作: 已启用")
|
|
264
|
-
print(f" [OK] 支持的CLI: claude, gemini, qwencode, qoder, codebuddy, copilot")
|
|
265
|
-
else:
|
|
266
|
-
print("\n❌ iFlow CLI集成安装失败!")
|
|
267
|
-
else:
|
|
268
|
-
parser.print_help()
|
|
269
|
-
|
|
270
|
-
if __name__ == "__main__":
|
|
271
|
-
main()
|