swarm-ui: restructure the agent card into status, terminal, subagents and settings, with badge controls for internet, permissions and allowed domains
This commit is contained in:
parent
197caa1e52
commit
5e23734667
1 changed files with 437 additions and 302 deletions
|
|
@ -4,6 +4,7 @@ import assert from "node:assert/strict";
|
|||
import { test } from "node:test";
|
||||
import {
|
||||
allowedSummary,
|
||||
entryGroups,
|
||||
entriesFor,
|
||||
entryBody,
|
||||
} from "../src/agent/detail/allowed-domains.ts";
|
||||
|
|
@ -62,3 +63,25 @@ test("a derived entry is counted as automatic, not as the operator's own", () =>
|
|||
assert.equal(allowedSummary([derived]), "1 automatic");
|
||||
assert.deepEqual(entriesFor([derived], "atlas"), [derived]);
|
||||
});
|
||||
|
||||
test("entries are grouped by source, empty sources left out", () => {
|
||||
const derived = { domain: "auto.io", agent: "atlas", derived: true };
|
||||
const groups = entryGroups([
|
||||
{ domain: "a.io" },
|
||||
{ domain: "b.io", agent: "atlas" },
|
||||
derived,
|
||||
]);
|
||||
assert.deepEqual(
|
||||
groups.map((g) => [g.source, g.entries.length]),
|
||||
[
|
||||
["swarm-wide", 1],
|
||||
["own", 1],
|
||||
["automatic", 1],
|
||||
],
|
||||
);
|
||||
assert.deepEqual(
|
||||
entryGroups([{ domain: "a.io" }]).map((g) => g.source),
|
||||
["swarm-wide"],
|
||||
);
|
||||
assert.deepEqual(entryGroups([]), []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue