@mariozechner/pi-coding-agent 0.12.1 → 0.12.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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.12.2] - 2025-12-02
6
+
7
+ ### Fixed
8
+
9
+ - **Windows Binary Path Resolution**: Fixed Bun compiled binary on Windows failing to find `package.json` and other assets. The binary was incorrectly using the Bun runtime's virtual filesystem path (`B:\~BUN\`) instead of the actual executable location. Now uses `process.execPath` which correctly points to the compiled binary, and updated detection to check for `%7EBUN` (URL-encoded `~BUN`) in `import.meta.url`.
10
+
5
11
  ## [0.12.1] - 2025-12-02
6
12
 
7
13
  ### Changed
package/README.md CHANGED
@@ -52,15 +52,20 @@ Extract and run:
52
52
  ```bash
53
53
  # macOS/Linux
54
54
  tar -xzf pi-darwin-arm64.tar.gz
55
- ./pi-darwin-arm64
55
+ ./pi
56
56
 
57
57
  # Windows
58
58
  unzip pi-windows-x64.zip
59
- pi-windows-x64.exe
59
+ pi.exe
60
60
  ```
61
61
 
62
62
  The archive includes the binary plus supporting files (README, CHANGELOG, themes). Keep them together in the same directory.
63
63
 
64
+ **macOS users**: The binary is not signed. macOS may block it on first run. To fix:
65
+ ```bash
66
+ xattr -c ./pi
67
+ ```
68
+
64
69
  ### Build Binary from Source
65
70
 
66
71
  Requires [Bun](https://bun.sh) 1.0+:
package/dist/paths.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Detect if we're running as a Bun compiled binary.
3
- * Bun binaries have import.meta.url starting with "file:///$bunfs/"
3
+ * Bun binaries have import.meta.url containing "%7EBUN" (URL-encoded ~BUN virtual filesystem path)
4
4
  */
5
5
  export declare const isBunBinary: boolean;
6
6
  /**
@@ -12,7 +12,7 @@ export declare const isBunBinary: boolean;
12
12
  export declare function getPackageDir(): string;
13
13
  /**
14
14
  * Get path to the theme directory
15
- * - For Bun binary: dist/theme/ next to executable
15
+ * - For Bun binary: theme/ next to executable
16
16
  * - For Node.js (dist/): dist/theme/
17
17
  * - For tsx (src/): src/theme/
18
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAgD,CAAC;AAEzE;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAWtC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAMpC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC","sourcesContent":["import { existsSync } from \"fs\";\nimport { dirname, join, resolve } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Detect if we're running as a Bun compiled binary.\n * Bun binaries have import.meta.url starting with \"file:///$bunfs/\"\n */\nexport const isBunBinary = import.meta.url.startsWith(\"file:///$bunfs/\");\n\n/**\n * Get the base directory for resolving package assets (themes, package.json, README.md, CHANGELOG.md).\n * - For Bun binary: returns the directory containing the executable\n * - For Node.js (dist/): returns __dirname (the dist/ directory)\n * - For tsx (src/): returns parent directory (the package root)\n */\nexport function getPackageDir(): string {\n\tif (isBunBinary) {\n\t\t// Bun binary: resolve relative to the executable\n\t\treturn dirname(process.execPath);\n\t}\n\t// Node.js: check if package.json exists in __dirname (dist/) or parent (src/ case)\n\tif (existsSync(join(__dirname, \"package.json\"))) {\n\t\treturn __dirname;\n\t}\n\t// Running from src/ via tsx - go up one level to package root\n\treturn dirname(__dirname);\n}\n\n/**\n * Get path to the theme directory\n * - For Bun binary: dist/theme/ next to executable\n * - For Node.js (dist/): dist/theme/\n * - For tsx (src/): src/theme/\n */\nexport function getThemeDir(): string {\n\tif (isBunBinary) {\n\t\treturn join(dirname(process.execPath), \"theme\");\n\t}\n\t// __dirname is either dist/ or src/ - theme is always a subdirectory\n\treturn join(__dirname, \"theme\");\n}\n\n/**\n * Get path to package.json\n */\nexport function getPackageJsonPath(): string {\n\treturn join(getPackageDir(), \"package.json\");\n}\n\n/**\n * Get path to README.md\n */\nexport function getReadmePath(): string {\n\treturn resolve(join(getPackageDir(), \"README.md\"));\n}\n\n/**\n * Get path to CHANGELOG.md\n */\nexport function getChangelogPath(): string {\n\treturn resolve(join(getPackageDir(), \"CHANGELOG.md\"));\n}\n"]}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAqC,CAAC;AAO9D;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAWtC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAMpC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC","sourcesContent":["import { existsSync } from \"fs\";\nimport { dirname, join, resolve } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Detect if we're running as a Bun compiled binary.\n * Bun binaries have import.meta.url containing \"%7EBUN\" (URL-encoded ~BUN virtual filesystem path)\n */\nexport const isBunBinary = import.meta.url.includes(\"%7EBUN\");\n\n/**\n * Type definition for Bun global (only available when running via Bun)\n */\ndeclare const Bun: { main: string } | undefined;\n\n/**\n * Get the base directory for resolving package assets (themes, package.json, README.md, CHANGELOG.md).\n * - For Bun binary: returns the directory containing the executable\n * - For Node.js (dist/): returns __dirname (the dist/ directory)\n * - For tsx (src/): returns parent directory (the package root)\n */\nexport function getPackageDir(): string {\n\tif (isBunBinary) {\n\t\t// Bun binary: process.execPath points to the compiled executable\n\t\treturn dirname(process.execPath);\n\t}\n\t// Node.js: check if package.json exists in __dirname (dist/) or parent (src/ case)\n\tif (existsSync(join(__dirname, \"package.json\"))) {\n\t\treturn __dirname;\n\t}\n\t// Running from src/ via tsx - go up one level to package root\n\treturn dirname(__dirname);\n}\n\n/**\n * Get path to the theme directory\n * - For Bun binary: theme/ next to executable\n * - For Node.js (dist/): dist/theme/\n * - For tsx (src/): src/theme/\n */\nexport function getThemeDir(): string {\n\tif (isBunBinary) {\n\t\treturn join(dirname(process.execPath), \"theme\");\n\t}\n\t// __dirname is either dist/ or src/ - theme is always a subdirectory\n\treturn join(__dirname, \"theme\");\n}\n\n/**\n * Get path to package.json\n */\nexport function getPackageJsonPath(): string {\n\treturn join(getPackageDir(), \"package.json\");\n}\n\n/**\n * Get path to README.md\n */\nexport function getReadmePath(): string {\n\treturn resolve(join(getPackageDir(), \"README.md\"));\n}\n\n/**\n * Get path to CHANGELOG.md\n */\nexport function getChangelogPath(): string {\n\treturn resolve(join(getPackageDir(), \"CHANGELOG.md\"));\n}\n"]}
package/dist/paths.js CHANGED
@@ -5,9 +5,9 @@ const __filename = fileURLToPath(import.meta.url);
5
5
  const __dirname = dirname(__filename);
