The hooks for Claude Code, Codex and the other agents ran the hive-mind-hooks-* packages, which left the repository; ADR-0002 hides the feature in v1. Remove the hook installer surface from the tool launcher, the POST /api/tools/hooks route, the hook status probe in tool detection, and the hook fields of the tool manifest and detection envelope (hookCapable, hookRoot, hookPointer, hooksInstalled, hookPointerPath). Third-party adapter manifests no longer accept the hook fields. In the web UI, remove the hidden hook actions and the "How memory is shared" explainer from the Launcher, adapter.manageHooks, the hook-wired count in Mission Control and the agentHooks and memoryMcp memory feature flags. Launch, watch and stop are unchanged; the roadmap tool note no longer mentions hooks.
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { getToolRegistry } from '../src/tool-registry.js';
|
|
import { SUPPORTED_TOOLS } from '@waggle/shared';
|
|
|
|
const fakeLoaderDeps = (manifests: unknown[]) => ({
|
|
dir: '/fake',
|
|
readDir: () => manifests.map((_, i) => `m${i}.json`),
|
|
readFile: (p: string) => JSON.stringify(manifests[Number(p.match(/m(\d+)\.json/)![1])]),
|
|
});
|
|
|
|
describe('getToolRegistry', () => {
|
|
it('includes all built-in tools when no third-party present', () => {
|
|
const ids = getToolRegistry({ dir: '/none', readDir: () => { throw new Error('ENOENT'); }, readFile: () => '' }).map((m) => m.id);
|
|
expect(ids.sort()).toEqual([...SUPPORTED_TOOLS].sort());
|
|
});
|
|
|
|
it('merges a valid third-party PATH adapter', () => {
|
|
const reg = getToolRegistry(fakeLoaderDeps([
|
|
{ id: 'foo-cli', displayName: 'Foo', launchable: true, detect: { kind: 'path', binaryName: 'foo' } },
|
|
]));
|
|
expect(reg.find((m) => m.id === 'foo-cli')).toMatchObject({ builtin: false });
|
|
expect(reg.length).toBe(SUPPORTED_TOOLS.length + 1);
|
|
});
|
|
|
|
it('built-in id wins a third-party collision', () => {
|
|
const reg = getToolRegistry(fakeLoaderDeps([
|
|
{ id: 'claude-code', displayName: 'HIJACK', launchable: true, detect: { kind: 'path', binaryName: 'x' } },
|
|
]));
|
|
const cc = reg.filter((m) => m.id === 'claude-code');
|
|
expect(cc).toHaveLength(1);
|
|
expect(cc[0].displayName).toBe('Claude Code');
|
|
});
|
|
});
|