From d85834b13d52c066f2a3ba04d80752da8a869229 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 18 Nov 2025 10:13:14 +0100 Subject: [PATCH] Release 0.6.2 --- CHANGELOG.md | 19 +++++++++++++++++++ tests/cli-list-verbose-e2e.test.ts | 3 ++- tests/daemon-client.test.ts | 4 ++-- tests/fixtures/test-helpers.ts | 24 ++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 tests/fixtures/test-helpers.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 6028475..cfec343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -253,3 +253,22 @@ ## [0.1.0] - Initial release. +## [0.6.2] - 2025-11-18 + +### Platform resilience (Windows/WSL) +- Added `fs-helpers` that treat chmod/copy failures on NTFS/DrvFs as best-effort so CLI generation keeps working on WSL mounts. +- Documented Windows/WSL workflows: install/test from ext4 copies, remount guidance for /mnt/c, and syncing tips. + +### CLI/runtime +- Global flag parsing moved into `cli-factory` for consistent log-level/oauth-timeout handling across commands. +- `daemon` host/client hardened and covered with new tests; idle eviction and restart paths verified. +- Imports now include platform-aware defaults for Cursor/Claude/Windsurf/VS Code/OpenCode configs with path dedupe. + +### StdIO MCP coverage +- Added stdio e2e tests using in-repo filesystem & memory MCP fixtures to ensure list/call works via execPath. + +### Content extraction +- `createCallResult` now reads nested `raw.content`/`raw.structuredContent` so tools that wrap responses render text/markdown/json correctly; new unit tests cover text joining, markdown, and JSON. + +### Docs +- New `docs/windows.md` with WSL/NTFS tips; added to docs index. diff --git a/tests/cli-list-verbose-e2e.test.ts b/tests/cli-list-verbose-e2e.test.ts index 8b6d4d4..04cb7e2 100644 --- a/tests/cli-list-verbose-e2e.test.ts +++ b/tests/cli-list-verbose-e2e.test.ts @@ -2,6 +2,7 @@ import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { restoreCwdSafely } from './fixtures/test-helpers.js'; process.env.MCPORTER_DISABLE_AUTORUN = '1'; const cliModulePromise = import('../src/cli.js'); @@ -28,7 +29,7 @@ describe('mcporter list --verbose end-to-end', () => { restoreHomedir?.(); delete process.env.MCPORTER_NO_FORCE_EXIT; process.env = { ...originalEnv }; - process.chdir(originalCwd); + restoreCwdSafely(originalCwd); await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {}); process.exitCode = undefined; }); diff --git a/tests/daemon-client.test.ts b/tests/daemon-client.test.ts index 2f287b6..d125f68 100644 --- a/tests/daemon-client.test.ts +++ b/tests/daemon-client.test.ts @@ -1,13 +1,13 @@ import fs from 'node:fs/promises'; import net from 'node:net'; -import os from 'node:os'; import path from 'node:path'; import { describe, expect, it } from 'vitest'; import { DaemonClient, resolveDaemonPaths } from '../src/daemon/client.js'; +import { makeShortTempDir } from './fixtures/test-helpers.js'; describe('daemon client', () => { it('keeps stdio sockets open until the daemon responds', async () => { - const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'mcporter-daemon-client-')); + const tmpDir = await makeShortTempDir('mcpd'); const originalDir = process.env.MCPORTER_DAEMON_DIR; process.env.MCPORTER_DAEMON_DIR = tmpDir; const configPath = path.join(tmpDir, 'config.json'); diff --git a/tests/fixtures/test-helpers.ts b/tests/fixtures/test-helpers.ts new file mode 100644 index 0000000..4879042 --- /dev/null +++ b/tests/fixtures/test-helpers.ts @@ -0,0 +1,24 @@ +import fs from 'node:fs/promises'; +import os from 'node:os'; +import path from 'node:path'; + +// Generates a short-lived temp directory with a stable, short base to avoid +// UNIX-domain socket length issues on macOS/Linux. On Windows we stick to the +// platform temp dir. +export async function makeShortTempDir(prefix: string): Promise { + const baseDir = process.platform === 'win32' ? os.tmpdir() : '/tmp'; + const dir = path.join(baseDir, `${prefix}-${Date.now().toString(36)}-${Math.random().toString(16).slice(2, 8)}`); + await fs.mkdir(dir, { recursive: true }); + return dir; +} + +// Safely restore cwd when running under Vitest workers (which disallow chdir). +export function restoreCwdSafely(originalCwd: string): void { + try { + process.chdir(originalCwd); + } catch (error) { + if (!(error instanceof Error) || !/chdir\(\) is not supported/.test(error.message)) { + throw error; + } + } +}