@masslessai/push-todo 4.0.0 → 4.0.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/lib/daemon.js +40 -1
  2. package/package.json +1 -1
package/lib/daemon.js CHANGED
@@ -105,6 +105,17 @@ const taskStderrBuffer = new Map(); // displayNumber -> lines[]
105
105
  const taskProjectPaths = new Map(); // displayNumber -> projectPath
106
106
  let daemonStartTime = null;
107
107
 
108
+ // ==================== Utilities ====================
109
+
110
+ function parseJsonField(value) {
111
+ if (!value) return [];
112
+ if (Array.isArray(value)) return value;
113
+ if (typeof value === 'string') {
114
+ try { return JSON.parse(value); } catch { return []; }
115
+ }
116
+ return [];
117
+ }
118
+
108
119
  // ==================== Logging ====================
109
120
 
110
121
  function rotateLogs() {
@@ -1386,10 +1397,37 @@ async function executeTask(task) {
1386
1397
 
1387
1398
  taskProjectPaths.set(displayNumber, projectPath);
1388
1399
 
1400
+ // Build attachment context for the prompt (screenshots, links)
1401
+ let attachmentContext = '';
1402
+ try {
1403
+ const links = parseJsonField(task.linkAttachmentsJson || task.linkAttachments || task.link_attachments);
1404
+ const screenshots = parseJsonField(task.screenshotAttachmentsJson || task.screenshotAttachments || task.screenshot_attachments);
1405
+ const contextApp = task.contextApp || task.context_app || null;
1406
+
1407
+ const parts = [];
1408
+ if (contextApp) {
1409
+ parts.push(`Context app: ${contextApp}`);
1410
+ }
1411
+ if (links.length > 0) {
1412
+ parts.push('Links:\n' + links.map(l => ` - ${l.url}${l.title ? ` (${l.title})` : ''}`).join('\n'));
1413
+ }
1414
+ if (screenshots.length > 0) {
1415
+ parts.push('Screenshots:\n' + screenshots.map(s =>
1416
+ ` - ${s.imageFilename || s.image_filename}${s.sourceApp ? ` (from ${s.sourceApp})` : ''}`
1417
+ ).join('\n'));
1418
+ }
1419
+
1420
+ if (parts.length > 0) {
1421
+ attachmentContext = '\n\nAttachments:\n' + parts.join('\n');
1422
+ }
1423
+ } catch {
1424
+ // Non-critical — continue without attachment context
1425
+ }
1426
+
1389
1427
  // Build prompt
1390
1428
  const prompt = `Work on Push task #${displayNumber}:
1391
1429
 
1392
- ${content}
1430
+ ${content}${attachmentContext}
1393
1431
 
1394
1432
  IMPORTANT:
1395
1433
  1. If you need to understand the codebase, start by reading the CLAUDE.md file if it exists.
@@ -1405,6 +1443,7 @@ IMPORTANT:
1405
1443
  'Bash(git *)',
1406
1444
  'Bash(npm *)', 'Bash(npx *)', 'Bash(yarn *)',
1407
1445
  'Bash(python *)', 'Bash(python3 *)', 'Bash(pip *)', 'Bash(pip3 *)',
1446
+ 'Bash(push-todo *)',
1408
1447
  'Task'
1409
1448
  ].join(',');
1410
1449
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masslessai/push-todo",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "Voice tasks from Push iOS app for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {