@cleocode/caamp 2026.10.8 → 2026.10.9-rc.ci.676

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/hooks/generated.ts","../src/core/hooks/normalizer.ts"],"sourcesContent":["// @generated — DO NOT EDIT. Source: providers/hook-mappings.json\n// Generated by scripts/generate-hook-types.ts\n\nimport type { ProviderHookProfile } from './types.js';\n\n/**\n * All hook event categories (8 total).\n * @public\n */\nexport const HOOK_CATEGORIES = [\n 'agent',\n 'context',\n 'memory',\n 'pipeline',\n 'prompt',\n 'session',\n 'task',\n 'tool',\n] as const;\n\n/** Union type of valid hook category strings. */\nexport type HookCategory = (typeof HOOK_CATEGORIES)[number];\n\n/**\n * Event source types: domain, provider.\n * @public\n */\nexport const EVENT_SOURCES = ['domain', 'provider'] as const;\n\n/** Union type of valid event source types. */\nexport type EventSource = (typeof EVENT_SOURCES)[number];\n\n/**\n * All canonical hook events (31 total: 16 provider, 15 domain).\n *\n * This replaces the previously hardcoded tuple in types.ts.\n * Single source of truth: providers/hook-mappings.json\n * @public\n */\nexport const CANONICAL_HOOK_EVENTS = [\n // Provider events\n 'ConfigChange',\n 'Notification',\n 'PermissionRequest',\n 'PostCompact',\n 'PostModel',\n 'PostToolUse',\n 'PostToolUseFailure',\n 'PreCompact',\n 'PreModel',\n 'PreToolUse',\n 'PromptSubmit',\n 'ResponseComplete',\n 'SessionEnd',\n 'SessionStart',\n 'SubagentStart',\n 'SubagentStop',\n // Domain events\n 'ApprovalExpired',\n 'ApprovalGranted',\n 'ApprovalRequested',\n 'MemoryDecisionStored',\n 'MemoryLearningStored',\n 'MemoryObserved',\n 'MemoryPatternStored',\n 'PipelineManifestAppended',\n 'PipelineStageCompleted',\n 'SessionEnded',\n 'SessionStarted',\n 'TaskBlocked',\n 'TaskCompleted',\n 'TaskCreated',\n 'TaskStarted',\n] as const;\n\n/** Union type of all canonical hook event names. */\nexport type CanonicalHookEvent = (typeof CANONICAL_HOOK_EVENTS)[number];\n\n/** Provider-sourced events only (original 16 CAAMP events). */\nexport const PROVIDER_HOOK_EVENTS = [\n 'ConfigChange',\n 'Notification',\n 'PermissionRequest',\n 'PostCompact',\n 'PostModel',\n 'PostToolUse',\n 'PostToolUseFailure',\n 'PreCompact',\n 'PreModel',\n 'PreToolUse',\n 'PromptSubmit',\n 'ResponseComplete',\n 'SessionEnd',\n 'SessionStart',\n 'SubagentStart',\n 'SubagentStop',\n] as const;\n\n/** Domain-sourced events only (CLEO business events). */\nexport const DOMAIN_HOOK_EVENTS = [\n 'ApprovalExpired',\n 'ApprovalGranted',\n 'ApprovalRequested',\n 'MemoryDecisionStored',\n 'MemoryLearningStored',\n 'MemoryObserved',\n 'MemoryPatternStored',\n 'PipelineManifestAppended',\n 'PipelineStageCompleted',\n 'SessionEnded',\n 'SessionStarted',\n 'TaskBlocked',\n 'TaskCompleted',\n 'TaskCreated',\n 'TaskStarted',\n] as const;\n\n/** Metadata for each canonical event, derived from hook-mappings.json. */\nexport const EVENT_METADATA: Record<\n CanonicalHookEvent,\n {\n category: HookCategory;\n source: EventSource;\n canBlock: boolean;\n description: string;\n }\n> = {\n ConfigChange: {\n category: 'context',\n source: 'provider',\n canBlock: false,\n description: 'Configuration file changes during a session',\n },\n Notification: {\n category: 'context',\n source: 'provider',\n canBlock: false,\n description: 'System notification or alert is emitted',\n },\n PermissionRequest: {\n category: 'tool',\n source: 'provider',\n canBlock: true,\n description: 'Permission dialog appears for a tool action',\n },\n PostCompact: {\n category: 'context',\n source: 'provider',\n canBlock: false,\n description: 'After context window compaction completes',\n },\n PostModel: {\n category: 'agent',\n source: 'provider',\n canBlock: false,\n description: 'After receiving an LLM response',\n },\n PostToolUse: {\n category: 'tool',\n source: 'provider',\n canBlock: false,\n description: 'After a tool call succeeds',\n },\n PostToolUseFailure: {\n category: 'tool',\n source: 'provider',\n canBlock: false,\n description: 'After a tool call fails or times out',\n },\n PreCompact: {\n category: 'context',\n source: 'provider',\n canBlock: false,\n description: 'Before context window compaction',\n },\n PreModel: {\n category: 'agent',\n source: 'provider',\n canBlock: true,\n description: 'Before sending a request to the LLM',\n },\n PreToolUse: {\n category: 'tool',\n source: 'provider',\n canBlock: true,\n description: 'Before a tool call executes (can block/modify)',\n },\n PromptSubmit: {\n category: 'prompt',\n source: 'provider',\n canBlock: true,\n description: 'User submits a prompt, before agent processes it',\n },\n ResponseComplete: {\n category: 'prompt',\n source: 'provider',\n canBlock: false,\n description: 'Agent finishes responding to a turn',\n },\n SessionEnd: {\n category: 'session',\n source: 'provider',\n canBlock: false,\n description: 'Session terminates or exits',\n },\n SessionStart: {\n category: 'session',\n source: 'provider',\n canBlock: false,\n description: 'Session begins, resumes, or is cleared',\n },\n SubagentStart: {\n category: 'agent',\n source: 'provider',\n canBlock: true,\n description: 'A subagent is spawned',\n },\n SubagentStop: {\n category: 'agent',\n source: 'provider',\n canBlock: false,\n description: 'A subagent finishes execution',\n },\n ApprovalExpired: {\n category: 'session',\n source: 'domain',\n canBlock: false,\n description: 'A workflow approval token has expired without response',\n },\n ApprovalGranted: {\n category: 'session',\n source: 'domain',\n canBlock: false,\n description: 'A workflow approval has been granted via /approve token',\n },\n ApprovalRequested: {\n category: 'session',\n source: 'domain',\n canBlock: false,\n description: 'A workflow approval gate has fired, awaiting human approval',\n },\n MemoryDecisionStored: {\n category: 'memory',\n source: 'domain',\n canBlock: false,\n description: 'A decision has been stored via memory.decision.store',\n },\n MemoryLearningStored: {\n category: 'memory',\n source: 'domain',\n canBlock: false,\n description: 'A learning has been stored via memory.learning.store',\n },\n MemoryObserved: {\n category: 'memory',\n source: 'domain',\n canBlock: false,\n description: 'An observation has been recorded to brain.db via memory.observe',\n },\n MemoryPatternStored: {\n category: 'memory',\n source: 'domain',\n canBlock: false,\n description: 'A pattern has been stored via memory.pattern.store',\n },\n PipelineManifestAppended: {\n category: 'pipeline',\n source: 'domain',\n canBlock: false,\n description:\n 'A manifest entry has been appended to `pipeline_manifest` (`SQLite` table per ADR-027)',\n },\n PipelineStageCompleted: {\n category: 'pipeline',\n source: 'domain',\n canBlock: false,\n description: 'A LOOM lifecycle gate has passed validation',\n },\n SessionEnded: {\n category: 'session',\n source: 'domain',\n canBlock: false,\n description: 'A CLEO session has ended via session.end',\n },\n SessionStarted: {\n category: 'session',\n source: 'domain',\n canBlock: false,\n description: 'A CLEO session has been started via session.start',\n },\n TaskBlocked: {\n category: 'task',\n source: 'domain',\n canBlock: false,\n description: 'A CLEO task has been blocked',\n },\n TaskCompleted: {\n category: 'task',\n source: 'domain',\n canBlock: false,\n description: 'A CLEO task has been marked complete via tasks.complete',\n },\n TaskCreated: {\n category: 'task',\n source: 'domain',\n canBlock: false,\n description: 'A CLEO task has been created via tasks.add',\n },\n TaskStarted: {\n category: 'task',\n source: 'domain',\n canBlock: false,\n description: 'A CLEO task has been started via tasks.start',\n },\n} as const;\n\n/** Generated capability registry version and review date. */\nexport const HOOK_REGISTRY_EVIDENCE = { version: '2.0.0', lastUpdated: '2026-10-10' };\n\n/** Complete fallback profiles generated from the registry. */\nexport const GENERATED_PROVIDER_HOOK_PROFILES: Record<string, ProviderHookProfile> = {\n 'claude-code': {\n hookSystem: 'config',\n hookConfigPath: '$HOME/.claude/settings.json',\n hookFormat: 'json',\n handlerTypes: ['command', 'http', 'prompt', 'agent'],\n experimental: false,\n projectDelivery: {\n configPath: '.claude/settings.local.json',\n timeoutUnit: 'seconds',\n documentedVersions: ['2.1.296'],\n verifiedVersions: [],\n documentation: 'https://code.claude.com/docs/en/hooks',\n reviewedAt: '2026-10-10',\n trust: 'native-unverified',\n },\n mappings: {\n SessionStart: {\n nativeName: 'SessionStart',\n supported: true,\n },\n SessionEnd: {\n nativeName: 'SessionEnd',\n supported: true,\n },\n PromptSubmit: {\n nativeName: 'UserPromptSubmit',\n supported: true,\n },\n ResponseComplete: {\n nativeName: 'Stop',\n supported: true,\n },\n PreToolUse: {\n nativeName: 'PreToolUse',\n supported: true,\n },\n PostToolUse: {\n nativeName: 'PostToolUse',\n supported: true,\n },\n PostToolUseFailure: {\n nativeName: 'PostToolUseFailure',\n supported: true,\n },\n PermissionRequest: {\n nativeName: 'PermissionRequest',\n supported: true,\n },\n SubagentStart: {\n nativeName: 'SubagentStart',\n supported: true,\n },\n SubagentStop: {\n nativeName: 'SubagentStop',\n supported: true,\n },\n PreModel: {\n nativeName: null,\n supported: false,\n },\n PostModel: {\n nativeName: null,\n supported: false,\n },\n PreCompact: {\n nativeName: 'PreCompact',\n supported: true,\n },\n PostCompact: {\n nativeName: 'PostCompact',\n supported: true,\n },\n Notification: {\n nativeName: 'Notification',\n supported: true,\n },\n ConfigChange: {\n nativeName: 'ConfigChange',\n supported: true,\n },\n },\n providerOnlyEvents: [\n 'StopFailure',\n 'TeammateIdle',\n 'TaskCompleted',\n 'InstructionsLoaded',\n 'WorktreeCreate',\n 'WorktreeRemove',\n 'Elicitation',\n 'ElicitationResult',\n ],\n },\n cursor: {\n hookSystem: 'config',\n hookConfigPath: '.cursor/hooks.json',\n hookFormat: 'json',\n handlerTypes: ['command', 'prompt'],\n experimental: true,\n mappings: {\n SessionStart: {\n nativeName: 'sessionStart',\n supported: true,\n },\n SessionEnd: {\n nativeName: 'sessionEnd',\n supported: true,\n },\n PromptSubmit: {\n nativeName: 'beforeSubmitPrompt',\n supported: true,\n },\n ResponseComplete: {\n nativeName: 'stop',\n supported: true,\n },\n PreToolUse: {\n nativeName: 'preToolUse',\n supported: true,\n },\n PostToolUse: {\n nativeName: 'postToolUse',\n supported: true,\n },\n PostToolUseFailure: {\n nativeName: 'postToolUseFailure',\n supported: true,\n },\n PermissionRequest: {\n nativeName: null,\n supported: false,\n },\n SubagentStart: {\n nativeName: 'subagentStart',\n supported: true,\n },\n SubagentStop: {\n nativeName: 'subagentStop',\n supported: true,\n },\n PreModel: {\n nativeName: null,\n supported: false,\n },\n PostModel: {\n nativeName: null,\n supported: false,\n },\n PreCompact: {\n nativeName: 'preCompact',\n supported: true,\n },\n PostCompact: {\n nativeName: null,\n supported: false,\n },\n Notification: {\n nativeName: null,\n supported: false,\n },\n ConfigChange: {\n nativeName: null,\n supported: false,\n },\n },\n providerOnlyEvents: [\n 'beforeShellExecution',\n 'afterShellExecution',\n 'beforeMCPExecution',\n 'afterMCPExecution',\n 'beforeReadFile',\n 'afterFileEdit',\n 'afterAgentResponse',\n 'afterAgentThought',\n 'beforeTabFileRead',\n 'afterTabFileEdit',\n ],\n },\n 'gemini-cli': {\n hookSystem: 'config',\n hookConfigPath: '$HOME/.gemini/settings.json',\n hookFormat: 'json',\n handlerTypes: ['command'],\n experimental: false,\n mappings: {\n SessionStart: {\n nativeName: 'SessionStart',\n supported: true,\n },\n SessionEnd: {\n nativeName: 'SessionEnd',\n supported: true,\n },\n PromptSubmit: {\n nativeName: 'BeforeAgent',\n supported: true,\n },\n ResponseComplete: {\n nativeName: 'AfterAgent',\n supported: true,\n },\n PreToolUse: {\n nativeName: 'BeforeTool',\n supported: true,\n },\n PostToolUse: {\n nativeName: 'AfterTool',\n supported: true,\n },\n PostToolUseFailure: {\n nativeName: null,\n supported: false,\n },\n PermissionRequest: {\n nativeName: null,\n supported: false,\n },\n SubagentStart: {\n nativeName: null,\n supported: false,\n },\n SubagentStop: {\n nativeName: null,\n supported: false,\n },\n PreModel: {\n nativeName: 'BeforeModel',\n supported: true,\n },\n PostModel: {\n nativeName: 'AfterModel',\n supported: true,\n },\n PreCompact: {\n nativeName: 'PreCompress',\n supported: true,\n },\n PostCompact: {\n nativeName: null,\n supported: false,\n },\n Notification: {\n nativeName: 'Notification',\n supported: true,\n },\n ConfigChange: {\n nativeName: null,\n supported: false,\n },\n },\n providerOnlyEvents: ['BeforeToolSelection'],\n },\n codex: {\n hookSystem: 'config',\n hookConfigPath: '.codex/hooks.json',\n hookFormat: 'json',\n handlerTypes: ['command'],\n experimental: true,\n projectDelivery: {\n configPath: '.codex/hooks.json',\n timeoutUnit: 'seconds',\n documentedVersions: ['0.162.1'],\n verifiedVersions: [],\n documentation: 'https://developers.openai.com/codex/hooks',\n reviewedAt: '2026-10-10',\n trust: 'native-unverified',\n },\n mappings: {\n SessionStart: {\n nativeName: 'SessionStart',\n supported: true,\n },\n SessionEnd: {\n nativeName: null,\n supported: false,\n },\n PromptSubmit: {\n nativeName: 'UserPromptSubmit',\n supported: true,\n },\n ResponseComplete: {\n nativeName: 'Stop',\n supported: true,\n },\n PreToolUse: {\n nativeName: 'PreToolUse',\n supported: true,\n notes: 'Documented by OpenAI; live version certification is separate from installation.',\n },\n PostToolUse: {\n nativeName: null,\n supported: false,\n },\n PostToolUseFailure: {\n nativeName: null,\n supported: false,\n },\n PermissionRequest: {\n nativeName: null,\n supported: false,\n },\n SubagentStart: {\n nativeName: null,\n supported: false,\n },\n SubagentStop: {\n nativeName: null,\n supported: false,\n },\n PreModel: {\n nativeName: null,\n supported: false,\n },\n PostModel: {\n nativeName: null,\n supported: false,\n },\n PreCompact: {\n nativeName: null,\n supported: false,\n },\n PostCompact: {\n nativeName: null,\n supported: false,\n },\n Notification: {\n nativeName: null,\n supported: false,\n },\n ConfigChange: {\n nativeName: null,\n supported: false,\n },\n },\n providerOnlyEvents: [],\n },\n opencode: {\n hookSystem: 'plugin',\n hookConfigPath: '.opencode/plugins/',\n hookFormat: 'javascript',\n handlerTypes: ['plugin'],\n experimental: false,\n projectDelivery: {\n configPath: '.opencode/plugins/cleo-project-hooks.js',\n timeoutUnit: 'milliseconds',\n documentedVersions: ['2.0.26'],\n verifiedVersions: [],\n documentation: 'https://opencode.ai/docs/plugins/',\n reviewedAt: '2026-10-10',\n trust: 'native-unverified',\n },\n mappings: {\n SessionStart: {\n nativeName: 'event:session.created',\n supported: true,\n notes: 'Via bus event subscriber',\n },\n SessionEnd: {\n nativeName: 'event:session.deleted',\n supported: true,\n notes: 'Via bus event subscriber',\n },\n PromptSubmit: {\n nativeName: 'chat.message',\n supported: true,\n },\n ResponseComplete: {\n nativeName: 'event:session.idle',\n supported: true,\n notes: 'Via bus event subscriber',\n },\n PreToolUse: {\n nativeName: 'tool.execute.before',\n supported: true,\n },\n PostToolUse: {\n nativeName: 'tool.execute.after',\n supported: true,\n },\n PostToolUseFailure: {\n nativeName: null,\n supported: false,\n },\n PermissionRequest: {\n nativeName: 'permission.ask',\n supported: true,\n },\n SubagentStart: {\n nativeName: null,\n supported: false,\n },\n SubagentStop: {\n nativeName: null,\n supported: false,\n },\n PreModel: {\n nativeName: 'chat.params',\n supported: true,\n notes: 'Modify LLM params before request',\n },\n PostModel: {\n nativeName: null,\n supported: false,\n },\n PreCompact: {\n nativeName: 'experimental.session.compacting',\n supported: true,\n },\n PostCompact: {\n nativeName: 'event:session.compacted',\n supported: true,\n notes: 'Via bus event subscriber',\n },\n Notification: {\n nativeName: null,\n supported: false,\n },\n ConfigChange: {\n nativeName: null,\n supported: false,\n },\n },\n providerOnlyEvents: [\n 'chat.headers',\n 'shell.env',\n 'tool.definition',\n 'command.execute.before',\n 'experimental.chat.messages.transform',\n 'experimental.chat.system.transform',\n 'experimental.text.complete',\n ],\n },\n kimi: {\n hookSystem: 'none',\n hookConfigPath: null,\n hookFormat: null,\n handlerTypes: [],\n experimental: false,\n projectDelivery: {\n configPath: null,\n documentedVersions: [],\n verifiedVersions: [],\n documentation: 'https://kimi-cli.com/en/customization/hooks.html',\n reviewedAt: '2026-10-10',\n trust: 'native-unverified',\n },\n mappings: {\n SessionStart: {\n nativeName: null,\n supported: false,\n },\n SessionEnd: {\n nativeName: null,\n supported: false,\n },\n PromptSubmit: {\n nativeName: null,\n supported: false,\n },\n ResponseComplete: {\n nativeName: null,\n supported: false,\n },\n PreToolUse: {\n nativeName: null,\n supported: false,\n },\n PostToolUse: {\n nativeName: null,\n supported: false,\n },\n PostToolUseFailure: {\n nativeName: null,\n supported: false,\n },\n PermissionRequest: {\n nativeName: null,\n supported: false,\n },\n SubagentStart: {\n nativeName: null,\n supported: false,\n },\n SubagentStop: {\n nativeName: null,\n supported: false,\n },\n PreModel: {\n nativeName: null,\n supported: false,\n },\n PostModel: {\n nativeName: null,\n supported: false,\n },\n PreCompact: {\n nativeName: null,\n supported: false,\n },\n PostCompact: {\n nativeName: null,\n supported: false,\n },\n Notification: {\n nativeName: null,\n supported: false,\n },\n ConfigChange: {\n nativeName: null,\n supported: false,\n },\n },\n providerOnlyEvents: [],\n },\n pi: {\n hookSystem: 'extension',\n hookConfigPath: '$PI_CODING_AGENT_DIR/extensions/',\n hookFormat: 'typescript',\n handlerTypes: ['extension'],\n experimental: false,\n notes:\n \"Pi is CAAMP's first-class primary harness (ADR-035). Events use snake_case. Extensions live at ~/.pi/agent/extensions/ (global) or <projectDir>/.pi/extensions/ (project).\",\n nativeEventCatalog: 'pi',\n mappings: {\n SessionStart: {\n nativeName: 'session_start',\n supported: true,\n },\n SessionEnd: {\n nativeName: 'session_shutdown',\n supported: true,\n },\n PromptSubmit: {\n nativeName: 'input',\n supported: true,\n },\n ResponseComplete: {\n nativeName: null,\n supported: false,\n },\n PreToolUse: {\n nativeName: 'tool_call',\n supported: true,\n },\n PostToolUse: {\n nativeName: 'tool_result',\n supported: true,\n },\n PostToolUseFailure: {\n nativeName: null,\n supported: false,\n },\n PermissionRequest: {\n nativeName: null,\n supported: false,\n },\n SubagentStart: {\n nativeName: 'before_agent_start',\n supported: true,\n },\n SubagentStop: {\n nativeName: 'agent_end',\n supported: true,\n },\n PreModel: {\n nativeName: 'before_provider_request',\n supported: true,\n },\n PostModel: {\n nativeName: null,\n supported: false,\n },\n PreCompact: {\n nativeName: 'context',\n supported: true,\n notes: \"Pi's context assembly event is the closest proxy for pre-compaction\",\n },\n PostCompact: {\n nativeName: null,\n supported: false,\n },\n Notification: {\n nativeName: 'turn_end',\n supported: true,\n notes:\n 'Pi emits turn_end when the assistant turn completes, which is the best proxy for a notification event',\n },\n ConfigChange: {\n nativeName: null,\n supported: false,\n },\n },\n providerOnlyEvents: [\n 'session_switch',\n 'session_fork',\n 'agent_start',\n 'turn_start',\n 'message_start',\n 'message_update',\n 'message_end',\n 'tool_execution_start',\n 'tool_execution_end',\n 'user_bash',\n 'model_select',\n 'resources_discover',\n ],\n },\n antigravity: {\n hookSystem: 'none',\n hookConfigPath: null,\n hookFormat: null,\n handlerTypes: [],\n experimental: false,\n mappings: {\n SessionStart: {\n nativeName: null,\n supported: false,\n },\n SessionEnd: {\n nativeName: null,\n supported: false,\n },\n PromptSubmit: {\n nativeName: null,\n supported: false,\n },\n ResponseComplete: {\n nativeName: null,\n supported: false,\n },\n PreToolUse: {\n nativeName: null,\n supported: false,\n },\n PostToolUse: {\n nativeName: null,\n supported: false,\n },\n PostToolUseFailure: {\n nativeName: null,\n supported: false,\n },\n PermissionRequest: {\n nativeName: null,\n supported: false,\n },\n SubagentStart: {\n nativeName: null,\n supported: false,\n },\n SubagentStop: {\n nativeName: null,\n supported: false,\n },\n PreModel: {\n nativeName: null,\n supported: false,\n },\n PostModel: {\n nativeName: null,\n supported: false,\n },\n PreCompact: {\n nativeName: null,\n supported: false,\n },\n PostCompact: {\n nativeName: null,\n supported: false,\n },\n Notification: {\n nativeName: null,\n supported: false,\n },\n ConfigChange: {\n nativeName: null,\n supported: false,\n },\n },\n providerOnlyEvents: [],\n },\n};\n\n/** Provider native-to-canonical maps generated from the same registry. */\nexport const PROVIDER_NATIVE_EVENT_MAPS: Record<string, Record<string, string>> = {\n 'claude-code': {\n SessionStart: 'SessionStart',\n SessionEnd: 'SessionEnd',\n UserPromptSubmit: 'PromptSubmit',\n Stop: 'ResponseComplete',\n PreToolUse: 'PreToolUse',\n PostToolUse: 'PostToolUse',\n PostToolUseFailure: 'PostToolUseFailure',\n PermissionRequest: 'PermissionRequest',\n SubagentStart: 'SubagentStart',\n SubagentStop: 'SubagentStop',\n PreCompact: 'PreCompact',\n PostCompact: 'PostCompact',\n Notification: 'Notification',\n ConfigChange: 'ConfigChange',\n },\n cursor: {\n sessionStart: 'SessionStart',\n sessionEnd: 'SessionEnd',\n beforeSubmitPrompt: 'PromptSubmit',\n stop: 'ResponseComplete',\n preToolUse: 'PreToolUse',\n postToolUse: 'PostToolUse',\n postToolUseFailure: 'PostToolUseFailure',\n subagentStart: 'SubagentStart',\n subagentStop: 'SubagentStop',\n preCompact: 'PreCompact',\n },\n 'gemini-cli': {\n SessionStart: 'SessionStart',\n SessionEnd: 'SessionEnd',\n BeforeAgent: 'PromptSubmit',\n AfterAgent: 'ResponseComplete',\n BeforeTool: 'PreToolUse',\n AfterTool: 'PostToolUse',\n BeforeModel: 'PreModel',\n AfterModel: 'PostModel',\n PreCompress: 'PreCompact',\n Notification: 'Notification',\n },\n codex: {\n SessionStart: 'SessionStart',\n UserPromptSubmit: 'PromptSubmit',\n Stop: 'ResponseComplete',\n PreToolUse: 'PreToolUse',\n },\n opencode: {\n 'event:session.created': 'SessionStart',\n 'event:session.deleted': 'SessionEnd',\n 'chat.message': 'PromptSubmit',\n 'event:session.idle': 'ResponseComplete',\n 'tool.execute.before': 'PreToolUse',\n 'tool.execute.after': 'PostToolUse',\n 'permission.ask': 'PermissionRequest',\n 'chat.params': 'PreModel',\n 'experimental.session.compacting': 'PreCompact',\n 'event:session.compacted': 'PostCompact',\n },\n kimi: {},\n pi: {\n session_start: 'SessionStart',\n session_shutdown: 'SessionEnd',\n input: 'PromptSubmit',\n tool_call: 'PreToolUse',\n tool_result: 'PostToolUse',\n before_agent_start: 'SubagentStart',\n agent_end: 'SubagentStop',\n before_provider_request: 'PreModel',\n context: 'PreCompact',\n turn_end: 'Notification',\n tool_execution_start: 'PreToolUse',\n tool_execution_end: 'PostToolUse',\n },\n antigravity: {},\n};\n","/**\n * CAAMP Hooks Normalizer\n *\n * Translates between CAAMP canonical hook events and provider-native\n * event names. Provides query functions for hook support, cross-provider\n * comparison, and event normalization.\n *\n * This module follows the same pattern as `src/core/mcp/transforms.ts` —\n * a translation layer that lets consumers use one canonical interface\n * while CAAMP handles provider-specific differences.\n */\n\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { resolveRegistryTemplatePath } from '../paths/standard.js';\nimport {\n EVENT_METADATA,\n GENERATED_PROVIDER_HOOK_PROFILES,\n HOOK_REGISTRY_EVIDENCE,\n} from './generated.js';\nimport type {\n CanonicalEventDefinition,\n CanonicalHookEvent,\n CrossProviderMatrix,\n HookCategory,\n HookMapping,\n HookMappingsFile,\n HookSupportResult,\n HookSystemType,\n NormalizedHookEvent,\n ProviderHookProfile,\n ProviderHookSummary,\n} from './types.js';\nimport { CANONICAL_HOOK_EVENTS, PROVIDER_HOOK_EVENTS } from './types.js';\n\n// ── Data Loading ────────────────────────────────────────────────────\n\nlet _mappings: HookMappingsFile | null = null;\n\nfunction findMappingsPath(): string {\n const thisDir = dirname(fileURLToPath(import.meta.url));\n // src/core/hooks/ -> providers/hook-mappings.json\n return join(thisDir, '..', '..', '..', 'providers', 'hook-mappings.json');\n}\n\nfunction loadMappings(): HookMappingsFile {\n if (_mappings) return _mappings;\n const mappingsPath = findMappingsPath();\n if (!existsSync(mappingsPath)) {\n // Use the generated registry snapshot when bundling relocates this module.\n // Installed delivery must not silently lose capabilities because a relative\n // source-tree path differs from the package's bundled layout.\n const empty: HookMappingsFile = {\n version: HOOK_REGISTRY_EVIDENCE.version,\n lastUpdated: HOOK_REGISTRY_EVIDENCE.lastUpdated,\n description: 'Generated registry fallback — runtime JSON path unavailable',\n canonicalEvents: EVENT_METADATA,\n providerMappings: GENERATED_PROVIDER_HOOK_PROFILES,\n };\n _mappings = empty;\n return empty;\n }\n const raw = readFileSync(mappingsPath, 'utf-8');\n _mappings = JSON.parse(raw) as HookMappingsFile;\n return _mappings;\n}\n\n/**\n * Reset the cached hook mappings data.\n *\n * @remarks\n * Clears the in-memory cache so the next query function call will\n * re-read `providers/hook-mappings.json` from disk. This is primarily\n * intended for test isolation — production code should not need to call this.\n *\n * @example\n * ```typescript\n * import { resetHookMappings, getHookMappingsVersion } from \"./normalizer.js\";\n *\n * // Force a fresh load from disk\n * resetHookMappings();\n * const version = getHookMappingsVersion();\n * ```\n *\n * @public\n */\nexport function resetHookMappings(): void {\n _mappings = null;\n}\n\n// ── Core Query Functions ────────────────────────────────────────────\n\n/**\n * Get the canonical event definition (category, description, canBlock).\n *\n * @remarks\n * Looks up the definition from the hook mappings data file. The returned\n * object contains the event's category, human-readable description, and\n * whether handlers can block the associated action.\n *\n * @param event - The canonical event name to look up.\n * @returns The event definition containing category, description, and canBlock flag.\n *\n * @example\n * ```typescript\n * import { getCanonicalEvent } from \"./normalizer.js\";\n *\n * const def = getCanonicalEvent(\"PreToolUse\");\n * console.log(def.category); // \"tool\"\n * console.log(def.canBlock); // true\n * ```\n *\n * @public\n */\nexport function getCanonicalEvent(event: CanonicalHookEvent): CanonicalEventDefinition {\n const data = loadMappings();\n return data.canonicalEvents[event];\n}\n\n/**\n * Get all canonical event definitions.\n *\n * @remarks\n * Returns the complete map of canonical event names to their definitions.\n * Useful for iterating over the full taxonomy or building UI displays\n * of all available events.\n *\n * @returns A record mapping every canonical event name to its definition.\n *\n * @example\n * ```typescript\n * import { getAllCanonicalEvents } from \"./normalizer.js\";\n *\n * const events = getAllCanonicalEvents();\n * for (const [name, def] of Object.entries(events)) {\n * console.log(`${name}: ${def.description}`);\n * }\n * ```\n *\n * @public\n */\nexport function getAllCanonicalEvents(): Record<CanonicalHookEvent, CanonicalEventDefinition> {\n return loadMappings().canonicalEvents;\n}\n\n/**\n * Get canonical events filtered by category.\n *\n * @remarks\n * Filters the canonical event list to only those belonging to the specified\n * category. Useful for displaying events grouped by lifecycle phase\n * (e.g. all `\"tool\"` events or all `\"session\"` events).\n *\n * @param category - The hook category to filter by (e.g. `\"session\"`, `\"tool\"`).\n * @returns Array of canonical event names that belong to the specified category.\n *\n * @example\n * ```typescript\n * import { getCanonicalEventsByCategory } from \"./normalizer.js\";\n *\n * const toolEvents = getCanonicalEventsByCategory(\"tool\");\n * // [\"PreToolUse\", \"PostToolUse\", \"PostToolUseFailure\"]\n * ```\n *\n * @public\n */\nexport function getCanonicalEventsByCategory(category: HookCategory): CanonicalHookEvent[] {\n const data = loadMappings();\n return CANONICAL_HOOK_EVENTS.filter((event) => data.canonicalEvents[event].category === category);\n}\n\n/**\n * Get the full hook profile for a provider.\n *\n * @remarks\n * Returns the complete hook configuration for a provider including its\n * hook system type, config path, handler types, and all event mappings.\n * Returns `undefined` if the provider has no hook mappings defined.\n *\n * @param providerId - The provider identifier (e.g. `\"claude-code\"`, `\"gemini-cli\"`).\n * @returns The provider's hook profile, or `undefined` if not found.\n *\n * @example\n * ```typescript\n * import { getProviderHookProfile } from \"./normalizer.js\";\n *\n * const profile = getProviderHookProfile(\"claude-code\");\n * if (profile) {\n * console.log(profile.hookSystem); // \"config\"\n * console.log(profile.experimental); // false\n * }\n * ```\n *\n * @public\n */\nexport function getProviderHookProfile(providerId: string): ProviderHookProfile | undefined {\n const data = loadMappings();\n return data.providerMappings[providerId];\n}\n\n/**\n * Get all provider IDs that have hook mappings.\n *\n * @remarks\n * Returns the list of provider identifiers present in the hook mappings\n * data file. This reflects all providers for which CAAMP has hook\n * translation data, regardless of whether they support any events.\n *\n * @returns Array of provider ID strings.\n *\n * @example\n * ```typescript\n * import { getMappedProviderIds } from \"./normalizer.js\";\n *\n * const ids = getMappedProviderIds();\n * // [\"claude-code\", \"gemini-cli\", \"cursor\", \"kimi\", ...]\n * ```\n *\n * @public\n */\nexport function getMappedProviderIds(): string[] {\n return Object.keys(loadMappings().providerMappings);\n}\n\n// ── Normalization: Canonical → Native ───────────────────────────────\n\n/**\n * Translate a CAAMP canonical event name to the provider's native name.\n *\n * @remarks\n * This is the primary forward-translation function. Given a canonical\n * event and a provider ID, it returns the provider-specific event name\n * that should be used when configuring hooks for that provider.\n * Returns `null` if the provider is unknown or does not support the event.\n *\n * @param canonical - The CAAMP canonical event name to translate.\n * @param providerId - The target provider identifier.\n * @returns The native event name, or `null` if unsupported.\n *\n * @example\n * ```typescript\n * import { toNative } from \"./normalizer.js\";\n *\n * toNative(\"PreToolUse\", \"claude-code\"); // \"PreToolUse\"\n * toNative(\"PreToolUse\", \"gemini-cli\"); // \"BeforeTool\"\n * toNative(\"PreToolUse\", \"cursor\"); // \"preToolUse\"\n * toNative(\"PreToolUse\", \"kimi\"); // null\n * ```\n *\n * @public\n */\nexport function toNative(canonical: CanonicalHookEvent, providerId: string): string | null {\n const profile = getProviderHookProfile(providerId);\n if (!profile) return null;\n const mapping = profile.mappings[canonical];\n return mapping?.supported ? mapping.nativeName : null;\n}\n\n/**\n * Translate a provider-native event name to the CAAMP canonical name.\n *\n * @remarks\n * This is the reverse-translation function. Scans all event mappings\n * for the given provider to find a canonical match for the native name.\n * Returns `null` if no mapping is found or the provider is unknown.\n *\n * @param nativeName - The provider-native event name to look up.\n * @param providerId - The provider identifier to search within.\n * @returns The canonical event name, or `null` if no mapping exists.\n *\n * @example\n * ```typescript\n * import { toCanonical } from \"./normalizer.js\";\n *\n * toCanonical(\"BeforeTool\", \"gemini-cli\"); // \"PreToolUse\"\n * toCanonical(\"stop\", \"cursor\"); // \"ResponseComplete\"\n * toCanonical(\"UserPromptSubmit\", \"claude-code\"); // \"PromptSubmit\"\n * ```\n *\n * @public\n */\nexport function toCanonical(nativeName: string, providerId: string): CanonicalHookEvent | null {\n const profile = getProviderHookProfile(providerId);\n if (!profile) return null;\n\n for (const [canonical, mapping] of Object.entries(profile.mappings)) {\n if (mapping?.supported && mapping.nativeName === nativeName) {\n return canonical as CanonicalHookEvent;\n }\n }\n return null;\n}\n\n/**\n * Batch-translate multiple canonical events to native names for a provider.\n *\n * @remarks\n * Translates an array of canonical events in a single call, returning\n * only the events that the provider actually supports. Each result\n * includes category and blocking metadata. Unsupported events are\n * silently excluded from the output.\n *\n * @param canonicals - Array of canonical event names to translate.\n * @param providerId - The target provider identifier.\n * @returns Array of normalized events (only supported ones included).\n *\n * @example\n * ```typescript\n * import { toNativeBatch } from \"./normalizer.js\";\n *\n * const events = toNativeBatch(\n * [\"PreToolUse\", \"PostToolUse\", \"ConfigChange\"],\n * \"claude-code\",\n * );\n * // Returns NormalizedHookEvent[] for supported events only\n * ```\n *\n * @public\n */\nexport function toNativeBatch(\n canonicals: CanonicalHookEvent[],\n providerId: string,\n): NormalizedHookEvent[] {\n const data = loadMappings();\n const profile = data.providerMappings[providerId];\n if (!profile) return [];\n\n const results: NormalizedHookEvent[] = [];\n for (const canonical of canonicals) {\n const mapping = profile.mappings[canonical];\n if (mapping?.supported && mapping.nativeName) {\n results.push({\n canonical,\n native: mapping.nativeName,\n providerId,\n category: data.canonicalEvents[canonical].category,\n canBlock: data.canonicalEvents[canonical].canBlock,\n });\n }\n }\n return results;\n}\n\n// ── Support Queries ─────────────────────────────────────────────────\n\n/**\n * Check if a provider supports a specific canonical hook event.\n *\n * @remarks\n * A quick boolean check that avoids returning the full mapping details.\n * Returns `false` if the provider is unknown or the event is not supported.\n *\n * @param canonical - The canonical event name to check.\n * @param providerId - The provider identifier to check against.\n * @returns `true` if the provider supports this canonical event, `false` otherwise.\n *\n * @example\n * ```typescript\n * import { supportsHook } from \"./normalizer.js\";\n *\n * supportsHook(\"PreToolUse\", \"claude-code\"); // true\n * supportsHook(\"PreToolUse\", \"kimi\"); // false\n * ```\n *\n * @public\n */\nexport function supportsHook(canonical: CanonicalHookEvent, providerId: string): boolean {\n const profile = getProviderHookProfile(providerId);\n if (!profile) return false;\n return profile.mappings[canonical]?.supported ?? false;\n}\n\n/**\n * Get full hook support details for a canonical event on a provider.\n *\n * @remarks\n * Returns a structured result with the native name translation and any\n * notes about support limitations. Unlike `supportsHook()`, this always\n * returns a result object even when the provider is unknown (with\n * `supported: false`).\n *\n * @param canonical - The canonical event name to query.\n * @param providerId - The provider identifier to query against.\n * @returns Support result including native name and optional notes.\n *\n * @example\n * ```typescript\n * import { getHookSupport } from \"./normalizer.js\";\n *\n * const result = getHookSupport(\"PreToolUse\", \"claude-code\");\n * console.log(result.supported); // true\n * console.log(result.native); // \"PreToolUse\"\n * ```\n *\n * @public\n */\nexport function getHookSupport(\n canonical: CanonicalHookEvent,\n providerId: string,\n): HookSupportResult {\n const profile = getProviderHookProfile(providerId);\n if (!profile) {\n return { canonical, supported: false, native: null };\n }\n const mapping = profile.mappings[canonical];\n return {\n canonical,\n supported: mapping?.supported ?? false,\n native: mapping?.nativeName ?? null,\n notes: mapping?.notes,\n };\n}\n\n/**\n * Get all supported canonical events for a provider.\n *\n * @remarks\n * Filters the full canonical event list to only those that the provider\n * supports. Returns an empty array if the provider is unknown.\n *\n * @param providerId - The provider identifier to query.\n * @returns Array of canonical event names the provider supports.\n *\n * @example\n * ```typescript\n * import { getSupportedEvents } from \"./normalizer.js\";\n *\n * const events = getSupportedEvents(\"claude-code\");\n * // [\"SessionStart\", \"SessionEnd\", \"PreToolUse\", ...]\n * ```\n *\n * @public\n */\nexport function getSupportedEvents(providerId: string): CanonicalHookEvent[] {\n const profile = getProviderHookProfile(providerId);\n if (!profile) return [];\n // Only provider events have provider mappings; domain events are not provider-translatable\n return PROVIDER_HOOK_EVENTS.filter((event) => profile.mappings[event]?.supported);\n}\n\n/**\n * Get all unsupported canonical events for a provider.\n *\n * @remarks\n * Returns the complement of `getSupportedEvents()`. If the provider is\n * unknown, all canonical events are returned since none are supported.\n *\n * @param providerId - The provider identifier to query.\n * @returns Array of canonical event names the provider does not support.\n *\n * @example\n * ```typescript\n * import { getUnsupportedEvents } from \"./normalizer.js\";\n *\n * const missing = getUnsupportedEvents(\"kimi\");\n * // Returns all canonical events (kimi has no hook support)\n * ```\n *\n * @public\n */\nexport function getUnsupportedEvents(providerId: string): CanonicalHookEvent[] {\n const profile = getProviderHookProfile(providerId);\n // Only provider events have provider mappings; domain events are not provider-translatable\n if (!profile) return [...PROVIDER_HOOK_EVENTS];\n return PROVIDER_HOOK_EVENTS.filter((event) => !profile.mappings[event]?.supported);\n}\n\n/**\n * Get providers that support a specific canonical event.\n *\n * @remarks\n * Scans all provider mappings and returns the IDs of those that support\n * the given canonical event. Useful for determining which providers can\n * be targeted when configuring a specific hook.\n *\n * @param canonical - The canonical event name to search for.\n * @returns Array of provider IDs that support this event.\n *\n * @example\n * ```typescript\n * import { getProvidersForEvent } from \"./normalizer.js\";\n *\n * const providers = getProvidersForEvent(\"PreToolUse\");\n * // [\"claude-code\", \"gemini-cli\", \"cursor\"]\n * ```\n *\n * @public\n */\nexport function getProvidersForEvent(canonical: CanonicalHookEvent): string[] {\n const data = loadMappings();\n return Object.entries(data.providerMappings)\n .filter(([, profile]) => profile.mappings[canonical]?.supported)\n .map(([id]) => id);\n}\n\n/**\n * Get canonical events common to all specified providers.\n *\n * @remarks\n * Computes the intersection of supported events across multiple providers.\n * Returns only events that every listed provider supports. Useful for\n * determining which hooks can be configured uniformly across a set of\n * target providers.\n *\n * @param providerIds - Array of provider IDs to intersect.\n * @returns Array of canonical events supported by all specified providers.\n *\n * @example\n * ```typescript\n * import { getCommonEvents } from \"./normalizer.js\";\n *\n * const common = getCommonEvents([\"claude-code\", \"gemini-cli\"]);\n * // Returns only events both providers support\n * ```\n *\n * @public\n */\nexport function getCommonEvents(providerIds: string[]): CanonicalHookEvent[] {\n if (providerIds.length === 0) return [];\n // Only provider events are relevant for cross-provider comparison\n return PROVIDER_HOOK_EVENTS.filter((event) => providerIds.every((id) => supportsHook(event, id)));\n}\n\n// ── Summary & Matrix Functions ──────────────────────────────────────\n\n/**\n * Get a summary of hook support for a provider.\n *\n * @remarks\n * Builds an aggregated view of a provider's hook capabilities including\n * counts, coverage percentage, and categorized event lists. Returns\n * `undefined` if the provider has no hook mappings. Used by the CLI\n * `hooks show` command for provider overviews.\n *\n * @param providerId - The provider identifier to summarize.\n * @returns The hook support summary, or `undefined` if the provider is not found.\n *\n * @example\n * ```typescript\n * import { getProviderSummary } from \"./normalizer.js\";\n *\n * const summary = getProviderSummary(\"claude-code\");\n * if (summary) {\n * console.log(`${summary.coverage}% coverage`);\n * console.log(`${summary.supportedCount}/${summary.totalCanonical} events`);\n * }\n * ```\n *\n * @public\n */\nexport function getProviderSummary(providerId: string): ProviderHookSummary | undefined {\n const profile = getProviderHookProfile(providerId);\n if (!profile) return undefined;\n\n const supported = getSupportedEvents(providerId);\n const unsupported = getUnsupportedEvents(providerId);\n\n return {\n providerId,\n hookSystem: profile.hookSystem,\n experimental: profile.experimental,\n supportedCount: supported.length,\n totalCanonical: PROVIDER_HOOK_EVENTS.length,\n supported,\n unsupported,\n providerOnly: profile.providerOnlyEvents,\n coverage: Math.round((supported.length / PROVIDER_HOOK_EVENTS.length) * 100),\n };\n}\n\n/**\n * Build a cross-provider hook support matrix.\n *\n * @remarks\n * Constructs a two-dimensional matrix showing which canonical events are\n * supported by which providers, with native name translations. When no\n * provider IDs are specified, all mapped providers are included. Used by\n * the CLI `hooks matrix` command for comparison tables.\n *\n * @param providerIds - Optional array of provider IDs to include. Defaults to all mapped providers.\n * @returns The cross-provider matrix with events, providers, and mapping data.\n *\n * @example\n * ```typescript\n * import { buildHookMatrix } from \"./normalizer.js\";\n *\n * const matrix = buildHookMatrix([\"claude-code\", \"gemini-cli\"]);\n * for (const event of matrix.events) {\n * for (const provider of matrix.providers) {\n * console.log(`${event} @ ${provider}: ${matrix.matrix[event][provider].supported}`);\n * }\n * }\n * ```\n *\n * @public\n */\nexport function buildHookMatrix(providerIds?: string[]): CrossProviderMatrix {\n const data = loadMappings();\n const ids = providerIds ?? Object.keys(data.providerMappings);\n\n // Provider matrix only covers provider events — domain events have no provider mappings\n const matrix: Record<string, Record<string, HookMapping>> = {};\n for (const event of PROVIDER_HOOK_EVENTS) {\n matrix[event] = {};\n for (const id of ids) {\n const profile = data.providerMappings[id];\n matrix[event][id] = profile?.mappings[event] ?? {\n nativeName: null,\n supported: false,\n };\n }\n }\n\n return {\n events: [...PROVIDER_HOOK_EVENTS],\n providers: ids,\n matrix: matrix as CrossProviderMatrix['matrix'],\n };\n}\n\n/**\n * Get the hook system type for a provider.\n *\n * @remarks\n * Returns the provider's hook system type: `\"config\"` for file-based hooks,\n * `\"plugin\"` for extension-based hooks, or `\"none\"` if the provider does\n * not support hooks. Returns `\"none\"` for unknown providers.\n *\n * @param providerId - The provider identifier to query.\n * @returns The hook system type (`\"config\"`, `\"plugin\"`, or `\"none\"`).\n *\n * @example\n * ```typescript\n * import { getHookSystemType } from \"./normalizer.js\";\n *\n * getHookSystemType(\"claude-code\"); // \"config\"\n * getHookSystemType(\"unknown\"); // \"none\"\n * ```\n *\n * @public\n */\nexport function getHookSystemType(providerId: string): HookSystemType {\n const profile = getProviderHookProfile(providerId);\n return profile?.hookSystem ?? 'none';\n}\n\n/**\n * Get the resolved hook config path for a provider.\n *\n * @remarks\n * Resolves the provider's hook configuration file path by expanding\n * registry template variables (e.g. `~` to the home directory). Returns\n * `null` if the provider has no hook config path defined or is unknown.\n *\n * @param providerId - The provider identifier to query.\n * @returns The resolved filesystem path, or `null` if not available.\n *\n * @example\n * ```typescript\n * import { getHookConfigPath } from \"./normalizer.js\";\n *\n * const path = getHookConfigPath(\"claude-code\");\n * // \"/home/user/.claude/settings.json\" (resolved from template)\n * ```\n *\n * @public\n */\nexport function getHookConfigPath(providerId: string): string | null {\n const profile = getProviderHookProfile(providerId);\n if (!profile?.hookConfigPath) return null;\n return resolveRegistryTemplatePath(profile.hookConfigPath);\n}\n\n/**\n * Get provider-only events (native events with no canonical mapping).\n *\n * @remarks\n * Some providers define hook events that have no equivalent in the CAAMP\n * canonical taxonomy. This function returns those provider-specific event\n * names. Returns an empty array for unknown providers.\n *\n * @param providerId - The provider identifier to query.\n * @returns Array of native event names unique to this provider.\n *\n * @example\n * ```typescript\n * import { getProviderOnlyEvents } from \"./normalizer.js\";\n *\n * const extras = getProviderOnlyEvents(\"claude-code\");\n * // Returns any events specific to Claude Code with no canonical equivalent\n * ```\n *\n * @public\n */\nexport function getProviderOnlyEvents(providerId: string): string[] {\n const profile = getProviderHookProfile(providerId);\n return profile?.providerOnlyEvents ?? [];\n}\n\n// ── Multi-Provider Translation ──────────────────────────────────────\n\n/**\n * Translate a canonical event to native names across multiple providers.\n *\n * @remarks\n * Performs a fan-out translation of a single canonical event to all\n * specified providers simultaneously. The result record only includes\n * providers that actually support the event — unsupported providers\n * are silently excluded.\n *\n * @param canonical - The canonical event name to translate.\n * @param providerIds - Array of provider IDs to translate for.\n * @returns Record mapping provider IDs to their native event names (supported only).\n *\n * @example\n * ```typescript\n * import { translateToAll } from \"./normalizer.js\";\n *\n * const result = translateToAll(\"PreToolUse\", [\"claude-code\", \"gemini-cli\", \"kimi\"]);\n * // { \"claude-code\": \"PreToolUse\", \"gemini-cli\": \"BeforeTool\" }\n * // (kimi excluded — unsupported)\n * ```\n *\n * @public\n */\nexport function translateToAll(\n canonical: CanonicalHookEvent,\n providerIds: string[],\n): Record<string, string> {\n const result: Record<string, string> = {};\n for (const id of providerIds) {\n const native = toNative(canonical, id);\n if (native) {\n result[id] = native;\n }\n }\n return result;\n}\n\n/**\n * Find the best canonical match for a native event name across all providers.\n *\n * @remarks\n * Scans every provider's mappings to find canonical events that match the\n * given native name. Useful when you have a native name but do not know\n * which provider it belongs to. Multiple results are possible if different\n * providers use the same native name for different canonical events.\n *\n * @param nativeName - The provider-native event name to resolve.\n * @returns Array of matches, each containing the provider ID and canonical event name.\n *\n * @example\n * ```typescript\n * import { resolveNativeEvent } from \"./normalizer.js\";\n *\n * const matches = resolveNativeEvent(\"BeforeTool\");\n * // [{ providerId: \"gemini-cli\", canonical: \"PreToolUse\" }]\n * ```\n *\n * @public\n */\nexport function resolveNativeEvent(nativeName: string): Array<{\n providerId: string;\n canonical: CanonicalHookEvent;\n}> {\n const data = loadMappings();\n const results: Array<{ providerId: string; canonical: CanonicalHookEvent }> = [];\n\n for (const [providerId, profile] of Object.entries(data.providerMappings)) {\n for (const [canonical, mapping] of Object.entries(profile.mappings)) {\n if (mapping?.supported && mapping.nativeName === nativeName) {\n results.push({ providerId, canonical: canonical as CanonicalHookEvent });\n }\n }\n }\n\n return results;\n}\n\n/**\n * Get the version of the hook mappings data.\n *\n * @remarks\n * Returns the semver version string from the hook mappings JSON file.\n * This can be used to check compatibility or display the data version\n * in diagnostic output.\n *\n * @returns The semver version string of the loaded hook mappings data.\n *\n * @example\n * ```typescript\n * import { getHookMappingsVersion } from \"./normalizer.js\";\n *\n * const version = getHookMappingsVersion();\n * console.log(`Hook mappings v${version}`);\n * ```\n *\n * @public\n */\nexport function getHookMappingsVersion(): string {\n return loadMappings().version;\n}\n"],"mappings":";;;;;AASO,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAqBO,IAAM,wBAAwB;AAAA;AAAA,EAEnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAMO,IAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAsBO,IAAM,iBAQT;AAAA,EACF,cAAc;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EACA,cAAc;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,IACjB,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,EACf;AA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,SAAO;AACT;AAwBO,SAAS,mBAAmB,YAGhC;AACD,QAAM,OAAO,aAAa;AAC1B,QAAM,UAAwE,CAAC;AAE/E,aAAW,CAAC,YAAY,OAAO,KAAK,OAAO,QAAQ,KAAK,gBAAgB,GAAG;AACzE,eAAW,CAAC,WAAW,OAAO,KAAK,OAAO,QAAQ,QAAQ,QAAQ,GAAG;AACnE,UAAI,SAAS,aAAa,QAAQ,eAAe,YAAY;AAC3D,gBAAQ,KAAK,EAAE,YAAY,UAA2C,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAsBO,SAAS,yBAAiC;AAC/C,SAAO,aAAa,EAAE;AACxB;","names":[]}
@@ -0,0 +1,10 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ export {
8
+ __export
9
+ };
10
+ //# sourceMappingURL=chunk-PZ5AY32C.js.map
package/dist/cli.js CHANGED
@@ -59,7 +59,7 @@ import {
59
59
  tokenizeCriteriaValue,
60
60
  updateInstructionsSingleOperation,
61
61
  validateSkill
62
- } from "./chunk-ZL6FLO2H.js";
62
+ } from "./chunk-5UAFS46N.js";
63
63
  import {
64
64
  buildSkillsMap,
65
65
  checkAllInjections,
@@ -73,7 +73,8 @@ import {
73
73
  injectAll,
74
74
  isHomeProject,
75
75
  providerSupports
76
- } from "./chunk-2FQWBKEG.js";
76
+ } from "./chunk-2RZGY4XT.js";
77
+ import "./chunk-D6CWC4BX.js";
77
78
  import {
78
79
  CANONICAL_HOOK_EVENTS,
79
80
  buildHookMatrix,
@@ -82,11 +83,12 @@ import {
82
83
  getHookSupport,
83
84
  getProviderSummary,
84
85
  translateToAll
85
- } from "./chunk-YCAANESR.js";
86
+ } from "./chunk-IYSZL7N7.js";
86
87
  import {
87
88
  resolveProviderConfigPath,
88
89
  resolveProviderSkillsDir
89
- } from "./chunk-HDZYZTR2.js";
90
+ } from "./chunk-5INWYMO4.js";
91
+ import "./chunk-PZ5AY32C.js";
90
92
 
91
93
  // src/cli.ts
92
94
  import { Command } from "commander";
@@ -3290,7 +3292,7 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
3290
3292
  return;
3291
3293
  }
3292
3294
  if (opts.from) {
3293
- const { toCanonical } = await import("./hooks-FHFZZENR.js");
3295
+ const { toCanonical } = await import("./hooks-HDXLOEX2.js");
3294
3296
  const canonical2 = toCanonical(event, opts.from);
3295
3297
  if (format === "json") {
3296
3298
  const envelope = buildEnvelope2(
@@ -3330,7 +3332,7 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
3330
3332
  }
3331
3333
  process.exit(1);
3332
3334
  }
3333
- const { getMappedProviderIds } = await import("./hooks-FHFZZENR.js");
3335
+ const { getMappedProviderIds } = await import("./hooks-HDXLOEX2.js");
3334
3336
  const allIds = getMappedProviderIds();
3335
3337
  const translations = translateToAll(canonical, allIds);
3336
3338
  if (format === "json") {