feat: Agent Builder 커스텀 JSON-RPC 스펙 및 에러코드 적용, McpBridge 문자열 ID 지원

This commit is contained in:
jade
2026-07-10 17:46:59 +09:00
parent 0d0c51844a
commit dfd9615942
10 changed files with 58 additions and 104 deletions

View File

@@ -96,13 +96,26 @@ public class McpBridge {
int idx = line.indexOf("\"id\":");
if (idx == -1) return "null";
int start = idx + 5;
while (start < line.length() && (line.charAt(start) == ' ' || line.charAt(start) == '\"')) {
while (start < line.length() && line.charAt(start) == ' ') {
start++;
}
if (start >= line.length()) return "null";
int end = start;
while (end < line.length() && Character.isDigit(line.charAt(end))) {
end++;
if (line.charAt(start) == '\"') {
end = start + 1;
while (end < line.length() && line.charAt(end) != '\"') {
end++;
}
if (end < line.length()) {
end++; // include closing quote
}
} else {
while (end < line.length() && Character.isDigit(line.charAt(end))) {
end++;
}
}
if (start == end) return "null";
return line.substring(start, end);
}