mirror of
https://github.com/JohnRiceML/clawport-ui.git
synced 2026-08-14 08:51:58 +00:00
7-step onboarding wizard (welcome, system check, naming, theme, accent, voice input, overview) with live previews and OpenClaw health checks. Add operatorName to settings — replaces all hardcoded "John Rice" references in sidebar, chat prompts, and system messages with dynamic operator name. Rebrand user-facing strings from "Manor" to "Agent Claw" with BRANDING.md documenting every reference for future rebranding. Open-source readiness: configurable agent registry (workspace override), requireEnv() for safe env access, npm run setup auto-detection script, SETUP.md guide, and comprehensive developer documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
840 B
TypeScript
33 lines
840 B
TypeScript
import { Agent } from '@/lib/types'
|
|
import { readFileSync, existsSync } from 'fs'
|
|
import { loadRegistry } from '@/lib/agents-registry'
|
|
|
|
export async function getAgents(): Promise<Agent[]> {
|
|
const workspacePath = process.env.WORKSPACE_PATH || ''
|
|
const registry = loadRegistry()
|
|
|
|
return registry.map((entry) => {
|
|
let soul: string | null = null
|
|
if (entry.soulPath && workspacePath) {
|
|
try {
|
|
const fullPath = workspacePath + '/' + entry.soulPath
|
|
if (existsSync(fullPath)) {
|
|
soul = readFileSync(fullPath, 'utf-8')
|
|
}
|
|
} catch {
|
|
soul = null
|
|
}
|
|
}
|
|
return {
|
|
...entry,
|
|
soul,
|
|
crons: [],
|
|
}
|
|
})
|
|
}
|
|
|
|
export async function getAgent(id: string): Promise<Agent | null> {
|
|
const agents = await getAgents()
|
|
return agents.find((a) => a.id === id) ?? null
|
|
}
|