dsh-browser-application 0.37.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/LICENSE +19 -0
- package/README.md +27 -0
- package/cordis.patch.yml +29 -0
- package/lib/index.js +3377 -0
- package/lib/invariant.js +26 -0
- package/lib/types/bridge-url.d.ts +27 -0
- package/lib/types/browser-context.d.ts +38 -0
- package/lib/types/dsh-gateway.d.ts +42 -0
- package/lib/types/event-generation.d.ts +56 -0
- package/lib/types/extension-sessions.d.ts +26 -0
- package/lib/types/host-api.d.ts +47 -0
- package/lib/types/image-relay.d.ts +43 -0
- package/lib/types/index.d.ts +158 -0
- package/lib/types/invariant.d.ts +16 -0
- package/lib/types/remote-host-api.d.ts +12 -0
- package/lib/types/server.d.ts +166 -0
- package/lib/types/session-deferral.d.ts +33 -0
- package/lib/types/session-history.d.ts +30 -0
- package/lib/types/session-purge.d.ts +55 -0
- package/lib/types/session-workspace.d.ts +37 -0
- package/lib/types/token.d.ts +57 -0
- package/lib/types/tools.d.ts +42 -0
- package/lib/types/vision-selfcheck.d.ts +18 -0
- package/lib/types/vision.d.ts +57 -0
- package/package.json +95 -0
- package/src/bridge-url.ts +57 -0
- package/src/browser-context.ts +102 -0
- package/src/dsh-gateway.ts +66 -0
- package/src/event-generation.ts +385 -0
- package/src/extension-sessions.ts +40 -0
- package/src/host-api.ts +64 -0
- package/src/image-relay.ts +118 -0
- package/src/index.ts +575 -0
- package/src/invariant.ts +33 -0
- package/src/remote-host-api.ts +397 -0
- package/src/server.ts +658 -0
- package/src/session-deferral.ts +296 -0
- package/src/session-history.ts +220 -0
- package/src/session-purge.ts +154 -0
- package/src/session-workspace.ts +147 -0
- package/src/token.ts +100 -0
- package/src/tools.ts +301 -0
- package/src/vision-selfcheck.ts +35 -0
- package/src/vision.ts +135 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yuxiang Lin
|
|
4
|
+
Copyright (c) 2026 youbaiyun
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
7
|
+
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
10
|
+
following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
13
|
+
portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
16
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
17
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
18
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
19
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# dsh-browser-application
|
|
2
|
+
|
|
3
|
+
The desktop half of the dsh browser extension. It mounts a token-authenticated
|
|
4
|
+
WebSocket bridge on the desktop app's own webserver, exposes the `browser_*` tools to
|
|
5
|
+
the model, and relays image recognition to the model the user configured.
|
|
6
|
+
|
|
7
|
+
Part of [dsh-browser-application](https://github.com/youbaiyun/dsh-browser-application).
|
|
8
|
+
Install it into a dsh profile rather than by hand:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
dsh plugin --profile web add dsh-browser-application
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Its settings page carries every knob — `visionBaseUrl`, `visionModel`,
|
|
15
|
+
`visionThinking`, `visionTimeoutMs`, the session workspace, the tool timeout — each
|
|
16
|
+
with a one-line description. The repository README has the table.
|
|
17
|
+
|
|
18
|
+
Three things worth knowing before you enable anything:
|
|
19
|
+
|
|
20
|
+
- **The bearer token** is generated on first boot and persisted at
|
|
21
|
+
`~/.dsh/ext-bridge-token` with mode 0600. `DSH_EXT_TOKEN` pins a fixed one.
|
|
22
|
+
- **Image recognition is off** until the user enables a tier in the extension's panel.
|
|
23
|
+
When it is on, the extension fetches the image the user asked about and this plugin
|
|
24
|
+
sends it to the model configured above.
|
|
25
|
+
- **The bridge answers on loopback only**, regardless of the token.
|
|
26
|
+
|
|
27
|
+
MIT. The upstream notice is preserved in `LICENSE`.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Browser bridge layer for the dsh `web` profile.
|
|
2
|
+
#
|
|
3
|
+
# `dsh plugin --profile web add` registers this package's `dsh.bundle`
|
|
4
|
+
# manifest, so both the repository launcher and `npx @deepseek-ai/dsh@0.2.0-rc.2 web`
|
|
5
|
+
# apply this patch without an extra command-line option.
|
|
6
|
+
#
|
|
7
|
+
# On first boot the plugin generates a bearer token and persists it at
|
|
8
|
+
# ~/.dsh/ext-bridge-token (chmod 0600). Local extensions discover the bridge
|
|
9
|
+
# without manual token entry. To pin a fixed token for a remote deployment,
|
|
10
|
+
# set DSH_EXT_TOKEN and reference it below.
|
|
11
|
+
# Extension-created sessions default to the ~/.dsh/browser-sessions workspace.
|
|
12
|
+
# Set DSH_BROWSER_SESSION_WORKSPACE to choose another path, or to an empty
|
|
13
|
+
# string to keep those sessions Ungrouped.
|
|
14
|
+
# Sessions materialize only on the first message (deferSessionCreate defaults
|
|
15
|
+
# to true): opening the side panel without chatting leaves no session behind.
|
|
16
|
+
#
|
|
17
|
+
# Security: the bridge path carries its own token auth and refuses privileged
|
|
18
|
+
# gateway methods (settings/credentials/open-*) for non-loopback remotes. Do
|
|
19
|
+
# not run `dsh web --host 0.0.0.0` on untrusted networks with this layer.
|
|
20
|
+
|
|
21
|
+
- insert:
|
|
22
|
+
- id: bridge-browser
|
|
23
|
+
name: 'dsh-browser-application'
|
|
24
|
+
config:
|
|
25
|
+
token: !!js process.env.DSH_EXT_TOKEN
|
|
26
|
+
sessionWorkspacePath: !!js process.env.DSH_BROWSER_SESSION_WORKSPACE
|
|
27
|
+
toolTimeoutMs: 90000
|
|
28
|
+
snapshotMaxChars: 32000
|
|
29
|
+
maxInteractiveItems: 60
|