@anweat/dsh-browser 0.1.6 → 0.1.8

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 (55) hide show
  1. package/README.md +306 -229
  2. package/cordis.patch.yml +26 -15
  3. package/lib/approval-policy.d.ts +2 -1
  4. package/lib/approval-policy.js +46 -1
  5. package/lib/approval-policy.js.map +1 -1
  6. package/lib/browser-service.d.ts +69 -19
  7. package/lib/browser-service.js +231 -64
  8. package/lib/browser-service.js.map +1 -1
  9. package/lib/client/SettingsCard.d.ts +2 -0
  10. package/lib/client/SettingsCard.js +21 -0
  11. package/lib/client/SettingsCard.js.map +1 -0
  12. package/lib/client/context-types.d.ts +8 -0
  13. package/lib/client/context-types.js +2 -0
  14. package/lib/client/context-types.js.map +1 -0
  15. package/lib/client/form.d.ts +62 -0
  16. package/lib/client/form.js +198 -0
  17. package/lib/client/form.js.map +1 -0
  18. package/lib/client/index.d.ts +16 -0
  19. package/lib/client/index.js +18 -0
  20. package/lib/client/index.js.map +1 -0
  21. package/lib/client/locales.d.ts +58 -0
  22. package/lib/client/locales.js +55 -0
  23. package/lib/client/locales.js.map +1 -0
  24. package/lib/client/settings-namespace.d.ts +2 -0
  25. package/lib/client/settings-namespace.js +3 -0
  26. package/lib/client/settings-namespace.js.map +1 -0
  27. package/lib/client/styles.d.ts +37 -0
  28. package/lib/client/styles.js +25 -0
  29. package/lib/client/styles.js.map +1 -0
  30. package/lib/client.js +753 -0
  31. package/lib/client.js.map +1 -0
  32. package/lib/config.d.ts +14 -0
  33. package/lib/config.js +25 -0
  34. package/lib/config.js.map +1 -1
  35. package/lib/deps.d.ts +7 -1
  36. package/lib/deps.js +22 -6
  37. package/lib/deps.js.map +1 -1
  38. package/lib/freedom.d.ts +8 -0
  39. package/lib/freedom.js +52 -0
  40. package/lib/freedom.js.map +1 -0
  41. package/lib/index.d.ts +2 -0
  42. package/lib/index.js +19 -6
  43. package/lib/index.js.map +1 -1
  44. package/lib/opencli-catalog.d.ts +21 -0
  45. package/lib/opencli-catalog.js +49 -0
  46. package/lib/opencli-catalog.js.map +1 -0
  47. package/lib/scripts.js +27 -27
  48. package/lib/tools.js +111 -22
  49. package/lib/tools.js.map +1 -1
  50. package/lib/usage-policy.d.ts +49 -0
  51. package/lib/usage-policy.js +171 -0
  52. package/lib/usage-policy.js.map +1 -0
  53. package/package.json +133 -78
  54. package/scripts/check-client-bundle.mjs +15 -0
  55. package/scripts/clean-lib.mjs +3 -0
