@jaco-tech/dsh-web-fetch-crw 0.1.0 → 0.2.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/README.md +26 -5
- package/lib/index.js +8 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -9,9 +9,7 @@ Registers a `WebFetchProvider` into `ctx.web` so that the existing `web_fetch` m
|
|
|
9
9
|
|
|
10
10
|
crw is a self-hosted web scraping and crawling service that implements the [Firecrawl](https://github.com/nicknisi/firecrawl) API. It provides a drop-in replacement for the Firecrawl `/v1/scrape` endpoint.
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
⚠️ **Not yet published to npm.** The CI/CD workflow builds on every push and publishes automatically when a `v*` tag is pushed. Once the first release is cut:
|
|
12
|
+
## Install
|
|
15
13
|
|
|
16
14
|
```bash
|
|
17
15
|
npm install @jaco-tech/dsh-web-fetch-crw
|
|
@@ -19,17 +17,26 @@ npm install @jaco-tech/dsh-web-fetch-crw
|
|
|
19
17
|
|
|
20
18
|
## Configure
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
### 1. Install the package
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @jaco-tech/dsh-web-fetch-crw
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Add it to your DSH profile
|
|
27
|
+
|
|
28
|
+
Edit `~/.dsh/profiles/web/cordis.patch.yml` (create it if it doesn't exist) and add:
|
|
23
29
|
|
|
24
30
|
```yaml
|
|
25
31
|
- insert:
|
|
26
32
|
- id: web-fetch-crw
|
|
27
33
|
name: '@jaco-tech/dsh-web-fetch-crw'
|
|
28
34
|
config:
|
|
35
|
+
# Required: point at your crw (Firecrawl-compatible) instance
|
|
29
36
|
baseURL: 'http://your-crw-instance:3000'
|
|
30
37
|
```
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
If you have multiple fetch providers registered, pin `ctx.web` to use this one:
|
|
33
40
|
|
|
34
41
|
```yaml
|
|
35
42
|
- replace:
|
|
@@ -38,6 +45,20 @@ Optionally pin `ctx.web` to use this provider explicitly:
|
|
|
38
45
|
fetchProvider: crw
|
|
39
46
|
```
|
|
40
47
|
|
|
48
|
+
### 3. Restart DSH
|
|
49
|
+
|
|
50
|
+
Stop your running `dsh` process and start it again:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx @deepseek-ai/dsh web
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The plugin will be loaded automatically. The `web_fetch` tool in your agent will now use your crw instance.
|
|
57
|
+
|
|
58
|
+
### 4. (Optional) Configure via the Web UI
|
|
59
|
+
|
|
60
|
+
Once DSH is running, go to **Settings → Plugins** in the Web UI. You'll see a "web-fetch-crw" card where you can edit the `baseURL` without editing YAML files.
|
|
61
|
+
|
|
41
62
|
## How it works
|
|
42
63
|
|
|
43
64
|
This is a [Cordis](https://github.com/cordiverse/cordis) plugin that implements the `WebFetchProvider` interface from `@deepseek-ai/dsh-web`:
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
2
|
import { WebError } from "@deepseek-ai/dsh-web";
|
|
3
|
+
import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
3
4
|
//#endregion
|
|
4
5
|
//#region provider
|
|
5
6
|
/**
|
|
@@ -118,8 +119,14 @@ const inject = ["web"];
|
|
|
118
119
|
const Config = z.object({
|
|
119
120
|
baseURL: z.string().required(),
|
|
120
121
|
});
|
|
122
|
+
/** Settings namespace for the DSH Web UI (Settings → Plugins). */
|
|
123
|
+
const WEB_FETCH_CRW_SETTINGS_NAMESPACE = settingsNamespace("web-fetch-crw");
|
|
121
124
|
function apply(ctx, config) {
|
|
122
|
-
|
|
125
|
+
let current = () => config;
|
|
126
|
+
installSettingsSection(ctx, WEB_FETCH_CRW_SETTINGS_NAMESPACE, Config, config, {
|
|
127
|
+
setSource: (source) => { current = source; },
|
|
128
|
+
onChange: () => { },
|
|
129
|
+
});
|
|
123
130
|
ctx.web.registerFetchProvider(new CrwFetchProvider(() => current()));
|
|
124
131
|
}
|
|
125
132
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaco-tech/dsh-web-fetch-crw",
|
|
3
3
|
"description": "crw (Firecrawl-compatible) fetch provider for the DeepSeek Harness web capability seam (ctx.web). No auth, no API key.",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"cordis-plugin"
|
|
34
34
|
],
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@deepseek-ai/dsh-web": "^0.1.0-rc.7",
|
|
36
|
+
"@deepseek-ai/dsh-web": "^0.1.0-rc.7 || ^0.1.1-rc.2",
|
|
37
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7 || ^0.1.1-rc.2",
|
|
37
38
|
"@deepseek-ai/cordis": "^4.0.1"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@deepseek-ai/dsh-web": "^0.1.0-rc.7",
|
|
45
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
|
|
44
46
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
45
47
|
"typescript": "^5.7.0"
|
|
46
48
|
},
|