1576
}
1577
}
1579
>
const agentInstructions = { content: ast.body?.getContent() ?? '', toolReferences, metadata } satisfies IAgentInstructions;
1580
>
1581
>
const name = ast.header?.name ?? extra.name ?? getCleanPromptName(uri);
1582
>
const description = ast.header?.description ?? extra.description;
1583
>
const target = getTarget(PromptsType.agent, ast.header ?? uri);
1584
>
const id = uri.toString();
1585
>
1586
>
const source = extra.source;
1587
>
if (!ast.header) {
1588
return { id, uri, name, agentInstructions, source, target, visibility: { userInvocable: true, agentInvocable: true }, sessionTypes, hooks, enabled };
1589
}
1590
const visibility = {
1591
userInvocable: ast.header.userInvocable !== false,
1592
>
agentInvocable: ast.header.infer !== undefined ? ast.header.infer === true : ast.header.disableModelInvocation !== true,
promptsServiceImpl.ts
1593
>
} satisfies ICustomAgentVisibility;
1594
>
1595
>
let model = ast.header.model;
1596
>
if (target === Target.Claude && model) {
1597
model = mapClaudeModels(model);
1598
}
1599
let { tools, handOffs, argumentHint, agents } = ast.header;
1601
tools = mapClaudeTools(tools);
1602
}
1603
return { id, uri, name, description, model, tools, handOffs, argumentHint, target, visibility, agents, agentInstructions, source, sessionTypes, hooks, enabled };
1605
>
}
1606
}