refactor(test): share directive elevated config

This commit is contained in:
Peter Steinberger
2026-02-14 23:39:25 +00:00
parent 61371a712b
commit 165dbc232f
3 changed files with 30 additions and 46 deletions

View File

@@ -56,3 +56,29 @@ export function installDirectiveBehaviorE2EHooks() {
vi.restoreAllMocks();
});
}
export function makeRestrictedElevatedDisabledConfig(home: string) {
return {
agents: {
defaults: {
model: "anthropic/claude-opus-4-5",
workspace: path.join(home, "openclaw"),
},
list: [
{
id: "restricted",
tools: {
elevated: { enabled: false },
},
},
],
},
tools: {
elevated: {
allowFrom: { whatsapp: ["+1222"] },
},
},
channels: { whatsapp: { allowFrom: ["+1222"] } },
session: { store: path.join(home, "sessions.json") },
} as const;
}