dsh-session-sync 0.2.24 → 0.2.26

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,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.26] - 2026-10-18
4
+
5
+ ### Changed
6
+
7
+ - Add a 1280×720 hero and a 960×540, 4-second terminal GIF rendered from the test run; `screenshots.json` is an object array and `capture.json` records the command.
8
+
9
+ ## [0.2.25] - 2026-10-17
10
+
11
+ ### Fixed
12
+
13
+ - **Pull now writes merged session files back into the live session store (#15).** Previously `pull` merged only into the git mirror; the next `push` mirrored the live store and unlinked those remote-only files. The merge result is copied back (new/changed files only, no deletions, symlinks/fork/host artifacts skipped) before `pull` returns.
14
+ - **Encrypted age probe runs with a real cwd (#12).** `detectAge` no longer passes `cwd: undefined`; a probe failure is reported instead of silently degrading.
15
+ - **Sanitizer masks token-in-username remotes and mirror writes refuse target symlinks (#13).**
16
+ - Compatibility: add `@deepseek-ai/dsh-working-directory` to devDependencies; the existing 0.2.x engines/peer bands remain.
17
+
3
18
  All notable changes to this project are documented in this file.
4
19
 
5
20
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
package/README-es.md CHANGED
@@ -41,7 +41,7 @@ Sincronización de sesiones entre dispositivos para DeepSeek Harness — un espe
41
41
 
42
42
  Sincroniza tus sesiones entre dispositivos, conserva ambos lados ante cualquier conflicto, nunca pierdas un turno.
43
43
 
44
- ![Demostración de terminal de dsh-session-sync: dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.png)
44
+ ![Demostración de terminal de dsh-session-sync: dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-hero.png)
45
45
 
46
46
  ![Animated terminal demo of dsh-session-sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.gif)
47
47
 
@@ -230,7 +230,7 @@ No hay paso de compilación: ESM puro, `index.mjs` y `lib/` son los artefactos p
230
230
 
231
231
  ## PerryLink DSH Plugin Family
232
232
 
233
- Este proyecto es uno de los **33 plugins activamente mantenidos** de DeepSeek Harness de [PerryLink](https://github.com/PerryLink): el registro tiene **42**, de los cuales **6** están congelados y **3** retirados; cada uno conserva su fila abajo, con el motivo en la columna Estado. Si este te ayuda, probablemente los demás también:
233
+ Este proyecto es uno de los **34 plugins activamente mantenidos** de DeepSeek Harness de [PerryLink](https://github.com/PerryLink): el registro tiene **42**, de los cuales **5** están congelados y **3** retirados; cada uno conserva su fila abajo, con el motivo en la columna Estado. Si este te ayuda, probablemente los demás también:
234
234
 
235
235
  | Plugin | En una línea | Estado |
236
236
  |---|---|---|
@@ -258,7 +258,7 @@ Este proyecto es uno de los **33 plugins activamente mantenidos** de DeepSeek Ha
258
258
  | **[dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions)** | LSP diagnostics, formatting, completion, code actions and rename over language servers | |
259
259
  | **[dsh-mask](https://github.com/PerryLink/dsh-mask)** | PII masking middleware: anonymize at the model boundary, restore at the display layer | |
260
260
  | **[dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel)** | Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors | |
261
- | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | 🧊 CONGELADO — ver el README del repositorio |
261
+ | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | |
262
262
  | **[dsh-observe](https://github.com/PerryLink/dsh-observe)** | OpenTelemetry and Langfuse observability exporter for DeepSeek Harness. | |
263
263
  | **[dsh-output-styles](https://github.com/PerryLink/dsh-output-styles)** | Claude Code outputStyles-equivalent runtime style switching | |
264
264
  | **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | Claude Code-style declarative allow/deny/ask permission rules with audit | |
package/README-hi.md CHANGED
@@ -41,7 +41,7 @@ DeepSeek Harness के लिए क्रॉस-डिवाइस सत्
41
41
 
42
42
  अपने सत्रों को डिवाइसों के बीच सिंक करें, किसी भी टकराव में दोनों पक्ष रखें, कभी कोई टर्न न खोएँ।
43
43
 
44
- ![dsh-session-sync का टर्मिनल डेमो: dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.png)
44
+ ![dsh-session-sync का टर्मिनल डेमो: dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-hero.png)
45
45
 
46
46
  ![Animated terminal demo of dsh-session-sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.gif)
47
47
 
@@ -230,7 +230,7 @@ pnpm pack # प्रकाशित ta
230
230
 
231
231
  ## PerryLink DSH Plugin Family
232
232
 
233
- यह प्रोजेक्ट [PerryLink](https://github.com/PerryLink) के DeepSeek Harness प्लगइन परिवार का हिस्सा है — **33 सक्रिय रूप से अनुरक्षित**, कुल सूची **42** है जिसमें **6 फ़्रोज़न** और **3 सेवानिवृत्त** हैं; हर एक की पंक्ति नीचे बनी रहती है, कारण “स्थिति” कॉलम में है। अगर यह उपयोगी लगे, तो अन्य भी मददगार होंगे:
233
+ यह प्रोजेक्ट [PerryLink](https://github.com/PerryLink) के DeepSeek Harness प्लगइन परिवार का हिस्सा है — **34 सक्रिय रूप से अनुरक्षित**, कुल सूची **42** है जिसमें **5 फ़्रोज़न** और **3 सेवानिवृत्त** हैं; हर एक की पंक्ति नीचे बनी रहती है, कारण “स्थिति” कॉलम में है। अगर यह उपयोगी लगे, तो अन्य भी मददगार होंगे:
234
234
 
235
235
  | Plugin | एक पंक्ति में | स्थिति |
236
236
  |---|---|---|
@@ -258,7 +258,7 @@ pnpm pack # प्रकाशित ta
258
258
  | **[dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions)** | LSP diagnostics, formatting, completion, code actions and rename over language servers | |
259
259
  | **[dsh-mask](https://github.com/PerryLink/dsh-mask)** | PII masking middleware: anonymize at the model boundary, restore at the display layer | |
260
260
  | **[dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel)** | Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors | |
261
- | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | 🧊 फ़्रोज़न — रिपॉज़िटरी README देखें |
261
+ | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | |
262
262
  | **[dsh-observe](https://github.com/PerryLink/dsh-observe)** | OpenTelemetry and Langfuse observability exporter for DeepSeek Harness. | |
263
263
  | **[dsh-output-styles](https://github.com/PerryLink/dsh-output-styles)** | Claude Code outputStyles-equivalent runtime style switching | |
264
264
  | **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | Claude Code-style declarative allow/deny/ask permission rules with audit | |
package/README-pt.md CHANGED
@@ -41,7 +41,7 @@ Sincronização de sessões entre dispositivos para o DeepSeek Harness — um es
41
41
 
42
42
  Sincronize suas sessões entre dispositivos, mantenha os dois lados em qualquer conflito, nunca perca um turno.
43
43
 
44
- ![Demonstração de terminal do dsh-session-sync: dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.png)
44
+ ![Demonstração de terminal do dsh-session-sync: dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-hero.png)
45
45
 
46
46
  ![Animated terminal demo of dsh-session-sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.gif)
47
47
 
@@ -230,7 +230,7 @@ Não há etapa de compilação: ESM puro, `index.mjs` e `lib/` são os artefatos
230
230
 
231
231
  ## PerryLink DSH Plugin Family
232
232
 
233
- Este projeto é um dos **33 plugins ativamente mantidos** do DeepSeek Harness da [PerryLink](https://github.com/PerryLink): o registro tem **42**, dos quais **6** estão congelados e **3** aposentados; cada um mantém sua linha abaixo, com o motivo na coluna Status. Se este ajudou você, provavelmente os outros também ajudarão:
233
+ Este projeto é um dos **34 plugins ativamente mantidos** do DeepSeek Harness da [PerryLink](https://github.com/PerryLink): o registro tem **42**, dos quais **5** estão congelados e **3** aposentados; cada um mantém sua linha abaixo, com o motivo na coluna Status. Se este ajudou você, provavelmente os outros também ajudarão:
234
234
 
235
235
  | Plugin | Em uma linha | Status |
236
236
  |---|---|---|
@@ -258,7 +258,7 @@ Este projeto é um dos **33 plugins ativamente mantidos** do DeepSeek Harness da
258
258
  | **[dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions)** | LSP diagnostics, formatting, completion, code actions and rename over language servers | |
259
259
  | **[dsh-mask](https://github.com/PerryLink/dsh-mask)** | PII masking middleware: anonymize at the model boundary, restore at the display layer | |
260
260
  | **[dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel)** | Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors | |
261
- | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | 🧊 CONGELADO — ver o README do repositório |
261
+ | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | |
262
262
  | **[dsh-observe](https://github.com/PerryLink/dsh-observe)** | OpenTelemetry and Langfuse observability exporter for DeepSeek Harness. | |
263
263
  | **[dsh-output-styles](https://github.com/PerryLink/dsh-output-styles)** | Claude Code outputStyles-equivalent runtime style switching | |
264
264
  | **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | Claude Code-style declarative allow/deny/ask permission rules with audit | |
package/README-zh.md CHANGED
@@ -43,7 +43,7 @@ DeepSeek Harness 的跨设备会话同步 —— 为你的会话存储建立专
43
43
 
44
44
  在设备间同步会话,冲突时两边都保留,绝不丢失任何一轮。
45
45
 
46
- ![dsh-session-sync 终端演示:dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.png)
46
+ ![dsh-session-sync 终端演示:dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-hero.png)
47
47
 
48
48
  ![Animated terminal demo of dsh-session-sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.gif)
49
49
 
@@ -232,7 +232,7 @@ pnpm pack # 发布 tarball
232
232
 
233
233
  ## PerryLink DSH Plugin Family
234
234
 
235
- 本项目是 [PerryLink](https://github.com/PerryLink) 维护的 DeepSeek Harness 插件家族成员:**33 个活跃维护**,名册共 **42** 个,其中 **6 个已冻结**、**3 个已退役**——每一个都在下表保留自己的行,原因见「状态」列。如果它能帮到你,其他的也会:
235
+ 本项目是 [PerryLink](https://github.com/PerryLink) 维护的 DeepSeek Harness 插件家族成员:**34 个活跃维护**,名册共 **42** 个,其中 **5 个已冻结**、**3 个已退役**——每一个都在下表保留自己的行,原因见「状态」列。如果它能帮到你,其他的也会:
236
236
 
237
237
  | Plugin | 一句话 | 状态 |
238
238
  |---|---|---|
@@ -260,7 +260,7 @@ pnpm pack # 发布 tarball
260
260
  | **[dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions)** | LSP diagnostics, formatting, completion, code actions and rename over language servers | |
261
261
  | **[dsh-mask](https://github.com/PerryLink/dsh-mask)** | PII masking middleware: anonymize at the model boundary, restore at the display layer | |
262
262
  | **[dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel)** | Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors | |
263
- | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | 🧊 已冻结 — 见仓库 README |
263
+ | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | |
264
264
  | **[dsh-observe](https://github.com/PerryLink/dsh-observe)** | OpenTelemetry and Langfuse observability exporter for DeepSeek Harness. | |
265
265
  | **[dsh-output-styles](https://github.com/PerryLink/dsh-output-styles)** | Claude Code outputStyles-equivalent runtime style switching | |
266
266
  | **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | Claude Code-style declarative allow/deny/ask permission rules with audit | |
package/README.md CHANGED
@@ -44,7 +44,7 @@ Cross-device session sync for DeepSeek Harness — a dedicated git mirror of you
44
44
 
45
45
  Sync your sessions between devices, keep both sides on any conflict, never lose a turn.
46
46
 
47
- ![Terminal demo of dsh-session-sync: dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.png)
47
+ ![Terminal demo of dsh-session-sync: dsh-session-sync — mirror the session store, then /sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-hero.png)
48
48
 
49
49
  ![Animated terminal demo of dsh-session-sync](https://raw.githubusercontent.com/PerryLink/dsh-session-sync/main/docs/assets/dsh-session-sync-demo.gif)
50
50
 
@@ -235,7 +235,7 @@ There is no build step: pure ESM, `index.mjs` and `lib/` are the shipped artifac
235
235
 
236
236
  ## PerryLink DSH Plugin Family
237
237
 
238
- This project is one of the **33 actively maintained** DeepSeek Harness plugins from [PerryLink](https://github.com/PerryLink) — the roster is **42**, of which **6** are frozen and **3** retired; every one keeps its row below, with the reason in the Status column. If this one helps you, the others likely will too:
238
+ This project is one of the **34 actively maintained** DeepSeek Harness plugins from [PerryLink](https://github.com/PerryLink) — the roster is **42**, of which **5** are frozen and **3** retired; every one keeps its row below, with the reason in the Status column. If this one helps you, the others likely will too:
239
239
 
240
240
  | Plugin | One-liner | Status |
241
241
  |---|---|---|
@@ -263,7 +263,7 @@ This project is one of the **33 actively maintained** DeepSeek Harness plugins f
263
263
  | **[dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions)** | LSP diagnostics, formatting, completion, code actions and rename over language servers | |
264
264
  | **[dsh-mask](https://github.com/PerryLink/dsh-mask)** | PII masking middleware: anonymize at the model boundary, restore at the display layer | |
265
265
  | **[dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel)** | Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors | |
266
- | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | 🧊 FROZEN — see the repo README |
266
+ | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool | |
267
267
  | **[dsh-observe](https://github.com/PerryLink/dsh-observe)** | OpenTelemetry and Langfuse observability exporter for DeepSeek Harness. | |
268
268
  | **[dsh-output-styles](https://github.com/PerryLink/dsh-output-styles)** | Claude Code outputStyles-equivalent runtime style switching | |
269
269
  | **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | Claude Code-style declarative allow/deny/ask permission rules with audit | |
package/lib/encrypted.mjs CHANGED
@@ -265,7 +265,7 @@ export class EncryptedBackend {
265
265
  probeMode() {
266
266
  if (this.#ready === undefined) {
267
267
  this.#ready = (async () => {
268
- const ageBin = await detectAge(this.#run, this.#ageBin, { timeoutMs: this.#timeoutMs })
268
+ const ageBin = await detectAge(this.#run, this.#ageBin, { timeoutMs: this.#timeoutMs, cwd: this.#repoDir })
269
269
  const selection = selectEncryptionMode({
270
270
  backend: BACKENDS.ENCRYPTED,
271
271
  ageAvailable: ageBin !== null,
package/lib/engine.mjs CHANGED
@@ -12,7 +12,7 @@ import { promises as fs } from 'node:fs'
12
12
  import path from 'node:path'
13
13
  import { MERGE_KINDS, MIRROR_DIR, DEVICE_FILE } from './constants.mjs'
14
14
  import { planMerge } from './merge.mjs'
15
- import { mirrorSessionRoot, ensureDeviceFile } from './mirror.mjs'
15
+ import { mirrorSessionRoot, restoreSessionRoot, ensureDeviceFile } from './mirror.mjs'
16
16
  import { collectStatus } from './status.mjs'
17
17
  import { forkFileName } from './paths.mjs'
18
18
  import { messageOf, SyncError } from './errors.mjs'
@@ -218,8 +218,12 @@ export class SyncEngine {
218
218
  await this.#deps.git.addAll()
219
219
  }
220
220
  const newHead = await this.#deps.git.commitMerge()
221
+ const restored = await restoreSessionRoot({
222
+ mirrorRoot: path.join(this.#deps.repoDir, MIRROR_DIR),
223
+ sessionRoot: this.#deps.sessionRoot,
224
+ })
221
225
  this.#deps.reportMeta({ lastPullAt: Date.now() })
222
- this.#deps.logger.info(`sync pull ok: merged remote head ${remoteHead} → ${newHead ?? ''} (${result.appended} appended-both, ${result.diverged} diverged, ${result.forks.length} forks)`)
226
+ this.#deps.logger.info(`sync pull ok: merged remote head ${remoteHead} → ${newHead ?? ''} (${result.appended} appended-both, ${result.diverged} diverged, ${result.forks.length} forks, ${restored.restored} restored)`)
223
227
  if (result.forks.length > 0) this.#deps.onForks(result.forks)
224
228
  return {
225
229
  ok: true,
@@ -229,6 +233,7 @@ export class SyncEngine {
229
233
  appended: result.appended,
230
234
  diverged: result.diverged,
231
235
  forks: result.forks,
236
+ restored: restored.restored,
232
237
  head: newHead ?? undefined,
233
238
  }
234
239
  }
package/lib/mirror.mjs CHANGED
@@ -39,6 +39,12 @@ async function listFiles(root) {
39
39
 
40
40
  /** 内容一致则跳过写(返回 false),否则覆写(返回 true)。 */
41
41
  async function writeIfDifferent(target, content) {
42
+ try {
43
+ const st = await fs.lstat(target)
44
+ if (st.isSymbolicLink()) throw new Error('refusing to write through a symbolic link')
45
+ } catch (error) {
46
+ if (error?.code !== 'ENOENT') throw error
47
+ }
42
48
  try {
43
49
  const existing = await fs.readFile(target)
44
50
  if (existing.equals(content)) return false
@@ -120,6 +126,44 @@ export async function mirrorSessionRoot(deps) {
120
126
  return { mirrored, unchanged, skippedLinks: source.skipped, deleted, forkedPreserved, hostArtifactsSkipped, hostArtifactsPreserved }
121
127
  }
122
128
 
129
+ /**
130
+ * Copy the merged mirror back into the live session store. Pull used to merge only
131
+ * into the mirror; the next push then saw those files as "missing locally" and
132
+ * unlinked them. This writes new/changed regular files back, never deletes, never
133
+ * follows symlinks, and never writes fork files or host-private artifacts.
134
+ * @param {object} deps - {mirrorRoot, sessionRoot, forkNameRe?}.
135
+ * @returns {Promise<{restored: number, unchanged: number, skipped: number}>}
136
+ */
137
+ export async function restoreSessionRoot(deps) {
138
+ const forkRe = deps.forkNameRe ?? FORK_NAME_RE
139
+ let entries
140
+ try {
141
+ entries = await fs.readdir(deps.mirrorRoot, { recursive: true, withFileTypes: true })
142
+ } catch {
143
+ return { restored: 0, unchanged: 0, skipped: 0 }
144
+ }
145
+ let restored = 0
146
+ let unchanged = 0
147
+ let skipped = 0
148
+ for (const entry of entries) {
149
+ if (!entry.isFile()) { skipped += 1; continue }
150
+ const parent = entry.parentPath ?? entry.path ?? deps.mirrorRoot
151
+ const absolute = path.join(parent, entry.name)
152
+ const rel = path.relative(deps.mirrorRoot, absolute).split(path.sep).join('/')
153
+ const basename = path.posix.basename(rel)
154
+ if (forkRe.test(basename) || HOST_ARTIFACT_NAME_RE.test(basename)) { skipped += 1; continue }
155
+ const target = path.join(deps.sessionRoot, ...rel.split('/'))
156
+ try {
157
+ const st = await fs.lstat(target)
158
+ if (st.isSymbolicLink()) { skipped += 1; continue }
159
+ } catch { /* target absent */ }
160
+ const wrote = await writeIfDifferent(target, await fs.readFile(absolute))
161
+ if (wrote) restored += 1
162
+ else unchanged += 1
163
+ }
164
+ return { restored, unchanged, skipped }
165
+ }
166
+
123
167
  /**
124
168
  * 确保设备身份文件内容为 deviceId(不同才写;返回是否写入)。
125
169
  * @param {string} repoDir - 同步仓库根。
package/lib/sanitize.mjs CHANGED
@@ -27,10 +27,17 @@ export function sanitizeRemote(remote) {
27
27
  const trimmed = remote.trim()
28
28
  try {
29
29
  const url = new URL(trimmed)
30
+ // Token-in-username is a real git credential form (`https://<token>@host`).
31
+ // Keep a normal username when a password is present; otherwise mask a
32
+ // token-shaped username. A plain `user@host` stays readable.
30
33
  if (url.username !== '' && url.password !== '') {
31
34
  url.password = '***'
32
35
  return url.toString()
33
36
  }
37
+ if (url.username !== '' && (/token|ghp_|github_pat_|glpat-|sk-|x-access-token/i.test(url.username) || url.username.length >= 32)) {
38
+ url.username = '***'
39
+ return url.toString()
40
+ }
34
41
  for (const key of [...url.searchParams.keys()]) {
35
42
  if (CREDENTIAL_QUERY_KEYS.test(key)) url.searchParams.set(key, '***')
36
43
  }
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.2.24",
4
+ "version": "0.2.26",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/PerryLink/dsh-session-sync.git"
@@ -70,8 +70,14 @@
70
70
  "credentials:none"
71
71
  ],
72
72
  "compatibility": {
73
- "dshVersions": ["0.1.2-rc.1","0.1.5-rc.2","0.1.7-alpha.2","0.1.7-rc.1", "0.1.7-rc.2",
74
- "0.2.1-alpha.1"]
73
+ "dshVersions": [
74
+ "0.1.2-rc.1",
75
+ "0.1.5-rc.2",
76
+ "0.1.7-alpha.2",
77
+ "0.1.7-rc.1",
78
+ "0.1.7-rc.2",
79
+ "0.2.1-alpha.1"
80
+ ]
75
81
  },
76
82
  "capability": {
77
83
  "id": "session-sync",
@@ -127,7 +133,8 @@
127
133
  "@deepseek-ai/schemastery": "^3.18.5-alpha.1",
128
134
  "@types/node": "^22.19.0",
129
135
  "oxlint": "0.18.1",
130
- "typescript": "^5.9.0"
136
+ "typescript": "^5.9.0",
137
+ "@deepseek-ai/dsh-working-directory": "0.2.1-rc.2"
131
138
  },
132
139
  "scripts": {
133
140
  "typecheck": "tsc -p tsconfig.check.json",