bugx-cli 0.1.0 → 0.1.1
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.md +190 -186
- package/core/README.md +2 -2
- package/core/agent/README.md +2 -1
- package/core/agent/agent_artifacts.py +8 -6
- package/core/agent/agent_eval.py +136 -54
- package/core/agent/agent_execution.py +218 -52
- package/core/agent/agent_orchestrator.py +14 -8
- package/core/agent/agent_targets.py +8 -2
- package/core/agent/feature_baseline.py +150 -0
- package/core/assets/axe-core/LICENSE-3RD-PARTY.txt +66 -0
- package/core/assets/axe-core/LICENSE.txt +362 -0
- package/core/assets/axe-core/UPSTREAM.md +10 -0
- package/core/assets/axe-core/axe.min.js +12 -0
- package/core/assets/bugx-hero-en.svg +74 -0
- package/core/assets/bugx-hero-zh.svg +74 -0
- package/core/assets/codex.png +0 -0
- package/core/assets/dsh.png +0 -0
- package/core/assets/webui-chatgpt.jpg +0 -0
- package/core/assets/webui-session.jpg +0 -0
- package/core/assets/webui-skills.jpg +0 -0
- package/core/assets/webui-studio.jpg +0 -0
- package/core/assets/webui-zcode.jpg +0 -0
- package/core/assets/zcode.png +0 -0
- package/core/autonomous_cve/SPEC.md +1 -1
- package/core/autonomous_cve/attack_graph_store.py +152 -106
- package/core/autonomous_cve/behavior_graph.py +8 -2
- package/core/autonomous_cve/verifier.py +4 -1
- package/core/bugx.md +1 -1
- package/core/bugx_paths.py +43 -8
- package/core/cli-help.txt +66 -0
- package/core/cloud_sync/SPEC.md +1 -1
- package/core/cloud_sync/cloud_client.py +25 -6
- package/core/cloud_sync/cloud_onboard.py +42 -1
- package/core/cloud_sync/flywheel_client.py +16 -7
- package/core/cloud_sync/network_transport.py +24 -3
- package/core/cloud_sync/sensitive_filter.py +2 -2
- package/core/cloud_sync/sync_push.py +12 -10
- package/core/contracts/AGENT_GUIDE.md +6 -9
- package/core/contracts/README.md +2 -2
- package/core/contracts/bugx-runtime-contract.md +1 -1
- package/core/contracts/bugx-worker.md +1 -1
- package/core/contracts/engine_gap_contracts.py +86 -3
- package/core/coverage/coverage_discovery.py +599 -29
- package/core/coverage/coverage_evidence.py +47 -0
- package/core/coverage/coverage_forensics.py +9 -0
- package/core/coverage/coverage_validate.py +6 -1
- package/core/dev_harness/SPEC.md +1 -1
- package/core/engine-integrity.json +591 -419
- package/core/fuzzing/concurrency_fuzzer.py +53 -0
- package/core/fuzzing/differential_oracle.py +562 -27
- package/core/fuzzing/fuzz_input.py +109 -6
- package/core/fuzzing/stateful_fuzzer.py +72 -0
- package/core/governance/secret_redactor.py +22 -10
- package/core/host_acp/SPEC.md +1 -1
- package/core/host_acp/__init__.py +4 -4
- package/core/host_acp/claude.py +59 -1
- package/core/host_acp/cline.py +64 -1
- package/core/host_acp/codex.py +56 -1
- package/core/host_acp/dsh.py +59 -1
- package/core/host_acp/opencode.py +56 -1
- package/core/host_acp/pi.py +59 -1
- package/core/host_acp/zcode.py +59 -1
- package/core/host_runtime/SPEC.md +1 -1
- package/core/host_runtime/adapters.py +1 -1
- package/core/host_runtime/cline.py +13 -0
- package/core/host_runtime/host_evaluators.py +44 -4
- package/core/host_runtime/host_probe.py +1 -1
- package/core/host_runtime/host_provider_arbitrator.py +116 -62
- package/core/host_runtime/host_registry.py +15 -8
- package/core/host_runtime/mcp_registry_gate.py +12 -1
- package/core/host_runtime/pi.py +102 -0
- package/core/host_runtime/provider_facts.py +66 -0
- package/core/hosts/SPEC.md +1 -1
- package/core/hosts/__init__.py +6 -2
- package/core/hosts/_dsh_usage.py +1 -1
- package/core/hosts/base.py +32 -4
- package/core/hosts/claude.py +55 -0
- package/core/hosts/cline.py +6 -2
- package/core/hosts/codex.py +58 -0
- package/core/hosts/dsh.py +9 -1
- package/core/hosts/opencode.py +6 -6
- package/core/hosts/pi.py +159 -2
- package/core/infra/README.md +4 -2
- package/core/infra/__init__.py +2 -0
- package/core/infra/build_info.py +22 -3
- package/core/infra/client_metadata.py +1 -1
- package/core/infra/json_utils.py +22 -0
- package/core/launch_phases/README.md +2 -2
- package/core/launch_phases/SPEC.md +1 -1
- package/core/launch_phases/common.py +21 -2
- package/core/launch_phases/finding_confirm_phase.py +5 -1
- package/core/launch_phases/finding_settlement.py +188 -1
- package/core/launch_phases/judge_phase.py +69 -12
- package/core/launch_phases/orchestrator_controls.py +11 -7
- package/core/launch_phases/post_coverage_sync.py +9 -2
- package/core/launch_phases/post_phase.py +139 -3
- package/core/launch_phases/post_receipt.py +12 -1
- package/core/launch_phases/pre_phase.py +3 -3
- package/core/launch_phases/pre_recon_scout.py +53 -36
- package/core/launch_phases/pre_state_builder.py +23 -176
- package/core/launch_phases/round_orchestrator.py +15 -32
- package/core/launch_phases/session_runtime.py +56 -9
- package/core/launch_phases/startup_gates.py +36 -8
- package/core/launch_phases/startup_interaction.py +68 -12
- package/core/launch_phases/startup_version_gate.py +9 -3
- package/core/launch_phases/supervisor_bridge.py +46 -17
- package/core/launch_phases/supervisor_coverage.py +8 -2
- package/core/launch_phases/supervisor_degraded.py +1 -9
- package/core/launch_phases/worker_barriers.py +15 -5
- package/core/launch_phases/worker_orchestrator.py +105 -25
- package/core/ledger/README.md +1 -1
- package/core/ledger/SPEC.md +1 -1
- package/core/ledger/_facade.py +2 -1
- package/core/ledger/archive_ops.py +60 -2
- package/core/ledger/cli.py +6 -1
- package/core/ledger/export_ops.py +6 -1
- package/core/ledger/finding_confirmation.py +48 -6
- package/core/ledger/finding_lifecycle.py +428 -5
- package/core/ledger/finding_verification.py +44 -8
- package/core/ledger/incidents.py +10 -4
- package/core/ledger/patterns.py +10 -7
- package/core/ledger/receipt_contract.py +17 -1
- package/core/ledger/sync_ops.py +21 -16
- package/core/ledger/tool_experience.py +2 -1
- package/core/ledger/verify_life.py +88 -17
- package/core/locales/en-US.json +2 -2
- package/core/locales/zh-CN.json +2 -2
- package/core/mcp_handlers/SPEC.md +1 -1
- package/core/mcp_handlers/base.py +23 -3
- package/core/mcp_handlers/channel_lifecycle.py +85 -30
- package/core/mcp_handlers/retrieval_handlers.py +11 -1
- package/core/mcp_handlers/rpc_server.py +6 -1
- package/core/mcp_handlers/supervisor_handlers.py +32 -6
- package/core/mcp_handlers/tool_table.py +15 -0
- package/core/mcp_runtime_support/environment.py +0 -38
- package/core/mcp_runtime_support/verifier.py +0 -52
- package/core/metadata.txt +2 -3
- package/core/planning/README.md +1 -1
- package/core/planning/domain_router.py +4 -2
- package/core/planning/dynamic_flow_analyzer.py +219 -14
- package/core/planning/judge_pipeline.py +87 -4
- package/core/planning/prompt_harness.py +7 -5
- package/core/planning/spec_harvester.py +4 -4
- package/core/probes/INTERFACE.md +11 -1
- package/core/probes/SPEC.md +11 -1
- package/core/probes/__init__.py +46 -40
- package/core/probes/android_probe.py +177 -9
- package/core/probes/codebase_memory_probe.py +57 -0
- package/core/probes/desktop_probe.py +104 -0
- package/core/probes/differential_probe.py +99 -21
- package/core/probes/efficiency_probe.py +64 -0
- package/core/probes/ios_binary_probe.py +105 -1
- package/core/probes/memory_probe.py +66 -0
- package/core/probes/miniprogram_probe.py +75 -13
- package/core/probes/mobile_probe.py +215 -30
- package/core/probes/native_probe.py +88 -0
- package/core/probes/openwiki_probe.py +70 -0
- package/core/probes/pattern_probe.py +106 -0
- package/core/probes/platform_probe.py +81 -0
- package/core/probes/probe_registry.py +108 -7
- package/core/probes/sast_fixture_corpus.py +340 -0
- package/core/probes/sast_probe.py +553 -52
- package/core/probes/sast_rules.py +668 -28
- package/core/probes/sca_scanner.py +48 -0
- package/core/probes/ui_accessibility.py +149 -0
- package/core/probes/ui_audit.py +513 -0
- package/core/probes/ui_contract.py +273 -0
- package/core/probes/ui_evidence.py +212 -0
- package/core/probes/ui_measurements.py +314 -0
- package/core/probes/ui_repair.py +250 -0
- package/core/probes/ui_review.py +133 -0
- package/core/probes/ui_storybook.py +107 -0
- package/core/probes/ui_tokens.py +185 -0
- package/core/probes/ui_visual_diff.py +131 -0
- package/core/probes/web_probe.py +373 -18
- package/core/project_profiler/SPEC.md +1 -1
- package/core/project_profiler/arbitrator.py +6 -1
- package/core/project_profiler/detector.py +8 -1
- package/core/project_profiler/strategy.py +51 -15
- package/core/prompts/command_routing_en.md +2 -2
- package/core/prompts/command_routing_zh.md +2 -2
- package/core/prompts/stages/stage_repair.md +1 -1
- package/core/repair/README.md +1 -1
- package/core/repair/l7_repair_loop.py +1 -4
- package/core/repair/rsi_fixer.py +4 -4
- package/core/repair/rsi_loop.py +1 -3
- package/core/repair/rsi_repair.py +7 -7
- package/core/repair/rsi_scope.py +27 -8
- package/core/report_engine/SPEC.md +1 -1
- package/core/report_engine/attestation.py +8 -4
- package/core/report_engine/finding_report.py +2 -1
- package/core/report_engine/models.py +7 -9
- package/core/report_engine/sast_bridge.py +2 -2
- package/core/report_engine/server.py +18 -8
- package/core/report_engine/web-conformance.md +123 -18
- package/core/report_engine/web_conformance.py +21 -52
- package/core/retrieval/README.md +1 -1
- package/core/retrieval/SPEC.md +1 -1
- package/core/retrieval/code_analyzer.py +50 -14
- package/core/retrieval/context_assembler.py +7 -1
- package/core/retrieval/knowledge_sync.py +108 -14
- package/core/retrieval/symbol_index.py +25 -6
- package/core/retrieval/universal_code_matcher.py +234 -49
- package/core/runtime/README.md +1 -1
- package/core/runtime/bugx_logging.py +78 -7
- package/core/runtime/fixture_solidify.py +5 -10
- package/core/runtime/incident_eval.py +1 -1
- package/core/runtime/model_runner.py +4 -41
- package/core/runtime/platform_adapter.py +2 -2
- package/core/runtime/prep_validate.py +4 -2
- package/core/runtime/project_settings.py +2 -1
- package/core/runtime/scenario_eval.py +50 -8
- package/core/skills/bugx_docs_mcp_server.py +3 -1
- package/core/skills/bugx_mcp_server.py +29 -2
- package/core/skills/tools_kb.py +1 -1
- package/core/supervisor/README.md +1 -1
- package/core/supervisor/SPEC.md +1 -1
- package/core/supervisor/budget_governor.py +503 -9
- package/core/supervisor/checkpoint_pipeline.py +248 -6
- package/core/supervisor/checkpoint_sync.py +13 -0
- package/core/supervisor/claim_events.py +1 -1
- package/core/supervisor/finding_workflow.py +22 -5
- package/core/supervisor/lease_manager.py +1 -1
- package/core/supervisor/lifecycle_blocks.py +6 -1
- package/core/supervisor/rejection_remedies.py +52 -5
- package/core/supervisor/serial_authorization.py +48 -4
- package/core/supervisor/task_scheduler.py +2 -2
- package/core/supervisor/worker_checkpoint.py +8 -1
- package/core/supervisor/worker_runtime.py +8 -2
- package/core/supervisor_types/worker_claim.py +9 -0
- package/core/webui/README.md +1 -1
- package/core/webui/SPEC.md +2 -1
- package/core/webui/adapters/claude.py +5 -1
- package/core/webui/adapters/cline.py +10 -2
- package/core/webui/adapters/codex.py +5 -1
- package/core/webui/adapters/dsh.py +5 -1
- package/core/webui/docs_session_service.py +2 -2
- package/core/webui/mcp_inspector.py +11 -7
- package/core/webui/static/00-base.css +1060 -0
- package/core/webui/static/01-monitoring.css +802 -0
- package/core/webui/static/02-header-actions.css +321 -0
- package/core/webui/static/03-trigger-popover.css +697 -0
- package/core/webui/static/04-composer.css +628 -0
- package/core/webui/static/05-skills-center.css +878 -0
- package/core/webui/static/06-mcp-center.css +623 -0
- package/core/webui/static/07-skill-detail.css +265 -0
- package/core/webui/static/08-files-management.css +167 -0
- package/core/webui/static/09-files-center.css +386 -0
- package/core/webui/static/10-icons.css +105 -0
- package/core/webui/static/11-project-options.css +185 -0
- package/core/webui/static/12-profile-tab.css +383 -0
- package/core/webui/static/design-tokens.css +113 -0
- package/core/webui/static/index.html +14 -1
- package/core/webui/workspace_service.py +1 -1
- package/docs/07_distribution/01_README_NPM.md +190 -186
- package/ecosystem/integrations/README.md +1 -1
- package/ecosystem/integrations/dsh/mcp/package.json +1 -1
- package/ecosystem/integrations/dsh/skills/bugx-dsh/SKILL.md +1 -1
- package/ecosystem/integrations/dsh/ui/package.json +1 -1
- package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +4 -4
- package/ecosystem/integrations/opencode/mcp-lock.json +14 -6
- package/ecosystem/integrations/opencode/opencode.json +23 -12
- package/ecosystem/integrations/pi/extensions/bugx/manifest.json +1 -1
- package/ecosystem/integrations/qoder/connector-meta.json +1 -1
- package/ecosystem/integrations/workbuddy/connector-meta.json +1 -1
- package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +1 -1
- package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +1 -1
- package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +1 -1
- package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +2 -2
- package/ecosystem/plugins/bugx/skills/bugx-dsh/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-opencode/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-zcode/SKILL.md +1 -1
- package/interfaces/bin/bugx.js +37 -0
- package/interfaces/cli/bugx_cli/__init__.py +4 -2
- package/interfaces/cli/bugx_cli/cli.py +11 -4
- package/interfaces/cli/bugx_cli/commands/advisory.py +1 -1
- package/interfaces/cli/bugx_cli/commands/agent.py +339 -73
- package/interfaces/cli/bugx_cli/commands/audit.py +2 -2
- package/interfaces/cli/bugx_cli/commands/autonomous.py +1 -1
- package/interfaces/cli/bugx_cli/commands/cloud.py +4 -3
- package/interfaces/cli/bugx_cli/commands/doctor.py +449 -204
- package/interfaces/cli/bugx_cli/commands/interaction.py +5 -1
- package/interfaces/cli/bugx_cli/commands/knowledge.py +2 -0
- package/interfaces/cli/bugx_cli/commands/lifecycle.py +3 -3
- package/interfaces/cli/bugx_cli/commands/plugin.py +55 -20
- package/interfaces/cli/bugx_cli/commands/plugin_claude.py +7 -7
- package/interfaces/cli/bugx_cli/commands/plugin_funide.py +2 -1
- package/interfaces/cli/bugx_cli/commands/plugin_zcode.py +1 -1
- package/interfaces/cli/bugx_cli/commands/report.py +2 -6
- package/interfaces/cli/bugx_cli/commands/system.py +11 -11
- package/interfaces/cli/bugx_cli/common.py +15 -7
- package/interfaces/cli/bugx_cli/host_adapters.py +29 -54
- package/interfaces/cli/bugx_cli/hosts/registry.py +8 -6
- package/interfaces/cli/bugx_cli/infra/ai_advisor.py +157 -27
- package/interfaces/cli/bugx_cli/infra/engine_installer.py +18 -10
- package/interfaces/cli/bugx_cli/infra/host_sync.py +11 -8
- package/interfaces/cli/bugx_cli/infra/mcp_advisor.py +76 -5
- package/interfaces/cli/bugx_cli/infra/security.py +13 -6
- package/package.json +2 -1
- package/pyproject.toml +20 -8
- package/scripts/ensure-python.mjs +7 -7
- package/scripts/sync-version.mjs +10 -21
- package/scripts/test-npm-wrapper.mjs +1 -1
- package/core/webui/static/project-settings.css +0 -6458
- package/docs/07_distribution/README.md +0 -16
- package/docs/README.md +0 -121
- package/interfaces/README.md +0 -143
- package/interfaces/bin/README.md +0 -35
- package/interfaces/cli/README.md +0 -90
- package/scripts/README.md +0 -118
|
@@ -313,6 +313,15 @@ class WorkerClaim:
|
|
|
313
313
|
raise PersistenceError("worker claim submitted_at 必须是有限正数")
|
|
314
314
|
if claim.round_no < 1:
|
|
315
315
|
raise PersistenceError("worker claim round_no 必须 >= 1")
|
|
316
|
+
# F-RSI-20261118-008 存量迁移:D27 清淤(lifecycle_blocks._release_owner_
|
|
317
|
+
# cancelled_debris)曾把「claimed 未 start」的残渣写成 ``state="preempted"``
|
|
318
|
+
# (execution_state 仍为 claimed),但该状态从未注册进白名单/映射——读取
|
|
319
|
+
# 端 post 结算直接 PersistenceError(worktree post 硬失败实证)。写入端已
|
|
320
|
+
# 改为 released(同 execution_state 归位),此处对存量 preempted 归一化
|
|
321
|
+
# 为 released(preempted_reason 保留历史原因),随后按既有白名单校验。
|
|
322
|
+
if claim.state == "preempted":
|
|
323
|
+
claim.state = "released"
|
|
324
|
+
claim.execution_state = "released"
|
|
316
325
|
if claim.state not in {"active", "submitted", "expired", "released", "superseded"}:
|
|
317
326
|
raise PersistenceError(f"未知 claim 状态: {claim.state}")
|
|
318
327
|
execution_by_claim_state = {
|
package/core/webui/README.md
CHANGED
|
@@ -46,7 +46,7 @@ flowchart TD
|
|
|
46
46
|
| `INTERFACE.md` | WebUI API 接口契约说明文档,包含完整 REST 端点清单与返回格式 | HTTP 端点规范 |
|
|
47
47
|
| `mcp_inspector.py` | MCP 工具检查器,提供可视化测试 MCP 工具、查看 Schema 和状态的能力 | `MCPInspectorService` |
|
|
48
48
|
| `SPEC.md` | Web 工作台设计规范,包括安全凭据认证与 CORS 限制规范 | 设计规范说明 |
|
|
49
|
-
| `static/` | 嵌入式前端工作台静态资源(SVG
|
|
49
|
+
| `static/` | 嵌入式前端工作台静态资源(SVG 矢量图标、响应式样式、离线运行时)。CSS 架构(F-023 v1):`design-tokens.css`(实测等值 token 层:2px 间距坡道/rem 字号刻度/圆角/语义色板)→ 13 个分节样式文件(00-base…12-profile-tab,按序加载)→ `index.html` 以 `?v=` 缓存戳接线;原 6458 行单文件 override 层已拆分,拆分经字节级等值探针 + Playwright 像素差分(bbox=None)双验收 | 前端静态资产 |
|
|
50
50
|
| `workspace_service.py` | 工作区状态服务,实时拉取文件变更、Git 状态与覆盖率数据给前端渲染 | `WorkspaceService` |
|
|
51
51
|
|
|
52
52
|
---
|
package/core/webui/SPEC.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
## 2. Dependency & Interaction Topology
|
|
10
10
|
- **Inbound Invocations**: Started via `bugx report serve` or background daemon.
|
|
11
11
|
- **Outbound Dependencies**: Serves frontend static assets (dist/) and exposes REST/WebSocket APIs.
|
|
12
|
+
- **CSS Architecture Invariant (F-023)**: `design-tokens.css` 必须最先加载;分节样式(00-base…12-profile-tab)按序跟随;间距/字号/圆角/色板改动应消费 token(var(--sp-*/--fs-*/--radius-*/--bx-*)而非新增字面值;新增样式进对应分节文件,禁止复活 6458 行单文件模式。!important 属 override 层既有对抗产物(576 处,同 selector 零精确重复——已实测无可机械削减子集),新代码禁止新增。
|
|
12
13
|
|
|
13
14
|
## 3. System Invariants & Failure Modes
|
|
14
15
|
- **Safety Invariant**: Port conflict must fail gracefully; binds locally (127.0.0.1) by default for security.
|
|
@@ -21,5 +22,5 @@ app = create_app()
|
|
|
21
22
|
```
|
|
22
23
|
|
|
23
24
|
## 5. Maintenance & Verification
|
|
24
|
-
-
|
|
25
|
+
- Verification is performed with short-lived tests outside the repository; no persistent `tests/` registry is retained.
|
|
25
26
|
- Changes to exported interfaces must be synchronized via `python3 scripts/gen_interface_spec.py --package core/webui --write`.
|
|
@@ -74,7 +74,11 @@ class ClaudeHostAdapter(BaseHostAdapter):
|
|
|
74
74
|
auto_approve: bool = True,
|
|
75
75
|
target_files: list[str] | None = None,
|
|
76
76
|
) -> tuple[list[str], dict[str, str]]:
|
|
77
|
-
bin_path = shutil.which("claude")
|
|
77
|
+
bin_path = shutil.which("claude")
|
|
78
|
+
if not bin_path:
|
|
79
|
+
raise RuntimeError(
|
|
80
|
+
"claude CLI 未在 PATH 中找到;请先安装 Claude Code 并确认 claude 可执行"
|
|
81
|
+
)
|
|
78
82
|
clean_msg = prompt.strip()
|
|
79
83
|
|
|
80
84
|
env = os.environ.copy()
|
|
@@ -40,10 +40,14 @@ class ClineHostAdapter(BaseHostAdapter):
|
|
|
40
40
|
if w:
|
|
41
41
|
cand_paths.append(Path(w).resolve().parent / ".cline")
|
|
42
42
|
cand_paths.extend([
|
|
43
|
-
Path("/Users/sp/.nvm/versions/node/v24.18.1/lib/node_modules/cline/bin/.cline"),
|
|
44
43
|
Path("/usr/local/lib/node_modules/cline/bin/.cline"),
|
|
45
44
|
Path("/opt/homebrew/lib/node_modules/cline/bin/.cline"),
|
|
46
45
|
])
|
|
46
|
+
# nvm 多版本泛化:任何 node 版本下的 cline 都可作为候选(禁止个人绝对路径)。
|
|
47
|
+
for nvm_cline in sorted(Path.home().glob(
|
|
48
|
+
".nvm/versions/node/*/lib/node_modules/cline/bin/.cline"
|
|
49
|
+
)):
|
|
50
|
+
cand_paths.append(nvm_cline)
|
|
47
51
|
for p in cand_paths:
|
|
48
52
|
if p.is_file():
|
|
49
53
|
return p
|
|
@@ -285,7 +289,11 @@ class ClineHostAdapter(BaseHostAdapter):
|
|
|
285
289
|
auto_approve: bool = True,
|
|
286
290
|
target_files: list[str] | None = None,
|
|
287
291
|
) -> tuple[list[str], dict[str, str]]:
|
|
288
|
-
bin_path = shutil.which("cline")
|
|
292
|
+
bin_path = shutil.which("cline")
|
|
293
|
+
if not bin_path:
|
|
294
|
+
raise RuntimeError(
|
|
295
|
+
"cline CLI 未在 PATH 中找到;请先安装 Cline 并确认 cline 可执行"
|
|
296
|
+
)
|
|
289
297
|
clean_msg = prompt.strip()
|
|
290
298
|
|
|
291
299
|
env = os.environ.copy()
|
|
@@ -102,7 +102,11 @@ class CodexHostAdapter(BaseHostAdapter):
|
|
|
102
102
|
auto_approve: bool = True,
|
|
103
103
|
target_files: list[str] | None = None,
|
|
104
104
|
) -> tuple[list[str], dict[str, str]]:
|
|
105
|
-
bin_path = shutil.which("codex")
|
|
105
|
+
bin_path = shutil.which("codex")
|
|
106
|
+
if not bin_path:
|
|
107
|
+
raise RuntimeError(
|
|
108
|
+
"codex CLI 未在 PATH 中找到;请先安装 OpenAI Codex 并确认 codex 可执行"
|
|
109
|
+
)
|
|
106
110
|
clean_msg = prompt.strip()
|
|
107
111
|
|
|
108
112
|
env = os.environ.copy()
|
|
@@ -147,7 +147,11 @@ class DshHostAdapter(BaseHostAdapter):
|
|
|
147
147
|
auto_approve: bool = True,
|
|
148
148
|
target_files: list[str] | None = None,
|
|
149
149
|
) -> tuple[list[str], dict[str, str]]:
|
|
150
|
-
bin_path = shutil.which("dsh")
|
|
150
|
+
bin_path = shutil.which("dsh")
|
|
151
|
+
if not bin_path:
|
|
152
|
+
raise RuntimeError(
|
|
153
|
+
"dsh CLI 未在 PATH 中找到;请先安装 DeepSeek Harness 并确认 dsh 可执行"
|
|
154
|
+
)
|
|
151
155
|
clean_msg = prompt.strip()
|
|
152
156
|
|
|
153
157
|
env = os.environ.copy()
|
|
@@ -159,8 +159,8 @@ def _get_models_list(self, provider: Optional[str] = None) -> list[dict[str, Any
|
|
|
159
159
|
|
|
160
160
|
host_specs = [
|
|
161
161
|
("cline", "Cline", "auto", False, shutil.which("cline") or Path("/opt/homebrew/bin/cline").is_file()),
|
|
162
|
-
("codex", "Codex", "openai", True, shutil.which("codex")
|
|
163
|
-
("claude", "Claude Code", "anthropic", False, shutil.which("claude")
|
|
162
|
+
("codex", "Codex", "openai", True, bool(shutil.which("codex"))),
|
|
163
|
+
("claude", "Claude Code", "anthropic", False, bool(shutil.which("claude"))),
|
|
164
164
|
("opencode", "OpenCode", "auto", False, shutil.which("opencode") or Path("/opt/homebrew/bin/opencode").is_file()),
|
|
165
165
|
("pi", "Pi Agent", "auto", False, shutil.which("pi") or (Path.home() / ".pi/agent/bin/pi").is_file() or Path("/opt/homebrew/bin/pi").is_file()),
|
|
166
166
|
("zcode", "ZCode", "zhipu", False, bool(shutil.which("zcode") or Path("/Applications/ZCode.app").is_dir() or (Path.home() / "Applications/ZCode.app").is_dir() or (Path.home() / ".zcode").is_dir() or Path("/opt/homebrew/bin/zcode").is_file())),
|
|
@@ -435,15 +435,18 @@ def inspect_workspace_mcp(workspace_path: Path | str) -> dict[str, Any]:
|
|
|
435
435
|
cmd_str = f"{cmd} {' '.join(str(a) for a in args)}".strip()
|
|
436
436
|
is_disabled = bool(cfg.get("disabled")) or (name in disabled_mcps)
|
|
437
437
|
|
|
438
|
-
tool_count
|
|
438
|
+
# F-RSI-20261115-317:tool_count 是按名字片段猜测的启发式估计值
|
|
439
|
+
# (真实工具数由 runtime 会话握手后 tools/list 才确定)。字段改名
|
|
440
|
+
# estimated_tool_count 防止宿主把它当真实计数消费。
|
|
441
|
+
estimated_tool_count = 6
|
|
439
442
|
if "supervisor" in name:
|
|
440
|
-
|
|
443
|
+
estimated_tool_count = 12
|
|
441
444
|
elif "docs" in name:
|
|
442
|
-
|
|
445
|
+
estimated_tool_count = 4
|
|
443
446
|
elif "memory" in name:
|
|
444
|
-
|
|
447
|
+
estimated_tool_count = 14
|
|
445
448
|
elif "playwright" in name:
|
|
446
|
-
|
|
449
|
+
estimated_tool_count = 10
|
|
447
450
|
|
|
448
451
|
reg_info = registry.get(name) or {}
|
|
449
452
|
raw_creds = reg_info.get("credentials")
|
|
@@ -461,8 +464,9 @@ def inspect_workspace_mcp(workspace_path: Path | str) -> dict[str, Any]:
|
|
|
461
464
|
"name": name,
|
|
462
465
|
"enabled": not is_disabled,
|
|
463
466
|
"status": status,
|
|
464
|
-
|
|
465
|
-
|
|
467
|
+
# project-settings.js 消费 tool_count 字段名(向后兼容);
|
|
468
|
+
# 值是启发式估计非真实计数(F-RSI-20261115-317)。
|
|
469
|
+
"tool_count": estimated_tool_count,
|
|
466
470
|
"command": cmd_str or "stdio",
|
|
467
471
|
"source": str(mcp_file.relative_to(ws)),
|
|
468
472
|
"tier": reg_info.get("tier", "custom"),
|