@masslessai/push-todo 4.1.0 → 4.1.2

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/hooks/hooks.json CHANGED
@@ -21,6 +21,18 @@
21
21
  }
22
22
  ]
23
23
  }
24
+ ],
25
+ "PostToolUse": [
26
+ {
27
+ "matcher": "Bash",
28
+ "hooks": [
29
+ {
30
+ "type": "command",
31
+ "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/post-commit-task-complete.js",
32
+ "timeout": 15
33
+ }
34
+ ]
35
+ }
24
36
  ]
25
37
  }
26
38
  }
@@ -234,7 +234,16 @@ export function buildSmartPrompt(task, context) {
234
234
  const sections = [];
235
235
 
236
236
  // 1. Task section (always present)
237
- sections.push(`## Task\nWork on Push task #${task.displayNumber}:\n\n${task.content}`);
237
+ // For follow-ups, frame as iteration on previous work
238
+ if (task.followUpRequest) {
239
+ sections.push(`## Task (Follow-Up Iteration #${task.followUpIteration || 2})\nContinue working on Push task #${task.displayNumber}.\n\nOriginal task:\n${task.content}\n\n**Follow-up request:**\n${task.followUpRequest}`);
240
+ // Include previous execution summary as context
241
+ if (task.previousSummary) {
242
+ sections.push(`## Previous Iteration Summary\nHere's what was accomplished in the previous iteration:\n\n${task.previousSummary}`);
243
+ }
244
+ } else {
245
+ sections.push(`## Task\nWork on Push task #${task.displayNumber}:\n\n${task.content}`);
246
+ }
238
247
 
239
248
  // 2. Metadata section (conditional)
240
249
  const metaParts = [];
package/lib/daemon.js CHANGED
@@ -1521,10 +1521,21 @@ async function executeTask(task) {
1521
1521
  log(`Task #${displayNumber}: claim failed, skipping`);
1522
1522
  return null;
1523
1523
  }
1524
- const healed = await autoHealExistingWork(displayNumber, summary, projectPath, taskId);
1525
- if (healed) {
1526
- log(`Task #${displayNumber}: auto-healed from previous execution, skipping re-execution`);
1527
- return null;
1524
+ // Follow-up: skip auto-heal when follow_up_request is set — the existing
1525
+ // branch/PR is intentional context, not evidence of completion.
1526
+ const followUpRequest = task.followUpRequest || task.follow_up_request || null;
1527
+ const followUpIteration = task.followUpIteration || task.follow_up_iteration || 1;
1528
+ const previousSessionId = task.executionSessionId || task.execution_session_id || null;
1529
+ const previousSummary = task.executionSummary || task.execution_summary || null;
1530
+
1531
+ if (!followUpRequest) {
1532
+ const healed = await autoHealExistingWork(displayNumber, summary, projectPath, taskId);
1533
+ if (healed) {
1534
+ log(`Task #${displayNumber}: auto-healed from previous execution, skipping re-execution`);
1535
+ return null;
1536
+ }
1537
+ } else {
1538
+ log(`Task #${displayNumber}: follow-up iteration #${followUpIteration}, skipping auto-heal`);
1528
1539
  }
1529
1540
 
1530
1541
  // Track task details
@@ -1578,7 +1589,8 @@ async function executeTask(task) {
1578
1589
  const projectContext = projectPath ? getProjectContext(projectPath) : { skills: [], state: {} };
1579
1590
  const contextApp = task.contextApp || task.context_app || null;
1580
1591
  const prompt = buildSmartPrompt(
1581
- { displayNumber, content, attachmentContext, actionName, contextApp },
1592
+ { displayNumber, content, attachmentContext, actionName, contextApp,
1593
+ followUpRequest, followUpIteration, previousSummary },
1582
1594
  projectContext
1583
1595
  );
1584
1596
 
@@ -1595,14 +1607,31 @@ async function executeTask(task) {
1595
1607
  'Task'
1596
1608
  ].join(',');
1597
1609
 
1598
- const claudeArgs = [
1599
- '-p', prompt,
1600
- '--worktree', worktreeName,
1601
- '--allowedTools', allowedTools,
1602
- '--output-format', 'json',
1603
- '--permission-mode', 'bypassPermissions',
1604
- '--session-id', preAssignedSessionId
1605
- ];
1610
+ // For follow-ups: try --continue with previous session for full context.
1611
+ // Falls back to new session with prompt context if session is stale/unavailable.
1612
+ const useResume = followUpRequest && previousSessionId;
1613
+ const claudeArgs = useResume
1614
+ ? [
1615
+ '--continue', previousSessionId,
1616
+ '-p', prompt,
1617
+ '--worktree', worktreeName,
1618
+ '--allowedTools', allowedTools,
1619
+ '--output-format', 'json',
1620
+ '--permission-mode', 'bypassPermissions',
1621
+ '--session-id', preAssignedSessionId
1622
+ ]
1623
+ : [
1624
+ '-p', prompt,
1625
+ '--worktree', worktreeName,
1626
+ '--allowedTools', allowedTools,
1627
+ '--output-format', 'json',
1628
+ '--permission-mode', 'bypassPermissions',
1629
+ '--session-id', preAssignedSessionId
1630
+ ];
1631
+
1632
+ if (useResume) {
1633
+ log(`Task #${displayNumber}: resuming session ${previousSessionId} for follow-up`);
1634
+ }
1606
1635
 
1607
1636
  try {
1608
1637
  const child = spawn('claude', claudeArgs, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masslessai/push-todo",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "description": "Voice tasks from Push iOS app for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {