bladebro 4.2.4 → 4.4.0

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 CHANGED
@@ -14,7 +14,71 @@ Or use without installing:
14
14
  npx bladebro mcp
15
15
  ```
16
16
 
17
- ## Two ways to use Bladebro
17
+ ### DeepSeek Harness (DSH)
18
+
19
+ Add Bladebro as a native plugin in the Web UI's **Plugins** page, or run:
20
+
21
+ ```bash
22
+ dsh plugin --profile web add bladebro
23
+ ```
24
+
25
+ Restart the profile and start a new chat. Desktop users can install `bladebro`
26
+ from the same **Plugins** page. For terminal setup, enable Desktop's **Manage dsh
27
+ Command**, fully quit the app, then use its bundled command:
28
+
29
+ ```bash
30
+ dsh plugin --profile desktop add bladebro
31
+ ```
32
+
33
+ Use Desktop's command for its profile; the npm DSH CLI cannot manage that
34
+ app-owned profile. Open Desktop again after installation.
35
+
36
+ DSH discovers the five tools as `mcp__bladebro__act`, `see`, `state`, `run` and
37
+ `vision` (each with the same prefix). Schemas and descriptions come from the
38
+ binary; DSH handles permissions, image attachments, reconnection and cleanup
39
+ through its native MCP bridge. DSH may also expose its own generic MCP resource
40
+ helpers and choose PTC presentation. No API key, separate MCP configuration, global
41
+ Bladebro install or extra plugin package is needed. Chrome/Chromium must be
42
+ installed on the machine running the DSH host. A remotely hosted Web UI controls
43
+ that host's browser, rather than the device viewing the UI.
44
+
45
+ Disable/re-enable the **Bladebro** bundle in Plugins, or remove it with
46
+ `dsh plugin --profile web remove bladebro` (use `desktop` with Desktop's command).
47
+ Restart the profile and begin a new chat after package changes. Other tools and
48
+ settings remain intact. Do not also configure a second MCP server named
49
+ `bladebro`; DSH refuses the duplicate namespace.
50
+
51
+ Updates use DSH's package manager: `dsh plugin --profile web update bladebro`,
52
+ or **Update** in Plugins. The plugin and native binary travel in the same
53
+ package, so ordinary Bladebro releases update both. Existing global/Pi installs
54
+ are separate. No background downloader or installation scripts run.
55
+
56
+ Advanced configuration belongs in the profile's `cordis.patch.yml`:
57
+
58
+ ```yaml
59
+ - id: bladebro
60
+ config:
61
+ # Optional absolute source-build/portable executable; package binary is default.
62
+ binaryPath: /absolute/path/to/bladebro
63
+ env:
64
+ CHROME_PATH: /absolute/path/to/chrome
65
+ BLADE_HOME: /absolute/path/to/private/browser-data
66
+ toolCallTimeoutMs: 180000
67
+ ```
68
+
69
+ Windows YAML paths can use forward slashes, such as `C:/Tools/bladebro.exe`.
70
+ The optional `cwd` and `reconnect` settings use DSH's native MCP configuration.
71
+ The default per-call budget is 180 seconds; raise it for longer `run` sequences.
72
+ Cancellation stops waiting, but an already-dispatched browser mutation may
73
+ finish: observe its destination before trying it again.
74
+
75
+ The npm CLI keeps its Node.js >=14 requirement; the DSH plugin uses the host's
76
+ Node.js requirement. Prebuilt binaries cover Linux x64/ARM64 (glibc >=2.28),
77
+ macOS Intel/Apple Silicon and Windows x64. Other targets need a source build and
78
+ `binaryPath`. See the official [DSH plugin commands](https://github.com/deepseek-ai/deepseek-harness/blob/master/apps/cli/reference/README.md#plugin-management)
79
+ and [Desktop command runtime](https://github.com/deepseek-ai/deepseek-harness/blob/master/apps/desktop/README.md#bundled-command-runtime).
80
+
81
+ ## MCP and CLI
18
82
 
19
83
  ### Option 1: MCP Server
20
84
 
package/bin.js CHANGED
@@ -2,50 +2,13 @@
2
2
  'use strict';
3
3
 
4
4
  const { spawnSync } = require('child_process');
5
- const { existsSync } = require('fs');
6
- const { dirname, join } = require('path');
5
+ const { resolveBinary } = require('./binary.cjs');
7
6
 
8
- // ── platform → npm package name mapping ──────────────────────────────
9
- const PLATFORM_MAP = {
10
- 'linux-x64': 'bladebro-linux-x64',
11
- 'linux-arm64': 'bladebro-linux-arm64',
12
- 'darwin-x64': 'bladebro-darwin-x64',
13
- 'darwin-arm64': 'bladebro-darwin-arm64',
14
- 'win32-x64': 'bladebro-windows-x64',
15
- };
16
-
17
- const key = process.platform + '-' + process.arch;
18
- const pkgName = PLATFORM_MAP[key];
19
-
20
- if (!pkgName) {
21
- process.stderr.write('bladebro: no prebuilt binary for ' + key + '\n');
22
- process.stderr.write('\nSupported platforms:\n');
23
- process.stderr.write(' linux-x64 Linux x86_64\n');
24
- process.stderr.write(' linux-arm64 Linux ARM64 (aarch64)\n');
25
- process.stderr.write(' darwin-arm64 macOS Apple Silicon\n');
26
- process.stderr.write(' darwin-x64 macOS Intel\n');
27
- process.stderr.write(' win32-x64 Windows x86_64\n');
28
- process.stderr.write('\nBuild from source: https://github.com/dondai44423/bladebro\n');
29
- process.exit(1);
30
- }
31
-
32
- // ── resolve the binary path from the platform package ─────────────────
33
7
  let binPath;
34
8
  try {
35
- const pkgJsonPath = require.resolve(pkgName + '/package.json');
36
- const pkgJson = require(pkgJsonPath);
37
- const binName = pkgJson.main || 'bladebro';
38
- binPath = join(dirname(pkgJsonPath), binName);
39
- } catch (e) {
40
- process.stderr.write('bladebro: platform package "' + pkgName + '" not installed\n');
41
- process.stderr.write('Run: npm install bladebro\n');
42
- process.exit(1);
43
- }
44
-
45
- // ── verify the binary exists ──────────────────────────────────────────
46
- if (!existsSync(binPath)) {
47
- process.stderr.write('bladebro: binary not found at ' + binPath + '\n');
48
- process.stderr.write('Reinstall: npm install bladebro\n');
9
+ binPath = resolveBinary();
10
+ } catch (error) {
11
+ process.stderr.write(error.message + '\n');
49
12
  process.exit(1);
50
13
  }
51
14
 
package/binary.cjs ADDED
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ const { accessSync, constants, statSync } = require('fs');
4
+ const { dirname, isAbsolute, join } = require('path');
5
+
6
+ const PLATFORMS = {
7
+ 'linux-x64': 'bladebro-linux-x64',
8
+ 'linux-arm64': 'bladebro-linux-arm64',
9
+ 'darwin-x64': 'bladebro-darwin-x64',
10
+ 'darwin-arm64': 'bladebro-darwin-arm64',
11
+ 'win32-x64': 'bladebro-windows-x64',
12
+ };
13
+
14
+ // Resolve beside this package, never through a shell or a desktop app's PATH.
15
+ // Both the CLI launcher and DSH use the very same optional binary dependency.
16
+ function resolveBinary(override) {
17
+ let path = override;
18
+ if (path !== undefined && (typeof path !== 'string' || !isAbsolute(path) || path.includes('\0'))) {
19
+ throw new Error('bladebro: binaryPath must be an absolute executable path');
20
+ }
21
+ if (path === undefined) {
22
+ const key = `${process.platform}-${process.arch}`;
23
+ const pkg = PLATFORMS[key];
24
+ if (!pkg) throw new Error(`bladebro: no prebuilt binary for ${key}. Build from source: https://github.com/dondai44423/bladebro#from-source`);
25
+ try {
26
+ const manifest = require.resolve(`${pkg}/package.json`);
27
+ path = join(dirname(manifest), process.platform === 'win32' ? 'bladebro.exe' : 'bladebro');
28
+ } catch {
29
+ throw new Error(`bladebro: platform package "${pkg}" not installed. Reinstall bladebro with optional dependencies enabled.`);
30
+ }
31
+ }
32
+ try {
33
+ if (!statSync(path).isFile()) throw new Error('not a file');
34
+ accessSync(path, process.platform === 'win32' ? constants.F_OK : constants.X_OK);
35
+ } catch (error) {
36
+ throw new Error(`bladebro: cannot execute ${path}: ${error.message}. Reinstall bladebro or set binaryPath.`);
37
+ }
38
+ return path;
39
+ }
40
+
41
+ module.exports = { resolveBinary };
@@ -0,0 +1,4 @@
1
+ # A native DSH bundle: tools and lifecycle belong to the host's MCP bridge.
2
+ - insert:
3
+ - id: bladebro
4
+ name: ./dsh-plugin.mjs
package/dsh-plugin.mjs ADDED
@@ -0,0 +1,33 @@
1
+ import { resolveBinary } from './binary.cjs';
2
+
3
+ export const name = 'bladebro';
4
+ export const inject = ['tools'];
5
+
6
+ // DSH owns discovery, schemas, images, cancellation, reconnection and disposal.
7
+ // Import its bridge from the running host, so no private SDK copy can drift.
8
+ export async function apply(ctx, config = {}) {
9
+ if (!config || typeof config !== 'object' || Array.isArray(config)) {
10
+ throw new Error('bladebro: plugin config must be an object');
11
+ }
12
+ const { binaryPath, ...options } = config;
13
+ for (const key of Object.keys(options)) {
14
+ if (!['env', 'cwd', 'toolCallTimeoutMs', 'reconnect'].includes(key)) {
15
+ throw new Error(`bladebro: unknown plugin option ${JSON.stringify(key)}`);
16
+ }
17
+ }
18
+ if (options.toolCallTimeoutMs !== undefined &&
19
+ (!Number.isSafeInteger(options.toolCallTimeoutMs) || options.toolCallTimeoutMs < 1000 || options.toolCallTimeoutMs > 2147483647)) {
20
+ throw new Error('bladebro: toolCallTimeoutMs must be an integer from 1000 through 2147483647');
21
+ }
22
+ const command = resolveBinary(binaryPath);
23
+ const bridge = await import('@deepseek-ai/dsh-mcp-client');
24
+ await ctx.plugin(bridge, {
25
+ toolCallTimeoutMs: 180000,
26
+ ...options,
27
+ transport: 'stdio',
28
+ serverName: 'bladebro',
29
+ command,
30
+ args: ['mcp'],
31
+ failOnStartupError: true,
32
+ });
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bladebro",
3
- "version": "4.2.4",
3
+ "version": "4.4.0",
4
4
  "description": "Stealthy and efficient agentic browser driver for AI agents. Few tools, full control, real stealth, max token efficiency.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -23,7 +23,8 @@
23
23
  "stealth",
24
24
  "scraper",
25
25
  "puppeteer",
26
- "playwright"
26
+ "playwright",
27
+ "dsh-plugin"
27
28
  ],
