fix(pi): load installed device extensions
This commit is contained in:
@@ -177,11 +177,12 @@ async function createThreadRuntime(channel, rawOptions) {
|
||||
const appendSystemPrompts = optionValues(args, '--append-system-prompt');
|
||||
const sessionId = requiredString(optionValue(args, '--session-id'), 'Thread session id');
|
||||
const forkSessionId = optionValue(args, '--fork');
|
||||
const extensionPaths = optionValues(args, '--extension').map((value) => path.resolve(value));
|
||||
const [makeloreExtensionPath, ...additionalExtensionPaths] = optionValues(args, '--extension')
|
||||
.map((value) => path.resolve(value));
|
||||
const skillPaths = optionValues(args, '--skill').map((value) => path.resolve(value));
|
||||
if (extensionPaths.length !== 1) throw new Error('Thread requires exactly one Makelore extension');
|
||||
if (!makeloreExtensionPath) throw new Error('Thread requires a Makelore extension');
|
||||
if (appendSystemPrompts.length !== 1) throw new Error('Thread requires exactly one Makelore language prompt');
|
||||
const extensionModule = await import(pathToFileURL(extensionPaths[0]).href);
|
||||
const extensionModule = await import(pathToFileURL(makeloreExtensionPath).href);
|
||||
if (typeof extensionModule.createMakeloreRuntime !== 'function') {
|
||||
throw new Error('Makelore runtime extension factory is unavailable');
|
||||
}
|
||||
@@ -215,6 +216,7 @@ async function createThreadRuntime(channel, rawOptions) {
|
||||
cwd: runtimeCwd,
|
||||
})),
|
||||
}],
|
||||
additionalExtensionPaths,
|
||||
additionalSkillPaths: skillPaths,
|
||||
noExtensions: true,
|
||||
noSkills: true,
|
||||
|
||||
Reference in New Issue
Block a user