@jaco-tech/dsh-web-fetch-crw 0.2.0 → 0.2.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/README.md CHANGED
@@ -15,19 +15,38 @@ crw is a self-hosted web scraping and crawling service that implements the [Fire
15
15
  npm install @jaco-tech/dsh-web-fetch-crw
16
16
  ```
17
17
 
18
+ Requires DeepSeek Harness 0.2.1-rc.5. The tested DSH dependency set pins
19
+ `@deepseek-ai/dsh-web` and `@deepseek-ai/dsh-settings` exactly at `0.2.1-rc.5`.
20
+ `@deepseek-ai/cordis` is the deliberate exception: like the first-party DSH web plugins,
21
+ this package declares the compatible patch range `~4.0.5`. A consumer lockfile could in
22
+ principle resolve a different 4.0.x cordis patch and create a second framework copy; this
23
+ plugin's one-shot install is verified against cordis 4.0.5. Every DSH bump therefore needs
24
+ a release of this package with its framework peers re-pinned (`test/peer-pins.test.mjs`
25
+ enforces their presence and pin form). DSH 0.1.x is no longer supported; use
26
+ `@jaco-tech/dsh-web-fetch-crw@0.1` there.
27
+
18
28
  ## Configure
19
29
 
20
- Add to your DSH profile's `cordis.patch.yml`:
30
+ ### 1. Install the package
31
+
32
+ ```bash
33
+ npm install @jaco-tech/dsh-web-fetch-crw
34
+ ```
35
+
36
+ ### 2. Add it to your DSH profile
37
+
38
+ Edit `~/.dsh/profiles/web/cordis.patch.yml` (create it if it doesn't exist) and add:
21
39
 
22
40
  ```yaml
23
41
  - insert:
24
42
  - id: web-fetch-crw
25
43
  name: '@jaco-tech/dsh-web-fetch-crw'
26
44
  config:
45
+ # Required: point at your crw (Firecrawl-compatible) instance
27
46
  baseURL: 'http://your-crw-instance:3000'
28
47
  ```
29
48
 
30
- Optionally pin `ctx.web` to use this provider explicitly:
49
+ If you have multiple fetch providers registered, pin `ctx.web` to use this one:
31
50
 
32
51
  ```yaml
33
52
  - replace:
@@ -36,6 +55,20 @@ Optionally pin `ctx.web` to use this provider explicitly:
36
55
  fetchProvider: crw
37
56
  ```
38
57
 
58
+ ### 3. Restart DSH
59
+
60
+ Stop your running `dsh` process and start it again:
61
+
62
+ ```bash
63
+ npx @deepseek-ai/dsh web
64
+ ```
65
+
66
+ The plugin will be loaded automatically. The `web_fetch` tool in your agent will now use your crw instance.
67
+
68
+ ### 4. (Optional) Configure via the Web UI
69
+
70
+ 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. `baseURL` is a volatile setting: the provider reads it on every fetch, so an edit applies without restarting DSH.
71
+
39
72
  ## How it works
40
73
 
41
74
  This is a [Cordis](https://github.com/cordiverse/cordis) plugin that implements the `WebFetchProvider` interface from `@deepseek-ai/dsh-web`:
@@ -73,8 +106,8 @@ This plugin communicates with [crw](https://github.com/us/crw) via its Firecrawl
73
106
 
74
107
  ```bash
75
108
  # Tag and push — the CI workflow builds and publishes to npm automatically
76
- git tag v0.1.0
77
- git push origin v0.1.0
109
+ git tag v0.2.2
110
+ git push origin v0.2.2
78
111
  ```
79
112
 
80
113
  Requires the `NPM_TOKEN` secret to be set in the repository.
@@ -84,8 +117,27 @@ Requires the `NPM_TOKEN` secret to be set in the repository.
84
117
  ```bash
85
118
  npm install
86
119
  npm run build
120
+ npm test # builds, then imports the built package against the installed DSH (hermetic)
87
121
  ```
88
122
 
123
+ Verify a one-shot scratch install of DSH plus this package's `npm pack` tarball:
124
+
125
+ ```bash
126
+ repo=$PWD
127
+ scratch=$(mktemp -d)
128
+ tarball=$(npm pack --pack-destination "$scratch" --silent)
129
+ printf '%s\n' \
130
+ "{\"private\":true,\"dependencies\":{\"@deepseek-ai/dsh\":\"0.2.1-rc.5\",\"@jaco-tech/dsh-web-fetch-crw\":\"file:./$tarball\"}}" \
131
+ > "$scratch/package.json"
132
+ (cd "$scratch" && npm install --no-audit --no-fund)
133
+ node "$repo/test/installed-tree-identity.mjs" "$scratch"
134
+ ```
135
+
136
+ The final check is hermetic (it only reads the installed tree). It requires exactly one
137
+ installed copy each of `@deepseek-ai/dsh-web`,
138
+ `@deepseek-ai/dsh-settings`, and `@deepseek-ai/cordis`, and requires
139
+ `@deepseek-ai/cordis-plugin-group` to be present.
140
+
89
141
  ## License
90
142
 
91
143
  MIT
package/lib/index.js CHANGED
@@ -1,6 +1,5 @@
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";
4
3
  //#endregion
5
4
  //#region provider
6
5
  /**
@@ -117,17 +116,11 @@ const name = "web-fetch-crw";
117
116
  /** The web seam this provider registers into. */
118
117
  const inject = ["web"];
119
118
  const Config = z.object({
120
- baseURL: z.string().required(),
119
+ baseURL: z.string().required().volatile(),
121
120
  });
122
- /** Settings namespace for the DSH Web UI (Settings → Plugins). */
123
- const WEB_FETCH_CRW_SETTINGS_NAMESPACE = settingsNamespace("web-fetch-crw");
121
+ /** Register the crw fetch provider with `ctx.web`. */
124
122
  function apply(ctx, config) {
125
- let current = () => config;
126
- installSettingsSection(ctx, WEB_FETCH_CRW_SETTINGS_NAMESPACE, Config, config, {
127
- setSource: (source) => { current = source; },
128
- onChange: () => { },
129
- });
130
- ctx.web.registerFetchProvider(new CrwFetchProvider(() => current()));
123
+ ctx.web.registerFetchProvider(new CrwFetchProvider(() => ({ baseURL: config.baseURL.get() })));
131
124
  }
132
125
  //#endregion
133
126
  //#region helpers
@@ -1,5 +1,5 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
- import type { Context } from "@deepseek-ai/cordis";
2
+ import type { Context, Volatile } from "@deepseek-ai/cordis";
3
3
  import type { WebFetchProvider, WebFetchRequest, WebFetchResult } from "@deepseek-ai/dsh-web";
4
4
  interface CrwScrapeResponse {
5
5
  success: boolean;
@@ -69,11 +69,18 @@ declare const name = "web-fetch-crw";
69
69
  declare const inject: string[];
70
70
  /**
71
71
  * Plugin configuration. `baseURL` is required (point at your crw instance).
72
+ * The field is volatile: DSH's settings plane updates it in place, and the
73
+ * provider reads it on every call, so an edit applies without a reload.
72
74
  */
73
75
  interface Config {
74
76
  /** Base URL of the crw service (without /v1/scrape suffix). */
75
- baseURL: string;
77
+ baseURL: Volatile<string>;
76
78
  }
77
- declare const Config: z<Config>;
79
+ declare const Config: z<Schemastery.ObjectS<NoInfer<{
80
+ baseURL: z<string, string, "volatile-defined">;
81
+ }>>, Schemastery.ObjectT<NoInfer<{
82
+ baseURL: z<string, string, "volatile-defined">;
83
+ }>>, "plain">;
84
+ /** Register the crw fetch provider with `ctx.web`. */
78
85
  declare function apply(ctx: Context, config: Config): void;
79
86
  export { CRW_PROVIDER_ID, CrwFetchProvider, Config, apply, inject, name, mapCrwResponse };
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.2.0",
4
+ "version": "0.2.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,21 +33,21 @@
33
33
  "cordis-plugin"
34
34
  ],
35
35
  "peerDependencies": {
36
- "@deepseek-ai/dsh-web": "^0.1.0-rc.7",
37
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
38
- "@deepseek-ai/cordis": "^4.0.1"
36
+ "@deepseek-ai/dsh-web": "0.2.1-rc.5",
37
+ "@deepseek-ai/cordis": "~4.0.5"
39
38
  },
40
39
  "dependencies": {
41
- "@deepseek-ai/schemastery": "^3.18.1"
40
+ "@deepseek-ai/schemastery": "~3.18.5 || ~3.19.0"
42
41
  },
43
42
  "devDependencies": {
44
- "@deepseek-ai/dsh-web": "^0.1.0-rc.7",
45
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
46
- "@deepseek-ai/cordis": "^4.0.1",
43
+ "@deepseek-ai/dsh": "0.2.1-rc.5",
44
+ "@deepseek-ai/dsh-web": "0.2.1-rc.5",
45
+ "@deepseek-ai/cordis": "~4.0.5",
47
46
  "typescript": "^5.7.0"
48
47
  },
49
48
  "scripts": {
50
49
  "build": "tsc",
50
+ "test": "npm run build && node --test test/peer-pins.test.mjs test/smoke.test.mjs",
51
51
  "prepublishOnly": "tsc"
52
52
  }
53
- }
53
+ }