28
29
  "pi": {
29
30
  "extensions": [
@@ -43,18 +44,26 @@
43
44
  },
44
45
  "files": [
45
46
  "bin.js",
47
+ "binary.cjs",
48
+ "dsh-plugin.mjs",
49
+ "cordis.patch.yml",
46
50
  "pi-extension.ts",
47
51
  "README.md",
48
52
  "LICENSE"
49
53
  ],
50
54
  "optionalDependencies": {
51
- "bladebro-linux-x64": "4.2.4",
52
- "bladebro-linux-arm64": "4.2.4",
53
- "bladebro-darwin-x64": "4.2.4",
54
- "bladebro-darwin-arm64": "4.2.4",
55
- "bladebro-windows-x64": "4.2.4"
55
+ "bladebro-linux-x64": "4.4.0",
56
+ "bladebro-linux-arm64": "4.4.0",
57
+ "bladebro-darwin-x64": "4.4.0",
58
+ "bladebro-darwin-arm64": "4.4.0",
59
+ "bladebro-windows-x64": "4.4.0"
56
60
  },
57
61
  "engines": {
58
62
  "node": ">=14"
63
+ },
64
+ "dsh": {
65
+ "bundle": {
66
+ "patch": "./cordis.patch.yml"
67
+ }
59
68
  }
60
69
  }