@mathew-macharia/black-mamba 1.0.1 → 1.0.2
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/README.md +1 -1
- package/docs/config.md +1 -1
- package/docs/install.md +1 -4
- package/package.json +1 -1
- package/src/config.js +3 -1
- package/src/deepseek/sha3_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Requires Node.js 18 or newer.
|
|
|
8
8
|
npm install -g @mathew-macharia/black-mamba
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Run `bm` in the folder that holds your data. That folder is where it reads `accounts
|
|
11
|
+
Run `bm` in the folder that holds your data. That folder is where it reads `accounts/` and `.env`. The proof-of-work file `sha3_wasm_bg.wasm` ships inside the package.
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
accounts/<name>/api-key.txt
|
package/docs/config.md
CHANGED
|
@@ -37,4 +37,4 @@ Set to `1` or `true` to enable the logger's debug method. Any other value leaves
|
|
|
37
37
|
|
|
38
38
|
DeepSeek web origin. Default `https://chat.deepseek.com`. Trailing slashes are removed. Login, chat create, the proof-of-work challenge, and completion are called under this origin at `/api/v0/users/current`, `/api/v0/chat_session/create`, `/api/v0/chat/create_pow_challenge`, and `/api/v0/chat/completion`.
|
|
39
39
|
|
|
40
|
-
The proof-of-work
|
|
40
|
+
The proof-of-work file `sha3_wasm_bg.wasm` lives in `src/deepseek/` and is published with `src`. If that installed file is missing, startup downloads it from DeepSeek's static file host and saves it there. That download URL does not follow `DEEPSEEK_BASE_URL`.
|
package/docs/install.md
CHANGED
|
@@ -6,12 +6,11 @@ Requires Node.js 18 or newer.
|
|
|
6
6
|
npm install -g @mathew-macharia/black-mamba
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
The command is `bm`. Run it in the directory that holds your data. That working directory (`process.cwd()`) is where `bm` reads `accounts
|
|
9
|
+
The command is `bm`. Run it in the directory that holds your data. That working directory (`process.cwd()`) is where `bm` reads `accounts/` and `.env`. The proof-of-work file `sha3_wasm_bg.wasm` is installed with the package.
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
<data-directory>/
|
|
13
13
|
.env optional
|
|
14
|
-
sha3_wasm_bg.wasm created on first start if missing
|
|
15
14
|
accounts/
|
|
16
15
|
<name>/
|
|
17
16
|
api-key.txt
|
|
@@ -36,8 +35,6 @@ From the data directory:
|
|
|
36
35
|
bm
|
|
37
36
|
```
|
|
38
37
|
|
|
39
|
-
If `sha3_wasm_bg.wasm` is missing from that directory, startup downloads it and saves it there. The terminal shows two `[WASM]` lines: one when the download starts, and one when the file is saved.
|
|
40
|
-
|
|
41
38
|
When the server is up, stdout has:
|
|
42
39
|
|
|
43
40
|
```
|
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import "dotenv/config";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
5
6
|
|
|
7
|
+
const SRC_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
6
8
|
const ROOT_DIR = process.cwd();
|
|
7
9
|
|
|
8
10
|
function readNumber(raw, fallback) {
|
|
@@ -38,7 +40,7 @@ export function loadConfig(env = process.env, rootDir = ROOT_DIR) {
|
|
|
38
40
|
chatCompletionUrl: `${deepseekBaseUrl}/api/v0/chat/completion`,
|
|
39
41
|
powTargetPath: "/api/v0/chat/completion",
|
|
40
42
|
wasmUrl: "https://fe-static.deepseek.com/chat/static/sha3_wasm_bg.7b9ca65ddd.wasm",
|
|
41
|
-
wasmPath: path.join(
|
|
43
|
+
wasmPath: path.join(SRC_DIR, "deepseek", "sha3_wasm_bg.wasm"),
|
|
42
44
|
healthCheckIntervalMs: 30 * 60 * 1000,
|
|
43
45
|
estimatedWafTtlMs: 4 * 24 * 60 * 60 * 1000,
|
|
44
46
|
estimatedSessionTtlMs: 30 * 24 * 60 * 60 * 1000,
|
|
Binary file
|