@probelabs/probe 0.6.0-rc239 → 0.6.0-rc241
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-rc241-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/{probe-v0.6.0-rc239-aarch64-unknown-linux-musl.tar.gz → probe-v0.6.0-rc241-aarch64-unknown-linux-musl.tar.gz} +0 -0
- package/bin/binaries/probe-v0.6.0-rc241-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc241-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc241-x86_64-unknown-linux-musl.tar.gz +0 -0
- package/build/agent/ProbeAgent.js +20 -2
- package/build/agent/dsl/validator.js +99 -8
- package/build/agent/index.js +213 -22
- package/build/agent/probeTool.js +9 -0
- package/build/agent/schemaUtils.js +34 -10
- package/build/agent/tools.js +9 -0
- package/build/index.js +5 -1
- package/build/tools/common.js +6 -0
- package/build/tools/executePlan.js +136 -2
- package/build/tools/index.js +3 -2
- package/cjs/agent/ProbeAgent.cjs +213 -22
- package/cjs/index.cjs +219 -19
- package/package.json +1 -1
- package/src/agent/ProbeAgent.js +20 -2
- package/src/agent/dsl/validator.js +99 -8
- package/src/agent/probeTool.js +9 -0
- package/src/agent/schemaUtils.js +34 -10
- package/src/agent/tools.js +9 -0
- package/src/index.js +5 -1
- package/src/tools/common.js +6 -0
- package/src/tools/executePlan.js +136 -2
- package/src/tools/index.js +3 -2
- package/bin/binaries/probe-v0.6.0-rc239-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc239-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc239-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc239-x86_64-unknown-linux-musl.tar.gz +0 -0
package/cjs/agent/ProbeAgent.cjs
CHANGED
|
@@ -39352,7 +39352,7 @@ function resolveTargetPath(target, cwd) {
|
|
|
39352
39352
|
}
|
|
39353
39353
|
return filePart + suffix;
|
|
39354
39354
|
}
|
|
39355
|
-
var import_path6, searchSchema, querySchema, extractSchema, delegateSchema, listSkillsSchema, useSkillSchema, bashSchema, analyzeAllSchema, executePlanSchema, attemptCompletionSchema, searchToolDefinition, queryToolDefinition, extractToolDefinition, delegateToolDefinition, attemptCompletionToolDefinition, analyzeAllToolDefinition, bashToolDefinition, googleSearchToolDefinition, urlContextToolDefinition, searchDescription, queryDescription, extractDescription, delegateDescription, analyzeAllDescription, DEFAULT_VALID_TOOLS;
|
|
39355
|
+
var import_path6, searchSchema, querySchema, extractSchema, delegateSchema, listSkillsSchema, useSkillSchema, bashSchema, analyzeAllSchema, executePlanSchema, cleanupExecutePlanSchema, attemptCompletionSchema, searchToolDefinition, queryToolDefinition, extractToolDefinition, delegateToolDefinition, attemptCompletionToolDefinition, analyzeAllToolDefinition, bashToolDefinition, googleSearchToolDefinition, urlContextToolDefinition, searchDescription, queryDescription, extractDescription, delegateDescription, analyzeAllDescription, DEFAULT_VALID_TOOLS;
|
|
39356
39356
|
var init_common2 = __esm({
|
|
39357
39357
|
"src/tools/common.js"() {
|
|
39358
39358
|
"use strict";
|
|
@@ -39401,6 +39401,10 @@ var init_common2 = __esm({
|
|
|
39401
39401
|
code: external_exports.string().min(1).describe("JavaScript DSL code to execute. All function calls look synchronous \u2014 do NOT use async/await. Use map(items, fn) for batch operations. Use LLM(instruction, data) for AI processing."),
|
|
39402
39402
|
description: external_exports.string().optional().describe("Human-readable description of what this plan does, for logging.")
|
|
39403
39403
|
});
|
|
39404
|
+
cleanupExecutePlanSchema = external_exports.object({
|
|
39405
|
+
clearOutputBuffer: external_exports.boolean().optional().default(true).describe("Clear the output buffer from previous execute_plan calls"),
|
|
39406
|
+
clearSessionStore: external_exports.boolean().optional().default(false).describe("Clear the session store (persisted data across execute_plan calls)")
|
|
39407
|
+
});
|
|
39404
39408
|
attemptCompletionSchema = {
|
|
39405
39409
|
// Custom validation that requires result parameter but allows direct XML response
|
|
39406
39410
|
safeParse: (params) => {
|
|
@@ -39748,6 +39752,7 @@ Capabilities:
|
|
|
39748
39752
|
"delegate",
|
|
39749
39753
|
"analyze_all",
|
|
39750
39754
|
"execute_plan",
|
|
39755
|
+
"cleanup_execute_plan",
|
|
39751
39756
|
"listSkills",
|
|
39752
39757
|
"useSkill",
|
|
39753
39758
|
"listFiles",
|
|
@@ -50925,6 +50930,50 @@ var init_walk = __esm({
|
|
|
50925
50930
|
});
|
|
50926
50931
|
|
|
50927
50932
|
// src/agent/dsl/validator.js
|
|
50933
|
+
function offsetToLineColumn(code, offset2) {
|
|
50934
|
+
const lines = code.split("\n");
|
|
50935
|
+
let pos = 0;
|
|
50936
|
+
for (let i5 = 0; i5 < lines.length; i5++) {
|
|
50937
|
+
const lineLength = lines[i5].length + 1;
|
|
50938
|
+
if (pos + lineLength > offset2) {
|
|
50939
|
+
return { line: i5 + 1, column: offset2 - pos + 1 };
|
|
50940
|
+
}
|
|
50941
|
+
pos += lineLength;
|
|
50942
|
+
}
|
|
50943
|
+
return { line: lines.length, column: 1 };
|
|
50944
|
+
}
|
|
50945
|
+
function generateErrorSnippet(code, line, column, contextLines = 2) {
|
|
50946
|
+
const lines = code.split("\n");
|
|
50947
|
+
const startLine = Math.max(0, line - 1 - contextLines);
|
|
50948
|
+
const endLine = Math.min(lines.length, line + contextLines);
|
|
50949
|
+
const snippetLines = [];
|
|
50950
|
+
const lineNumWidth = String(endLine).length;
|
|
50951
|
+
for (let i5 = startLine; i5 < endLine; i5++) {
|
|
50952
|
+
const lineNum = String(i5 + 1).padStart(lineNumWidth, " ");
|
|
50953
|
+
const marker15 = i5 + 1 === line ? ">" : " ";
|
|
50954
|
+
snippetLines.push(`${marker15} ${lineNum} | ${lines[i5]}`);
|
|
50955
|
+
if (i5 + 1 === line) {
|
|
50956
|
+
const padding = " ".repeat(lineNumWidth + 4);
|
|
50957
|
+
const arrow = " ".repeat(Math.max(0, column - 1)) + "^";
|
|
50958
|
+
snippetLines.push(`${padding}${arrow}`);
|
|
50959
|
+
}
|
|
50960
|
+
}
|
|
50961
|
+
return snippetLines.join("\n");
|
|
50962
|
+
}
|
|
50963
|
+
function formatErrorWithSnippet(message, code, offset2 = -1, line = 0, column = 0) {
|
|
50964
|
+
if (offset2 >= 0) {
|
|
50965
|
+
const loc = offsetToLineColumn(code, offset2);
|
|
50966
|
+
line = loc.line;
|
|
50967
|
+
column = loc.column;
|
|
50968
|
+
}
|
|
50969
|
+
if (line <= 0) {
|
|
50970
|
+
return message;
|
|
50971
|
+
}
|
|
50972
|
+
const snippet = generateErrorSnippet(code, line, column);
|
|
50973
|
+
return `${message}
|
|
50974
|
+
|
|
50975
|
+
${snippet}`;
|
|
50976
|
+
}
|
|
50928
50977
|
function validateDSL(code) {
|
|
50929
50978
|
const errors = [];
|
|
50930
50979
|
let ast;
|
|
@@ -50932,40 +50981,54 @@ function validateDSL(code) {
|
|
|
50932
50981
|
ast = parse3(code, {
|
|
50933
50982
|
ecmaVersion: 2022,
|
|
50934
50983
|
sourceType: "script",
|
|
50935
|
-
allowReturnOutsideFunction: true
|
|
50984
|
+
allowReturnOutsideFunction: true,
|
|
50985
|
+
locations: true
|
|
50986
|
+
// Enable location tracking for better error messages
|
|
50936
50987
|
});
|
|
50937
50988
|
} catch (e5) {
|
|
50938
|
-
|
|
50989
|
+
const line = e5.loc?.line || 0;
|
|
50990
|
+
const column = e5.loc?.column ? e5.loc.column + 1 : 0;
|
|
50991
|
+
const formattedError = formatErrorWithSnippet(
|
|
50992
|
+
`Syntax error: ${e5.message}`,
|
|
50993
|
+
code,
|
|
50994
|
+
-1,
|
|
50995
|
+
line,
|
|
50996
|
+
column
|
|
50997
|
+
);
|
|
50998
|
+
return { valid: false, errors: [formattedError] };
|
|
50939
50999
|
}
|
|
51000
|
+
const addError = (message, position) => {
|
|
51001
|
+
errors.push(formatErrorWithSnippet(message, code, position));
|
|
51002
|
+
};
|
|
50940
51003
|
full(ast, (node) => {
|
|
50941
51004
|
if (!ALLOWED_NODE_TYPES.has(node.type)) {
|
|
50942
|
-
|
|
51005
|
+
addError(`Blocked node type: ${node.type}`, node.start);
|
|
50943
51006
|
return;
|
|
50944
51007
|
}
|
|
50945
51008
|
if ((node.type === "ArrowFunctionExpression" || node.type === "FunctionExpression") && node.async) {
|
|
50946
|
-
|
|
51009
|
+
addError(`Async functions are not allowed. Write synchronous code \u2014 the runtime handles async.`, node.start);
|
|
50947
51010
|
}
|
|
50948
51011
|
if (node.type === "FunctionExpression" && node.generator) {
|
|
50949
|
-
|
|
51012
|
+
addError(`Generator functions are not allowed`, node.start);
|
|
50950
51013
|
}
|
|
50951
51014
|
if (node.type === "Identifier" && BLOCKED_IDENTIFIERS.has(node.name)) {
|
|
50952
|
-
|
|
51015
|
+
addError(`Blocked identifier: '${node.name}'`, node.start);
|
|
50953
51016
|
}
|
|
50954
51017
|
if (node.type === "MemberExpression" && !node.computed) {
|
|
50955
51018
|
if (node.property.type === "Identifier" && BLOCKED_PROPERTIES.has(node.property.name)) {
|
|
50956
|
-
|
|
51019
|
+
addError(`Blocked property access: '.${node.property.name}'`, node.property.start);
|
|
50957
51020
|
}
|
|
50958
51021
|
}
|
|
50959
51022
|
if (node.type === "MemberExpression" && node.computed) {
|
|
50960
51023
|
if (node.property.type === "Literal" && typeof node.property.value === "string") {
|
|
50961
51024
|
if (BLOCKED_PROPERTIES.has(node.property.value) || BLOCKED_IDENTIFIERS.has(node.property.value)) {
|
|
50962
|
-
|
|
51025
|
+
addError(`Blocked computed property access: '["${node.property.value}"]'`, node.property.start);
|
|
50963
51026
|
}
|
|
50964
51027
|
}
|
|
50965
51028
|
}
|
|
50966
51029
|
if (node.type === "VariableDeclarator" && node.id.type === "Identifier") {
|
|
50967
51030
|
if (BLOCKED_IDENTIFIERS.has(node.id.name)) {
|
|
50968
|
-
|
|
51031
|
+
addError(`Cannot declare variable with blocked name: '${node.id.name}'`, node.id.start);
|
|
50969
51032
|
}
|
|
50970
51033
|
}
|
|
50971
51034
|
});
|
|
@@ -58279,10 +58342,32 @@ var init_esm5 = __esm({
|
|
|
58279
58342
|
});
|
|
58280
58343
|
|
|
58281
58344
|
// src/tools/executePlan.js
|
|
58345
|
+
function decodeHtmlEntities(str) {
|
|
58346
|
+
const entities = {
|
|
58347
|
+
"&": "&",
|
|
58348
|
+
"<": "<",
|
|
58349
|
+
">": ">",
|
|
58350
|
+
""": '"',
|
|
58351
|
+
"'": "'",
|
|
58352
|
+
"'": "'",
|
|
58353
|
+
"'": "'"
|
|
58354
|
+
};
|
|
58355
|
+
let result = str.replace(/&(?:amp|lt|gt|quot|apos|#39|#x27);/gi, (match2) => {
|
|
58356
|
+
return entities[match2.toLowerCase()] || match2;
|
|
58357
|
+
});
|
|
58358
|
+
result = result.replace(/&#(\d+);/g, (match2, dec) => {
|
|
58359
|
+
return String.fromCharCode(parseInt(dec, 10));
|
|
58360
|
+
});
|
|
58361
|
+
result = result.replace(/&#x([0-9a-f]+);/gi, (match2, hex) => {
|
|
58362
|
+
return String.fromCharCode(parseInt(hex, 16));
|
|
58363
|
+
});
|
|
58364
|
+
return result;
|
|
58365
|
+
}
|
|
58282
58366
|
function stripCodeWrapping(code) {
|
|
58283
58367
|
let s5 = String(code || "");
|
|
58284
58368
|
s5 = s5.replace(/^```(?:javascript|js)?\n?/gm, "").replace(/```$/gm, "");
|
|
58285
58369
|
s5 = s5.replace(/<\/?(?:execute_plan|code)>/g, "");
|
|
58370
|
+
s5 = decodeHtmlEntities(s5);
|
|
58286
58371
|
return s5.trim();
|
|
58287
58372
|
}
|
|
58288
58373
|
function buildToolImplementations(configOptions) {
|
|
@@ -58534,6 +58619,14 @@ Logs: ${result.logs.join(" | ")}` : "";
|
|
|
58534
58619
|
"dsl.error": lastError.substring(0, 1e3)
|
|
58535
58620
|
});
|
|
58536
58621
|
}
|
|
58622
|
+
if (outputBuffer && outputBuffer.items && outputBuffer.items.length > 0) {
|
|
58623
|
+
const clearedChars = outputBuffer.items.reduce((sum, item) => sum + item.length, 0);
|
|
58624
|
+
outputBuffer.items = [];
|
|
58625
|
+
planSpan?.addEvent?.("dsl.auto_cleanup", {
|
|
58626
|
+
"cleanup.chars_cleared": clearedChars,
|
|
58627
|
+
"cleanup.reason": "all_retries_exhausted"
|
|
58628
|
+
});
|
|
58629
|
+
}
|
|
58537
58630
|
finalOutput = `Plan execution failed after ${maxRetries} retries.
|
|
58538
58631
|
|
|
58539
58632
|
Last error: ${lastError}`;
|
|
@@ -58546,6 +58639,9 @@ Last error: ${lastError}`;
|
|
|
58546
58639
|
planSpan?.end?.();
|
|
58547
58640
|
return finalOutput;
|
|
58548
58641
|
} catch (e5) {
|
|
58642
|
+
if (outputBuffer && outputBuffer.items && outputBuffer.items.length > 0) {
|
|
58643
|
+
outputBuffer.items = [];
|
|
58644
|
+
}
|
|
58549
58645
|
planSpan?.setStatus?.("ERROR");
|
|
58550
58646
|
planSpan?.addEvent?.("exception", {
|
|
58551
58647
|
"exception.message": e5.message,
|
|
@@ -58989,6 +59085,62 @@ output(table);
|
|
|
58989
59085
|
return "Generated table with " + results.length + " items.";
|
|
58990
59086
|
\`\`\``;
|
|
58991
59087
|
}
|
|
59088
|
+
function createCleanupExecutePlanTool(options) {
|
|
59089
|
+
const { outputBuffer, sessionStore, tracer } = options;
|
|
59090
|
+
return (0, import_ai4.tool)({
|
|
59091
|
+
description: "Clean up output buffer and session store from previous execute_plan calls. Use this when a previous execute_plan failed and left stale data, or before starting a fresh analysis.",
|
|
59092
|
+
parameters: cleanupExecutePlanSchema,
|
|
59093
|
+
execute: async ({ clearOutputBuffer = true, clearSessionStore = false }) => {
|
|
59094
|
+
const span = tracer?.createToolSpan?.("cleanup_execute_plan", {
|
|
59095
|
+
"cleanup.clear_output_buffer": clearOutputBuffer,
|
|
59096
|
+
"cleanup.clear_session_store": clearSessionStore
|
|
59097
|
+
}) || null;
|
|
59098
|
+
const results = [];
|
|
59099
|
+
try {
|
|
59100
|
+
if (clearOutputBuffer && outputBuffer) {
|
|
59101
|
+
const itemCount = outputBuffer.items?.length || 0;
|
|
59102
|
+
const charCount = outputBuffer.items?.reduce((sum, item) => sum + item.length, 0) || 0;
|
|
59103
|
+
outputBuffer.items = [];
|
|
59104
|
+
results.push(`Output buffer cleared (${itemCount} items, ${charCount} chars)`);
|
|
59105
|
+
}
|
|
59106
|
+
if (clearSessionStore && sessionStore) {
|
|
59107
|
+
const keyCount = Object.keys(sessionStore).length;
|
|
59108
|
+
for (const key of Object.keys(sessionStore)) {
|
|
59109
|
+
delete sessionStore[key];
|
|
59110
|
+
}
|
|
59111
|
+
results.push(`Session store cleared (${keyCount} keys)`);
|
|
59112
|
+
}
|
|
59113
|
+
const output = results.length > 0 ? `Cleanup complete:
|
|
59114
|
+
- ${results.join("\n- ")}` : "Nothing to clean up";
|
|
59115
|
+
span?.setAttributes?.({
|
|
59116
|
+
"cleanup.result": output,
|
|
59117
|
+
"cleanup.success": true
|
|
59118
|
+
});
|
|
59119
|
+
span?.setStatus?.("OK");
|
|
59120
|
+
span?.end?.();
|
|
59121
|
+
return output;
|
|
59122
|
+
} catch (e5) {
|
|
59123
|
+
span?.setStatus?.("ERROR");
|
|
59124
|
+
span?.addEvent?.("exception", { "exception.message": e5.message });
|
|
59125
|
+
span?.end?.();
|
|
59126
|
+
return `Cleanup failed: ${e5.message}`;
|
|
59127
|
+
}
|
|
59128
|
+
}
|
|
59129
|
+
});
|
|
59130
|
+
}
|
|
59131
|
+
function getCleanupExecutePlanToolDefinition() {
|
|
59132
|
+
return `## cleanup_execute_plan
|
|
59133
|
+
Description: Clean up output buffer and session store from previous execute_plan calls. Use when a previous execute_plan failed and left stale data, or before starting a fresh analysis.
|
|
59134
|
+
|
|
59135
|
+
Parameters:
|
|
59136
|
+
- clearOutputBuffer: (optional, default: true) Clear the output buffer from previous execute_plan calls
|
|
59137
|
+
- clearSessionStore: (optional, default: false) Clear the session store (persisted data across execute_plan calls)
|
|
59138
|
+
|
|
59139
|
+
Example:
|
|
59140
|
+
<cleanup_execute_plan>
|
|
59141
|
+
<clearOutputBuffer>true</clearOutputBuffer>
|
|
59142
|
+
</cleanup_execute_plan>`;
|
|
59143
|
+
}
|
|
58992
59144
|
var import_ai4;
|
|
58993
59145
|
var init_executePlan = __esm({
|
|
58994
59146
|
"src/tools/executePlan.js"() {
|
|
@@ -59344,6 +59496,13 @@ function createWrappedTools(baseTools) {
|
|
|
59344
59496
|
baseTools.executePlanTool.execute
|
|
59345
59497
|
);
|
|
59346
59498
|
}
|
|
59499
|
+
if (baseTools.cleanupExecutePlanTool) {
|
|
59500
|
+
wrappedTools.cleanupExecutePlanToolInstance = wrapToolWithEmitter(
|
|
59501
|
+
baseTools.cleanupExecutePlanTool,
|
|
59502
|
+
"cleanup_execute_plan",
|
|
59503
|
+
baseTools.cleanupExecutePlanTool.execute
|
|
59504
|
+
);
|
|
59505
|
+
}
|
|
59347
59506
|
if (baseTools.bashTool) {
|
|
59348
59507
|
wrappedTools.bashToolInstance = wrapToolWithEmitter(
|
|
59349
59508
|
baseTools.bashTool,
|
|
@@ -60260,6 +60419,9 @@ function createTools(configOptions) {
|
|
|
60260
60419
|
}
|
|
60261
60420
|
if (configOptions.enableExecutePlan && isToolAllowed("execute_plan")) {
|
|
60262
60421
|
tools2.executePlanTool = createExecutePlanTool(configOptions);
|
|
60422
|
+
if (isToolAllowed("cleanup_execute_plan")) {
|
|
60423
|
+
tools2.cleanupExecutePlanTool = createCleanupExecutePlanTool(configOptions);
|
|
60424
|
+
}
|
|
60263
60425
|
} else if (isToolAllowed("analyze_all")) {
|
|
60264
60426
|
tools2.analyzeAllTool = analyzeAllTool(configOptions);
|
|
60265
60427
|
}
|
|
@@ -97138,7 +97300,7 @@ __export(schemaUtils_exports, {
|
|
|
97138
97300
|
createJsonCorrectionPrompt: () => createJsonCorrectionPrompt,
|
|
97139
97301
|
createMermaidCorrectionPrompt: () => createMermaidCorrectionPrompt,
|
|
97140
97302
|
createSchemaDefinitionCorrectionPrompt: () => createSchemaDefinitionCorrectionPrompt,
|
|
97141
|
-
decodeHtmlEntities: () =>
|
|
97303
|
+
decodeHtmlEntities: () => decodeHtmlEntities2,
|
|
97142
97304
|
extractMermaidFromJson: () => extractMermaidFromJson,
|
|
97143
97305
|
extractMermaidFromMarkdown: () => extractMermaidFromMarkdown,
|
|
97144
97306
|
generateExampleFromSchema: () => generateExampleFromSchema,
|
|
@@ -97243,7 +97405,7 @@ function enforceNoAdditionalProperties(schema) {
|
|
|
97243
97405
|
applyRecursively(cloned);
|
|
97244
97406
|
return cloned;
|
|
97245
97407
|
}
|
|
97246
|
-
function
|
|
97408
|
+
function decodeHtmlEntities2(text) {
|
|
97247
97409
|
if (!text || typeof text !== "string") {
|
|
97248
97410
|
return text;
|
|
97249
97411
|
}
|
|
@@ -97673,15 +97835,31 @@ function isSimpleTextWrapperSchema(schema) {
|
|
|
97673
97835
|
return null;
|
|
97674
97836
|
}
|
|
97675
97837
|
const trimmed = schema.trim();
|
|
97676
|
-
|
|
97677
|
-
|
|
97678
|
-
|
|
97679
|
-
|
|
97680
|
-
|
|
97681
|
-
|
|
97682
|
-
|
|
97683
|
-
|
|
97838
|
+
try {
|
|
97839
|
+
const parsed = JSON.parse(trimmed);
|
|
97840
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
97841
|
+
} else {
|
|
97842
|
+
const keys2 = Object.keys(parsed);
|
|
97843
|
+
if (keys2.length === 1 && parsed[keys2[0]] === "string") {
|
|
97844
|
+
return { fieldName: keys2[0] };
|
|
97845
|
+
}
|
|
97846
|
+
if (parsed.type === "object" && parsed.properties) {
|
|
97847
|
+
const propKeys = Object.keys(parsed.properties);
|
|
97848
|
+
if (propKeys.length === 1) {
|
|
97849
|
+
const prop = parsed.properties[propKeys[0]];
|
|
97850
|
+
if (prop && prop.type === "string") {
|
|
97851
|
+
return { fieldName: propKeys[0] };
|
|
97852
|
+
}
|
|
97853
|
+
}
|
|
97854
|
+
}
|
|
97855
|
+
return null;
|
|
97684
97856
|
}
|
|
97857
|
+
} catch {
|
|
97858
|
+
}
|
|
97859
|
+
const simplePattern = /^\{\s*["']?(\w+)["']?\s*:\s*["']?string["']?\s*\}$/i;
|
|
97860
|
+
const match2 = trimmed.match(simplePattern);
|
|
97861
|
+
if (match2) {
|
|
97862
|
+
return { fieldName: match2[1] };
|
|
97685
97863
|
}
|
|
97686
97864
|
return null;
|
|
97687
97865
|
}
|
|
@@ -98670,7 +98848,7 @@ When presented with a broken Mermaid diagram, analyze it thoroughly and provide
|
|
|
98670
98848
|
* @returns {Promise<string>} - The corrected Mermaid diagram
|
|
98671
98849
|
*/
|
|
98672
98850
|
async fixMermaidDiagram(diagramContent, originalErrors = [], diagramInfo = {}) {
|
|
98673
|
-
const decodedContent =
|
|
98851
|
+
const decodedContent = decodeHtmlEntities2(diagramContent);
|
|
98674
98852
|
if (decodedContent !== diagramContent) {
|
|
98675
98853
|
try {
|
|
98676
98854
|
const quickValidation = await validateMermaidDiagram(decodedContent);
|
|
@@ -110543,6 +110721,9 @@ var init_ProbeAgent = __esm({
|
|
|
110543
110721
|
}
|
|
110544
110722
|
if (this.enableExecutePlan && wrappedTools.executePlanToolInstance && isToolAllowed("execute_plan")) {
|
|
110545
110723
|
this.toolImplementations.execute_plan = wrappedTools.executePlanToolInstance;
|
|
110724
|
+
if (wrappedTools.cleanupExecutePlanToolInstance && isToolAllowed("cleanup_execute_plan")) {
|
|
110725
|
+
this.toolImplementations.cleanup_execute_plan = wrappedTools.cleanupExecutePlanToolInstance;
|
|
110726
|
+
}
|
|
110546
110727
|
} else if (wrappedTools.analyzeAllToolInstance && isToolAllowed("analyze_all")) {
|
|
110547
110728
|
this.toolImplementations.analyze_all = wrappedTools.analyzeAllToolInstance;
|
|
110548
110729
|
}
|
|
@@ -111916,6 +112097,10 @@ Workspace: ${this.allowedFolders.join(", ")}`;
|
|
|
111916
112097
|
if (this.enableBash && isToolAllowed("bash")) dslFunctions.push("bash");
|
|
111917
112098
|
toolDefinitions += `${getExecutePlanToolDefinition(dslFunctions)}
|
|
111918
112099
|
`;
|
|
112100
|
+
if (isToolAllowed("cleanup_execute_plan")) {
|
|
112101
|
+
toolDefinitions += `${getCleanupExecutePlanToolDefinition()}
|
|
112102
|
+
`;
|
|
112103
|
+
}
|
|
111919
112104
|
} else if (isToolAllowed("analyze_all")) {
|
|
111920
112105
|
toolDefinitions += `${analyzeAllToolDefinition}
|
|
111921
112106
|
`;
|
|
@@ -111991,6 +112176,9 @@ The configuration is loaded from src/config.js lines 15-25 which contains the da
|
|
|
111991
112176
|
}
|
|
111992
112177
|
if (this.enableExecutePlan && isToolAllowed("execute_plan")) {
|
|
111993
112178
|
availableToolsList += '- execute_plan: Execute a DSL program to orchestrate tool calls. ALWAYS use this for: questions containing "all"/"every"/"comprehensive"/"complete inventory", multi-topic analysis, open-ended discovery questions, or any task requiring full codebase coverage.\n';
|
|
112179
|
+
if (isToolAllowed("cleanup_execute_plan")) {
|
|
112180
|
+
availableToolsList += "- cleanup_execute_plan: Clean up output buffer and session store from previous execute_plan calls.\n";
|
|
112181
|
+
}
|
|
111994
112182
|
} else if (isToolAllowed("analyze_all")) {
|
|
111995
112183
|
availableToolsList += "- analyze_all: Process ALL data matching a query using map-reduce (for aggregate questions needing 100% coverage).\n";
|
|
111996
112184
|
}
|
|
@@ -112217,7 +112405,7 @@ You are working with a workspace. Available paths: ${workspaceDesc}
|
|
|
112217
112405
|
}
|
|
112218
112406
|
try {
|
|
112219
112407
|
const oldHistoryLength = this.history.length;
|
|
112220
|
-
if (this._outputBuffer) {
|
|
112408
|
+
if (this._outputBuffer && !options?._schemaFormatted) {
|
|
112221
112409
|
this._outputBuffer.items = [];
|
|
112222
112410
|
}
|
|
112223
112411
|
if (this.enableTasks) {
|
|
@@ -112577,6 +112765,9 @@ You are working with a workspace. Available paths: ${workspaceDesc}
|
|
|
112577
112765
|
}
|
|
112578
112766
|
if (this.enableExecutePlan && this.allowedTools.isEnabled("execute_plan")) {
|
|
112579
112767
|
validTools.push("execute_plan");
|
|
112768
|
+
if (this.allowedTools.isEnabled("cleanup_execute_plan")) {
|
|
112769
|
+
validTools.push("cleanup_execute_plan");
|
|
112770
|
+
}
|
|
112580
112771
|
} else if (this.allowedTools.isEnabled("analyze_all")) {
|
|
112581
112772
|
validTools.push("analyze_all");
|
|
112582
112773
|
}
|