|
|
|
|
@ -59,7 +59,7 @@ function parseOne(text, startIdx) {
@@ -59,7 +59,7 @@ function parseOne(text, startIdx) {
|
|
|
|
|
const closeIdx = text.indexOf(CLOSE_B64, startIdx + OPEN_B64.length); |
|
|
|
|
if (closeIdx < 0) return null; |
|
|
|
|
const raw = text.slice(startIdx + OPEN_B64.length, closeIdx); |
|
|
|
|
const json = b64DecodeUtf8(raw); |
|
|
|
|
let json = null; try { json = b64DecodeUtf8(raw); } catch (e) { return null; } |
|
|
|
|
const obj = tryParseJson(json); |
|
|
|
|
if (!obj || typeof obj !== 'object' || !obj.tool) return null; |
|
|
|
|
return { call: obj, nextIdx: closeIdx + CLOSE_B64.length }; |
|
|
|
|
|