@khorsheed/dsh-inline-html-render 0.1.14 → 0.1.16
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 +9 -0
- package/README.en.md +3 -3
- package/README.i18n.yaml +2 -2
- package/README.md +3 -3
- package/lib/index.js +1 -1
- package/lib/types/index.js +1 -1
- package/package.json +6 -8
- package/lib/invariant.js +0 -25
- package/lib/types/invariant.d.ts +0 -16
- package/lib/types/invariant.js +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# 变更记录
|
|
2
2
|
|
|
3
|
+
## 0.1.16(2026-10-22)
|
|
4
|
+
|
|
5
|
+
- **技能卡来源归一为包全名**:随包注册的两个作者 skill(`inline-html-card`、`3d-artifact`)的 `provider` 从裸词 `inline-html-render` 改为 `@khorsheed/dsh-inline-html-render`——能力目录的技能卡与其他插件一样显示包全名;行为与 skill 内容不变
|
|
6
|
+
- 适配宿主 0.2.1 线:退役 invariant 伴生并声明 `engines.dsh`(`>=0.1.2-rc.1 <0.3.0-0`);peer 区间加 `|| ^0.2.1-rc.1`(严格解析路径下 `^0.2.0-rc.1` 不覆盖 0.2.1);verifiedHost 前移 0.2.1-rc.1
|
|
7
|
+
|
|
8
|
+
## 0.1.15(2026-09-30)
|
|
9
|
+
|
|
10
|
+
无功能变更。加宽 `@deepseek-ai/dsh-*` peer 区间以覆盖宿主 0.2.0(0.2.0 的兼容闸会禁用 peer 区间不覆盖宿主版本的已装插件)。
|
|
11
|
+
|
|
3
12
|
## 0.1.14(2026-09-27)
|
|
4
13
|
|
|
5
14
|
- **修复 rc.1 宿主上卡片不再渲染**:rc.1 的 `CodeToolbar` 对 shiki 不认得的 fence 语言一律显示宿主本地化的通用标签(「代码块」),`dsh-card` 信息串完全不进 DOM(无 `.infostring`、无前导文本、无 `language-*` 类)。检测新增内容签名兜底:完整 HTML 文档(doctype/`<html` 开头 + `</html>` 收尾)或含逐字严格 CSP meta 的块即判定为卡片;`.infostring` 与前导文本两臂原样保留(旧宿主与 0.1.5 线不变)。裸 HTML 片段在信息串不可见的宿主上不再识别为卡片(已知损失,上游 `data-lang` 提案见 docs/upstream-proposals)。
|
package/README.en.md
CHANGED
|
@@ -6,7 +6,7 @@ English | [中文](README.md)
|
|
|
6
6
|
|
|
7
7
|
Without it, an agent that wants you to *see* a result can only paste code for you to imagine, or write an HTML file you have to open in a preview. This plugin swaps the fenced block whose info string is `dsh-card` for a sandboxed iframe — mid-message — that runs the authored HTML: inline between paragraphs and genuinely interactive, not ASCII art or a prose description.
|
|
8
8
|
|
|
9
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-
|
|
9
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/inline-html-card-1.png" width="640" alt="a dsh-card block in the agent's reply rendered as a tabbed data-observation card, flowing with the surrounding text">
|
|
10
10
|
|
|
11
11
|
```dsh-card
|
|
12
12
|
<div style="font:14px system-ui;padding:16px;background:#1e1e1e;border-radius:10px;color:#eee">
|
|
@@ -57,7 +57,7 @@ The two skills the host half registers, `inline-html-card` and `3d-artifact`, sh
|
|
|
57
57
|
## Compatibility
|
|
58
58
|
|
|
59
59
|
- npm release line (`@deepseek-ai/dsh@0.1.5-rc.1`): ✅ full — this plugin consumes only standard DOM plus the client-runtime `ClientContext`, with no host-service dependency; minHost is 0.1.2-rc.1 — older hosts stay on the previous release line.
|
|
60
|
-
- source line (deepseek-harness master): ✅ (verifiedHost: 0.1
|
|
60
|
+
- source line (deepseek-harness master): ✅ (verifiedHost: 0.2.1-rc.1) — host-021 wave: full build+test green against the 0.2.1-rc.1 tree, no other surface changes; the DOM anchors re-checked on master (0.1.7-rc.2) are unchanged: `CodeBlock` still renders the `.md-code-block` wrapper with the info string in its banner (a CSS-module hashed class, caught by the leading-text fallback), `AssistantMarkdown` still sets `data-streaming`, and `ui-sidebar-browser` still registers the `browser` right-Sidebar tab kind.
|
|
61
61
|
|
|
62
62
|
## Known Limitations
|
|
63
63
|
|
|
@@ -71,7 +71,7 @@ The two skills the host half registers, `inline-html-card` and `3d-artifact`, sh
|
|
|
71
71
|
<details>
|
|
72
72
|
<summary>Internals (click to expand)</summary>
|
|
73
73
|
|
|
74
|
-
**Architecture.** The browser half is a pure DOM-layer effect: it owns no slot and registers no Remote, mutating only the DOM the official client already rendered — the same repo-accepted last-resort pattern as message-tools' dom-hider — so it composes as an independent package with no core edits. The host half (`src/index.ts`) does exactly one thing: once the skill registry is ready (awaited via `ctx.inject(['skills'], …)` rather than probed synchronously at apply time), it registers the two bundled content-only skills (a missing/malformed SKILL.md warns, never throws; a composition without the `skills` service stays pending, never fails boot). Identity triangle: the cordis.patch.yml row id `inline-html-render` = the package.json name =
|
|
74
|
+
**Architecture.** The browser half is a pure DOM-layer effect: it owns no slot and registers no Remote, mutating only the DOM the official client already rendered — the same repo-accepted last-resort pattern as message-tools' dom-hider — so it composes as an independent package with no core edits. The host half (`src/index.ts`) does exactly one thing: once the skill registry is ready (awaited via `ctx.inject(['skills'], …)` rather than probed synchronously at apply time), it registers the two bundled content-only skills (a missing/malformed SKILL.md warns, never throws; a composition without the `skills` service stays pending, never fails boot). Identity triangle: the cordis.patch.yml row id `inline-html-render` = the package.json name = the tsdown `clientBundle` id.
|
|
75
75
|
|
|
76
76
|
| Module | Responsibility |
|
|
77
77
|
| --- | --- |
|
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# last confirmed-consistent state. Both languages carry equal authority; after
|
|
3
3
|
# editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/inline-html-render/README.en.md
|
|
5
|
-
packages/inline-html-render/README.en.md:
|
|
6
|
-
packages/inline-html-render/README.md:
|
|
5
|
+
packages/inline-html-render/README.en.md: e87317bab7778e1be2d5db04c4759610d13eb0ae
|
|
6
|
+
packages/inline-html-render/README.md: 11c14dd73d0fe3085b23259fd64ef2ee57e1b718
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
没有它的时候,agent 想让你**看到**一个效果,只能贴段代码让你脑补,或者写个 HTML 文件等你去预览里打开。这个插件把 info string 为 `dsh-card` 的 fenced block 在消息流中间替换成一个沙箱 iframe,直接运行其中的 HTML——内联在段落之间、真正可交互,而不是 ASCII 图或一句描述。
|
|
8
8
|
|
|
9
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-
|
|
9
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/inline-html-card-1.png" width="640" alt="agent 回复中间的 dsh-card 代码块被渲染成一张带 tab 的数据观测卡片,与上下文文字自然衔接">
|
|
10
10
|
|
|
11
11
|
```dsh-card
|
|
12
12
|
<div style="font:14px system-ui;padding:16px;background:#1e1e1e;border-radius:10px;color:#eee">
|
|
@@ -57,7 +57,7 @@ host 半边注册的 `inline-html-card` 与 `3d-artifact` 两个 skill 同属一
|
|
|
57
57
|
## Compatibility
|
|
58
58
|
|
|
59
59
|
- npm 发布线(`@deepseek-ai/dsh@0.1.5-rc.1`):✅ 完整——本插件只消费标准 DOM 与客户端运行时 `ClientContext`,不依赖任何 host 服务;minHost 0.1.2-rc.1,0.1.2 之前的宿主请停留在旧发布线。
|
|
60
|
-
- 源码线(deepseek-harness master):✅(verifiedHost: 0.1.2-rc.1
|
|
60
|
+
- 源码线(deepseek-harness master):✅(verifiedHost: 0.2.1-rc.1)——host-021 波对 0.2.1-rc.1 树全量 build+test 绿,无其它表面变化;所依赖的 DOM 锚点在 master(0.1.7-rc.2)复核无变化:`CodeBlock` 仍渲染 `.md-code-block` 容器且 banner 带 info string(CSS-module 哈希类名,由前导文本回退路径识别),`AssistantMarkdown` 仍置 `data-streaming`,`ui-sidebar-browser` 仍注册 `browser` 右侧栏标签类型。
|
|
61
61
|
|
|
62
62
|
## 已知限制
|
|
63
63
|
|
|
@@ -71,7 +71,7 @@ host 半边注册的 `inline-html-card` 与 `3d-artifact` 两个 skill 同属一
|
|
|
71
71
|
<details>
|
|
72
72
|
<summary>内部结构(点击展开)</summary>
|
|
73
73
|
|
|
74
|
-
**架构。** 浏览器半部分是纯 DOM 层效果:不拥有 slot、不注册 Remote,只改写官方已渲染的 DOM——与 message-tools 的 dom-hider 同属仓库接受的 last-resort 模式,因此可以作为独立包组合,不改任何核心包。host 半部分(`src/index.ts`)只做一件事:经 `ctx.inject(['skills'], …)` 等 skill 注册表就绪后,注册随包的两个内容型 skill(SKILL.md 缺失/畸形只 warn 不 throw;组合里没有 `skills` 服务时保持 pending,绝不炸 boot)。身份三角:cordis.patch.yml 行 id `inline-html-render` = package.json name = `
|
|
74
|
+
**架构。** 浏览器半部分是纯 DOM 层效果:不拥有 slot、不注册 Remote,只改写官方已渲染的 DOM——与 message-tools 的 dom-hider 同属仓库接受的 last-resort 模式,因此可以作为独立包组合,不改任何核心包。host 半部分(`src/index.ts`)只做一件事:经 `ctx.inject(['skills'], …)` 等 skill 注册表就绪后,注册随包的两个内容型 skill(SKILL.md 缺失/畸形只 warn 不 throw;组合里没有 `skills` 服务时保持 pending,绝不炸 boot)。身份三角:cordis.patch.yml 行 id `inline-html-render` = package.json name = tsdown `clientBundle` id。
|
|
75
75
|
|
|
76
76
|
| 模块 | 职责 |
|
|
77
77
|
| --- | --- |
|
package/lib/index.js
CHANGED
|
@@ -49,7 +49,7 @@ function readSkill(ctx, skillName) {
|
|
|
49
49
|
description,
|
|
50
50
|
content,
|
|
51
51
|
source: "runtime",
|
|
52
|
-
provider: "inline-html-render"
|
|
52
|
+
provider: "@khorsheed/dsh-inline-html-render"
|
|
53
53
|
};
|
|
54
54
|
} catch (error) {
|
|
55
55
|
ctx.logger.warn(`inline-html-render: shipped SKILL.md unreadable (${String(error)}) — the ${skillName} skill is not registered`);
|
package/lib/types/index.js
CHANGED
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"card",
|
|
11
11
|
"sandbox"
|
|
12
12
|
],
|
|
13
|
-
"version": "0.1.
|
|
13
|
+
"version": "0.1.16",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"main": "lib/index.js",
|
|
16
16
|
"types": "lib/types/index.d.ts",
|
|
@@ -19,10 +19,6 @@
|
|
|
19
19
|
"types": "./lib/types/index.d.ts",
|
|
20
20
|
"default": "./lib/index.js"
|
|
21
21
|
},
|
|
22
|
-
"./invariant": {
|
|
23
|
-
"types": "./lib/types/invariant.d.ts",
|
|
24
|
-
"default": "./lib/invariant.js"
|
|
25
|
-
},
|
|
26
22
|
"./client": {
|
|
27
23
|
"types": "./lib/types/client/index.d.ts",
|
|
28
24
|
"default": "./lib/client.js"
|
|
@@ -41,13 +37,15 @@
|
|
|
41
37
|
},
|
|
42
38
|
"compat": {
|
|
43
39
|
"minHost": "0.1.2-rc.1",
|
|
44
|
-
"verifiedHost": "0.1
|
|
40
|
+
"verifiedHost": "0.2.1-rc.1"
|
|
45
41
|
}
|
|
46
42
|
},
|
|
47
43
|
"license": "MIT",
|
|
44
|
+
"engines": {
|
|
45
|
+
"dsh": ">=0.1.2-rc.1 <0.3.0-0"
|
|
46
|
+
},
|
|
48
47
|
"peerDependencies": {
|
|
49
|
-
"@deepseek-ai/cordis": "^4.0.1"
|
|
50
|
-
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6"
|
|
48
|
+
"@deepseek-ai/cordis": "^4.0.1"
|
|
51
49
|
},
|
|
52
50
|
"files": [
|
|
53
51
|
"lib",
|
package/lib/invariant.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@khorsheed/dsh-inline-html-render`.
|
|
4
|
-
* @module @khorsheed/dsh-inline-html-render/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@khorsheed/dsh-inline-html-render";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "client-inline-html-render-invariant";
|
|
9
|
-
/** Service required before the companion can reserve package ownership. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* No runtime invariant: the renderer is a pure DOM-layer effect owning its own
|
|
13
|
-
* MutationObserver and a per-document iframe/`<pre>` pair; there is no durable
|
|
14
|
-
* state shared with other packages. Reserved here so the loader knows this
|
|
15
|
-
* package is alive (and so a future invariant can attach without a rename).
|
|
16
|
-
*/
|
|
17
|
-
const install = () => {};
|
|
18
|
-
/**
|
|
19
|
-
* Register this package's invariant companion.
|
|
20
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
21
|
-
* @returns The installed registration's disposer after setup succeeds.
|
|
22
|
-
*/
|
|
23
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
24
|
-
//#endregion
|
|
25
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@khorsheed/dsh-inline-html-render`.
|
|
3
|
-
* @module @khorsheed/dsh-inline-html-render/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "client-inline-html-render-invariant";
|
|
8
|
-
/** Service required before the companion can reserve package ownership. */
|
|
9
|
-
export declare const inject: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Register this package's invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns The installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
-
//# sourceMappingURL=invariant.d.ts.map
|
package/lib/types/invariant.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@khorsheed/dsh-inline-html-render`.
|
|
3
|
-
* @module @khorsheed/dsh-inline-html-render/invariant
|
|
4
|
-
*/
|
|
5
|
-
const PACKAGE_NAME = '@khorsheed/dsh-inline-html-render';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export const name = 'client-inline-html-render-invariant';
|
|
8
|
-
/** Service required before the companion can reserve package ownership. */
|
|
9
|
-
export const inject = ['invariants'];
|
|
10
|
-
/**
|
|
11
|
-
* No runtime invariant: the renderer is a pure DOM-layer effect owning its own
|
|
12
|
-
* MutationObserver and a per-document iframe/`<pre>` pair; there is no durable
|
|
13
|
-
* state shared with other packages. Reserved here so the loader knows this
|
|
14
|
-
* package is alive (and so a future invariant can attach without a rename).
|
|
15
|
-
*/
|
|
16
|
-
const install = () => { };
|
|
17
|
-
/**
|
|
18
|
-
* Register this package's invariant companion.
|
|
19
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
20
|
-
* @returns The installed registration's disposer after setup succeeds.
|
|
21
|
-
*/
|
|
22
|
-
export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
23
|
-
/* jscpd:ignore-end */
|