feat(hooks): gate orca.yaml execution on trust

Audited and rebased PR 1138. Squashed to remove the original untrusted commit stack; hook execution now requires explicit UI trust or CLI --run-hooks opt-in.
This commit is contained in:
mcd77
2026-04-29 18:29:53 -07:00
committed by GitHub
parent 2329f56180
commit 89f41bfda2
24 changed files with 702 additions and 57 deletions
+2 -1
View File
@@ -232,7 +232,8 @@ export function getDefaultUIState(): PersistedUIState {
statusBarItems: [...DEFAULT_STATUS_BAR_ITEMS],
statusBarVisible: true,
dismissedUpdateVersion: null,
lastUpdateCheckAt: null
lastUpdateCheckAt: null,
trustedOrcaHooks: {}
}
}
+14
View File
@@ -1117,8 +1117,22 @@ export type PersistedUIState = {
/** Once the user has starred Orca (from any entry point) we permanently
* suppress the nag — no further thresholds, no notifications. */
starNagCompleted?: boolean
trustedOrcaHooks?: PersistedTrustedOrcaHooks
}
export type PersistedTrustedOrcaHookEntry = {
contentHash: string
approvedAt: number
}
export type PersistedTrustedOrcaHookRepo = {
setup?: PersistedTrustedOrcaHookEntry
archive?: PersistedTrustedOrcaHookEntry
issueCommand?: PersistedTrustedOrcaHookEntry
}
export type PersistedTrustedOrcaHooks = Record<string, PersistedTrustedOrcaHookRepo>
// ─── Persistence shape ──────────────────────────────────────────────
export type PersistedState = {
schemaVersion: number