Skip to content

Commit 79ce420

Browse files
authored
fix: support npx bin startup and bump codex package (#14)
1 parent 8f90d18 commit 79ce420

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

codex/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ codex mcp add glance -- npx -y @modemdev/glance-codex
2222
Optional: pin a specific version:
2323

2424
```bash
25-
codex mcp add glance -- npx -y @modemdev/glance-codex@0.1.0
25+
codex mcp add glance -- npx -y @modemdev/glance-codex@0.1.1
2626
```
2727

2828
Local development / manual install:
@@ -71,8 +71,8 @@ Prerequisite: configure `NPM_TOKEN` in the `glance-agent-plugins` repository wit
7171
3. Create and push a matching tag:
7272

7373
```bash
74-
git tag codex-v0.1.0
75-
git push origin codex-v0.1.0
74+
git tag codex-v0.1.1
75+
git push origin codex-v0.1.1
7676
```
7777

7878
The `Release codex package` workflow validates tag/version alignment, checks for already-published versions, runs `npm pack --dry-run`, and publishes with npm provenance.

codex/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modemdev/glance-codex",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "glance.sh MCP server package for Codex",
55
"license": "MIT",
66
"type": "module",

codex/servers/glance-mcp.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env node
22

3-
import { pathToFileURL } from "node:url"
3+
import { realpathSync } from "node:fs"
4+
import { fileURLToPath } from "node:url"
45

56
const DEFAULT_BASE_URL = process.env.GLANCE_BASE_URL?.trim() || "https://glance.sh"
67

@@ -740,7 +741,13 @@ function isMainModule() {
740741
return false
741742
}
742743

743-
return import.meta.url === pathToFileURL(process.argv[1]).href
744+
try {
745+
const invokedPath = realpathSync(process.argv[1])
746+
const currentPath = realpathSync(fileURLToPath(import.meta.url))
747+
return invokedPath === currentPath
748+
} catch {
749+
return false
750+
}
744751
}
745752

746753
if (isMainModule()) {

0 commit comments

Comments
 (0)