package/package.json CHANGED
@@ -1,78 +1,133 @@
1
- {
2
- "name": "@anweat/dsh-browser",
3
- "version": "0.1.6",
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
- "./cordis.patch.yml": "./cordis.patch.yml",
15
- "./package.json": "./package.json"
16
- },
17
- "files": [
18
- "lib",
19
- "cordis.patch.yml",
20
- "README.md",
21
- "scripts",
22
- "LICENSE"
23
- ],
24
- "engines": {
25
- "node": "^22.19 || >=24"
26
- },
27
- "scripts": {
28
- "build": "tsc -p tsconfig.json",
29
- "test": "node --test --experimental-transform-types test/*.test.ts",
30
- "prepublishOnly": "npm run build",
31
- "prepare": "npm run build"
32
- },
33
- "peerDependencies": {
34
- "@deepseek-ai/cordis": "^4.0.1",
35
- "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
36
- "@deepseek-ai/schemastery": "^3.18.1"
37
- },
38
- "peerDependenciesMeta": {
39
- "@deepseek-ai/cordis": {
40
- "optional": true
41
- },
42
- "@deepseek-ai/dsh-tools": {
43
- "optional": true
44
- },
45
- "@deepseek-ai/schemastery": {
46
- "optional": true
47
- }
48
- },
49
- "dependencies": {
50
- "@jackwener/opencli": "^1.8.6",
51
- "playwright": "^1.60.0"
52
- },
53
- "devDependencies": {
54
- "@deepseek-ai/cordis": "^4.0.1",
55
- "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
56
- "@deepseek-ai/schemastery": "^3.18.1",
57
- "typescript": "^5.6.0",
58
- "@types/node": "^22.0.0"
59
- },
60
- "dsh": {
61
- "bundle": {
62
- "patch": "./cordis.patch.yml"
63
- }
64
- },
65
- "packageManager": "pnpm@11.7.0",
66
- "repository": {
67
- "type": "git",
68
- "url": "git+https://github.com/anweat/dsh-browser.git"
69
- },
70
- "keywords": [
71
- "dsh",
72
- "deepseek-harness",
73
- "plugin",
74
- "browser",
75
- "playwright",
76
- "opencli"
77
- ]
78
- }
1
+ {
2
+ "name": "@anweat/dsh-browser",
3
+ "version": "0.1.8",
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.1",
33
+ "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
34
+ "@deepseek-ai/dsh-client-connection": "^0.1.1-rc.2",
35
+ "@deepseek-ai/dsh-client-locale": "^0.1.1-rc.2",
36
+ "@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.2",
37
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.1-rc.2",
38
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.1-rc.2",
39
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.2",
40
+ "@deepseek-ai/dsh-settings": "^0.1.1-rc.2",
41
+ "@deepseek-ai/schemastery": "^3.18.1"
42
+ },
43
+ "peerDependenciesMeta": {
44
+ "@deepseek-ai/cordis": {
45
+ "optional": true
46
+ },
47
+ "@deepseek-ai/dsh-tools": {
48
+ "optional": true
49
+ },
50
+ "@deepseek-ai/dsh-client-connection": {
51
+ "optional": true
52
+ },
53
+ "@deepseek-ai/dsh-client-locale": {
54
+ "optional": true
55
+ },
56
+ "@deepseek-ai/dsh-client-runtime": {
57
+ "optional": true
58
+ },
59
+ "@deepseek-ai/dsh-client-ui-settings": {
60
+ "optional": true
61
+ },
62
+ "@deepseek-ai/dsh-client-ui-settings-plugins": {
63
+ "optional": true
64
+ },
65
+ "@deepseek-ai/dsh-client-ui-slots": {
66
+ "optional": true
67
+ },
68
+ "@deepseek-ai/dsh-settings": {
69
+ "optional": true
70
+ },
71
+ "@deepseek-ai/schemastery": {
72
+ "optional": true
73
+ }
74
+ },
75
+ "dependencies": {
76
+ "@jackwener/opencli": "^1.8.6",
77
+ "patchright": "^1.62.1",
78
+ "playwright": "^1.60.0"
79
+ },
80
+ "devDependencies": {
81
+ "@deepseek-ai/cordis": "^4.0.1",
82
+ "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
83
+ "@deepseek-ai/dsh-client-connection": "^0.1.1-rc.2",
84
+ "@deepseek-ai/dsh-client-locale": "^0.1.1-rc.2",
85
+ "@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.2",
86
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.1-rc.2",
87
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.1-rc.2",
88
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.2",
89
+ "@deepseek-ai/dsh-settings": "^0.1.1-rc.2",
90
+ "@deepseek-ai/schemastery": "^3.18.1",
91
+ "@types/react": "~18.3.1",
92
+ "@types/react-dom": "~18.3.1",
93
+ "react": "^18.2.0",
94
+ "react-dom": "18.2.0",
95
+ "tsdown": "^0.22.2",
96
+ "typescript": "^5.6.0",
97
+ "@types/node": "^22.0.0"
98
+ },
99
+ "dsh": {
100
+ "client": {
101
+ "inject": [
102
+ "@deepseek-ai/dsh-client-connection",
103
+ "@deepseek-ai/dsh-client-locale",
104
+ "@deepseek-ai/dsh-client-runtime",
105
+ "@deepseek-ai/dsh-client-ui-settings",
106
+ "@deepseek-ai/dsh-client-ui-settings-plugins"
107
+ ],
108
+ "platform": "web"
109
+ },
110
+ "bundle": {
111
+ "patch": "./cordis.patch.yml"
112
+ }
113
+ },
114
+ "repository": {
115
+ "type": "git",
116
+ "url": "git+https://github.com/anweat/dsh-browser.git"
117
+ },
118
+ "keywords": [
119
+ "dsh",
120
+ "deepseek-harness",
121
+ "plugin",
122
+ "browser",
123
+ "playwright",
124
+ "opencli"
125
+ ],
126
+ "scripts": {
127
+ "build": "node scripts/clean-lib.mjs && tsc -p tsconfig.json && tsdown",
128
+ "typecheck": "tsc -p tsconfig.json --noEmit",
129
+ "test": "node --test --experimental-transform-types test/*.test.ts",
130
+ "test:client-bundle": "node scripts/check-client-bundle.mjs",
131
+ "verify": "pnpm run typecheck && pnpm run build && pnpm test && pnpm run test:client-bundle"
132
+ }
133
+ }
@@ -0,0 +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-runtime/client', '@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)`)
@@ -0,0 +1,3 @@
1
+ import { rm } from 'node:fs/promises'
2
+
3
+ await rm(new URL('../lib', import.meta.url), { recursive: true, force: true })