hivecode-mcp 0.14.0 → 0.14.1

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.
package/hive-mcp-http.js CHANGED
@@ -26,6 +26,9 @@ import crypto from 'crypto'
26
26
  import { startSync, parseLink } from './sync.js'
27
27
  import { attachRateLimit } from './limits.js'
28
28
  import { makeSlackActorCheck, formatSlackSender, slackPost } from './hive-slack.js'
29
+ import { realpathSync as __hiveRealpath } from 'fs'
30
+ import { resolve as __hiveResolve } from 'path'
31
+ import { fileURLToPath as __hiveFileURLToPath } from 'url'
29
32
 
30
33
  import { VERSION } from "./hive-version.js"
31
34
  export { VERSION }
@@ -575,6 +578,14 @@ export async function main(argv = process.argv.slice(2), {
575
578
  })
576
579
  }
577
580
 
578
- if (process.argv[1] && import.meta.url === `file:///${process.argv[1].replace(/\\/g, '/')}`) {
581
+ // Run directly (node <file>, or through an npx / node_modules/.bin symlink)? Compared by real path:
582
+ // the old `file:///${argv[1]}` test built "file:////..." on macOS and Linux, never matched, and the
583
+ // process exited 0 having done nothing.
584
+ function __hiveIsEntry() {
585
+ if (!process.argv[1]) return false
586
+ const me = __hiveFileURLToPath(import.meta.url)
587
+ try { return __hiveRealpath(process.argv[1]) === __hiveRealpath(me) } catch { return __hiveResolve(process.argv[1]) === __hiveResolve(me) }
588
+ }
589
+ if (__hiveIsEntry()) {
579
590
  main().then((code) => { if (code !== 0) process.exit(code) })
580
591
  }