feat(extensions): add Roast Room, bring Codex to parity, fix audit findings
Roast Room is installed as a managed Git clone under ~/.my-ai-configuration/roast-room, shared by Claude and Codex. A personal launcher skill runs it from any folder, starts its live room when needed, and only runs when invoked by name (/roast-room, $roast-room). Codex now gets what was Claude-only before: the Caveman skill with a SessionStart hook that keeps it on, PreCompact and session-pointer hooks, execpolicy deny rules mirroring Claude's permissions.deny, and Impeccable's custom agents registered in ~/.codex/agents. The command-safety hook checks both shell dialects for Codex on Windows, where PowerShell text arrives as Bash, in both the PowerShell and Bash packages. Audit fixes: - command-safety blocks git checkout -- / restore / push --force / stash clear and find -delete, and treats heredoc bodies as text - removing a clone clears read-only Git files, git errors no longer abort the extension sync, and a lock left by a dead process is replaced - with-credential passes child flags such as -k or -d through unchanged and resolves commands from PATH - uninstall strips only owned hooks from settings.json and config.toml and keeps the selection while another client is installed; update keeps CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY; Bash merges write the same bytes as PowerShell - qmd no longer trusts a stale daemon.json after a lost start race and prunes collections of deleted repositories - Bash scripts avoid GNU-only find -printf Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
63a36d90e0
commit
b35e2254b3
48 files changed
+1059
-98
No files matched your search
@@ -9,7 +9,7 @@ from personal_instructions import CLIENT_FILES, render
|
||||
|
||||
|
||||
# Hook scripts this configuration installs; merges replace these and keep any foreign hooks.
|
||||
OWNED_HOOK_PATTERN = r'(?:flashbang|statusline|record-compact|session-state-pointer|qmd-warm|Start-QmdWarm|completion-?evidence|correction-?prompt|command-?safety|impeccable-?hook|search-?reminder)\.(?:ps1|sh)'
|
||||
OWNED_HOOK_PATTERN = r'(?:flashbang|statusline|record-compact|session-?state-?pointer|caveman-?mode|qmd-warm|Start-QmdWarm|completion-?evidence|correction-?prompt|command-?safety|impeccable-?hook|search-?reminder)\.(?:ps1|sh)'
|
||||
|
||||
|
||||
def is_flashbang(hook):
|
||||
@@ -109,17 +109,35 @@ def filter_flashbang(path):
|
||||
return filter_options(path, flashbang_enabled=False)
|
||||
|
||||
|
||||
def without_owned_hooks(groups):
|
||||
retained = []
|
||||
for group in groups:
|
||||
if not isinstance(group, dict) or not isinstance(group.get('hooks'), list):
|
||||
retained.append(group)
|
||||
continue
|
||||
foreign = [hook for hook in group['hooks'] if not (isinstance(hook, dict) and re.search(
|
||||
OWNED_HOOK_PATTERN,
|
||||
str(hook.get('command', '')) + str(hook.get('command_windows', '')), re.I))]
|
||||
if foreign:
|
||||
retained.append(dict(group, hooks=foreign))
|
||||
return retained
|
||||
|
||||
|
||||
def without_qmd_exclusion(settings):
|
||||
sandbox = settings.get('sandbox')
|
||||
if isinstance(sandbox, dict) and isinstance(sandbox.get('excludedCommands'), list):
|
||||
# The QMD exclusion is owned; managed settings re-add it only while semantic retrieval is enabled.
|
||||
excluded = [command for command in sandbox['excludedCommands'] if 'qmd-search.mjs' not in str(command)]
|
||||
settings['sandbox'] = dict(sandbox, excludedCommands=excluded) if excluded else {k: v for k, v in sandbox.items() if k != 'excludedCommands'}
|
||||
|
||||
|
||||
def merge_json(current, managed):
|
||||
if not isinstance(current, dict) or not isinstance(managed, dict):
|
||||
return managed
|
||||
result = dict(current)
|
||||
if 'statusLine' not in managed:
|
||||
result.pop('statusLine', None)
|
||||
sandbox = result.get('sandbox')
|
||||
if isinstance(sandbox, dict) and isinstance(sandbox.get('excludedCommands'), list):
|
||||
# The QMD exclusion is owned; managed settings re-add it only while semantic retrieval is enabled.
|
||||
excluded = [command for command in sandbox['excludedCommands'] if 'qmd-search.mjs' not in str(command)]
|
||||
result['sandbox'] = dict(sandbox, excludedCommands=excluded) if excluded else {k: v for k, v in sandbox.items() if k != 'excludedCommands'}
|
||||
without_qmd_exclusion(result)
|
||||
for key, value in managed.items():
|
||||
if key == 'hooks' and isinstance(value, dict) and isinstance(result.get(key), dict):
|
||||
hooks = dict(result[key])
|
||||
@@ -127,16 +145,7 @@ def merge_json(current, managed):
|
||||
groups = value.get(event, [])
|
||||
old_groups = hooks.get(event, [])
|
||||
if isinstance(groups, list) and isinstance(old_groups, list):
|
||||
retained = []
|
||||
for group in old_groups:
|
||||
if not isinstance(group, dict) or not isinstance(group.get('hooks'), list):
|
||||
retained.append(group)
|
||||
continue
|
||||
foreign = [hook for hook in group['hooks'] if not (isinstance(hook, dict) and re.search(
|
||||
OWNED_HOOK_PATTERN,
|
||||
str(hook.get('command', '')) + str(hook.get('command_windows', '')), re.I))]
|
||||
if foreign:
|
||||
retained.append(dict(group, hooks=foreign))
|
||||
retained = without_owned_hooks(old_groups)
|
||||
merged = groups + [group for group in retained if group not in groups]
|
||||
if merged:
|
||||
hooks[event] = merged
|
||||
@@ -236,9 +245,46 @@ def merge_toml(current_text, managed_text, statusline_enabled=True):
|
||||
return result
|
||||
|
||||
|
||||
def strip_json(current):
|
||||
"""Remove only what this setup owns (hooks, status line, QMD exclusion); keep everything else."""
|
||||
if not isinstance(current, dict):
|
||||
return current
|
||||
result = dict(current)
|
||||
status = result.get('statusLine')
|
||||
if isinstance(status, dict) and re.search(OWNED_HOOK_PATTERN, str(status.get('command', '')), re.I):
|
||||
del result['statusLine']
|
||||
without_qmd_exclusion(result)
|
||||
if isinstance(result.get('hooks'), dict):
|
||||
hooks = {}
|
||||
for event, groups in result['hooks'].items():
|
||||
remaining = without_owned_hooks(groups) if isinstance(groups, list) else groups
|
||||
if remaining:
|
||||
hooks[event] = remaining
|
||||
if hooks:
|
||||
result['hooks'] = hooks
|
||||
else:
|
||||
del result['hooks']
|
||||
return result
|
||||
|
||||
|
||||
def strip_toml(current_text):
|
||||
# Merging with an empty managed file drops owned hook tables and keeps every other line.
|
||||
result = merge_toml(current_text, '').lstrip('\r\n')
|
||||
return result if result.strip() else ''
|
||||
|
||||
|
||||
def strip_file(path):
|
||||
"""Return path's content without owned entries, or '' when nothing else remains."""
|
||||
content = path.read_text(encoding='utf-8-sig')
|
||||
if path.name == 'config.toml':
|
||||
return strip_toml(content)
|
||||
result = strip_json(json.loads(content))
|
||||
return json.dumps(result, indent=2, ensure_ascii=False) + '\n' if result else ''
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('action', choices=('filter', 'filter-instructions', 'merge-json', 'merge-toml'))
|
||||
parser.add_argument('action', choices=('filter', 'filter-instructions', 'merge-json', 'merge-toml', 'strip'))
|
||||
parser.add_argument('--path', type=Path)
|
||||
parser.add_argument('--current', type=Path)
|
||||
parser.add_argument('--flashbang', choices=('true', 'false'))
|
||||
@@ -256,6 +302,8 @@ if __name__ == '__main__':
|
||||
if args.destination and args.path.name in CLIENT_FILES.values():
|
||||
client = next(client for client, name in CLIENT_FILES.items() if name == args.path.name)
|
||||
result = render(result, args.destination.parent, client)
|
||||
elif args.action == 'strip':
|
||||
result = strip_file(args.current)
|
||||
else:
|
||||
managed = args.managed.read_text(encoding='utf-8-sig') if args.managed else sys.stdin.buffer.read().decode('utf-8-sig')
|
||||
current = args.current.read_text(encoding='utf-8-sig')
|
||||
|
||||
Reference in new issue
Block a user