dsh-skill-picker 0.3.3 → 0.3.4

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 CHANGED
@@ -102,6 +102,7 @@ DSH 的 [dsh-tool-skill](https://github.com/deepseek-ai/deepseek-harness) 在 `a
102
102
 
103
103
  ## 更新日志
104
104
 
105
+ - **v0.3.4**:适配 DSH 0.1.2-alpha.5 —— 技能列表改用官方 `remote.skills` RPC(alpha.5 将 rc.x 的 `connection.api.skills` 改名),`/` 补全与 ⚡ 面板统一「官方 RPC → host 扫描兜底」;`dsh.client.inject` 声明 `dsh-client-ui-input-trigger`(alpha.5 装载器只给声明了提供者的插件暴露 `inputTriggers` 服务)。修复 alpha.5 下 `/` 模糊/拼音搜索失效(实测 `/jiyi` → backup-memory)
105
106
  - **v0.3.3**:兜底扫描对齐官方全部技能根——补扫 user-agents 层(`~/.agents/skills`,含 `DSH_AGENTS_HOME`),扫描顺序与官方 rank 一致(项目级优先于用户级);走兜底时 ⚡ 面板显示「本地扫描」来源徽标便于排障(对应 issue #5)
106
107
  - **v0.3.2**:安装文档修正——实测三种安装方式并补网络特例(HTTPS 受限改 SSH、npm 新版本 24h 内被 minimumReleaseAge 门禁挡旧版的规避方法)
107
108
  - **v0.3.1**:README 顶部新增一键快速安装命令(`dsh plugin --profile web add dsh-skill-picker`)与 npm 版本/许可徽章
package/lib/client.js CHANGED
@@ -26100,10 +26100,13 @@ function SkillPickerButton(props) {
26100
26100
  ] });
26101
26101
  }
26102
26102
  function apply(ctx) {
26103
+ const inputTriggers = typeof ctx.get === "function" ? ctx.get("inputTriggers") : ctx.inputTriggers;
26103
26104
  const listSkills = async (sessionId) => {
26104
- const skills = ctx.connection?.api?.skills;
26105
+ const remoteSkills = ctx.remote?.skills;
26106
+ const connectionSkills = ctx.connection?.api?.skills;
26107
+ const skills = remoteSkills ?? connectionSkills;
26105
26108
  if (skills === void 0 || typeof skills.list !== "function") {
26106
- throw new Error("connection.api.skills unavailable");
26109
+ throw new Error("skills RPC unavailable (remote.skills / connection.api.skills)");
26107
26110
  }
26108
26111
  const controller = new AbortController();
26109
26112
  const { result } = await skills.list({ sessionId }, controller.signal);
@@ -26122,6 +26125,24 @@ function apply(ctx) {
26122
26125
  currentCwd = "";
26123
26126
  }
26124
26127
  };
26128
+ const fetchHostSkills = async () => {
26129
+ const cwd = typeof currentCwd === "string" && currentCwd !== "" ? `?cwd=${encodeURIComponent(currentCwd)}` : "";
26130
+ const res = await fetch(`/dsh-skill-picker/skills${cwd}`, { headers: { accept: "application/json" } });
26131
+ const json = await res.json();
26132
+ if (!json.ok) throw new Error(json.error || "bad response");
26133
+ return Array.isArray(json.skills) ? json.skills : [];
26134
+ };
26135
+ const resolveSkills = async (sessionId) => {
26136
+ try {
26137
+ return await listSkills(sessionId);
26138
+ } catch {
26139
+ try {
26140
+ return await fetchHostSkills();
26141
+ } catch {
26142
+ return [];
26143
+ }
26144
+ }
26145
+ };
26125
26146
  syncCwd();
26126
26147
  const unsubscribe = ctx.sessions.list.subscribe(syncCwd);
26127
26148
  ctx.effect(() => {
@@ -26152,7 +26173,7 @@ function apply(ctx) {
26152
26173
  };
26153
26174
  const refreshNames = async (sessionId) => {
26154
26175
  try {
26155
- const skills = await listSkills(sessionId);
26176
+ const skills = await resolveSkills(sessionId);
26156
26177
  namesCache.set(sessionId, (Array.isArray(skills) ? skills : []).map((s) => s.name));
26157
26178
  notifyLexicon(sessionId);
26158
26179
  } catch {
@@ -26163,7 +26184,7 @@ function apply(ctx) {
26163
26184
  name: "skill-fuzzy",
26164
26185
  order: -10,
26165
26186
  async candidates(session, { query, signal }) {
26166
- const skills = await listSkills(session.sessionId);
26187
+ const skills = await resolveSkills(session.sessionId);
26167
26188
  if (signal.aborted) return [];
26168
26189
  namesCache.set(session.sessionId, skills.map((s) => s.name));
26169
26190
  notifyLexicon(session.sessionId);
@@ -26213,7 +26234,11 @@ function apply(ctx) {
26213
26234
  return { text: `/${candidate.name} ` };
26214
26235
  }
26215
26236
  };
26216
- const unregister = ctx.inputTriggers.registerSource(source);
26237
+ if (inputTriggers === void 0 || typeof inputTriggers.registerSource !== "function") {
26238
+ console.warn("[dsh-skill-picker] inputTriggers service unavailable; fuzzy / completion disabled (\u26A1 panel still works)");
26239
+ return;
26240
+ }
26241
+ const unregister = inputTriggers.registerSource(source);
26217
26242
  return () => {
26218
26243
  unregister();
26219
26244
  namesCache.clear();