feat(ai): wire the four v1 companion tools into a shared registry

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-01 18:18:44 +10:00
parent 7282729654
commit 02e2a633f0
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { describe, it, expect } from 'vitest';
import { companionRegistry } from '../../../../lib/ai/agent/tools/index.js';
describe('companion registry', () => {
it('registers exactly the four v1 tools', () => {
expect(companionRegistry.listTools().map(t => t.name).sort())
.toEqual(['context', 'propose_change', 'read', 'search']);
});
it('exposes them in Anthropic shape', () => {
const tools = companionRegistry.toAnthropicTools();
expect(tools.every(t => t.name && t.input_schema && !('handler' in t))).toBe(true);
});
});