dsh-modern-web-guidance 0.6.0 → 0.7.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/README.md +44 -24
- package/README.ru.md +51 -30
- package/README.zh.md +40 -24
- package/client.js +1024 -33
- package/index.js +200 -45
- package/lib/report.js +92 -1
- package/lib/telemetry.js +132 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,6 +72,10 @@ optional `rules` list of up to 33 rule ids, and `format: 'summary' | 'json'`; it
|
|
|
72
72
|
and 8 MB per call, and returns at most 200 findings. It carries 33 rules, 30 of them upstream's; the
|
|
73
73
|
[parity note](docs/notes/legacy-scan-parity.md) accounts for what is still missing and for the one real debt.
|
|
74
74
|
|
|
75
|
+
The same scan is a human command, `/guidance-scan <paths> [--rules ls-01,ls-13] [--format summary|json]`: it reuses the
|
|
76
|
+
tool's scanner, its refusals and its caps, and refuses to run without at least one explicit path. The panel's scan
|
|
77
|
+
button is the same operation with `.` already filled in.
|
|
78
|
+
|
|
75
79
|
The catalog covers `css`, `ui-atoms`, `ui-components`, `ui-behaviors`, `forms`, `html`, `js`, `accessibility`,
|
|
76
80
|
`visual-design`, `security`, `performance`, `built-in-ai`, `pwa`, `wasm`, `webmcp`, `privacy`, and `user-experience`.
|
|
77
81
|
|
|
@@ -119,6 +123,7 @@ reach for it. There are three ways to work with it.
|
|
|
119
123
|
| "what is even in here?" | `web_guidance_list` | counts per category, or ids and titles for one category |
|
|
120
124
|
| "is the catalog actually being used?" | `/guidance-stats` | the local report as text; `--json` is what the panel reads |
|
|
121
125
|
| "will the code I am about to write or review use a legacy pattern?" | `web_guidance_legacy_scan` | findings for the paths you name explicitly, up to 200 per call |
|
|
126
|
+
| "do it myself, from the terminal" | `/guidance-scan src/` | the same findings as text; `--format json` gives the machine value, `--rules ls-01,ls-13` narrows the table |
|
|
122
127
|
|
|
123
128
|
### 1. Just ask for web work (default)
|
|
124
129
|
|
|
@@ -182,17 +187,17 @@ and security budget. The honest split:
|
|
|
182
187
|
|
|
183
188
|
| | Google `modern-web-guidance` | This plugin |
|
|
184
189
|
| --- | --- | --- |
|
|
185
|
-
| Shape | npm package: a CLI plus skills, run as `npx -y modern-web-guidance@latest …` | DSH plugin: 4 tools, 2 skills, a sidebar panel |
|
|
190
|
+
| Shape | npm package: a CLI plus skills, run as `npx -y modern-web-guidance@latest …` | DSH plugin: 4 tools, 2 skills, 2 human commands, a sidebar panel |
|
|
186
191
|
| Audience | any agent that can run a shell command | DeepSeek Harness sessions |
|
|
187
192
|
| Guide corpus | 208 indexed guides (209 `.md` files, one byte-identical duplicate) | the same 208, byte-identical, snapshot `2026_11_09-5bcc021b` |
|
|
188
193
|
| 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) |
|
|
189
194
|
| Runtime dependencies | Node plus the CLI engines shipped in the package | none |
|
|
190
195
|
| Network | `npx` fetches the package, then works locally | never — the corpus is inside the package |
|
|
191
|
-
| Legacy scan | a 4.99 MB `legacy-scan` engine with a four-step scan → verify → report → modernize workflow | shipped since 0.5.0: a dependency-free regex scanner over 33 rules, 30 of them upstream's, explicit paths only, report only |
|
|
196
|
+
| Legacy scan | a 4.99 MB `legacy-scan` engine with a four-step scan → verify → report → modernize workflow | shipped since 0.5.0: a dependency-free regex scanner over 33 rules, 30 of them upstream's, explicit paths only, report only — with `/guidance-scan` as its human command since 0.7.0 |
|
|
192
197
|
| Experimental guides | gated inside the CLI | `[experimental]` marker in `web_guidance_search`, warning banner in `web_guidance_retrieve` |
|
|
193
|
-
| Usage insight | none | local counters, `/guidance-stats
|
|
198
|
+
| Usage insight | none | local counters, the `/guidance-stats` report, the `/guidance-scan` command and a panel that maps both |
|
|
194
199
|
| Languages | English guides | the same guides; docs in EN/RU/ZH, panel in EN/RU/ZH |
|
|
195
|
-
| Size | — | 256 files,
|
|
200
|
+
| Size | — | 256 files, 893 kB packed, 2.6 MB unpacked |
|
|
196
201
|
|
|
197
202
|
What this means in practice: if you work outside DeepSeek Harness, use their package — it is the
|
|
198
203
|
reference implementation and it owns the corpus. Inside Harness you want the tools in the model's tool
|
|
@@ -298,7 +303,9 @@ sides are bounded:
|
|
|
298
303
|
- **The scanner reads only what it is given.** `web_guidance_legacy_scan` has no default target: the caller names 1–16
|
|
299
304
|
paths, each must resolve inside the session workspace, and a symlink that escapes it is skipped rather than followed.
|
|
300
305
|
It refuses absolute paths, paths outside the workspace and missing paths (`path-absolute`, `path-outside`,
|
|
301
|
-
`path-missing`), caps the read at 200 files, 512 kB per file and 8 MB per call, and never writes a byte.
|
|
306
|
+
`path-missing`), caps the read at 200 files, 512 kB per file and 8 MB per call, and never writes a byte. The human
|
|
307
|
+
command `/guidance-scan` goes through the same scanner, so it refuses the same paths and applies the same caps; it
|
|
308
|
+
also refuses to run with no path at all, so nothing can walk the whole workspace by accident.
|
|
302
309
|
- **The catalog cannot reach outside the package**: entry ids and categories must be slugs, and every resolved path is
|
|
303
310
|
checked to stay inside the data directory. A tampered `guides.json` used to be able to read any `*.md` on disk.
|
|
304
311
|
- **Failures retry and stay opaque**: a transient read error no longer poisons the tool for the session, and tool errors
|
|
@@ -329,7 +336,9 @@ The report is a human slash command, not a tool the agent can call:
|
|
|
329
336
|
counts, per-category hit counts, per-guide retrieve counts, and the last 1000 calls with their query text and returned
|
|
330
337
|
ids. Misses are the point — a count of misses that cannot be reproduced cannot be fixed.
|
|
331
338
|
|
|
332
|
-
0.5.0 adds a fourth row (`legacy-scan`) and a findings total to the same report.
|
|
339
|
+
0.5.0 adds a fourth row (`legacy-scan`) and a findings total to the same report. 0.7.0 keeps the scan detail with it:
|
|
340
|
+
the rules and guides the findings pointed at, and the last completed scan (when, files read, findings), which the report
|
|
341
|
+
prints as `Most matched rules: …` and `Last scan: …`. That detail is ids and numbers, never a path and never a snippet.
|
|
333
342
|
|
|
334
343
|
Where it lives: the profile's durable storage, the same trust boundary that already holds session logs. Retention
|
|
335
344
|
defaults to 90 days, and `--reset --yes` erases it.
|
|
@@ -341,20 +350,27 @@ Turn it off: set `enabled: false` in the plugin config — no listener is regist
|
|
|
341
350
|
## 🖥 Sidebar panel
|
|
342
351
|
|
|
343
352
|
The plugin adds a client half: a guidance icon in the left rail opens **Guidance Insights** in the central area. It
|
|
344
|
-
|
|
353
|
+
draws the counters `/guidance-stats` prints as a map, and answers four questions in that order:
|
|
354
|
+
|
|
355
|
+
- **how much, and how well** — total calls, and a hit rate over the calls that could hit (search hits, search misses and
|
|
356
|
+
unknown ids), with the report's own all-calls rate in the tile's tooltip; a `7 d` / `30 d` switch re-reads the window
|
|
357
|
+
- **when** — calls per day, one bar per day of the window
|
|
358
|
+
- **with what, and how it ended** — calls by tool and by outcome, side by side
|
|
359
|
+
- **what the scanner catches** — the last completed scan, the rules that matched most (up to 10) and the guides those
|
|
360
|
+
findings point at; the button below scans the session workspace folder and shows that run's result inline
|
|
345
361
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
- category coverage — retrieved guides against the 208 in the corpus
|
|
349
|
-
- the queries that found nothing
|
|
350
|
-
- how many guides were never retrieved
|
|
351
|
-
- the scanner's finding total for the same window
|
|
362
|
+
Below those, the report's lists: the most frequent queries with hit and miss counts, category coverage against the 208
|
|
363
|
+
guides, the queries that found nothing, and the dead guides — listed by id, up to 20.
|
|
352
364
|
|
|
353
|
-
|
|
365
|
+
Refresh re-reads the counters, and the `7 d` / `30 d` switch sends `/guidance-stats --json --days N` to the host. In a
|
|
366
|
+
conversation, a scan renders as a table — rule, place, confidence, guide — up to 16 rows and an "and N more" count,
|
|
367
|
+
whichever format the call asked for.
|
|
354
368
|
|
|
355
|
-
The panel is read-only
|
|
356
|
-
tools — the same four tools stay exactly four.
|
|
357
|
-
|
|
369
|
+
The panel is read-only apart from the scan button: it changes no counter, never leaves the machine, and adds no network
|
|
370
|
+
calls and no new tools — the same four tools stay exactly four. A scan it starts is counted like any other scan. Paths
|
|
371
|
+
and snippets stay out of the panel by design: the panel shows counters, not evidence, and the chat row is where files
|
|
372
|
+
and lines appear. `/guidance-stats` remains the text and `--json` version for the terminal and the agent, and
|
|
373
|
+
`/guidance-scan` is the text twin of the button.
|
|
358
374
|
|
|
359
375
|
<a id="configuration"></a>
|
|
360
376
|
|
|
@@ -362,7 +378,8 @@ terminal and for the agent; the panel is that report as a view.
|
|
|
362
378
|
|
|
363
379
|
The plugin needs no configuration to work. It registers its tools and skills on the host context and is inert when the
|
|
364
380
|
profile has no `tools` or `skills` service. The one setting is `enabled` on the plugin row: `false` turns the local
|
|
365
|
-
counters off
|
|
381
|
+
counters off, and `/guidance-stats` with them; `/guidance-scan` keeps working, because scanning is not counting (see
|
|
382
|
+
[Usage stats](#usage-stats)).
|
|
366
383
|
|
|
367
384
|
<a id="updating-the-guide-corpus"></a>
|
|
368
385
|
|
|
@@ -424,7 +441,8 @@ work on their own; the panel additionally needs the host's `slots`, `locale` and
|
|
|
424
441
|
| 0.4.0 | shipped | the upstream v1.0.0 corpus (208 guides) plus experimental marking |
|
|
425
442
|
| 0.4.1 | shipped | docs: navigation, the comparison, the catalog map |
|
|
426
443
|
| 0.5.0 | shipped | `legacy-scan` as the fourth tool: 30 regex rules, explicit paths only, report only — `web_guidance_legacy_scan`, with a fourth counter and a findings total in the panel. Design and verdict: [docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
|
|
427
|
-
| 0.6.0 |
|
|
444
|
+
| 0.6.0 | shipped | three more rules (`:host-context()`, text balancing, `select:invalid`) take the table to 33 rules, 30 of them upstream's, and a guide-hash guard keeps a rule honest after a corpus refresh |
|
|
445
|
+
| 0.7.0 | shipped | the panel becomes a map rather than a scoreboard — period switch, calls per day, per tool and per outcome, dead guides by id, an honest hit rate, what the scanner catches and a scan button — with `/guidance-scan` as the scanner's human command and a chat table for its findings |
|
|
428
446
|
|
|
429
447
|
Deliberately **not** planned: shipping upstream's 9.16 MB embedding tables, or its 4.99 MB
|
|
430
448
|
`legacy-scan` engine with a bundled TypeScript compiler. Both would break "zero runtime dependencies,
|
|
@@ -455,12 +473,14 @@ no network, no code generation" for a gain the lexical index does not show.
|
|
|
455
473
|
npm test
|
|
456
474
|
```
|
|
457
475
|
|
|
458
|
-
`npm test` runs
|
|
476
|
+
`npm test` runs 205 tests across fourteen files: `guidance.test.mjs` covers the index, ranking, retrieval and the stemmer;
|
|
459
477
|
`plugin.test.mjs` mounts the plugin against a fake Cordis context; `hardening.test.mjs` guards the security invariants;
|
|
460
|
-
`report.test.mjs`, `stats.test.mjs`, `store.test.mjs` and `telemetry.test.mjs` cover the counter pipeline
|
|
461
|
-
`scan-core.test.mjs`, `scan-rules.test.mjs` and `scan-tool.test.mjs` cover the scanner's containment, its
|
|
462
|
-
the tool contract,
|
|
463
|
-
|
|
478
|
+
`report.test.mjs`, `stats.test.mjs`, `store.test.mjs` and `telemetry.test.mjs` cover the counter pipeline and its 0.7.0
|
|
479
|
+
scan fields; `scan-core.test.mjs`, `scan-rules.test.mjs` and `scan-tool.test.mjs` cover the scanner's containment, its
|
|
480
|
+
rule table and the tool contract, `scan.test.mjs` is the end-to-end scan, and `scan-command.test.mjs` holds
|
|
481
|
+
`/guidance-scan` to the same refusals and the same values; `scan-guides.test.mjs` checks the guide hashes the rule table
|
|
482
|
+
points at, and `client-locales.test.mjs` keeps the panel's three dictionaries in sync. In a sandbox that forbids child
|
|
483
|
+
processes, run the files directly (`node test/hardening.test.mjs`).
|
|
464
484
|
|
|
465
485
|
<a id="publishing"></a>
|
|
466
486
|
|
package/README.ru.md
CHANGED
|
@@ -68,11 +68,15 @@ API платформы (нативные `<dialog>`/popover, anchor positioning,
|
|
|
68
68
|
| Скилл | `chrome-extensions` | Разработка Manifest V3 и требования Chrome Web Store |
|
|
69
69
|
|
|
70
70
|
Сканер работает только на чтение. `web_guidance_legacy_scan` принимает `paths` (1–16 файлов или каталогов, цели по
|
|
71
|
-
умолчанию нет), необязательный список `rules` до
|
|
71
|
+
умолчанию нет), необязательный список `rules` до 33 id правил и `format: 'summary' | 'json'`; за вызов он читает не
|
|
72
72
|
более 200 файлов, до 512 kB на файл и 8 MB суммарно, и возвращает не более 200 находок. В таблице 33 правила, из них
|
|
73
73
|
30 — правила апстрима; чего до сих пор не хватает и в чём единственный настоящий долг — в
|
|
74
74
|
[заметке о соответствии](docs/notes/legacy-scan-parity.md).
|
|
75
75
|
|
|
76
|
+
Тот же скан доступен человеку командой `/guidance-scan <paths> [--rules ls-01,ls-13] [--format summary|json]`: она
|
|
77
|
+
ходит через тот же сканер, с теми же отказами и лимитами, и не запускается без хотя бы одного явного пути. Кнопка
|
|
78
|
+
сканирования в панели — та же операция, где `.` уже подставлен.
|
|
79
|
+
|
|
76
80
|
Каталог покрывает `css`, `ui-atoms`, `ui-components`, `ui-behaviors`, `forms`, `html`, `js`, `accessibility`,
|
|
77
81
|
`visual-design`, `security`, `performance`, `built-in-ai`, `pwa`, `wasm`, `webmcp`, `privacy` и `user-experience`.
|
|
78
82
|
|
|
@@ -119,6 +123,7 @@ dsh plugin --profile desktop add file:E:/path/to/dsh-modern-web-guidance
|
|
|
119
123
|
| «что там вообще есть?» | `web_guidance_list` | счётчики по категориям или id и заголовки одной категории |
|
|
120
124
|
| «каталог вообще используется?» | `/guidance-stats` | локальный отчёт текстом; `--json` — это то, что читает панель |
|
|
121
125
|
| «код, который я собираюсь написать или проверить, не тянет legacy-паттерн?» | `web_guidance_legacy_scan` | находки по явно перечисленным путям, до 200 за вызов |
|
|
126
|
+
| «хочу прогнать проверку сам, из терминала» | `/guidance-scan src/` | те же находки текстом; `--format json` даёт машинное значение, `--rules ls-01,ls-13` сужает таблицу |
|
|
122
127
|
|
|
123
128
|
### 1. Просто попросить сделать веб-задачу (обычный режим)
|
|
124
129
|
|
|
@@ -181,17 +186,17 @@ DeepSeek Harness: инструменты для модели, боковую п
|
|
|
181
186
|
|
|
182
187
|
| | Google `modern-web-guidance` | Этот плагин |
|
|
183
188
|
| --- | --- | --- |
|
|
184
|
-
| Форма | npm-пакет: CLI плюс скиллы, запуск как `npx -y modern-web-guidance@latest …` | плагин DSH: 4 инструмента, 2 скилла, боковая панель |
|
|
189
|
+
| Форма | npm-пакет: CLI плюс скиллы, запуск как `npx -y modern-web-guidance@latest …` | плагин DSH: 4 инструмента, 2 скилла, 2 человеческие команды, боковая панель |
|
|
185
190
|
| Аудитория | любой агент, умеющий запускать команды в оболочке | сессии DeepSeek Harness |
|
|
186
191
|
| Корпус гайдов | 208 проиндексированных гайдов (209 файлов `.md`, один побайтовый дубль) | те же 208, побайтово идентичны, срез `2026_11_09-5bcc021b` |
|
|
187
192
|
| Поиск | предвычисленные ассеты в `gen/` — квантованные векторы слов (`query-words.i8`, 7.47 MB) и эмбеддинги чанков, 9.16 MB вместе | BM25 строится в процессе из `guides.json` и тел гайдов: без ассетов, без скачивания модели (измерено 29/30 top-1 на пробе из 30 запросов) |
|
|
188
193
|
| Зависимости рантайма | Node плюс движки CLI, поставляемые в пакете | нет |
|
|
189
194
|
| Сеть | `npx` скачивает пакет, дальше всё локально | никогда — корпус лежит внутри пакета |
|
|
190
|
-
| Сканер legacy | движок `legacy-scan` на 4.99 MB с четырёхшаговым процессом scan → verify → report → modernize | поставляется с 0.5.0: сканер регулярными выражениями без зависимостей, 33 правила, из них 30 — правила апстрима, только явные пути, только отчёт |
|
|
195
|
+
| Сканер legacy | движок `legacy-scan` на 4.99 MB с четырёхшаговым процессом scan → verify → report → modernize | поставляется с 0.5.0: сканер регулярными выражениями без зависимостей, 33 правила, из них 30 — правила апстрима, только явные пути, только отчёт — а с 0.7.0 у него есть человеческая команда `/guidance-scan` |
|
|
191
196
|
| Экспериментальные гайды | закрыты внутри CLI | маркер `[experimental]` в `web_guidance_search`, предупреждающий баннер в `web_guidance_retrieve` |
|
|
192
|
-
| Анализ использования | нет | локальные счётчики, `/guidance-stats` и
|
|
197
|
+
| Анализ использования | нет | локальные счётчики, отчёт `/guidance-stats`, команда `/guidance-scan` и панель, которая показывает и то и другое |
|
|
193
198
|
| Языки | гайды на английском | те же гайды; документация на EN/RU/ZH, панель на EN/RU/ZH |
|
|
194
|
-
| Размер | — | 256 файлов,
|
|
199
|
+
| Размер | — | 256 файлов, 893 kB в упаковке, 2.6 MB распакованного |
|
|
195
200
|
|
|
196
201
|
Что это значит на практике: если вы работаете вне DeepSeek Harness, берите их пакет — это референсная реализация, и
|
|
197
202
|
корпус принадлежит им. Внутри Harness нужны инструменты в списке инструментов модели, установка без сборки и без сети и
|
|
@@ -298,6 +303,8 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
298
303
|
1–16 путей, каждый обязан разрешаться внутри воркспейса сессии, а симлинк, уводящий наружу, пропускается, а не
|
|
299
304
|
читается. Абсолютные пути, пути за пределами воркспейса и отсутствующие пути он отклоняет (`path-absolute`,
|
|
300
305
|
`path-outside`, `path-missing`), чтение ограничено 200 файлами, 512 kB на файл и 8 MB на вызов, и он не пишет ни байта.
|
|
306
|
+
Человеческая команда `/guidance-scan` идёт через тот же сканер, поэтому отклоняет те же пути и держит те же лимиты;
|
|
307
|
+
она ещё и не запускается без пути, так что случайно пройтись по всему воркспейсу нечем.
|
|
301
308
|
- **Каталог не может выйти за пределы пакета**: id и категории записей обязаны быть слагами, и каждый разрешённый путь
|
|
302
309
|
проверяется на принадлежность каталогу данных. Подменённый `guides.json` раньше мог прочитать любой `*.md` на диске.
|
|
303
310
|
- **Сбои повторяются и не раскрывают лишнего**: случайная ошибка чтения больше не отравляет инструмент на всю сессию,
|
|
@@ -327,7 +334,10 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
327
334
|
счётчики по дням, попадания по категориям, извлечения по гайдам и последние 1000 вызовов с текстом запроса и
|
|
328
335
|
возвращёнными id. Промахи как раз и нужны — промах, который нельзя воспроизвести, нельзя исправить.
|
|
329
336
|
|
|
330
|
-
0.5.0 добавляет в тот же отчёт четвёртую строку (`legacy-scan`) и итог по находкам.
|
|
337
|
+
0.5.0 добавляет в тот же отчёт четвёртую строку (`legacy-scan`) и итог по находкам. 0.7.0 добавляет к этому
|
|
338
|
+
детализацию: какие правила и гайды дали находки, и последнее завершённое сканирование — когда, сколько файлов
|
|
339
|
+
прочитано, сколько находок; в отчёте это строки `Most matched rules: …` и `Last scan: …`. Только id и числа, ни
|
|
340
|
+
путей, ни сниппетов.
|
|
331
341
|
|
|
332
342
|
Где лежит: durable-хранилище профиля — та же граница доверия, где уже лежат логи сессий. Срок хранения по умолчанию
|
|
333
343
|
90 дней, `--reset --yes` стирает всё.
|
|
@@ -339,22 +349,29 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
339
349
|
## 🖥 Боковая панель
|
|
340
350
|
|
|
341
351
|
Плагин добавляет клиентскую часть: иконка в левом рейле открывает в центральной области панель
|
|
342
|
-
**Guidance Insights**. Это те же счётчики, что печатает `/guidance-stats
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
352
|
+
**Guidance Insights**. Это те же счётчики, что печатает `/guidance-stats`, но в виде карты: панель отвечает на
|
|
353
|
+
четыре вопроса по порядку:
|
|
354
|
+
|
|
355
|
+
- **сколько и насколько удачно** — всего вызовов и доля попаданий, посчитанная по вызовам, которые вообще могли
|
|
356
|
+
попасть (попадания поиска, промахи поиска, неизвестные id); доля «по всем вызовам», как её считает отчёт, лежит в
|
|
357
|
+
подсказке плитки. Переключатель `7 дн.` / `30 дн.` перечитывает окно
|
|
358
|
+
- **когда** — вызовы по дням, по столбику на день окна
|
|
359
|
+
- **чем и с каким исходом** — вызовы по инструментам и по исходам, рядом
|
|
360
|
+
- **что находит сканер** — последнее завершённое сканирование, чаще всего сработавшие правила (до 10) и гайды, на
|
|
361
|
+
которые указывают эти находки; кнопка ниже сканирует рабочую папку сессии и показывает результат этого прогона тут же
|
|
362
|
+
|
|
363
|
+
Дальше идут списки из отчёта: частые запросы с попаданиями и промахами, покрытие категорий против 208 гайдов,
|
|
364
|
+
запросы без результата и непрочитанные гайды — списком id, до 20.
|
|
365
|
+
|
|
366
|
+
Обновление перечитывает счётчики, а переключатель `7 дн.` / `30 дн.` отправляет хосту
|
|
367
|
+
`/guidance-stats --json --days N`. В диалоге сканирование показывается таблицей — правило, место, уверенность,
|
|
368
|
+
гайд — до 16 строк и «и ещё N», в каком бы формате его ни запросили.
|
|
369
|
+
|
|
370
|
+
Панель только читает, кроме кнопки сканирования: она не меняет счётчики и не покидает машину, сетевых вызовов и
|
|
371
|
+
новых инструментов не добавляет — четыре инструмента остаются ровно четырьмя. Запущенное из неё сканирование
|
|
372
|
+
считается как любое другое. Путей и сниппетов в панели нет намеренно: панель показывает счётчики, а не
|
|
373
|
+
доказательства, — файлы и строки видны в строке вызова в диалоге. `/guidance-stats` остаётся текстовой версией (в том
|
|
374
|
+
числе `--json`) для терминала и агента, а `/guidance-scan` — текстовая пара кнопки.
|
|
358
375
|
|
|
359
376
|
<a id="configuration"></a>
|
|
360
377
|
|
|
@@ -362,7 +379,8 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
362
379
|
|
|
363
380
|
Настройка не нужна, чтобы плагин работал. Он регистрирует инструменты и скиллы на контексте хоста и бездействует,
|
|
364
381
|
если в профиле нет сервисов `tools` или `skills`. Единственная настройка — `enabled` в конфиге плагина: `false`
|
|
365
|
-
выключает локальные
|
|
382
|
+
выключает локальные счётчики, а вместе с ними и `/guidance-stats`; `/guidance-scan` продолжает работать, потому что
|
|
383
|
+
сканирование — не подсчёт (см. [Статистика использования](#usage-stats)).
|
|
366
384
|
|
|
367
385
|
<a id="updating-the-guide-corpus"></a>
|
|
368
386
|
|
|
@@ -424,7 +442,8 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
424
442
|
| 0.4.0 | вышел | корпус апстрима v1.0.0 (208 гайдов) плюс пометка экспериментальных |
|
|
425
443
|
| 0.4.1 | вышел | документация: навигация, сравнение, карта каталога |
|
|
426
444
|
| 0.5.0 | вышел | `legacy-scan` четвёртым инструментом: 30 правил-регулярок, только явные пути, только отчёт — `web_guidance_legacy_scan`, с четвёртым счётчиком и итогом по находкам в панели. Дизайн и вердикт: [docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
|
|
427
|
-
| 0.6.0 |
|
|
445
|
+
| 0.6.0 | вышел | ещё три правила (`:host-context()`, балансировка текста, `select:invalid`) — в таблице 33 правила, 30 из них апстрима, плюс страховка по хешам гайдов: после обновления корпуса правило не устареет молча |
|
|
446
|
+
| 0.7.0 | вышел | панель из табло превращается в карту: переключатель окна, вызовы по дням, по инструментам и исходам, непрочитанные гайды списком id, честная доля попаданий, что находит сканер, и кнопка сканирования; плюс `/guidance-scan` — человеческая команда сканера — и таблица находок в диалоге |
|
|
428
447
|
|
|
429
448
|
Намеренно **не** планируется: поставлять таблицы эмбеддингов апстрима на 9.16 MB или его движок `legacy-scan` на
|
|
430
449
|
4.99 MB со встроенным компилятором TypeScript. И то и другое сломало бы «ноль зависимостей рантайма, никакой сети,
|
|
@@ -455,12 +474,14 @@ CLI через `npx`, сохраняет заметки про фреймвор
|
|
|
455
474
|
npm test
|
|
456
475
|
```
|
|
457
476
|
|
|
458
|
-
`npm test` запускает
|
|
459
|
-
стеммер; `plugin.test.mjs` монтирует плагин на поддельном контексте Cordis; `hardening.test.mjs` защищает инварианты
|
|
460
|
-
безопасности; `report.test.mjs`, `stats.test.mjs`, `store.test.mjs` и `telemetry.test.mjs` покрывают конвейер
|
|
461
|
-
|
|
462
|
-
правил и контракт инструмента,
|
|
463
|
-
|
|
477
|
+
`npm test` запускает 205 тестов в четырнадцати файлах: `guidance.test.mjs` покрывает индекс, ранжирование, извлечение
|
|
478
|
+
и стеммер; `plugin.test.mjs` монтирует плагин на поддельном контексте Cordis; `hardening.test.mjs` защищает инварианты
|
|
479
|
+
безопасности; `report.test.mjs`, `stats.test.mjs`, `store.test.mjs` и `telemetry.test.mjs` покрывают конвейер счётчиков
|
|
480
|
+
и его поля сканера из 0.7.0; `scan-core.test.mjs`, `scan-rules.test.mjs` и `scan-tool.test.mjs` покрывают изоляцию
|
|
481
|
+
сканера, его таблицу правил и контракт инструмента, `scan.test.mjs` — сквозной скан, а `scan-command.test.mjs` держит
|
|
482
|
+
`/guidance-scan` на тех же отказах и тех же значениях; `scan-guides.test.mjs` сверяет хеши гайдов, на которые указывает
|
|
483
|
+
таблица правил; `client-locales.test.mjs` держит синхронными три словаря панели. В песочнице, где запрещены дочерние
|
|
484
|
+
процессы, запускайте файлы напрямую (`node test/hardening.test.mjs`).
|
|
464
485
|
|
|
465
486
|
<a id="publishing"></a>
|
|
466
487
|
|
package/README.zh.md
CHANGED
|
@@ -67,9 +67,12 @@
|
|
|
67
67
|
| 技能 | `chrome-extensions` | Manifest V3 开发与 Chrome Web Store 上架要求 |
|
|
68
68
|
|
|
69
69
|
扫描器只读不写。`web_guidance_legacy_scan` 接受 `paths`(1–16 个文件或目录,没有默认目标)、可选的 `rules`(最多
|
|
70
|
-
|
|
70
|
+
33 个规则 id)和 `format: 'summary' | 'json'`;每次调用最多读 200 个文件、单文件 512 kB、合计 8 MB,最多返回
|
|
71
71
|
200 条发现。表里一共 33 条规则,覆盖上游 35 条中的 30 条;剩下没覆盖的规则、以及唯一真正的一笔技术债,都记在[对照说明](docs/notes/legacy-scan-parity.md)里。
|
|
72
72
|
|
|
73
|
+
同一套扫描也给人留了一条命令:`/guidance-scan <paths> [--rules ls-01,ls-13] [--format summary|json]`。它走同一个
|
|
74
|
+
扫描器、同一套拒绝规则和上限,而且不给至少一个显式路径就不跑。面板上的扫描按钮就是这条操作,只是把 `.` 替你填好。
|
|
75
|
+
|
|
73
76
|
目录覆盖 `css`、`ui-atoms`、`ui-components`、`ui-behaviors`、`forms`、`html`、`js`、`accessibility`、
|
|
74
77
|
`visual-design`、`security`、`performance`、`built-in-ai`、`pwa`、`wasm`、`webmcp`、`privacy` 和
|
|
75
78
|
`user-experience`。
|
|
@@ -116,6 +119,7 @@ bundle 只插入一行(`modern-web-guidance`),不需要构建步骤、依
|
|
|
116
119
|
| “这里到底有什么?” | `web_guidance_list` | 各分类数量,或某个分类下的 id 与标题 |
|
|
117
120
|
| “目录真的有人在用吗?” | `/guidance-stats` | 文本形式的本地报告;`--json` 是面板读取的格式 |
|
|
118
121
|
| “我正要写或要审的代码会不会用上过时写法?” | `web_guidance_legacy_scan` | 对显式列出的路径给出发现,每次最多 200 条 |
|
|
122
|
+
| “想自己在终端里跑一遍” | `/guidance-scan src/` | 同样的发现,文本形式;`--format json` 给出机器可读的原始值,`--rules ls-01,ls-13` 收窄规则表 |
|
|
119
123
|
|
|
120
124
|
### 1. 直接提出 Web 开发需求(默认方式)
|
|
121
125
|
|
|
@@ -176,17 +180,17 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
176
180
|
|
|
177
181
|
| | Google `modern-web-guidance` | 本插件 |
|
|
178
182
|
| --- | --- | --- |
|
|
179
|
-
| 形态 | npm 包:一个 CLI 加技能,用 `npx -y modern-web-guidance@latest …` 运行 | DSH 插件:4 个工具、2
|
|
183
|
+
| 形态 | npm 包:一个 CLI 加技能,用 `npx -y modern-web-guidance@latest …` 运行 | DSH 插件:4 个工具、2 个技能、2 条给人用的命令、一个侧边栏面板 |
|
|
180
184
|
| 受众 | 任何能执行 shell 命令的智能体 | DeepSeek Harness 会话 |
|
|
181
185
|
| 指南语料 | 208 篇已索引的指南(209 个 `.md` 文件,其中一个是逐字节副本) | 同样的 208 篇,逐字节一致,快照 `2026_11_09-5bcc021b` |
|
|
182
186
|
| 检索方式 | `gen/` 里预计算好的资源 —— 量化词向量(`query-words.i8`,7.47 MB)与分块 embedding,合计 9.16 MB | 在进程内用 `guides.json` 和指南正文构建 BM25:没有资源文件,不下载模型(在 30 条查询的探针上测得 29/30 的 top-1) |
|
|
183
187
|
| 运行时依赖 | Node 加上包里附带的 CLI 引擎 | 无 |
|
|
184
188
|
| 网络 | `npx` 先取包,之后本地运行 | 从不联网 —— 语料就在包里 |
|
|
185
|
-
| legacy-scan 扫描 | 4.99 MB 的 `legacy-scan` 引擎,带扫描 → 校验 → 报告 → 现代化四步工作流 | 0.5.0 起内置:零依赖的正则扫描器,33 条规则(其中 30
|
|
189
|
+
| legacy-scan 扫描 | 4.99 MB 的 `legacy-scan` 引擎,带扫描 → 校验 → 报告 → 现代化四步工作流 | 0.5.0 起内置:零依赖的正则扫描器,33 条规则(其中 30 条对应上游规则),只接受显式路径,只输出报告;0.7.0 起还多了一条给人用的命令 `/guidance-scan` |
|
|
186
190
|
| 实验性指南 | 在 CLI 内部做门控 | `web_guidance_search` 结果里的 `[experimental]` 标记,`web_guidance_retrieve` 开头的警告横幅 |
|
|
187
|
-
| 使用情况洞察 | 无 | 本地计数、`/guidance-stats`
|
|
191
|
+
| 使用情况洞察 | 无 | 本地计数、`/guidance-stats` 报告、`/guidance-scan` 命令,以及把两者都画出来的侧边栏面板 |
|
|
188
192
|
| 语言 | 英文指南 | 同样的指南;文档 EN/RU/ZH,面板 EN/RU/ZH |
|
|
189
|
-
| 体积 | — | 256 个文件,打包
|
|
193
|
+
| 体积 | — | 256 个文件,打包 893 kB,解包 2.6 MB |
|
|
190
194
|
|
|
191
195
|
实际意味着:如果你在 DeepSeek Harness 之外工作,就用他们的包 —— 它是参考实现,语料也归它所有。在 Harness
|
|
192
196
|
里面,你要的是工具出现在模型的工具列表里、安装不需要构建步骤也不联网,以及一个能看出指南到底有没有人在用的
|
|
@@ -282,7 +286,8 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
282
286
|
- **扫描器只读它被明确给定的内容。** `web_guidance_legacy_scan` 没有默认目标:调用方要给出 1–16 个路径,每个路径
|
|
283
287
|
都必须落在会话工作区内,指向区外的符号链接会被跳过而不是跟随。绝对路径、工作区外的路径和不存在路径会被拒绝
|
|
284
288
|
(`path-absolute`、`path-outside`、`path-missing`),读取上限为 200 个文件、单文件 512 kB、每次 8 MB,并且它不写
|
|
285
|
-
|
|
289
|
+
任何一个字节。给人用的 `/guidance-scan` 走同一个扫描器,所以拒绝同样的路径、执行同样的上限;它也不接受空路径,
|
|
290
|
+
因此没有任何命令会顺手把整个工作区扫一遍。
|
|
286
291
|
- **目录无法越出包外**:条目 id 与分类必须是 slug,每个解析出的路径都会校验是否位于数据目录内。被篡改的
|
|
287
292
|
`guides.json` 此前可以读取磁盘上任意 `*.md`。
|
|
288
293
|
- **失败会重试,且不泄露信息**:一次临时的读取错误不再让工具在本次会话中永久失效,错误信息也不再暴露安装的
|
|
@@ -312,7 +317,9 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
312
317
|
命中次数、各指南被取回次数,以及最近 1000 次调用携带的查询文本和返回的 id。未命中的查询才是重点 —— 无法复现的
|
|
313
318
|
未命中就无法修复。
|
|
314
319
|
|
|
315
|
-
0.5.0 在同一份报告里加了第四行(`legacy-scan`)和一个发现总数。
|
|
320
|
+
0.5.0 在同一份报告里加了第四行(`legacy-scan`)和一个发现总数。0.7.0 把扫描的细节也留在报告里:命中过哪些规则和
|
|
321
|
+
指南,以及最近一次完成的扫描(时间、读了几个文件、多少条发现)—— 报告里就是 `Most matched rules: …` 与
|
|
322
|
+
`Last scan: …` 两行。只有 id 和数字,没有路径,也没有代码片段。
|
|
316
323
|
|
|
317
324
|
存放位置:profile 的持久存储,也就是本来就存会话日志的那层信任边界。默认保留 90 天,`--reset --yes` 会立即清空。
|
|
318
325
|
|
|
@@ -322,27 +329,33 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
322
329
|
|
|
323
330
|
## 🖥 侧边栏面板
|
|
324
331
|
|
|
325
|
-
插件增加了客户端部分:左侧栏的图标会在中央区域打开 **Guidance Insights**
|
|
326
|
-
|
|
332
|
+
插件增加了客户端部分:左侧栏的图标会在中央区域打开 **Guidance Insights** 面板。它把 `/guidance-stats` 打印的计数
|
|
333
|
+
画成一张地图,按顺序回答四个问题:
|
|
334
|
+
|
|
335
|
+
- **用了多少、准不准** —— 总调用次数,以及按“本来可能命中”的调用算出的命中率(检索命中、检索未命中、未知 id);
|
|
336
|
+
报告里那个“按全部调用算”的比例放在图块的提示里。`7 天` / `30 天` 开关重新读取时间窗口
|
|
337
|
+
- **什么时候用的** —— 每日调用,一天一根柱子
|
|
338
|
+
- **用什么、结果如何** —— 按工具和按结果的两列并列
|
|
339
|
+
- **扫描器发现了什么** —— 最近一次完成的扫描、命中最多(最多 10 条)的规则,以及这些发现指向的指南;下面的按钮
|
|
340
|
+
扫描当前会话的工作区文件夹,并把这一次的结果就地显示出来
|
|
327
341
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
- 分类覆盖情况 —— 已取回的指南对 208 篇语料
|
|
331
|
-
- 什么都没找到的查询
|
|
332
|
-
- 有多少篇指南从未被取回过
|
|
333
|
-
- 同一时间窗口内扫描器的发现总数
|
|
342
|
+
再往下是报告里的清单:热门查询及其各自的命中与未命中、对 208 篇指南的分类覆盖、没有结果的查询,以及从未被
|
|
343
|
+
检索过的指南 —— 按 id 列出,最多 20 条。
|
|
334
344
|
|
|
335
|
-
|
|
345
|
+
刷新会重新读取计数,`7 天` / `30 天` 开关则把 `/guidance-stats --json --days N` 发给宿主。对话里,扫描结果渲染成
|
|
346
|
+
表格 —— 规则、位置、置信度、指南 —— 最多 16 行,多出来的显示“另有 N 条”,不管调用要的是哪种格式。
|
|
336
347
|
|
|
337
|
-
|
|
338
|
-
|
|
348
|
+
面板除了扫描按钮之外只读:它不改计数、不离开这台机器,也不新增网络请求和工具 —— 四个工具仍然是四个。由它发起的
|
|
349
|
+
扫描和别的扫描一样计数。面板里刻意不显示路径和代码片段:面板给的是计数,不是证据;文件和行号在对话的那条工具
|
|
350
|
+
调用里。`/guidance-stats` 仍然是给终端和智能体用的文本版本(含 `--json`),而 `/guidance-scan` 是按钮的文本版本。
|
|
339
351
|
|
|
340
352
|
<a id="configuration"></a>
|
|
341
353
|
|
|
342
354
|
## ⚙️ 配置
|
|
343
355
|
|
|
344
356
|
插件不需要配置就能工作。它把工具与技能注册到宿主上下文;如果 profile 没有 `tools` 或 `skills` 服务,它就保持
|
|
345
|
-
静默。唯一的设置是插件配置里的 `enabled`:设为 `false`
|
|
357
|
+
静默。唯一的设置是插件配置里的 `enabled`:设为 `false` 就关闭本地统计,`/guidance-stats` 也随之消失;`/guidance-scan`
|
|
358
|
+
照常可用,因为扫描不是计数(见[使用统计](#usage-stats))。
|
|
346
359
|
|
|
347
360
|
<a id="updating-the-guide-corpus"></a>
|
|
348
361
|
|
|
@@ -397,7 +410,8 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
397
410
|
| 0.4.0 | 已发布 | 上游 v1.0.0 语料(208 篇指南)加实验性标记 |
|
|
398
411
|
| 0.4.1 | 已发布 | 文档:导航、对比表、目录地图 |
|
|
399
412
|
| 0.5.0 | 已发布 | `legacy-scan` 作为第四个工具:30 条正则规则,只接受显式路径,只输出报告 —— `web_guidance_legacy_scan`,面板里多一个计数器和一个发现总数。设计与结论:[docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
|
|
400
|
-
| 0.6.0 |
|
|
413
|
+
| 0.6.0 | 已发布 | 再多三条规则(`:host-context()`、文本平衡、`select:invalid`),规则表增至 33 条,其中 30 条对应上游规则;另加指南哈希校验,语料更新后规则不会悄悄过期 |
|
|
414
|
+
| 0.7.0 | 已发布 | 面板从计分板变成地图:时间窗口开关、每日调用、按工具与按结果、按 id 列出的未读指南、诚实的命中率、扫描器发现了什么,外加一个扫描按钮;同时加入 `/guidance-scan` 这条给人用的扫描命令,以及对话里的发现表格 |
|
|
401
415
|
|
|
402
416
|
刻意**不**做的:内置上游那 9.16 MB 的 embedding 表,或者它那个附带 TypeScript 编译器的 4.99 MB `legacy-scan`
|
|
403
417
|
引擎。两者都会破坏“零运行时依赖、不联网、不生成代码”,而换来的收益在词法索引上根本看不出来。
|
|
@@ -427,11 +441,13 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
|
|
|
427
441
|
npm test
|
|
428
442
|
```
|
|
429
443
|
|
|
430
|
-
`npm test` 会跑
|
|
444
|
+
`npm test` 会跑 205 个测试,分布在十四个文件里:`guidance.test.mjs` 覆盖索引、排序、取回与词干器;
|
|
431
445
|
`plugin.test.mjs` 用模拟的 Cordis 上下文挂载插件;`hardening.test.mjs` 守住安全不变量;`report.test.mjs`、
|
|
432
|
-
`stats.test.mjs`、`store.test.mjs` 和 `telemetry.test.mjs`
|
|
433
|
-
|
|
434
|
-
|
|
446
|
+
`stats.test.mjs`、`store.test.mjs` 和 `telemetry.test.mjs` 覆盖计数管线及其 0.7.0 的扫描字段;
|
|
447
|
+
`scan-core.test.mjs`、`scan-rules.test.mjs` 和 `scan-tool.test.mjs` 覆盖扫描器的隔离、规则表与工具契约,
|
|
448
|
+
`scan.test.mjs` 是端到端扫描,`scan-command.test.mjs` 则要求 `/guidance-scan` 拒绝同样的路径、返回同样的值;
|
|
449
|
+
`scan-guides.test.mjs` 校验规则表指向的指南哈希;`client-locales.test.mjs` 保证面板的三份词典保持同步。在禁止
|
|
450
|
+
子进程的沙箱里,请直接运行文件(`node test/hardening.test.mjs`)。
|
|
435
451
|
|
|
436
452
|
<a id="publishing"></a>
|
|
437
453
|
|