@anweat/dsh-browser 0.1.13-alpha.1 → 0.1.14-alpha.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/LICENSE +21 -21
- package/README.md +393 -382
- package/cordis.patch.yml +26 -26
- package/lib/approval-policy.js +1 -1
- package/lib/approval-policy.js.map +1 -1
- package/lib/browser-service.d.ts +90 -5
- package/lib/browser-service.js +410 -100
- package/lib/browser-service.js.map +1 -1
- package/lib/client/styles.js +12 -12
- package/lib/freedom.d.ts +1 -1
- package/lib/freedom.js +9 -0
- package/lib/freedom.js.map +1 -1
- package/lib/index.js +8 -14
- package/lib/index.js.map +1 -1
- package/lib/scripts.js +27 -27
- package/lib/tools.js +188 -28
- package/lib/tools.js.map +1 -1
- package/package.json +147 -150
- package/scripts/check-client-bundle.mjs +15 -15
- package/scripts/clean-lib.mjs +3 -3
- package/scripts/install-browser.mjs +18 -18
package/package.json
CHANGED
|
@@ -1,150 +1,147 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@anweat/dsh-browser",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Self-contained browser runtime plugin for DeepSeek Harness (scoped @anweat) — bundles Playwright (chromium) and OpenCLI as plugin-local dependencies (with global-reuse fallback), exposes a `browser` service and interactive browser tools.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "lib/index.js",
|
|
8
|
-
"types": "lib/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./lib/index.d.ts",
|
|
12
|
-
"default": "./lib/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./client": {
|
|
15
|
-
"types": "./lib/client/index.d.ts",
|
|
16
|
-
"default": "./lib/client.js"
|
|
17
|
-
},
|
|
18
|
-
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
19
|
-
"./package.json": "./package.json"
|
|
20
|
-
},
|
|
21
|
-
"files": [
|
|
22
|
-
"lib",
|
|
23
|
-
"cordis.patch.yml",
|
|
24
|
-
"README.md",
|
|
25
|
-
"scripts",
|
|
26
|
-
"LICENSE"
|
|
27
|
-
],
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": "^22.19 || >=24"
|
|
30
|
-
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"@deepseek-ai/
|
|
42
|
-
"@deepseek-ai/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"@deepseek-ai/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@deepseek-ai/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"@deepseek-ai/
|
|
55
|
-
"optional": true
|
|
56
|
-
},
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"optional": true
|
|
59
|
-
},
|
|
60
|
-
"@deepseek-ai/dsh-client-
|
|
61
|
-
"optional": true
|
|
62
|
-
},
|
|
63
|
-
"@deepseek-ai/dsh-client-
|
|
64
|
-
"optional": true
|
|
65
|
-
},
|
|
66
|
-
"@deepseek-ai/dsh-client-
|
|
67
|
-
"optional": true
|
|
68
|
-
},
|
|
69
|
-
"@deepseek-ai/dsh-client-ui-
|
|
70
|
-
"optional": true
|
|
71
|
-
},
|
|
72
|
-
"@deepseek-ai/dsh-
|
|
73
|
-
"optional": true
|
|
74
|
-
},
|
|
75
|
-
"@deepseek-ai/
|
|
76
|
-
"optional": true
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"@
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"@deepseek-ai/
|
|
95
|
-
"@deepseek-ai/dsh-
|
|
96
|
-
"@deepseek-ai/dsh-
|
|
97
|
-
"@deepseek-ai/dsh-
|
|
98
|
-
"@deepseek-ai/dsh-
|
|
99
|
-
"@deepseek-ai/dsh-
|
|
100
|
-
"@deepseek-ai/dsh-
|
|
101
|
-
"@deepseek-ai/dsh-
|
|
102
|
-
"@deepseek-ai/dsh-
|
|
103
|
-
"@deepseek-ai/dsh-
|
|
104
|
-
"@deepseek-ai/
|
|
105
|
-
"@
|
|
106
|
-
"@
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"@
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"opencli"
|
|
149
|
-
]
|
|
150
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@anweat/dsh-browser",
|
|
3
|
+
"version": "0.1.14-alpha.2",
|
|
4
|
+
"description": "Self-contained browser runtime plugin for DeepSeek Harness (scoped @anweat) — bundles Playwright (chromium) and OpenCLI as plugin-local dependencies (with global-reuse fallback), exposes a `browser` service and interactive browser tools.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"types": "lib/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"default": "./lib/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./client": {
|
|
15
|
+
"types": "./lib/client/index.d.ts",
|
|
16
|
+
"default": "./lib/client.js"
|
|
17
|
+
},
|
|
18
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"lib",
|
|
23
|
+
"cordis.patch.yml",
|
|
24
|
+
"README.md",
|
|
25
|
+
"scripts",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": "^22.19 || >=24"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@deepseek-ai/cordis": "4.0.2",
|
|
33
|
+
"@deepseek-ai/dsh-tools": "0.1.5-alpha.1",
|
|
34
|
+
"@deepseek-ai/dsh-client-connection": "0.1.5-alpha.1",
|
|
35
|
+
"@deepseek-ai/dsh-client-locale": "0.1.5-alpha.1",
|
|
36
|
+
"@deepseek-ai/dsh-client-store": "0.1.5-alpha.1",
|
|
37
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.1.5-alpha.1",
|
|
38
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.5-alpha.1",
|
|
39
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.5-alpha.1",
|
|
40
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.5-alpha.1",
|
|
41
|
+
"@deepseek-ai/dsh-settings": "0.1.5-alpha.1",
|
|
42
|
+
"@deepseek-ai/schemastery": "3.18.2"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"@deepseek-ai/cordis": {
|
|
46
|
+
"optional": true
|
|
47
|
+
},
|
|
48
|
+
"@deepseek-ai/dsh-tools": {
|
|
49
|
+
"optional": true
|
|
50
|
+
},
|
|
51
|
+
"@deepseek-ai/dsh-client-connection": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"@deepseek-ai/dsh-client-locale": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"@deepseek-ai/dsh-client-store": {
|
|
58
|
+
"optional": true
|
|
59
|
+
},
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-renderer": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-settings": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-slots": {
|
|
70
|
+
"optional": true
|
|
71
|
+
},
|
|
72
|
+
"@deepseek-ai/dsh-settings": {
|
|
73
|
+
"optional": true
|
|
74
|
+
},
|
|
75
|
+
"@deepseek-ai/schemastery": {
|
|
76
|
+
"optional": true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@jackwener/opencli": "^1.8.6",
|
|
81
|
+
"patchright": "^1.62.1",
|
|
82
|
+
"playwright": "^1.60.0"
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@deepseek-ai/cordis": "4.0.2",
|
|
86
|
+
"@deepseek-ai/dsh-agent": "0.1.5-alpha.1",
|
|
87
|
+
"@deepseek-ai/dsh-code-runtime": "0.1.5-alpha.1",
|
|
88
|
+
"@deepseek-ai/dsh-invariants": "0.1.5-alpha.1",
|
|
89
|
+
"@deepseek-ai/dsh-llm": "0.1.5-alpha.1",
|
|
90
|
+
"@deepseek-ai/dsh-scope": "0.1.5-alpha.1",
|
|
91
|
+
"@deepseek-ai/dsh-session": "0.1.5-alpha.1",
|
|
92
|
+
"@deepseek-ai/dsh-session-projection": "0.1.5-alpha.1",
|
|
93
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.5-alpha.1",
|
|
94
|
+
"@deepseek-ai/dsh-user-approval": "0.1.5-alpha.1",
|
|
95
|
+
"@deepseek-ai/dsh-tools": "0.1.5-alpha.1",
|
|
96
|
+
"@deepseek-ai/dsh-client-connection": "0.1.5-alpha.1",
|
|
97
|
+
"@deepseek-ai/dsh-client-locale": "0.1.5-alpha.1",
|
|
98
|
+
"@deepseek-ai/dsh-client-store": "0.1.5-alpha.1",
|
|
99
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.1.5-alpha.1",
|
|
100
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.5-alpha.1",
|
|
101
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.5-alpha.1",
|
|
102
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.5-alpha.1",
|
|
103
|
+
"@deepseek-ai/dsh-settings": "0.1.5-alpha.1",
|
|
104
|
+
"@deepseek-ai/schemastery": "3.18.2",
|
|
105
|
+
"@types/react": "~18.3.1",
|
|
106
|
+
"@types/react-dom": "~18.3.1",
|
|
107
|
+
"react": "^18.2.0",
|
|
108
|
+
"react-dom": "18.2.0",
|
|
109
|
+
"tsdown": "^0.22.2",
|
|
110
|
+
"typescript": "^5.6.0",
|
|
111
|
+
"@types/node": "^22.0.0"
|
|
112
|
+
},
|
|
113
|
+
"dsh": {
|
|
114
|
+
"client": {
|
|
115
|
+
"inject": [
|
|
116
|
+
"@deepseek-ai/dsh-client-connection",
|
|
117
|
+
"@deepseek-ai/dsh-client-locale",
|
|
118
|
+
"@deepseek-ai/dsh-client-ui-renderer",
|
|
119
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
120
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins"
|
|
121
|
+
],
|
|
122
|
+
"platform": "web"
|
|
123
|
+
},
|
|
124
|
+
"bundle": {
|
|
125
|
+
"patch": "./cordis.patch.yml"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"repository": {
|
|
129
|
+
"type": "git",
|
|
130
|
+
"url": "git+https://github.com/anweat/dsh-browser.git"
|
|
131
|
+
},
|
|
132
|
+
"keywords": [
|
|
133
|
+
"dsh",
|
|
134
|
+
"deepseek-harness",
|
|
135
|
+
"plugin",
|
|
136
|
+
"browser",
|
|
137
|
+
"playwright",
|
|
138
|
+
"opencli"
|
|
139
|
+
],
|
|
140
|
+
"scripts": {
|
|
141
|
+
"build": "node scripts/clean-lib.mjs && tsc -p tsconfig.json && tsdown",
|
|
142
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
143
|
+
"test": "node --test --experimental-transform-types test/*.test.ts",
|
|
144
|
+
"test:client-bundle": "node scripts/check-client-bundle.mjs",
|
|
145
|
+
"verify": "pnpm run typecheck && pnpm run build && pnpm test && pnpm run test:client-bundle"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import assert from 'node:assert/strict'
|
|
2
|
-
import { readFile } from 'node:fs/promises'
|
|
3
|
-
|
|
4
|
-
const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
|
|
5
|
-
const sourceMap = JSON.parse(await readFile(new URL('../lib/client.js.map', import.meta.url), 'utf8'))
|
|
6
|
-
const imports = [...source.matchAll(/\brequire\((['"])([^'"]+)\1\)/g)].map(match => match[2])
|
|
7
|
-
const allowed = new Set(['react', 'react/jsx-runtime', 'react-dom', 'react-dom/client', '@deepseek-ai/cordis', '@deepseek-ai/dsh-client-store', '@deepseek-ai/dsh-client-ui-slots'])
|
|
8
|
-
const forbidden = [...new Set(imports.filter(id => !allowed.has(id)))].sort()
|
|
9
|
-
|
|
10
|
-
assert.deepEqual(forbidden, [], `client bundle contains unavailable imports: ${forbidden.join(', ')}`)
|
|
11
|
-
assert.match(source, /settings\.plugin\.item/)
|
|
12
|
-
assert.match(source, /dsh-browser/)
|
|
13
|
-
assert.match(source, /Browser automation/)
|
|
14
|
-
assert.equal('sourcesContent' in sourceMap, false, 'client source map must exclude source contents')
|
|
15
|
-
console.log(`client bundle check passed (${[...new Set(imports)].length} module-table imports)`)
|
|
1
|
+
import assert from 'node:assert/strict'
|
|
2
|
+
import { readFile } from 'node:fs/promises'
|
|
3
|
+
|
|
4
|
+
const source = await readFile(new URL('../lib/client.js', import.meta.url), 'utf8')
|
|
5
|
+
const sourceMap = JSON.parse(await readFile(new URL('../lib/client.js.map', import.meta.url), 'utf8'))
|
|
6
|
+
const imports = [...source.matchAll(/\brequire\((['"])([^'"]+)\1\)/g)].map(match => match[2])
|
|
7
|
+
const allowed = new Set(['react', 'react/jsx-runtime', 'react-dom', 'react-dom/client', '@deepseek-ai/cordis', '@deepseek-ai/dsh-client-store', '@deepseek-ai/dsh-client-ui-slots'])
|
|
8
|
+
const forbidden = [...new Set(imports.filter(id => !allowed.has(id)))].sort()
|
|
9
|
+
|
|
10
|
+
assert.deepEqual(forbidden, [], `client bundle contains unavailable imports: ${forbidden.join(', ')}`)
|
|
11
|
+
assert.match(source, /settings\.plugin\.item/)
|
|
12
|
+
assert.match(source, /dsh-browser/)
|
|
13
|
+
assert.match(source, /Browser automation/)
|
|
14
|
+
assert.equal('sourcesContent' in sourceMap, false, 'client source map must exclude source contents')
|
|
15
|
+
console.log(`client bundle check passed (${[...new Set(imports)].length} module-table imports)`)
|
package/scripts/clean-lib.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { rm } from 'node:fs/promises'
|
|
2
|
-
|
|
3
|
-
await rm(new URL('../lib', import.meta.url), { recursive: true, force: true })
|
|
1
|
+
import { rm } from 'node:fs/promises'
|
|
2
|
+
|
|
3
|
+
await rm(new URL('../lib', import.meta.url), { recursive: true, force: true })
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Installs the Playwright browser(s) used by the dsh-browser plugin, using the
|
|
3
|
-
// playwright CLI from THIS plugin's node_modules (not the global install).
|
|
4
|
-
// Usage: node scripts/install-browser.mjs [chromium|msedge|...] (default chromium)
|
|
5
|
-
import { createRequire } from 'node:module'
|
|
6
|
-
import { fileURLToPath } from 'node:url'
|
|
7
|
-
import { spawnSync } from 'node:child_process'
|
|
8
|
-
import path from 'node:path'
|
|
9
|
-
|
|
10
|
-
const root = fileURLToPath(new URL('..', import.meta.url))
|
|
11
|
-
const req = createRequire(path.join(root, 'package.json'))
|
|
12
|
-
const cli = path.join(path.dirname(req.resolve('playwright/package.json')), 'cli.js')
|
|
13
|
-
|
|
14
|
-
const channels = process.argv.slice(2)
|
|
15
|
-
const targets = channels.length ? channels : ['chromium']
|
|
16
|
-
console.log('[dsh-browser] installing playwright browsers:', targets.join(', '))
|
|
17
|
-
const r = spawnSync(process.execPath, [cli, 'install', ...targets], { stdio: 'inherit', cwd: root })
|
|
18
|
-
process.exit(r.status ?? 1)
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Installs the Playwright browser(s) used by the dsh-browser plugin, using the
|
|
3
|
+
// playwright CLI from THIS plugin's node_modules (not the global install).
|
|
4
|
+
// Usage: node scripts/install-browser.mjs [chromium|msedge|...] (default chromium)
|
|
5
|
+
import { createRequire } from 'node:module'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
import { spawnSync } from 'node:child_process'
|
|
8
|
+
import path from 'node:path'
|
|
9
|
+
|
|
10
|
+
const root = fileURLToPath(new URL('..', import.meta.url))
|
|
11
|
+
const req = createRequire(path.join(root, 'package.json'))
|
|
12
|
+
const cli = path.join(path.dirname(req.resolve('playwright/package.json')), 'cli.js')
|
|
13
|
+
|
|
14
|
+
const channels = process.argv.slice(2)
|
|
15
|
+
const targets = channels.length ? channels : ['chromium']
|
|
16
|
+
console.log('[dsh-browser] installing playwright browsers:', targets.join(', '))
|
|
17
|
+
const r = spawnSync(process.execPath, [cli, 'install', ...targets], { stdio: 'inherit', cwd: root })
|
|
18
|
+
process.exit(r.status ?? 1)
|