feat(pi): add persistent Mosaic /goal controller (#1152)
This commit was merged in pull request #1152.
This commit is contained in:
@@ -715,9 +715,15 @@ export function buildPiSkillArgs(
|
||||
return ['--no-skills', ...forcedSkillArgs];
|
||||
}
|
||||
|
||||
function discoverPiExtension(): string[] {
|
||||
const ext = join(MOSAIC_HOME, 'runtime', 'pi', 'mosaic-extension.ts');
|
||||
return existsSync(ext) ? ['--extension', ext] : [];
|
||||
const PI_EXTENSION_FILES = ['mosaic-extension.ts', 'goal-extension.ts'] as const;
|
||||
|
||||
export function discoverPiExtensionArgs(mosaicHome: string = MOSAIC_HOME): string[] {
|
||||
const args: string[] = [];
|
||||
for (const fileName of PI_EXTENSION_FILES) {
|
||||
const extensionPath = join(mosaicHome, 'runtime', 'pi', fileName);
|
||||
if (existsSync(extensionPath)) args.push('--extension', extensionPath);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// ─── Launch functions ────────────────────────────────────────────────────────
|
||||
@@ -792,7 +798,7 @@ function launchRuntime(runtime: RuntimeName, args: string[], yolo: boolean): nev
|
||||
const prompt = buildRuntimePrompt('pi');
|
||||
const cliArgs = ['--append-system-prompt', prompt];
|
||||
cliArgs.push(...buildPiSkillArgs(args));
|
||||
cliArgs.push(...discoverPiExtension());
|
||||
cliArgs.push(...discoverPiExtensionArgs());
|
||||
if (hasMissionNoArgs) {
|
||||
cliArgs.push(missionPrompt);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user