diff --git a/codex/README.md b/codex/README.md index cd87d30..7becadc 100644 --- a/codex/README.md +++ b/codex/README.md @@ -22,7 +22,7 @@ codex mcp add glance -- npx -y @modemdev/glance-codex Optional: pin a specific version: ```bash -codex mcp add glance -- npx -y @modemdev/glance-codex@0.1.0 +codex mcp add glance -- npx -y @modemdev/glance-codex@0.1.1 ``` Local development / manual install: @@ -71,8 +71,8 @@ Prerequisite: configure `NPM_TOKEN` in the `glance-agent-plugins` repository wit 3. Create and push a matching tag: ```bash -git tag codex-v0.1.0 -git push origin codex-v0.1.0 +git tag codex-v0.1.1 +git push origin codex-v0.1.1 ``` The `Release codex package` workflow validates tag/version alignment, checks for already-published versions, runs `npm pack --dry-run`, and publishes with npm provenance. diff --git a/codex/package.json b/codex/package.json index 1093cec..53ebb43 100644 --- a/codex/package.json +++ b/codex/package.json @@ -1,6 +1,6 @@ { "name": "@modemdev/glance-codex", - "version": "0.1.0", + "version": "0.1.1", "description": "glance.sh MCP server package for Codex", "license": "MIT", "type": "module", diff --git a/codex/servers/glance-mcp.js b/codex/servers/glance-mcp.js index 10564a8..8d68f9c 100755 --- a/codex/servers/glance-mcp.js +++ b/codex/servers/glance-mcp.js @@ -1,6 +1,7 @@ #!/usr/bin/env node -import { pathToFileURL } from "node:url" +import { realpathSync } from "node:fs" +import { fileURLToPath } from "node:url" const DEFAULT_BASE_URL = process.env.GLANCE_BASE_URL?.trim() || "https://glance.sh" @@ -740,7 +741,13 @@ function isMainModule() { return false } - return import.meta.url === pathToFileURL(process.argv[1]).href + try { + const invokedPath = realpathSync(process.argv[1]) + const currentPath = realpathSync(fileURLToPath(import.meta.url)) + return invokedPath === currentPath + } catch { + return false + } } if (isMainModule()) {