@jaco-tech/dsh-web-fetch-crw 0.2.1 → 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,6 +15,16 @@ 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
30
  ### 1. Install the package
@@ -57,7 +67,7 @@ The plugin will be loaded automatically. The `web_fetch` tool in your agent will
57
67
 
58
68
  ### 4. (Optional) Configure via the Web UI
59
69
 
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.
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.
61
71
 
62
72
  ## How it works
63
73
 
@@ -96,8 +106,8 @@ This plugin communicates with [crw](https://github.com/us/crw) via its Firecrawl
96
106
 
97
107
  ```bash
98
108
  # Tag and push — the CI workflow builds and publishes to npm automatically
99
- git tag v0.1.0
100
- git push origin v0.1.0
109
+ git tag v0.2.2
110
+ git push origin v0.2.2
101
111
  ```
102
112
 
103
113
  Requires the `NPM_TOKEN` secret to be set in the repository.
@@ -107,8 +117,27 @@ Requires the `NPM_TOKEN` secret to be set in the repository.
107
117
  ```bash
108
118
  npm install
109
119
  npm run build
120
+ npm test # builds, then imports the built package against the installed DSH (hermetic)
121
+ ```
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"
110
134
  ```
111
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
+
112
141
  ## License
113
142
 
114
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.1",
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 || ^0.1.1-rc.2",
37
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.7 || ^0.1.1-rc.2",
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
+ }