@tintinweb/pi-subagents 0.6.1 → 0.6.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/CHANGELOG.md +8 -0
- package/README.md +0 -1
- package/dist/output-file.d.ts +7 -0
- package/dist/output-file.js +22 -2
- package/package.json +5 -5
- package/src/output-file.ts +21 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.6.2] - 2026-04-28
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- **`Agent` tool fails on Windows with `ENOENT` creating output directory** ([#27](https://github.com/tintinweb/pi-subagents/issues/27) — thanks [@sixnathan](https://github.com/sixnathan) for the diagnosis). The cwd-encoding regex in `output-file.ts` only handled POSIX `/` separators, so on Windows `cwd = "C:\\Users\\foo\\project"` survived unchanged and `path.join(tmpRoot, encoded, …)` produced an invalid nested-absolute path. Now extracts a small `encodeCwd()` helper that handles both `/` and `\\` separators, strips the Windows drive-letter prefix, and preserves UNC server/share segments. The `chmodSync(root, 0o700)` call is also wrapped in a try/catch that swallows errors only on Windows (where chmod is a no-op and can throw on some filesystems); on Unix the error still propagates so umask-defeating `0o700` enforcement is preserved.
|
|
14
|
+
|
|
10
15
|
## [0.6.1] - 2026-04-25
|
|
11
16
|
|
|
12
17
|
### Added
|
|
@@ -369,6 +374,9 @@ Initial release.
|
|
|
369
374
|
- **Thinking level** — per-agent extended thinking control
|
|
370
375
|
- **`/agent` and `/agents` commands**
|
|
371
376
|
|
|
377
|
+
[0.6.2]: https://github.com/tintinweb/pi-subagents/compare/v0.6.1...v0.6.2
|
|
378
|
+
[0.6.1]: https://github.com/tintinweb/pi-subagents/compare/v0.6.0...v0.6.1
|
|
379
|
+
[0.6.0]: https://github.com/tintinweb/pi-subagents/compare/v0.5.2...v0.6.0
|
|
372
380
|
[0.5.2]: https://github.com/tintinweb/pi-subagents/compare/v0.5.1...v0.5.2
|
|
373
381
|
[0.5.1]: https://github.com/tintinweb/pi-subagents/compare/v0.5.0...v0.5.1
|
|
374
382
|
[0.5.0]: https://github.com/tintinweb/pi-subagents/compare/v0.4.9...v0.5.0
|
package/README.md
CHANGED
|
@@ -166,7 +166,6 @@ All fields are optional — sensible defaults for everything.
|
|
|
166
166
|
| `prompt_mode` | `replace` | `replace`: body is the full system prompt (no AGENTS.md / CLAUDE.md inheritance). `append`: body appended to parent's prompt (agent acts as a "parent twin" — inherits parent's AGENTS.md / CLAUDE.md) |
|
|
167
167
|
| `inherit_context` | `false` | Fork parent conversation into agent |
|
|
168
168
|
| `run_in_background` | `false` | Run in background by default |
|
|
169
|
-
| `isolation` | — | `worktree`: run in a temporary git worktree for full repo isolation |
|
|
170
169
|
| `isolated` | `false` | No extension/MCP tools, only built-in |
|
|
171
170
|
| `enabled` | `true` | Set to `false` to disable an agent (useful for hiding a default agent per-project) |
|
|
172
171
|
|
package/dist/output-file.d.ts
CHANGED
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
* matching Claude Code's task output file format.
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentSession } from "@mariozechner/pi-coding-agent";
|
|
8
|
+
/**
|
|
9
|
+
* Encode a cwd path as a filesystem-safe directory name. Handles:
|
|
10
|
+
* - POSIX: "/home/user/project" → "home-user-project"
|
|
11
|
+
* - Windows: "C:\Users\foo\project" → "Users-foo-project"
|
|
12
|
+
* - UNC: "\\\\server\\share\\project" → "server-share-project"
|
|
13
|
+
*/
|
|
14
|
+
export declare function encodeCwd(cwd: string): string;
|
|
8
15
|
/** Create the output file path, ensuring the directory exists.
|
|
9
16
|
* Mirrors Claude Code's layout: /tmp/{prefix}-{uid}/{encoded-cwd}/{sessionId}/tasks/{agentId}.output */
|
|
10
17
|
export declare function createOutputFilePath(cwd: string, agentId: string, sessionId: string): string;
|
package/dist/output-file.js
CHANGED
|
@@ -7,13 +7,33 @@
|
|
|
7
7
|
import { appendFileSync, chmodSync, mkdirSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { tmpdir } from "node:os";
|
|
9
9
|
import { join } from "node:path";
|
|
10
|
+
/**
|
|
11
|
+
* Encode a cwd path as a filesystem-safe directory name. Handles:
|
|
12
|
+
* - POSIX: "/home/user/project" → "home-user-project"
|
|
13
|
+
* - Windows: "C:\Users\foo\project" → "Users-foo-project"
|
|
14
|
+
* - UNC: "\\\\server\\share\\project" → "server-share-project"
|
|
15
|
+
*/
|
|
16
|
+
export function encodeCwd(cwd) {
|
|
17
|
+
return cwd
|
|
18
|
+
.replace(/[/\\]/g, "-") // both separators → dash
|
|
19
|
+
.replace(/^[A-Za-z]:-/, "") // strip Windows drive prefix ("C:-")
|
|
20
|
+
.replace(/^-+/, ""); // strip leading dashes (POSIX root, UNC)
|
|
21
|
+
}
|
|
10
22
|
/** Create the output file path, ensuring the directory exists.
|
|
11
23
|
* Mirrors Claude Code's layout: /tmp/{prefix}-{uid}/{encoded-cwd}/{sessionId}/tasks/{agentId}.output */
|
|
12
24
|
export function createOutputFilePath(cwd, agentId, sessionId) {
|
|
13
|
-
const encoded = cwd
|
|
25
|
+
const encoded = encodeCwd(cwd);
|
|
14
26
|
const root = join(tmpdir(), `pi-subagents-${process.getuid?.() ?? 0}`);
|
|
15
27
|
mkdirSync(root, { recursive: true, mode: 0o700 });
|
|
16
|
-
|
|
28
|
+
// chmod is a no-op on Windows and throws on some Windows filesystems.
|
|
29
|
+
// On Unix we still want to enforce 0o700 past umask, so only swallow on Windows.
|
|
30
|
+
try {
|
|
31
|
+
chmodSync(root, 0o700);
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
if (process.platform !== "win32")
|
|
35
|
+
throw err;
|
|
36
|
+
}
|
|
17
37
|
const dir = join(root, encoded, sessionId, "tasks");
|
|
18
38
|
mkdirSync(dir, { recursive: true });
|
|
19
39
|
return join(dir, `${agentId}.output`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tintinweb/pi-subagents",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "A pi extension extension that brings smart Claude Code-style autonomous sub-agents to pi.",
|
|
5
5
|
"author": "tintinweb",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"autonomous"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@mariozechner/pi-ai": "^0.70.
|
|
25
|
-
"@mariozechner/pi-coding-agent": "^0.70.
|
|
26
|
-
"@mariozechner/pi-tui": "^0.70.
|
|
24
|
+
"@mariozechner/pi-ai": "^0.70.5",
|
|
25
|
+
"@mariozechner/pi-coding-agent": "^0.70.5",
|
|
26
|
+
"@mariozechner/pi-tui": "^0.70.5",
|
|
27
27
|
"@sinclair/typebox": "latest"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@biomejs/biome": "^2.3.5",
|
|
40
40
|
"@types/node": "^25.5.0",
|
|
41
|
-
"typescript": "^
|
|
41
|
+
"typescript": "^6.0.0",
|
|
42
42
|
"vitest": "^4.0.18"
|
|
43
43
|
},
|
|
44
44
|
"pi": {
|
package/src/output-file.ts
CHANGED
|
@@ -10,13 +10,32 @@ import { tmpdir } from "node:os";
|
|
|
10
10
|
import { join } from "node:path";
|
|
11
11
|
import type { AgentSession, AgentSessionEvent } from "@mariozechner/pi-coding-agent";
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Encode a cwd path as a filesystem-safe directory name. Handles:
|
|
15
|
+
* - POSIX: "/home/user/project" → "home-user-project"
|
|
16
|
+
* - Windows: "C:\Users\foo\project" → "Users-foo-project"
|
|
17
|
+
* - UNC: "\\\\server\\share\\project" → "server-share-project"
|
|
18
|
+
*/
|
|
19
|
+
export function encodeCwd(cwd: string): string {
|
|
20
|
+
return cwd
|
|
21
|
+
.replace(/[/\\]/g, "-") // both separators → dash
|
|
22
|
+
.replace(/^[A-Za-z]:-/, "") // strip Windows drive prefix ("C:-")
|
|
23
|
+
.replace(/^-+/, ""); // strip leading dashes (POSIX root, UNC)
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
/** Create the output file path, ensuring the directory exists.
|
|
14
27
|
* Mirrors Claude Code's layout: /tmp/{prefix}-{uid}/{encoded-cwd}/{sessionId}/tasks/{agentId}.output */
|
|
15
28
|
export function createOutputFilePath(cwd: string, agentId: string, sessionId: string): string {
|
|
16
|
-
const encoded = cwd
|
|
29
|
+
const encoded = encodeCwd(cwd);
|
|
17
30
|
const root = join(tmpdir(), `pi-subagents-${process.getuid?.() ?? 0}`);
|
|
18
31
|
mkdirSync(root, { recursive: true, mode: 0o700 });
|
|
19
|
-
|
|
32
|
+
// chmod is a no-op on Windows and throws on some Windows filesystems.
|
|
33
|
+
// On Unix we still want to enforce 0o700 past umask, so only swallow on Windows.
|
|
34
|
+
try {
|
|
35
|
+
chmodSync(root, 0o700);
|
|
36
|
+
} catch (err) {
|
|
37
|
+
if (process.platform !== "win32") throw err;
|
|
38
|
+
}
|
|
20
39
|
const dir = join(root, encoded, sessionId, "tasks");
|
|
21
40
|
mkdirSync(dir, { recursive: true });
|
|
22
41
|
return join(dir, `${agentId}.output`);
|