@monotykamary/dsh-client-ui-skill 0.1.0-rc.8 → 0.1.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.i18n.yaml +1 -1
- package/README.zh.md +1 -1
- package/lib/client.js +33 -27
- package/package.json +20 -23
package/README.i18n.yaml
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/client/ui-skill/README.md
|
|
5
5
|
README.md: 5ca3ff05e3935fc1013d786ddf081c2e8474cb52
|
|
6
|
-
README.zh.md:
|
|
6
|
+
README.zh.md: 30d56aa714ab93fb8c63512cd934851476ada910
|
package/README.zh.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
skill(技能)调用 source 的浏览器端:把 `/` 触发的 `skill` source 注册进 `ctx.inputTriggers`。普通会话的候选来自 `skill.list` RPC,以每次调用的 `ClientSessionContext` 投影中的 `{sessionId}` 寻址,host 从会话 header 解析 `cwd`。宿主提供每一个用户可调用的 skill;`modelInvocable: false` 的条目(即 `disable-model-invocation` skill,此路径是其唯一入口)会以当前语言把仅限用户标记作为描述前缀带上。由目录寻址的可继续 subagent 在客户端解析为没有 skill 候选,因为现有 skill RPC 要求会话已挂载;查看其持久化历史不得激活它。目录按普通会话缓存,拉取走 single-flight;scope 创建时的 `warm` 钩子预热该会话的缓存项,转发的 owner 事件 `agent-preset/selected` 丢弃该会话这一项(目录属于 preset,而空会话可能在预热之后才切换),`connection/reset` 清空全部缓存。结果按 `startsWith(query)` 过滤。
|
|
6
6
|
|
|
7
|
-
pick 会落下字面文本 `/name `,发出的提示词中也是同一段字面文本([slash 流水线 Agent Note](../../../.agents/notes/implemented/architecture/2026-07-25-web-input-machine-and-slash-pipeline.md))——本 source 不实现任何裁决钩子,也没有引用 codec。确定性在宿主侧:pre-step 手势边界(`dsh-tool-skill`)识别用户消息中任意位置、以空白为界、指名用户可调用 skill 的 `/name` token,并为每个入口注入渲染后的 `<skill_content>`,因此菜单 pick、手动键入的 token 与 TUI/ACP(Agent Client Protocol)提示词都以同一种方式加载 skill。与宿主命令同名的名称仍解析为命令:裁决在客户端把该行认领走,它根本不会成为提示词——这是有意的优先级,与同类产品一致。列表 RPC 使用插件注册时捕获的根上下文连接——source 绝不从每次调用的参数上读取服务;草稿 chip 视觉由 `lexicon` 扫描派生。
|
|
7
|
+
pick 会落下字面文本 `/name `,发出的提示词中也是同一段字面文本([slash 流水线 Agent Note](../../../.agents/notes/implemented/architecture/2026-07-25-web-input-machine-and-slash-pipeline.zh.md))——本 source 不实现任何裁决钩子,也没有引用 codec。确定性在宿主侧:pre-step 手势边界(`dsh-tool-skill`)识别用户消息中任意位置、以空白为界、指名用户可调用 skill 的 `/name` token,并为每个入口注入渲染后的 `<skill_content>`,因此菜单 pick、手动键入的 token 与 TUI/ACP(Agent Client Protocol)提示词都以同一种方式加载 skill。与宿主命令同名的名称仍解析为命令:裁决在客户端把该行认领走,它根本不会成为提示词——这是有意的优先级,与同类产品一致。列表 RPC 使用插件注册时捕获的根上下文连接——source 绝不从每次调用的参数上读取服务;草稿 chip 视觉由 `lexicon` 扫描派生。
|
|
8
8
|
|
|
9
9
|
`skill.list` 失败时 `candidates` 抛出异常,slash 壳层记录日志,并静默丢弃该菜单组——菜单只显示 pending/ready 状态。
|
|
10
10
|
|
package/lib/client.js
CHANGED
|
@@ -7,8 +7,8 @@ window.__ModuleLoader__.load({
|
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let _monotykamary_dsh_client_ui_primitives = require("@monotykamary/dsh-client-ui-primitives");
|
|
10
|
-
//#region \0dsh-css:/
|
|
11
|
-
const css = ".
|
|
10
|
+
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-skill/src/client/SkillRow.module.css.mjs
|
|
11
|
+
const css = ".iWrAna_card{flex-direction:column;display:flex}.iWrAna_row{align-items:center;min-width:0;height:24px;display:flex}.iWrAna_row[data-expandable]{cursor:pointer}.iWrAna_card[data-state=running] .iWrAna_row .iWrAna_title,.iWrAna_card[data-state=running] .iWrAna_row .iWrAna_summary{position:relative;overflow:hidden}.iWrAna_leading{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:6px;display:inline-flex;position:relative}.iWrAna_chevron{color:var(--dsw-alias-label-secondary)}.iWrAna_iconIdle{opacity:1;transition:opacity .1s;display:inline-flex}.iWrAna_chevronHover{opacity:0;margin:auto;transition:opacity .1s;position:absolute;inset:0}.iWrAna_row:hover .iWrAna_iconIdle{opacity:0}.iWrAna_row:hover .iWrAna_chevronHover{opacity:1}.iWrAna_title{color:var(--dsw-alias-label-secondary);flex:none;font-size:14px;line-height:24px}.iWrAna_separator{background:var(--dsw-alias-label-caption);border-radius:1px;flex:none;width:2px;height:2px;margin:0 8px}.iWrAna_summary{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-tertiary);flex:auto;font-size:14px;line-height:24px;overflow:hidden}.iWrAna_errorSummary{color:var(--dsw-alias-state-error-primary)}.iWrAna_bodyWrap{flex-direction:column;display:flex}.iWrAna_instructionsCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-markdown-code-block);border-radius:12px;flex-direction:column;max-height:260px;margin:4px 0 4px 4px;display:flex;overflow:hidden}.iWrAna_instructionsHeader{border-bottom:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-markdown-code-block-banner);color:var(--dsw-alias-label-caption);text-transform:uppercase;letter-spacing:.04em;flex:none;padding:8px 12px;font-size:11px;font-weight:500;line-height:16px}.iWrAna_instructions{white-space:pre-wrap;overflow-wrap:anywhere;min-height:0;font:var(--dsw-font-markdown-code-block-small);color:var(--dsw-alias-label-secondary);margin:0;padding:10px 12px 12px;overflow:auto}.iWrAna_instructions[data-error]{color:var(--dsw-alias-state-error-primary)}.iWrAna_instructions::-webkit-scrollbar-thumb{background-clip:padding-box;border:2px solid #0000;border-radius:6px}.iWrAna_instructions::-webkit-scrollbar-track{margin:6px 0}.iWrAna_inspectButton{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-secondary);cursor:pointer;opacity:0;border-radius:999px;align-self:flex-start;align-items:center;gap:4px;margin:4px 0 2px 4px;padding:2px 8px;font-size:11px;line-height:16px;transition:opacity .1s;display:inline-flex}.iWrAna_card:hover .iWrAna_inspectButton,.iWrAna_inspectButton:focus-visible{opacity:1}.iWrAna_inspectButton:hover{background:var(--dsw-alias-interactive-bg-hover-solid);color:var(--dsw-alias-label-primary)}.iWrAna_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.iWrAna_iconIdle,.iWrAna_chevronHover,.iWrAna_inspectButton{transition:none}}";
|
|
12
12
|
const tagId = "@monotykamary/dsh-client-ui-skill/SkillRow.module.css";
|
|
13
13
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
14
14
|
const tag = document.createElement("style");
|
|
@@ -18,23 +18,22 @@ window.__ModuleLoader__.load({
|
|
|
18
18
|
document.head.appendChild(tag);
|
|
19
19
|
}
|
|
20
20
|
var SkillRow_module_css_default = {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"inspectButton": "
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"separator": "HXy9aG_separator"
|
|
21
|
+
"bodyWrap": "iWrAna_bodyWrap",
|
|
22
|
+
"card": "iWrAna_card",
|
|
23
|
+
"chevron": "iWrAna_chevron",
|
|
24
|
+
"chevronHover": "iWrAna_chevronHover",
|
|
25
|
+
"errorSummary": "iWrAna_errorSummary",
|
|
26
|
+
"iconIdle": "iWrAna_iconIdle",
|
|
27
|
+
"inspectButton": "iWrAna_inspectButton",
|
|
28
|
+
"instructions": "iWrAna_instructions",
|
|
29
|
+
"instructionsCard": "iWrAna_instructionsCard",
|
|
30
|
+
"instructionsHeader": "iWrAna_instructionsHeader",
|
|
31
|
+
"leading": "iWrAna_leading",
|
|
32
|
+
"row": "iWrAna_row",
|
|
33
|
+
"separator": "iWrAna_separator",
|
|
34
|
+
"summary": "iWrAna_summary",
|
|
35
|
+
"title": "iWrAna_title",
|
|
36
|
+
"visuallyHidden": "iWrAna_visuallyHidden"
|
|
38
37
|
};
|
|
39
38
|
//#endregion
|
|
40
39
|
//#region lib/types/client/SkillRow.js
|
|
@@ -81,18 +80,24 @@ window.__ModuleLoader__.load({
|
|
|
81
80
|
switch (state) {
|
|
82
81
|
case "error": return (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.StateDot, { state: "error" });
|
|
83
82
|
case "stopped": return (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.StateDot, { state: "warning" });
|
|
84
|
-
default: return (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.
|
|
83
|
+
default: return (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.WandSparkles, { size: 14 });
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
86
|
/** Leading disclosure slot: state icon at rest, chevron on hover or while open. */
|
|
88
87
|
function disclosureLeading(state, open, expandable) {
|
|
89
|
-
if (open) return (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.
|
|
88
|
+
if (open) return (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.ChevronDown, {
|
|
89
|
+
size: 14,
|
|
90
|
+
className: SkillRow_module_css_default.chevron
|
|
91
|
+
});
|
|
90
92
|
const icon = leadingFor(state);
|
|
91
93
|
if (!expandable) return icon;
|
|
92
94
|
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)("span", {
|
|
93
95
|
className: SkillRow_module_css_default.iconIdle,
|
|
94
96
|
children: icon
|
|
95
|
-
}), (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.
|
|
97
|
+
}), (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.ChevronDown, {
|
|
98
|
+
size: 14,
|
|
99
|
+
className: `${SkillRow_module_css_default.chevron} ${SkillRow_module_css_default.chevronHover}`
|
|
100
|
+
})] });
|
|
96
101
|
}
|
|
97
102
|
/** Visually hidden state copy for the colour-only lifecycle cues. */
|
|
98
103
|
function stateStatus(state, t) {
|
|
@@ -115,6 +120,7 @@ window.__ModuleLoader__.load({
|
|
|
115
120
|
const open = expanded && expandable;
|
|
116
121
|
const status = stateStatus(model.state, t);
|
|
117
122
|
const summary = model.errorSummary ?? model.name;
|
|
123
|
+
const running = model.state === "running";
|
|
118
124
|
const toggleExpand = () => {
|
|
119
125
|
setExpanded((value) => !value);
|
|
120
126
|
};
|
|
@@ -148,17 +154,17 @@ window.__ModuleLoader__.load({
|
|
|
148
154
|
className: SkillRow_module_css_default.visuallyHidden,
|
|
149
155
|
children: status
|
|
150
156
|
}) : null,
|
|
151
|
-
(0, react_jsx_runtime.
|
|
157
|
+
(0, react_jsx_runtime.jsxs)("span", {
|
|
152
158
|
className: SkillRow_module_css_default.title,
|
|
153
|
-
children: "Skill"
|
|
159
|
+
children: ["Skill", running && (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.TextShimmer, {})]
|
|
154
160
|
}),
|
|
155
161
|
(0, react_jsx_runtime.jsx)("span", {
|
|
156
162
|
className: SkillRow_module_css_default.separator,
|
|
157
163
|
"aria-hidden": true
|
|
158
164
|
}),
|
|
159
|
-
(0, react_jsx_runtime.
|
|
165
|
+
(0, react_jsx_runtime.jsxs)("span", {
|
|
160
166
|
className: model.errorSummary === null ? SkillRow_module_css_default.summary : `${SkillRow_module_css_default.summary} ${SkillRow_module_css_default.errorSummary}`,
|
|
161
|
-
children: summary
|
|
167
|
+
children: [summary, running && (0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.TextShimmer, {})]
|
|
162
168
|
})
|
|
163
169
|
]
|
|
164
170
|
}), open ? (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -178,7 +184,7 @@ window.__ModuleLoader__.load({
|
|
|
178
184
|
type: "button",
|
|
179
185
|
className: SkillRow_module_css_default.inspectButton,
|
|
180
186
|
onClick: inspect,
|
|
181
|
-
children: [(0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.
|
|
187
|
+
children: [(0, react_jsx_runtime.jsx)(_monotykamary_dsh_client_ui_primitives.ScanSearch, { size: 12 }), "Inspect"]
|
|
182
188
|
}) : null]
|
|
183
189
|
}) : null]
|
|
184
190
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monotykamary/dsh-client-ui-skill",
|
|
3
3
|
"description": "Web skill references and the dedicated skill tool row",
|
|
4
|
-
"version": "0.1.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -43,34 +43,31 @@
|
|
|
43
43
|
},
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"
|
|
47
|
-
"@monotykamary/dsh-
|
|
48
|
-
"@monotykamary/dsh-client-
|
|
49
|
-
"@monotykamary/dsh-client-
|
|
50
|
-
"@monotykamary/dsh-client-ui-
|
|
51
|
-
"@monotykamary/dsh-client-
|
|
52
|
-
"@monotykamary/dsh-
|
|
53
|
-
"@monotykamary/
|
|
54
|
-
"@monotykamary/dsh-invariants": "^0.1.0-rc.8",
|
|
55
|
-
"@monotykamary/cordis": "^4.0.1",
|
|
56
|
-
"@monotykamary/dsh-client-locale": "^0.1.0-rc.8"
|
|
46
|
+
"@monotykamary/dsh-api-remotes": "^0.1.0",
|
|
47
|
+
"@monotykamary/dsh-client-connection": "^0.1.0",
|
|
48
|
+
"@monotykamary/dsh-client-ui-input-trigger": "^0.1.0",
|
|
49
|
+
"@monotykamary/dsh-client-locale": "^0.1.0",
|
|
50
|
+
"@monotykamary/dsh-client-ui-tool": "^0.1.0",
|
|
51
|
+
"@monotykamary/dsh-client-runtime": "^0.1.0",
|
|
52
|
+
"@monotykamary/dsh-invariants": "^0.1.0",
|
|
53
|
+
"@monotykamary/cordis": "^4.0.1"
|
|
57
54
|
},
|
|
58
55
|
"devDependencies": {
|
|
59
56
|
"@testing-library/react": "^16.1.0",
|
|
60
57
|
"@types/react": "~18.3.1",
|
|
61
58
|
"react": "^18.2.0",
|
|
62
59
|
"react-dom": "^18.2.0",
|
|
63
|
-
"@monotykamary/dsh-api-remotes": "^0.1.0
|
|
64
|
-
"@monotykamary/dsh-client-connection": "^0.1.0
|
|
65
|
-
"@monotykamary/dsh-client-locale": "^0.1.0
|
|
66
|
-
"@monotykamary/dsh-client-
|
|
67
|
-
"@monotykamary/dsh-client-runtime": "^0.1.0
|
|
68
|
-
"@monotykamary/dsh-client-
|
|
69
|
-
"@monotykamary/dsh-client-ui-input-trigger": "^0.1.0
|
|
70
|
-
"@monotykamary/dsh-client-ui-slots": "^0.1.0
|
|
71
|
-
"@monotykamary/dsh-
|
|
72
|
-
"@monotykamary/
|
|
73
|
-
"@monotykamary/
|
|
60
|
+
"@monotykamary/dsh-api-remotes": "^0.1.0",
|
|
61
|
+
"@monotykamary/dsh-client-connection": "^0.1.0",
|
|
62
|
+
"@monotykamary/dsh-client-locale": "^0.1.0",
|
|
63
|
+
"@monotykamary/dsh-client-runtime": "^0.1.0",
|
|
64
|
+
"@monotykamary/dsh-client-test-runtime": "^0.1.0",
|
|
65
|
+
"@monotykamary/dsh-client-ui-primitives": "^0.1.0",
|
|
66
|
+
"@monotykamary/dsh-client-ui-input-trigger": "^0.1.0",
|
|
67
|
+
"@monotykamary/dsh-client-ui-slots": "^0.1.0",
|
|
68
|
+
"@monotykamary/dsh-client-ui-tool": "^0.1.0",
|
|
69
|
+
"@monotykamary/dsh-invariants": "^0.1.0",
|
|
70
|
+
"@monotykamary/cordis": "^4.0.1"
|
|
74
71
|
},
|
|
75
72
|
"files": [
|
|
76
73
|
"lib/index.js",
|