fix(sf): add 'hook' to LogComponent + use it in hook-emitter
The auto-drain shipped hook-emitter.ts:80,93 logWarning calls with component "hook-emitter" but that string wasn't in the LogComponent union, blocking tsc compilation. Add 'hook' to the union (consistent with the existing short component names like 'tool', 'dispatch', 'timer') and update the two callsites. Without this, tsc fails and dist/resource-loader.js (which contains the new verifyManifestFilesExist fix) can't update — leaving the ask-user-questions.js boot failure unresolved despite the source-side fix landing in aa7d3f10a. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
644187c73e
commit
a4059e5871
2 changed files with 14 additions and 13 deletions
|
|
@ -76,12 +76,12 @@ async function emitEvent(
|
|||
// Log warning once per session when hooks fire but _pi is missing
|
||||
// (#sf-moobmhx4-gk9g83)
|
||||
if (!_missingPiWarningLogged) {
|
||||
_missingPiWarningLogged = true;
|
||||
logWarning(
|
||||
"hook-emitter",
|
||||
"ExtensionAPI not set — hooks will not fire. Call setHookEmitter(pi) from registerSfExtension to enable.",
|
||||
);
|
||||
}
|
||||
_missingPiWarningLogged = true;
|
||||
logWarning(
|
||||
"hook",
|
||||
"ExtensionAPI not set — hooks will not fire. Call setHookEmitter(pi) from registerSfExtension to enable.",
|
||||
);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
// Call emitExtensionEvent if available on the ExtensionAPI
|
||||
|
|
@ -89,13 +89,13 @@ async function emitEvent(
|
|||
if (typeof emitter === "function") {
|
||||
try {
|
||||
return (await emitter.call(_pi, event)) as EventResult | undefined;
|
||||
} catch (err) {
|
||||
logWarning(
|
||||
"hook-emitter",
|
||||
`emitExtensionEvent failed for ${event.type}: ${err instanceof Error ? err.message : String(err)}`,
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
} catch (err) {
|
||||
logWarning(
|
||||
"hook",
|
||||
`emitExtensionEvent failed for ${event.type}: ${err instanceof Error ? err.message : String(err)}`,
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
// emitExtensionEvent not available on this ExtensionAPI version
|
||||
return undefined;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ export type LogComponent =
|
|||
| "prompt" // Prompt construction and context injection
|
||||
| "dashboard" // Auto-dashboard rendering
|
||||
| "timer" // Auto-timers (idle watchdog, hard timeout)
|
||||
| "hook" // Extension hook emitter (beforeCommit, beforePush, etc.)
|
||||
| "worktree" // Worktree lifecycle (create, sync, merge)
|
||||
| "command" // Slash command execution and maintenance
|
||||
| "parallel" // Parallel orchestrator and merge
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue