winter-super-cli 2026.6.20 → 2026.6.21
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 +1 -1
- package/src/cli/tool-call-adapter.js +24 -2
package/package.json
CHANGED
|
@@ -39,8 +39,14 @@ export function extractInlineToolCalls(content, idFactory = index => `inline-${D
|
|
|
39
39
|
};
|
|
40
40
|
const pushParsedToolObject = (parsed) => {
|
|
41
41
|
const { name, args } = extractToolPayload(parsed, parseToolArguments);
|
|
42
|
-
if (
|
|
43
|
-
|
|
42
|
+
if (name && typeof name === 'string') {
|
|
43
|
+
pushToolCall(name, args, 'object');
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const inferred = inferSafeToolFromBareArguments(parsed);
|
|
48
|
+
if (!inferred) return false;
|
|
49
|
+
pushToolCall(inferred.name, inferred.args, 'bare-arguments');
|
|
44
50
|
return true;
|
|
45
51
|
};
|
|
46
52
|
|
|
@@ -304,6 +310,22 @@ function extractToolPayload(payload, parseArguments) {
|
|
|
304
310
|
};
|
|
305
311
|
}
|
|
306
312
|
|
|
313
|
+
export function inferSafeToolFromBareArguments(value) {
|
|
314
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) return null;
|
|
315
|
+
|
|
316
|
+
const keys = Object.keys(value);
|
|
317
|
+
if (keys.length === 0) return null;
|
|
318
|
+
|
|
319
|
+
const hasGenericPayloadKeys = keys.some(key => /^(arguments?|args?|input|parameters?|params?|tool[_-]?input|function[_-]?arguments?)$/i.test(key));
|
|
320
|
+
if (!hasGenericPayloadKeys) return null;
|
|
321
|
+
|
|
322
|
+
const name = value.name || value.tool || value.tool_name || value.function_name || null;
|
|
323
|
+
if (typeof name !== 'string' || !name.trim()) return null;
|
|
324
|
+
|
|
325
|
+
const args = value.arguments ?? value.args ?? value.input ?? value.parameters ?? value.params ?? value.tool_input ?? value.function_arguments ?? {};
|
|
326
|
+
return { name, args };
|
|
327
|
+
}
|
|
328
|
+
|
|
307
329
|
export function formatToolCallsForMessage(toolCalls) {
|
|
308
330
|
return toolCalls.map((tc) => ({
|
|
309
331
|
id: tc.id,
|