pi-crew 0.2.22 → 0.2.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-crew",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "description": "Pi extension for coordinated AI teams, workflows, worktrees, and async task orchestration",
5
5
  "author": "baphuongna",
6
6
  "license": "MIT",
@@ -1,5 +1,4 @@
1
1
  import * as fs from "node:fs";
2
- import * as path from "node:path";
3
2
  import type { AgentConfig } from "../../agents/agent-config.ts";
4
3
  import type { CrewRuntimeConfig } from "../../config/config.ts";
5
4
  import { writeArtifact } from "../../state/artifact-store.ts";
@@ -9,6 +8,7 @@ import type { ArtifactDescriptor, TeamRunManifest, TeamTaskState } from "../../s
9
8
  import type { WorkflowStep } from "../../workflows/workflow-config.ts";
10
9
  import { appendCrewAgentEvent, appendCrewAgentOutput, emptyCrewAgentProgress, recordFromTask, upsertCrewAgent } from "../crew-agent-records.ts";
11
10
  import { createWorkerHeartbeat, touchWorkerHeartbeat } from "../worker-heartbeat.ts";
11
+ import { loadRunManifestById, saveRunTasks } from "../../state/state-store.ts";
12
12
  import { createStartupEvidence, type WorkerStartupEvidence } from "../worker-startup.ts";
13
13
  import { runLiveSessionTask } from "../live-session-runtime.ts";
14
14
  import { shouldAppendProgressEventUpdate, type ProgressEventSummary } from "../progress-event-coalescer.ts";
@@ -81,10 +81,7 @@ export async function runLiveTask(input: RunLiveTaskInput): Promise<RunLiveTaskO
81
81
  ...task,
82
82
  heartbeat: touchWorkerHeartbeat(task.heartbeat ?? createWorkerHeartbeat(task.id)),
83
83
  };
84
- tasks = updateTask(tasks, task);
85
- // Persist to tasks.json using the same pattern as task-runner.ts
86
- const tasksPath = path.join(manifest.stateRoot, "tasks.json");
87
- try { fs.writeFileSync(tasksPath, JSON.stringify({ ...loaded, tasks }, null, 2)); } catch {}
84
+ tasks = persistSingleTaskUpdate(manifest, tasks, task);
88
85
  lastHeartbeatPersistedAt = now;
89
86
  }
90
87
  const summary = progressEventSummary(task, event);