Suggests dcg allow-once for the last command dcg blocked in a turn

Managed using GNU Stow
Structure: "name-of-package"/path-to/destination stow "package-to-install" to set up symlinks stow -D "package-to-uninstall" to remove symlinks
Install both packages with stow omp omarchy, then apply an Omarchy theme to generate the OMP palette. Restart OMP once after setup so it starts with the custom theme's file watcher. Subsequent Omarchy theme switches update OMP live. Changing the theme through Appearance settings alone does not start the watcher in the current OMP runtime.
Install the packages and browser UI modification from the repository root as your desktop user:
make install-vivaldi
The target runs Stow, prompts for sudo to patch Vivaldi's system resources, and reapplies the current Omarchy theme. Stow alone is not sufficient. Restart Vivaldi once after it completes. Subsequent theme switches update its interface within about a second, without a debugging port or local server. The integration selects its own Omarchy theme and disables Vivaldi's theme scheduling.
Run make install-vivaldi again after Vivaldi updates, then restart the browser. The modification uses Vivaldi's internal API and may need changes when that API changes. The installation supports one desktop user and shares that user's palette with every Vivaldi profile using this installation.
To stop syncing, remove the omarchy-theme.js script tag from /opt/vivaldi/resources/vivaldi/window.html, restart Vivaldi, and select your preferred theme and scheduling settings.
hooks/register.ts 29 lines1import type { Register } from 'claude-code'
2
3const DCG_TOOLS: ReadonlySet<string> = new Set(['Bash', 'PowerShell', 'Monitor'])
4const DENIAL_CODE = /approve it with: dcg allow-once (\d+)$/m
5
6let blockedCode: string | undefined
7
8export const register: Register = on => {
9 on('tool.call', async ($, e, next) => {
10 const outcome = await next(e)
11 if (!DCG_TOOLS.has(e.tool)) return outcome
12 const denial = 'deny' in outcome ? outcome.deny : outcome.isError ? outcome.text : undefined
13 const code = denial?.match(DENIAL_CODE)?.[1]
14 if (code !== undefined) blockedCode = code
15 return outcome
16 })
17
18 on('turn.complete', async ($, e, next) => {
19 const completed = await next(e)
20 if (e.agentId === undefined) {
21 if (!e.isAborted && blockedCode !== undefined) {
22 void $.prompt.suggest({ text: `! dcg allow-once -y ${blockedCode}` })
23 }
24 blockedCode = undefined
25 }
26 return completed
27 })
28}
29