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.
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
* Tool Detection — shared types for AI-OS Phase 0.
|
||||
*
|
||||
* Mission: report which external AI tools are installed on the user's
|
||||
* machine, with version and hive-mind hook status. Foundation for the
|
||||
* launcher dock (Phase 2), hook auto-installer UX (Phase 2), and the
|
||||
* machine, with version. Foundation for the launcher dock (Phase 2) and the
|
||||
* Mission Control inventory tile (Phase 4).
|
||||
*
|
||||
* The detection itself runs in the sidecar (agent package); these types
|
||||
@@ -11,7 +10,6 @@
|
||||
* consume the same envelope without duplicating shapes.
|
||||
*
|
||||
* Out of scope for these types:
|
||||
* - Hook installation (Phase 2)
|
||||
* - Tool spawn / process management (Phase 2)
|
||||
* - Workspace context injection (Phase 2)
|
||||
*/
|
||||
@@ -80,8 +78,7 @@ export type ToolReleaseStatus = 'supported' | 'roadmap';
|
||||
/**
|
||||
* AI-OS #5 — declarative descriptor for one external tool. The single source of
|
||||
* truth for the per-tool facts that used to be duplicated across SUPPORTED_TOOLS
|
||||
* / LAUNCH_COHORT / TOOL_DISPLAY_NAMES / HOOK_POINTER_BY_TOOL / HOOKS_COHORT /
|
||||
* the per-tool detectors. Built-ins live in BUILTIN_TOOL_MANIFESTS; third-party
|
||||
* / LAUNCH_COHORT / TOOL_DISPLAY_NAMES / the per-tool detectors. Built-ins live in BUILTIN_TOOL_MANIFESTS; third-party
|
||||
* adapters are loaded (data-only) from ~/.waggle/adapters/*.json.
|
||||
*/
|
||||
export interface ToolManifest {
|
||||
@@ -90,10 +87,6 @@ export interface ToolManifest {
|
||||
/** Omitted means supported; roadmap integrations remain detectable but inert. */
|
||||
releaseStatus?: ToolReleaseStatus;
|
||||
launchable: boolean;
|
||||
hookCapable: boolean;
|
||||
/** Built-in-only pointer root; third-party adapters always use the user home. */
|
||||
hookRoot?: 'user-home' | 'hermes-home';
|
||||
hookPointer: string;
|
||||
detect: ToolDetectSpec;
|
||||
/**
|
||||
* Declarative inline-prompt arg template for THIRD-PARTY path adapters
|
||||
@@ -112,13 +105,13 @@ export interface ToolManifest {
|
||||
/**
|
||||
* The canonical 8 built-in execution surfaces — the source of truth for their
|
||||
* per-tool data.
|
||||
* SUPPORTED_TOOLS (above) stays the `as const` type anchor; the cohort/name/
|
||||
* pointer consts derive from these manifests.
|
||||
* SUPPORTED_TOOLS (above) stays the `as const` type anchor; the cohort and
|
||||
* name consts derive from these manifests.
|
||||
*/
|
||||
export const BUILTIN_TOOL_MANIFESTS: readonly ToolManifest[] = [
|
||||
{
|
||||
id: 'claude-code', displayName: 'Claude Code', launchable: true, hookCapable: true,
|
||||
hookPointer: '.claude/hive-mind-install.json', detect: { kind: 'path', binaryName: 'claude' }, builtin: true,
|
||||
id: 'claude-code', displayName: 'Claude Code', launchable: true,
|
||||
detect: { kind: 'path', binaryName: 'claude' }, builtin: true,
|
||||
capabilities: { interactiveLaunch: true, headlessTask: true, structuredProgress: true, resumable: true, liveWaggleDance: false },
|
||||
task: {
|
||||
argvTemplate: ['-p', '--safe-mode', '--disable-slash-commands', '--max-budget-usd', '1.00', '--input-format', 'text', '--output-format', 'stream-json', '--verbose', '{accessArgs}'],
|
||||
@@ -133,18 +126,18 @@ export const BUILTIN_TOOL_MANIFESTS: readonly ToolManifest[] = [
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'claude-desktop', displayName: 'Claude Desktop', launchable: true, hookCapable: true,
|
||||
hookPointer: '.waggle/claude-desktop/hive-mind-install.json', detect: { kind: 'candidates' }, builtin: true,
|
||||
id: 'claude-desktop', displayName: 'Claude Desktop', launchable: true,
|
||||
detect: { kind: 'candidates' }, builtin: true,
|
||||
capabilities: { interactiveLaunch: true, headlessTask: false, structuredProgress: false, resumable: false, liveWaggleDance: false },
|
||||
},
|
||||
{
|
||||
id: 'cursor', displayName: 'Cursor', releaseStatus: 'roadmap', launchable: false, hookCapable: false,
|
||||
hookPointer: '.cursor/hive-mind-install.json', detect: { kind: 'candidates' }, builtin: true,
|
||||
id: 'cursor', displayName: 'Cursor', releaseStatus: 'roadmap', launchable: false,
|
||||
detect: { kind: 'candidates' }, builtin: true,
|
||||
capabilities: { interactiveLaunch: true, headlessTask: false, structuredProgress: false, resumable: false, liveWaggleDance: false },
|
||||
},
|
||||
{
|
||||
id: 'codex', displayName: 'Codex CLI', launchable: true, hookCapable: true,
|
||||
hookPointer: '.codex/hive-mind-install.json', detect: { kind: 'path', binaryName: 'codex' }, builtin: true,
|
||||
id: 'codex', displayName: 'Codex CLI', launchable: true,
|
||||
detect: { kind: 'path', binaryName: 'codex' }, builtin: true,
|
||||
capabilities: { interactiveLaunch: true, headlessTask: true, structuredProgress: true, resumable: true, liveWaggleDance: false },
|
||||
task: {
|
||||
argvTemplate: ['{accessArgs}', 'exec', '--ignore-user-config', '--ignore-rules', '--skip-git-repo-check', '--json', '--color', 'never', '-C', '{workspacePath}', '-'],
|
||||
@@ -159,13 +152,13 @@ export const BUILTIN_TOOL_MANIFESTS: readonly ToolManifest[] = [
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'codex-desktop', displayName: 'Codex Desktop', launchable: true, hookCapable: true,
|
||||
hookPointer: '.codex/hive-mind-install.json', detect: { kind: 'candidates' }, builtin: true,
|
||||
id: 'codex-desktop', displayName: 'Codex Desktop', launchable: true,
|
||||
detect: { kind: 'candidates' }, builtin: true,
|
||||
capabilities: { interactiveLaunch: true, headlessTask: false, structuredProgress: false, resumable: false, liveWaggleDance: false },
|
||||
},
|
||||
{
|
||||
id: 'hermes', displayName: 'Hermes Agent CLI', launchable: true, hookCapable: true,
|
||||
hookRoot: 'hermes-home', hookPointer: 'hive-mind-install.json', detect: { kind: 'path', binaryName: 'hermes' }, builtin: true,
|
||||
id: 'hermes', displayName: 'Hermes Agent CLI', launchable: true,
|
||||
detect: { kind: 'path', binaryName: 'hermes' }, builtin: true,
|
||||
capabilities: { interactiveLaunch: true, headlessTask: true, structuredProgress: false, resumable: true, liveWaggleDance: false },
|
||||
task: {
|
||||
argvTemplate: ['chat', '-q', '{prompt}', '-Q', '--source', 'tool', '--ignore-rules', '--max-turns', '12', '--checkpoints'],
|
||||
@@ -175,13 +168,13 @@ export const BUILTIN_TOOL_MANIFESTS: readonly ToolManifest[] = [
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'hermes-desktop', displayName: 'Hermes Desktop', launchable: true, hookCapable: false,
|
||||
hookPointer: '', detect: { kind: 'candidates' }, builtin: true,
|
||||
id: 'hermes-desktop', displayName: 'Hermes Desktop', launchable: true,
|
||||
detect: { kind: 'candidates' }, builtin: true,
|
||||
capabilities: { interactiveLaunch: true, headlessTask: false, structuredProgress: false, resumable: false, liveWaggleDance: false },
|
||||
},
|
||||
{
|
||||
id: 'openclaw', displayName: 'OpenClaw', releaseStatus: 'roadmap', launchable: false, hookCapable: false,
|
||||
hookPointer: '.openclaw/hive-mind-install.json', detect: { kind: 'path', binaryName: 'openclaw' }, builtin: true,
|
||||
id: 'openclaw', displayName: 'OpenClaw', releaseStatus: 'roadmap', launchable: false,
|
||||
detect: { kind: 'path', binaryName: 'openclaw' }, builtin: true,
|
||||
capabilities: { interactiveLaunch: true, headlessTask: true, structuredProgress: true, resumable: true, liveWaggleDance: false },
|
||||
task: {
|
||||
argvTemplate: ['agent', '--agent', '{agentId}', '--session-key', 'agent:{agentId}:waggle:{runId}', '--message-file', '{promptFile}', '--json', '--timeout', '{timeoutSeconds}'],
|
||||
@@ -193,10 +186,10 @@ export const BUILTIN_TOOL_MANIFESTS: readonly ToolManifest[] = [
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Tools the launcher dock + hook installer support end-to-end.
|
||||
* Tools the launcher dock supports end-to-end.
|
||||
*
|
||||
* Registered integrations can remain detectable for compatibility while
|
||||
* `releaseStatus: 'roadmap'` keeps them out of both launch and hook cohorts.
|
||||
* `releaseStatus: 'roadmap'` keeps them out of the launch cohort.
|
||||
*/
|
||||
export const LAUNCH_COHORT: readonly ToolId[] =
|
||||
BUILTIN_TOOL_MANIFESTS.filter((m) => m.launchable).map((m) => m.id as ToolId);
|
||||
@@ -225,11 +218,6 @@ export const TOOL_DISPLAY_NAMES = Object.fromEntries(
|
||||
* - `installed` : true iff the binary was found at a known path.
|
||||
* - `installedPath` : absolute path to the binary, or null.
|
||||
* - `version` : version string (best-effort; null if exec failed).
|
||||
* - `hooksInstalled` : true iff the hook pointer and its referenced rollback
|
||||
* state are healthy; tools with active-config verification must also still
|
||||
* contain their marker-tagged hook entries.
|
||||
* - `hookPointerPath` : the pointer file we read (or attempted),
|
||||
* for diagnostics.
|
||||
* - `diagnostic` : optional human-readable reason for any
|
||||
* partial-failure case (e.g. "claude-code installed but --version
|
||||
* returned non-zero").
|
||||
@@ -242,8 +230,6 @@ export interface DetectedTool {
|
||||
releaseStatus?: ToolReleaseStatus;
|
||||
/** True when the tool manifest allows launching from the dock. */
|
||||
launchable?: boolean;
|
||||
/** True when the tool manifest declares hook support. */
|
||||
hookCapable?: boolean;
|
||||
/** True for built-in execution surfaces; false for loaded adapters. */
|
||||
builtin?: boolean;
|
||||
/** True when the manifest can accept the launch prompt inline. */
|
||||
@@ -255,8 +241,6 @@ export interface DetectedTool {
|
||||
installed: boolean;
|
||||
installedPath: string | null;
|
||||
version: string | null;
|
||||
hooksInstalled: boolean;
|
||||
hookPointerPath: string | null;
|
||||
diagnostic?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,22 +14,13 @@ describe('BUILTIN_TOOL_MANIFESTS', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('keeps roadmap integrations detectable but outside launch and hook cohorts', () => {
|
||||
it('keeps roadmap integrations detectable but outside the launch cohort', () => {
|
||||
const roadmap = BUILTIN_TOOL_MANIFESTS.filter((m) => m.releaseStatus === 'roadmap');
|
||||
expect(roadmap.map((m) => m.id)).toEqual(['cursor', 'openclaw']);
|
||||
for (const manifest of roadmap) {
|
||||
expect(manifest.launchable).toBe(false);
|
||||
expect(manifest.hookCapable).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
it('keeps desktop-only and roadmap surfaces out of the hook cohort', () => {
|
||||
expect(BUILTIN_TOOL_MANIFESTS.filter((m) => !m.hookCapable).map((m) => m.id)).toEqual([
|
||||
'cursor',
|
||||
'hermes-desktop',
|
||||
'openclaw',
|
||||
]);
|
||||
});
|
||||
it('derives TOOL_DISPLAY_NAMES and the release-qualified launch cohort from manifests', () => {
|
||||
expect(TOOL_DISPLAY_NAMES['claude-code']).toBe('Claude Code');
|
||||
expect(TOOL_DISPLAY_NAMES['codex']).toBe('Codex CLI');
|
||||
@@ -44,14 +35,10 @@ describe('BUILTIN_TOOL_MANIFESTS', () => {
|
||||
|
||||
expect(cli).toMatchObject({
|
||||
displayName: 'Hermes Agent CLI',
|
||||
hookCapable: true,
|
||||
hookRoot: 'hermes-home',
|
||||
hookPointer: 'hive-mind-install.json',
|
||||
capabilities: { interactiveLaunch: true, headlessTask: true },
|
||||
});
|
||||
expect(desktop).toMatchObject({
|
||||
displayName: 'Hermes Desktop',
|
||||
hookCapable: false,
|
||||
detect: { kind: 'candidates' },
|
||||
capabilities: { interactiveLaunch: true, headlessTask: false, resumable: false },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user