droid-mode 0.1.2 → 0.1.3
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
|
@@ -81,7 +81,17 @@ export function createToolApi(opts) {
|
|
|
81
81
|
hasStructured: !!res?.structured,
|
|
82
82
|
textLength: (res?.text || "").length,
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
// Return structured data if available
|
|
85
|
+
if (res.structured) return res.structured;
|
|
86
|
+
// Auto-parse JSON text responses for better workflow UX
|
|
87
|
+
if (res.text) {
|
|
88
|
+
try {
|
|
89
|
+
return JSON.parse(res.text);
|
|
90
|
+
} catch {
|
|
91
|
+
return { text: res.text };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return res.raw;
|
|
85
95
|
} catch (err) {
|
|
86
96
|
lastError = err;
|
|
87
97
|
traceItem.retries = attempt;
|