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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "droid-mode",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Progressive Code-Mode MCP integration for Factory.ai Droid - access MCP tools without context bloat",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
@@ -81,7 +81,17 @@ export function createToolApi(opts) {
81
81
  hasStructured: !!res?.structured,
82
82
  textLength: (res?.text || "").length,
83
83
  };
84
- return res.structured ?? (res.text ? { text: res.text } : res.raw);
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;