@mjasnikovs/pi-task 0.4.0 → 0.4.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/dist/remote/ui.js CHANGED
@@ -349,12 +349,19 @@ export function html(wsUrl) {
349
349
  }
350
350
 
351
351
  const COMMANDS = [
352
- { name: '/new', desc: 'Start a new session' },
353
- { name: '/clear', desc: 'Clear the conversation' },
354
- { name: '/compact', desc: 'Compact context to save tokens' },
355
- { name: '/help', desc: 'Show available commands' },
356
- { name: '/fast', desc: 'Toggle fast mode' },
357
- { name: '/remote stop', desc: 'Stop the remote server' },
352
+ { name: '/task', desc: 'Start a new task' },
353
+ { name: '/task-list', desc: 'List tasks in this project' },
354
+ { name: '/task-resume', desc: 'Resume a task' },
355
+ { name: '/task-cancel', desc: 'Cancel the currently running task' },
356
+ { name: '/task-auto', desc: 'Plan a feature into tasks and run them' },
357
+ { name: '/task-auto-resume', desc: 'Resume the active /task-auto run' },
358
+ { name: '/task-auto-cancel', desc: 'Stop the running /task-auto loop after the current task' },
359
+ { name: '/new', desc: 'Start a new session' },
360
+ { name: '/clear', desc: 'Clear the conversation' },
361
+ { name: '/compact', desc: 'Compact context to save tokens' },
362
+ { name: '/help', desc: 'Show available commands' },
363
+ { name: '/fast', desc: 'Toggle fast mode' },
364
+ { name: '/remote stop', desc: 'Stop the remote server' },
358
365
  ];
359
366
  let cmdActive = [];
360
367
  let cmdIndex = -1;
@@ -59,7 +59,15 @@ export function runChild(spawn, invocation, cwd, signal, opts) {
59
59
  drainJsonEvents(lineBuffer + '\n', opts);
60
60
  lineBuffer = '';
61
61
  }
62
- const text = isJsonEvents ? (finalText || textDeltaAccum).trim() : undefined;
62
+ let text;
63
+ if (isJsonEvents) {
64
+ const extracted = (finalText || textDeltaAccum).trim();
65
+ // When json-events mode extracts no text but stderr has content,
66
+ // surface the stderr as the text so the caller sees the real error
67
+ // instead of the generic "X child produced no output". Without this,
68
+ // a model API crash that exits 0 with an error on stderr is invisible.
69
+ text = extracted.length > 0 ? extracted : (stderr.trim() || undefined);
70
+ }
63
71
  resolve({ stdout, stderr, exitCode: code ?? 0, aborted, text });
64
72
  });
65
73
  proc.on('error', () => {
@@ -58,7 +58,12 @@ export async function runChild(cwd, tools, prompt, signal, onLine, onContextUsag
58
58
  }
59
59
  });
60
60
  return {
61
- text: result.text ?? result.stdout.trim(),
61
+ // Use `||` (not `??`) so an empty string from json-events mode falls
62
+ // back to raw stdout. Without this, a child that exits 0 but emits no
63
+ // assistant text (e.g. model API error swallowed in json mode) always
64
+ // fails with the unhelpful "X child produced no output" — the raw
65
+ // stdout/stderr that might contain the real error is discarded.
66
+ text: result.text || result.stdout.trim(),
62
67
  exitCode: result.exitCode,
63
68
  stderr: result.stderr.trim(),
64
69
  loopHit
@@ -71,7 +76,7 @@ export async function runPhaseChild(deps, name, tools, prompt) {
71
76
  throw new Error(`${name} child failed: ${r.stderr || '(no stderr)'}`);
72
77
  }
73
78
  if (r.text.trim().length === 0) {
74
- throw new Error(`${name} child produced no output`);
79
+ throw new Error(`${name} child produced no output${r.stderr ? ' — stderr: ' + r.stderr : ''}`);
75
80
  }
76
81
  return r.text;
77
82
  }
@@ -122,7 +127,7 @@ export async function runPhaseWithLoopGuard(deps, name, tools, buildPrompt) {
122
127
  throw new Error(`${name} child failed: ${r.stderr || '(no stderr)'}`);
123
128
  }
124
129
  if (r.text.trim().length === 0) {
125
- throw new Error(`${name} child produced no output`);
130
+ throw new Error(`${name} child produced no output${r.stderr ? ' — stderr: ' + r.stderr : ''}`);
126
131
  }
127
132
  return r.text;
128
133
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjasnikovs/pi-task",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Deterministic spec-orchestration for local models, with a bundled real-time remote web view and web/docs/fetch/worker subagent tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",