mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 18:10:39 +09:00
Merge pull request #2649 from plind-dm/fix/import-ceo-role-default
fix(import): read agent role from frontmatter before defaulting to "a…
This commit is contained in:
commit
73e7007e7c
2 changed files with 45 additions and 1 deletions
|
|
@ -1638,6 +1638,50 @@ describe("company portability", () => {
|
|||
}));
|
||||
});
|
||||
|
||||
it("preserves agent role from frontmatter when extension block omits it", async () => {
|
||||
const portability = companyPortabilityService({} as any);
|
||||
|
||||
const preview = await portability.previewImport({
|
||||
source: {
|
||||
type: "inline",
|
||||
rootPath: "ceo-package",
|
||||
files: {
|
||||
"COMPANY.md": [
|
||||
"---",
|
||||
'schema: "agentcompanies/v1"',
|
||||
'name: "CEO Role Test"',
|
||||
"---",
|
||||
"",
|
||||
].join("\n"),
|
||||
"agents/ceo/AGENTS.md": [
|
||||
"---",
|
||||
'name: "CEO"',
|
||||
'role: "ceo"',
|
||||
"---",
|
||||
"",
|
||||
"# CEO",
|
||||
"",
|
||||
"You run the company.",
|
||||
"",
|
||||
].join("\n"),
|
||||
},
|
||||
},
|
||||
include: { company: true, agents: true, projects: false, issues: false },
|
||||
target: { mode: "new_company", newCompanyName: "CEO Role Test" },
|
||||
agents: "all",
|
||||
collisionStrategy: "rename",
|
||||
});
|
||||
|
||||
expect(preview.errors).toEqual([]);
|
||||
expect(preview.manifest.agents).toEqual([
|
||||
expect.objectContaining({
|
||||
slug: "ceo",
|
||||
name: "CEO",
|
||||
role: "ceo",
|
||||
}),
|
||||
]);
|
||||
});
|
||||
|
||||
it("treats no-separator auth and api key env names as secrets during export", async () => {
|
||||
const portability = companyPortabilityService({} as any);
|
||||
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,7 @@ function buildManifestFromPackageFiles(
|
|||
name: asString(frontmatter.name) ?? title ?? slug,
|
||||
path: agentPath,
|
||||
skills: readAgentSkillRefs(frontmatter),
|
||||
role: asString(extension.role) ?? "agent",
|
||||
role: asString(extension.role) ?? asString(frontmatter.role) ?? "agent",
|
||||
title,
|
||||
icon: asString(extension.icon),
|
||||
capabilities: asString(extension.capabilities),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue