Compare commits

...

4 Commits

Author SHA1 Message Date
Michal
3f93f0798f 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
CI/CD / lint (push) Successful in 1m4s
CI/CD / typecheck (push) Successful in 2m18s
CI/CD / test (push) Successful in 1m18s
CI/CD / build (push) Successful in 2m13s
CI/CD / smoke (push) Failing after 3m24s
CI/CD / publish (push) Has been skipped
2026-08-08 12:18:22 +01:00
Michal
ce7df10e06 feat(cli): show the active mcpctl project in prime-agent's footer
`/mcpctl` could switch projects but there was no way to see which one was
active without running a command. prime-agent exposes the same status-bar
channel the model name uses (`ctx.ui.setStatus`), so the switcher now
publishes `mcpctl:<project>` there.

Wired to `session_start`, which fires on startup *and* on every reload —
including the reload the switch itself triggers — so the footer tracks
settings.json without extra bookkeeping. Cleared when no project is mounted.

Also fixes `notify(..., 'success')`: the API only accepts info|warning|error.
Not a live bug (prime-agent falls through to the same showStatus path as
'info') but it fails a typecheck of the extension against the real
ExtensionAPI, which is how it was found.

The extension ships as a JSON-escaped string and is never compiled by our
build, so it was typechecked out-of-tree against
@earendil-works/pi-coding-agent's published types.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BMXdb2qZbPSh8Q7XpTyjB
2026-08-08 12:18:21 +01:00
Michal
25c1bffdd0 Merge pull request 'fix(cli): harden config prime-agent sync, auth + /mcpctl switcher' (#95) from feat/config-prime-agent into main
Some checks failed
CI/CD / typecheck (push) Successful in 1m5s
CI/CD / lint (push) Successful in 2m11s
CI/CD / test (push) Successful in 1m20s
CI/CD / smoke (push) Failing after 1m53s
CI/CD / build (push) Successful in 4m7s
CI/CD / publish (push) Has been skipped
2026-08-08 12:02:08 +01:00
d56a074733 Merge pull request 'feat(cli): add mcpctl config prime-agent — proxy MCP + skills sync for prime-agent' (#93) from feat/config-prime-agent into main
Some checks failed
CI/CD / lint (push) Successful in 1m6s
CI/CD / typecheck (push) Successful in 2m9s
CI/CD / test (push) Successful in 1m21s
CI/CD / smoke (push) Failing after 1m53s
CI/CD / build (push) Successful in 4m16s
CI/CD / publish (push) Has been skipped
Reviewed-on: #93
2026-08-08 09:19:32 +00:00
2 changed files with 19 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -510,6 +510,24 @@ describe('config prime-agent', () => {
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 () => {
const settingsPath = join(tmpDir, 'settings.json');
const cmd = createConfigCommand(