feat: add agents command

This commit is contained in:
Peter Steinberger
2026-01-07 09:58:54 +01:00
parent 9df8af855b
commit 7973fd4caf
20 changed files with 1519 additions and 330 deletions

View File

@@ -21,16 +21,25 @@ export function resolveAgentIdFromSessionKey(
export function resolveAgentConfig(
cfg: ClawdbotConfig,
agentId: string,
): { workspace?: string; agentDir?: string } | undefined {
):
| {
name?: string;
workspace?: string;
agentDir?: string;
model?: string;
}
| undefined {
const id = normalizeAgentId(agentId);
const agents = cfg.routing?.agents;
if (!agents || typeof agents !== "object") return undefined;
const entry = agents[id];
if (!entry || typeof entry !== "object") return undefined;
return {
name: typeof entry.name === "string" ? entry.name : undefined,
workspace:
typeof entry.workspace === "string" ? entry.workspace : undefined,
agentDir: typeof entry.agentDir === "string" ? entry.agentDir : undefined,
model: typeof entry.model === "string" ? entry.model : undefined,
};
}