dsh-modern-web-guidance 0.4.0 → 0.4.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 +209 -17
- package/README.ru.md +211 -22
- package/README.zh.md +202 -21
- package/client.js +45 -1
- package/locale/zh.json +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -27,8 +27,23 @@
|
|
|
27
27
|
<a href="https://www.npmjs.com/package/dsh-modern-web-guidance"><img alt="npm" src="https://img.shields.io/npm/v/dsh-modern-web-guidance"></a>
|
|
28
28
|
<img alt="Guides" src="https://img.shields.io/badge/guides-208-2563eb">
|
|
29
29
|
<img alt="DSH plugin" src="https://img.shields.io/badge/DSH-plugin-0d9488">
|
|
30
|
+
<a href="https://www.npmjs.com/package/dsh-modern-web-guidance"><img alt="npm downloads" src="https://img.shields.io/npm/dm/dsh-modern-web-guidance"></a>
|
|
31
|
+
<a href="https://github.com/metapeka/dsh-modern-web-guidance/releases"><img alt="release" src="https://img.shields.io/github/v/release/metapeka/dsh-modern-web-guidance?label=release"></a>
|
|
30
32
|
</p>
|
|
31
33
|
|
|
34
|
+
<details>
|
|
35
|
+
<summary>📑 Contents</summary>
|
|
36
|
+
|
|
37
|
+
**Start here** · [What you get](#what-you-get) · [Install](#install) · [How to use](#how-to-use) · [Which tool when](#which-tool-when)
|
|
38
|
+
|
|
39
|
+
**Understand it** · [vs Google's package](#vs-google) · [How search works](#how-search-works) · [Catalog map](#catalog-map) · [Experimental guides](#experimental-guides)
|
|
40
|
+
|
|
41
|
+
**Operate it** · [Security and limits](#security-and-limits) · [Usage stats](#usage-stats) · [Sidebar panel](#sidebar-panel) · [Configuration](#configuration) · [Updating the corpus](#updating-the-guide-corpus)
|
|
42
|
+
|
|
43
|
+
**Everything else** · [FAQ](#faq) · [Roadmap](#roadmap) · [Docs map](#docs-map) · [Development](#development) · [Publishing](#publishing) · [License](#attribution-and-license)
|
|
44
|
+
|
|
45
|
+
</details>
|
|
46
|
+
|
|
32
47
|
---
|
|
33
48
|
|
|
34
49
|
Coding models default to legacy web patterns because that is what their training data contains. This plugin puts 208
|
|
@@ -39,7 +54,9 @@ effects, `:has()`, passkeys, `fetchpriority`, …) instead of a JavaScript worka
|
|
|
39
54
|
Everything runs locally: the guides ship inside the package, search is computed in-process, and there are no network
|
|
40
55
|
calls. Usage counters have existed since 0.2.0, but they never leave the machine — see [Usage stats](#usage-stats).
|
|
41
56
|
|
|
42
|
-
|
|
57
|
+
<a id="what-you-get"></a>
|
|
58
|
+
|
|
59
|
+
## 🧰 What you get
|
|
43
60
|
|
|
44
61
|
| Kind | Name | Description |
|
|
45
62
|
|---|---|---|
|
|
@@ -52,7 +69,9 @@ calls. Usage counters have existed since 0.2.0, but they never leave the machine
|
|
|
52
69
|
The catalog covers `css`, `ui-atoms`, `ui-components`, `ui-behaviors`, `forms`, `html`, `js`, `accessibility`,
|
|
53
70
|
`visual-design`, `security`, `performance`, `built-in-ai`, `pwa`, `wasm`, `webmcp`, `privacy`, and `user-experience`.
|
|
54
71
|
|
|
55
|
-
|
|
72
|
+
<a id="install"></a>
|
|
73
|
+
|
|
74
|
+
## 🚀 Install
|
|
56
75
|
|
|
57
76
|
Published on npm:
|
|
58
77
|
|
|
@@ -76,11 +95,24 @@ From an agent session, `plugin_manager` with `action: "install_bundle"` and the
|
|
|
76
95
|
does the same thing. The bundle inserts one row (`modern-web-guidance`) and needs no build step, no dependencies, and no
|
|
77
96
|
native modules.
|
|
78
97
|
|
|
79
|
-
|
|
98
|
+
<a id="how-to-use"></a>
|
|
99
|
+
|
|
100
|
+
## 🧭 How to use
|
|
80
101
|
|
|
81
102
|
Nothing has to be wired up: the plugin registers itself, and the `modern-web-guidance` skill tells the agent when to
|
|
82
103
|
reach for it. There are three ways to work with it.
|
|
83
104
|
|
|
105
|
+
<a id="which-tool-when"></a>
|
|
106
|
+
|
|
107
|
+
### Which tool when
|
|
108
|
+
|
|
109
|
+
| You want | Call | Comes back |
|
|
110
|
+
| --- | --- | --- |
|
|
111
|
+
| "how is this done today?" | `web_guidance_search` | ranked guide ids for a 2–5 word capability query, optional category filter |
|
|
112
|
+
| "show me the guide" | `web_guidance_retrieve` | full markdown, up to 10 guides or 120 000 characters per call |
|
|
113
|
+
| "what is even in here?" | `web_guidance_list` | counts per category, or ids and titles for one category |
|
|
114
|
+
| "is the catalog actually being used?" | `/guidance-stats` | the local report as text; `--json` is what the panel reads |
|
|
115
|
+
|
|
84
116
|
### 1. Just ask for web work (default)
|
|
85
117
|
|
|
86
118
|
The skill's routing description is "search 208 use-case guides before writing HTML, CSS or client-side JavaScript", so
|
|
@@ -132,7 +164,37 @@ ones instead of an empty result.
|
|
|
132
164
|
| Faster LCP | `prioritize hero image` | `fetchpriority` guides |
|
|
133
165
|
| A Manifest V3 extension | (skill) `chrome-extensions` | extension skill references |
|
|
134
166
|
|
|
135
|
-
|
|
167
|
+
<a id="vs-google"></a>
|
|
168
|
+
|
|
169
|
+
## 🆚 vs Google's package
|
|
170
|
+
|
|
171
|
+
This plugin **vendors Google's corpus** — the same 208 guides, byte-identical — and adds the layer
|
|
172
|
+
DeepSeek Harness needs: model-facing tools, a sidebar panel and no runtime dependencies. It does not
|
|
173
|
+
reimplement their agent, and it deliberately drops the engines that would not survive a plugin's size
|
|
174
|
+
and security budget. The honest split:
|
|
175
|
+
|
|
176
|
+
| | Google `modern-web-guidance` | This plugin |
|
|
177
|
+
| --- | --- | --- |
|
|
178
|
+
| Shape | npm package: a CLI plus skills, run as `npx -y modern-web-guidance@latest …` | DSH plugin: 3 tools, 2 skills, a sidebar panel |
|
|
179
|
+
| Audience | any agent that can run a shell command | DeepSeek Harness sessions |
|
|
180
|
+
| Guide corpus | 208 indexed guides (209 `.md` files, one byte-identical duplicate) | the same 208, byte-identical, snapshot `2026_11_09-5bcc021b` |
|
|
181
|
+
| Lookup | precomputed assets in `gen/` — quantized word vectors (`query-words.i8`, 7.47 MB) and chunk embeddings, 9.16 MB together | BM25 built in-process from `guides.json` and the guide bodies: no assets, no model download (measured 29/30 top-1 on a 30-query probe) |
|
|
182
|
+
| Runtime dependencies | Node plus the CLI engines shipped in the package | none |
|
|
183
|
+
| Network | `npx` fetches the package, then works locally | never — the corpus is inside the package |
|
|
184
|
+
| Legacy scan | a 4.99 MB `legacy-scan` engine with a four-step scan → verify → report → modernize workflow | not shipped; planned as a dependency-free, report-only regex scanner in 0.5.0 |
|
|
185
|
+
| Experimental guides | gated inside the CLI | `[experimental]` marker in `web_guidance_search`, warning banner in `web_guidance_retrieve` |
|
|
186
|
+
| Usage insight | none | local counters, `/guidance-stats`, and the sidebar panel |
|
|
187
|
+
| Languages | English guides | the same guides; docs in EN/RU/ZH, panel in EN/RU/ZH |
|
|
188
|
+
| Size | — | 254 files, 854 kB packed, 2.5 MB unpacked |
|
|
189
|
+
|
|
190
|
+
What this means in practice: if you work outside DeepSeek Harness, use their package — it is the
|
|
191
|
+
reference implementation and it owns the corpus. Inside Harness you want the tools in the model's tool
|
|
192
|
+
list, an install with no build step and no network, and a panel that says whether the guides are being
|
|
193
|
+
used; that is this plugin.
|
|
194
|
+
|
|
195
|
+
<a id="how-search-works"></a>
|
|
196
|
+
|
|
197
|
+
## 🧠 How search works
|
|
136
198
|
|
|
137
199
|
`lib/guidance.js` builds a BM25 index over the bundled corpus at first use (~1.9 MB of markdown, indexed in a few
|
|
138
200
|
hundred milliseconds and cached): title, id, description, `featuresUsed`, headings and body, with stopword filtering,
|
|
@@ -143,14 +205,73 @@ Compared with the upstream semantic search, phrase-like queries (`"light dismiss
|
|
|
143
205
|
the specific guide first; broad topical queries can differ in ordering. If a search misses, `web_guidance_list` shows
|
|
144
206
|
what the catalog contains.
|
|
145
207
|
|
|
146
|
-
|
|
208
|
+
<a id="catalog-map"></a>
|
|
209
|
+
|
|
210
|
+
## 🗺 Catalog map
|
|
211
|
+
|
|
212
|
+
Everything is local, so the catalog is only as useful as the agent's ability to find the right guide.
|
|
213
|
+
`web_guidance_list` prints these counts at runtime; this is what they look like at snapshot
|
|
214
|
+
`2026_11_09-5bcc021b`.
|
|
215
|
+
|
|
216
|
+
<details>
|
|
217
|
+
<summary>Counts per category (208 guides, 17 categories)</summary>
|
|
218
|
+
|
|
219
|
+
| Category | Guides | Category | Guides |
|
|
220
|
+
| --- | --- | --- | --- |
|
|
221
|
+
| `ui-behaviors` | 40 | `html` | 8 |
|
|
222
|
+
| `performance` | 26 | `js` | 5 |
|
|
223
|
+
| `ui-components` | 22 | `accessibility` | 4 |
|
|
224
|
+
| `visual-design` | 22 | `built-in-ai` | 4 |
|
|
225
|
+
| `forms` | 19 | `user-experience` | 3 |
|
|
226
|
+
| `css` | 18 | `webmcp` | 3 |
|
|
227
|
+
| `security` | 17 | `pwa` | 2 |
|
|
228
|
+
| `ui-atoms` | 13 | `privacy` · `wasm` | 1 · 1 |
|
|
229
|
+
| | | **total** | **208** |
|
|
230
|
+
|
|
231
|
+
</details>
|
|
232
|
+
|
|
233
|
+
<a id="experimental-guides"></a>
|
|
234
|
+
|
|
235
|
+
## 🧪 Experimental guides
|
|
236
|
+
|
|
237
|
+
Eighteen of the 208 guides describe platform features that are not safe to assume: eight sit behind an
|
|
238
|
+
Origin Trial in Chrome, and ten are volatile in a single engine. Upstream flags them in its index; this
|
|
239
|
+
plugin surfaces the flag where the agent will actually see it:
|
|
240
|
+
|
|
241
|
+
- `web_guidance_search` appends `[experimental]` to the hit;
|
|
242
|
+
- `web_guidance_retrieve` opens the guide with a `> [!WARNING]` banner naming the reason;
|
|
243
|
+
- the guide body itself is untouched — byte-identical to upstream — and the banner counts against the
|
|
244
|
+
120 000-character budget, not against the 10-guide limit.
|
|
245
|
+
|
|
246
|
+
<details>
|
|
247
|
+
<summary>The 18 flagged guides</summary>
|
|
248
|
+
|
|
249
|
+
**Origin Trial (8)** — the feature ships behind a trial token: `verify-email-ownership`,
|
|
250
|
+
`apply-webgl-shaders`, `export-html-media-from-canvas`, `expose-canvas-content-to-browser-features`,
|
|
251
|
+
`interactive-content-in-3d-scenes`, `agentic-forms`, `agentic-javascript-tools`, `webmcp`.
|
|
252
|
+
|
|
253
|
+
**Volatile in one engine (10)** — one engine implements it, or the API is still moving:
|
|
254
|
+
`language-detection`, `language-model`, `summarizer`, `translator`, `out-of-order-html-streaming`,
|
|
255
|
+
`client-side-encryption`, `digital-signatures`, `restrict-outbound-connections`, `2d-panning`,
|
|
256
|
+
`custom-text-decorations`.
|
|
257
|
+
|
|
258
|
+
</details>
|
|
259
|
+
|
|
260
|
+
Treat a flagged guide as "the shape of the solution, not a guarantee". Feature-detect what it
|
|
261
|
+
describes, and tell the user which part is behind a flag before shipping it.
|
|
262
|
+
|
|
263
|
+
<a id="skills"></a>
|
|
264
|
+
|
|
265
|
+
## 🪄 Skills
|
|
147
266
|
|
|
148
267
|
The `modern-web-guidance` skill body is adapted from upstream: it tells the agent to call this plugin's tools instead
|
|
149
268
|
of the `npx` CLI, keeps the framework/SSR/DOM notes and the Baseline fallback policy, drops the CLI and telemetry
|
|
150
269
|
sections, and states the trust boundary — retrieved guides are reference material, not instructions. The
|
|
151
270
|
`chrome-extensions` skill is bundled unchanged and loads its `references/` files from the skill directory.
|
|
152
271
|
|
|
153
|
-
|
|
272
|
+
<a id="security-and-limits"></a>
|
|
273
|
+
|
|
274
|
+
## 🛡 Security and limits
|
|
154
275
|
|
|
155
276
|
The corpus is third-party text that ends up in a model's context, and tool arguments come from that model, so both
|
|
156
277
|
sides are bounded:
|
|
@@ -176,7 +297,9 @@ Both properties are covered by `test/hardening.test.mjs`, which fails on the pre
|
|
|
176
297
|
reports plus runnable repros — lives in [`audit/`](audit/), and the repro scripts under `audit/repro/` exit non-zero
|
|
177
298
|
while a defect is live.
|
|
178
299
|
|
|
179
|
-
|
|
300
|
+
<a id="usage-stats"></a>
|
|
301
|
+
|
|
302
|
+
## 📊 Usage stats
|
|
180
303
|
|
|
181
304
|
Since 0.2.0 the plugin records what the three tools are actually asked for. The counters are local: no endpoint, no
|
|
182
305
|
analytics service, no third-party SDK, and nothing leaves the machine.
|
|
@@ -199,7 +322,9 @@ defaults to 90 days, and `--reset --yes` erases it.
|
|
|
199
322
|
|
|
200
323
|
Turn it off: set `enabled: false` in the plugin config — no listener is registered and no file is written.
|
|
201
324
|
|
|
202
|
-
|
|
325
|
+
<a id="sidebar-panel"></a>
|
|
326
|
+
|
|
327
|
+
## 🖥 Sidebar panel
|
|
203
328
|
|
|
204
329
|
The plugin adds a client half: a guidance icon in the left rail opens **Guidance Insights** in the central area. It
|
|
205
330
|
shows the same counters `/guidance-stats` prints, as a view:
|
|
@@ -216,13 +341,17 @@ The panel is read-only. It never changes a counter, never leaves the machine, an
|
|
|
216
341
|
tools — the same three tools stay exactly three. `/guidance-stats` remains the text and `--json` version for the
|
|
217
342
|
terminal and for the agent; the panel is that report as a view.
|
|
218
343
|
|
|
219
|
-
|
|
344
|
+
<a id="configuration"></a>
|
|
345
|
+
|
|
346
|
+
## ⚙️ Configuration
|
|
220
347
|
|
|
221
348
|
The plugin needs no configuration to work. It registers its tools and skills on the host context and is inert when the
|
|
222
349
|
profile has no `tools` or `skills` service. The one setting is `enabled` on the plugin row: `false` turns the local
|
|
223
350
|
counters off (see [Usage stats](#usage-stats)).
|
|
224
351
|
|
|
225
|
-
|
|
352
|
+
<a id="updating-the-guide-corpus"></a>
|
|
353
|
+
|
|
354
|
+
## 🔄 Updating the guide corpus
|
|
226
355
|
|
|
227
356
|
The corpus is a pinned snapshot of upstream `modern-web-guidance@1.0.0`
|
|
228
357
|
(skill version `2026_11_09-5bcc021b`). To refresh it:
|
|
@@ -238,24 +367,87 @@ The corpus is a pinned snapshot of upstream `modern-web-guidance@1.0.0`
|
|
|
238
367
|
any served guide tells the agent to run the upstream CLI, so a refreshed corpus needs no manual de-CLI pass — the
|
|
239
368
|
rewrite happens at load time (`lib/guidance.js`, `CLI_REFERENCE`).
|
|
240
369
|
|
|
241
|
-
|
|
370
|
+
<a id="faq"></a>
|
|
371
|
+
|
|
372
|
+
## ❓ FAQ
|
|
373
|
+
|
|
374
|
+
**The plugin is installed but I see nothing.** The bundle inserts one row (`modern-web-guidance`) and
|
|
375
|
+
needs no build step. Restart DSH after `dsh plugin --profile desktop add …`; the tools appear in the
|
|
376
|
+
next session's tool list, and the panel as an icon in the left rail.
|
|
377
|
+
|
|
378
|
+
**Search returns nothing useful.** Queries are 2–5 words describing a capability ("light dismiss
|
|
379
|
+
dialog", "view transition", "container query"), not sentences. If a query still misses, call
|
|
380
|
+
`web_guidance_list` for the category overview and retrieve by id from there.
|
|
381
|
+
|
|
382
|
+
**Why did a result say `[experimental]`?** The guide's platform feature is behind an Origin Trial or
|
|
383
|
+
is volatile in one engine — see [Experimental guides](#experimental-guides). The guide is still the
|
|
384
|
+
right shape; feature-detect it before shipping.
|
|
385
|
+
|
|
386
|
+
**Does anything leave my machine?** No. The corpus is inside the package, search is computed
|
|
387
|
+
in-process, and there are no network calls. The usage counters are local files and can be switched off
|
|
388
|
+
with `enabled: false` — see [Security and limits](#security-and-limits) and [ADR 0001](docs/adr/0001-local-telemetry.md).
|
|
389
|
+
|
|
390
|
+
**Google says 203 use cases. Why does this say 208?** Upstream's own count is 203 *use-case* guides;
|
|
391
|
+
the index has 208 entries, the extra five being the discipline overviews (`accessibility`, `forms`,
|
|
392
|
+
`html`, `performance`, `security`). This plugin ships what the index ships.
|
|
393
|
+
|
|
394
|
+
**Which DSH versions work?** `engines.dsh` is `>=0.2.0-rc.1 <0.3.0-0` and Node `>=22.19.0`. The tools
|
|
395
|
+
work on their own; the panel additionally needs the host's `slots`, `locale` and `remote` services.
|
|
396
|
+
|
|
397
|
+
<a id="roadmap"></a>
|
|
398
|
+
|
|
399
|
+
## 🚦 Roadmap
|
|
400
|
+
|
|
401
|
+
| Release | State | What it is |
|
|
402
|
+
| --- | --- | --- |
|
|
403
|
+
| 0.4.0 | shipped | the upstream v1.0.0 corpus (208 guides) plus experimental marking |
|
|
404
|
+
| 0.4.1 | this pass | docs: navigation, the comparison, the catalog map |
|
|
405
|
+
| 0.5.0 | next | `legacy-scan` as a fourth tool: 30–35 regex rules ported from upstream's engine, explicit paths only, report-only output. Design and verdict: [docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
|
|
406
|
+
|
|
407
|
+
Deliberately **not** planned: shipping upstream's 9.16 MB embedding tables, or its 4.99 MB
|
|
408
|
+
`legacy-scan` engine with a bundled TypeScript compiler. Both would break "zero runtime dependencies,
|
|
409
|
+
no network, no code generation" for a gain the lexical index does not show.
|
|
410
|
+
|
|
411
|
+
<a id="docs-map"></a>
|
|
412
|
+
|
|
413
|
+
## 📚 Docs map
|
|
414
|
+
|
|
415
|
+
| Document | Read it when |
|
|
416
|
+
| --- | --- |
|
|
417
|
+
| [`docs/README.md`](docs/README.md) | you want the full map of this repository |
|
|
418
|
+
| [`PUBLISHING.md`](PUBLISHING.md) | you are releasing: npm rules, trusted publishing, the release ritual |
|
|
419
|
+
| [`docs/releases/README.md`](docs/releases/README.md) | you are writing release notes — the house style lives here |
|
|
420
|
+
| [`AGENTS.md`](AGENTS.md) | you are an agent working in this repo: CI, client half, conventions |
|
|
421
|
+
| [`GLOSSARY.md`](GLOSSARY.md) | a term in this codebase is unclear |
|
|
422
|
+
| [`NOTICE`](NOTICE) | attribution: what came from upstream and what was left out, and why |
|
|
423
|
+
| [`audit/`](audit) | you want the 0.1.x security, corpus and bug audits as they were written |
|
|
424
|
+
| [`docs/adr/`](docs/adr) | you want the decisions: local telemetry, and what followed |
|
|
425
|
+
| [`docs/notes/`](docs/notes) | you want the research behind a release (upstream diffs, feasibility studies, plans) |
|
|
426
|
+
|
|
427
|
+
<a id="development"></a>
|
|
428
|
+
|
|
429
|
+
## 🧑💻 Development
|
|
242
430
|
|
|
243
431
|
```shell
|
|
244
432
|
npm test
|
|
245
433
|
```
|
|
246
434
|
|
|
247
|
-
|
|
248
|
-
`plugin.test.mjs`
|
|
249
|
-
|
|
250
|
-
`
|
|
435
|
+
`npm test` runs the suite: `guidance.test.mjs` covers the index, ranking, retrieval and the stemmer;
|
|
436
|
+
`plugin.test.mjs` mounts the plugin against a fake Cordis context; `hardening.test.mjs` guards the
|
|
437
|
+
security invariants; `report.test.mjs`, `stats.test.mjs`, `store.test.mjs` and `telemetry.test.mjs`
|
|
438
|
+
cover the counter pipeline; `client-locales.test.mjs` keeps the panel's three dictionaries in sync. In a
|
|
251
439
|
sandbox that forbids child processes, run the files directly (`node test/hardening.test.mjs`).
|
|
252
440
|
|
|
253
|
-
|
|
441
|
+
<a id="publishing"></a>
|
|
442
|
+
|
|
443
|
+
## 📦 Publishing
|
|
254
444
|
|
|
255
445
|
Marketplace submission and npm steps are documented in [PUBLISHING.md](PUBLISHING.md); the prepared awesome-dsh-plugin
|
|
256
446
|
entry lives in [`market/awesome-dsh-plugin.yml`](market/awesome-dsh-plugin.yml).
|
|
257
447
|
|
|
258
|
-
|
|
448
|
+
<a id="attribution-and-license"></a>
|
|
449
|
+
|
|
450
|
+
## ⚖️ Attribution and license
|
|
259
451
|
|
|
260
452
|
Apache-2.0. The guide corpus, the `chrome-extensions` skill, and the source of the adapted `SKILL.md` come from
|
|
261
453
|
[GoogleChrome/modern-web-guidance](https://github.com/GoogleChrome/modern-web-guidance) (Copyright Google LLC,
|
package/README.ru.md
CHANGED
|
@@ -22,13 +22,28 @@
|
|
|
22
22
|
<p align="center">
|
|
23
23
|
<a href="LICENSE"><img alt="Лицензия" src="https://img.shields.io/badge/license-Apache--2.0-blue"></a>
|
|
24
24
|
<a href="package.json"><img alt="Зависимости" src="https://img.shields.io/badge/dependencies-0-brightgreen"></a>
|
|
25
|
-
<a href="
|
|
25
|
+
<a href="#security-and-limits"><img alt="Телеметрия" src="https://img.shields.io/badge/telemetry-local--only-brightgreen"></a>
|
|
26
26
|
<a href="https://github.com/metapeka/dsh-modern-web-guidance/actions/workflows/test.yml"><img alt="Тесты" src="https://github.com/metapeka/dsh-modern-web-guidance/actions/workflows/test.yml/badge.svg"></a>
|
|
27
27
|
<a href="https://www.npmjs.com/package/dsh-modern-web-guidance"><img alt="npm" src="https://img.shields.io/npm/v/dsh-modern-web-guidance"></a>
|
|
28
28
|
<img alt="Гайды" src="https://img.shields.io/badge/guides-208-2563eb">
|
|
29
29
|
<img alt="Плагин DSH" src="https://img.shields.io/badge/DSH-plugin-0d9488">
|
|
30
|
+
<a href="https://www.npmjs.com/package/dsh-modern-web-guidance"><img alt="Скачивания npm" src="https://img.shields.io/npm/dm/dsh-modern-web-guidance"></a>
|
|
31
|
+
<a href="https://github.com/metapeka/dsh-modern-web-guidance/releases"><img alt="Релиз" src="https://img.shields.io/github/v/release/metapeka/dsh-modern-web-guidance?label=release"></a>
|
|
30
32
|
</p>
|
|
31
33
|
|
|
34
|
+
<details>
|
|
35
|
+
<summary>📑 Содержание</summary>
|
|
36
|
+
|
|
37
|
+
**Начать здесь** · [Что вы получаете](#what-you-get) · [Установка](#install) · [Как пользоваться](#how-to-use) · [Каким инструментом когда](#which-tool-when)
|
|
38
|
+
|
|
39
|
+
**Понять, как устроено** · [Против пакета Google](#vs-google) · [Как работает поиск](#how-search-works) · [Карта каталога](#catalog-map) · [Экспериментальные гайды](#experimental-guides)
|
|
40
|
+
|
|
41
|
+
**Эксплуатация** · [Безопасность и границы](#security-and-limits) · [Статистика использования](#usage-stats) · [Боковая панель](#sidebar-panel) · [Конфигурация](#configuration) · [Обновление корпуса](#updating-the-guide-corpus)
|
|
42
|
+
|
|
43
|
+
**Остальное** · [Частые вопросы](#faq) · [Дорожная карта](#roadmap) · [Карта документации](#docs-map) · [Разработка](#development) · [Публикация](#publishing) · [Лицензия](#attribution-and-license)
|
|
44
|
+
|
|
45
|
+
</details>
|
|
46
|
+
|
|
32
47
|
---
|
|
33
48
|
|
|
34
49
|
Модели по умолчанию пишут веб-код по своему обучающему срезу — то есть тянут паттерны пятилетней давности. Этот
|
|
@@ -37,9 +52,11 @@ API платформы (нативные `<dialog>`/popover, anchor positioning,
|
|
|
37
52
|
эффекты, `:has()`, passkeys, `fetchpriority`, …), а не костыль на JavaScript или библиотеку.
|
|
38
53
|
|
|
39
54
|
Всё работает локально: гайды лежат внутри пакета, поиск считается в процессе, сетевых вызовов нет. Счётчики
|
|
40
|
-
использования есть с 0.2.0, но они не покидают машину — см. [Статистика использования](
|
|
55
|
+
использования есть с 0.2.0, но они не покидают машину — см. [Статистика использования](#usage-stats).
|
|
56
|
+
|
|
57
|
+
<a id="what-you-get"></a>
|
|
41
58
|
|
|
42
|
-
## Что вы получаете
|
|
59
|
+
## 🧰 Что вы получаете
|
|
43
60
|
|
|
44
61
|
| Тип | Имя | Описание |
|
|
45
62
|
|---|---|---|
|
|
@@ -52,7 +69,9 @@ API платформы (нативные `<dialog>`/popover, anchor positioning,
|
|
|
52
69
|
Каталог покрывает `css`, `ui-atoms`, `ui-components`, `ui-behaviors`, `forms`, `html`, `js`, `accessibility`,
|
|
53
70
|
`visual-design`, `security`, `performance`, `built-in-ai`, `pwa`, `wasm`, `webmcp`, `privacy` и `user-experience`.
|
|
54
71
|
|
|
55
|
-
|
|
72
|
+
<a id="install"></a>
|
|
73
|
+
|
|
74
|
+
## 🚀 Установка
|
|
56
75
|
|
|
57
76
|
Из опубликованного пакета:
|
|
58
77
|
|
|
@@ -75,11 +94,22 @@ dsh plugin --profile desktop add file:E:/path/to/dsh-modern-web-guidance
|
|
|
75
94
|
Из сессии агента то же самое делает `plugin_manager` с `action: "install_bundle"` и абсолютным путём к пакету в
|
|
76
95
|
`target`. Бандл добавляет одну строку (`modern-web-guidance`) и не требует сборки, зависимостей или нативных модулей.
|
|
77
96
|
|
|
78
|
-
|
|
97
|
+
<a id="how-to-use"></a>
|
|
98
|
+
|
|
99
|
+
## 🧭 Как пользоваться
|
|
79
100
|
|
|
80
101
|
Ничего настраивать не нужно: плагин регистрируется сам, а скилл `modern-web-guidance` подсказывает агенту, когда к
|
|
81
102
|
нему идти. Есть три способа работы.
|
|
82
103
|
|
|
104
|
+
### <a id="which-tool-when"></a>Каким инструментом когда
|
|
105
|
+
|
|
106
|
+
| Что нужно | Вызов | Что вернётся |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| «как это делается сегодня?» | `web_guidance_search` | ранжированные id гайдов по запросу из 2–5 слов, опционально с фильтром по категории |
|
|
109
|
+
| «покажи гайд» | `web_guidance_retrieve` | полный markdown, до 10 гайдов или 120 000 символов за вызов |
|
|
110
|
+
| «что там вообще есть?» | `web_guidance_list` | счётчики по категориям или id и заголовки одной категории |
|
|
111
|
+
| «каталог вообще используется?» | `/guidance-stats` | локальный отчёт текстом; `--json` — это то, что читает панель |
|
|
112
|
+
|
|
83
113
|
### 1. Просто попросить сделать веб-задачу (обычный режим)
|
|
84
114
|
|
|
85
115
|
Описание скилла для роутинга — «искать по 208 гайдам, прежде чем писать HTML, CSS или клиентский JavaScript», так что
|
|
@@ -130,7 +160,36 @@ web_guidance_search({"query": "view transition"}) → ранжированный
|
|
|
130
160
|
| Быстрый LCP | `prioritize hero image` | гайды про `fetchpriority` |
|
|
131
161
|
| Расширение Manifest V3 | (скилл) `chrome-extensions` | материалы скилла про расширения |
|
|
132
162
|
|
|
133
|
-
|
|
163
|
+
<a id="vs-google"></a>
|
|
164
|
+
|
|
165
|
+
## 🆚 Против пакета Google
|
|
166
|
+
|
|
167
|
+
Этот плагин **вендорит корпус Google** — те же 208 гайдов, побайтово идентичных — и добавляет слой, который нужен
|
|
168
|
+
DeepSeek Harness: инструменты для модели, боковую панель и никаких зависимостей рантайма. Он не переписывает их агента
|
|
169
|
+
и сознательно отказывается от движков, которые не выжили бы при бюджете размера и безопасности плагина. Честное
|
|
170
|
+
разделение:
|
|
171
|
+
|
|
172
|
+
| | Google `modern-web-guidance` | Этот плагин |
|
|
173
|
+
| --- | --- | --- |
|
|
174
|
+
| Форма | npm-пакет: CLI плюс скиллы, запуск как `npx -y modern-web-guidance@latest …` | плагин DSH: 3 инструмента, 2 скилла, боковая панель |
|
|
175
|
+
| Аудитория | любой агент, умеющий запускать команды в оболочке | сессии DeepSeek Harness |
|
|
176
|
+
| Корпус гайдов | 208 проиндексированных гайдов (209 файлов `.md`, один побайтовый дубль) | те же 208, побайтово идентичны, срез `2026_11_09-5bcc021b` |
|
|
177
|
+
| Поиск | предвычисленные ассеты в `gen/` — квантованные векторы слов (`query-words.i8`, 7.47 MB) и эмбеддинги чанков, 9.16 MB вместе | BM25 строится в процессе из `guides.json` и тел гайдов: без ассетов, без скачивания модели (измерено 29/30 top-1 на пробе из 30 запросов) |
|
|
178
|
+
| Зависимости рантайма | Node плюс движки CLI, поставляемые в пакете | нет |
|
|
179
|
+
| Сеть | `npx` скачивает пакет, дальше всё локально | никогда — корпус лежит внутри пакета |
|
|
180
|
+
| Сканер legacy | движок `legacy-scan` на 4.99 MB с четырёхшаговым процессом scan → verify → report → modernize | не поставляется; запланирован на 0.5.0 как сканер регулярными выражениями без зависимостей, только с отчётом |
|
|
181
|
+
| Экспериментальные гайды | закрыты внутри CLI | маркер `[experimental]` в `web_guidance_search`, предупреждающий баннер в `web_guidance_retrieve` |
|
|
182
|
+
| Анализ использования | нет | локальные счётчики, `/guidance-stats` и боковая панель |
|
|
183
|
+
| Языки | гайды на английском | те же гайды; документация на EN/RU/ZH, панель на EN/RU/ZH |
|
|
184
|
+
| Размер | — | 254 файла, 854 kB в упаковке, 2.5 MB распакованного |
|
|
185
|
+
|
|
186
|
+
Что это значит на практике: если вы работаете вне DeepSeek Harness, берите их пакет — это референсная реализация, и
|
|
187
|
+
корпус принадлежит им. Внутри Harness нужны инструменты в списке инструментов модели, установка без сборки и без сети и
|
|
188
|
+
панель, которая говорит, используются ли гайды; это и есть этот плагин.
|
|
189
|
+
|
|
190
|
+
<a id="how-search-works"></a>
|
|
191
|
+
|
|
192
|
+
## 🧠 Как работает поиск
|
|
134
193
|
|
|
135
194
|
`lib/guidance.js` при первом использовании строит BM25-индекс по встроенному корпусу (~1.9 MB markdown, индексация
|
|
136
195
|
занимает несколько сотен миллисекунд, дальше кэш): заголовок, id, описание, `featuresUsed`, заголовки разделов и
|
|
@@ -142,14 +201,72 @@ web_guidance_search({"query": "view transition"}) → ранжированный
|
|
|
142
201
|
ставят на первое место нужный гайд; на широких тематических запросах порядок может отличаться. Если поиск промахнулся,
|
|
143
202
|
`web_guidance_list` покажет, что в каталоге есть.
|
|
144
203
|
|
|
145
|
-
|
|
204
|
+
<a id="catalog-map"></a>
|
|
205
|
+
|
|
206
|
+
## 🗺 Карта каталога
|
|
207
|
+
|
|
208
|
+
Всё локально, поэтому каталог полезен ровно настолько, насколько агент умеет найти нужный гайд. `web_guidance_list`
|
|
209
|
+
печатает эти счётчики в рантайме; вот как они выглядят на срезе `2026_11_09-5bcc021b`.
|
|
210
|
+
|
|
211
|
+
<details>
|
|
212
|
+
<summary>Счётчики по категориям (208 гайдов, 17 категорий)</summary>
|
|
213
|
+
|
|
214
|
+
| Категория | Гайдов | Категория | Гайдов |
|
|
215
|
+
| --- | --- | --- | --- |
|
|
216
|
+
| `ui-behaviors` | 40 | `html` | 8 |
|
|
217
|
+
| `performance` | 26 | `js` | 5 |
|
|
218
|
+
| `ui-components` | 22 | `accessibility` | 4 |
|
|
219
|
+
| `visual-design` | 22 | `built-in-ai` | 4 |
|
|
220
|
+
| `forms` | 19 | `user-experience` | 3 |
|
|
221
|
+
| `css` | 18 | `webmcp` | 3 |
|
|
222
|
+
| `security` | 17 | `pwa` | 2 |
|
|
223
|
+
| `ui-atoms` | 13 | `privacy` · `wasm` | 1 · 1 |
|
|
224
|
+
| | | **итого** | **208** |
|
|
225
|
+
|
|
226
|
+
</details>
|
|
227
|
+
|
|
228
|
+
<a id="experimental-guides"></a>
|
|
229
|
+
|
|
230
|
+
## 🧪 Экспериментальные гайды
|
|
231
|
+
|
|
232
|
+
Восемнадцать из 208 гайдов описывают возможности платформы, которые нельзя считать безопасными: восемь закрыты Origin
|
|
233
|
+
Trial в Chrome, а десять изменчивы в пределах одного движка. Апстрим помечает их в своём индексе; этот плагин показывает
|
|
234
|
+
пометку там, где агент её действительно увидит:
|
|
235
|
+
|
|
236
|
+
- `web_guidance_search` добавляет `[experimental]` к результату;
|
|
237
|
+
- `web_guidance_retrieve` открывает гайд баннером `> [!WARNING]`, называющим причину;
|
|
238
|
+
- тело гайда не тронуто — побайтово идентично апстриму — а баннер считается в бюджет 120 000 символов, а не в лимит
|
|
239
|
+
в 10 гайдов.
|
|
240
|
+
|
|
241
|
+
<details>
|
|
242
|
+
<summary>18 помеченных гайдов</summary>
|
|
243
|
+
|
|
244
|
+
**Origin Trial (8)** — возможность поставляется за токеном триала: `verify-email-ownership`,
|
|
245
|
+
`apply-webgl-shaders`, `export-html-media-from-canvas`, `expose-canvas-content-to-browser-features`,
|
|
246
|
+
`interactive-content-in-3d-scenes`, `agentic-forms`, `agentic-javascript-tools`, `webmcp`.
|
|
247
|
+
|
|
248
|
+
**Нестабильно в одном движке (10)** — возможность реализована в одном движке, либо API ещё меняется:
|
|
249
|
+
`language-detection`, `language-model`, `summarizer`, `translator`, `out-of-order-html-streaming`,
|
|
250
|
+
`client-side-encryption`, `digital-signatures`, `restrict-outbound-connections`, `2d-panning`,
|
|
251
|
+
`custom-text-decorations`.
|
|
252
|
+
|
|
253
|
+
</details>
|
|
254
|
+
|
|
255
|
+
Относитесь к помеченному гайду как к «форме решения, а не гарантии». Проверяйте фича-детектом то, что он описывает, и
|
|
256
|
+
говорите пользователю, какая часть за флагом, прежде чем это отгружать.
|
|
257
|
+
|
|
258
|
+
<a id="skills"></a>
|
|
259
|
+
|
|
260
|
+
## 🪄 Скиллы
|
|
146
261
|
|
|
147
262
|
Тело скилла `modern-web-guidance` адаптировано из апстрима: он велит агенту вызывать инструменты этого плагина вместо
|
|
148
263
|
CLI через `npx`, сохраняет заметки про фреймворки/SSR/DOM и политику Baseline-фолбэков, убирает разделы про CLI и
|
|
149
264
|
телеметрию и проговаривает границу доверия — извлечённые гайды это справочный материал, а не инструкции. Скилл
|
|
150
265
|
`chrome-extensions` вложен без изменений и подгружает свои файлы из `references/` внутри каталога скилла.
|
|
151
266
|
|
|
152
|
-
|
|
267
|
+
<a id="security-and-limits"></a>
|
|
268
|
+
|
|
269
|
+
## 🛡 Безопасность и границы
|
|
153
270
|
|
|
154
271
|
Корпус — это сторонний текст, который попадает в контекст модели, а аргументы инструментов приходят от самой модели,
|
|
155
272
|
поэтому ограничены обе стороны:
|
|
@@ -157,7 +274,7 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
157
274
|
- **Ни сети, ни исполнения, одна локальная запись.** Плагин импортирует только локальные `node:fs`, `node:path` и
|
|
158
275
|
`node:url`; у него нет зависимостей и lifecycle-скриптов, поэтому при установке ничего не скачивается и не
|
|
159
276
|
выполняется. Единственный файл, который он пишет, — собственный файл счётчиков (см.
|
|
160
|
-
[Статистика использования](
|
|
277
|
+
[Статистика использования](#usage-stats)).
|
|
161
278
|
- **Гайды не могут протащить команды.** В телах гайдов апстрима есть перекрёстные ссылки вида
|
|
162
279
|
`npx -y modern-web-guidance@latest retrieve "…"` (197 вхождений в 64 гайдах). При загрузке индекса они
|
|
163
280
|
переписываются в `web_guidance_retrieve({"ids":["…"]})`, так что ничто прочитанное моделью из каталога не просит
|
|
@@ -176,7 +293,9 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
176
293
|
и запускаемые репро — лежит в [`audit/`](audit/); скрипты в `audit/repro/` завершаются с ненулевым кодом, пока дефект
|
|
177
294
|
жив.
|
|
178
295
|
|
|
179
|
-
|
|
296
|
+
<a id="usage-stats"></a>
|
|
297
|
+
|
|
298
|
+
## 📊 Статистика использования
|
|
180
299
|
|
|
181
300
|
С версии 0.2.0 плагин записывает, что именно спрашивают у трёх инструментов. Счётчики локальные: ни endpoint, ни аналитического
|
|
182
301
|
сервиса, ни стороннего SDK — за пределы машины ничего не уходит.
|
|
@@ -199,7 +318,9 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
199
318
|
|
|
200
319
|
Как выключить: `enabled: false` в конфиге плагина — тогда слушатель не регистрируется и файл не пишется.
|
|
201
320
|
|
|
202
|
-
|
|
321
|
+
<a id="sidebar-panel"></a>
|
|
322
|
+
|
|
323
|
+
## 🖥 Боковая панель
|
|
203
324
|
|
|
204
325
|
Плагин добавляет клиентскую часть: иконка в левом рейле открывает в центральной области панель
|
|
205
326
|
**Guidance Insights**. Это те же счётчики, что печатает `/guidance-stats`, только в виде экрана:
|
|
@@ -210,19 +331,24 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
210
331
|
- запросы, которые ничего не нашли
|
|
211
332
|
- сколько гайдов не извлекали ни разу
|
|
212
333
|
|
|
213
|
-
Единственный элемент управления — обновление: одна кнопка перечитывает счётчики.
|
|
334
|
+
Единственный элемент управления — обновление: одна кнопка перечитывает счётчики. Интерфейс панели переведён на
|
|
335
|
+
английский, русский и китайский.
|
|
214
336
|
|
|
215
337
|
Панель только читает. Она не меняет счётчики, не покидает машину и не добавляет ни сетевых вызовов, ни новых
|
|
216
338
|
инструментов — три инструмента остаются ровно тремя. `/guidance-stats` остаётся текстовой версией (в том числе
|
|
217
339
|
`--json`) для терминала и агента; панель — тот же отчёт в виде экрана.
|
|
218
340
|
|
|
219
|
-
|
|
341
|
+
<a id="configuration"></a>
|
|
342
|
+
|
|
343
|
+
## ⚙️ Конфигурация
|
|
220
344
|
|
|
221
345
|
Настройка не нужна, чтобы плагин работал. Он регистрирует инструменты и скиллы на контексте хоста и бездействует,
|
|
222
346
|
если в профиле нет сервисов `tools` или `skills`. Единственная настройка — `enabled` в конфиге плагина: `false`
|
|
223
|
-
выключает локальные счётчики (см. [Статистика использования](
|
|
347
|
+
выключает локальные счётчики (см. [Статистика использования](#usage-stats)).
|
|
224
348
|
|
|
225
|
-
|
|
349
|
+
<a id="updating-the-guide-corpus"></a>
|
|
350
|
+
|
|
351
|
+
## 🔄 Обновление корпуса гайдов
|
|
226
352
|
|
|
227
353
|
Корпус — это закреплённый срез апстрима `modern-web-guidance@1.0.0` (версия скилла `2026_11_09-5bcc021b`). Чтобы
|
|
228
354
|
обновить:
|
|
@@ -238,24 +364,87 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
238
364
|
Тесты также падают, если какой-то отданный гайд велит агенту запускать CLI апстрима, поэтому после обновления не
|
|
239
365
|
нужен ручной проход «убрать npx» — переписывание происходит при загрузке (`lib/guidance.js`, `CLI_REFERENCE`).
|
|
240
366
|
|
|
241
|
-
|
|
367
|
+
<a id="faq"></a>
|
|
368
|
+
|
|
369
|
+
## ❓ Частые вопросы
|
|
370
|
+
|
|
371
|
+
**Плагин установлен, но я ничего не вижу.** Бандл добавляет одну строку (`modern-web-guidance`) и не требует сборки.
|
|
372
|
+
Перезапустите DSH после `dsh plugin --profile desktop add …`; инструменты появятся в списке инструментов следующей
|
|
373
|
+
сессии, а панель — иконкой в левом рейле.
|
|
374
|
+
|
|
375
|
+
**Поиск не находит ничего полезного.** Запрос — это 2–5 слов, описывающих возможность («light dismiss dialog»,
|
|
376
|
+
«view transition», «container query»), а не предложение. Если запрос всё равно промахнулся, вызовите
|
|
377
|
+
`web_guidance_list` для обзора по категориям и оттуда извлекайте по id.
|
|
378
|
+
|
|
379
|
+
**Почему в результате `[experimental]`?** Платформенная возможность гайда закрыта Origin Trial или изменчива в одном
|
|
380
|
+
движке — см. [Экспериментальные гайды](#experimental-guides). Гайд всё равно задаёт правильную форму; проверьте её
|
|
381
|
+
фича-детектом, прежде чем отгружать.
|
|
382
|
+
|
|
383
|
+
**Что-нибудь уходит с моей машины?** Нет. Корпус лежит внутри пакета, поиск считается в процессе, сетевых вызовов нет.
|
|
384
|
+
Счётчики использования — локальные файлы, их можно выключить через `enabled: false` — см.
|
|
385
|
+
[Безопасность и границы](#security-and-limits) и [ADR 0001](docs/adr/0001-local-telemetry.md).
|
|
386
|
+
|
|
387
|
+
**Google говорит про 203 use case. Почему здесь 208?** Собственный счёт апстрима — 203 *use-case* гайда; в индексе
|
|
388
|
+
208 записей, лишние пять — обзорные гайды дисциплин (`accessibility`, `forms`, `html`, `performance`, `security`). Этот
|
|
389
|
+
плагин поставляет то, что в индексе.
|
|
390
|
+
|
|
391
|
+
**Какие версии DSH подходят?** `engines.dsh` — `>=0.2.0-rc.1 <0.3.0-0`, Node `>=22.19.0`. Инструменты работают сами по
|
|
392
|
+
себе; панели дополнительно нужны сервисы хоста `slots`, `locale` и `remote`.
|
|
393
|
+
|
|
394
|
+
<a id="roadmap"></a>
|
|
395
|
+
|
|
396
|
+
## 🚦 Дорожная карта
|
|
397
|
+
|
|
398
|
+
| Выпуск | Состояние | Что это |
|
|
399
|
+
| --- | --- | --- |
|
|
400
|
+
| 0.4.0 | вышел | корпус апстрима v1.0.0 (208 гайдов) плюс пометка экспериментальных |
|
|
401
|
+
| 0.4.1 | этот проход | документация: навигация, сравнение, карта каталога |
|
|
402
|
+
| 0.5.0 | следующий | `legacy-scan` четвёртым инструментом: 30–35 правил-регулярок, перенесённых из движка апстрима, только явные пути, только отчёт. Дизайн и вердикт: [docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
|
|
403
|
+
|
|
404
|
+
Намеренно **не** планируется: поставлять таблицы эмбеддингов апстрима на 9.16 MB или его движок `legacy-scan` на
|
|
405
|
+
4.99 MB со встроенным компилятором TypeScript. И то и другое сломало бы «ноль зависимостей рантайма, никакой сети,
|
|
406
|
+
никакой генерации кода» ради выигрыша, которого лексический индекс не показывает.
|
|
407
|
+
|
|
408
|
+
<a id="docs-map"></a>
|
|
409
|
+
|
|
410
|
+
## 📚 Карта документации
|
|
411
|
+
|
|
412
|
+
| Документ | Читать, когда |
|
|
413
|
+
| --- | --- |
|
|
414
|
+
| [`docs/README.md`](docs/README.md) | нужна полная карта этого репозитория |
|
|
415
|
+
| [`PUBLISHING.md`](PUBLISHING.md) | вы выпускаете релиз: правила npm, trusted publishing, ритуал релиза |
|
|
416
|
+
| [`docs/releases/README.md`](docs/releases/README.md) | вы пишете release notes — их стиль живёт здесь |
|
|
417
|
+
| [`AGENTS.md`](AGENTS.md) | вы агент, работающий в этом репозитории: CI, клиентская часть, соглашения |
|
|
418
|
+
| [`GLOSSARY.md`](GLOSSARY.md) | непонятен термин в этом коде |
|
|
419
|
+
| [`NOTICE`](NOTICE) | атрибуция: что пришло из апстрима, что осталось за бортом и почему |
|
|
420
|
+
| [`audit/`](audit) | нужны аудиты безопасности, корпуса и багов 0.1.x в том виде, как их писали |
|
|
421
|
+
| [`docs/adr/`](docs/adr) | нужны решения: локальная телеметрия и что за ней последовало |
|
|
422
|
+
| [`docs/notes/`](docs/notes) | нужно исследование, стоящее за релизом (диффы апстрима, feasibility-исследования, планы) |
|
|
423
|
+
|
|
424
|
+
<a id="development"></a>
|
|
425
|
+
|
|
426
|
+
## 🧑💻 Разработка
|
|
242
427
|
|
|
243
428
|
```shell
|
|
244
429
|
npm test
|
|
245
430
|
```
|
|
246
431
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
432
|
+
`npm test` запускает весь набор: `guidance.test.mjs` покрывает индекс, ранжирование, извлечение и стеммер;
|
|
433
|
+
`plugin.test.mjs` монтирует плагин на поддельном контексте Cordis; `hardening.test.mjs` защищает инварианты
|
|
434
|
+
безопасности; `report.test.mjs`, `stats.test.mjs`, `store.test.mjs` и `telemetry.test.mjs` покрывают конвейер
|
|
435
|
+
счётчиков; `client-locales.test.mjs` держит синхронными три словаря панели. В песочнице, где запрещены дочерние
|
|
251
436
|
процессы, запускайте файлы напрямую (`node test/hardening.test.mjs`).
|
|
252
437
|
|
|
253
|
-
|
|
438
|
+
<a id="publishing"></a>
|
|
439
|
+
|
|
440
|
+
## 📦 Публикация
|
|
254
441
|
|
|
255
442
|
Подача в каталог и шаги для npm описаны в [PUBLISHING.md](PUBLISHING.md); подготовленная запись для awesome-dsh-plugin
|
|
256
443
|
лежит в [`market/awesome-dsh-plugin.yml`](market/awesome-dsh-plugin.yml).
|
|
257
444
|
|
|
258
|
-
|
|
445
|
+
<a id="attribution-and-license"></a>
|
|
446
|
+
|
|
447
|
+
## ⚖️ Атрибуция и лицензия
|
|
259
448
|
|
|
260
449
|
Apache-2.0. Корпус гайдов, скилл `chrome-extensions` и исходный текст адаптированного `SKILL.md` взяты из
|
|
261
450
|
[GoogleChrome/modern-web-guidance](https://github.com/GoogleChrome/modern-web-guidance) (Copyright Google LLC,
|
package/README.zh.md
CHANGED
|
@@ -22,13 +22,28 @@
|
|
|
22
22
|
<p align="center">
|
|
23
23
|
<a href="LICENSE"><img alt="许可证" src="https://img.shields.io/badge/license-Apache--2.0-blue"></a>
|
|
24
24
|
<a href="package.json"><img alt="依赖" src="https://img.shields.io/badge/dependencies-0-brightgreen"></a>
|
|
25
|
-
<a href="
|
|
25
|
+
<a href="#security-and-limits"><img alt="遥测" src="https://img.shields.io/badge/telemetry-local--only-brightgreen"></a>
|
|
26
26
|
<a href="https://github.com/metapeka/dsh-modern-web-guidance/actions/workflows/test.yml"><img alt="测试" src="https://github.com/metapeka/dsh-modern-web-guidance/actions/workflows/test.yml/badge.svg"></a>
|
|
27
27
|
<a href="https://www.npmjs.com/package/dsh-modern-web-guidance"><img alt="npm" src="https://img.shields.io/npm/v/dsh-modern-web-guidance"></a>
|
|
28
28
|
<img alt="指南" src="https://img.shields.io/badge/guides-208-2563eb">
|
|
29
29
|
<img alt="DSH 插件" src="https://img.shields.io/badge/DSH-plugin-0d9488">
|
|
30
|
+
<a href="https://www.npmjs.com/package/dsh-modern-web-guidance"><img alt="npm 下载量" src="https://img.shields.io/npm/dm/dsh-modern-web-guidance"></a>
|
|
31
|
+
<a href="https://github.com/metapeka/dsh-modern-web-guidance/releases"><img alt="版本" src="https://img.shields.io/github/v/release/metapeka/dsh-modern-web-guidance?label=release"></a>
|
|
30
32
|
</p>
|
|
31
33
|
|
|
34
|
+
<details>
|
|
35
|
+
<summary>📑 目录</summary>
|
|
36
|
+
|
|
37
|
+
**开始使用** · [你得到什么](#what-you-get) · [安装](#install) · [如何使用](#how-to-use) · [何时用哪个工具](#which-tool-when)
|
|
38
|
+
|
|
39
|
+
**理解原理** · [与 Google 官方包的区别](#vs-google) · [检索如何工作](#how-search-works) · [目录地图](#catalog-map) · [实验性指南](#experimental-guides)
|
|
40
|
+
|
|
41
|
+
**日常操作** · [安全与边界](#security-and-limits) · [使用统计](#usage-stats) · [侧边栏面板](#sidebar-panel) · [配置](#configuration) · [更新语料](#updating-the-guide-corpus)
|
|
42
|
+
|
|
43
|
+
**其他** · [常见问题](#faq) · [路线图](#roadmap) · [文档地图](#docs-map) · [开发](#development) · [发布](#publishing) · [许可](#attribution-and-license)
|
|
44
|
+
|
|
45
|
+
</details>
|
|
46
|
+
|
|
32
47
|
---
|
|
33
48
|
|
|
34
49
|
编程模型默认会写出过时的 Web 代码,因为它们的训练数据里就是这些内容。这个插件把 208 篇经过筛选、节省 token 的
|
|
@@ -36,9 +51,11 @@
|
|
|
36
51
|
过渡、滚动驱动效果、`:has()`、passkey、`fetchpriority` 等),而不是自己写 JavaScript 变通方案或引入库。
|
|
37
52
|
|
|
38
53
|
一切都本地运行:指南随包分发,检索在进程内计算,没有网络请求。自 0.2.0 起就有使用统计,但它不离开这台机器 ——
|
|
39
|
-
见[使用统计](
|
|
54
|
+
见[使用统计](#usage-stats)。
|
|
40
55
|
|
|
41
|
-
|
|
56
|
+
<a id="what-you-get"></a>
|
|
57
|
+
|
|
58
|
+
## 🧰 你得到什么
|
|
42
59
|
|
|
43
60
|
| 类型 | 名称 | 说明 |
|
|
44
61
|
|---|---|---|
|
|
@@ -52,7 +69,9 @@
|
|
|
52
69
|
`visual-design`、`security`、`performance`、`built-in-ai`、`pwa`、`wasm`、`webmcp`、`privacy` 和
|
|
53
70
|
`user-experience`。
|
|
54
71
|
|
|
55
|
-
|
|
72
|
+
<a id="install"></a>
|
|
73
|
+
|
|
74
|
+
## 🚀 安装
|
|
56
75
|
|
|
57
76
|
从已发布的包安装:
|
|
58
77
|
|
|
@@ -75,10 +94,23 @@ dsh plugin --profile desktop add file:E:/path/to/dsh-modern-web-guidance
|
|
|
75
94
|
在智能体会话里,`plugin_manager` 的 `action: "install_bundle"` 加上包的绝对路径作为 `target`,效果相同。这个
|
|
76
95
|
bundle 只插入一行(`modern-web-guidance`),不需要构建步骤、依赖或原生模块。
|
|
77
96
|
|
|
78
|
-
|
|
97
|
+
<a id="how-to-use"></a>
|
|
98
|
+
|
|
99
|
+
## 🧭 如何使用
|
|
79
100
|
|
|
80
101
|
不需要任何配置:插件会自行注册,`modern-web-guidance` 技能会告诉智能体什么时候该用它。有三种使用方式。
|
|
81
102
|
|
|
103
|
+
<a id="which-tool-when"></a>
|
|
104
|
+
|
|
105
|
+
### 何时用哪个工具
|
|
106
|
+
|
|
107
|
+
| 你想要 | 调用 | 返回 |
|
|
108
|
+
| --- | --- | --- |
|
|
109
|
+
| “现在该怎么做?” | `web_guidance_search` | 用 2–5 个词描述能力,返回排好序的指南 id,可按分类过滤 |
|
|
110
|
+
| “把指南给我看” | `web_guidance_retrieve` | 完整 markdown,每次最多 10 篇或 120 000 字符 |
|
|
111
|
+
| “这里到底有什么?” | `web_guidance_list` | 各分类数量,或某个分类下的 id 与标题 |
|
|
112
|
+
| “目录真的有人在用吗?” | `/guidance-stats` | 文本形式的本地报告;`--json` 是面板读取的格式 |
|
|
113
|
+
|
|
82
114
|
### 1. 直接提出 Web 开发需求(默认方式)
|
|
83
115
|
|
|
84
116
|
技能的路由描述就是“在写 HTML、CSS 或客户端 JavaScript 之前先检索 208 篇用例指南”,所以一句平常的请求就够了 ——
|
|
@@ -128,7 +160,35 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
128
160
|
| 更快的 LCP | `prioritize hero image` | `fetchpriority` 相关指南 |
|
|
129
161
|
| Manifest V3 扩展 | (技能)`chrome-extensions` | 扩展技能的参考文件 |
|
|
130
162
|
|
|
131
|
-
|
|
163
|
+
<a id="vs-google"></a>
|
|
164
|
+
|
|
165
|
+
## 🆚 与 Google 官方包的区别
|
|
166
|
+
|
|
167
|
+
本插件**直接内置 Google 的语料** —— 同样的 208 篇指南,逐字节一致 —— 再补上 DeepSeek Harness 需要的那一层:
|
|
168
|
+
面向模型的工具、一个侧边栏面板,以及零运行时依赖。它没有重新实现上游的智能体,也刻意去掉了那些撑不过插件
|
|
169
|
+
体积与安全预算的引擎。老实说,差别是这样:
|
|
170
|
+
|
|
171
|
+
| | Google `modern-web-guidance` | 本插件 |
|
|
172
|
+
| --- | --- | --- |
|
|
173
|
+
| 形态 | npm 包:一个 CLI 加技能,用 `npx -y modern-web-guidance@latest …` 运行 | DSH 插件:3 个工具、2 个技能、一个侧边栏面板 |
|
|
174
|
+
| 受众 | 任何能执行 shell 命令的智能体 | DeepSeek Harness 会话 |
|
|
175
|
+
| 指南语料 | 208 篇已索引的指南(209 个 `.md` 文件,其中一个是逐字节副本) | 同样的 208 篇,逐字节一致,快照 `2026_11_09-5bcc021b` |
|
|
176
|
+
| 检索方式 | `gen/` 里预计算好的资源 —— 量化词向量(`query-words.i8`,7.47 MB)与分块 embedding,合计 9.16 MB | 在进程内用 `guides.json` 和指南正文构建 BM25:没有资源文件,不下载模型(在 30 条查询的探针上测得 29/30 的 top-1) |
|
|
177
|
+
| 运行时依赖 | Node 加上包里附带的 CLI 引擎 | 无 |
|
|
178
|
+
| 网络 | `npx` 先取包,之后本地运行 | 从不联网 —— 语料就在包里 |
|
|
179
|
+
| legacy-scan 扫描 | 4.99 MB 的 `legacy-scan` 引擎,带扫描 → 校验 → 报告 → 现代化四步工作流 | 未内置;计划在 0.5.0 里做成零依赖、只输出报告的 regex 扫描器 |
|
|
180
|
+
| 实验性指南 | 在 CLI 内部做门控 | `web_guidance_search` 结果里的 `[experimental]` 标记,`web_guidance_retrieve` 开头的警告横幅 |
|
|
181
|
+
| 使用情况洞察 | 无 | 本地计数、`/guidance-stats` 和侧边栏面板 |
|
|
182
|
+
| 语言 | 英文指南 | 同样的指南;文档 EN/RU/ZH,面板 EN/RU/ZH |
|
|
183
|
+
| 体积 | — | 254 个文件,打包 854 kB,解包 2.5 MB |
|
|
184
|
+
|
|
185
|
+
实际意味着:如果你在 DeepSeek Harness 之外工作,就用他们的包 —— 它是参考实现,语料也归它所有。在 Harness
|
|
186
|
+
里面,你要的是工具出现在模型的工具列表里、安装不需要构建步骤也不联网,以及一个能看出指南到底有没有人在用的
|
|
187
|
+
面板;那就是本插件。
|
|
188
|
+
|
|
189
|
+
<a id="how-search-works"></a>
|
|
190
|
+
|
|
191
|
+
## 🧠 检索如何工作
|
|
132
192
|
|
|
133
193
|
`lib/guidance.js` 在首次使用时为内置语料建立 BM25 索引(约 1.9 MB markdown,几百毫秒建好并缓存):标题、id、
|
|
134
194
|
描述、`featuresUsed`、各级标题与正文,配合停用词过滤、小型英文词干器、前缀扩展,以及精确 id/标题命中的加权。
|
|
@@ -137,18 +197,73 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
137
197
|
与上游的语义检索相比,短语式查询(`"light dismiss dialog"`、`"anchor positioning"`)会把对应的具体指南排在第一
|
|
138
198
|
位;宽泛的主题查询排序可能不同。如果检索没命中,`web_guidance_list` 会告诉你目录里有什么。
|
|
139
199
|
|
|
140
|
-
|
|
200
|
+
<a id="catalog-map"></a>
|
|
201
|
+
|
|
202
|
+
## 🗺 目录地图
|
|
203
|
+
|
|
204
|
+
一切都本地运行,所以目录好不好用,全看智能体能不能找到对的那篇指南。`web_guidance_list` 在运行时打印这些
|
|
205
|
+
数量;下面是快照 `2026_11_09-5bcc021b` 的样子。
|
|
206
|
+
|
|
207
|
+
<details>
|
|
208
|
+
<summary>各分类数量(208 篇指南,17 个分类)</summary>
|
|
209
|
+
|
|
210
|
+
| 分类 | 指南数 | 分类 | 指南数 |
|
|
211
|
+
| --- | --- | --- | --- |
|
|
212
|
+
| `ui-behaviors` | 40 | `html` | 8 |
|
|
213
|
+
| `performance` | 26 | `js` | 5 |
|
|
214
|
+
| `ui-components` | 22 | `accessibility` | 4 |
|
|
215
|
+
| `visual-design` | 22 | `built-in-ai` | 4 |
|
|
216
|
+
| `forms` | 19 | `user-experience` | 3 |
|
|
217
|
+
| `css` | 18 | `webmcp` | 3 |
|
|
218
|
+
| `security` | 17 | `pwa` | 2 |
|
|
219
|
+
| `ui-atoms` | 13 | `privacy` · `wasm` | 1 · 1 |
|
|
220
|
+
| | | **合计** | **208** |
|
|
221
|
+
|
|
222
|
+
</details>
|
|
223
|
+
|
|
224
|
+
<a id="experimental-guides"></a>
|
|
225
|
+
|
|
226
|
+
## 🧪 实验性指南
|
|
227
|
+
|
|
228
|
+
208 篇指南里有 18 篇讲的是不能默认可用的平台特性:其中 8 篇对应的功能在 Chrome 里还挂在 Origin Trial 后面,
|
|
229
|
+
另外 10 篇只在单一引擎里实现、仍不稳定。上游在自己的索引里给它们打了标记;本插件把这个标记放到智能体真正
|
|
230
|
+
看得到的地方:
|
|
231
|
+
|
|
232
|
+
- `web_guidance_search` 在命中的结果后面追加 `[experimental]`;
|
|
233
|
+
- `web_guidance_retrieve` 在指南开头放一段 `> [!WARNING]` 横幅,写明原因;
|
|
234
|
+
- 指南正文本身没有改动 —— 与上游逐字节一致 —— 横幅计入 120 000 字符的预算,不占 10 篇的次数上限。
|
|
235
|
+
|
|
236
|
+
<details>
|
|
237
|
+
<summary>被标记的 18 篇指南</summary>
|
|
238
|
+
|
|
239
|
+
**Origin Trial(8 篇)** —— 功能需要 trial token 才能开启:`verify-email-ownership`、`apply-webgl-shaders`、
|
|
240
|
+
`export-html-media-from-canvas`、`expose-canvas-content-to-browser-features`、`interactive-content-in-3d-scenes`、
|
|
241
|
+
`agentic-forms`、`agentic-javascript-tools`、`webmcp`。
|
|
242
|
+
|
|
243
|
+
**单一引擎内仍不稳定(10 篇)** —— 只有一个引擎实现了它,或者 API 还在变:`language-detection`、`language-model`、
|
|
244
|
+
`summarizer`、`translator`、`out-of-order-html-streaming`、`client-side-encryption`、`digital-signatures`、
|
|
245
|
+
`restrict-outbound-connections`、`2d-panning`、`custom-text-decorations`。
|
|
246
|
+
|
|
247
|
+
</details>
|
|
248
|
+
|
|
249
|
+
把带标记的指南当作“方案的轮廓,而不是保证”。先对它描述的特性做检测,上线前告诉用户哪一部分还挂在开关后面。
|
|
250
|
+
|
|
251
|
+
<a id="skills"></a>
|
|
252
|
+
|
|
253
|
+
## 🪄 技能
|
|
141
254
|
|
|
142
255
|
`modern-web-guidance` 技能正文改编自上游:它让智能体调用本插件的工具,而不是通过 `npx` 调 CLI;保留框架/SSR/DOM
|
|
143
256
|
相关说明与 Baseline 降级策略;删掉 CLI 与遥测章节;并明确信任边界 —— 取回的指南是参考资料,不是指令。
|
|
144
257
|
`chrome-extensions` 技能原样内置,并从技能目录的 `references/` 加载参考文件。
|
|
145
258
|
|
|
146
|
-
|
|
259
|
+
<a id="security-and-limits"></a>
|
|
260
|
+
|
|
261
|
+
## 🛡 安全与边界
|
|
147
262
|
|
|
148
263
|
语料是要进入模型上下文的第三方文本,而工具参数又来自该模型,所以两边都设了边界:
|
|
149
264
|
|
|
150
265
|
- **无网络、无执行,只有一次本地写入。** 插件只导入本地的 `node:fs`、`node:path` 和 `node:url`;没有依赖,也没有
|
|
151
|
-
lifecycle 脚本,因此安装时不会下载或运行任何东西。它唯一写入的文件是自己的计数文件(见[使用统计](
|
|
266
|
+
lifecycle 脚本,因此安装时不会下载或运行任何东西。它唯一写入的文件是自己的计数文件(见[使用统计](#usage-stats))。
|
|
152
267
|
- **指南里夹带不了命令。** 上游指南正文之间用
|
|
153
268
|
`npx -y modern-web-guidance@latest retrieve "…"` 互相引用(197 处,分布在 64 篇指南里)。建立索引时这些引用会被
|
|
154
269
|
改写成 `web_guidance_retrieve({"ids":["…"]})`,所以模型从目录里读到的内容不会要求它安装并执行一个未锁定版本的
|
|
@@ -165,7 +280,9 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
165
280
|
这两类性质由 `test/hardening.test.mjs` 覆盖,该文件在加固前的代码上会失败。完整审计 —— 三份报告与可运行的复现
|
|
166
281
|
脚本 —— 位于 [`audit/`](audit/);只要缺陷仍然存在,`audit/repro/` 下的脚本就会以非零码退出。
|
|
167
282
|
|
|
168
|
-
|
|
283
|
+
<a id="usage-stats"></a>
|
|
284
|
+
|
|
285
|
+
## 📊 使用统计
|
|
169
286
|
|
|
170
287
|
自 0.2.0 起,插件记录三个工具到底被问了什么。计数只在本地:没有上报端点、没有分析服务、没有第三方 SDK,任何东西都不离开这台
|
|
171
288
|
机器。
|
|
@@ -187,7 +304,9 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
187
304
|
|
|
188
305
|
关闭方式:在插件配置里设 `enabled: false` —— 此时不注册监听,也不写文件。
|
|
189
306
|
|
|
190
|
-
|
|
307
|
+
<a id="sidebar-panel"></a>
|
|
308
|
+
|
|
309
|
+
## 🖥 侧边栏面板
|
|
191
310
|
|
|
192
311
|
插件增加了客户端部分:左侧栏的图标会在中央区域打开 **Guidance Insights** 面板。它展示的就是
|
|
193
312
|
`/guidance-stats` 打印的那些计数,只是换成了界面:
|
|
@@ -203,12 +322,16 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
203
322
|
面板是只读的。它不改动计数、不离开这台机器,也不新增网络请求和工具 —— 三个工具仍然是三个。
|
|
204
323
|
`/guidance-stats` 仍然是给终端和智能体用的文本版本(含 `--json`);面板是同一份报告的界面版本。
|
|
205
324
|
|
|
206
|
-
|
|
325
|
+
<a id="configuration"></a>
|
|
326
|
+
|
|
327
|
+
## ⚙️ 配置
|
|
207
328
|
|
|
208
329
|
插件不需要配置就能工作。它把工具与技能注册到宿主上下文;如果 profile 没有 `tools` 或 `skills` 服务,它就保持
|
|
209
|
-
静默。唯一的设置是插件配置里的 `enabled`:设为 `false` 就关闭本地统计(见[使用统计](
|
|
330
|
+
静默。唯一的设置是插件配置里的 `enabled`:设为 `false` 就关闭本地统计(见[使用统计](#usage-stats))。
|
|
210
331
|
|
|
211
|
-
|
|
332
|
+
<a id="updating-the-guide-corpus"></a>
|
|
333
|
+
|
|
334
|
+
## 🔄 更新指南语料
|
|
212
335
|
|
|
213
336
|
语料是上游 `modern-web-guidance@1.0.0` 的锁定快照(技能版本 `2026_11_09-5bcc021b`)。更新步骤:
|
|
214
337
|
|
|
@@ -222,23 +345,81 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
222
345
|
测试同样会失败,所以刷新语料后不需要手工再清理一遍 npx —— 改写发生在加载时(`lib/guidance.js`,
|
|
223
346
|
`CLI_REFERENCE`)。
|
|
224
347
|
|
|
225
|
-
|
|
348
|
+
<a id="faq"></a>
|
|
349
|
+
|
|
350
|
+
## ❓ 常见问题
|
|
351
|
+
|
|
352
|
+
**插件装了却什么也看不到。** bundle 只插入一行(`modern-web-guidance`),不需要构建步骤。执行
|
|
353
|
+
`dsh plugin --profile desktop add …` 之后重启 DSH;工具会出现在下一次会话的工具列表里,面板则以左侧栏图标
|
|
354
|
+
的形式出现。
|
|
355
|
+
|
|
356
|
+
**检索结果没什么用。** 查询是用 2–5 个词描述一项能力(“light dismiss dialog”、“view transition”、
|
|
357
|
+
“container query”),不是整句。如果还是没命中,先调 `web_guidance_list` 看各分类总览,再按 id 取回。
|
|
358
|
+
|
|
359
|
+
**为什么结果里写着 `[experimental]`?** 指南讲的平台特性挂在 Origin Trial 后面,或者只在单一引擎里实现、仍
|
|
360
|
+
不稳定 —— 见[实验性指南](#experimental-guides)。指南本身仍然是正确的方向;上线前先做特性检测。
|
|
361
|
+
|
|
362
|
+
**会有东西离开这台机器吗?** 不会。语料就在包里,检索在进程内计算,没有任何网络请求。使用计数是本地文件,
|
|
363
|
+
可以用 `enabled: false` 关掉 —— 见[安全与边界](#security-and-limits)和 [ADR 0001](docs/adr/0001-local-telemetry.md)。
|
|
364
|
+
|
|
365
|
+
**Google 说 203 个用例,这里为什么写 208?** 上游自己数的是 203 篇*用例*指南;索引里有 208 条,多出来的 5 篇
|
|
366
|
+
是各领域总览(`accessibility`、`forms`、`html`、`performance`、`security`)。本插件跟着索引走。
|
|
367
|
+
|
|
368
|
+
**支持哪些 DSH 版本?** `engines.dsh` 是 `>=0.2.0-rc.1 <0.3.0-0`,Node 是 `>=22.19.0`。工具本身可以独立工作;
|
|
369
|
+
面板还需要宿主提供 `slots`、`locale` 和 `remote` 服务。
|
|
370
|
+
|
|
371
|
+
<a id="roadmap"></a>
|
|
372
|
+
|
|
373
|
+
## 🚦 路线图
|
|
374
|
+
|
|
375
|
+
| 版本 | 状态 | 内容 |
|
|
376
|
+
| --- | --- | --- |
|
|
377
|
+
| 0.4.0 | 已发布 | 上游 v1.0.0 语料(208 篇指南)加实验性标记 |
|
|
378
|
+
| 0.4.1 | 本次 | 文档:导航、对比表、目录地图 |
|
|
379
|
+
| 0.5.0 | 下一步 | `legacy-scan` 作为第四个工具:从上游引擎移植的 30–35 条 regex 规则,只接受显式路径,只输出报告。设计与结论:[docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
|
|
380
|
+
|
|
381
|
+
刻意**不**做的:内置上游那 9.16 MB 的 embedding 表,或者它那个附带 TypeScript 编译器的 4.99 MB `legacy-scan`
|
|
382
|
+
引擎。两者都会破坏“零运行时依赖、不联网、不生成代码”,而换来的收益在词法索引上根本看不出来。
|
|
383
|
+
|
|
384
|
+
<a id="docs-map"></a>
|
|
385
|
+
|
|
386
|
+
## 📚 文档地图
|
|
387
|
+
|
|
388
|
+
| 文档 | 什么时候读 |
|
|
389
|
+
| --- | --- |
|
|
390
|
+
| [`docs/README.md`](docs/README.md) | 想看这个仓库的完整地图 |
|
|
391
|
+
| [`PUBLISHING.md`](PUBLISHING.md) | 你要发版:npm 规则、trusted publishing、发布流程 |
|
|
392
|
+
| [`docs/releases/README.md`](docs/releases/README.md) | 你要写发布说明 —— 团队的行文风格就在这里 |
|
|
393
|
+
| [`AGENTS.md`](AGENTS.md) | 你是要在这个仓库里干活的智能体:CI、客户端部分、各项约定 |
|
|
394
|
+
| [`GLOSSARY.md`](GLOSSARY.md) | 某个术语在这个代码库里说不清楚 |
|
|
395
|
+
| [`NOTICE`](NOTICE) | 署名:哪些来自上游、哪些被去掉,以及为什么 |
|
|
396
|
+
| [`audit/`](audit) | 想看 0.1.x 的安全、语料与缺陷审计原文 |
|
|
397
|
+
| [`docs/adr/`](docs/adr) | 想看决策记录:本地遥测,以及之后的演变 |
|
|
398
|
+
| [`docs/notes/`](docs/notes) | 想看某次发布背后的调研(上游 diff、可行性研究、计划) |
|
|
399
|
+
|
|
400
|
+
<a id="development"></a>
|
|
401
|
+
|
|
402
|
+
## 🧑💻 开发
|
|
226
403
|
|
|
227
404
|
```shell
|
|
228
405
|
npm test
|
|
229
406
|
```
|
|
230
407
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
`
|
|
234
|
-
|
|
408
|
+
`npm test` 会跑整套测试:`guidance.test.mjs` 覆盖索引、排序、取回与词干器;`plugin.test.mjs` 用模拟的 Cordis
|
|
409
|
+
上下文挂载插件;`hardening.test.mjs` 守住安全不变量;`report.test.mjs`、`stats.test.mjs`、`store.test.mjs` 和
|
|
410
|
+
`telemetry.test.mjs` 覆盖计数管线;`client-locales.test.mjs` 保证面板的三份词典保持同步。在禁止子进程的沙箱
|
|
411
|
+
里,请直接运行文件(`node test/hardening.test.mjs`)。
|
|
412
|
+
|
|
413
|
+
<a id="publishing"></a>
|
|
235
414
|
|
|
236
|
-
## 发布
|
|
415
|
+
## 📦 发布
|
|
237
416
|
|
|
238
417
|
上架目录与 npm 发布步骤见 [PUBLISHING.md](PUBLISHING.md);已准备好的 awesome-dsh-plugin 条目位于
|
|
239
418
|
[`market/awesome-dsh-plugin.yml`](market/awesome-dsh-plugin.yml)。
|
|
240
419
|
|
|
241
|
-
|
|
420
|
+
<a id="attribution-and-license"></a>
|
|
421
|
+
|
|
422
|
+
## ⚖️ 署名与许可
|
|
242
423
|
|
|
243
424
|
Apache-2.0。指南语料、`chrome-extensions` 技能以及改编版 `SKILL.md` 的源文本来自
|
|
244
425
|
[GoogleChrome/modern-web-guidance](https://github.com/GoogleChrome/modern-web-guidance)(Copyright Google LLC,
|
package/client.js
CHANGED
|
@@ -111,6 +111,50 @@ window.__ModuleLoader__.load({
|
|
|
111
111
|
'error.hint': '/guidance-stats печатает тот же отчёт в терминале.',
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Simplified Chinese dictionary. Chinese has no plural inflection, so `call`, `hit` and `miss`
|
|
116
|
+
* define `.one`, `.few` and `.many` with the same text: `plural()` stays as it is and picks a
|
|
117
|
+
* form for every language.
|
|
118
|
+
*/
|
|
119
|
+
const ZH = {
|
|
120
|
+
'title': '指引使用统计',
|
|
121
|
+
'subtitle': '本插件在本机记录的计数器,只读。',
|
|
122
|
+
'refresh': '刷新',
|
|
123
|
+
'loading': '正在读取计数器...',
|
|
124
|
+
'updated': '更新于 {time}',
|
|
125
|
+
'kpi.calls': '总调用次数',
|
|
126
|
+
'kpi.hitRate': '命中率',
|
|
127
|
+
'kpi.period': '统计周期',
|
|
128
|
+
'kpi.periodValue': '最近 {days} 天',
|
|
129
|
+
'kpi.corpus': '指引数量',
|
|
130
|
+
'section.queries': '热门查询',
|
|
131
|
+
'section.queries.empty': '暂无可排序的查询。',
|
|
132
|
+
'section.coverage': '分类覆盖率',
|
|
133
|
+
'section.misses': '没有结果的查询',
|
|
134
|
+
'section.misses.empty': '没有查询返回空结果。',
|
|
135
|
+
'section.dead': '未被读过的指引',
|
|
136
|
+
'dead.summary': '{total} 篇指引中有 {count} 篇从未被检索',
|
|
137
|
+
'dead.none': '每篇指引都至少被检索过一次。',
|
|
138
|
+
'coverage.value': '{retrieved} / {total}',
|
|
139
|
+
'call.one': '{count} 次调用',
|
|
140
|
+
'call.few': '{count} 次调用',
|
|
141
|
+
'call.many': '{count} 次调用',
|
|
142
|
+
'hit.one': '{count} 次命中',
|
|
143
|
+
'hit.few': '{count} 次命中',
|
|
144
|
+
'hit.many': '{count} 次命中',
|
|
145
|
+
'miss.one': '{count} 次未命中',
|
|
146
|
+
'miss.few': '{count} 次未命中',
|
|
147
|
+
'miss.many': '{count} 次未命中',
|
|
148
|
+
'empty.title': '最近 {days} 天没有调用',
|
|
149
|
+
'empty.body': '使用 web_guidance_search 获取指引,然后刷新本面板。/guidance-stats 会以文本形式输出同一份报告。',
|
|
150
|
+
'error.title': '使用计数器不可用',
|
|
151
|
+
'error.bridge': '面板桥接不可用',
|
|
152
|
+
'error.bridgeHint': '当前页面无法访问主机命令桥接。/guidance-stats --json 会输出同一份报告。',
|
|
153
|
+
'error.session': '没有可运行 /guidance-stats 的会话',
|
|
154
|
+
'error.sessionHint': '打开或开始一个对话,然后点击刷新。',
|
|
155
|
+
'error.hint': '/guidance-stats 会在终端输出同一份报告。',
|
|
156
|
+
}
|
|
157
|
+
|
|
114
158
|
//#region helpers
|
|
115
159
|
|
|
116
160
|
/** A finite number, or 0: the report is JSON, so a missing field must read as zero. */
|
|
@@ -732,7 +776,7 @@ window.__ModuleLoader__.load({
|
|
|
732
776
|
*/
|
|
733
777
|
function apply(ctx) {
|
|
734
778
|
const t = ctx.locale.bind(NS)
|
|
735
|
-
ctx.effect(() => ctx.locale.register(NS, { en: EN, ru: RU }), 'modern-web-guidance: client dictionaries')
|
|
779
|
+
ctx.effect(() => ctx.locale.register(NS, { en: EN, ru: RU, zh: ZH }), 'modern-web-guidance: client dictionaries')
|
|
736
780
|
|
|
737
781
|
/**
|
|
738
782
|
* The one bridge. `ctx.remote` is the typed Remote service; a page that does not mount it
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
{
|
|
2
2
|
"name": "dsh-modern-web-guidance",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Modern web platform guidance for DeepSeek Harness agents: Google Chrome's 208-guide catalog with offline search and retrieve tools, plus a Chrome extensions (MV3) skill.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|