feat: add default columns to ego.json

Initialize ego.json with default columns on first install:
- columns (Agent Scope): default-username, name, discord-id, email, role,
  position, date-of-birth, agent-id, gender
- public-columns (Public Scope): git-host, keycloak-host
This commit is contained in:
zhi
2026-03-24 19:10:23 +00:00
parent 21d7a85ba1
commit 4e8e264390

View File

@@ -296,13 +296,13 @@ async function install() {
// Initialize ego.json if it doesn't exist // Initialize ego.json if it doesn't exist
const egoJsonPath = join(openclawPath, 'ego.json'); const egoJsonPath = join(openclawPath, 'ego.json');
if (!existsSync(egoJsonPath)) { if (!existsSync(egoJsonPath)) {
const emptyEgo = { const defaultEgo = {
columns: [], columns: ['default-username', 'name', 'discord-id', 'email', 'role', 'position', 'date-of-birth', 'agent-id', 'gender'],
'public-columns': [], 'public-columns': ['git-host', 'keycloak-host'],
'public-scope': {}, 'public-scope': {},
'agent-scope': {}, 'agent-scope': {},
}; };
writeFileSync(egoJsonPath, JSON.stringify(emptyEgo, null, 2) + '\n', { mode: 0o644 }); writeFileSync(egoJsonPath, JSON.stringify(defaultEgo, null, 2) + '\n', { mode: 0o644 });
logOk('Created ego.json'); logOk('Created ego.json');
} else { } else {
logOk('ego.json already exists'); logOk('ego.json already exists');