docs: update README for plugin system, add proxyModel tests

- Rewrite README Content Pipeline section as Plugin System section
  documenting built-in plugins (default, gate, content-pipeline),
  plugin hooks, and the relationship between gating and proxyModel
- Update all README examples to use --proxy-model instead of --gated
- Add unit tests: proxyModel normalization in JSON/YAML output (4 tests),
  Plugin Config section in describe output (2 tests)
- Add smoke tests: yaml/json output shows resolved proxyModel without
  gated field, round-trip compatibility (4 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Michal
2026-03-07 01:24:47 +00:00
parent f60d40a25b
commit d9d0a7a374
4 changed files with 224 additions and 40 deletions

View File

@@ -142,5 +142,40 @@ describe('ProxyModel smoke tests', () => {
expect(output).toContain('Plugin Config');
expect(output).toContain('Plugin:');
});
it('mcpctl get projects -o yaml shows proxyModel and no gated field', async () => {
if (!available) return;
const output = await mcpctl('get projects -o yaml');
// proxyModel should be resolved (not empty)
expect(output).toContain('proxyModel:');
expect(output).not.toContain('gated:');
});
it('mcpctl get projects -o json shows proxyModel and no gated field', async () => {
if (!available) return;
const json = await mcpctl('get projects -o json');
const projects = JSON.parse(json) as Array<{ proxyModel?: string; gated?: boolean }>;
expect(projects.length).toBeGreaterThan(0);
for (const project of projects) {
expect(project.proxyModel).toBeDefined();
expect(project.proxyModel).not.toBe('');
expect(project).not.toHaveProperty('gated');
}
});
it('mcpctl get projects -o yaml is round-trip compatible with apply', async () => {
if (!available) return;
const yaml = await mcpctl('get projects -o yaml');
// Should contain kind and proxyModel (apply-compatible fields)
expect(yaml).toContain('kind: project');
expect(yaml).toContain('proxyModel:');
// Should not contain internal fields
expect(yaml).not.toContain('ownerId:');
expect(yaml).not.toContain('createdAt:');
});
});
});