fix(packages): load bundled Pi runtime for local installs
This commit is contained in:
@@ -17,6 +17,7 @@ import type { PiProductTools } from './product-tools';
|
||||
import type { CodingPluginToolDefinition } from '../../../shared/coding-plugins';
|
||||
import type { PiSkillEntry } from './resource-loader';
|
||||
import type { EffectivePluginSnapshot } from '../../coding-plugins/effective-resolver';
|
||||
import { DevicePackageError } from '../../coding-packages/device-package-manager';
|
||||
|
||||
const MAX_REQUEST_BYTES = 64 * 1024;
|
||||
const PRODUCT_TOOL_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9._:-]{0,63}$/u;
|
||||
@@ -483,7 +484,14 @@ export class PiManagedExtensionHost {
|
||||
response.removeListener('close', cancel);
|
||||
record.waiters.delete(value.resourceId);
|
||||
}
|
||||
} catch {
|
||||
} catch (error) {
|
||||
if (!response.writableEnded && error instanceof DevicePackageError) {
|
||||
this.respond(response, 400, {
|
||||
code: error.code,
|
||||
error: error.message.slice(0, 512),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!response.writableEnded) this.respond(response, 400, { error: 'Bridge request failed' });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user