@probelabs/probe 0.6.0-rc296 → 0.6.0-rc298
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/bin/binaries/{probe-v0.6.0-rc296-aarch64-apple-darwin.tar.gz → probe-v0.6.0-rc298-aarch64-apple-darwin.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc296-aarch64-unknown-linux-musl.tar.gz → probe-v0.6.0-rc298-aarch64-unknown-linux-musl.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc296-x86_64-apple-darwin.tar.gz → probe-v0.6.0-rc298-x86_64-apple-darwin.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc296-x86_64-pc-windows-msvc.zip → probe-v0.6.0-rc298-x86_64-pc-windows-msvc.zip} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc296-x86_64-unknown-linux-musl.tar.gz → probe-v0.6.0-rc298-x86_64-unknown-linux-musl.tar.gz} +0 -0
- package/build/agent/ProbeAgent.d.ts +32 -0
- package/build/agent/ProbeAgent.js +20 -1
- package/build/agent/mcp/client.js +34 -0
- package/build/agent/mcp/xmlBridge.js +2 -1
- package/cjs/agent/ProbeAgent.cjs +237 -153
- package/cjs/index.cjs +237 -153
- package/package.json +2 -2
- package/src/agent/ProbeAgent.d.ts +32 -0
- package/src/agent/ProbeAgent.js +20 -1
- package/src/agent/mcp/client.js +34 -0
- package/src/agent/mcp/xmlBridge.js +2 -1
package/cjs/agent/ProbeAgent.cjs
CHANGED
|
@@ -63618,7 +63618,22 @@ function mapFlowchartParserError(err, text) {
|
|
|
63618
63618
|
const lineContent = allLines[Math.max(0, line - 1)] || "";
|
|
63619
63619
|
const beforeQuote = lineContent.slice(0, Math.max(0, column - 1));
|
|
63620
63620
|
const hasLinkBefore = beforeQuote.match(/--\s*$|==\s*$|-\.\s*$|-\.-\s*$|\[\s*$/);
|
|
63621
|
+
const caret0 = Math.max(0, column - 1);
|
|
63622
|
+
const firstBar = lineContent.lastIndexOf("|", caret0);
|
|
63623
|
+
const secondBar = firstBar >= 0 ? lineContent.indexOf("|", caret0 + 1) : -1;
|
|
63624
|
+
const inPipeLabel = firstBar >= 0 && secondBar > firstBar && firstBar < caret0 && secondBar > caret0;
|
|
63621
63625
|
if (inLinkRule || hasLinkBefore) {
|
|
63626
|
+
if (tokType === "QuotedString" && inPipeLabel) {
|
|
63627
|
+
return {
|
|
63628
|
+
line,
|
|
63629
|
+
column,
|
|
63630
|
+
severity: "error",
|
|
63631
|
+
code: "FL-EDGE-LABEL-QUOTE-IN-PIPES",
|
|
63632
|
+
message: "Quotes are not supported inside pipe-delimited edge labels.",
|
|
63633
|
+
hint: "Use " inside |...|, e.g., --|e.g. "navigate to example.com"|-->",
|
|
63634
|
+
length: len
|
|
63635
|
+
};
|
|
63636
|
+
}
|
|
63622
63637
|
if (tokType === "DiamondOpen" || tokType === "DiamondClose") {
|
|
63623
63638
|
return {
|
|
63624
63639
|
line,
|
|
@@ -64220,17 +64235,6 @@ ${br.example}`,
|
|
|
64220
64235
|
if (inRule("arrow") && err.name === "NoViableAltException") {
|
|
64221
64236
|
return { line, column, severity: "error", code: "SE-ARROW-INVALID", message: `Invalid sequence arrow near '${found}'.`, hint: "Use ->, -->, ->>, -->>, -x, --x, -), --), <<->>, or <<-->>", length: len };
|
|
64222
64237
|
}
|
|
64223
|
-
if ((err.name === "NoViableAltException" || err.name === "MismatchedTokenException") && tokType === "Minus") {
|
|
64224
|
-
return {
|
|
64225
|
-
line,
|
|
64226
|
-
column,
|
|
64227
|
-
severity: "error",
|
|
64228
|
-
code: "SE-BULLET-LINE-UNSUPPORTED",
|
|
64229
|
-
message: "Bullet list lines starting with '-' are not supported in sequence diagrams.",
|
|
64230
|
-
hint: "Wrap free\u2011form text in a note block instead, for example:\nNote over A : Item 1\nNote over A\n - Item 1\n - Item 2\nend note",
|
|
64231
|
-
length: len
|
|
64232
|
-
};
|
|
64233
|
-
}
|
|
64234
64238
|
if (inRule("noteStmt")) {
|
|
64235
64239
|
if (err.name === "MismatchedTokenException" && exp("Colon")) {
|
|
64236
64240
|
return { line, column, severity: "error", code: "SE-NOTE-MALFORMED", message: "Malformed note: missing colon before the note text.", hint: "Example: Note right of Alice: Hello", length: len };
|
|
@@ -64239,6 +64243,22 @@ ${br.example}`,
|
|
|
64239
64243
|
return { line, column, severity: "error", code: "SE-NOTE-MALFORMED", message: "Malformed note statement. Use left|right of X or over X[,Y]: text", hint: "Examples: Note over A,B: hi", length: len };
|
|
64240
64244
|
}
|
|
64241
64245
|
}
|
|
64246
|
+
if ((err.name === "NoViableAltException" || err.name === "MismatchedTokenException") && tokType === "Minus") {
|
|
64247
|
+
const nonWs = ltxt.search(/\S/);
|
|
64248
|
+
const minusAtLineStart = nonWs >= 0 && ltxt[nonWs] === "-" && column === nonWs + 1;
|
|
64249
|
+
if (!minusAtLineStart) {
|
|
64250
|
+
} else {
|
|
64251
|
+
return {
|
|
64252
|
+
line,
|
|
64253
|
+
column,
|
|
64254
|
+
severity: "error",
|
|
64255
|
+
code: "SE-BULLET-LINE-UNSUPPORTED",
|
|
64256
|
+
message: "Bullet list lines starting with '-' are not supported in sequence diagrams.",
|
|
64257
|
+
hint: "Wrap free\u2011form text in a note block instead, for example:\nNote over A : Item 1\nNote over A\n - Item 1\n - Item 2\nend note",
|
|
64258
|
+
length: len
|
|
64259
|
+
};
|
|
64260
|
+
}
|
|
64261
|
+
}
|
|
64242
64262
|
if (tokType === "ElseKeyword" && isInRule(err, "criticalBlock")) {
|
|
64243
64263
|
return {
|
|
64244
64264
|
line,
|
|
@@ -65038,7 +65058,7 @@ var Identifier2, NumberLiteral3, SequenceKeyword, ParticipantKeyword, ActorKeywo
|
|
|
65038
65058
|
var init_lexer4 = __esm({
|
|
65039
65059
|
"node_modules/@probelabs/maid/out/diagrams/sequence/lexer.js"() {
|
|
65040
65060
|
init_api6();
|
|
65041
|
-
Identifier2 = createToken({ name: "Identifier", pattern: /[A-Za-z_][A-Za-z0-9_]*/ });
|
|
65061
|
+
Identifier2 = createToken({ name: "Identifier", pattern: /[A-Za-z_][A-Za-z0-9_.]*(?:-(?![>x)\s])[A-Za-z0-9_.]+)*/ });
|
|
65042
65062
|
NumberLiteral3 = createToken({ name: "NumberLiteral", pattern: /[0-9]+/ });
|
|
65043
65063
|
SequenceKeyword = createToken({ name: "SequenceKeyword", pattern: /sequenceDiagram/, longer_alt: Identifier2 });
|
|
65044
65064
|
ParticipantKeyword = createToken({ name: "ParticipantKeyword", pattern: /participant/i, longer_alt: Identifier2 });
|
|
@@ -66858,6 +66878,135 @@ var init_validate5 = __esm({
|
|
|
66858
66878
|
}
|
|
66859
66879
|
});
|
|
66860
66880
|
|
|
66881
|
+
// node_modules/@probelabs/maid/out/core/frontmatter.js
|
|
66882
|
+
function parseFrontmatter(input) {
|
|
66883
|
+
const text = input.startsWith("\uFEFF") ? input.slice(1) : input;
|
|
66884
|
+
const lines = text.split(/\r?\n/);
|
|
66885
|
+
if (lines.length < 3 || lines[0].trim() !== "---")
|
|
66886
|
+
return null;
|
|
66887
|
+
let i = 1;
|
|
66888
|
+
const block = [];
|
|
66889
|
+
while (i < lines.length && lines[i].trim() !== "---") {
|
|
66890
|
+
block.push(lines[i]);
|
|
66891
|
+
i++;
|
|
66892
|
+
}
|
|
66893
|
+
if (i >= lines.length)
|
|
66894
|
+
return null;
|
|
66895
|
+
const body = lines.slice(i + 1).join("\n");
|
|
66896
|
+
const bodyStartLine = i + 2;
|
|
66897
|
+
const raw = block.join("\n");
|
|
66898
|
+
const config2 = {};
|
|
66899
|
+
const themeVars = {};
|
|
66900
|
+
let themeUnderConfig = false;
|
|
66901
|
+
let ctx = "root";
|
|
66902
|
+
for (const line of block) {
|
|
66903
|
+
if (!line.trim())
|
|
66904
|
+
continue;
|
|
66905
|
+
const indent = line.match(/^\s*/)?.[0].length ?? 0;
|
|
66906
|
+
const mKey = line.match(/^\s*([A-Za-z0-9_\-]+):\s*(.*)$/);
|
|
66907
|
+
if (!mKey)
|
|
66908
|
+
continue;
|
|
66909
|
+
const key = mKey[1];
|
|
66910
|
+
let value = mKey[2] || "";
|
|
66911
|
+
if (indent === 0) {
|
|
66912
|
+
if (key === "config") {
|
|
66913
|
+
ctx = "config";
|
|
66914
|
+
continue;
|
|
66915
|
+
}
|
|
66916
|
+
if (key === "themeVariables") {
|
|
66917
|
+
ctx = "theme";
|
|
66918
|
+
continue;
|
|
66919
|
+
}
|
|
66920
|
+
ctx = "root";
|
|
66921
|
+
continue;
|
|
66922
|
+
}
|
|
66923
|
+
if (ctx === "config") {
|
|
66924
|
+
if (indent <= 2 && key !== "pie" && key !== "themeVariables")
|
|
66925
|
+
continue;
|
|
66926
|
+
if (key === "pie") {
|
|
66927
|
+
ctx = "config.pie";
|
|
66928
|
+
ensure(config2, "pie", {});
|
|
66929
|
+
continue;
|
|
66930
|
+
}
|
|
66931
|
+
if (key === "themeVariables") {
|
|
66932
|
+
ctx = "theme";
|
|
66933
|
+
themeUnderConfig = true;
|
|
66934
|
+
continue;
|
|
66935
|
+
}
|
|
66936
|
+
continue;
|
|
66937
|
+
}
|
|
66938
|
+
if (ctx === "config.pie") {
|
|
66939
|
+
if (indent < 4) {
|
|
66940
|
+
if (key === "pie") {
|
|
66941
|
+
ctx = "config.pie";
|
|
66942
|
+
ensure(config2, "pie", {});
|
|
66943
|
+
continue;
|
|
66944
|
+
}
|
|
66945
|
+
if (key === "themeVariables") {
|
|
66946
|
+
ctx = "theme";
|
|
66947
|
+
themeUnderConfig = true;
|
|
66948
|
+
continue;
|
|
66949
|
+
}
|
|
66950
|
+
ctx = "config";
|
|
66951
|
+
continue;
|
|
66952
|
+
}
|
|
66953
|
+
setKV(config2.pie, key, value);
|
|
66954
|
+
continue;
|
|
66955
|
+
}
|
|
66956
|
+
if (ctx === "theme") {
|
|
66957
|
+
if (indent < 2) {
|
|
66958
|
+
ctx = "root";
|
|
66959
|
+
continue;
|
|
66960
|
+
}
|
|
66961
|
+
setKV(themeVars, key, value);
|
|
66962
|
+
continue;
|
|
66963
|
+
}
|
|
66964
|
+
}
|
|
66965
|
+
if (themeUnderConfig && Object.keys(themeVars).length) {
|
|
66966
|
+
ensure(config2, "themeVariables", {});
|
|
66967
|
+
Object.assign(config2.themeVariables, themeVars);
|
|
66968
|
+
}
|
|
66969
|
+
return {
|
|
66970
|
+
raw,
|
|
66971
|
+
body,
|
|
66972
|
+
bodyStartLine,
|
|
66973
|
+
config: Object.keys(config2).length ? config2 : void 0,
|
|
66974
|
+
themeVariables: Object.keys(themeVars).length ? themeVars : void 0
|
|
66975
|
+
};
|
|
66976
|
+
}
|
|
66977
|
+
function ensure(obj, key, def) {
|
|
66978
|
+
if (obj[key] == null)
|
|
66979
|
+
obj[key] = def;
|
|
66980
|
+
}
|
|
66981
|
+
function unquote(val) {
|
|
66982
|
+
const v = val.trim();
|
|
66983
|
+
if (v.startsWith('"') && v.endsWith('"') || v.startsWith("'") && v.endsWith("'")) {
|
|
66984
|
+
return v.slice(1, -1);
|
|
66985
|
+
}
|
|
66986
|
+
return v;
|
|
66987
|
+
}
|
|
66988
|
+
function setKV(target, key, rawValue) {
|
|
66989
|
+
const v = unquote(rawValue);
|
|
66990
|
+
if (v === "") {
|
|
66991
|
+
target[key] = "";
|
|
66992
|
+
return;
|
|
66993
|
+
}
|
|
66994
|
+
const num = Number(v);
|
|
66995
|
+
if (!Number.isNaN(num) && /^-?[0-9]+(\.[0-9]+)?$/.test(v)) {
|
|
66996
|
+
target[key] = num;
|
|
66997
|
+
return;
|
|
66998
|
+
}
|
|
66999
|
+
if (/^(true|false)$/i.test(v)) {
|
|
67000
|
+
target[key] = /^true$/i.test(v);
|
|
67001
|
+
return;
|
|
67002
|
+
}
|
|
67003
|
+
target[key] = v;
|
|
67004
|
+
}
|
|
67005
|
+
var init_frontmatter = __esm({
|
|
67006
|
+
"node_modules/@probelabs/maid/out/core/frontmatter.js"() {
|
|
67007
|
+
}
|
|
67008
|
+
});
|
|
67009
|
+
|
|
66861
67010
|
// node_modules/@probelabs/maid/out/core/router.js
|
|
66862
67011
|
function firstNonCommentLine(text) {
|
|
66863
67012
|
const lines = text.split(/\r?\n/);
|
|
@@ -66872,7 +67021,8 @@ function firstNonCommentLine(text) {
|
|
|
66872
67021
|
return void 0;
|
|
66873
67022
|
}
|
|
66874
67023
|
function detectDiagramType(text) {
|
|
66875
|
-
const
|
|
67024
|
+
const { content } = stripFrontmatter(text);
|
|
67025
|
+
const header = firstNonCommentLine(content);
|
|
66876
67026
|
if (!header)
|
|
66877
67027
|
return "unknown";
|
|
66878
67028
|
if (/^(flowchart|graph)\b/i.test(header))
|
|
@@ -66924,20 +67074,26 @@ function isOtherMermaidDiagram(headerLine) {
|
|
|
66924
67074
|
return OTHER.has(t);
|
|
66925
67075
|
}
|
|
66926
67076
|
function validate(text, options = {}) {
|
|
66927
|
-
const
|
|
67077
|
+
const { content, lineOffset } = stripFrontmatter(text);
|
|
67078
|
+
const type = detectDiagramType(content);
|
|
67079
|
+
const withOffset = (errors) => {
|
|
67080
|
+
if (lineOffset === 0)
|
|
67081
|
+
return errors;
|
|
67082
|
+
return errors.map((e) => ({ ...e, line: Math.max(1, (e.line || 1) + lineOffset) }));
|
|
67083
|
+
};
|
|
66928
67084
|
switch (type) {
|
|
66929
67085
|
case "flowchart":
|
|
66930
|
-
return { type, errors: validateFlowchart(
|
|
67086
|
+
return { type, errors: withOffset(validateFlowchart(content, options)) };
|
|
66931
67087
|
case "pie":
|
|
66932
|
-
return { type, errors: validatePie(
|
|
67088
|
+
return { type, errors: withOffset(validatePie(content, options)) };
|
|
66933
67089
|
case "sequence":
|
|
66934
|
-
return { type, errors: validateSequence(
|
|
67090
|
+
return { type, errors: withOffset(validateSequence(content, options)) };
|
|
66935
67091
|
case "class":
|
|
66936
|
-
return { type, errors: validateClass(
|
|
67092
|
+
return { type, errors: withOffset(validateClass(content, options)) };
|
|
66937
67093
|
case "state":
|
|
66938
|
-
return { type, errors: validateState(
|
|
67094
|
+
return { type, errors: withOffset(validateState(content, options)) };
|
|
66939
67095
|
default:
|
|
66940
|
-
const header = firstNonCommentLine(
|
|
67096
|
+
const header = firstNonCommentLine(content);
|
|
66941
67097
|
if (isOtherMermaidDiagram(header)) {
|
|
66942
67098
|
return { type, errors: [] };
|
|
66943
67099
|
}
|
|
@@ -66945,7 +67101,7 @@ function validate(text, options = {}) {
|
|
|
66945
67101
|
type,
|
|
66946
67102
|
errors: [
|
|
66947
67103
|
{
|
|
66948
|
-
line: 1,
|
|
67104
|
+
line: lineOffset + 1,
|
|
66949
67105
|
column: 1,
|
|
66950
67106
|
message: 'Diagram must start with "graph", "flowchart", "pie", "sequenceDiagram", "classDiagram" or "stateDiagram[-v2]"',
|
|
66951
67107
|
severity: "error",
|
|
@@ -66956,6 +67112,12 @@ function validate(text, options = {}) {
|
|
|
66956
67112
|
};
|
|
66957
67113
|
}
|
|
66958
67114
|
}
|
|
67115
|
+
function stripFrontmatter(text) {
|
|
67116
|
+
const fm = parseFrontmatter(text);
|
|
67117
|
+
if (!fm)
|
|
67118
|
+
return { content: text, lineOffset: 0 };
|
|
67119
|
+
return { content: fm.body, lineOffset: fm.bodyStartLine - 1 };
|
|
67120
|
+
}
|
|
66959
67121
|
var init_router = __esm({
|
|
66960
67122
|
"node_modules/@probelabs/maid/out/core/router.js"() {
|
|
66961
67123
|
init_validate();
|
|
@@ -66963,6 +67125,7 @@ var init_router = __esm({
|
|
|
66963
67125
|
init_validate3();
|
|
66964
67126
|
init_validate4();
|
|
66965
67127
|
init_validate5();
|
|
67128
|
+
init_frontmatter();
|
|
66966
67129
|
}
|
|
66967
67130
|
});
|
|
66968
67131
|
|
|
@@ -67174,16 +67337,18 @@ function computeFixes(text, errors, level = "safe") {
|
|
|
67174
67337
|
}
|
|
67175
67338
|
continue;
|
|
67176
67339
|
}
|
|
67177
|
-
if (is("FL-EDGE-LABEL-BRACKET", e) || is("FL-EDGE-LABEL-CURLY-IN-PIPES", e)) {
|
|
67340
|
+
if (is("FL-EDGE-LABEL-BRACKET", e) || is("FL-EDGE-LABEL-CURLY-IN-PIPES", e) || is("FL-EDGE-LABEL-QUOTE-IN-PIPES", e)) {
|
|
67178
67341
|
const lineText = lineTextAt(text, e.line);
|
|
67179
|
-
const
|
|
67180
|
-
const
|
|
67342
|
+
const col = Math.max(0, e.column - 1);
|
|
67343
|
+
const firstBar = lineText.lastIndexOf("|", col);
|
|
67344
|
+
const secondBar = firstBar >= 0 ? lineText.indexOf("|", col + 1) : -1;
|
|
67181
67345
|
if (firstBar >= 0 && secondBar > firstBar) {
|
|
67182
67346
|
const before = lineText.slice(0, firstBar + 1);
|
|
67183
67347
|
const label = lineText.slice(firstBar + 1, secondBar);
|
|
67184
67348
|
const after = lineText.slice(secondBar);
|
|
67185
67349
|
let fixedLabel = label.replace(/\[/g, "[").replace(/\]/g, "]");
|
|
67186
67350
|
fixedLabel = fixedLabel.replace(/\{/g, "{").replace(/\}/g, "}");
|
|
67351
|
+
fixedLabel = fixedLabel.replace(/\\"/g, """).replace(/"/g, """);
|
|
67187
67352
|
const fixedLine = before + fixedLabel + after;
|
|
67188
67353
|
const finalLine = fixedLine.replace(/\[([^\]]*)\]/g, (m, seg) => "[" + String(seg).replace(/`/g, "") + "]");
|
|
67189
67354
|
edits.push({ start: { line: e.line, column: 1 }, end: { line: e.line, column: lineText.length + 1 }, newText: finalLine });
|
|
@@ -78573,7 +78738,7 @@ ${overlay}</g>`;
|
|
|
78573
78738
|
});
|
|
78574
78739
|
|
|
78575
78740
|
// node_modules/@probelabs/maid/out/renderer/pie-builder.js
|
|
78576
|
-
function
|
|
78741
|
+
function unquote2(s) {
|
|
78577
78742
|
if (!s)
|
|
78578
78743
|
return s;
|
|
78579
78744
|
const first2 = s.charAt(0);
|
|
@@ -78623,7 +78788,7 @@ function buildPieModel(text) {
|
|
|
78623
78788
|
const collect = (k) => {
|
|
78624
78789
|
const arr = tnode.children?.[k] ?? [];
|
|
78625
78790
|
for (const tok of arr)
|
|
78626
|
-
parts.push(
|
|
78791
|
+
parts.push(unquote2(tok.image));
|
|
78627
78792
|
};
|
|
78628
78793
|
collect("QuotedString");
|
|
78629
78794
|
collect("Text");
|
|
@@ -78636,7 +78801,7 @@ function buildPieModel(text) {
|
|
|
78636
78801
|
const labelTok = snode.children?.sliceLabel?.[0]?.children?.QuotedString?.[0];
|
|
78637
78802
|
const numTok = snode.children?.NumberLiteral?.[0];
|
|
78638
78803
|
if (labelTok && numTok) {
|
|
78639
|
-
const label =
|
|
78804
|
+
const label = unquote2(labelTok.image).trim();
|
|
78640
78805
|
const value = Number(numTok.image);
|
|
78641
78806
|
if (!Number.isNaN(value)) {
|
|
78642
78807
|
model.slices.push({ label, value });
|
|
@@ -79792,128 +79957,6 @@ var init_state_renderer = __esm({
|
|
|
79792
79957
|
}
|
|
79793
79958
|
});
|
|
79794
79959
|
|
|
79795
|
-
// node_modules/@probelabs/maid/out/core/frontmatter.js
|
|
79796
|
-
function parseFrontmatter(input) {
|
|
79797
|
-
const text = input.startsWith("\uFEFF") ? input.slice(1) : input;
|
|
79798
|
-
const lines = text.split(/\r?\n/);
|
|
79799
|
-
if (lines.length < 3 || lines[0].trim() !== "---")
|
|
79800
|
-
return null;
|
|
79801
|
-
let i = 1;
|
|
79802
|
-
const block = [];
|
|
79803
|
-
while (i < lines.length && lines[i].trim() !== "---") {
|
|
79804
|
-
block.push(lines[i]);
|
|
79805
|
-
i++;
|
|
79806
|
-
}
|
|
79807
|
-
if (i >= lines.length)
|
|
79808
|
-
return null;
|
|
79809
|
-
const body = lines.slice(i + 1).join("\n");
|
|
79810
|
-
const raw = block.join("\n");
|
|
79811
|
-
const config2 = {};
|
|
79812
|
-
const themeVars = {};
|
|
79813
|
-
let themeUnderConfig = false;
|
|
79814
|
-
let ctx = "root";
|
|
79815
|
-
for (const line of block) {
|
|
79816
|
-
if (!line.trim())
|
|
79817
|
-
continue;
|
|
79818
|
-
const indent = line.match(/^\s*/)?.[0].length ?? 0;
|
|
79819
|
-
const mKey = line.match(/^\s*([A-Za-z0-9_\-]+):\s*(.*)$/);
|
|
79820
|
-
if (!mKey)
|
|
79821
|
-
continue;
|
|
79822
|
-
const key = mKey[1];
|
|
79823
|
-
let value = mKey[2] || "";
|
|
79824
|
-
if (indent === 0) {
|
|
79825
|
-
if (key === "config") {
|
|
79826
|
-
ctx = "config";
|
|
79827
|
-
continue;
|
|
79828
|
-
}
|
|
79829
|
-
if (key === "themeVariables") {
|
|
79830
|
-
ctx = "theme";
|
|
79831
|
-
continue;
|
|
79832
|
-
}
|
|
79833
|
-
ctx = "root";
|
|
79834
|
-
continue;
|
|
79835
|
-
}
|
|
79836
|
-
if (ctx === "config") {
|
|
79837
|
-
if (indent <= 2 && key !== "pie" && key !== "themeVariables")
|
|
79838
|
-
continue;
|
|
79839
|
-
if (key === "pie") {
|
|
79840
|
-
ctx = "config.pie";
|
|
79841
|
-
ensure(config2, "pie", {});
|
|
79842
|
-
continue;
|
|
79843
|
-
}
|
|
79844
|
-
if (key === "themeVariables") {
|
|
79845
|
-
ctx = "theme";
|
|
79846
|
-
themeUnderConfig = true;
|
|
79847
|
-
continue;
|
|
79848
|
-
}
|
|
79849
|
-
continue;
|
|
79850
|
-
}
|
|
79851
|
-
if (ctx === "config.pie") {
|
|
79852
|
-
if (indent < 4) {
|
|
79853
|
-
if (key === "pie") {
|
|
79854
|
-
ctx = "config.pie";
|
|
79855
|
-
ensure(config2, "pie", {});
|
|
79856
|
-
continue;
|
|
79857
|
-
}
|
|
79858
|
-
if (key === "themeVariables") {
|
|
79859
|
-
ctx = "theme";
|
|
79860
|
-
themeUnderConfig = true;
|
|
79861
|
-
continue;
|
|
79862
|
-
}
|
|
79863
|
-
ctx = "config";
|
|
79864
|
-
continue;
|
|
79865
|
-
}
|
|
79866
|
-
setKV(config2.pie, key, value);
|
|
79867
|
-
continue;
|
|
79868
|
-
}
|
|
79869
|
-
if (ctx === "theme") {
|
|
79870
|
-
if (indent < 2) {
|
|
79871
|
-
ctx = "root";
|
|
79872
|
-
continue;
|
|
79873
|
-
}
|
|
79874
|
-
setKV(themeVars, key, value);
|
|
79875
|
-
continue;
|
|
79876
|
-
}
|
|
79877
|
-
}
|
|
79878
|
-
if (themeUnderConfig && Object.keys(themeVars).length) {
|
|
79879
|
-
ensure(config2, "themeVariables", {});
|
|
79880
|
-
Object.assign(config2.themeVariables, themeVars);
|
|
79881
|
-
}
|
|
79882
|
-
return { raw, body, config: Object.keys(config2).length ? config2 : void 0, themeVariables: Object.keys(themeVars).length ? themeVars : void 0 };
|
|
79883
|
-
}
|
|
79884
|
-
function ensure(obj, key, def) {
|
|
79885
|
-
if (obj[key] == null)
|
|
79886
|
-
obj[key] = def;
|
|
79887
|
-
}
|
|
79888
|
-
function unquote2(val) {
|
|
79889
|
-
const v = val.trim();
|
|
79890
|
-
if (v.startsWith('"') && v.endsWith('"') || v.startsWith("'") && v.endsWith("'")) {
|
|
79891
|
-
return v.slice(1, -1);
|
|
79892
|
-
}
|
|
79893
|
-
return v;
|
|
79894
|
-
}
|
|
79895
|
-
function setKV(target, key, rawValue) {
|
|
79896
|
-
const v = unquote2(rawValue);
|
|
79897
|
-
if (v === "") {
|
|
79898
|
-
target[key] = "";
|
|
79899
|
-
return;
|
|
79900
|
-
}
|
|
79901
|
-
const num = Number(v);
|
|
79902
|
-
if (!Number.isNaN(num) && /^-?[0-9]+(\.[0-9]+)?$/.test(v)) {
|
|
79903
|
-
target[key] = num;
|
|
79904
|
-
return;
|
|
79905
|
-
}
|
|
79906
|
-
if (/^(true|false)$/i.test(v)) {
|
|
79907
|
-
target[key] = /^true$/i.test(v);
|
|
79908
|
-
return;
|
|
79909
|
-
}
|
|
79910
|
-
target[key] = v;
|
|
79911
|
-
}
|
|
79912
|
-
var init_frontmatter = __esm({
|
|
79913
|
-
"node_modules/@probelabs/maid/out/core/frontmatter.js"() {
|
|
79914
|
-
}
|
|
79915
|
-
});
|
|
79916
|
-
|
|
79917
79960
|
// node_modules/@probelabs/maid/out/renderer/class-builder.js
|
|
79918
79961
|
function textFromTokens3(tokens) {
|
|
79919
79962
|
if (!tokens || tokens.length === 0)
|
|
@@ -89236,6 +89279,7 @@ var init_client = __esm({
|
|
|
89236
89279
|
this.debug = options.debug || process.env.DEBUG_MCP === "1";
|
|
89237
89280
|
this.config = null;
|
|
89238
89281
|
this.tracer = options.tracer || null;
|
|
89282
|
+
this.agentEvents = options.agentEvents || null;
|
|
89239
89283
|
}
|
|
89240
89284
|
/**
|
|
89241
89285
|
* Record an MCP telemetry event if tracer is available
|
|
@@ -89463,11 +89507,21 @@ var init_client = __esm({
|
|
|
89463
89507
|
throw new Error(`Server ${tool6.serverName} not connected`);
|
|
89464
89508
|
}
|
|
89465
89509
|
const startTime = Date.now();
|
|
89510
|
+
const toolCallId = `mcp-${toolName}-${startTime}`;
|
|
89466
89511
|
this.recordMcpEvent("tool.call_started", {
|
|
89467
89512
|
toolName,
|
|
89468
89513
|
serverName: tool6.serverName,
|
|
89469
89514
|
originalToolName: tool6.originalName
|
|
89470
89515
|
});
|
|
89516
|
+
if (this.agentEvents) {
|
|
89517
|
+
this.agentEvents.emit("toolCall", {
|
|
89518
|
+
toolCallId,
|
|
89519
|
+
name: toolName,
|
|
89520
|
+
args,
|
|
89521
|
+
status: "started",
|
|
89522
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
89523
|
+
});
|
|
89524
|
+
}
|
|
89471
89525
|
try {
|
|
89472
89526
|
if (this.debug) {
|
|
89473
89527
|
console.error(`[MCP DEBUG] Calling ${toolName} with args:`, JSON.stringify(args, null, 2));
|
|
@@ -89497,6 +89551,14 @@ var init_client = __esm({
|
|
|
89497
89551
|
originalToolName: tool6.originalName,
|
|
89498
89552
|
durationMs
|
|
89499
89553
|
});
|
|
89554
|
+
if (this.agentEvents) {
|
|
89555
|
+
this.agentEvents.emit("toolCall", {
|
|
89556
|
+
toolCallId,
|
|
89557
|
+
name: toolName,
|
|
89558
|
+
status: "completed",
|
|
89559
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
89560
|
+
});
|
|
89561
|
+
}
|
|
89500
89562
|
return result;
|
|
89501
89563
|
} catch (error40) {
|
|
89502
89564
|
const durationMs = Date.now() - startTime;
|
|
@@ -89512,6 +89574,14 @@ var init_client = __esm({
|
|
|
89512
89574
|
durationMs,
|
|
89513
89575
|
isTimeout: error40.message.includes("timeout")
|
|
89514
89576
|
});
|
|
89577
|
+
if (this.agentEvents) {
|
|
89578
|
+
this.agentEvents.emit("toolCall", {
|
|
89579
|
+
toolCallId,
|
|
89580
|
+
name: toolName,
|
|
89581
|
+
status: "error",
|
|
89582
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
89583
|
+
});
|
|
89584
|
+
}
|
|
89515
89585
|
throw error40;
|
|
89516
89586
|
}
|
|
89517
89587
|
}
|
|
@@ -89697,6 +89767,7 @@ var init_xmlBridge = __esm({
|
|
|
89697
89767
|
constructor(options = {}) {
|
|
89698
89768
|
this.debug = options.debug || false;
|
|
89699
89769
|
this.tracer = options.tracer || null;
|
|
89770
|
+
this.agentEvents = options.agentEvents || null;
|
|
89700
89771
|
this.mcpTools = {};
|
|
89701
89772
|
this.mcpManager = null;
|
|
89702
89773
|
this.toolDescriptions = {};
|
|
@@ -89739,7 +89810,7 @@ var init_xmlBridge = __esm({
|
|
|
89739
89810
|
if (this.debug) {
|
|
89740
89811
|
console.error("[MCP DEBUG] Initializing MCP client manager...");
|
|
89741
89812
|
}
|
|
89742
|
-
this.mcpManager = new MCPClientManager({ debug: this.debug, tracer: this.tracer });
|
|
89813
|
+
this.mcpManager = new MCPClientManager({ debug: this.debug, tracer: this.tracer, agentEvents: this.agentEvents });
|
|
89743
89814
|
const result = await this.mcpManager.initialize(mcpConfigs);
|
|
89744
89815
|
const vercelTools = this.mcpManager.getVercelTools();
|
|
89745
89816
|
this.mcpTools = vercelTools;
|
|
@@ -97186,7 +97257,7 @@ function deriveDescription(rawDescription, body) {
|
|
|
97186
97257
|
}
|
|
97187
97258
|
return truncateDescription(description);
|
|
97188
97259
|
}
|
|
97189
|
-
function
|
|
97260
|
+
function stripFrontmatter2(content) {
|
|
97190
97261
|
const { body } = extractFrontmatter(content);
|
|
97191
97262
|
return body.trim();
|
|
97192
97263
|
}
|
|
@@ -97327,7 +97398,7 @@ var init_registry = __esm({
|
|
|
97327
97398
|
const skill = this.skillsByName.get(name15);
|
|
97328
97399
|
if (!skill) return null;
|
|
97329
97400
|
const content = await (0, import_promises3.readFile)(skill.skillFilePath, "utf8");
|
|
97330
|
-
return
|
|
97401
|
+
return stripFrontmatter2(content);
|
|
97331
97402
|
}
|
|
97332
97403
|
async _resolveRealPath(target) {
|
|
97333
97404
|
try {
|
|
@@ -102027,7 +102098,7 @@ var init_ProbeAgent = __esm({
|
|
|
102027
102098
|
}
|
|
102028
102099
|
mcpConfig = null;
|
|
102029
102100
|
}
|
|
102030
|
-
this.mcpBridge = new MCPXmlBridge({ debug: this.debug });
|
|
102101
|
+
this.mcpBridge = new MCPXmlBridge({ debug: this.debug, agentEvents: this.events });
|
|
102031
102102
|
await this.mcpBridge.initialize(mcpConfig);
|
|
102032
102103
|
const mcpToolNames = this.mcpBridge.getToolNames();
|
|
102033
102104
|
const mcpToolCount = mcpToolNames.length;
|
|
@@ -102903,6 +102974,14 @@ or
|
|
|
102903
102974
|
active_tools_count: activeToolsList.length
|
|
102904
102975
|
});
|
|
102905
102976
|
}
|
|
102977
|
+
this.events.emit("timeout.extended", {
|
|
102978
|
+
grantedMs,
|
|
102979
|
+
reason: decision.reason || "work in progress",
|
|
102980
|
+
extensionsUsed: negotiatedTimeoutState.extensionsUsed,
|
|
102981
|
+
extensionsRemaining: negotiatedTimeoutState.maxRequests - negotiatedTimeoutState.extensionsUsed,
|
|
102982
|
+
totalExtraTimeMs: negotiatedTimeoutState.totalExtraTimeMs,
|
|
102983
|
+
budgetRemainingMs: remainingBudgetMs - grantedMs
|
|
102984
|
+
});
|
|
102906
102985
|
} else {
|
|
102907
102986
|
if (this.debug) {
|
|
102908
102987
|
console.log(`[DEBUG] Timeout observer: declined extension (reason: ${decision.reason}). Initiating graceful stop.`);
|
|
@@ -102916,6 +102995,11 @@ or
|
|
|
102916
102995
|
active_tools: activeToolsList.map((t) => t.name)
|
|
102917
102996
|
});
|
|
102918
102997
|
}
|
|
102998
|
+
this.events.emit("timeout.windingDown", {
|
|
102999
|
+
reason: decision.reason || "observer declined",
|
|
103000
|
+
extensionsUsed: negotiatedTimeoutState.extensionsUsed,
|
|
103001
|
+
totalExtraTimeMs: negotiatedTimeoutState.totalExtraTimeMs
|
|
103002
|
+
});
|
|
102919
103003
|
await this._initiateGracefulStop(gracefulTimeoutState, `observer declined: ${decision.reason}`);
|
|
102920
103004
|
}
|
|
102921
103005
|
};
|