dsh-desktop-enhance 0.3.11 → 0.3.12

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
@@ -1787,6 +1787,7 @@ window.__ModuleLoader__.load({
1787
1787
  sourceBadge: provider || source || "plugin"
1788
1788
  };
1789
1789
  }
1790
+ const rememberedSkills = new Map();
1790
1791
  function normalizeSkillCatalogItems(list, options) {
1791
1792
  const includeProject = options?.includeProject ?? true;
1792
1793
  const byName = new Map();
@@ -1805,7 +1806,7 @@ window.__ModuleLoader__.load({
1805
1806
  const modelInvocable = typeof row.modelInvocable === "boolean" ? row.modelInvocable : typeof invocation?.modelInvocable === "boolean" ? invocation.modelInvocable : true;
1806
1807
  const userInvocable = typeof row.userInvocable === "boolean" ? row.userInvocable : typeof invocation?.userInvocable === "boolean" ? invocation.userInvocable : true;
1807
1808
  const whenToUse = typeof row.whenToUse === "string" && row.whenToUse.trim() !== "" ? row.whenToUse.trim() : void 0;
1808
- byName.set(name, {
1809
+ const entry = {
1809
1810
  name,
1810
1811
  description,
1811
1812
  source,
@@ -1816,7 +1817,9 @@ window.__ModuleLoader__.load({
1816
1817
  ...whenToUse === void 0 ? {} : { whenToUse },
1817
1818
  modelInvocable,
1818
1819
  userInvocable
1819
- });
1820
+ };
1821
+ rememberedSkills.set(name, entry);
1822
+ byName.set(name, entry);
1820
1823
  }
1821
1824
  return [...byName.values()].sort((a, b) => compareCodeUnits(a.name, b.name));
1822
1825
  }
@@ -1835,8 +1838,9 @@ window.__ModuleLoader__.load({
1835
1838
  available: true
1836
1839
  };
1837
1840
  }
1838
- function mergeMissingDisabledSkills(skills, disabled) {
1841
+ function mergeMissingDisabledSkills(skills, disabled, options) {
1839
1842
  if (disabled.size === 0) return skills;
1843
+ const includeProject = options?.includeProject ?? true;
1840
1844
  const seen = new Set();
1841
1845
  for (const skill of skills) seen.add(skill.name);
1842
1846
  const missing = [];
@@ -1844,14 +1848,20 @@ window.__ModuleLoader__.load({
1844
1848
  const name = typeof rawName === "string" ? rawName.trim() : "";
1845
1849
  if (name === "" || seen.has(name)) continue;
1846
1850
  seen.add(name);
1851
+ const remembered = rememberedSkills.get(name);
1852
+ if (remembered !== void 0) {
1853
+ if (!includeProject && remembered.scope === "project") continue;
1854
+ missing.push(remembered);
1855
+ continue;
1856
+ }
1847
1857
  const isOffice = name === "office" || name.startsWith("office-");
1848
1858
  missing.push({
1849
1859
  name,
1850
1860
  description: "",
1851
- source: isOffice ? "bundled" : "user-dsh",
1861
+ source: isOffice ? "bundled" : "user-agents",
1852
1862
  provider: isOffice ? "dsh-office" : "filesystem",
1853
1863
  scope: isOffice ? "plugin" : "global",
1854
- sourceBadge: isOffice ? "dsh-office" : "~/.dsh/skills",
1864
+ sourceBadge: isOffice ? "dsh-office" : "~/.agents/skills",
1855
1865
  modelInvocable: true,
1856
1866
  userInvocable: true
1857
1867
  });
@@ -1862,7 +1872,7 @@ window.__ModuleLoader__.load({
1862
1872
  function buildSkillScopeGroups(skills, disabled, query = "", options) {
1863
1873
  const includeProject = options?.includeProject ?? true;
1864
1874
  const needle = typeof query === "string" ? query.trim().toLowerCase() : "";
1865
- const completeSkills = mergeMissingDisabledSkills(skills, disabled);
1875
+ const completeSkills = mergeMissingDisabledSkills(skills, disabled, { includeProject });
1866
1876
  const buckets = new Map();
1867
1877
  for (const scope of SKILL_SCOPE_ORDER) buckets.set(scope, []);
1868
1878
  for (const skill of completeSkills) {
@@ -2691,7 +2701,7 @@ window.__ModuleLoader__.load({
2691
2701
  };
2692
2702
  }, []);
2693
2703
  const disabledSet = parseDisabledTools(disabledRaw);
2694
- const skills = catalog?.available ? mergeMissingDisabledSkills(catalog.skills, disabledSet) : [];
2704
+ const skills = catalog?.available ? mergeMissingDisabledSkills(catalog.skills, disabledSet, { includeProject: false }) : [];
2695
2705
  const disabledInCatalog = skills.filter((skill) => disabledSet.has(skill.name));
2696
2706
  const enabledCount = skills.length - disabledInCatalog.length;
2697
2707
  const displayDisabledNames = skills.length > 0 ? disabledInCatalog.map((skill) => skill.name) : [...disabledSet];
package/lib/index.js CHANGED
@@ -1632,6 +1632,7 @@ function classifySkillScope(rawSource, rawProvider, rawPath) {
1632
1632
  sourceBadge: provider || source || "plugin"
1633
1633
  };
1634
1634
  }
1635
+ const rememberedSkills = new Map();
1635
1636
  function normalizeSkillCatalogItems(list, options) {
1636
1637
  const includeProject = options?.includeProject ?? true;
1637
1638
  const byName = new Map();
@@ -1650,7 +1651,7 @@ function normalizeSkillCatalogItems(list, options) {
1650
1651
  const modelInvocable = typeof row.modelInvocable === "boolean" ? row.modelInvocable : typeof invocation?.modelInvocable === "boolean" ? invocation.modelInvocable : true;
1651
1652
  const userInvocable = typeof row.userInvocable === "boolean" ? row.userInvocable : typeof invocation?.userInvocable === "boolean" ? invocation.userInvocable : true;
1652
1653
  const whenToUse = typeof row.whenToUse === "string" && row.whenToUse.trim() !== "" ? row.whenToUse.trim() : void 0;
1653
- byName.set(name, {
1654
+ const entry = {
1654
1655
  name,
1655
1656
  description,
1656
1657
  source,
@@ -1661,7 +1662,9 @@ function normalizeSkillCatalogItems(list, options) {
1661
1662
  ...whenToUse === void 0 ? {} : { whenToUse },
1662
1663
  modelInvocable,
1663
1664
  userInvocable
1664
- });
1665
+ };
1666
+ rememberedSkills.set(name, entry);
1667
+ byName.set(name, entry);
1665
1668
  }
1666
1669
  return [...byName.values()].sort((a, b) => compareCodeUnits(a.name, b.name));
1667
1670
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-desktop-enhance",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "DSH Desktop 界面增强:页内查找(Cmd+F)、轮次编号、上下文压缩行常显、建议、每步耗时、会话信息、工具管理、Skill 管理。",
5
5
 
6
6