Merge pull request 'feat(cli): show the active mcpctl project in prime-agent's footer' (#96) from feat/mcpctl-switcher-status into main
Some checks failed
Some checks failed
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -510,6 +510,24 @@ describe('config prime-agent', () => {
|
|||||||
expect(exceptionSafeRead(join(tmpDir, '.mcpctl-project'))).toBeNull();
|
expect(exceptionSafeRead(join(tmpDir, '.mcpctl-project'))).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('the installed switcher extension publishes the active project to the footer', async () => {
|
||||||
|
const settingsPath = join(tmpDir, 'settings.json');
|
||||||
|
const cmd = createConfigCommand(
|
||||||
|
{ configDeps: { configDir: tmpDir }, log },
|
||||||
|
{ client, credentialsDeps: { configDir: tmpDir }, log },
|
||||||
|
);
|
||||||
|
await cmd.parseAsync(['prime-agent', '--project', 'ha', '-o', settingsPath, '--skip-skills', '--token', 'mcpctl_pat_x'], { from: 'user' });
|
||||||
|
|
||||||
|
const ext = readFileSync(join(tmpDir, 'extensions', 'mcpctl-switch.ts'), 'utf-8');
|
||||||
|
// Footer status, refreshed on startup and on every reload (which is what
|
||||||
|
// the switch itself triggers) — the mcpctl equivalent of the model name.
|
||||||
|
expect(ext).toContain("pi.on('session_start'");
|
||||||
|
expect(ext).toContain('ctx.ui.setStatus(STATUS_KEY');
|
||||||
|
expect(ext).toContain('`mcpctl:${active}`');
|
||||||
|
// notify() only accepts info|warning|error — 'success' is not a valid type.
|
||||||
|
expect(ext).not.toContain("'success'");
|
||||||
|
});
|
||||||
|
|
||||||
it('the installed switcher extension passes --skip-marker', async () => {
|
it('the installed switcher extension passes --skip-marker', async () => {
|
||||||
const settingsPath = join(tmpDir, 'settings.json');
|
const settingsPath = join(tmpDir, 'settings.json');
|
||||||
const cmd = createConfigCommand(
|
const cmd = createConfigCommand(
|
||||||
|
|||||||
Reference in New Issue
Block a user