dsh-session-history 0.2.1 → 0.2.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/README.md CHANGED
@@ -113,6 +113,8 @@ dsh plugin --profile desktop add dsh-session-history
113
113
 
114
114
  很多人只维护一个技能文件夹,其余目录用软链指向它(例如 `~/.claude/skills`、`~/.agents/skills` 都指向 `~/my-skills`)。这时各 agent 读的其实是同一个文件夹,但本技能的文件夹(数据目录)不在里面,所以显示「待接入」是准确的:只需在那个共用文件夹里建一条 `session-history` 软链,它们就一起接入。
115
115
 
116
+ 各家读的不是同一个文件夹时,会按文件夹分组、各给一个按钮;一个 agent 同时读几个目录的(如 Pi 既读自己的目录也读 `~/.agents/skills`),只归入能覆盖它的那一组,不会让你点两次。
117
+
116
118
  判断是否已接入,是从每个 agent 自己的技能目录出发、顺着软链去读 `session-history/SKILL.md`,读得到、名字对才算,与 agent 加载技能走同一条路。已有同名的独立文件夹(多半是旧版拷贝)时不会覆盖,会提示冲突。Windows 用目录联接,不需要管理员权限。
117
119
 
118
120
  ## 数据与卸载
@@ -156,7 +158,7 @@ session-history refresh | status | setup | link all | unlink claude | config
156
158
  Git 子目录地址(不提供原生更新检查):
157
159
 
158
160
  ```text
159
- git+https://github.com/fujingzhai/youxia-dsh-plugins.git#dsh-session-history@0.2.1&path:/dsh-session-history
161
+ git+https://github.com/fujingzhai/youxia-dsh-plugins.git#dsh-session-history@0.2.2&path:/dsh-session-history
160
162
  ```
161
163
 
162
164
  ## 兼容与限制
package/lib/links.js CHANGED
@@ -73,9 +73,19 @@ export function skillStatus(home, config = {}) {
73
73
  g.agents.push(a.name);
74
74
  groups.set(a.target.key, g);
75
75
  }
76
- // 同一目录还被别的未生效 agent 读到的,一并算进受益者。
76
+ // 同一目录还被别的未接入 agent 读到的,一并算进受益者。
77
77
  for (const g of groups.values()) {
78
78
  for (const a of live.filter(x => x.state === 'missing' && !g.agents.includes(x.name))) if (a.dirs.some(d => d.real === g.key)) g.agents.push(a.name);
79
+ }
80
+ // 一个 agent 读多个目录时(如 Pi 既读自己的目录也读 ~/.agents/skills),只归入覆盖 agent 最多的那一组,
81
+ // 免得同一家出现在两组、让人以为要点两次;被完全覆盖的组不再列出。
82
+ const assigned = new Set();
83
+ for (const g of [...groups.values()].sort((a, b) => b.agents.length - a.agents.length)) {
84
+ g.agents = g.agents.filter(n => !assigned.has(n));
85
+ for (const n of g.agents) assigned.add(n);
86
+ }
87
+ for (const [k, g] of groups) if (!g.agents.length) groups.delete(k);
88
+ for (const g of groups.values()) {
79
89
  const realPath = g.create ? null : realpathSafe(g.path);
80
90
  g.realDisplay = realPath && key(realPath) !== key(g.path) ? tilde(realPath) : null;
81
91
  g.paths = [...new Set(live.filter(a => g.agents.includes(a.name)).flatMap(a => a.dirs.filter(d => d.real === g.key).map(d => d.display)))];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-history",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "把各个 agent(Claude Code、Codex 等)的对话整理成可检索的原文日志,以一个共用技能提供给所有 agent;保留原话,不做摘要,不用向量,不调用模型。",
5
5
  "author": "youxia",
6
6
  "repository": {