Polish agent and team sharing and snapshots (#1852)

This commit is contained in:
klopez4212
2026-07-15 18:19:03 +01:00
committed by GitHub
parent c5996e13a4
commit 2f3fa586f3
54 changed files with 4212 additions and 3402 deletions

View File

@@ -94,6 +94,7 @@ test("resolveSnapshotCard: .agent.json with sha256 returns snapshot card", () =>
"",
);
assert.ok(card !== null, "expected a snapshot card");
assert.equal(card.displayName, "Analyst");
assert.equal(card.filename, "analyst.agent.json");
assert.equal(card.sha256, SHA256);
assert.equal(card.snapshotKind, "agent");
@@ -107,10 +108,27 @@ test("resolveSnapshotCard: .agent.png with image/png mime returns snapshot card"
"",
);
assert.ok(card !== null);
assert.equal(card.displayName, "Analyst");
assert.equal(card.filename, "analyst.agent.png");
assert.equal(card.snapshotKind, "agent");
});
test("resolveSnapshotCard: sender label is used as the agent name", () => {
const card = resolveSnapshotCard(
{
m: "image/png",
size: 2048,
filename: "animation-auditor.agent.png",
x: SHA256,
},
PNG_URL,
"Animation Auditor",
);
assert.ok(card !== null);
assert.equal(card.displayName, "Animation Auditor");
assert.equal(card.filename, "animation-auditor.agent.png");
});
test("resolveSnapshotCard: .agent.json with octet-stream mime is eligible", () => {
// JSON snapshots often arrive as application/octet-stream.
const card = resolveSnapshotCard(
@@ -283,7 +301,7 @@ test("resolveSnapshotCard: .team.png with image/png returns team snapshot card",
);
assert.ok(card !== null);
assert.equal(card.snapshotKind, "team");
assert.ok(card.thumb != null, "PNG team card must have a thumb");
assert.equal(card.thumb, undefined);
});
test("resolveSnapshotCard: plain .team without suffix is not a snapshot", () => {