braid-coding-agent 0.1.0__py3-none-any.whl
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.
- braid_coding_agent/__init__.py +13 -0
- braid_coding_agent/assembly.py +460 -0
- braid_coding_agent/cancellation.py +25 -0
- braid_coding_agent/checkpoint/__init__.py +106 -0
- braid_coding_agent/checkpoint/git.py +305 -0
- braid_coding_agent/checkpoint/settings.py +26 -0
- braid_coding_agent/checkpoint/store.py +1261 -0
- braid_coding_agent/checkpoint/workspace.py +220 -0
- braid_coding_agent/cli.py +2168 -0
- braid_coding_agent/commands/__init__.py +50 -0
- braid_coding_agent/commands/auth.py +161 -0
- braid_coding_agent/commands/config.py +180 -0
- braid_coding_agent/commands/doctor.py +511 -0
- braid_coding_agent/commands/mcp.py +928 -0
- braid_coding_agent/commands/models.py +95 -0
- braid_coding_agent/commands/setup.py +89 -0
- braid_coding_agent/commands/uninstall.py +277 -0
- braid_coding_agent/commands/upgrade.py +381 -0
- braid_coding_agent/compaction/__init__.py +174 -0
- braid_coding_agent/compaction/prepare.py +430 -0
- braid_coding_agent/compaction/summarize.py +542 -0
- braid_coding_agent/compaction/tokens.py +204 -0
- braid_coding_agent/compaction/tool_results.py +196 -0
- braid_coding_agent/compaction/utils.py +181 -0
- braid_coding_agent/config.py +2776 -0
- braid_coding_agent/config_files.py +191 -0
- braid_coding_agent/credentials.py +252 -0
- braid_coding_agent/discovery.py +415 -0
- braid_coding_agent/extensions/__init__.py +77 -0
- braid_coding_agent/extensions/api.py +480 -0
- braid_coding_agent/extensions/runner.py +553 -0
- braid_coding_agent/formatting/__init__.py +62 -0
- braid_coding_agent/formatting/settings.py +87 -0
- braid_coding_agent/formatting/tool.py +179 -0
- braid_coding_agent/lsp/__init__.py +105 -0
- braid_coding_agent/lsp/client.py +546 -0
- braid_coding_agent/lsp/manager.py +187 -0
- braid_coding_agent/lsp/model.py +316 -0
- braid_coding_agent/lsp/protocol.py +105 -0
- braid_coding_agent/lsp/settings.py +120 -0
- braid_coding_agent/lsp/tool.py +429 -0
- braid_coding_agent/mcp/__init__.py +101 -0
- braid_coding_agent/mcp/cache.py +230 -0
- braid_coding_agent/mcp/catalog.py +108 -0
- braid_coding_agent/mcp/config.py +664 -0
- braid_coding_agent/mcp/config_store.py +142 -0
- braid_coding_agent/mcp/inspector.py +85 -0
- braid_coding_agent/mcp/panel.py +254 -0
- braid_coding_agent/mcp/runtime.py +1060 -0
- braid_coding_agent/mcp/tools.py +579 -0
- braid_coding_agent/mcp/trust.py +150 -0
- braid_coding_agent/mcp/tui_panel.py +444 -0
- braid_coding_agent/messages.py +152 -0
- braid_coding_agent/models_view.py +105 -0
- braid_coding_agent/modes/__init__.py +64 -0
- braid_coding_agent/modes/json_mode.py +480 -0
- braid_coding_agent/modes/lifecycle.py +217 -0
- braid_coding_agent/modes/print_mode.py +257 -0
- braid_coding_agent/modes/repl.py +2687 -0
- braid_coding_agent/modes/repl_commands.py +263 -0
- braid_coding_agent/modes/rpc.py +953 -0
- braid_coding_agent/modes/skill_commands.py +88 -0
- braid_coding_agent/modes/tui.py +2226 -0
- braid_coding_agent/modes/tui_control.py +90 -0
- braid_coding_agent/modes/tui_model.py +1043 -0
- braid_coding_agent/modes/tui_render.py +327 -0
- braid_coding_agent/modes/tui_rich.py +751 -0
- braid_coding_agent/modes/tui_style.py +42 -0
- braid_coding_agent/modes/wire.py +81 -0
- braid_coding_agent/netsafe.py +82 -0
- braid_coding_agent/network/__init__.py +20 -0
- braid_coding_agent/network/cache.py +77 -0
- braid_coding_agent/network/fetch.py +311 -0
- braid_coding_agent/network/html_text.py +160 -0
- braid_coding_agent/network/search.py +347 -0
- braid_coding_agent/network/settings.py +103 -0
- braid_coding_agent/network/urls.py +89 -0
- braid_coding_agent/observability/__init__.py +101 -0
- braid_coding_agent/observability/audit.py +124 -0
- braid_coding_agent/observability/collector.py +314 -0
- braid_coding_agent/observability/exporter.py +74 -0
- braid_coding_agent/observability/logging_setup.py +149 -0
- braid_coding_agent/observability/redaction.py +96 -0
- braid_coding_agent/observability/settings.py +29 -0
- braid_coding_agent/observability/spans.py +239 -0
- braid_coding_agent/permissions/__init__.py +185 -0
- braid_coding_agent/permissions/command.py +586 -0
- braid_coding_agent/permissions/engine.py +522 -0
- braid_coding_agent/permissions/evaluate.py +309 -0
- braid_coding_agent/permissions/matching.py +233 -0
- braid_coding_agent/permissions/model.py +278 -0
- braid_coding_agent/permissions/policy.py +99 -0
- braid_coding_agent/permissions/readonly.py +236 -0
- braid_coding_agent/permissions/store.py +379 -0
- braid_coding_agent/project_init.py +313 -0
- braid_coding_agent/prompt/__init__.py +98 -0
- braid_coding_agent/prompt/context_files.py +253 -0
- braid_coding_agent/prompt/project_context.py +172 -0
- braid_coding_agent/prompt/system_prompt.py +378 -0
- braid_coding_agent/questions.py +71 -0
- braid_coding_agent/render/__init__.py +56 -0
- braid_coding_agent/render/batch.py +66 -0
- braid_coding_agent/render/history.py +143 -0
- braid_coding_agent/render/stream.py +823 -0
- braid_coding_agent/render/theme.py +243 -0
- braid_coding_agent/sandbox/__init__.py +89 -0
- braid_coding_agent/sandbox/backend.py +184 -0
- braid_coding_agent/sandbox/bubblewrap.py +96 -0
- braid_coding_agent/sandbox/operations.py +301 -0
- braid_coding_agent/sandbox/policy.py +221 -0
- braid_coding_agent/sandbox/proxy.py +320 -0
- braid_coding_agent/sandbox/seatbelt.py +222 -0
- braid_coding_agent/sdk/__init__.py +31 -0
- braid_coding_agent/sdk/async_client.py +366 -0
- braid_coding_agent/sdk/client.py +386 -0
- braid_coding_agent/sdk/errors.py +52 -0
- braid_coding_agent/sdk/events.py +162 -0
- braid_coding_agent/sdk/types.py +63 -0
- braid_coding_agent/sdk/wire.py +59 -0
- braid_coding_agent/server/__init__.py +54 -0
- braid_coding_agent/server/errors.py +52 -0
- braid_coding_agent/server/http_server.py +419 -0
- braid_coding_agent/server/hub.py +530 -0
- braid_coding_agent/server/openapi.py +157 -0
- braid_coding_agent/server/registry.py +354 -0
- braid_coding_agent/server/router.py +275 -0
- braid_coding_agent/server/run.py +148 -0
- braid_coding_agent/server/schema.py +194 -0
- braid_coding_agent/server/service.py +975 -0
- braid_coding_agent/session/__init__.py +293 -0
- braid_coding_agent/session/agent_session.py +2706 -0
- braid_coding_agent/session/context_breakdown.py +302 -0
- braid_coding_agent/session/discovery.py +212 -0
- braid_coding_agent/session/entries.py +809 -0
- braid_coding_agent/session/evidence.py +295 -0
- braid_coding_agent/session/lock.py +176 -0
- braid_coding_agent/session/manager.py +1185 -0
- braid_coding_agent/session/plan.py +243 -0
- braid_coding_agent/session/plan_mode.py +423 -0
- braid_coding_agent/session/projection.py +262 -0
- braid_coding_agent/session/rewind.py +257 -0
- braid_coding_agent/session/status.py +240 -0
- braid_coding_agent/settings.py +94 -0
- braid_coding_agent/skills/__init__.py +70 -0
- braid_coding_agent/skills/loader.py +681 -0
- braid_coding_agent/startup/__init__.py +76 -0
- braid_coding_agent/startup/cache.py +72 -0
- braid_coding_agent/startup/diagnostics.py +37 -0
- braid_coding_agent/startup/monitor.py +245 -0
- braid_coding_agent/startup/phases.py +79 -0
- braid_coding_agent/startup/project.py +165 -0
- braid_coding_agent/startup/report.py +560 -0
- braid_coding_agent/startup/scheduler.py +347 -0
- braid_coding_agent/statusline.py +163 -0
- braid_coding_agent/subagents/__init__.py +22 -0
- braid_coding_agent/subagents/contract.py +75 -0
- braid_coding_agent/subagents/definitions.py +583 -0
- braid_coding_agent/subagents/registry.py +277 -0
- braid_coding_agent/subagents/runtime.py +610 -0
- braid_coding_agent/subagents/settings.py +156 -0
- braid_coding_agent/subagents/worktree.py +63 -0
- braid_coding_agent/tools/__init__.py +327 -0
- braid_coding_agent/tools/args.py +87 -0
- braid_coding_agent/tools/bash.py +359 -0
- braid_coding_agent/tools/edit.py +298 -0
- braid_coding_agent/tools/edit_diff.py +344 -0
- braid_coding_agent/tools/find.py +158 -0
- braid_coding_agent/tools/grep.py +305 -0
- braid_coding_agent/tools/ignore.py +198 -0
- braid_coding_agent/tools/ls.py +127 -0
- braid_coding_agent/tools/mutation_queue.py +90 -0
- braid_coding_agent/tools/operations.py +274 -0
- braid_coding_agent/tools/output_accumulator.py +282 -0
- braid_coding_agent/tools/output_store.py +244 -0
- braid_coding_agent/tools/path_utils.py +91 -0
- braid_coding_agent/tools/plan.py +141 -0
- braid_coding_agent/tools/prompt_notes.py +52 -0
- braid_coding_agent/tools/question.py +180 -0
- braid_coding_agent/tools/read.py +223 -0
- braid_coding_agent/tools/submit_plan.py +102 -0
- braid_coding_agent/tools/truncate.py +423 -0
- braid_coding_agent/tools/write.py +100 -0
- braid_coding_agent/untrusted.py +50 -0
- braid_coding_agent/verify/__init__.py +78 -0
- braid_coding_agent/verify/runner.py +260 -0
- braid_coding_agent/verify/settings.py +64 -0
- braid_coding_agent/verify/tool.py +143 -0
- braid_coding_agent-0.1.0.dist-info/METADATA +19 -0
- braid_coding_agent-0.1.0.dist-info/RECORD +192 -0
- braid_coding_agent-0.1.0.dist-info/WHEEL +4 -0
- braid_coding_agent-0.1.0.dist-info/entry_points.txt +3 -0
- braid_coding_agent-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""语言服务器的配置形状:谁能启动、处理哪些扩展名、等多久。
|
|
2
|
+
|
|
3
|
+
一个 ``lsp.<name>`` 对象描述一台服务器。字段的取舍:
|
|
4
|
+
|
|
5
|
+
- ``command`` 是 **argv 数组**,不是一段 shell 命令。语言服务器由我们自己 spawn,
|
|
6
|
+
经过 shell 只会多一层引号解析与一条多余的进程;写错一个空格就变成"服务器起不来"。
|
|
7
|
+
- ``extensions`` 决定路由。一台服务器声明自己认识的扩展名,文件按扩展名找第一台
|
|
8
|
+
匹配的服务器;没有声明扩展名的服务器永远收不到文件。
|
|
9
|
+
- ``language_id`` 是 LSP 的 ``languageId`` 字段,由配置文件写死而不是从扩展名猜。
|
|
10
|
+
猜错时服务器的行为是"静默不分析",比启动失败更难排查。
|
|
11
|
+
- ``root_markers`` 用来定工作区根。语言服务器按根目录找项目配置(``pyproject.toml``、
|
|
12
|
+
``go.mod``、``tsconfig.json``),根定错会让它按错误的解释器与依赖分析代码。
|
|
13
|
+
从文件所在目录向上找第一个含标记的目录,找不到就用会话的工作目录。
|
|
14
|
+
- ``timeout_seconds`` 是一次请求的等待上限。语言服务器首次分析一个大项目可以花掉
|
|
15
|
+
十几秒,默认 15 秒;超时之后客户端会被关掉并在下一次调用时重启,不留一个半死的进程。
|
|
16
|
+
|
|
17
|
+
``enabled = false`` 的服务器条目保留在配置里但不启动,``command`` 可以省略——这是
|
|
18
|
+
"临时关掉一台服务器"的写法,不用删掉整段配置。
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
import os
|
|
24
|
+
from collections.abc import Mapping, Sequence
|
|
25
|
+
from dataclasses import dataclass, field
|
|
26
|
+
|
|
27
|
+
from braid_ai.types import JsonValue
|
|
28
|
+
|
|
29
|
+
#: 一次 LSP 请求的默认等待上限(秒)。
|
|
30
|
+
DEFAULT_LSP_TIMEOUT_SECONDS = 15.0
|
|
31
|
+
#: 关闭服务器时等它自己退出的上限(秒)。超时就杀进程组。
|
|
32
|
+
SHUTDOWN_TIMEOUT_SECONDS = 2.0
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@dataclass(slots=True, frozen=True)
|
|
36
|
+
class LspServerSettings:
|
|
37
|
+
"""一台语言服务器的启动方式与路由规则。
|
|
38
|
+
|
|
39
|
+
``name`` 是配置里的表名,用于日志、错误消息与客户端缓存键。
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
name: str
|
|
43
|
+
command: tuple[str, ...]
|
|
44
|
+
extensions: tuple[str, ...]
|
|
45
|
+
language_id: str
|
|
46
|
+
root_markers: tuple[str, ...] = ()
|
|
47
|
+
initialization_options: Mapping[str, JsonValue] = field(default_factory=dict[str, JsonValue])
|
|
48
|
+
env: Mapping[str, str] = field(default_factory=dict[str, str])
|
|
49
|
+
timeout_seconds: float = DEFAULT_LSP_TIMEOUT_SECONDS
|
|
50
|
+
enabled: bool = True
|
|
51
|
+
|
|
52
|
+
def handles(self, path: str) -> bool:
|
|
53
|
+
"""这台服务器是否处理这个文件(只看扩展名,小写比较)。"""
|
|
54
|
+
return os.path.splitext(path)[1].lower() in self.extensions
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@dataclass(slots=True, frozen=True)
|
|
58
|
+
class LspSettings:
|
|
59
|
+
"""全部语言服务器,顺序即路由优先级。"""
|
|
60
|
+
|
|
61
|
+
servers: tuple[LspServerSettings, ...] = ()
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def enabled_servers(self) -> tuple[LspServerSettings, ...]:
|
|
65
|
+
return tuple(server for server in self.servers if server.enabled)
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def has_servers(self) -> bool:
|
|
69
|
+
"""是否有可用的服务器。没有时 CLI 不装配 ``lsp`` 工具。"""
|
|
70
|
+
return bool(self.enabled_servers)
|
|
71
|
+
|
|
72
|
+
def server_for(self, path: str) -> LspServerSettings | None:
|
|
73
|
+
"""按扩展名找第一台匹配的服务器。"""
|
|
74
|
+
for server in self.servers:
|
|
75
|
+
if server.enabled and server.handles(path):
|
|
76
|
+
return server
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
def extensions(self) -> tuple[str, ...]:
|
|
80
|
+
"""全部已启用服务器声明的扩展名,按配置顺序去重。错误消息里用它提示可用值。"""
|
|
81
|
+
seen: dict[str, None] = {}
|
|
82
|
+
for server in self.enabled_servers:
|
|
83
|
+
for extension in server.extensions:
|
|
84
|
+
seen.setdefault(extension, None)
|
|
85
|
+
return tuple(seen)
|
|
86
|
+
|
|
87
|
+
def describe(self) -> str:
|
|
88
|
+
"""一行摘要,给 `/status` 与错误消息用。"""
|
|
89
|
+
if not self.enabled_servers:
|
|
90
|
+
return "未配置语言服务器"
|
|
91
|
+
parts = [
|
|
92
|
+
f"{server.name}[{', '.join(server.extensions)}]" for server in self.enabled_servers
|
|
93
|
+
]
|
|
94
|
+
return " ".join(parts)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def normalize_extension(value: str) -> str:
|
|
98
|
+
"""扩展名归一化:补前导点、转小写。``"PY"`` 与 ``".py"`` 都收。"""
|
|
99
|
+
text = value.strip().lower()
|
|
100
|
+
if not text:
|
|
101
|
+
return text
|
|
102
|
+
return text if text.startswith(".") else f".{text}"
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def merge_extensions(values: Sequence[str]) -> tuple[str, ...]:
|
|
106
|
+
"""一组扩展名:逐个归一化、去掉重复,保持书写顺序。"""
|
|
107
|
+
ordered: dict[str, None] = {}
|
|
108
|
+
for value in values:
|
|
109
|
+
ordered.setdefault(normalize_extension(value), None)
|
|
110
|
+
return tuple(ordered)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
__all__ = [
|
|
114
|
+
"DEFAULT_LSP_TIMEOUT_SECONDS",
|
|
115
|
+
"SHUTDOWN_TIMEOUT_SECONDS",
|
|
116
|
+
"LspServerSettings",
|
|
117
|
+
"LspSettings",
|
|
118
|
+
"merge_extensions",
|
|
119
|
+
"normalize_extension",
|
|
120
|
+
]
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
"""``lsp`` 工具:把编译器的判断交给模型。
|
|
2
|
+
|
|
3
|
+
## 四个动作,一条路由
|
|
4
|
+
|
|
5
|
+
``diagnostics`` / ``definition`` / ``references`` / ``symbols`` 对应 OpenCode 与
|
|
6
|
+
Claude Code 里"LSP 作为工具"的最小可用集合:
|
|
7
|
+
|
|
8
|
+
- **诊断**回答"我刚改的东西错在哪",是修复闭环的起点;
|
|
9
|
+
- **定义跳转**回答"这个名字是哪来的",比 ``grep`` 精确:正则分不清局部变量与同名方法;
|
|
10
|
+
- **引用查找**回答"改这个符号会影响到谁",重构前必查;
|
|
11
|
+
- **符号列表**回答"这个文件/这个仓库里有什么",省掉一次通读。
|
|
12
|
+
|
|
13
|
+
## 行列从 1 开始
|
|
14
|
+
|
|
15
|
+
模型读过 ``grep -n`` 的输出,见过的都是 ``文件:行:列`` 的 1 基写法。工具的参数因此
|
|
16
|
+
也按 1 基收,转换只在 :mod:`braid_coding_agent.lsp.client` 里做一次。
|
|
17
|
+
|
|
18
|
+
## 诊断默认只给 error 与 warning
|
|
19
|
+
|
|
20
|
+
一个中等规模的 Python 文件在 pyright 下常有几十条 ``hint``(未使用的导入提示、
|
|
21
|
+
类型收窄建议)。它们会挤掉真正要修的两条错误。默认门槛是 ``warning``,模型可以用
|
|
22
|
+
``severity = "info"`` 放宽,也可以用 ``severity = "error"`` 只看错误。
|
|
23
|
+
|
|
24
|
+
## 失败要说清是哪一层
|
|
25
|
+
|
|
26
|
+
没有服务器处理这个扩展名、服务器起不来、请求超时、服务器回了错误——四种情况的
|
|
27
|
+
处置完全不同(改配置 / 装服务器 / 重试 / 换个动作),所以错误消息必须带上是哪一层
|
|
28
|
+
出的问题,并且给出下一条可执行的命令(``braid`` 的哪个配置项、哪条安装命令)。
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
from __future__ import annotations
|
|
32
|
+
|
|
33
|
+
import os
|
|
34
|
+
|
|
35
|
+
from braid_agent.tools import AgentTool, AgentToolResult, ToolUpdateSink
|
|
36
|
+
from braid_ai.cancel import CancelToken
|
|
37
|
+
from braid_ai.types import JsonValue, TextContent
|
|
38
|
+
from braid_coding_agent.lsp.manager import LspManager
|
|
39
|
+
from braid_coding_agent.lsp.model import (
|
|
40
|
+
SEVERITIES,
|
|
41
|
+
Diagnostic,
|
|
42
|
+
Severity,
|
|
43
|
+
Symbol,
|
|
44
|
+
severity_at_least,
|
|
45
|
+
)
|
|
46
|
+
from braid_coding_agent.lsp.protocol import (
|
|
47
|
+
LspError,
|
|
48
|
+
LspResponseError,
|
|
49
|
+
LspServerGone,
|
|
50
|
+
LspTimeout,
|
|
51
|
+
)
|
|
52
|
+
from braid_coding_agent.tools.args import (
|
|
53
|
+
optional_integer_arg,
|
|
54
|
+
optional_string_arg,
|
|
55
|
+
string_arg,
|
|
56
|
+
)
|
|
57
|
+
from braid_coding_agent.tools.path_utils import relative_posix, resolve_to_cwd
|
|
58
|
+
from braid_coding_agent.tools.prompt_notes import LSP_GUIDELINES, LSP_SNIPPET
|
|
59
|
+
|
|
60
|
+
#: 一次结果里最多列多少条。超出的部分只报数量,避免一次诊断刷满上下文。
|
|
61
|
+
DEFAULT_LIMIT = 50
|
|
62
|
+
#: 上限。模型可以要求更多,但不能无限。
|
|
63
|
+
MAX_LIMIT = 500
|
|
64
|
+
#: 诊断的默认级别门槛。
|
|
65
|
+
DEFAULT_SEVERITY: Severity = "warning"
|
|
66
|
+
|
|
67
|
+
LSP_ACTION_NAMES: tuple[str, ...] = ("diagnostics", "definition", "references", "symbols")
|
|
68
|
+
|
|
69
|
+
LSP_PARAMETERS: dict[str, JsonValue] = {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"action": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": list(LSP_ACTION_NAMES),
|
|
75
|
+
"description": (
|
|
76
|
+
"diagnostics: errors and warnings for a file; definition: where a symbol is "
|
|
77
|
+
"defined; references: where a symbol is used; symbols: outline of a file, or "
|
|
78
|
+
"workspace-wide search when query is given"
|
|
79
|
+
),
|
|
80
|
+
},
|
|
81
|
+
"path": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"description": "File to inspect (relative or absolute). Required except for a "
|
|
84
|
+
"workspace symbol search with only a query",
|
|
85
|
+
},
|
|
86
|
+
"line": {
|
|
87
|
+
"type": "integer",
|
|
88
|
+
"description": "1-indexed line of the symbol (definition and references)",
|
|
89
|
+
},
|
|
90
|
+
"column": {
|
|
91
|
+
"type": "integer",
|
|
92
|
+
"description": "1-indexed column of the symbol (defaults to 1)",
|
|
93
|
+
},
|
|
94
|
+
"query": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Symbol name to search across the workspace (symbols action)",
|
|
97
|
+
},
|
|
98
|
+
"severity": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"enum": list(SEVERITIES),
|
|
101
|
+
"description": "Minimum severity for diagnostics (default: warning)",
|
|
102
|
+
},
|
|
103
|
+
"limit": {
|
|
104
|
+
"type": "integer",
|
|
105
|
+
"description": f"Maximum items to list (default {DEFAULT_LIMIT}, max {MAX_LIMIT})",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
"required": ["action"],
|
|
109
|
+
"additionalProperties": False,
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def create_lsp_tool(manager: LspManager, *, cwd: str) -> AgentTool:
|
|
114
|
+
"""构造 ``lsp`` 工具。``manager`` 决定用哪台服务器、在哪个根上启动。"""
|
|
115
|
+
|
|
116
|
+
async def execute(
|
|
117
|
+
tool_call_id: str,
|
|
118
|
+
args: dict[str, JsonValue],
|
|
119
|
+
signal: CancelToken | None,
|
|
120
|
+
on_update: ToolUpdateSink,
|
|
121
|
+
) -> AgentToolResult:
|
|
122
|
+
del tool_call_id, on_update
|
|
123
|
+
action = string_arg(args, "action")
|
|
124
|
+
raw_path = optional_string_arg(args, "path")
|
|
125
|
+
query = optional_string_arg(args, "query")
|
|
126
|
+
limit = _limit(args)
|
|
127
|
+
severity = _severity(args)
|
|
128
|
+
try:
|
|
129
|
+
if action == "diagnostics":
|
|
130
|
+
return await _diagnostics(manager, raw_path, severity, limit, signal, cwd=cwd)
|
|
131
|
+
if action in ("definition", "references"):
|
|
132
|
+
return await _locations(manager, action, raw_path, args, limit, signal, cwd=cwd)
|
|
133
|
+
if action == "symbols":
|
|
134
|
+
return await _symbols(manager, raw_path, query, limit, signal, cwd=cwd)
|
|
135
|
+
except LspTimeout as error:
|
|
136
|
+
return _failure(
|
|
137
|
+
f"语言服务器在 {error.seconds:g} 秒内没有返回 {error.method} 的结果。"
|
|
138
|
+
"客户端已重启,可以再试一次;如果反复超时,检查 lsp.<name>.timeout_seconds "
|
|
139
|
+
"与服务器的日志。",
|
|
140
|
+
{"action": action, "error": "timeout", "method": error.method},
|
|
141
|
+
)
|
|
142
|
+
except LspResponseError as error:
|
|
143
|
+
return _failure(
|
|
144
|
+
f"语言服务器拒绝了 {error.method}(错误码 {error.code}):{error.message}",
|
|
145
|
+
{"action": action, "error": "response", "method": error.method},
|
|
146
|
+
)
|
|
147
|
+
except LspServerGone as error:
|
|
148
|
+
return _failure(
|
|
149
|
+
f"{error}。可以用 bash 跑项目自己的检查命令,或检查 lsp 配置。",
|
|
150
|
+
{"action": action, "error": "unavailable"},
|
|
151
|
+
)
|
|
152
|
+
except LspError as error:
|
|
153
|
+
return _failure(
|
|
154
|
+
f"LSP 调用失败:{error}",
|
|
155
|
+
{"action": action, "error": "protocol"},
|
|
156
|
+
)
|
|
157
|
+
except _BadArgument as error:
|
|
158
|
+
return _failure(str(error), {"action": action, "error": "bad_argument"})
|
|
159
|
+
return _failure(
|
|
160
|
+
f"未知的 action {action!r}(可用:{', '.join(LSP_ACTION_NAMES)})",
|
|
161
|
+
{"action": action, "error": "bad_action"},
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
return AgentTool(
|
|
165
|
+
name="lsp",
|
|
166
|
+
label="lsp",
|
|
167
|
+
description=(
|
|
168
|
+
"Ask the project's language server about a file: diagnostics (errors and "
|
|
169
|
+
"warnings), definition and references at a 1-indexed line/column, or the symbol "
|
|
170
|
+
"outline of a file / the whole workspace. Use diagnostics after editing to see "
|
|
171
|
+
"what the compiler thinks before claiming the change is correct."
|
|
172
|
+
),
|
|
173
|
+
parameters=LSP_PARAMETERS,
|
|
174
|
+
execute=execute,
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
async def _diagnostics(
|
|
179
|
+
manager: LspManager,
|
|
180
|
+
raw_path: str | None,
|
|
181
|
+
severity: Severity,
|
|
182
|
+
limit: int,
|
|
183
|
+
signal: CancelToken | None,
|
|
184
|
+
*,
|
|
185
|
+
cwd: str,
|
|
186
|
+
) -> AgentToolResult:
|
|
187
|
+
# 模型给的是相对路径(``src/a.py``),先按会话 cwd 解析:直接把它交给管理器,
|
|
188
|
+
# 语言服务器会相对**进程**的当前目录去找文件,用户看到的是一句"文件不存在"。
|
|
189
|
+
path = resolve_to_cwd(_require_path(raw_path, "diagnostics"), cwd)
|
|
190
|
+
_require_file(path)
|
|
191
|
+
items = await manager.diagnostics(path, signal=signal)
|
|
192
|
+
selected = sorted(
|
|
193
|
+
(item for item in items if severity_at_least(item.severity, severity)),
|
|
194
|
+
key=lambda item: (item.rank, item.path, item.line, item.column),
|
|
195
|
+
)
|
|
196
|
+
counts = {name: 0 for name in SEVERITIES}
|
|
197
|
+
for item in items:
|
|
198
|
+
counts[item.severity] += 1
|
|
199
|
+
summary = ", ".join(f"{counts[name]} {name}" for name in SEVERITIES if counts[name])
|
|
200
|
+
header = (
|
|
201
|
+
f"lsp diagnostics: {relative_posix(path, cwd)} — "
|
|
202
|
+
f"{len(selected)} shown of {len(items)} ({summary or 'none'})"
|
|
203
|
+
)
|
|
204
|
+
if not selected:
|
|
205
|
+
text = (
|
|
206
|
+
f"{header}\nNo {severity} or worse diagnostics."
|
|
207
|
+
if items
|
|
208
|
+
else f"{header}\nNo diagnostics. The file parses and type-checks clean."
|
|
209
|
+
)
|
|
210
|
+
return AgentToolResult(
|
|
211
|
+
content=[TextContent(text=text)],
|
|
212
|
+
details={"action": "diagnostics", "path": path, "count": 0},
|
|
213
|
+
structured_content={"action": "diagnostics", "path": path, "diagnostics": []},
|
|
214
|
+
)
|
|
215
|
+
lines = [header]
|
|
216
|
+
for item in selected[:limit]:
|
|
217
|
+
lines.append(_diagnostic_line(item, cwd))
|
|
218
|
+
if len(selected) > limit:
|
|
219
|
+
lines.append(f"... {len(selected) - limit} more (raise limit to see them)")
|
|
220
|
+
return AgentToolResult(
|
|
221
|
+
content=[TextContent(text="\n".join(lines))],
|
|
222
|
+
details={"action": "diagnostics", "path": path, "count": len(selected)},
|
|
223
|
+
structured_content={
|
|
224
|
+
"action": "diagnostics",
|
|
225
|
+
"path": path,
|
|
226
|
+
"diagnostics": [_diagnostic_wire(item) for item in selected[:limit]],
|
|
227
|
+
},
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
async def _locations(
|
|
232
|
+
manager: LspManager,
|
|
233
|
+
action: str,
|
|
234
|
+
raw_path: str | None,
|
|
235
|
+
args: dict[str, JsonValue],
|
|
236
|
+
limit: int,
|
|
237
|
+
signal: CancelToken | None,
|
|
238
|
+
*,
|
|
239
|
+
cwd: str,
|
|
240
|
+
) -> AgentToolResult:
|
|
241
|
+
path = resolve_to_cwd(_require_path(raw_path, action), cwd)
|
|
242
|
+
_require_file(path)
|
|
243
|
+
line = optional_integer_arg(args, "line")
|
|
244
|
+
if line is None or line < 1:
|
|
245
|
+
return _failure(
|
|
246
|
+
f"{action} 需要 line(1 基行号);先用 grep -n 或 read 找到符号所在行。",
|
|
247
|
+
{"action": action, "error": "missing_position"},
|
|
248
|
+
)
|
|
249
|
+
column = optional_integer_arg(args, "column") or 1
|
|
250
|
+
if column < 1:
|
|
251
|
+
return _failure(
|
|
252
|
+
f"column 必须是从 1 开始的列号,收到 {column}",
|
|
253
|
+
{"action": action, "error": "bad_position"},
|
|
254
|
+
)
|
|
255
|
+
if action == "definition":
|
|
256
|
+
locations = await manager.definition(path, line, column, signal=signal)
|
|
257
|
+
title = "definition"
|
|
258
|
+
else:
|
|
259
|
+
locations = await manager.references(path, line, column, signal=signal)
|
|
260
|
+
title = "references"
|
|
261
|
+
origin = f"{relative_posix(path, cwd)}:{line}:{column}"
|
|
262
|
+
if not locations:
|
|
263
|
+
return AgentToolResult(
|
|
264
|
+
content=[TextContent(text=f"lsp {title}: {origin} → nothing found")],
|
|
265
|
+
details={"action": action, "path": path, "count": 0},
|
|
266
|
+
structured_content={"action": action, "path": path, "locations": []},
|
|
267
|
+
)
|
|
268
|
+
lines = [f"lsp {title}: {origin} → {len(locations)} location(s)"]
|
|
269
|
+
for location in locations[:limit]:
|
|
270
|
+
lines.append(f"{relative_posix(location.path, cwd)}:{location.line}:{location.column}")
|
|
271
|
+
if len(locations) > limit:
|
|
272
|
+
lines.append(f"... {len(locations) - limit} more (raise limit to see them)")
|
|
273
|
+
return AgentToolResult(
|
|
274
|
+
content=[TextContent(text="\n".join(lines))],
|
|
275
|
+
details={"action": action, "path": path, "count": len(locations)},
|
|
276
|
+
structured_content={
|
|
277
|
+
"action": action,
|
|
278
|
+
"path": path,
|
|
279
|
+
"locations": [
|
|
280
|
+
{"path": item.path, "line": item.line, "column": item.column}
|
|
281
|
+
for item in locations[:limit]
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
async def _symbols(
|
|
288
|
+
manager: LspManager,
|
|
289
|
+
raw_path: str | None,
|
|
290
|
+
query: str | None,
|
|
291
|
+
limit: int,
|
|
292
|
+
signal: CancelToken | None,
|
|
293
|
+
*,
|
|
294
|
+
cwd: str,
|
|
295
|
+
) -> AgentToolResult:
|
|
296
|
+
if query is not None and query.strip():
|
|
297
|
+
symbols = await manager.workspace_symbols(query.strip(), signal=signal)
|
|
298
|
+
title = f"workspace symbols: {query.strip()!r}"
|
|
299
|
+
else:
|
|
300
|
+
path = resolve_to_cwd(_require_path(raw_path, "symbols"), cwd)
|
|
301
|
+
_require_file(path)
|
|
302
|
+
symbols = await manager.document_symbols(path, signal=signal)
|
|
303
|
+
title = f"symbols: {relative_posix(path, cwd)}"
|
|
304
|
+
if not symbols:
|
|
305
|
+
return AgentToolResult(
|
|
306
|
+
content=[TextContent(text=f"lsp {title} → no symbols")],
|
|
307
|
+
details={"action": "symbols", "count": 0},
|
|
308
|
+
structured_content={"action": "symbols", "symbols": []},
|
|
309
|
+
)
|
|
310
|
+
lines = [f"lsp {title} → {_count_symbols(symbols)} symbol(s)"]
|
|
311
|
+
for symbol in symbols[:limit]:
|
|
312
|
+
lines.extend(_symbol_lines(symbol))
|
|
313
|
+
if len(symbols) > limit:
|
|
314
|
+
lines.append(f"... {len(symbols) - limit} more top-level symbols")
|
|
315
|
+
return AgentToolResult(
|
|
316
|
+
content=[TextContent(text="\n".join(lines))],
|
|
317
|
+
details={"action": "symbols", "count": _count_symbols(symbols)},
|
|
318
|
+
structured_content={
|
|
319
|
+
"action": "symbols",
|
|
320
|
+
"symbols": [_symbol_wire(symbol) for symbol in symbols[:limit]],
|
|
321
|
+
},
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
def diagnostic_text(item: Diagnostic, cwd: str) -> str:
|
|
326
|
+
"""``文件:行:列 级别: 消息 [code]``。一行的形状决定了模型能不能直接跳到那一行。"""
|
|
327
|
+
location = f"{relative_posix(item.path, cwd)}:{item.line}:{item.column}"
|
|
328
|
+
code = f" [{item.code}]" if item.code else ""
|
|
329
|
+
return f"{location} {item.severity}: {item.message}{code}"
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
def _diagnostic_line(item: Diagnostic, cwd: str) -> str:
|
|
333
|
+
return diagnostic_text(item, cwd)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
def _diagnostic_wire(item: Diagnostic) -> dict[str, JsonValue]:
|
|
337
|
+
return {
|
|
338
|
+
"path": item.path,
|
|
339
|
+
"line": item.line,
|
|
340
|
+
"column": item.column,
|
|
341
|
+
"severity": item.severity,
|
|
342
|
+
"message": item.message,
|
|
343
|
+
"code": item.code,
|
|
344
|
+
"source": item.source,
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def _symbol_lines(symbol: Symbol, depth: int = 0) -> list[str]:
|
|
349
|
+
indent = " " * depth
|
|
350
|
+
detail = f" — {symbol.detail}" if symbol.detail else ""
|
|
351
|
+
location = f" {symbol.path}:{symbol.line}" if symbol.path else f" (line {symbol.line})"
|
|
352
|
+
lines = [f"{indent}{symbol.kind} {symbol.name}{location}{detail}"]
|
|
353
|
+
for child in symbol.children:
|
|
354
|
+
lines.extend(_symbol_lines(child, depth + 1))
|
|
355
|
+
return lines
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
def _symbol_wire(symbol: Symbol) -> dict[str, JsonValue]:
|
|
359
|
+
return {
|
|
360
|
+
"name": symbol.name,
|
|
361
|
+
"kind": symbol.kind,
|
|
362
|
+
"line": symbol.line,
|
|
363
|
+
"path": symbol.path,
|
|
364
|
+
"detail": symbol.detail,
|
|
365
|
+
"children": [_symbol_wire(child) for child in symbol.children],
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
def _count_symbols(symbols: list[Symbol]) -> int:
|
|
370
|
+
return sum(1 + _count_symbols(list(symbol.children)) for symbol in symbols)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
def _limit(args: dict[str, JsonValue]) -> int:
|
|
374
|
+
value = optional_integer_arg(args, "limit")
|
|
375
|
+
if value is None:
|
|
376
|
+
return DEFAULT_LIMIT
|
|
377
|
+
return max(1, min(value, MAX_LIMIT))
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
def _severity(args: dict[str, JsonValue]) -> Severity:
|
|
381
|
+
value = optional_string_arg(args, "severity")
|
|
382
|
+
if value is None:
|
|
383
|
+
return DEFAULT_SEVERITY
|
|
384
|
+
if value not in SEVERITIES:
|
|
385
|
+
raise _BadArgument(f"severity 只能是 {', '.join(SEVERITIES)},收到 {value!r}")
|
|
386
|
+
return value
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
def _require_path(raw: str | None, action: str) -> str:
|
|
390
|
+
if raw is None or not raw.strip():
|
|
391
|
+
raise _BadArgument(f"{action} 需要 path(相对或绝对路径)")
|
|
392
|
+
return raw
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
def _require_file(path: str) -> None:
|
|
396
|
+
if not os.path.exists(path):
|
|
397
|
+
raise _BadArgument(f"文件不存在:{path}")
|
|
398
|
+
if os.path.isdir(path):
|
|
399
|
+
raise _BadArgument(f"{path} 是目录;lsp 只处理单个文件")
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
class _BadArgument(Exception):
|
|
403
|
+
"""参数不足以执行这个动作。调用方翻成 ``is_error`` 结果,不当作服务器故障。"""
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
def _failure(text: str, details: dict[str, JsonValue]) -> AgentToolResult:
|
|
407
|
+
return AgentToolResult(
|
|
408
|
+
content=[TextContent(text=text)],
|
|
409
|
+
details=details,
|
|
410
|
+
is_error=True,
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
#: 系统提示词里这一行怎么介绍 ``lsp``。文字放在 :mod:`braid_coding_agent.tools.prompt_notes`,
|
|
415
|
+
#: 那里不 import 任何东西,汇总点与这里都能安全取用。
|
|
416
|
+
PROMPT_SNIPPET = LSP_SNIPPET
|
|
417
|
+
|
|
418
|
+
#: 只有 ``lsp`` 可执行时才出现的规则条目。
|
|
419
|
+
PROMPT_GUIDELINES: tuple[str, ...] = LSP_GUIDELINES
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
__all__ = [
|
|
423
|
+
"LSP_ACTION_NAMES",
|
|
424
|
+
"LSP_PARAMETERS",
|
|
425
|
+
"PROMPT_GUIDELINES",
|
|
426
|
+
"PROMPT_SNIPPET",
|
|
427
|
+
"create_lsp_tool",
|
|
428
|
+
"diagnostic_text",
|
|
429
|
+
]
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""MCP 接入产品装配:配置文件、连接状态机与工具适配。
|
|
2
|
+
|
|
3
|
+
- :mod:`.config` —— 读 ``~/.braid/mcp.json`` 与 ``<cwd>/.braid/mcp.json``;
|
|
4
|
+
- :mod:`.runtime` —— ``McpServerConnection``(连接与重连)与 ``McpRuntime``
|
|
5
|
+
(扩展:注册工具、会话释放时关连接、``/mcp`` 的状态来源)。
|
|
6
|
+
|
|
7
|
+
协议客户端在 ``braid_mcp``,适配只在这里发生:``braid_mcp`` 不认识 ``AgentTool``,
|
|
8
|
+
``braid_agent`` 不认识 MCP。
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import importlib
|
|
14
|
+
from typing import TYPE_CHECKING
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from braid_coding_agent.mcp.config import (
|
|
18
|
+
DEFAULT_TIMEOUT_SECONDS,
|
|
19
|
+
GLOBAL_CONFIG_NAME,
|
|
20
|
+
PROJECT_CONFIG_DIR,
|
|
21
|
+
TRANSPORT_NAMES,
|
|
22
|
+
LoadedMcpConfig,
|
|
23
|
+
McpOAuthConfig,
|
|
24
|
+
McpServerConfig,
|
|
25
|
+
McpTransportKind,
|
|
26
|
+
load_mcp_config,
|
|
27
|
+
parse_mcp_document,
|
|
28
|
+
)
|
|
29
|
+
from braid_coding_agent.mcp.runtime import (
|
|
30
|
+
HELPER_TOOL_NAMES,
|
|
31
|
+
MAX_TOOL_DESCRIPTION_CHARS,
|
|
32
|
+
MAX_TOOL_NAME_LENGTH,
|
|
33
|
+
MCP_EXTENSION_NAME,
|
|
34
|
+
MCP_PROMPT_SECTION,
|
|
35
|
+
TOOL_NAME_PREFIX,
|
|
36
|
+
McpRuntime,
|
|
37
|
+
McpServerConnection,
|
|
38
|
+
McpServerState,
|
|
39
|
+
McpServerStatus,
|
|
40
|
+
mcp_tool_name,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
_LAZY_EXPORTS: dict[str, str] = {
|
|
44
|
+
"DEFAULT_TIMEOUT_SECONDS": "braid_coding_agent.mcp.config",
|
|
45
|
+
"GLOBAL_CONFIG_NAME": "braid_coding_agent.mcp.config",
|
|
46
|
+
"PROJECT_CONFIG_DIR": "braid_coding_agent.mcp.config",
|
|
47
|
+
"TRANSPORT_NAMES": "braid_coding_agent.mcp.config",
|
|
48
|
+
"LoadedMcpConfig": "braid_coding_agent.mcp.config",
|
|
49
|
+
"McpOAuthConfig": "braid_coding_agent.mcp.config",
|
|
50
|
+
"McpServerConfig": "braid_coding_agent.mcp.config",
|
|
51
|
+
"McpTransportKind": "braid_coding_agent.mcp.config",
|
|
52
|
+
"load_mcp_config": "braid_coding_agent.mcp.config",
|
|
53
|
+
"parse_mcp_document": "braid_coding_agent.mcp.config",
|
|
54
|
+
"HELPER_TOOL_NAMES": "braid_coding_agent.mcp.runtime",
|
|
55
|
+
"MAX_TOOL_DESCRIPTION_CHARS": "braid_coding_agent.mcp.runtime",
|
|
56
|
+
"MAX_TOOL_NAME_LENGTH": "braid_coding_agent.mcp.runtime",
|
|
57
|
+
"MCP_EXTENSION_NAME": "braid_coding_agent.mcp.runtime",
|
|
58
|
+
"MCP_PROMPT_SECTION": "braid_coding_agent.mcp.runtime",
|
|
59
|
+
"TOOL_NAME_PREFIX": "braid_coding_agent.mcp.runtime",
|
|
60
|
+
"McpRuntime": "braid_coding_agent.mcp.runtime",
|
|
61
|
+
"McpServerConnection": "braid_coding_agent.mcp.runtime",
|
|
62
|
+
"McpServerState": "braid_coding_agent.mcp.runtime",
|
|
63
|
+
"McpServerStatus": "braid_coding_agent.mcp.runtime",
|
|
64
|
+
"mcp_tool_name": "braid_coding_agent.mcp.runtime",
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def __getattr__(name: str) -> object:
|
|
69
|
+
"""按需导入导出名。"""
|
|
70
|
+
module_name = _LAZY_EXPORTS.get(name)
|
|
71
|
+
if module_name is None:
|
|
72
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
73
|
+
module = importlib.import_module(module_name)
|
|
74
|
+
value = getattr(module, name)
|
|
75
|
+
globals()[name] = value
|
|
76
|
+
return value
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
__all__ = [
|
|
80
|
+
"DEFAULT_TIMEOUT_SECONDS",
|
|
81
|
+
"GLOBAL_CONFIG_NAME",
|
|
82
|
+
"HELPER_TOOL_NAMES",
|
|
83
|
+
"MAX_TOOL_DESCRIPTION_CHARS",
|
|
84
|
+
"MAX_TOOL_NAME_LENGTH",
|
|
85
|
+
"MCP_EXTENSION_NAME",
|
|
86
|
+
"MCP_PROMPT_SECTION",
|
|
87
|
+
"PROJECT_CONFIG_DIR",
|
|
88
|
+
"TOOL_NAME_PREFIX",
|
|
89
|
+
"TRANSPORT_NAMES",
|
|
90
|
+
"LoadedMcpConfig",
|
|
91
|
+
"McpOAuthConfig",
|
|
92
|
+
"McpRuntime",
|
|
93
|
+
"McpServerConfig",
|
|
94
|
+
"McpServerConnection",
|
|
95
|
+
"McpServerState",
|
|
96
|
+
"McpServerStatus",
|
|
97
|
+
"McpTransportKind",
|
|
98
|
+
"load_mcp_config",
|
|
99
|
+
"mcp_tool_name",
|
|
100
|
+
"parse_mcp_document",
|
|
101
|
+
]
|