dsh-mini-utility-dock 0.5.1 → 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.en.md +22 -6
- package/README.md +22 -6
- package/bin/dsh-mini-utility-dock.js +71 -26
- package/bin/dsh-plugin-docs.js +101 -37
- package/bin/dsh-plugin-parity.js +105 -60
- package/dist/guard.js +18 -21
- package/dist/host-http.js +207 -0
- package/dist/launcher.js +19 -16
- package/dist/loopback.js +11 -14
- package/docs/CHANGELOG.en.md +91 -0
- package/docs/CHANGELOG.md +91 -0
- package/package.json +10 -5
- package/CHANGELOG.en.md +0 -73
- package/CHANGELOG.md +0 -73
package/dist/launcher.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
//
|
|
1
|
+
// The shared launcher assembly: one icon plus the menu of panels it opens, for a
|
|
2
|
+
// plugin's browser half.
|
|
2
3
|
//
|
|
3
4
|
// This fragment has ONE source of truth: dsh-mini-utility-dock/dist/launcher.js.
|
|
4
5
|
// DSH client artifacts are self-contained classic scripts, so the fragment is
|
|
5
6
|
// embedded into lib/client.js at build time by
|
|
6
7
|
// npm run launcher:sync (write it)
|
|
7
8
|
// npm run launcher:check (fail on drift)
|
|
8
|
-
// instead of being imported: a bare import would put a runtime dependency on
|
|
9
|
-
//
|
|
9
|
+
// instead of being imported: a bare import would put a runtime dependency on
|
|
10
|
+
// this package into the bundle that embeds it, and an embedding plugin ships
|
|
10
11
|
// standalone, with nothing else required.
|
|
11
12
|
//
|
|
12
|
-
// The launcher is one icon that opens a menu of
|
|
13
|
+
// The launcher is one icon that opens a menu of utility panels. It is contributed
|
|
13
14
|
// through slots, not through a page-local protocol: exactly one copy of this
|
|
14
|
-
// assembly runs per page
|
|
15
|
-
// declares the menu seat
|
|
15
|
+
// assembly runs per page — the first to load wins the window mutex, registers the
|
|
16
|
+
// launcher, and declares the menu seat — while the other copies register nothing
|
|
17
|
+
// here and only wait to take the claim over once their owner is disposed.
|
|
16
18
|
const UTILITY_ITEM_SLOT = 'createhelper.utility.item'
|
|
17
19
|
const UTILITY_MUTEX_KEY = '__CREATEHELPER_DSH_UTILITY_LAUNCHER_V1__'
|
|
18
20
|
const UTILITY_CSS_ID = 'createhelper-utility-launcher'
|
|
@@ -21,7 +23,7 @@ const UTILITY_MEASURE_TRIES = 120
|
|
|
21
23
|
const UTILITY_ICON = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="2"></rect><rect x="14" y="3" width="7" height="7" rx="2"></rect><rect x="3" y="14" width="7" height="7" rx="2"></rect><rect x="14" y="14" width="7" height="7" rx="2"></rect></svg>'
|
|
22
24
|
|
|
23
25
|
// The launcher's own chrome, injected once by whichever copy wins the mutex.
|
|
24
|
-
// The rows
|
|
26
|
+
// The rows are other plugins' components, so the menu styles its buttons by
|
|
25
27
|
// position instead of asking every contributor for a class name.
|
|
26
28
|
function ensureUtilityStyles() {
|
|
27
29
|
if (typeof document === 'undefined') return
|
|
@@ -41,8 +43,9 @@ function ensureUtilityStyles() {
|
|
|
41
43
|
document.head.appendChild(styleEl)
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
// The
|
|
45
|
-
//
|
|
46
|
+
// The launcher tracks the shell's sidebar column rather than a fixed offset: its
|
|
47
|
+
// left edge sits 16px right of the sidebar's edge, and 80px while the shell has
|
|
48
|
+
// not laid that column out yet.
|
|
46
49
|
const measureUtilityLeft = () => {
|
|
47
50
|
if (typeof document === 'undefined') return UTILITY_FALLBACK_LEFT_PX
|
|
48
51
|
const overlay = document.querySelector('[data-shell-overlay]')
|
|
@@ -105,7 +108,7 @@ const useUtilityMenu = () => {
|
|
|
105
108
|
// The launcher and its menu. The menu is always rendered - a declared child
|
|
106
109
|
// slot is not conditionally declared - and hidden when closed. Choosing a row
|
|
107
110
|
// closes the menu through the click that bubbles out of it, because the rows
|
|
108
|
-
//
|
|
111
|
+
// belong to other plugins, not to this block.
|
|
109
112
|
function UtilityLauncher (props) {
|
|
110
113
|
const left = useUtilityLeft()
|
|
111
114
|
const open = useUtilityMenu()
|
|
@@ -156,11 +159,11 @@ function UtilityLauncher (props) {
|
|
|
156
159
|
// into it directly throws while that declaration is still pending, and a
|
|
157
160
|
// launcher must never cost the caller the surfaces it registers afterwards.
|
|
158
161
|
//
|
|
159
|
-
// The claim lives on the page and is released with its owner.
|
|
160
|
-
//
|
|
161
|
-
// owner would dispose its registration while the claim stayed taken, and the
|
|
162
|
-
// launcher would stay missing until the page was reloaded. A released claim
|
|
163
|
-
//
|
|
162
|
+
// The claim lives on the page and is released with its owner. Any plugin that
|
|
163
|
+
// embeds this block may win the claim, so without the release a hot reload of
|
|
164
|
+
// the owner would dispose its registration while the claim stayed taken, and the
|
|
165
|
+
// launcher would stay missing until the page was reloaded. A released claim wakes
|
|
166
|
+
// the other copies on the page, which re-register immediately.
|
|
164
167
|
const utilityClaim = () => {
|
|
165
168
|
if (typeof window === 'undefined') return null
|
|
166
169
|
const existing = window[UTILITY_MUTEX_KEY]
|
|
@@ -199,7 +202,7 @@ const registerUtilityLauncher = (scope) => {
|
|
|
199
202
|
} catch (error) {
|
|
200
203
|
release()
|
|
201
204
|
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
202
|
-
console.error('[utility-launcher] could not register the
|
|
205
|
+
console.error('[utility-launcher] could not register the launcher', error)
|
|
203
206
|
}
|
|
204
207
|
}
|
|
205
208
|
})
|
package/dist/loopback.js
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
//
|
|
1
|
+
// The loopback predicates: which Host names and which peer addresses count as
|
|
2
|
+
// loopback, for a plugin's host half that binds an API to the loopback interface.
|
|
2
3
|
//
|
|
3
4
|
// This fragment has ONE source of truth: dsh-mini-utility-dock/dist/loopback.js.
|
|
4
|
-
//
|
|
5
|
-
//
|
|
5
|
+
// A host half is plain Node ESM that its package ships standalone, so the
|
|
6
|
+
// fragment is embedded into `lib/shared.js` at build time by
|
|
6
7
|
// npm run loopback:sync (write it)
|
|
7
8
|
// npm run loopback:check (fail on drift)
|
|
8
9
|
// instead of being imported: a bare `import 'dsh-mini-utility-dock/...'` would
|
|
9
|
-
// put a runtime dependency on
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// Why it is shared at all: these predicates were copy-pasted per repo and
|
|
13
|
-
// drifted twice. The first drift rejected IPv6 loopback everywhere; the second
|
|
14
|
-
// is that consumers disagreed on which Host spellings count as loopback
|
|
15
|
-
// (see the parity bin this package ships, which compares this block across repositories).
|
|
10
|
+
// put a runtime dependency on this package into the file that embeds it, and an
|
|
11
|
+
// embedding plugin ships standalone, with nothing else required.
|
|
16
12
|
//
|
|
17
13
|
// "Loopback" is decided in exactly one place — LOOPBACK_HOSTNAMES plus the
|
|
18
14
|
// IPv4-mapped IPv6 form of each entry — and both the name and the address
|
|
19
|
-
// predicate route through it, so the Host path and the peer path cannot
|
|
20
|
-
//
|
|
15
|
+
// predicate route through it, so the Host path and the peer path cannot
|
|
16
|
+
// disagree. Every spelling this file accepts is a documented one; anything
|
|
17
|
+
// unrecognised fails closed.
|
|
21
18
|
//
|
|
22
19
|
// Kept a separate fragment from the host guard on purpose: the predicates are
|
|
23
20
|
// stable facts about what an address is, while the guard is a policy about who
|
|
24
|
-
// may call an API.
|
|
25
|
-
// this block and never the other way round.
|
|
21
|
+
// may call an API. The guard block reads the names this block declares, so it
|
|
22
|
+
// depends on this block and never the other way round.
|
|
26
23
|
|
|
27
24
|
// Hostnames a request to a loopback-bound API may legitimately arrive with.
|
|
28
25
|
// Exact spellings only: `api.localhost` and `127.0.0.1.evil.example` must stay
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Release notes are generated from the matching version section; newest first.
|
|
4
|
+
For Chinese, see [CHANGELOG.md](CHANGELOG.md).
|
|
5
|
+
|
|
6
|
+
## 0.7.0 - 2026-09-29
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- `dsh-plugin-docs` names no document. Which pairs to check, their paths and the shape each is compared with come from a `--config <module>` the calling repository supplies, exporting an array of `{ name, zh, en, shape? }`. `shape` defaults to `markdown` (heading-level sequence and code-fence languages); `changelog` compares releases, sections and per-section item counts. A document absent from that configuration is not compared, so a caller's `docs:check` passes `--config`.
|
|
11
|
+
- This package's `CHANGELOG.md`, `CHANGELOG.en.md` and `RELEASING.md` move into `docs/`; the repository root keeps the two READMEs, `LICENSE` and `AGENTS.md`. The npm package ships the changelogs at their new paths.
|
|
12
|
+
|
|
13
|
+
## 0.6.0 - 2026-09-28
|
|
14
|
+
|
|
15
|
+
- New `dist/host-http.js` (marker `dsh-host-http`): the host half's reply glue becomes one block — `sendJson` (always `no-store`), the POST gate, the browser authorizer, `optionalSessionId` — so a reply policy has one definition. An already published vocabulary (`need_post`, Chinese wording, the echoed `action`) is a `policy` override, so no public identifier changes.
|
|
16
|
+
- `createBrowserAuthorizer` takes accessors, not values: a service reload reassigns a host half's Connection to `null` and later to a new instance, and the value-shaped version would keep handing requests to a destroyed Connection.
|
|
17
|
+
- The comments that ride verbatim into a consumer's repository with the launcher and host-http fragments now state the facts: no sentence misdescribes what the other copies do, and host-http's analogy to a guard-block name says where that name comes from.
|
|
18
|
+
- `dsh-mini-utility-dock`'s `sync`/`check` reject a file whose marker ranges overlap (`<A> <B> </A> </B>`) and leave it unwritten, closing off the corruption the bottom-up splice could previously produce.
|
|
19
|
+
- `dsh-plugin-parity` compares the `dsh-host-http` block byte for byte, and its block-position assertion now covers all three host blocks.
|
|
20
|
+
- The parity bin's "private implementation outside the blocks" scan matches code shapes only: both the bracketed and the destructured Fetch Metadata read count, `LOOPBACK_HOSTNAMES` is caught on assignment but not comparison, and a composite heuristic that could false-FAIL a reasonable repository is gone — so a comment that explains why a helper is not a second guard no longer reads as drift.
|
|
21
|
+
- The parity bin's block comparison strips each block's common indentation, so a consumer that indents its markers by 4 spaces or a tab is no longer reported as drift; `--fleet` naming a repository that is not a member now fails with a non-zero exit instead of the "skipped" line reading as a pass.
|
|
22
|
+
- `dsh-plugin-docs --base` no longer dies inside `git diff` on an all-zero SHA — which is what `github.event.before` carries for a new or force-pushed branch; it notes that there is no previous state and still completes the structural checks.
|
|
23
|
+
- `dsh-plugin-docs` now compares the `Unreleased` section for version, section and item structure — it is the most-edited section each round and was previously outside the check.
|
|
24
|
+
- Tests filled in: process-level behavior for the two diagnostic bins, decision-level behavior for `dist/loopback.js`, `dist/guard.js` and the new fragment, and one `FRAGMENTS` integrity assertion, with a paired case for each behavior change above.
|
|
25
|
+
- Maintenance: CI installs with `npm ci --ignore-scripts` and caches npm, both workflows run `docs:check`, syntax checks cover `bin` and `dist`, `publish.yml` gates on the tag being an ancestor of `main`, and `homepage`, `bugs` and `author` are filled in. Being dependency-free, this package now tracks `package-lock.json` so `npm ci` and the cache have one (reason in `.gitignore`).
|
|
26
|
+
|
|
27
|
+
## 0.5.1 - 2026-09-25
|
|
28
|
+
|
|
29
|
+
- Fix the launcher disappearing after a hot reload: the claim is released with its owner, which wakes the other copies to register again instead of requiring a full page reload.
|
|
30
|
+
|
|
31
|
+
## 0.5.0 - 2026-09-24
|
|
32
|
+
|
|
33
|
+
- New `dist/launcher.js` (marker `dsh-utility-launcher`): one icon at the bottom-left that opens a menu of utility panels, assembled through the host's slots rather than a page-local protocol. Exactly one copy runs per page (the first to load wins a `window` mutex and declares the menu seat `createhelper.utility.item`) and every other copy adds one row to it; consumers maintain it with `launcher:sync` / `launcher:check`.
|
|
34
|
+
|
|
35
|
+
## 0.4.0 - 2026-09-24
|
|
36
|
+
|
|
37
|
+
- Remove `dist/bootstrap.js` (the page-local dock bootstrap fragment) and its `FRAGMENTS` row: it appended a self-measuring `position:fixed` container to every consumer's `document.body`, so it necessarily floated above the page and covered the composer's own controls. Consumers now register the host's `sidebar.footer.action` seat, embed no fragment in `lib/client.js`, and have dropped `dock:sync` / `dock:check`.
|
|
38
|
+
- The two host-side fragments (loopback predicates, host guard) are unchanged, so consumers stay pinned to `0.3.0` and `loopback:check` / `guard:check` keep comparing against that version.
|
|
39
|
+
|
|
40
|
+
## 0.3.0 - 2026-09-22
|
|
41
|
+
|
|
42
|
+
- New `dsh-plugin-docs`: a bilingual docs structure check, adopted from the `check-docs.mjs` copy each plugin repository carried. Same interface: no arguments checks the README and CHANGELOG pairs for structural alignment, `--base <revision>` requires bilingual pairs to change together. This package's own bilingual docs are now checked by it too.
|
|
43
|
+
- README gains badges and a positioning statement; the two diagnostic bins (`dsh-plugin-parity`, `dsh-plugin-docs`) are documented with their purpose and opt-in mechanism; the package description states the "family shared assets" scope.
|
|
44
|
+
|
|
45
|
+
## 0.2.0 - 2026-09-21
|
|
46
|
+
|
|
47
|
+
- New `dsh-plugin-parity`: a cross-repository drift check, adopted from the copy each plugin repository carried. The member list is caller-supplied via `--member <repo>:<export>`; this package names no repository of its own. Without `--member` it runs the static checks only and discovers every repository that embeds the host-guard block.
|
|
48
|
+
- The copy in each plugin repository is gone with it; the bilingual-structure half of `docs:check` stays with the repositories.
|
|
49
|
+
|
|
50
|
+
## 0.1.8 - 2026-09-21
|
|
51
|
+
|
|
52
|
+
- The two host-side fragments drop "sibling" and state the design goal directly: a plugin ships standalone, with nothing else required.
|
|
53
|
+
|
|
54
|
+
## 0.1.7 - 2026-09-20
|
|
55
|
+
|
|
56
|
+
- The two host-side fragments no longer state how many consumers exist ("all three plugins", "the three disagree", "diverged three times" give way to wording that names no count): a fragment is embedded verbatim into a consumer's repository, where no reader can check that count.
|
|
57
|
+
|
|
58
|
+
## 0.1.6 - 2026-09-20
|
|
59
|
+
|
|
60
|
+
- Fix the `allowRemoteHost` note in `dist/guard.js`: it read "stop being admitted", the opposite of what the code does — that mode skips both checks, so it admits them.
|
|
61
|
+
|
|
62
|
+
## 0.1.5 - 2026-09-17
|
|
63
|
+
|
|
64
|
+
- Documentation maintenance: README and CHANGELOG cleanup. Fragments and command behavior are unchanged, so consumer pins need no update.
|
|
65
|
+
|
|
66
|
+
## 0.1.4 - 2026-09-16
|
|
67
|
+
|
|
68
|
+
- Add a cross-repo consistency section to the READMEs, separating two different properties: **local** -- a consumer's `npm test` runs `loopback:check` / `guard:check` to compare both fragments byte-for-byte against the version of this package it pins, covering both "edited a block by hand" and "forgot to re-`sync`"; and **cross-repo** -- this package's published versions are immutable and consumers pin an exact version, so "all three pin the same version" already implies "all three hold byte-identical blocks".
|
|
69
|
+
- That section also records that a consumer's `scripts/guard-parity.mjs` is a **manual diagnostic, not a CI gate**, because the property it asserts cannot hold while a peer checkout resolves to a different branch, which would make it report false failures.
|
|
70
|
+
- The LICENSE copyright holder is now `xswt442-cmd`.
|
|
71
|
+
|
|
72
|
+
## 0.1.3 - 2026-09-14
|
|
73
|
+
|
|
74
|
+
- Add two host-side fragments. `dist/loopback.js` (`dsh-loopback-helpers`) exports `LOOPBACK_HOSTNAMES`, `normalizeHostValue`, `hostHostname`, `isLoopbackName` and `isLoopbackAddress`. `dist/guard.js` (`dsh-host-guard`) exports `portOf`, `GUARD_REASONS`, `DEFAULT_GUARD_POLICY` and an internal `bindGuard()` factory; a consumer passes its own error codes and wording as `policy`, so the enforcement does not fork per plugin.
|
|
75
|
+
- `sync` / `check` now maintain **every** marked fragment in the target file, applied bottom-up in `FRAGMENTS` order, instead of requiring exactly one block. Single-block callers are unaffected.
|
|
76
|
+
- Correct the READMEs and the package description: each host-side fragment's responsibility, the fixed order, and why `bindGuard` is not exported.
|
|
77
|
+
- Add tests for multi-block sync and idempotent `check`, block order, the absence of `import`/`require` in either fragment, and `bindGuard` staying private with no duplicated predicates.
|
|
78
|
+
|
|
79
|
+
## 0.1.2 - 2026-09-06
|
|
80
|
+
|
|
81
|
+
- Fix the README `npm run dock:embed` examples: add the previously missing `dock:embed` script to `package.json` and switch the usage to `npm run dock:embed -- check|sync path/to/client.js` (npm argument passing needs the `--` separator, and the CLI takes `sync|check` subcommands, not `--check`). A new smoke test extracts the documented commands from both READMEs and runs them, preventing docs/script drift.
|
|
82
|
+
|
|
83
|
+
## 0.1.1 - 2026-09-04
|
|
84
|
+
|
|
85
|
+
- Normalize `label` in `register()`: a missing, blank, or non-string label falls back to `id`, so no item renders `aria-label="undefined"`.
|
|
86
|
+
|
|
87
|
+
## 0.1.0
|
|
88
|
+
|
|
89
|
+
- Add the Mini Utility Dock protocol v1 bootstrap.
|
|
90
|
+
- Add `sync` and `check` commands for self-contained DSH client bundles.
|
|
91
|
+
- Validate icons, registration ownership, placement, and load-order behavior.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
Release Notes 由对应版本段生成;最新版本在前。
|
|
4
|
+
英文版见 [CHANGELOG.en.md](CHANGELOG.en.md)。
|
|
5
|
+
|
|
6
|
+
## 0.7.0 - 2026-09-29
|
|
7
|
+
|
|
8
|
+
### 变更
|
|
9
|
+
|
|
10
|
+
- `dsh-plugin-docs` 不再预设文档名。检查哪些文档对、各自的路径与比较形状由调用仓的 `--config <module>` 提供,该模块导出 `{ name, zh, en, shape? }` 数组;`shape` 缺省为 `markdown`(比标题层级序列与代码围栏语言),`changelog` 比版本段、分类段与小节条目数。未在配置中声明的文档不参与比较,因此调用方的 `docs:check` 需要带上 `--config`。
|
|
11
|
+
- 本包的 `CHANGELOG.md`、`CHANGELOG.en.md`、`RELEASING.md` 移入 `docs/`,仓库根目录只留两份 README、`LICENSE` 与 `AGENTS.md`;npm 包内的两份 CHANGELOG 随新路径发布。
|
|
12
|
+
|
|
13
|
+
## 0.6.0 - 2026-09-28
|
|
14
|
+
|
|
15
|
+
- 新增 `dist/host-http.js`(标记 `dsh-host-http`):宿主半的响应胶水收成一块——`sendJson`(一律带 `no-store`)、POST 门、浏览器授权器、`optionalSessionId`,回复策略自此只有一份定义。已发布的词汇(`need_post`、中文文案、回带 `action`)由 `policy` 覆盖,公开标识符不变。
|
|
16
|
+
- `createBrowserAuthorizer` 收访问器而非值:宿主半的 Connection 会被服务重载置空再赋新值,捕获值的那一版会一直把请求交给一个已销毁的 Connection。
|
|
17
|
+
- launcher 与 host-http 片段随片段逐字进入消费者的注释改为直陈事实:不再有误述其余副本行为的句子,host-http 把引用守卫块名字的类比写明其来源。
|
|
18
|
+
- `dsh-mini-utility-dock` 的 `sync`/`check` 遇到标记区间交叠(`<A> <B> </A> </B>`)的文件直接拒绝且不写出,杜绝此前可能产生的损坏。
|
|
19
|
+
- `dsh-plugin-parity` 把 `dsh-host-http` 块纳入逐块比对,块落点顺序的断言同时覆盖三个 host 块。
|
|
20
|
+
- `dsh-plugin-parity` 的「块外私有实现」扫描只匹配代码形状:Fetch Metadata 的方括号取头与解构取头都算、`LOOPBACK_HOSTNAMES` 只认赋值不认比较,并删去会误伤合理仓库的复合启发式,讲清了理由的注释与散文不再被误判成漂移。
|
|
21
|
+
- `dsh-plugin-parity` 的逐块比对改为剥离块的公共缩进,按 4 空格或 Tab 缩进标记的消费者不再被误判为漂移;`--fleet` 点名不在成员表中的仓即判 FAIL 并非零退出,不再把「未测」报成「跳过」。
|
|
22
|
+
- `dsh-plugin-docs --base` 收到全 0 SHA(新建分支或强推时 `github.event.before` 的值)不再崩在 `git diff`,改为按「无可比前态」给提示并跑完结构校验。
|
|
23
|
+
- `dsh-plugin-docs` 把 `Unreleased` 段纳入版本段/分类段/条目数比较——它是每轮改动最多的段落,此前完全不在检查范围内。
|
|
24
|
+
- 补齐测试:两个诊断 bin 的进程级行为、`dist/loopback.js` / `dist/guard.js` 与新片段的判定行为、一条 `FRAGMENTS` 完整性断言,并为上述行为各补对照用例。
|
|
25
|
+
- 维护:CI 改 `npm ci --ignore-scripts` 并启用缓存、两处都跑 `docs:check`,语法检查覆盖 `bin` 与 `dist`,`publish.yml` 加「tag 必须是 `main` 的祖先」闸门,补齐 `homepage`、`bugs`、`author`;本包零依赖,故开始跟踪 `package-lock.json` 以满足 `npm ci` 与缓存(理由见 `.gitignore`)。
|
|
26
|
+
|
|
27
|
+
## 0.5.1 - 2026-09-25
|
|
28
|
+
|
|
29
|
+
- 修复 launcher 热重载后消失:归属从一次性闩锁改为可释放的认领,owner 被销毁时唤醒其余副本重新注册,不再需要刷新整页。
|
|
30
|
+
|
|
31
|
+
## 0.5.0 - 2026-09-24
|
|
32
|
+
|
|
33
|
+
- 新增 `dist/launcher.js`(标记 `dsh-utility-launcher`):左下角一个图标,点开一个列出各插件面板的菜单,走宿主的槽位而不是页面级协议。每页只有一份装配(先加载的一方赢得 `window` 互斥并声明菜单座位 `createhelper.utility.item`),其余副本各往那个座位投一行;消费方用 `launcher:sync` / `launcher:check` 维护。
|
|
34
|
+
|
|
35
|
+
## 0.4.0 - 2026-09-24
|
|
36
|
+
|
|
37
|
+
- 移除 `dist/bootstrap.js`(页面级 dock 引导片段)与其 `FRAGMENTS` 条目:它给每个消费插件在 `document.body` 上挂一个自量位置的 `position:fixed` 容器,必然浮在页面之上、压住 composer 自己的控件。消费方改为注册宿主的 `sidebar.footer.action` 座位,`lib/client.js` 不再嵌片段,各仓的 `dock:sync` / `dock:check` 随之删除。
|
|
38
|
+
- 两个 host 侧片段(loopback 判定、host 守卫)字节未变,消费方仍可 pin `0.3.0`,`loopback:check` / `guard:check` 继续按该版本比对。
|
|
39
|
+
|
|
40
|
+
## 0.3.0 - 2026-09-22
|
|
41
|
+
|
|
42
|
+
- 新增 `dsh-plugin-docs`:双语文档结构校验,收编自插件仓里各自维护的 `check-docs.mjs`。接口不变:无参数查 README 与 CHANGELOG 的中英结构对齐,`--base <revision>` 检查双语对同改。本包自身的双语文档也由此接入校验。
|
|
43
|
+
- README 补上 badges 与包定位说明;两个诊断 bin(`dsh-plugin-parity`、`dsh-plugin-docs`)的用途与接入方式补进文档;包描述同步「族级共享资产」的定位。
|
|
44
|
+
|
|
45
|
+
## 0.2.0 - 2026-09-21
|
|
46
|
+
|
|
47
|
+
- 新增 `dsh-plugin-parity`:跨仓漂移诊断,收编自插件仓里各自维护的那份脚本。成员表由调用方通过 `--member <repo>:<export>` 提供,本包不点名任何仓;不带 `--member` 时只跑静态检查,自动发现所有嵌入了宿主守卫块的仓。
|
|
48
|
+
- 插件仓里的该脚本由此删除;`docs:check` 的双语结构校验仍归各仓。
|
|
49
|
+
|
|
50
|
+
## 0.1.8 - 2026-09-21
|
|
51
|
+
|
|
52
|
+
- 两个 host 侧片段的注释去掉 `sibling`,改为直接陈述设计目标:插件独立发布,不依赖同级安装。
|
|
53
|
+
|
|
54
|
+
## 0.1.7 - 2026-09-20
|
|
55
|
+
|
|
56
|
+
- 两个 host 侧片段的注释不再声明消费方数量(「all three plugins」「diverged three times」等改为不指名、不计数的说法):片段逐字嵌入消费者的仓库,那里的读者无从得知有几个消费方。
|
|
57
|
+
|
|
58
|
+
## 0.1.6 - 2026-09-20
|
|
59
|
+
|
|
60
|
+
- 修正 `dist/guard.js` 里 `allowRemoteHost` 的行内注释:原文写作「不再被放行」,与代码相反——该模式是跳过这两项检查,即放行。
|
|
61
|
+
|
|
62
|
+
## 0.1.5 - 2026-09-17
|
|
63
|
+
|
|
64
|
+
- 文档维护:README 与 CHANGELOG 的整理,片段与命令行为不变,故无需改动消费仓的 pin。
|
|
65
|
+
|
|
66
|
+
## 0.1.4 - 2026-09-16
|
|
67
|
+
|
|
68
|
+
- README 新增「跨仓一致性」一节:本地由消费仓 `npm test` 的 `loopback:check` / `guard:check` 逐字节比对,跨仓由消费仓 pin 精确版本保证。
|
|
69
|
+
- 该节记录 `scripts/guard-parity.mjs` 是人工诊断工具而非 CI 门禁。
|
|
70
|
+
- LICENSE 版权署名统一为 `xswt442-cmd`。
|
|
71
|
+
|
|
72
|
+
## 0.1.3 - 2026-09-14
|
|
73
|
+
|
|
74
|
+
- 新增两个 host 侧片段:`dist/loopback.js`(`dsh-loopback-helpers`)导出回环判定谓词;`dist/guard.js`(`dsh-host-guard`)导出 `portOf`、`GUARD_REASONS`、`DEFAULT_GUARD_POLICY` 与内部的 `bindGuard()` 工厂,调用方以 `policy` 传入自己的错误码与文案。
|
|
75
|
+
- `sync` / `check` 处理目标文件中所有已标记的片段,按 `FRAGMENTS` 顺序自下而上应用。
|
|
76
|
+
- 修正 README 与包描述:说明两个 host 侧片段的职责、固定顺序与 `bindGuard` 不导出的原因。
|
|
77
|
+
- 新增测试:多块同步与幂等 `check`、块顺序、片段不引入 `import`/`require`、判据不被重复声明。
|
|
78
|
+
|
|
79
|
+
## 0.1.2 - 2026-09-06
|
|
80
|
+
|
|
81
|
+
- 修正 README 的 `npm run dock:embed` 示例:补上 `package.json` 缺失的 `dock:embed` 脚本,用法改为 `npm run dock:embed -- check|sync path/to/client.js`(npm 传参需要 `--` 分隔符,CLI 接受 `sync|check` 子命令而非 `--check`)。新增从双语 README 提取命令逐条执行的 smoke test,防止文档与脚本漂移。
|
|
82
|
+
|
|
83
|
+
## 0.1.1 - 2026-09-04
|
|
84
|
+
|
|
85
|
+
- 归一化 `register()` 的 `label`:缺省、空白或非字符串的 `label` 回退为 `id`,避免渲染出 `aria-label="undefined"`。
|
|
86
|
+
|
|
87
|
+
## 0.1.0
|
|
88
|
+
|
|
89
|
+
- Add the Mini Utility Dock protocol v1 bootstrap.
|
|
90
|
+
- Add `sync` and `check` commands for self-contained DSH client bundles.
|
|
91
|
+
- Validate icons, registration ownership, placement, and load-order behavior.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mini-utility-dock",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The DSH plugin family's shared assets: source fragments (the loopback predicates
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "The DSH plugin family's shared assets: source fragments (the loopback predicates, host request guard and host HTTP glue for host halves, the utility launcher for client halves), the embedding CLI, and the family diagnostics — cross-repo drift check and bilingual docs structure check.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"dsh-mini-utility-dock": "bin/dsh-mini-utility-dock.js",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"README.md",
|
|
15
15
|
"README.en.md",
|
|
16
16
|
"LICENSE",
|
|
17
|
-
"CHANGELOG.md",
|
|
18
|
-
"CHANGELOG.en.md"
|
|
17
|
+
"docs/CHANGELOG.md",
|
|
18
|
+
"docs/CHANGELOG.en.md"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"dock:embed": "node bin/dsh-mini-utility-dock.js",
|
|
22
|
-
"docs:check": "node bin/dsh-plugin-docs.js",
|
|
22
|
+
"docs:check": "node bin/dsh-plugin-docs.js --config docs.config.mjs",
|
|
23
23
|
"test": "node --test test/*.test.js"
|
|
24
24
|
},
|
|
25
25
|
"engines": {
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
"type": "git",
|
|
30
30
|
"url": "git+https://github.com/xswt442-cmd/dsh-mini-utility-dock.git"
|
|
31
31
|
},
|
|
32
|
+
"homepage": "https://github.com/xswt442-cmd/dsh-mini-utility-dock#readme",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/xswt442-cmd/dsh-mini-utility-dock/issues"
|
|
35
|
+
},
|
|
36
|
+
"author": "xswt442-cmd",
|
|
32
37
|
"keywords": [
|
|
33
38
|
"dsh",
|
|
34
39
|
"deepseek-harness",
|
package/CHANGELOG.en.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
Release notes are generated from the matching version section; newest first.
|
|
4
|
-
For Chinese, see [CHANGELOG.md](CHANGELOG.md).
|
|
5
|
-
|
|
6
|
-
## 0.5.1 - 2026-09-25
|
|
7
|
-
|
|
8
|
-
- Fix the launcher disappearing after a hot reload: the claim is released with its owner, which wakes the other copies to register again instead of requiring a full page reload.
|
|
9
|
-
|
|
10
|
-
## 0.5.0 - 2026-09-24
|
|
11
|
-
|
|
12
|
-
- New `dist/launcher.js` (marker `dsh-utility-launcher`): the family's shared entry point — one icon at the bottom-left that opens a menu of the family's panels. It goes through slots rather than a page-local protocol: one copy of the assembly runs per page (the first plugin to load wins the `window` mutex and declares the menu seat `createhelper.utility.item`), and every other plugin contributes one row to that seat. Consumers maintain it with `launcher:sync` / `launcher:check`, so the three client halves no longer each carry their own copy.
|
|
13
|
-
|
|
14
|
-
## 0.4.0 - 2026-09-24
|
|
15
|
-
|
|
16
|
-
- Remove `dist/bootstrap.js` (the dock bootstrap fragment) and its `FRAGMENTS` row. It made every consumer append a `position:fixed; z-index:9997` container to `document.body` and locate it by measuring the sidebar — so it necessarily floated above the page and covered the composer's own controls. The three consumers now register the host's `sidebar.footer.action` seat instead (an icon button directly above Settings), embed no fragment in `lib/client.js` at all, and drop their `dock:sync` / `dock:check` scripts.
|
|
17
|
-
- Consumers stay pinned to `0.3.0`: the two remaining fragments (loopback predicates, host guard) are unchanged, so `loopback:check` / `guard:check` keep comparing against that version byte for byte.
|
|
18
|
-
|
|
19
|
-
## 0.3.0 - 2026-09-22
|
|
20
|
-
|
|
21
|
-
- New `dsh-plugin-docs`: a bilingual docs structure check, adopted from the `check-docs.mjs` copy each plugin repository carried. Same interface: no arguments checks the README and CHANGELOG pairs for structural alignment, `--base <revision>` requires bilingual pairs to change together. This package's own bilingual docs are now checked by it too.
|
|
22
|
-
- README gains badges and a positioning statement; the two diagnostic bins (`dsh-plugin-parity`, `dsh-plugin-docs`) are documented with their purpose and opt-in mechanism; the package description states the "family shared assets" scope.
|
|
23
|
-
|
|
24
|
-
## 0.2.0 - 2026-09-21
|
|
25
|
-
|
|
26
|
-
- New `dsh-plugin-parity`: a cross-repository drift check, adopted from the copy each plugin repository carried. The member list is caller-supplied via `--member <repo>:<export>`; this package names no repository of its own. Without `--member` it runs the static checks only and discovers every repository that embeds the host-guard block.
|
|
27
|
-
- The copy in each plugin repository is gone with it; the bilingual-structure half of `docs:check` stays with the repositories.
|
|
28
|
-
|
|
29
|
-
## 0.1.8 - 2026-09-21
|
|
30
|
-
|
|
31
|
-
- The two host-side fragments no longer say "sibling": the three phrasings now state the design goal itself — a plugin ships standalone, with nothing else required. A fragment is embedded verbatim into each consumer, where the word had no referent.
|
|
32
|
-
- The fragments' bytes change, so consumers must re-run `loopback:sync` / `guard:sync` and raise their pin to 0.1.8.
|
|
33
|
-
|
|
34
|
-
## 0.1.7 - 2026-09-20
|
|
35
|
-
|
|
36
|
-
- The two host-side fragments no longer state how many consumers exist: "all three plugins", "the three disagree" and "the three plugins / diverged three times" give way to wording that names no count. A fragment is embedded verbatim into each consumer, where the reader cannot know how many other consumers there are — the count is workspace knowledge, not that repository's.
|
|
37
|
-
- The fragments' bytes change, so consumers must re-run `loopback:sync` / `guard:sync` and raise their pin to 0.1.7.
|
|
38
|
-
|
|
39
|
-
## 0.1.6 - 2026-09-20
|
|
40
|
-
|
|
41
|
-
- Fix the `allowRemoteHost` note in `dist/guard.js`: it read "stop being admitted", the opposite of what the code does — that mode skips both checks, so it admits them. The JSDoc was already right; only this inline comment was inverted.
|
|
42
|
-
- The fragment's bytes change, so consumers must re-run `guard:sync` and raise their pin to 0.1.6.
|
|
43
|
-
|
|
44
|
-
## 0.1.5 - 2026-09-17
|
|
45
|
-
|
|
46
|
-
- Documentation maintenance: README and CHANGELOG cleanup. Fragments and command behavior are unchanged, so consumer pins need no update.
|
|
47
|
-
|
|
48
|
-
## 0.1.4 - 2026-09-16
|
|
49
|
-
|
|
50
|
-
- Add a cross-repo consistency section to the READMEs, separating two different properties: **local** -- a consumer's `npm test` runs `loopback:check` / `guard:check` to compare both fragments byte-for-byte against the version of this package it pins, covering both "edited a block by hand" and "forgot to re-`sync`"; and **cross-repo** -- this package's published versions are immutable and consumers pin an exact version, so "all three pin the same version" already implies "all three hold byte-identical blocks".
|
|
51
|
-
- That section also records that a consumer's `scripts/guard-parity.mjs` is a **manual diagnostic, not a CI gate**, because the property it asserts cannot hold while a peer checkout resolves to a different branch, which would make it report false failures.
|
|
52
|
-
- The LICENSE copyright holder is now `xswt442-cmd`.
|
|
53
|
-
|
|
54
|
-
## 0.1.3 - 2026-09-14
|
|
55
|
-
|
|
56
|
-
- Add two host-side fragments. `dist/loopback.js` (`dsh-loopback-helpers`) exports `LOOPBACK_HOSTNAMES`, `normalizeHostValue`, `hostHostname`, `isLoopbackName` and `isLoopbackAddress`. `dist/guard.js` (`dsh-host-guard`) exports `portOf`, `GUARD_REASONS`, `DEFAULT_GUARD_POLICY` and an internal `bindGuard()` factory; a consumer passes its own error codes and wording as `policy`, so the enforcement does not fork per plugin.
|
|
57
|
-
- `sync` / `check` now maintain **every** marked fragment in the target file, applied bottom-up in `FRAGMENTS` order, instead of requiring exactly one block. Single-block callers are unaffected.
|
|
58
|
-
- Correct the READMEs and the package description: each host-side fragment's responsibility, the fixed order, and why `bindGuard` is not exported.
|
|
59
|
-
- Add tests for multi-block sync and idempotent `check`, block order, the absence of `import`/`require` in either fragment, and `bindGuard` staying private with no duplicated predicates.
|
|
60
|
-
|
|
61
|
-
## 0.1.2 - 2026-09-06
|
|
62
|
-
|
|
63
|
-
- Fix the README `npm run dock:embed` examples: add the previously missing `dock:embed` script to `package.json` and switch the usage to `npm run dock:embed -- check|sync path/to/client.js` (npm argument passing needs the `--` separator, and the CLI takes `sync|check` subcommands, not `--check`). A new smoke test extracts the documented commands from both READMEs and runs them, preventing docs/script drift.
|
|
64
|
-
|
|
65
|
-
## 0.1.1 - 2026-09-04
|
|
66
|
-
|
|
67
|
-
- Normalize `label` in `register()`: a missing, blank, or non-string label falls back to `id`, so no item renders `aria-label="undefined"`.
|
|
68
|
-
|
|
69
|
-
## 0.1.0
|
|
70
|
-
|
|
71
|
-
- Add the Mini Utility Dock protocol v1 bootstrap.
|
|
72
|
-
- Add `sync` and `check` commands for self-contained DSH client bundles.
|
|
73
|
-
- Validate icons, registration ownership, placement, and load-order behavior.
|
package/CHANGELOG.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# 更新日志
|
|
2
|
-
|
|
3
|
-
Release Notes 由对应版本段生成;最新版本在前。
|
|
4
|
-
英文版见 [CHANGELOG.en.md](CHANGELOG.en.md)。
|
|
5
|
-
|
|
6
|
-
## 0.5.1 - 2026-09-25
|
|
7
|
-
|
|
8
|
-
- 修复 launcher 热重载后消失:归属从一次性闩锁改为可释放的认领,owner 被销毁时唤醒其余副本重新注册,不再需要刷新整页。
|
|
9
|
-
|
|
10
|
-
## 0.5.0 - 2026-09-24
|
|
11
|
-
|
|
12
|
-
- 新增 `dist/launcher.js`(片段标记 `dsh-utility-launcher`):族的共享入口——左下角一个图标,点开一个列出各插件面板的菜单。它走槽位而不是页面级协议:每页只有一份装配(先加载的插件赢得 `window` 互斥并声明菜单座位 `createhelper.utility.item`),其余插件各往那个座位投一行。消费插件用 `launcher:sync` / `launcher:check` 维护,三个 client 半从此不再各写一份。
|
|
13
|
-
|
|
14
|
-
## 0.4.0 - 2026-09-24
|
|
15
|
-
|
|
16
|
-
- 移除 `dist/bootstrap.js`(dock 引导片段)与对应的 `FRAGMENTS` 条目。它让每个消费插件在 `document.body` 上挂一个 `position:fixed; z-index:9997` 的容器,位置靠自己量侧边栏算出来——于是它必然悬在页面上方,会压住 composer 自己的控件。三个消费插件已改为注册宿主槽位 `sidebar.footer.action`(图标按钮,就在设置上方),`lib/client.js` 不再嵌任何片段,各仓的 `dock:sync` / `dock:check` 随之删除。
|
|
17
|
-
- 消费仓仍 pin `0.3.0`:本仓剩下两个片段(loopback 判定、host 守卫)未变,`loopback:check` / `guard:check` 继续按该版本逐字节比对。
|
|
18
|
-
|
|
19
|
-
## 0.3.0 - 2026-09-22
|
|
20
|
-
|
|
21
|
-
- 新增 `dsh-plugin-docs`:双语文档结构校验,收编自插件仓里各自维护的 `check-docs.mjs`。接口不变:无参数查 README 与 CHANGELOG 的中英结构对齐,`--base <revision>` 检查双语对同改。本包自身的双语文档也由此接入校验。
|
|
22
|
-
- README 补上 badges 与包定位说明;两个诊断 bin(`dsh-plugin-parity`、`dsh-plugin-docs`)的用途与接入方式补进文档;包描述同步「族级共享资产」的定位。
|
|
23
|
-
|
|
24
|
-
## 0.2.0 - 2026-09-21
|
|
25
|
-
|
|
26
|
-
- 新增 `dsh-plugin-parity`:跨仓漂移诊断,收编自插件仓里各自维护的那份脚本。成员表由调用方通过 `--member <repo>:<export>` 提供,本包不点名任何仓;不带 `--member` 时只跑静态检查,自动发现所有嵌入了宿主守卫块的仓。
|
|
27
|
-
- 插件仓里的该脚本由此删除;`docs:check` 的双语结构校验仍归各仓。
|
|
28
|
-
|
|
29
|
-
## 0.1.8 - 2026-09-21
|
|
30
|
-
|
|
31
|
-
- 两个 host 侧片段的注释不再出现 `sibling`:三处改为陈述设计目标本身——插件独立运行,不依赖同级安装。片段会逐字嵌入消费仓,那个词在那里没有可指对象。
|
|
32
|
-
- 片段字节因此变化,消费仓需重新运行 `loopback:sync` / `guard:sync` 并把 pin 升到 0.1.8。
|
|
33
|
-
|
|
34
|
-
## 0.1.7 - 2026-09-20
|
|
35
|
-
|
|
36
|
-
- 两个 host 侧片段的注释不再带消费仓数量:「all three plugins」「the three disagree」「the three plugins / diverged three times」改为不指名、不计数的说法。片段会逐字嵌入消费仓,那里的读者无从得知存在几个消费方,计数是工作区知识而非该仓知识。
|
|
37
|
-
- 片段字节因此变化,消费仓需重新运行 `loopback:sync` / `guard:sync` 并把 pin 升到 0.1.7。
|
|
38
|
-
|
|
39
|
-
## 0.1.6 - 2026-09-20
|
|
40
|
-
|
|
41
|
-
- 修正 `dist/guard.js` 里 `allowRemoteHost` 的说明文字:原文写作「不再被放行」,与代码相反——开启该模式时这两项检查被跳过,即被放行。JSDoc 一直是对的,只有这处行内注释写反。
|
|
42
|
-
- 该片段的字节因此变化,消费仓需重新运行 `guard:sync` 并把 pin 升到 0.1.6。
|
|
43
|
-
|
|
44
|
-
## 0.1.5 - 2026-09-17
|
|
45
|
-
|
|
46
|
-
- 文档维护:README 与 CHANGELOG 的整理,片段与命令行为不变,故无需改动消费仓的 pin。
|
|
47
|
-
|
|
48
|
-
## 0.1.4 - 2026-09-16
|
|
49
|
-
|
|
50
|
-
- README 新增「跨仓一致性」一节:本地由消费仓 `npm test` 的 `loopback:check` / `guard:check` 逐字节比对,跨仓由消费仓 pin 精确版本保证。
|
|
51
|
-
- 该节记录 `scripts/guard-parity.mjs` 是人工诊断工具而非 CI 门禁。
|
|
52
|
-
- LICENSE 版权署名统一为 `xswt442-cmd`。
|
|
53
|
-
|
|
54
|
-
## 0.1.3 - 2026-09-14
|
|
55
|
-
|
|
56
|
-
- 新增两个 host 侧片段:`dist/loopback.js`(`dsh-loopback-helpers`)导出回环判定谓词;`dist/guard.js`(`dsh-host-guard`)导出 `portOf`、`GUARD_REASONS`、`DEFAULT_GUARD_POLICY` 与内部的 `bindGuard()` 工厂,调用方以 `policy` 传入自己的错误码与文案。
|
|
57
|
-
- `sync` / `check` 处理目标文件中所有已标记的片段,按 `FRAGMENTS` 顺序自下而上应用。
|
|
58
|
-
- 修正 README 与包描述:说明两个 host 侧片段的职责、固定顺序与 `bindGuard` 不导出的原因。
|
|
59
|
-
- 新增测试:多块同步与幂等 `check`、块顺序、片段不引入 `import`/`require`、判据不被重复声明。
|
|
60
|
-
|
|
61
|
-
## 0.1.2 - 2026-09-06
|
|
62
|
-
|
|
63
|
-
- 修正 README 的 `npm run dock:embed` 示例:补上 `package.json` 缺失的 `dock:embed` 脚本,用法改为 `npm run dock:embed -- check|sync path/to/client.js`(npm 传参需要 `--` 分隔符,CLI 接受 `sync|check` 子命令而非 `--check`)。新增从双语 README 提取命令逐条执行的 smoke test,防止文档与脚本漂移。
|
|
64
|
-
|
|
65
|
-
## 0.1.1 - 2026-09-04
|
|
66
|
-
|
|
67
|
-
- 归一化 `register()` 的 `label`:缺省、空白或非字符串的 `label` 回退为 `id`,避免渲染出 `aria-label="undefined"`。
|
|
68
|
-
|
|
69
|
-
## 0.1.0
|
|
70
|
-
|
|
71
|
-
- Add the Mini Utility Dock protocol v1 bootstrap.
|
|
72
|
-
- Add `sync` and `check` commands for self-contained DSH client bundles.
|
|
73
|
-
- Validate icons, registration ownership, placement, and load-order behavior.
|