fix: lazy-load Pi device package manager

This commit is contained in:
brother7 committed 2026-09-02 19:14:33 +08:00
1 parent 756638a28a
commit 7469e95ef7
1 file changed
+3 -1
@@ -2,7 +2,6 @@ import { execFile } from 'node:child_process';
import { randomUUID } from 'node:crypto'; import { randomUUID } from 'node:crypto';
import { cp, mkdir, readFile, rename, rm, stat } from 'node:fs/promises'; import { cp, mkdir, readFile, rename, rm, stat } from 'node:fs/promises';
import path from 'node:path'; import path from 'node:path';
import { DefaultPackageManager, SettingsManager } from '@earendil-works/pi-coding-agent';
import { atomicWriteJson } from '../coding-projects/atomic-json'; import { atomicWriteJson } from '../coding-projects/atomic-json';
import { import {
devicePackageKind, devicePackageKind,
@@ -280,6 +279,9 @@ export class DevicePackageManager {
cwd, cwd,
env: installEnvironment(agentDir), env: installEnvironment(agentDir),
}); });
const { DefaultPackageManager, SettingsManager } = await import(
'@earendil-works/pi-coding-agent'
);
const manager = new DefaultPackageManager({ const manager = new DefaultPackageManager({
cwd, cwd,
agentDir, agentDir,