fix: resolve format/build failures
This commit is contained in:
@@ -55,7 +55,9 @@ function resolveAgentIdByWorkspace(
|
||||
): string[] {
|
||||
const list = listAgentEntries(cfg);
|
||||
const ids =
|
||||
list.length > 0 ? list.map((entry) => normalizeAgentId(entry.id)) : [resolveDefaultAgentId(cfg)];
|
||||
list.length > 0
|
||||
? list.map((entry) => normalizeAgentId(entry.id))
|
||||
: [resolveDefaultAgentId(cfg)];
|
||||
const normalizedTarget = normalizeWorkspacePath(workspaceDir);
|
||||
return ids.filter(
|
||||
(id) => normalizeWorkspacePath(resolveAgentWorkspaceDir(cfg, id)) === normalizedTarget,
|
||||
@@ -134,10 +136,7 @@ export async function agentsSetIdentityCommand(
|
||||
}
|
||||
|
||||
const fileTheme =
|
||||
identityFromFile?.theme ??
|
||||
identityFromFile?.creature ??
|
||||
identityFromFile?.vibe ??
|
||||
undefined;
|
||||
identityFromFile?.theme ?? identityFromFile?.creature ?? identityFromFile?.vibe ?? undefined;
|
||||
const incomingIdentity: IdentityConfig = {
|
||||
...(nameRaw || identityFromFile?.name ? { name: nameRaw ?? identityFromFile?.name } : {}),
|
||||
...(emojiRaw || identityFromFile?.emoji ? { emoji: emojiRaw ?? identityFromFile?.emoji } : {}),
|
||||
|
||||
@@ -79,11 +79,7 @@ export function parseIdentityMarkdown(content: string): AgentIdentity {
|
||||
const cleaned = line.trim().replace(/^\s*-\s*/, "");
|
||||
const colonIndex = cleaned.indexOf(":");
|
||||
if (colonIndex === -1) continue;
|
||||
const label = cleaned
|
||||
.slice(0, colonIndex)
|
||||
.replace(/[*_]/g, "")
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
const label = cleaned.slice(0, colonIndex).replace(/[*_]/g, "").trim().toLowerCase();
|
||||
const value = cleaned
|
||||
.slice(colonIndex + 1)
|
||||
.replace(/^[*_]+|[*_]+$/g, "")
|
||||
|
||||
@@ -93,7 +93,12 @@ describe("agents set-identity command", () => {
|
||||
configMocks.readConfigFileSnapshot.mockResolvedValue({
|
||||
...baseSnapshot,
|
||||
config: {
|
||||
agents: { list: [{ id: "main", workspace }, { id: "ops", workspace }] },
|
||||
agents: {
|
||||
list: [
|
||||
{ id: "main", workspace },
|
||||
{ id: "ops", workspace },
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user