6
6
  /**
7
7
  * Detect if we're running as a Bun compiled binary.
8
- * Bun binaries have import.meta.url starting with "file:///$bunfs/"
8
+ * Bun binaries have import.meta.url containing "%7EBUN" (URL-encoded ~BUN virtual filesystem path)
9
9
  */
10
- export const isBunBinary = import.meta.url.startsWith("file:///$bunfs/");
10
+ export const isBunBinary = import.meta.url.includes("%7EBUN");
11
11
  /**
12
12
  * Get the base directory for resolving package assets (themes, package.json, README.md, CHANGELOG.md).
13
13
  * - For Bun binary: returns the directory containing the executable
@@ -16,7 +16,7 @@ export const isBunBinary = import.meta.url.startsWith("file:///$bunfs/");
16
16
  */
17
17
  export function getPackageDir() {
18
18
  if (isBunBinary) {
19
- // Bun binary: resolve relative to the executable
19
+ // Bun binary: process.execPath points to the compiled executable
20
20
  return dirname(process.execPath);
21
21
  }
22
22
  // Node.js: check if package.json exists in __dirname (dist/) or parent (src/ case)
@@ -28,7 +28,7 @@ export function getPackageDir() {
28
28
  }
29
29
  /**
30
30
  * Get path to the theme directory
31
- * - For Bun binary: dist/theme/ next to executable
31
+ * - For Bun binary: theme/ next to executable
32
32
  * - For Node.js (dist/): dist/theme/
33
33
  * - For tsx (src/): src/theme/
34
34
  */
package/dist/paths.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,UAAU,aAAa,GAAW;IACvC,IAAI,WAAW,EAAE,CAAC;QACjB,iDAAiD;QACjD,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IACD,mFAAmF;IACnF,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QACjD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,8DAA8D;IAC9D,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAAA,CAC1B;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,GAAW;IACrC,IAAI,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IACD,qEAAqE;IACrE,OAAO,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAAA,CAChC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,GAAW;IAC5C,OAAO,IAAI,CAAC,aAAa,EAAE,EAAE,cAAc,CAAC,CAAC;AAAA,CAC7C;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,GAAW;IACvC,OAAO,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;AAAA,CACnD;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,GAAW;IAC1C,OAAO,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;AAAA,CACtD","sourcesContent":["import { existsSync } from \"fs\";\nimport { dirname, join, resolve } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Detect if we're running as a Bun compiled binary.\n * Bun binaries have import.meta.url starting with \"file:///$bunfs/\"\n */\nexport const isBunBinary = import.meta.url.startsWith(\"file:///$bunfs/\");\n\n/**\n * Get the base directory for resolving package assets (themes, package.json, README.md, CHANGELOG.md).\n * - For Bun binary: returns the directory containing the executable\n * - For Node.js (dist/): returns __dirname (the dist/ directory)\n * - For tsx (src/): returns parent directory (the package root)\n */\nexport function getPackageDir(): string {\n\tif (isBunBinary) {\n\t\t// Bun binary: resolve relative to the executable\n\t\treturn dirname(process.execPath);\n\t}\n\t// Node.js: check if package.json exists in __dirname (dist/) or parent (src/ case)\n\tif (existsSync(join(__dirname, \"package.json\"))) {\n\t\treturn __dirname;\n\t}\n\t// Running from src/ via tsx - go up one level to package root\n\treturn dirname(__dirname);\n}\n\n/**\n * Get path to the theme directory\n * - For Bun binary: dist/theme/ next to executable\n * - For Node.js (dist/): dist/theme/\n * - For tsx (src/): src/theme/\n */\nexport function getThemeDir(): string {\n\tif (isBunBinary) {\n\t\treturn join(dirname(process.execPath), \"theme\");\n\t}\n\t// __dirname is either dist/ or src/ - theme is always a subdirectory\n\treturn join(__dirname, \"theme\");\n}\n\n/**\n * Get path to package.json\n */\nexport function getPackageJsonPath(): string {\n\treturn join(getPackageDir(), \"package.json\");\n}\n\n/**\n * Get path to README.md\n */\nexport function getReadmePath(): string {\n\treturn resolve(join(getPackageDir(), \"README.md\"));\n}\n\n/**\n * Get path to CHANGELOG.md\n */\nexport function getChangelogPath(): string {\n\treturn resolve(join(getPackageDir(), \"CHANGELOG.md\"));\n}\n"]}
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAO9D;;;;;GAKG;AACH,MAAM,UAAU,aAAa,GAAW;IACvC,IAAI,WAAW,EAAE,CAAC;QACjB,iEAAiE;QACjE,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IACD,mFAAmF;IACnF,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QACjD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,8DAA8D;IAC9D,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAAA,CAC1B;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,GAAW;IACrC,IAAI,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IACD,qEAAqE;IACrE,OAAO,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAAA,CAChC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,GAAW;IAC5C,OAAO,IAAI,CAAC,aAAa,EAAE,EAAE,cAAc,CAAC,CAAC;AAAA,CAC7C;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,GAAW;IACvC,OAAO,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;AAAA,CACnD;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,GAAW;IAC1C,OAAO,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;AAAA,CACtD","sourcesContent":["import { existsSync } from \"fs\";\nimport { dirname, join, resolve } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Detect if we're running as a Bun compiled binary.\n * Bun binaries have import.meta.url containing \"%7EBUN\" (URL-encoded ~BUN virtual filesystem path)\n */\nexport const isBunBinary = import.meta.url.includes(\"%7EBUN\");\n\n/**\n * Type definition for Bun global (only available when running via Bun)\n */\ndeclare const Bun: { main: string } | undefined;\n\n/**\n * Get the base directory for resolving package assets (themes, package.json, README.md, CHANGELOG.md).\n * - For Bun binary: returns the directory containing the executable\n * - For Node.js (dist/): returns __dirname (the dist/ directory)\n * - For tsx (src/): returns parent directory (the package root)\n */\nexport function getPackageDir(): string {\n\tif (isBunBinary) {\n\t\t// Bun binary: process.execPath points to the compiled executable\n\t\treturn dirname(process.execPath);\n\t}\n\t// Node.js: check if package.json exists in __dirname (dist/) or parent (src/ case)\n\tif (existsSync(join(__dirname, \"package.json\"))) {\n\t\treturn __dirname;\n\t}\n\t// Running from src/ via tsx - go up one level to package root\n\treturn dirname(__dirname);\n}\n\n/**\n * Get path to the theme directory\n * - For Bun binary: theme/ next to executable\n * - For Node.js (dist/): dist/theme/\n * - For tsx (src/): src/theme/\n */\nexport function getThemeDir(): string {\n\tif (isBunBinary) {\n\t\treturn join(dirname(process.execPath), \"theme\");\n\t}\n\t// __dirname is either dist/ or src/ - theme is always a subdirectory\n\treturn join(__dirname, \"theme\");\n}\n\n/**\n * Get path to package.json\n */\nexport function getPackageJsonPath(): string {\n\treturn join(getPackageDir(), \"package.json\");\n}\n\n/**\n * Get path to README.md\n */\nexport function getReadmePath(): string {\n\treturn resolve(join(getPackageDir(), \"README.md\"));\n}\n\n/**\n * Get path to CHANGELOG.md\n */\nexport function getChangelogPath(): string {\n\treturn resolve(join(getPackageDir(), \"CHANGELOG.md\"));\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mariozechner/pi-coding-agent",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,9 +24,9 @@
24
24
  "prepublishOnly": "npm run clean && npm run build"
25
25
  },
26
26
  "dependencies": {
27
- "@mariozechner/pi-agent-core": "^0.12.1",
28
- "@mariozechner/pi-ai": "^0.12.1",
29
- "@mariozechner/pi-tui": "^0.12.1",
27
+ "@mariozechner/pi-agent-core": "^0.12.2",
28
+ "@mariozechner/pi-ai": "^0.12.2",
29
+ "@mariozechner/pi-tui": "^0.12.2",
30
30
  "chalk": "^5.5.0",
31
31
  "diff": "^8.0.2",
32
32
  "glob": "^11.0.3"