@arkheia/mcp-server 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +34 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -91,9 +91,43 @@ function handleError(toolName, e) {
91
91
  // ---------------------------------------------------------------------------
92
92
  // Main
93
93
  // ---------------------------------------------------------------------------
94
+ const CURRENT_VERSION = "0.1.7";
95
+ async function checkForUpdate() {
96
+ // Check once per day — skip if checked recently
97
+ const markerPath = path.join(os.homedir(), '.arkheia', '.update-check');
98
+ try {
99
+ if (fs.existsSync(markerPath)) {
100
+ const age = Date.now() - fs.statSync(markerPath).mtimeMs;
101
+ if (age < 24 * 60 * 60 * 1000)
102
+ return; // checked within 24h
103
+ }
104
+ }
105
+ catch { }
106
+ try {
107
+ const resp = await fetch('https://registry.npmjs.org/@arkheia/mcp-server/latest', {
108
+ signal: AbortSignal.timeout(5000),
109
+ });
110
+ if (resp.ok) {
111
+ const data = await resp.json();
112
+ if (data.version && data.version !== CURRENT_VERSION) {
113
+ process.stderr.write(`[arkheia] Update available: ${CURRENT_VERSION} → ${data.version}\n` +
114
+ `[arkheia] Run: npm update -g @arkheia/mcp-server\n`);
115
+ }
116
+ }
117
+ // Touch marker regardless of result
118
+ const dir = path.dirname(markerPath);
119
+ if (!fs.existsSync(dir))
120
+ fs.mkdirSync(dir, { recursive: true });
121
+ fs.writeFileSync(markerPath, new Date().toISOString());
122
+ }
123
+ catch {
124
+ // Network failure — silently skip, don't block startup
125
+ }
126
+ }
94
127
  async function main() {
95
128
  loadConfig();
96
129
  checkCRLF();
130
+ checkForUpdate(); // fire-and-forget, don't await — never blocks startup
97
131
  const ARKHEIA_PROXY_URL = process.env.ARKHEIA_PROXY_URL || "http://localhost:8098";
98
132
  const ARKHEIA_HOSTED_URL = process.env.ARKHEIA_HOSTED_URL || "https://arkheia-proxy-production.up.railway.app";
99
133
  const ARKHEIA_API_KEY = process.env.ARKHEIA_API_KEY;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkheia/mcp-server",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Arkheia MCP Server — Fabrication detection for AI agents. Know when your AI is making things up.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {