@mathew-macharia/black-mamba 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/index.js +12 -3
  2. package/package.json +4 -1
package/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file only wires the modules together; see src/ for the implementation.
4
4
 
5
5
  import http from "node:http";
6
- import path from "node:path";
6
+ import { realpathSync } from "node:fs";
7
7
  import { fileURLToPath } from "node:url";
8
8
 
9
9
  import { findAccount, listAccountDirs, loadAccounts } from "./src/accounts.js";
@@ -72,5 +72,14 @@ async function main() {
72
72
  }
73
73
  }
74
74
 
75
- const isMainModule = Boolean(process.argv[1]) && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
76
- if (isMainModule) main();
75
+ function isCliEntry() {
76
+ const entry = process.argv[1];
77
+ if (!entry) return false;
78
+ try {
79
+ return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));
80
+ } catch {
81
+ return false;
82
+ }
83
+ }
84
+
85
+ if (isCliEntry()) main();
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@mathew-macharia/black-mamba",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "OpenAI-compatible proxy that maps chat sessions onto DeepSeek web chat",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "bin": {
8
8
  "bm": "index.js"
9
9
  },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
10
13
  "engines": {
11
14
  "node": ">=18"
12
15
  },