drafted 1.2.0 → 1.2.1

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.
Files changed (2) hide show
  1. package/mcp/server.mjs +17 -2
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -1071,8 +1071,23 @@ tool('frame', 'Frame CRUD in the ACTIVE PROJECT. Dispatch by `action`: read (by
1071
1071
  if (!lines && result.ok && result.id) {
1072
1072
  readFrameIds.add(result.id);
1073
1073
  }
1074
- return ok(result.content || result, {
1075
- structuredContent: frameStructuredContent(result),
1074
+ // Surface content as the visible text. Some Claude clients prefer
1075
+ // structuredContent over text when both are present and structured looks
1076
+ // "complete" — so include content in BOTH places to ensure the agent
1077
+ // can always see the frame's actual content, not just metadata.
1078
+ const structured = frameStructuredContent(result);
1079
+ structured.content = result.content ?? '';
1080
+ structured.size = result.size;
1081
+ structured.totalLines = result.totalLines;
1082
+ const visibleText = JSON.stringify({
1083
+ path: result.path,
1084
+ contentType: result.contentType,
1085
+ size: result.size,
1086
+ totalLines: result.totalLines,
1087
+ content: result.content ?? '',
1088
+ }, null, 2);
1089
+ return ok(visibleText, {
1090
+ structuredContent: structured,
1076
1091
  _meta: { frameHtml: result.content },
1077
1092
  });
1078
1093
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Drafted CLI - Design preview server for Claude agents",
5
5
  "type": "module",
6
6
  "files": [