Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions test/mcp/mcp-tool-discovery-image-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import path from "node:path";
import { pathToFileURL } from "node:url";
import { stripVTControlCharacters } from "node:util";
import { describe, expect, it } from "vitest";
import { lockedArchives } from "../../scripts/checks/materialize-locked-npm-cache-seed.mts";
import { expectManagedToolDiscoveryRuntimeImageContract } from "../support/managed-bootstrap-image-contract";

const repoRoot = path.join(import.meta.dirname, "../..");
Expand Down Expand Up @@ -146,8 +147,7 @@ describe("MCP tool discovery image contract", () => {

it.each([
{
archiveCount: 85,
label: "NemoClaw CLI",
label: "NemoClaw plugin",
lockfile: "nemoclaw/package-lock.json",
seedDirectory: "tools/mcp-tool-discovery-runtime/npm-cache-seed",
},
Expand All @@ -158,13 +158,20 @@ describe("MCP tool discovery image contract", () => {
.readdirSync(seedDirectory)
.filter((seedName) => seedName !== "manifest.json")
.sort();
const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, fixture.lockfile), "utf8"));
const lockSource = fs.readFileSync(path.join(repoRoot, fixture.lockfile), "utf8");
const lock = JSON.parse(lockSource);
const target = { cpu: "x64", libc: "glibc", os: "linux" };
const expectedArchives = lockedArchives(lockSource, target);
Comment thread
coderabbitai[bot] marked this conversation as resolved.

expect(manifest).toMatchObject({
archiveCount: fixture.archiveCount,
archiveCount: expectedArchives.length,
kind: "nemoclaw-locked-npm-cache-seed-v1",
target: { cpu: "x64", libc: "glibc", os: "linux" },
lockSha256: crypto.createHash("sha256").update(lockSource).digest("hex"),
target,
});
expect(manifest.archives).toEqual(
expectedArchives.map((archive) => expect.objectContaining(archive)),
);
expect(manifest.archives).toHaveLength(manifest.archiveCount);
expect(
seedNames
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
28 changes: 26 additions & 2 deletions tools/mcp-tool-discovery-runtime/npm-cache-seed/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"archiveCount": 85,
"archiveCount": 89,
"archives": [
{
"archive": "assertion-error-2.0.1.tgz",
Expand All @@ -25,6 +25,24 @@
"resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.78.0.tgz",
"size": 6738988
},
{
"archive": "binding-linux-x64-musl-0.63.0.tgz",
"integrity": "sha512-5eGyTJuMZNwBSHCivXt8Yuta6GeTYksOPXRk2MIhajiyFGQx7bjaHIwY+ZusAoFHhT157A9x6sktLjYo9D5oMQ==",
"resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-musl/-/binding-linux-x64-musl-0.63.0.tgz",
"size": 3695601
},
{
"archive": "binding-linux-x64-musl-1.1.5.tgz",
"integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz",
"size": 7753314
},
{
"archive": "binding-linux-x64-musl-1.78.0.tgz",
"integrity": "sha512-GmsP4rW0xTL6u5CVdcDsaN5Fbc7hBc382Wmar1kttbnwSEviM+rSINKOMQ+UQ6iH+AGwC+8gaAiwu134Tgh6Lg==",
"resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.78.0.tgz",
"size": 6670571
},
{
"archive": "chai-5.2.3.tgz",
"integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
Expand Down Expand Up @@ -175,6 +193,12 @@
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz",
"size": 3848191
},
{
"archive": "lightningcss-linux-x64-musl-1.32.0.tgz",
"integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==",
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz",
"size": 3846393
},
{
"archive": "linux-x64-7.0.2001.tgz",
"integrity": "sha512-UDezNqdECVmngu2TPnjaS1YoAmcTaBoI5lV9vk3VahBxoi+I5r9k3iJTT7qZoYWOXTD/7T7bNcwRgrocR6BscQ==",
Expand Down Expand Up @@ -513,7 +537,7 @@
}
],
"kind": "nemoclaw-locked-npm-cache-seed-v1",
"lockSha256": "66bef669196bb1c61385871e369542d3c321c277adb0f0e2e9f0ad972106b163",
"lockSha256": "55a512d782f8a4ad0eac39078b0e652400bf8580767b3a9ac5282a05bae47042",
"target": {
"cpu": "x64",
"libc": "glibc",
Expand Down
Loading