pi-cohort 7.1.2 → 7.2.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.
@@ -4,6 +4,8 @@
4
4
 
5
5
  import * as os from "node:os";
6
6
  import * as path from "node:path";
7
+ import { PINNED_AGENT_DIR } from "./agent-dir.ts";
8
+ import type { PiRuntimeIdentity } from "../runs/shared/pi-spawn.ts";
7
9
  import type { Message } from "@earendil-works/pi-ai";
8
10
  import type { FSWatcher } from "node:fs";
9
11
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
@@ -495,6 +497,8 @@ export interface NestedStepSummary {
495
497
  }
496
498
 
497
499
  export interface NestedRunSummary extends NestedRunAddress {
500
+ runtime?: PiRuntimeIdentity;
501
+ sessionRoot?: string;
498
502
  asyncDir?: string;
499
503
  pid?: number;
500
504
  sessionId?: string;
@@ -549,6 +553,8 @@ export interface AsyncStartedEvent {
549
553
  }
550
554
 
551
555
  export interface AsyncStatus {
556
+ runtime?: PiRuntimeIdentity;
557
+ error?: string;
552
558
  runId: string;
553
559
  sessionId?: string;
554
560
  mode: SubagentRunMode;
@@ -660,6 +666,7 @@ export interface ForegroundResumeChild {
660
666
  }
661
667
 
662
668
  export interface ForegroundResumeRun {
669
+ runtime?: PiRuntimeIdentity;
663
670
  runId: string;
664
671
  mode: SubagentRunMode;
665
672
  cwd: string;
@@ -750,6 +757,7 @@ export const SUBAGENT_CONTROL_EVENT = "subagent:control-event";
750
757
  // ============================================================================
751
758
 
752
759
  export interface RunSyncOptions {
760
+ runtime: PiRuntimeIdentity;
753
761
  cwd?: string;
754
762
  signal?: AbortSignal;
755
763
  interruptSignal?: AbortSignal;
@@ -902,7 +910,9 @@ const MAX_PARALLEL = 8;
902
910
  export const MAX_CONCURRENCY = 4;
903
911
  export const TEMP_ROOT_DIR = path.join(os.tmpdir(), `pi-cohort-${resolveTempScopeId()}`);
904
912
  export const RESULTS_DIR = path.join(TEMP_ROOT_DIR, "async-subagent-results");
905
- export const ASYNC_DIR = path.join(TEMP_ROOT_DIR, "async-subagent-runs");
913
+ export const RUN_STATE_ROOT_DIR = path.join(PINNED_AGENT_DIR, "pi-cohort");
914
+ export const ASYNC_DIR = path.join(RUN_STATE_ROOT_DIR, "async-subagent-runs");
915
+ export const LEGACY_ASYNC_DIR = path.join(TEMP_ROOT_DIR, "async-subagent-runs");
906
916
  export const CHAIN_RUNS_DIR = path.join(TEMP_ROOT_DIR, "chain-runs");
907
917
  export const TEMP_ARTIFACTS_DIR = path.join(TEMP_ROOT_DIR, "artifacts");
908
918
  export const WIDGET_KEY = "pi-cohort-async";
@@ -13,12 +13,7 @@ import type { AgentProgress, AsyncStatus, Details, DisplayItem, ErrorInfo, Singl
13
13
  // File System Utilities
14
14
  // ============================================================================
15
15
 
16
- export function getAgentDir(): string {
17
- const configured = process.env.PI_CODING_AGENT_DIR;
18
- if (configured === "~") return os.homedir();
19
- if (configured?.startsWith("~/")) return path.join(os.homedir(), configured.slice(2));
20
- return configured || path.join(os.homedir(), ".pi", "agent");
21
- }
16
+ export { getAgentDir } from "./agent-dir.ts";
22
17
 
23
18
  const statusCache = new Map<string, { mtime: number; status: AsyncStatus }>();
24
19