dsh-desktop-enhance 0.6.1 → 0.6.2

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/lib/client.js CHANGED
@@ -262,6 +262,7 @@ window.__ModuleLoader__.load({
262
262
  "settings.skills.scope.project": "项目级 Skill",
263
263
  "settings.skills.scope.global": "全局级 Skill",
264
264
  "settings.skills.scope.plugin": "插件与内置 Skill",
265
+ "settings.skills.scope.unknown": "来源未知",
265
266
  "settings.skills.userOnly": "仅手动 /",
266
267
  "settings.skills.preview": "预览 ↗",
267
268
  "settings.suggestModel": "建议用哪个模型",
@@ -405,6 +406,7 @@ window.__ModuleLoader__.load({
405
406
  "settings.skills.scope.project": "Project skills",
406
407
  "settings.skills.scope.global": "Global skills",
407
408
  "settings.skills.scope.plugin": "Plugin & bundled skills",
409
+ "settings.skills.scope.unknown": "Unknown source",
408
410
  "settings.skills.userOnly": "Manual / only",
409
411
  "settings.skills.preview": "Preview ↗",
410
412
  "settings.suggestModel": "Model for suggestions",
@@ -1918,7 +1920,8 @@ window.__ModuleLoader__.load({
1918
1920
  const SKILL_SCOPE_ORDER = [
1919
1921
  "project",
1920
1922
  "global",
1921
- "plugin"
1923
+ "plugin",
1924
+ "unknown"
1922
1925
  ];
1923
1926
  function extractPackageBadgeFromPath(rawPath) {
1924
1927
  const normalized = rawPath.replaceAll("\\", "/");
@@ -2059,14 +2062,13 @@ window.__ModuleLoader__.load({
2059
2062
  missing.push(remembered);
2060
2063
  continue;
2061
2064
  }
2062
- const isOffice = name === "office" || name.startsWith("office-");
2063
2065
  missing.push({
2064
2066
  name,
2065
2067
  description: "",
2066
- source: isOffice ? "bundled" : "user-agents",
2067
- provider: isOffice ? "dsh-office" : "filesystem",
2068
- scope: isOffice ? "plugin" : "global",
2069
- sourceBadge: isOffice ? "dsh-office" : "~/.agents/skills",
2068
+ source: "",
2069
+ provider: "",
2070
+ scope: "unknown",
2071
+ sourceBadge: "unknown",
2070
2072
  modelInvocable: true,
2071
2073
  userInvocable: true
2072
2074
  });
@@ -2983,7 +2985,7 @@ window.__ModuleLoader__.load({
2983
2985
  headerAttr: "data-default-skill-subgroup-header",
2984
2986
  batchAttr: "data-default-skill-subgroup-batch",
2985
2987
  groupKey: subgroup.key,
2986
- label: subgroup.label,
2988
+ label: subgroup.scope === "unknown" ? t("settings.skills.scope.unknown") : subgroup.label,
2987
2989
  isOpen: subOpen,
2988
2990
  total: subgroup.total,
2989
2991
  disabledCount: subgroup.disabled,
@@ -3016,7 +3018,7 @@ window.__ModuleLoader__.load({
3016
3018
  key: "badge",
3017
3019
  className: "de-defaults-source-badge",
3018
3020
  "data-skill-scope": item.scope
3019
- }, item.sourceBadge),
3021
+ }, item.scope === "unknown" ? t("settings.skills.scope.unknown") : item.sourceBadge),
3020
3022
  !item.modelInvocable ? h("span", {
3021
3023
  key: "user-only",
3022
3024
  className: "de-defaults-source-badge"
@@ -5133,7 +5135,7 @@ window.__ModuleLoader__.load({
5133
5135
  },
5134
5136
  batchAttr: "data-skills-subgroup-batch",
5135
5137
  batchValue: subgroup.key,
5136
- labelText: subgroup.label,
5138
+ labelText: subgroup.scope === "unknown" ? t("settings.skills.scope.unknown") : subgroup.label,
5137
5139
  isOpen: subOpen,
5138
5140
  total: subgroup.total,
5139
5141
  disabledCount: subgroup.disabled,
@@ -5168,7 +5170,7 @@ window.__ModuleLoader__.load({
5168
5170
  }
5169
5171
  const sourceBadge = globalThis.document.createElement("span");
5170
5172
  sourceBadge.setAttribute("data-skills-source-badge", item.scope);
5171
- sourceBadge.textContent = item.sourceBadge;
5173
+ sourceBadge.textContent = item.scope === "unknown" ? t("settings.skills.scope.unknown") : item.sourceBadge;
5172
5174
  nameRow.appendChild(sourceBadge);
5173
5175
  if (!item.modelInvocable) {
5174
5176
  const userOnly = globalThis.document.createElement("span");
package/lib/index.d.ts CHANGED
@@ -143,7 +143,7 @@ declare function handleToolsCatalog(ctx: HostContext, request?: Request): Promis
143
143
  declare function registerToolsRoute(ctx: HostContext): () => void;
144
144
  //#endregion
145
145
  //#region src/shared/skills-manager.d.ts
146
- type SkillScope = 'project' | 'global' | 'plugin';
146
+ type SkillScope = 'project' | 'global' | 'plugin' | 'unknown';
147
147
  interface SkillCatalogItem {
148
148
  readonly name: string;
149
149
  readonly description: string;
package/lib/index.js CHANGED
@@ -2244,8 +2244,12 @@ function filterSkillsList(skills, enabled, disabled) {
2244
2244
  //#region src/skills-manager/host.ts
2245
2245
  const SKILLS_PATH = SKILLS_ROUTE;
2246
2246
  const rawSkillListMap = new WeakMap();
2247
+ function skillServiceIdentity(service) {
2248
+ const original = Reflect.get(service, Symbol.for("cordis.original"));
2249
+ return original !== null && typeof original === "object" ? original : service;
2250
+ }
2247
2251
  function getUnfilteredList(skillsService) {
2248
- const raw = rawSkillListMap.get(skillsService);
2252
+ const raw = rawSkillListMap.get(skillServiceIdentity(skillsService));
2249
2253
  if (raw !== void 0) return raw;
2250
2254
  if (typeof skillsService.list === "function") return skillsService.list.bind(skillsService);
2251
2255
  }
@@ -2381,7 +2385,7 @@ function installSkillsPolicy(ctx, readState) {
2381
2385
  const snap = await origSnapshot(options);
2382
2386
  return Array.isArray(snap?.skills) ? snap.skills : [];
2383
2387
  } : origList;
2384
- if (unfilteredList !== void 0) rawSkillListMap.set(skillsService, unfilteredList);
2388
+ if (unfilteredList !== void 0) rawSkillListMap.set(skillServiceIdentity(skillsService), unfilteredList);
2385
2389
  if (origList !== void 0) {
2386
2390
  const baseList = unfilteredList ?? origList;
2387
2391
  skillsService.list = async (options) => {
@@ -2407,7 +2411,7 @@ function installSkillsPolicy(ctx, readState) {
2407
2411
  return await origGet(name, options);
2408
2412
  };
2409
2413
  disposers.push(() => {
2410
- rawSkillListMap.delete(skillsService);
2414
+ rawSkillListMap.delete(skillServiceIdentity(skillsService));
2411
2415
  if (origList !== void 0) skillsService.list = origList;
2412
2416
  if (origSnapshot !== void 0) skillsService.snapshot = origSnapshot;
2413
2417
  if (origGet !== void 0) skillsService.get = origGet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-desktop-enhance",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "DSH Desktop 界面增强:页内查找(Cmd+F)、轮次编号、上下文压缩行常显、建议、每步耗时、折叠文件夹状态计数、会话信息(含上下文注入 C1 视图)、工具管理、Skill 管理、独立远程接入与手机体验。",
5
5
  "type": "module",
6
6
  "icon": "./icon.svg",