@opentiny/webmcp-cli 0.1.1-alpha.1 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/webmcp-cli",
3
- "version": "0.1.1-alpha.1",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "WebMCP CLI for AI Agents to interact with browser via Puppeteer",
6
6
  "repository": {
@@ -18,7 +18,8 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
- "README.md"
21
+ "README.md",
22
+ "scripts/ensure-pty-helper.mjs"
22
23
  ],
23
24
  "keywords": [
24
25
  "chrome",
@@ -28,24 +29,32 @@
28
29
  "license": "MIT",
29
30
  "author": "OpenTiny Team",
30
31
  "engines": {
31
- "node": ">=16"
32
+ "node": ">=18.19.0"
32
33
  },
33
34
  "publishConfig": {
34
35
  "access": "public"
35
36
  },
36
37
  "dependencies": {
37
- "@mcp-b/webmcp-polyfill": "^3.0.0",
38
+ "@mcp-b/webmcp-polyfill": "^5.1.0",
39
+ "@modelcontextprotocol/sdk": "~1.25.2",
38
40
  "@page-agent/page-controller": "^1.10.0",
39
41
  "clipboardy": "^5.3.1",
40
42
  "commander": "^11.1.0",
43
+ "execa": "^9.6.1",
41
44
  "json5": "^2.2.3",
42
45
  "marked": "^15.0.7",
43
46
  "picocolors": "^1.0.0",
44
47
  "puppeteer-core": "^22.0.0",
45
- "@opentiny/next-sdk": "^0.4.12-alpha.1"
48
+ "ws": "^8.18.0",
49
+ "zod": "^3.23.0",
50
+ "@opentiny/next-sdk": "^0.4.11"
51
+ },
52
+ "optionalDependencies": {
53
+ "node-pty": "^1.1.0"
46
54
  },
47
55
  "devDependencies": {
48
56
  "@types/node": "^20.0.0",
57
+ "@types/ws": "^8.5.10",
49
58
  "esbuild": "^0.25.0",
50
59
  "tsup": "^8.0.2",
51
60
  "tsx": "^4.0.0",
@@ -58,6 +67,7 @@
58
67
  "build": "tsup && pnpm run build:inject",
59
68
  "link:global": "npm install -g .",
60
69
  "start": "node dist/bin.js",
70
+ "postinstall": "node scripts/ensure-pty-helper.mjs",
61
71
  "test": "vitest run",
62
72
  "test:watch": "vitest",
63
73
  "test:browser": "vitest run --config vitest.e2e.config.ts"
@@ -0,0 +1,24 @@
1
+ import { chmodSync, existsSync, readdirSync } from 'node:fs'
2
+ import { createRequire } from 'node:module'
3
+ import path from 'node:path'
4
+
5
+ // node-pty 预编译包里的 spawn-helper 可能是 0644。安装时改成可执行,
6
+ // 避免之后用非 root 用户运行时无法 chmod。
7
+ try {
8
+ const pkgJson = createRequire(import.meta.url).resolve('node-pty/package.json')
9
+ const prebuilds = path.join(path.dirname(pkgJson), 'prebuilds')
10
+ if (!existsSync(prebuilds)) process.exit(0)
11
+ for (const entry of readdirSync(prebuilds, { withFileTypes: true })) {
12
+ if (!entry.isDirectory()) continue
13
+ const helper = path.join(prebuilds, entry.name, 'spawn-helper')
14
+ if (!existsSync(helper)) continue
15
+ chmodSync(helper, 0o755)
16
+ }
17
+ } catch (err) {
18
+ const code = err && typeof err === 'object' && 'code' in err ? String(err.code) : ''
19
+ if (code === 'EPERM' || code === 'EACCES') {
20
+ console.warn(
21
+ '[webmcp-cli] 无法把 node-pty spawn-helper 设为可执行。交互终端可能启动失败,system/bash 不受影响。'
22
+ )
23
+ }
24
+ }
package/dist/bin.d.cts DELETED
@@ -1 +0,0 @@
1
- #!/usr/bin/env node
package/dist/bin.d.ts DELETED
@@ -1 +0,0 @@
1
- #!/usr/bin/env node