diff --git a/AGENTS.md b/AGENTS.md index 2d1d770..556c674 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,3 +1,3 @@ # Repository boundary -This repository owns only the `@agentcommunity/mcp` stdio connector. The hosted server and its tools live at `https://agentcommunity.org/mcp`; do not copy server logic here. The connector must remain anonymous, fixed-origin, telemetry-free, and dependency-pinned. It must never call a tool during tests or installation, expose an SDK API, accept an alternate remote URL, add install scripts, or store credentials. The sole local-publish exception is the reviewed `0.1.0` bootstrap required to create the npm package before trusted publishing can be attached; it must be deprecated after `0.1.1` is live. Every later publication, including canonical `0.1.1`, uses the tag-only OIDC workflow after `npm test` and `npm run package:audit` pass. +This repository owns only the `@agentcommunity/mcp` stdio connector. The hosted server and its tools live at `https://agentcommunity.org/mcp`; do not copy server logic here. The connector must remain anonymous, fixed-origin, telemetry-free, and dependency-pinned. It must never call a tool during tests or installation, expose an SDK API, accept an alternate remote URL, add install scripts, or store credentials. The sole local-publish exception is the reviewed `0.1.0` bootstrap required to create the npm package before trusted publishing can be attached; deprecate it only after canonical `0.1.2` is independently verified live. `v0.1.1` is a failed immutable historical tag with no npm publication and must never be moved, deleted, or reused. Forward release work targets canonical `0.1.2` through the tag-only OIDC workflow after `npm test` and `npm run package:audit` pass. diff --git a/package-lock.json b/package-lock.json index f38e913..4f45eab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@agentcommunity/mcp", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@agentcommunity/mcp", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "dependencies": { "mcp-remote": "0.1.38" diff --git a/package.json b/package.json index 66af821..0b88d07 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@agentcommunity/mcp", - "version": "0.1.1", + "version": "0.1.2", "description": "Official Agent Community MCP connector for stdio clients; bridges to the hosted Streamable HTTP server at https://agentcommunity.org/mcp", "type": "module", "exports": {}, diff --git a/test/bin.test.js b/test/bin.test.js index 814094d..34ebbb4 100644 --- a/test/bin.test.js +++ b/test/bin.test.js @@ -9,10 +9,20 @@ import { promisify } from 'node:util'; import { fileURLToPath } from 'node:url'; import { applyChildExit, buildInvocation, helpText, installSignalForwarding } from '../bin.js'; +import { normalizePackResult } from '../scripts/audit-package.mjs'; const execFileAsync = promisify(execFile); const packageRoot = fileURLToPath(new URL('../', import.meta.url)); +function packResultWithShape(value, shape) { + const candidate = Array.isArray(value) ? value[0] : Object.values(value)[0]; + assert.ok(candidate); + + if (shape === 'array') return [candidate]; + assert.equal(shape, 'package-map'); + return { '@agentcommunity/mcp': candidate }; +} + function quoteForComSpec(argument) { return `"${argument.replaceAll('"', '""')}"`; } @@ -101,7 +111,7 @@ test('builds the installed Windows shim invocation through ComSpec with robust q ); }); -async function withPackedInstall(callback) { +async function withPackedInstall(callback, packResultShape = 'array') { const temporaryRoot = await mkdtemp(join(tmpdir(), 'agentcommunity-mcp-')); const packDirectory = join(temporaryRoot, 'pack'); const clientDirectory = join(temporaryRoot, 'client'); @@ -121,7 +131,9 @@ async function withPackedInstall(callback) { cwd: packageRoot, ...packInvocation.options, }); - const [{ filename }] = JSON.parse(packed.stdout); + const shapedPackResult = packResultWithShape(JSON.parse(packed.stdout), packResultShape); + const sourceManifest = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8')); + const { filename } = normalizePackResult(shapedPackResult, sourceManifest.version); const installInvocation = buildNpmInvocation([ 'install', '--ignore-scripts', @@ -158,7 +170,7 @@ test('help describes a connector and never claims to own the server or SDK', fun assert.doesNotMatch(helpText, /SDK|implements four tools|MCP server package/); }); -test('packed package emits help through the installed npm shim', async function () { +test('packed package emits help through the installed npm shim with array pack JSON', async function () { await withPackedInstall(async function (clientDirectory) { const shimName = process.platform === 'win32' ? 'agentcommunity-mcp.cmd' @@ -173,7 +185,18 @@ test('packed package emits help through the installed npm shim', async function assert.match(result.stdout, /Official Agent Community MCP connector/); assert.match(result.stdout, /https:\/\/agentcommunity\.org\/mcp/); assert.equal(result.stderr, ''); - }); + }, 'array'); +}); + +test('packed installation accepts npm 12 package-keyed pack JSON', async function () { + await withPackedInstall(async function (clientDirectory) { + const installedManifest = JSON.parse(await readFile( + join(clientDirectory, 'node_modules', '@agentcommunity', 'mcp', 'package.json'), + 'utf8', + )); + + assert.equal(installedManifest.name, '@agentcommunity/mcp'); + }, 'package-map'); }); test('package metadata has no install scripts or SDK export', async function () {