@masslessai/push-todo 3.10.3 → 3.10.4

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/lib/cli.js CHANGED
@@ -393,7 +393,8 @@ export async function run(argv) {
393
393
  process.exit(1);
394
394
  }
395
395
 
396
- const screenshots = task.screenshot_attachments || task.screenshotAttachments || [];
396
+ const raw = task.screenshotAttachmentsJson || task.screenshotAttachments || task.screenshot_attachments;
397
+ const screenshots = !raw ? [] : Array.isArray(raw) ? raw : (() => { try { return JSON.parse(raw); } catch { return []; } })();
397
398
  if (screenshots.length === 0) {
398
399
  console.error(red(`Task #${displayNumber} has no screenshot attachments`));
399
400
  process.exit(1);
@@ -6,6 +6,18 @@
6
6
 
7
7
  import { bold, dim, green, yellow, red, cyan, muted, symbols } from './colors.js';
8
8
 
9
+ /**
10
+ * Parse a JSON string field into an array. Handles strings, arrays, null/undefined.
11
+ */
12
+ function parseJsonField(value) {
13
+ if (!value) return [];
14
+ if (Array.isArray(value)) return value;
15
+ if (typeof value === 'string') {
16
+ try { return JSON.parse(value); } catch { return []; }
17
+ }
18
+ return [];
19
+ }
20
+
9
21
  /**
10
22
  * Format a duration in seconds to human-readable string.
11
23
  *
@@ -85,9 +97,9 @@ export function formatTaskForDisplay(task) {
85
97
  lines.push(task.content || task.normalizedContent || 'No content');
86
98
  lines.push('');
87
99
 
88
- // Attachments
89
- const screenshots = task.screenshotAttachments || task.screenshot_attachments || [];
90
- const links = task.linkAttachments || task.link_attachments || [];
100
+ // Attachments — API returns JSON strings (screenshotAttachmentsJson, linkAttachmentsJson)
101
+ const screenshots = parseJsonField(task.screenshotAttachmentsJson || task.screenshotAttachments || task.screenshot_attachments);
102
+ const links = parseJsonField(task.linkAttachmentsJson || task.linkAttachments || task.link_attachments);
91
103
 
92
104
  if (screenshots.length > 0 || links.length > 0) {
93
105
  lines.push('### Attachments');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masslessai/push-todo",
3
- "version": "3.10.3",
3
+ "version": "3.10.4",
4
4
  "description": "Voice tasks from Push iOS app for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {