Files
waggle-os/packages/server/tests/launch-args.test.ts
shumeiko.it 2edfd01e6e refactor: remove coding-agent hook management (P2.2)
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.
2026-11-01 00:35:13 +01:00

38 lines
1.6 KiB
TypeScript

/**
* AI-OS #5 fast-follow — promptArgTemplate application: a third-party adapter's
* declarative template turns a raw prompt into CLI args at launch. Focused unit
* on the exported resolver (the route just looks the manifest up + calls it).
*/
import { describe, it, expect } from 'vitest';
import { resolveLaunchArgs } from '../src/local/routes/tools.js';
import type { ToolManifest } from '@waggle/shared';
const manifest = (promptArgTemplate?: string[]): ToolManifest => ({
id: 'foo',
displayName: 'Foo',
launchable: true,
detect: { kind: 'path', binaryName: 'foo' },
...(promptArgTemplate ? { promptArgTemplate } : {}),
builtin: false,
});
describe('resolveLaunchArgs (#5 fast-follow)', () => {
it('passes through explicit args (built-in path) unchanged', () => {
expect(resolveLaunchArgs(manifest(['--print', '{prompt}']), { args: ['--print', 'hi'], prompt: 'ignored' }))
.toEqual(['--print', 'hi']);
});
it('applies a third-party promptArgTemplate when a prompt is given and no args', () => {
expect(resolveLaunchArgs(manifest(['--print', '{prompt}']), { prompt: 'hello' }))
.toEqual(['--print', 'hello']);
});
it('returns undefined with no args and no template', () => {
expect(resolveLaunchArgs(manifest(), { prompt: 'hello' })).toBeUndefined();
});
it('returns undefined with a template but no prompt', () => {
expect(resolveLaunchArgs(manifest(['--print', '{prompt}']), {})).toBeUndefined();
});
it('returns undefined when the manifest is missing', () => {
expect(resolveLaunchArgs(undefined, { prompt: 'hello' })).toBeUndefined();
});
});