dsh-session-sync 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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.4] - 2026-11-20
4
+
5
+ ### Fixed
6
+
7
+ - **Encrypted backend failed on every push and pull on DSH >= 0.2.2 because age ran without a `cwd` (#34).** `encryptTree`/`decryptTree` called `ageEncrypt`/`ageDecrypt` without forwarding a `cwd`, and `makeRunAge` forwarded `runOpts.cwd` (undefined) verbatim into `ctx.subprocess.spawn()`. DSH 0.2.2 validates the required `SubprocessSpawnSpec.cwd` unconditionally, so every encrypted push/pull died with `TypeError: Cannot read properties of undefined (reading 'includes')` wrapped as `AGE_FAILED`. The encrypted backend now passes `repoDir` into both tree walkers, `makeRunAge` falls back to `process.cwd()` when a caller omits the cwd, and tests pin both halves (a stubbed runner that requires a cwd for the roundtrip/e2e paths, plus unit coverage for the fallback). The `detectAge` probe already passed `repoDir`, which is why the binary was found and only the encryption step failed.
8
+
3
9
  ## [0.3.1] - 2026-11-14
4
10
 
5
11
  ### Fixed
package/README.en.md CHANGED
@@ -313,6 +313,8 @@ The mirror **never follows symbolic links** by default (a safety boundary). Andr
313
313
  | Platforms | Anywhere `git` and DSH run (git-based mirror; no platform-specific code) |
314
314
  | Model | Text-only models fully supported; no vision or extra model capability required |
315
315
 
316
+ **Cross-device sync needs compatible DSH engine versions.** The `subagent/catalog` event carries a versioned fact, and an older engine reading a version-3 fact written by a newer one (for example 0.2.2-rc.3) rejects the whole log as `stored log is corrupt: ... subagent/catalog requires a supported versioned catalog fact`. The mirrored bytes are fine — the reader is too old. Sessions without subagents are usually unaffected. Keep both engines on close versions, or upgrade the older device before opening such a session.
317
+
316
318
  ## Ecosystem and quality
317
319
 
318
320
  - [Gitee mirror](https://gitee.com/perrylink/dsh-session-sync) (synced mirror; GitHub is canonical)
package/README.es.md CHANGED
@@ -313,6 +313,8 @@ El espejo **nunca sigue enlaces simbólicos** por defecto (límite de seguridad)
313
313
  | Plataformas | Dondequiera que corran `git` y DSH (espejo basado en git; sin código específico de plataforma) |
314
314
  | Modelo | Modelos solo de texto totalmente soportados; no se requiere visión ni capacidad extra de modelo |
315
315
 
316
+ **La sincronización entre dispositivos necesita versiones compatibles del motor DSH.** El evento `subagent/catalog` incluye un fact versionado; un motor antiguo que lee un fact version 3 escrito por uno más nuevo (por ejemplo 0.2.2-rc.3) rechaza el log completo como `stored log is corrupt: ... subagent/catalog requires a supported versioned catalog fact`. Los bytes replicados están bien: el lector es demasiado antiguo. Las sesiones sin subagentes normalmente no se ven afectadas. Mantén ambos motores en versiones cercanas, o actualiza el dispositivo antiguo antes de abrir esas sesiones.
317
+
316
318
  ## Ecosistema y calidad
317
319
 
318
320
  - [Espejo en Gitee](https://gitee.com/perrylink/dsh-session-sync) (espejo sincronizado; GitHub es canónico)
package/README.hi.md CHANGED
@@ -313,6 +313,8 @@ cwdMap:
313
313
  | प्लेटफ़ॉर्म | जहाँ भी `git` और DSH चलते हैं (git-आधारित मिरर; कोई प्लेटफ़ॉर्म-विशिष्ट कोड नहीं) |
314
314
  | मॉडल | केवल-पाठ मॉडल पूरी तरह समर्थित; किसी दृष्टि या अतिरिक्त मॉडल क्षमता की आवश्यकता नहीं |
315
315
 
316
+ **उपकरणों के बीच सिंक के लिए DSH इंजिन के संगत संस्करण चाहिए।** `subagent/catalog` इवेंट में versioned fact होता है; पुराना इंजिन नए इंजिन (जैसे 0.2.2-rc.3) द्वारा लिखे version-3 fact को पढ़ते समय पूरा लॉग `stored log is corrupt: ... subagent/catalog requires a supported versioned catalog fact` बताकर अस्वीकार कर देता है। मिरर किए गए बाइट्स ठीक हैं — पढ़ने वाला इंजिन पुराना है। subagent रहित सत्र आमतौर पर प्रभावित नहीं होते। दोनों इंजिनों के संस्करण पास रखें, या ऐसे सत्र खोलने से पहले पुराने उपकरण को अपग्रेड करें।
317
+
316
318
  ## पारिस्थितिकी और गुणवत्ता
317
319
 
318
320
  - [Gitee मिरर](https://gitee.com/perrylink/dsh-session-sync) (सिंक किया गया मिरर; GitHub आधिकारिक है)
package/README.md CHANGED
@@ -313,6 +313,8 @@ cwdMap:
313
313
  | 平台 | 任何能运行 `git` 和 DSH 的环境(基于 git 镜像;无平台特定代码) |
314
314
  | 模型 | 纯文本模型即可完整支持;无需视觉或额外模型能力 |
315
315
 
316
+ **跨设备同步需要兼容的 DSH 引擎版本。** 会话日志里的 `subagent/catalog` 事件带版本化 fact;较旧的引擎打开较新引擎(例如 0.2.2-rc.3)写入的 version-3 fact 时,会把整份日志报成 `stored log is corrupt: ... subagent/catalog requires a supported versioned catalog fact`。镜像字节本身是好的,问题在读端;不含 subagent 的会话通常不受影响。请让两端 DSH 版本接近,或先升级旧端再打开这类会话。
317
+
316
318
  ## 生态与质量
317
319
 
318
320
  - [Gitee 镜像](https://gitee.com/perrylink/dsh-session-sync)(同步镜像,以 GitHub 为准)
package/README.pt.md CHANGED
@@ -313,6 +313,8 @@ O espelho **nunca segue links simbólicos** por padrão (limite de segurança).
313
313
  | Plataformas | Onde quer que `git` e DSH rodem (espelho baseado em git; sem código específico de plataforma) |
314
314
  | Modelo | Modelos apenas de texto totalmente suportados; nenhuma visão ou capacidade extra de modelo é necessária |
315
315
 
316
+ **A sincronização entre dispositivos precisa de versões compatíveis do motor DSH.** O evento `subagent/catalog` carrega um fact versionado; um motor antigo que lê um fact version 3 gravado por um mais novo (por exemplo 0.2.2-rc.3) rejeita o log inteiro como `stored log is corrupt: ... subagent/catalog requires a supported versioned catalog fact`. Os bytes replicados estão corretos — o leitor é antigo demais. Sessões sem subagentes normalmente não são afetadas. Mantenha os dois motores em versões próximas, ou atualize o dispositivo antigo antes de abrir essas sessões.
317
+
316
318
  ## Ecossistema e qualidade
317
319
 
318
320
  - [Espelho no Gitee](https://gitee.com/perrylink/dsh-session-sync) (espelho sincronizado; o GitHub é canônico)
package/index.mjs CHANGED
@@ -340,7 +340,10 @@ export function makeRunAge(subprocess, opts) {
340
340
  const executable = await subprocess.resolveExecutable(args[0], undefined, controller.signal)
341
341
  const handle = subprocess.spawn({
342
342
  argv: [executable, ...args.slice(1)],
343
- cwd: runOpts.cwd,
343
+ // SubprocessSpawnSpec.cwd is required and validated unconditionally on DSH >= 0.2.2; an
344
+ // undefined cwd aborted every encrypted push/pull with "Cannot read properties of
345
+ // undefined (reading 'includes')" (#34). Fall back to a real directory.
346
+ cwd: typeof runOpts.cwd === 'string' && runOpts.cwd.length > 0 ? runOpts.cwd : process.cwd(),
344
347
  stdio: {
345
348
  stdin: 'ignore',
346
349
  stdout: { maxBytes: opts.maxOutputBytes },
package/lib/encrypted.mjs CHANGED
@@ -81,7 +81,7 @@ async function writeTree(root, map) {
81
81
  * 加密整棵明文树 → 密文树(每文件一个 age 密文;删除明文已消失的密文)。
82
82
  * @param {string} plainRoot - 明文树根。
83
83
  * @param {string} encRoot - 密文树根。
84
- * @param {object} deps - {run, ageBin, recipient, timeoutMs}。
84
+ * @param {object} deps - {run, ageBin, recipient, timeoutMs, cwd?}。
85
85
  * @returns {Promise<number>} 加密文件数。
86
86
  */
87
87
  export async function encryptTree(plainRoot, encRoot, deps) {
@@ -100,6 +100,7 @@ export async function encryptTree(plainRoot, encRoot, deps) {
100
100
  inPath: path.join(plainRoot, ...rel.split('/')),
101
101
  outPath,
102
102
  timeoutMs: deps.timeoutMs,
103
+ cwd: deps.cwd,
103
104
  })
104
105
  }
105
106
  return plainFiles.length
@@ -108,7 +109,7 @@ export async function encryptTree(plainRoot, encRoot, deps) {
108
109
  /**
109
110
  * 解密整棵密文树 → 明文 Map<rel, Buffer>(只读 .age 文件,其余跳过)。
110
111
  * @param {string} encRoot - 密文树根。
111
- * @param {object} deps - {run, ageBin, identity, timeoutMs}。
112
+ * @param {object} deps - {run, ageBin, identity, timeoutMs, cwd?}。
112
113
  * @returns {Promise<Map<string, Buffer>>} 明文相对路径 → 内容。
113
114
  */
114
115
  export async function decryptTree(encRoot, deps) {
@@ -126,6 +127,7 @@ export async function decryptTree(encRoot, deps) {
126
127
  inPath,
127
128
  outPath,
128
129
  timeoutMs: deps.timeoutMs,
130
+ cwd: deps.cwd,
129
131
  })
130
132
  map.set(rel.slice(0, -ENC_EXT.length), await fs.readFile(outPath))
131
133
  index += 1
@@ -351,6 +353,7 @@ export class EncryptedBackend {
351
353
  ageBin: this.#ageBin,
352
354
  recipient: this.#recipient,
353
355
  timeoutMs: this.#timeoutMs,
356
+ cwd: this.#repoDir,
354
357
  })
355
358
  }
356
359
 
@@ -383,6 +386,7 @@ export class EncryptedBackend {
383
386
  inPath,
384
387
  outPath,
385
388
  timeoutMs: this.#timeoutMs,
389
+ cwd: this.#repoDir,
386
390
  })
387
391
  map.set(rel.slice(ENC_DIR.length + 1, -ENC_EXT.length), await fs.readFile(outPath))
388
392
  index += 1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-session-sync",
3
3
  "description": "Cross-device sync for DeepSeek Harness sessions: a dedicated git mirror of the session store, append-only three-way merge with keep-both + fork conflict resolution, /sync command, sync_pull/sync_push/sync_status tools, and configurable auto push/pull",
4
- "version": "0.3.3",
4
+ "version": "0.3.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/PerryLink/dsh-session-sync.git"