Skip to content
Open
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
10 changes: 10 additions & 0 deletions .changeset/mcp-sdk-floor-and-unused-uuid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@sapiom/mcp": patch
"@sapiom/harness": patch
"@sapiom/agent-map": patch
---

`@sapiom/mcp` and `@sapiom/harness` now require `@modelcontextprotocol/sdk`
1.32.0 or later within 1.x, the first release that fixes the SDK's published
security advisories. `@sapiom/agent-map` and `@sapiom/harness` no longer depend
on the unused `uuid` package.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ jobs:
cache: "pnpm"
- run: pnpm install --frozen-lockfile --filter "@sapiom/mcp..."
- run: pnpm --filter "@sapiom/mcp..." build
- run: pnpm --filter @sapiom/agent-map test
# Vitest 4 needs Node 20+, so agent-map's unit suite runs in the matrix
# above; this job proves the packed packages still work on Node 18.
- run: pnpm --filter @sapiom/agent-map test:package
- run: pnpm --filter @sapiom/mcp test:capabilities
- run: pnpm --filter @sapiom/mcp test:package
Expand Down
6 changes: 2 additions & 4 deletions packages/agent-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@
"devDependencies": {
"@types/node": "^20.11.30",
"typescript": "~5.9.3",
"vitest": "^3.0.0",
"@types/uuid": "^10.0.0",
"vitest": "^4.1.12",
"esbuild": "^0.28.1"
},
"engines": {
Expand All @@ -89,7 +88,6 @@
"access": "public"
},
"dependencies": {
"zod": "^3.25.0",
"uuid": "^10.0.0"
"zod": "^3.25.0"
}
}
10 changes: 9 additions & 1 deletion packages/axios/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ module.exports = {
roots: ['<rootDir>/src'],
testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
transform: {
'^.+\\.tsx?$': ['ts-jest', {}],
// Type-check the tests against axios's CommonJS declarations, which
// describe the build Jest loads. Without the mapping, ts-jest resolves
// "axios" to index.d.ts for this package's files and to index.d.cts for
// axios-mock-adapter, and since axios 1.19 an AxiosInstance from one file
// is not assignable to an AxiosInstance from the other.
'^.+\\.tsx?$': [
'ts-jest',
{ tsconfig: { paths: { axios: ['./node_modules/axios/index.d.cts'] } } },
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
moduleNameMapper: {
Expand Down
2 changes: 1 addition & 1 deletion packages/axios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@types/node": "^20.11.30",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"axios": "^1.7.9",
"axios": "^1.20.0",
"axios-mock-adapter": "^2.1.0",
"eslint": "^8.57.0",
"jest": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"typescript": "^5.4.2",
"undici": "^7.16.0"
"undici": "^7.30.1"
},
"dependencies": {
"@sapiom/core": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/harness-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"electron": "^33.0.0",
"electron-builder": "^25.1.8",
"typescript": "^5.4.2",
"vitest": "^3.0.0"
"vitest": "^4.1.12"
},
"engines": {
"node": ">=20.0.0"
Expand Down
8 changes: 3 additions & 5 deletions packages/harness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"e2e:live": "tsx scripts/e2e-live.ts"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.26.0",
"@modelcontextprotocol/sdk": "^1.32.0",
"@sapiom/agent": "workspace:^",
"@sapiom/agent-core": "workspace:^",
"@sapiom/analytics-core": "workspace:^",
Expand All @@ -75,7 +75,6 @@
"node-pty": "^1.1.0",
"open": "^10.1.0",
"typescript": "~5.9.3",
"uuid": "^10.0.0",
"ws": "^8.18.0",
"zod": "^3.25.0",
"@sapiom/agent-map": "workspace:^"
Expand All @@ -88,7 +87,6 @@
"@types/node": "^20.11.30",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@types/uuid": "^10.0.0",
"@types/ws": "^8.5.10",
"@vitejs/plugin-react": "^4.3.4",
"@xterm/addon-fit": "^0.10.0",
Expand All @@ -100,8 +98,8 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tsx": "^4.19.0",
"vite": "^6.0.0",
"vitest": "^3.0.0",
"vite": "^6.4.4",
"vitest": "^4.1.12",
"@assistant-ui/react": "0.15.18",
"@assistant-ui/react-opencode": "0.2.22",
"@opencode-ai/sdk": "1.18.29"
Expand Down
4 changes: 2 additions & 2 deletions packages/harness/src/core/collector/codex-tailer.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mkdir, mkdtemp, realpath, rm, symlink, writeFile, appendFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from "vitest";

import { findRolloutFile, tailCodexRollout, type CodexTailerHandle } from "./codex-tailer.js";
import type { RawHookPayload } from "./normalizer.js";
Expand Down Expand Up @@ -36,7 +36,7 @@ describe("tailCodexRollout", () => {
let rolloutPath: string;
let handle: CodexTailerHandle | undefined;
let onEvent: ReturnType<typeof vi.fn<(hookEvent: string, payload: RawHookPayload) => void>>;
let onError: ReturnType<typeof vi.fn>;
let onError: Mock<(...args: any[]) => any>;

beforeEach(async () => {
dir = await mkdtemp(join(tmpdir(), "harness-codex-tailer-"));
Expand Down
2 changes: 1 addition & 1 deletion packages/harness/src/core/definition-slug-resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ describe("authenticated deployment evidence", () => {
} finally {
timeout.mockRestore();
}
});

describe("createDefinitionSlugResolver.listVisible (SAP-3214)", () => {
let errorSpy: ReturnType<typeof vi.spyOn>;
Expand Down Expand Up @@ -697,7 +698,6 @@ describe("authenticated deployment evidence", () => {
expect(fetchImpl).toHaveBeenCalledTimes(1);
});
});
});
});

describe("createDefinitionSlugResolver — credential channel", () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/harness/src/core/opencode-host.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from "vitest";
import {
access,
mkdtemp,
Expand Down Expand Up @@ -36,8 +36,8 @@ const observers: Array<{
hosted: HostedOpenCode;
id: string;
update: (state: AssistantObservation) => void;
dispose: ReturnType<typeof vi.fn>;
start: ReturnType<typeof vi.fn>;
dispose: Mock<(...args: any[]) => any>;
start: Mock<(...args: any[]) => any>;
}> = [];
const createObserver = vi.fn(
(
Expand Down
4 changes: 2 additions & 2 deletions packages/harness/src/core/workspace-watch-broker.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fs from "node:fs/promises";
import * as os from "node:os";
import * as path from "node:path";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from "vitest";

import {
SharedWorkspaceWatchBroker,
Expand All @@ -13,7 +13,7 @@ import {

let root: string;
let listener: Parameters<WorkspaceWatchFactory>[1];
let close: ReturnType<typeof vi.fn>;
let close: Mock<(...args: any[]) => any>;
let watchFactory: ReturnType<typeof vi.fn<WorkspaceWatchFactory>>;
let aliasPath: string | null;

Expand Down
6 changes: 3 additions & 3 deletions packages/harness/src/core/workspace-watcher.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
import { describe, it, expect, beforeEach, afterEach, vi, type Mock } from "vitest";
import * as fs from "node:fs/promises";
import * as os from "node:os";
import * as path from "node:path";
Expand Down Expand Up @@ -28,8 +28,8 @@ async function scaffoldWorkflow(root: string, name: string): Promise<string> {

let cwd: string;
let manager: WorkspaceWatcherManager;
let onChange: ReturnType<typeof vi.fn>;
let onWatcherStarted: ReturnType<typeof vi.fn>;
let onChange: Mock<(...args: any[]) => any>;
let onWatcherStarted: Mock<(...args: any[]) => any>;

describe("WorkspaceWatcherManager", () => {
beforeEach(async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/harness/src/server/codex-tailer-wiring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* polling delay. See codex-session-lifecycle.test.ts for the real-files,
* no-mocking end-to-end proof.
*/
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from "vitest";
import { mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
Expand All @@ -21,7 +21,7 @@ import { startServer, type HarnessServer } from "./index.js";
import { CodexRolloutBroker } from "../core/collector/codex-rollout-broker.js";
import type { HarnessAdapter, LaunchOpts, SpawnSpec } from "../shared/types.js";

type FakeTailerHandle = { stop: ReturnType<typeof vi.fn>; emitSessionEnd: ReturnType<typeof vi.fn> };
type FakeTailerHandle = { stop: Mock<(...args: any[]) => any>; emitSessionEnd: Mock<(...args: any[]) => any> };

/**
* `vi.waitFor`'s own default (1000ms timeout / 50ms interval — tuned for
Expand Down
6 changes: 3 additions & 3 deletions packages/harness/src/server/rest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fs from "node:fs/promises";
import * as os from "node:os";
import * as path from "node:path";
import express from "express";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from "vitest";

let tmpHome: string;

Expand Down Expand Up @@ -161,8 +161,8 @@ function historyAdapter(
describe("createRestRouter", () => {
let server: ReturnType<express.Express["listen"]>;
let baseUrl: string;
let onTelemetryOptInChange: ReturnType<typeof vi.fn>;
let writeWorkspaceContext: ReturnType<typeof vi.fn>;
let onTelemetryOptInChange: Mock<(...args: any[]) => any>;
let writeWorkspaceContext: Mock<(...args: any[]) => any>;

function start(overrides: Partial<RestRouterOptions> = {}) {
onTelemetryOptInChange = vi.fn();
Expand Down
4 changes: 2 additions & 2 deletions packages/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"test:package": "pnpm --filter \"@sapiom/mcp...\" build && node scripts/check-package.mjs"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.26.0",
"@modelcontextprotocol/sdk": "^1.32.0",
"@sapiom/agent-core": "workspace:^",
"@sapiom/analytics-core": "workspace:^",
"@sapiom/sandbox-preview": "workspace:^",
Expand All @@ -73,7 +73,7 @@
"@typescript-eslint/parser": "^7.3.1",
"eslint": "^8.57.0",
"prettier": "^3.2.5",
"vitest": "^3.0.0"
"vitest": "^4.1.12"
},
"engines": {
"node": ">=18.0.0"
Expand Down
3 changes: 3 additions & 0 deletions packages/mcp/src/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ describe("performBrowserAuth", () => {

afterEach(() => {
globalThis.fetch = originalFetch;
// Vitest 4's restoreAllMocks only restores vi.spyOn spies; reset module
// mocks too to prevent call history from leaking between tests.
vi.resetAllMocks();
vi.restoreAllMocks();
});

Expand Down
3 changes: 3 additions & 0 deletions packages/mcp/src/credentials.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ it("exposes the shared credential-store path", () => {
});

afterEach(() => {
// Vitest 4's restoreAllMocks only restores vi.spyOn spies; reset module
// mocks too to prevent call history from leaking between tests.
vi.resetAllMocks();
vi.restoreAllMocks();
});

Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"@typescript-eslint/parser": "^7.3.1",
"eslint": "^8.57.0",
"typescript": "^5.4.2",
"vitest": "^3.0.0"
"vitest": "^4.1.12"
}
}
Loading
Loading