6 role definitions (developer, manager, operator, mentor, secretary, agent-resource-director) and 6 position definitions. Routers: role.ts and position.ts read ego.json for agent mapping. install.sh: copies routers to PrismFacet, scans roles/ and positions/ directories, registers rules in PrismFacet's rules.json. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
15 lines
420 B
TypeScript
15 lines
420 B
TypeScript
// Reads agent position from ego.json (requires PaddedCell/ego-mgr)
|
|
import { readFileSync } from "node:fs";
|
|
import { homedir } from "node:os";
|
|
|
|
const EGO_PATH = `${homedir()}/.openclaw/ego.json`;
|
|
|
|
export function resolve(ctx: { agentId: string }): string {
|
|
try {
|
|
const ego = JSON.parse(readFileSync(EGO_PATH, "utf8"));
|
|
return ego["agent-scope"]?.[ctx.agentId]?.position || "";
|
|
} catch {
|
|
return "";
|
|
}
|
|
}
|