@oh-my-pi/pi-coding-agent 4.8.0 → 4.8.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [4.8.1] - 2026-01-12
6
+
7
+ ### Fixed
8
+
9
+ - Prevent bun from statically resolving sharp import to fix runtime errors on arm64
10
+
5
11
  ## [4.8.0] - 2026-01-12
6
12
 
7
13
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-coding-agent",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "ompConfig": {
@@ -39,10 +39,10 @@
39
39
  "prepublishOnly": "bun run generate-template && bun run clean && bun run build"
40
40
  },
41
41
  "dependencies": {
42
- "@oh-my-pi/pi-ai": "4.8.0",
43
- "@oh-my-pi/pi-agent-core": "4.8.0",
44
- "@oh-my-pi/pi-git-tool": "4.8.0",
45
- "@oh-my-pi/pi-tui": "4.8.0",
42
+ "@oh-my-pi/pi-ai": "4.8.1",
43
+ "@oh-my-pi/pi-agent-core": "4.8.1",
44
+ "@oh-my-pi/pi-git-tool": "4.8.1",
45
+ "@oh-my-pi/pi-tui": "4.8.1",
46
46
  "@openai/agents": "^0.3.7",
47
47
  "@sinclair/typebox": "^0.34.46",
48
48
  "ajv": "^8.17.1",
@@ -16,7 +16,9 @@ export async function convertToPng(
16
16
 
17
17
  // Try sharp first
18
18
  try {
19
- const sharp = (await import("sharp")).default;
19
+ // Use variable to prevent bun from statically analyzing the import
20
+ const sharpModule = "sharp";
21
+ const sharp = (await import(/* @vite-ignore */ sharpModule)).default;
20
22
  const buffer = Buffer.from(base64Data, "base64");
21
23
  const pngBuffer = await sharp(buffer).png().toBuffer();
22
24
  return {
@@ -99,9 +99,12 @@ export async function resizeImage(img: ImageContent, options?: ImageResizeOption
99
99
  const opts = { ...DEFAULT_OPTIONS, ...options };
100
100
  const buffer = Buffer.from(img.data, "base64");
101
101
 
102
- let sharp: typeof import("sharp") | undefined;
102
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
103
+ let sharp: any;
103
104
  try {
104
- sharp = (await import("sharp")).default;
105
+ // Use variable to prevent bun from statically analyzing the import
106
+ const sharpModule = "sharp";
107
+ sharp = (await import(/* @vite-ignore */ sharpModule)).default;
105
108
  } catch {
106
109
  // Sharp not available - try ImageMagick fallback
107
110
  return resizeImageWithImageMagick(img, opts);
@@ -147,13 +150,11 @@ export async function resizeImage(img: ImageContent, options?: ImageResizeOption
147
150
  height: number,
148
151
  jpegQuality: number,
149
152
  ): Promise<{ buffer: Buffer; mimeType: string }> {
150
- const resized = await sharp!(buffer)
151
- .resize(width, height, { fit: "inside", withoutEnlargement: true })
152
- .toBuffer();
153
+ const resized = await sharp(buffer).resize(width, height, { fit: "inside", withoutEnlargement: true }).toBuffer();
153
154
 
154
155
  const [pngBuffer, jpegBuffer] = await Promise.all([
155
- sharp!(resized).png({ compressionLevel: 9 }).toBuffer(),
156
- sharp!(resized).jpeg({ quality: jpegQuality }).toBuffer(),
156
+ sharp(resized).png({ compressionLevel: 9 }).toBuffer(),
157
+ sharp(resized).jpeg({ quality: jpegQuality }).toBuffer(),
157
158
  ]);
158
159
 
159
160
  return pickSmaller({ buffer: pngBuffer, mimeType: "image/png" }, { buffer: jpegBuffer, mimeType: "image/jpeg" });