@jaggerxtrm/specialists 3.4.3 → 3.4.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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- // specialists-complete — Claude Code UserPromptSubmit hook
2
+ // specialists-complete — Claude Code UserPromptSubmit/PostToolUse hook
3
3
  // Checks .specialists/ready/ for completed background job markers and injects
4
- // completion banners into Claude's context.
4
+ // completion/failure banners into Claude's context.
5
5
  //
6
6
  // Installed by: specialists install
7
7
 
@@ -32,16 +32,26 @@ for (const jobId of markers) {
32
32
  try {
33
33
  let specialist = jobId;
34
34
  let elapsed = '';
35
+ let completionStatus = 'done';
36
+ let errorMessage = '';
35
37
 
36
38
  if (existsSync(statusPath)) {
37
39
  const status = JSON.parse(readFileSync(statusPath, 'utf-8'));
38
40
  specialist = status.specialist ?? jobId;
39
41
  elapsed = status.elapsed_s !== undefined ? `, ${status.elapsed_s}s` : '';
42
+ completionStatus = status.status ?? 'done';
43
+ errorMessage = status.error ? ` — ${status.error}` : '';
40
44
  }
41
45
 
42
- banners.push(
43
- `[Specialist '${specialist}' completed (job ${jobId}${elapsed}). Run: specialists result ${jobId}]`
44
- );
46
+ if (completionStatus === 'error') {
47
+ banners.push(
48
+ `[Specialist '${specialist}' failed (job ${jobId}${elapsed}${errorMessage}). Run: specialists feed ${jobId} --follow]`
49
+ );
50
+ } else {
51
+ banners.push(
52
+ `[Specialist '${specialist}' completed (job ${jobId}${elapsed}). Run: specialists result ${jobId}]`
53
+ );
54
+ }
45
55
 
46
56
  // Delete marker so it only fires once
47
57
  unlinkSync(markerPath);
@@ -53,7 +63,7 @@ for (const jobId of markers) {
53
63
 
54
64
  if (banners.length === 0) process.exit(0);
55
65
 
56
- // UserPromptSubmit hooks inject content via JSON
66
+ // UserPromptSubmit/PostToolUse hooks inject content via JSON
57
67
  process.stdout.write(JSON.stringify({
58
68
  type: 'inject',
59
69
  content: banners.join('\n'),
@@ -107,7 +107,7 @@ lines.push('specialists status # system health')
107
107
  lines.push('specialists doctor # troubleshoot issues');
108
108
  lines.push('```');
109
109
  lines.push('');
110
- lines.push('MCP tools: specialist_init · use_specialist · start_specialist · feed_specialist · run_parallel');
110
+ lines.push('MCP tools: use_specialist (foreground only)');
111
111
 
112
112
  // ── Output ─────────────────────────────────────────────────────────────────
113
113
  if (lines.length === 0) process.exit(0);
@@ -296,6 +296,8 @@ Available after `specialists init` and session restart.
296
296
 
297
297
  MCP is intentionally minimal. Use CLI commands for orchestration, monitoring, steering,
298
298
  resume, and cancellation.
299
+ If you encounter legacy `start_specialist`, treat it as deprecated and migrate to
300
+ `specialists run <name> --prompt "..." --background`.
299
301
 
300
302
  ---
301
303
 
package/dist/index.js CHANGED
@@ -19297,6 +19297,7 @@ function ensureProjectHookWiring(cwd) {
19297
19297
  }
19298
19298
  }
19299
19299
  addHook("UserPromptSubmit", "node .claude/hooks/specialists-complete.mjs");
19300
+ addHook("PostToolUse", "node .claude/hooks/specialists-complete.mjs");
19300
19301
  addHook("SessionStart", "node .claude/hooks/specialists-session-start.mjs");
19301
19302
  if (changed) {
19302
19303
  saveJson(settingsPath, settings);
@@ -20201,6 +20202,10 @@ class Supervisor {
20201
20202
  readyDir() {
20202
20203
  return join10(this.opts.jobsDir, "..", "ready");
20203
20204
  }
20205
+ writeReadyMarker(id) {
20206
+ mkdirSync2(this.readyDir(), { recursive: true });
20207
+ writeFileSync3(join10(this.readyDir(), id), "", "utf-8");
20208
+ }
20204
20209
  readStatus(id) {
20205
20210
  const path = this.statusPath(id);
20206
20211
  if (!existsSync10(path))
@@ -20566,8 +20571,7 @@ class Supervisor {
20566
20571
  bead_id: result.beadId,
20567
20572
  output: result.output
20568
20573
  }));
20569
- mkdirSync2(this.readyDir(), { recursive: true });
20570
- writeFileSync3(join10(this.readyDir(), id), "", "utf-8");
20574
+ this.writeReadyMarker(id);
20571
20575
  return id;
20572
20576
  } catch (err) {
20573
20577
  const elapsed = Math.round((Date.now() - startedAtMs) / 1000);
@@ -20580,6 +20584,7 @@ class Supervisor {
20580
20584
  appendTimelineEvent(createRunCompleteEvent("ERROR", elapsed, {
20581
20585
  error: errorMsg
20582
20586
  }));
20587
+ this.writeReadyMarker(id);
20583
20588
  throw err;
20584
20589
  } finally {
20585
20590
  if (stuckIntervalId !== undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaggerxtrm/specialists",
3
- "version": "3.4.3",
3
+ "version": "3.4.4",
4
4
  "description": "OmniSpecialist — 7-tool MCP orchestration layer powered by the Specialist System. Discover and execute .specialist.yaml files across project/user/system scopes via pi.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",