fix(coding-agent): load photon via dynamic import

This commit is contained in:
Mario Zechner 2026-01-17 21:32:23 +01:00
parent 157e4e51bf
commit 94bd7f69fd
4 changed files with 28 additions and 37 deletions

View file

@ -1,5 +1,5 @@
import type { ImageContent } from "@mariozechner/pi-ai";
import { getPhoton } from "./photon.js";
import { loadPhoton } from "./photon.js";
export interface ImageResizeOptions {
maxWidth?: number; // Default: 2000
@ -53,7 +53,7 @@ export async function resizeImage(img: ImageContent, options?: ImageResizeOption
const opts = { ...DEFAULT_OPTIONS, ...options };
const inputBuffer = Buffer.from(img.data, "base64");
const photon = getPhoton();
const photon = await loadPhoton();
if (!photon) {
// Photon not available, return original image
return {