Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
/**
* Admin SPA scope constants — HAND-MAINTAINED MIRROR of src/core/scope.ts.
*
* The admin tsconfig.json scopes `include: ['src']` to admin/src/, so we
* cannot directly import from ../../src/core/scope.ts without breaking the
* SPA's compile boundary. Instead, this file is a hand-maintained duplicate;
* scripts/check-admin-scope-drift.sh fails the build if the two lists drift.
*
* If you change ALLOWED_SCOPES in src/core/scope.ts, update this file too,
* or `bun run verify` will reject the change.
*/
export type Scope = 'read' | 'write' | 'admin' | 'sources_admin' | 'users_admin' | 'agent' | 'skill_editor' | 'skill_publisher' | 'skills_member_self' | 'memory_confirm';
// MIRROR OF src/core/scope.ts ALLOWED_SCOPES_LIST — keep alphabetically sorted.
// v0.38: 'agent' added for the submit_agent remote-MCP op (sibling to admin,
// NOT implied — existing admin clients must re-register to opt in).
// memory_confirm is listed for display only: the server refuses to grant it
// over the admin API (local CLI only, src/core/scope.ts LOCAL_CLI_ONLY_SCOPES).
export const ALLOWED_SCOPES_LIST: ReadonlyArray<Scope> = [
'admin',
'agent',
'memory_confirm',
'read',
'skill_editor',
'skill_publisher',
'skills_member_self',
'sources_admin',
'users_admin',
'write',
];