@d3ara1n/pi-subagent 0.10.3 → 0.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3ara1n/pi-subagent",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "type": "module",
5
5
  "description": "Role-based subagent orchestration for pi — delegates tasks to specialized pi child processes with configurable model roles",
6
6
  "main": "src/index.ts",
@@ -27,7 +27,7 @@
27
27
  }
28
28
  },
29
29
  "dependencies": {
30
- "@d3ara1n/pi-model-roles": "^0.7.0"
30
+ "@d3ara1n/pi-model-roles": "*"
31
31
  },
32
32
  "pi": {
33
33
  "extensions": [
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Configuration loading regression tests.
3
3
  *
4
- * Uses isolated global/project settings roots via PI_AGENT_DIR.
4
+ * Uses isolated global/project settings roots via PI_CODING_AGENT_DIR.
5
5
  * node --test packages/pi-subagent/src/config.test.ts
6
6
  */
7
7
 
@@ -13,7 +13,7 @@ import * as path from "node:path";
13
13
  import { loadSubagentConfig } from "./config.ts";
14
14
  import { DEFAULT_CONFIG } from "./types.ts";
15
15
 
16
- const originalAgentDir = process.env.PI_AGENT_DIR;
16
+ const originalAgentDir = process.env.PI_CODING_AGENT_DIR;
17
17
  const tempRoots: string[] = [];
18
18
 
19
19
  function makeRoot(): { agentDir: string; projectDir: string } {
@@ -23,7 +23,7 @@ function makeRoot(): { agentDir: string; projectDir: string } {
23
23
  const projectDir = path.join(root, "project");
24
24
  fs.mkdirSync(agentDir, { recursive: true });
25
25
  fs.mkdirSync(projectDir, { recursive: true });
26
- process.env.PI_AGENT_DIR = agentDir;
26
+ process.env.PI_CODING_AGENT_DIR = agentDir;
27
27
  return { agentDir, projectDir };
28
28
  }
29
29
 
@@ -37,8 +37,8 @@ function writeSettingsText(dir: string, content: string): void {
37
37
  }
38
38
 
39
39
  afterEach(() => {
40
- if (originalAgentDir === undefined) delete process.env.PI_AGENT_DIR;
41
- else process.env.PI_AGENT_DIR = originalAgentDir;
40
+ if (originalAgentDir === undefined) delete process.env.PI_CODING_AGENT_DIR;
41
+ else process.env.PI_CODING_AGENT_DIR = originalAgentDir;
42
42
  for (const root of tempRoots.splice(0)) fs.rmSync(root, { recursive: true, force: true });
43
43
  });
44
44
 
package/src/config.ts CHANGED
@@ -5,19 +5,13 @@
5
5
  * project overrides global.
6
6
  */
7
7
 
8
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
8
9
  import * as fs from "node:fs";
9
- import * as os from "node:os";
10
10
  import * as path from "node:path";
11
11
  import type { SubagentConfig } from "./types.ts";
12
12
  import { DEFAULT_CONFIG } from "./types.ts";
13
13
  import { normalizeNonNegativeInteger, normalizeNonNegativeNumber } from "./utils.ts";
14
14
 
15
- function getAgentDir(): string {
16
- const envDir = process.env.PI_AGENT_DIR;
17
- if (envDir) return envDir;
18
- return path.join(os.homedir(), ".pi", "agent");
19
- }
20
-
21
15
  function readSettingsFile(filePath: string): any {
22
16
  try {
23
17
  const content = fs.readFileSync(filePath, "utf-8");