feat(hooks): Enable hooks in the CLI [ENG-1375] (#7948)

* feat(cli): Add hooks_enabled support to CLI settings

- Add hooks_enabled field to Settings proto message (field 134)
- Add hooks_enabled parsing to CLI settings parser
- Enables users to toggle hooks via -s hooks_enabled=true/false flag

Fixes missing CLI support for hooks that was available in the VSCode extension

* feat(hooks): Enable hooks in the CLI

* Add include back in after resolving merge conflict

* feat(hooks): Changes as per human code review feedback.

---------

Co-authored-by: NightTrek <Daniels@dual4t.com>
This commit is contained in:
CandiedUniverseandNightTrek authored and GitHub committed 2025-12-09 10:32:18 -08:00
1 parent 8ce7e132d2
commit dec215cd9c
14 files changed
+66 -17

No files matched your search

+12
View File
@@ -80,6 +80,18 @@ export async function newTask(controller: Controller, request: NewTaskRequest):
...(request.taskSettings?.actModeApiProvider !== undefined && {
actModeApiProvider: convertProtoToApiProvider(request.taskSettings.actModeApiProvider),
}),
...(request.taskSettings?.hooksEnabled !== undefined && {
hooksEnabled: (() => {
const isEnabled = !!request.taskSettings.hooksEnabled
// Platform validation: Only allow enabling hooks on macOS and Linux
if (isEnabled && process.platform === "win32") {
throw new Error("Hooks are not yet supported on Windows")
}
return isEnabled
})(),
}),
}).filter(([_, value]) => value !== undefined),
)