@jayyuen66/dsh-zvec-grep 0.1.17 → 0.1.19
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/CHANGELOG.md +28 -0
- package/README.md +10 -2
- package/README.zh-CN.md +10 -2
- package/client.js +3 -1662
- package/cordis.patch.yml +4 -0
- package/docs/DETAIL.md +7 -1
- package/docs/DETAIL.zh.md +7 -1
- package/host.js +42 -37
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The deviations below are deliberate: version headings carry no release date (publish times are recorded by the registry — `npm view <package> time`), and a release may add sections beyond the standard six, such as `Not changed, deliberately` and `Earlier`.
|
|
4
4
|
|
|
5
|
+
## 0.1.19
|
|
6
|
+
|
|
7
|
+
将 `@jayyuen66/dsh-plugin-shared` 抬到 `^0.2.10`。设置卡吸底保存条的旧固定 id 冲突与底色随 shared 修复;shared 的 `registerSkill` 在 effect 挂不上时立即撤销注册并回 `false`,本包 skill 不会再在卸载后留在目录里。装载面反转 0.1.14 的内联取舍:`cordis.patch.yml` 显式插入固定 id `dsh-plugin-shared` 的供应行(停用后卡片失去 shared 组件供应),`package.json` 的 `dsh.client.external` 同步声明 `@jayyuen66/dsh-plugin-shared/client`,卡片组件改由 shared 客户端行供应;client bundle 开启 minify,产物 65,390 B → 23,818 B,体积预算按新实量重定。`registerRoutingSkill` 的入参改用 shared 的 `SkillRegistryContext`,让 `effect` 这条撤销权契约进类型。工具面与 grep/rg 门禁行为不变。
|
|
8
|
+
|
|
9
|
+
## 0.1.18
|
|
10
|
+
|
|
11
|
+
market 热挂与 bundle 层双路径装载时第二份 `apply` 整份让路(此前第二遍会撞「同名已注册」把 fiber 打成 failed);设置卡接「有字段越界就不许保存」那道门禁;卡片样式改用 shared 的共享 `<style>`;shared 抬到 `^0.2.9`,输入框不再撑出容器、小节内补上纵向间距。工具面与 grep/rg 门禁的行为一字未变。
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **单实例锁**:`apply` 在首道宿主守卫之后用 shared 的 `claimInstance` 抢 `INSTANCE_LOCK_KEY = "@jayyuen66/dsh-zvec-grep/instance"`,抢不到就 `console.warn` 一行「本次装配让路,工具与设置卡由在册的那一份提供」并直接返回。成因是 dshmarket 运行期热装会在 `<profile>/.dsh-market/` 下造一棵它自己的 Include 子树(`mkt-*`,`file://` 直连 `host.js`),与 profile 的 bundle 层解析到同一份模块却各起一个 fiber ⇒ 同一进程里 `apply` 跑两遍,第二遍的三个工具、prompt section 与 Typert Remote 服务注册全部撞名。锁随在册那一份的 fiber 卸载自动释放。
|
|
16
|
+
- **回归测试 `test/instance-lock.test.ts`(6 条)**:空作用域抢到且锁名落进服务表 / 已有一份在册时让路且**不再尝试 provide** / `provide` 抛错时让路、不把异常抛给调用方 / 没有注册口时放行 / `reflect` 在但没有 `provide` 时放行 / 两个不同键互不影响。`test/host.test.ts` 另加一条装配级用例:「第二份装配必须安静让路,绝不能把 fiber 打成 failed」,断言工具数、section 数、Remote 服务三者不变且 `warn` 恰好一次。夹具的 `reflect.provide` 因此从「重复写入覆盖」改成「重复即抛」——真 cordis 的 `Service` 构造就走这里,第二遍若没被锁挡住会当场抛错,而不是静默覆盖。
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **三处逐字重复收进 shared**:`lib/skill.ts` 的注册正文(取可选 `skills` 服务 → 判形状 → 空正文不注册 → `register`)换成 shared 的 `registerSkill(ctx, spec)`,本文件只剩 `SKILL_NAME` 与把正文收成 spec 的那一层;`lib/messages.ts` 的 `fill()` 换成 shared 的 `fillPlaceholders`;`lib/daemon-client.ts` 的私有 `isRecord` 换成 shared 的 `lib/record`(本包那份少了 `!Array.isArray`,数组会被判成 record —— 这次顺手修掉)。
|
|
21
|
+
- **`fill()` 的缺值语义从「替空串」改成「保留原文」**:漏传或写错占位符时原样留着的 `{xxx}` 一眼可见,比一句悄悄塌成残句的文案好排查。`null` 仍照实渲染成 `"null"`(`exitCode` 这类字段的正常取值)。两条既有断言随之改判。
|
|
22
|
+
- **卡片样式改用 shared 的 `ensureCardUiCss()`**:不再把 `CARD_UI_CSS` 整段拼进本仓的 `<style>`,改为固定 id `dsh-card-ui-css` 的幂等注入 + 引用计数。
|
|
23
|
+
- **运行时依赖 shared 抬到 `^0.2.9`**。
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- **越界数字草稿会被静默丢掉**:`NumberField` 对越界草稿**不调 `onChange`**,于是它根本不进 `touched`。三个数字字段(`defaultLimit` / `grepBudgetPerSearch` / `unlockWindowMin`)现在都接 `onInvalidChange` 上报,卡片据此灰掉保存并在保存条上点名「有字段超出范围,先修正或撤销后再保存。」(`src/ui-messages.ts` 的 `invalidFields`);`resetToken` 在保存/撤销后把框里的非法草稿清回已提交值。
|
|
28
|
+
- **越界时连撤销都点不动**:上一版把「有未保存改动」与「有越界字段」混成保存条的一个 `disabled`。现在 `SaveBar` 分开算:保存被 `blocked` 拦下,撤销保持可点。
|
|
29
|
+
- **「已修改 N 项」把越界字段算重**:一个字段先写进合法草稿(进 `touched`)再改成越界草稿时,草稿差异与越界集各算一次。现在按字段名去重(`InvalidFields.fields`),一格只算一项。
|
|
30
|
+
- **输入控件撑出容器**(shared 侧):`.dsu-form` 整棵子树统一 `border-box`,否则 `.dsu-input` 的 `width:100%` 会连同左右 padding 一起撑出容器 26px。
|
|
31
|
+
- **小节内相邻元素间距为 0**(shared 侧):`.dsu-form .dsu-section>*+*` 给 10px,`.dsu-sectionHint` 4px,`.dsu-field` 之间仍 0。
|
|
32
|
+
|
|
5
33
|
## 0.1.17
|
|
6
34
|
|
|
7
35
|
检索规则从常驻提示词搬进了按需加载的虚拟 skill;工具结果带上可判的错误码与调用态卡片;三个工具各声明自己的墙钟。工具面与 grep/rg 门禁的行为一字未变。
|
package/README.md
CHANGED
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
- [ Known boundaries](#-known-boundaries)
|
|
60
60
|
- [ FAQ](#-faq)
|
|
61
61
|
- [ Development](#-development)
|
|
62
|
+
- [ Feedback](#feedback)
|
|
62
63
|
- [ License](#-license)
|
|
63
64
|
|
|
64
65
|
## <img src="https://api.iconify.design/lucide/shield.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> What it does
|
|
@@ -106,8 +107,9 @@ If your profile pins `@jayyuen66/dsh-plugin-shared` with a pnpm `overrides` entr
|
|
|
106
107
|
|
|
107
108
|
## <img src="https://api.iconify.design/lucide/plug.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Enabling it in dsh
|
|
108
109
|
|
|
109
|
-
- `dsh.bundle.patch` points at `cordis.patch.yml`, whose `insert:` block carries a
|
|
110
|
+
- `dsh.bundle.patch` points at `cordis.patch.yml`, whose `insert:` block carries a `- id: dsh-plugin-shared` supplier row (keep it enabled; disabling it removes the cards' shared component supply) plus the `- id: zvec-grep` entry with `name: "@jayyuen66/dsh-zvec-grep"` - the **bare package name** is what makes the host scan the client half. The card components come from the shared client row, externalized as `@jayyuen66/dsh-plugin-shared/client`; the host module table provides `react`, `zod` and that shared row. Bundle installation goes through pnpm (>= 12.3.0).
|
|
110
111
|
- A missing injected surface keeps cordis from activating the entry (startup diagnostic: `pending (waiting for service: …)`); a malformed ctx throws `required services … missing` from apply.
|
|
112
|
+
- The two delivery paths - a dshmarket hot-mounted `mkt-*` include and the bundle layer - can resolve to the same module and run `apply` twice in one scope. The second assembly claims a private instance service and stands down with a single `console.warn`; the tools, the prompt section and the `zvecGrepRebuild` namespace stay with the registered copy, and the lock is released when that fiber unloads.
|
|
111
113
|
- The card is registered in the `plugins.bundle.config` slot keyed by the **bundle package name**; the settings namespace and `configForms` reads stay the bare entry id `zvec-grep` (implicit registration by entry id).
|
|
112
114
|
- The rebuild read surface is installed on the apply fiber - no `webServer` dependency, no child fiber. On a TUI host the service still registers; the card simply has nowhere to render.
|
|
113
115
|
- The status poll is the client's own timer (2000 ms), not a server push; every read answers a result object, never a thrown error.
|
|
@@ -162,7 +164,7 @@ Output is plain text; timeouts 5 min (search) / 10 min (index) / 60 s (status);
|
|
|
162
164
|
|
|
163
165
|
## <img src="https://api.iconify.design/lucide/sliders-horizontal.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Settings
|
|
164
166
|
|
|
165
|
-
Namespace `zvec-grep` equals the settings entry id; the schema has 18 fields with built-in defaults, 7 of them volatile and on the card.
|
|
167
|
+
Namespace `zvec-grep` equals the settings entry id; the schema has 18 fields with built-in defaults, 7 of them volatile and on the card. An out-of-range numeric draft never reaches `onChange`, so **Save** is blocked while any numeric field is invalid; **Revert** stays enabled, and the save bar names the reason.
|
|
166
168
|
|
|
167
169
|
| Field | Type | Default | Purpose |
|
|
168
170
|
| --- | --- | --- | --- |
|
|
@@ -277,6 +279,12 @@ pnpm run check # typecheck (three tsconfig programs) → lint → both bundle
|
|
|
277
279
|
- `host.js` / `client.js` are not committed; `prepare` / `prepack` rebuild them and two tests compare the on-disk bundle against an in-memory build byte for byte. Never hand-edit the bundles.
|
|
278
280
|
- Manifest gates (`test/publish-manifest.test.ts`) guard the published surface: entry targets covered by `files`, host packages out of `dependencies`, `dsh-*` pinned exactly, no local paths in artifacts. `test/dist-size.test.ts` budgets bundle bytes; `test/readme-parity.test.ts` keeps both READMEs structurally in sync.
|
|
279
281
|
|
|
282
|
+
## Feedback
|
|
283
|
+
|
|
284
|
+
Issues and pull requests are welcome: [https://github.com/JayYuen666/dsh-zvec-grep/issues](https://github.com/JayYuen666/dsh-zvec-grep/issues).
|
|
285
|
+
|
|
286
|
+
If a plugin fails to boot, include the dsh host version, the profile install shape, and the browser console line. The `missed the module table` line is especially useful: it tells us whether the shared client row was materialized.
|
|
287
|
+
|
|
280
288
|
## <img src="https://api.iconify.design/lucide/scale.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> License
|
|
281
289
|
|
|
282
290
|
MIT - see [LICENSE](LICENSE). Source at [github.com/JayYuen666/dsh-zvec-grep](https://github.com/JayYuen666/dsh-zvec-grep). Issues go to that repository's tracker.
|
package/README.zh-CN.md
CHANGED
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
- [ 已知边界](#-已知边界)
|
|
60
60
|
- [ 常见问题](#-常见问题)
|
|
61
61
|
- [ 开发](#-开发)
|
|
62
|
+
- [ 反馈](#反馈)
|
|
62
63
|
- [ 许可](#-许可)
|
|
63
64
|
|
|
64
65
|
## <img src="https://api.iconify.design/lucide/shield.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 它做什么
|
|
@@ -106,8 +107,9 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
|
|
|
106
107
|
|
|
107
108
|
## <img src="https://api.iconify.design/lucide/plug.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 在 dsh 里启用
|
|
108
109
|
|
|
109
|
-
- `dsh.bundle.patch` 指向 `cordis.patch.yml`,其 `insert:`
|
|
110
|
+
- `dsh.bundle.patch` 指向 `cordis.patch.yml`,其 `insert:` 块含一条 `- id: dsh-plugin-shared` 供应行(必须保持开启;停用后卡片会失去 shared 组件供应),再加一条 `- id: zvec-grep`、`name: "@jayyuen66/dsh-zvec-grep"`——让宿主扫描 client 半的是**不带子路径的包名**。卡片组件来自 shared 的客户端行,以 `@jayyuen66/dsh-plugin-shared/client` 外置;宿主模块表提供 `react`、`zod` 与这条 shared 供应。bundle 安装走 pnpm(>= 12.3.0)。
|
|
110
111
|
- 缺任一注入宿主服务,cordis 就不激活本条目(启动诊断点名 `pending (waiting for service: …)`);ctx 形状不对时 apply 抛 `required services … missing`。
|
|
112
|
+
- 两条装载路径——dshmarket 热挂的 `mkt-*` 子树与 bundle 层——可能解析到同一份模块而在同一作用域里跑两遍 `apply`。第二份会抢一把私有实例服务锁并安静让路(只 `console.warn` 一行);三个工具、提示词段与 `zvecGrepRebuild` 命名空间仍由在册那一份提供,那一份 fiber 卸载时锁自动释放。
|
|
111
113
|
- 卡片注册在 `plugins.bundle.config` 槽的 **bundle 包名**键下;设置命名空间与 `configForms` 的读仍走裸条目 id `zvec-grep`(按条目 id 隐式注册)。
|
|
112
114
|
- 重建读取接口注册在 apply fiber 上——不声明 `webServer`、没有子 fiber。TUI 宿主上服务照常注册,只是卡片没有地方渲染。
|
|
113
115
|
- 状态轮询是客户端自己的定时器(2000 ms),不是服务端推送;每次读都以结果对象回答,不抛错。
|
|
@@ -162,7 +164,7 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
|
|
|
162
164
|
|
|
163
165
|
## <img src="https://api.iconify.design/lucide/sliders-horizontal.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 设置项
|
|
164
166
|
|
|
165
|
-
命名空间 `zvec-grep` 即设置条目 id;schema 共 18 个字段、逐字段带内置默认,其中卡上那 7 枚标 `.volatile()
|
|
167
|
+
命名空间 `zvec-grep` 即设置条目 id;schema 共 18 个字段、逐字段带内置默认,其中卡上那 7 枚标 `.volatile()`。越界数字草稿不会进 `onChange`,所以只要有数字字段越界,**保存**就被禁用(**撤销**保持可点),保存条同时点名原因。
|
|
166
168
|
|
|
167
169
|
| 字段 | 类型 | 默认值 | 作用 |
|
|
168
170
|
| --- | --- | --- | --- |
|
|
@@ -277,6 +279,12 @@ pnpm run check # 类型检查(三个 tsconfig 程序)→ lint → 两个 b
|
|
|
277
279
|
- `host.js` / `client.js` 不入库;`prepare` / `prepack` 现产,两条测试拿磁盘产物与内存构建逐字节比。发布物不手改。
|
|
278
280
|
- manifest 门(`test/publish-manifest.test.ts`)守发布清单:入口目标被 `files` 覆盖、宿主包不进 `dependencies`、`dsh-*` 精确钉、产物无本机路径。`test/dist-size.test.ts` 设体积预算,`test/readme-parity.test.ts` 钉两份 README 的结构对等。
|
|
279
281
|
|
|
282
|
+
## 反馈
|
|
283
|
+
|
|
284
|
+
欢迎提 issue 和 PR:[https://github.com/JayYuen666/dsh-zvec-grep/issues](https://github.com/JayYuen666/dsh-zvec-grep/issues)。
|
|
285
|
+
|
|
286
|
+
插件启动失败时,请附上 dsh 宿主版本、profile 安装形态和浏览器控制台原文。`missed the module table` 这一行尤其有用:它能直接说明 shared 客户端供应行有没有被物化。
|
|
287
|
+
|
|
280
288
|
## <img src="https://api.iconify.design/lucide/scale.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 许可
|
|
281
289
|
|
|
282
290
|
MIT,见 [LICENSE](LICENSE)。源码在 [github.com/JayYuen666/dsh-zvec-grep](https://github.com/JayYuen666/dsh-zvec-grep)。问题请提到那个仓库的 issue tracker。
|