bpmnlint-plugin-camunda-compat 2.59.2 → 2.60.0
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/package.json
CHANGED
|
@@ -15,10 +15,11 @@ const { annotateRule } = require('../helper');
|
|
|
15
15
|
* or a part like `toolCallResult.statusCode`), a script task or called decision
|
|
16
16
|
* `resultVariable`, or a connector `resultVariable`/`resultExpression` header.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* the flow writes none at all,
|
|
18
|
+
* When the tool flow writes result-shaped variables but none of them is
|
|
19
|
+
* `toolCallResult`, every miswrite is reported individually on the element
|
|
20
|
+
* that wrote it (misdirection or wrong casing), so each offending output row
|
|
21
|
+
* carries its own finding. When the flow writes none at all, the rule reports
|
|
22
|
+
* once on the entry activity, since there's no single offending element to
|
|
22
23
|
* point to (the agent gets no completion signal and may retry or hallucinate
|
|
23
24
|
* an outcome). Results written from arbitrary FEEL expressions are not
|
|
24
25
|
* statically detectable.
|
|
@@ -47,26 +48,25 @@ module.exports = skipInNonExecutableProcess(function(config = {}) {
|
|
|
47
48
|
|
|
48
49
|
const hasResult = channels.some(isToolCallResultChannel);
|
|
49
50
|
if (!hasResult) {
|
|
50
|
-
const casingMismatch = channels.find(isToolCallResultCasingMismatch);
|
|
51
|
-
|
|
52
|
-
if (casingMismatch) {
|
|
53
|
-
reportErrors(casingMismatch.element, reporter, {
|
|
54
|
-
message: `Wrong casing "${getCasingMismatchText(casingMismatch)}": use toolCallResult (case-sensitive).`,
|
|
55
|
-
data: { type: ERROR_TYPES.AGENT_TOOL_OUTPUT_KEY_CASING_INVALID },
|
|
56
|
-
path: getChannelPath(casingMismatch),
|
|
57
|
-
});
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
51
|
|
|
61
52
|
// Every channel here is a miswrite (none matched toolCallResult), so
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
// each is reported on the element that wrote it. A wrong-casing
|
|
54
|
+
// near-miss gets the more specific guidance.
|
|
55
|
+
for (const channel of channels) {
|
|
56
|
+
if (isToolCallResultCasingMismatch(channel)) {
|
|
57
|
+
reportErrors(channel.element, reporter, {
|
|
58
|
+
message: `Wrong casing "${getCasingMismatchText(channel)}": use toolCallResult (case-sensitive).`,
|
|
59
|
+
data: { type: ERROR_TYPES.AGENT_TOOL_OUTPUT_KEY_CASING_INVALID },
|
|
60
|
+
path: getChannelPath(channel),
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
reportErrors(channel.element, reporter, {
|
|
64
|
+
message: '"toolCallResult" output is not mapped.',
|
|
65
|
+
data: { type: ERROR_TYPES.AGENT_TOOL_OUTPUT_KEY_INVALID },
|
|
66
|
+
path: getChannelPath(channel),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
|