mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 10:50:38 +09:00
Fix portability import and org chart test blockers
This commit is contained in:
parent
1830216078
commit
553e7b6b30
5 changed files with 251 additions and 12 deletions
|
|
@ -623,6 +623,124 @@ describe("company portability", () => {
|
|||
]);
|
||||
});
|
||||
|
||||
it("imports a vendor-neutral package without .paperclip.yaml", async () => {
|
||||
const portability = companyPortabilityService({} as any);
|
||||
|
||||
companySvc.create.mockResolvedValue({
|
||||
id: "company-imported",
|
||||
name: "Imported Paperclip",
|
||||
});
|
||||
accessSvc.ensureMembership.mockResolvedValue(undefined);
|
||||
agentSvc.create.mockResolvedValue({
|
||||
id: "agent-created",
|
||||
name: "ClaudeCoder",
|
||||
});
|
||||
|
||||
const preview = await portability.previewImport({
|
||||
source: {
|
||||
type: "inline",
|
||||
rootPath: "paperclip-demo",
|
||||
files: {
|
||||
"COMPANY.md": [
|
||||
"---",
|
||||
'schema: "agentcompanies/v1"',
|
||||
'name: "Imported Paperclip"',
|
||||
'description: "Portable company package"',
|
||||
"---",
|
||||
"",
|
||||
"# Imported Paperclip",
|
||||
"",
|
||||
].join("\n"),
|
||||
"agents/claudecoder/AGENTS.md": [
|
||||
"---",
|
||||
'name: "ClaudeCoder"',
|
||||
'title: "Software Engineer"',
|
||||
"---",
|
||||
"",
|
||||
"# ClaudeCoder",
|
||||
"",
|
||||
"You write code.",
|
||||
"",
|
||||
].join("\n"),
|
||||
},
|
||||
},
|
||||
include: {
|
||||
company: true,
|
||||
agents: true,
|
||||
projects: false,
|
||||
issues: false,
|
||||
},
|
||||
target: {
|
||||
mode: "new_company",
|
||||
newCompanyName: "Imported Paperclip",
|
||||
},
|
||||
agents: "all",
|
||||
collisionStrategy: "rename",
|
||||
});
|
||||
|
||||
expect(preview.errors).toEqual([]);
|
||||
expect(preview.manifest.company?.name).toBe("Imported Paperclip");
|
||||
expect(preview.manifest.agents).toEqual([
|
||||
expect.objectContaining({
|
||||
slug: "claudecoder",
|
||||
name: "ClaudeCoder",
|
||||
adapterType: "process",
|
||||
}),
|
||||
]);
|
||||
expect(preview.envInputs).toEqual([]);
|
||||
|
||||
await portability.importBundle({
|
||||
source: {
|
||||
type: "inline",
|
||||
rootPath: "paperclip-demo",
|
||||
files: {
|
||||
"COMPANY.md": [
|
||||
"---",
|
||||
'schema: "agentcompanies/v1"',
|
||||
'name: "Imported Paperclip"',
|
||||
'description: "Portable company package"',
|
||||
"---",
|
||||
"",
|
||||
"# Imported Paperclip",
|
||||
"",
|
||||
].join("\n"),
|
||||
"agents/claudecoder/AGENTS.md": [
|
||||
"---",
|
||||
'name: "ClaudeCoder"',
|
||||
'title: "Software Engineer"',
|
||||
"---",
|
||||
"",
|
||||
"# ClaudeCoder",
|
||||
"",
|
||||
"You write code.",
|
||||
"",
|
||||
].join("\n"),
|
||||
},
|
||||
},
|
||||
include: {
|
||||
company: true,
|
||||
agents: true,
|
||||
projects: false,
|
||||
issues: false,
|
||||
},
|
||||
target: {
|
||||
mode: "new_company",
|
||||
newCompanyName: "Imported Paperclip",
|
||||
},
|
||||
agents: "all",
|
||||
collisionStrategy: "rename",
|
||||
}, "user-1");
|
||||
|
||||
expect(companySvc.create).toHaveBeenCalledWith(expect.objectContaining({
|
||||
name: "Imported Paperclip",
|
||||
description: "Portable company package",
|
||||
}));
|
||||
expect(agentSvc.create).toHaveBeenCalledWith("company-imported", expect.objectContaining({
|
||||
name: "ClaudeCoder",
|
||||
adapterType: "process",
|
||||
}));
|
||||
});
|
||||
|
||||
it("treats no-separator auth and api key env names as secrets during export", async () => {
|
||||
const portability = companyPortabilityService({} as any);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue