dsh-conversation-recycle-bin 0.3.14 → 0.3.15

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
@@ -3,6 +3,28 @@
3
3
  All notable changes to `dsh-conversation-recycle-bin` are documented here.
4
4
  The format follows Keep a Changelog; the project uses Semantic Versioning.
5
5
 
6
+ ## [0.3.15] — 2026-10-31
7
+
8
+ dsh-go(Android)适配性审计后的修复。审计结论:Host 半边开箱可用(手机里跑的是真 Node 24 + 原版 DSH 引擎),问题全在**前端座位**与**移动端输入**上。
9
+
10
+ ### Fixed
11
+
12
+ - **原生界面里删除按钮全都没有反应**(dsh-go 侧 `shell.overlay` 是 opt-in 座位,确认框宿主不挂载):新增 `useInlineDialogState()`,检测到 overlay 宿主没有挂载时,把**同一个确认框内联**渲染在设置页「批量删除」标签页里。桌面端/网页端有座位时行为不变(`overlaySeatMounted` 标记 + 500ms 宽限,避免闪一下内联副本)。
13
+ - **`DELETE` 短语在手机上永远对不上**:Android 输入法会把首字母大写,`purgePhrase.trim() !== 'DELETE'` 于是让按钮永久灰掉、没有任何提示。现在 Client 的 `phraseMatches()` 与 Host 的 `deletePlan`/`purgeEntry`/`discardEntry` 三处比对都**忽略大小写并去空格**;三个输入框补 `autoCapitalize`/`autoCorrect`/`spellCheck`(计数短语用 `inputMode: 'numeric'`)。
14
+ - **非 JSON 拒绝被报成「无法解析的响应」**:dsh-go 的 `route-guard.diff` 在插件路由之前返回 `text/plain` 401/503。新增 `httpFallbackError(response)`,按状态码映射成 `E_UNAUTHORIZED`/`E_DISABLED`/`E_BAD_RESPONSE`,并在响应头带 `x-dsh-go-guard: reject` 时把原因写进文案("dsh-go route guard")。
15
+ - **`E_LOCK_BUSY` 是死胡同**:错误信息补上锁文件路径与"持续出现就删掉它"的指引,`details.lockPath` 一并返回(手机被杀进程后残留锁最长阻塞 20 分钟,用户此前没有任何自救手段)。
16
+
17
+ ### Changed
18
+
19
+ - 回收站横幅文案补充「清理只在 Host 运行时发生」:App 关闭期间清扫不执行,下次启动补扫。
20
+ - README 新增 §8.1「dsh-go(Android)适配」:网页模式/原生界面的差异、opt-in 座位导致的降级路径、市场默认隐藏 web-only 插件需点「显示网页版插件」、DSH Remote 无网页版。
21
+
22
+ ### Tests
23
+
24
+ - `test/client-module.test.mjs`(25 → 28):短语忽略大小写与空期望值;非 JSON 拒绝按状态码映射(含 `x-dsh-go-guard` 分支);**没有 overlay 座位时设置页把同一个确认框内联渲染**(无 payload 时不渲染空壳,有 payload 时挂上真正的 `DeleteDialog` 并给出原因提示)。
25
+ - `test/api.test.mjs`(63 → 64):`DELETE` 短语大小写不敏感(`Delete me` 仍 400 `E_CONFIRM_PHRASE`,`delete` 通过)。
26
+ - 合计 188 → **192**(干净树 `rm -rf test/.tmp` 后全绿)。
27
+
6
28
  ## [0.3.14] — 2026-10-30
7
29
 
8
30
  第二轮独立审计(架构 / 安全 / 验收各跑 186 条、并做了变异测试与真实探针)之后的修复:一条会**删掉唯一副本**的读盘失败被当成「空目录」,一条会把用户**刚恢复的对话**再删一次,还有一类条目**三条出路全拒**却仍在 UI 上提供「恢复」按钮。
package/README.md CHANGED
@@ -247,6 +247,28 @@ npm run check # 语法 + manifest
247
247
 
248
248
  ---
249
249
 
250
+ ## 8.1 dsh-go(Android)适配
251
+
252
+ [dsh-go](https://github.com/ccch1mneyyy/dsh-Go) 的 App 里跑的是**真正的 Node 24 + 原版 DSH 引擎**(PRoot 内 Ubuntu),所以 Host 半边零改动即可运行:`engines.node >= 22.15`、`engines.dsh >= 0.2.1-rc.2` 双向满足,`market/policy.json` 也不拦第三方包。差异全在**前端座位**上:
253
+
254
+ | 界面 | 结果 |
255
+ |---|---|
256
+ | **网页模式**(App 内 DSH 网页版 / SSH 主机) | 完整可用,四个槽位都在 |
257
+ | **原生界面** | 插件能装、设置页有整页岛(回收站可看、可恢复、可彻底清除);会话行菜单与顶栏入口**没有座位**,因此删除走设置页「批量删除」标签页 |
258
+
259
+ 原生界面里 `shell.overlay` 是 opt-in 座位(`slot_catalog.dart` 的 `SeatPolicy.p2Overlay`),确认框的宿主因此不会挂载。0.3.15 起做了两件事:
260
+
261
+ 1. **降级渲染**:检测到 overlay 宿主没有挂载时,设置页把**同一个确认框内联**渲染在「批量删除」标签页里(`client.js` 的 `useInlineDialogState`),不再出现"点了删除没反应"。
262
+ 2. **移动端输入**:短语输入框加 `autoCapitalize/autoCorrect/spellCheck`,并且 Host 与 Client 的短语比对都改成**忽略大小写**(Android 输入法会把 `DELETE` 写成 `Delete`)。
263
+
264
+ 另外两件与手机有关的事,写在文档里而不是藏起来:
265
+
266
+ - **市场默认隐藏 web-only 插件**:安装前要在插件市场点一次「显示网页版插件」。
267
+ - **保留期清理只在 Host 运行时发生**:`trashRetentionDays`(默认 30 天)的清扫由宿主进程驱动,App 被杀掉期间不会执行,下次启动时补扫;`0` 关闭。
268
+ - **DSH Remote(远程桥)没有网页版**,因此插件在那里没有 UI;SSH 主机可以用网页模式。
269
+
270
+ ---
271
+
250
272
  ## 9. 反馈通道(设置页「反馈」按钮)
251
273
 
252
274
  设置页**最上方**新增一条「反馈」横幅(主色按钮,位于标题之上):把问题或建议写成一条消息,由**宿主进程**通过邮件发到维护者邮箱。凭证只在宿主侧读取,页面拿不到、也发不出任何邮件。
package/client.js CHANGED
@@ -112,7 +112,7 @@ window.__ModuleLoader__.load({
112
112
  'trash.title': 'Recycle bin',
113
113
  'trash.empty': 'The recycle bin is empty.',
114
114
  'trash.deletedAt': 'Deleted {time}',
115
- 'trash.retention': 'Entries are purged automatically {days} days after deletion. Set trashRetentionDays to 0 to keep them until you purge them yourself.',
115
+ 'trash.retention': 'Entries are purged automatically {days} days after deletion, but only while the Host is running (a phone with the app closed simply sweeps on the next launch). Set trashRetentionDays to 0 to keep them until you purge them yourself.',
116
116
  'trash.expiresIn': 'auto-purged in {days} d',
117
117
  'trash.expiresSoon': 'auto-purged on the next check',
118
118
  'trash.swept': 'The Host cleaned up {count} expired entries in the background.',
@@ -219,6 +219,7 @@ window.__ModuleLoader__.load({
219
219
  'error.E_QUEUE_TIMEOUT': 'The Host was still busy with another change, so this request was not applied. Retry in a moment.',
220
220
  'error.E_ABANDONED': 'The page gave up waiting before the Host started; nothing was changed. Retry.',
221
221
  'error.E_UNAUTHORIZED': 'This request is not authenticated with the Host.',
222
+ 'dialog.inlineHint': 'This window has no overlay slot (dsh-go native UI), so the confirmation is shown here instead of in a popup.',
222
223
  'adapter.lingshu': 'Lingshu cognitive graph (md_cg)',
223
224
  'adapter.generic-json': 'Generic JSON memory store',
224
225
  'adapter.none': 'No memory store',
@@ -274,7 +275,7 @@ window.__ModuleLoader__.load({
274
275
  'trash.title': '回收站',
275
276
  'trash.empty': '回收站为空。',
276
277
  'trash.deletedAt': '删除于 {time}',
277
- 'trash.retention': '条目在删除 {days} 天后自动清理。把 trashRetentionDays 设为 0 可改为一直保留、由你自己彻底删除。',
278
+ 'trash.retention': '条目在删除 {days} 天后自动清理,但清理只在 Host 运行时发生(手机 App 关闭期间不会执行,下次启动时补扫)。把 trashRetentionDays 设为 0 可改为一直保留、由你自己彻底删除。',
278
279
  'trash.expiresIn': '{days} 天后自动清理',
279
280
  'trash.expiresSoon': '下次检查时自动清理',
280
281
  'trash.swept': 'Host 已在后台自动清理 {count} 条过期条目。',
@@ -381,6 +382,7 @@ window.__ModuleLoader__.load({
381
382
  'error.E_QUEUE_TIMEOUT': '宿主还在处理另一个变更,这次请求没有执行,请稍后重试。',
382
383
  'error.E_ABANDONED': '页面在宿主开始处理前就放弃了等待,本次没有做任何改动,请重试。',
383
384
  'error.E_UNAUTHORIZED': '该请求未通过宿主的鉴权。',
385
+ 'dialog.inlineHint': '当前窗口没有 overlay 槽位(dsh-go 原生界面),确认框直接显示在这里。',
384
386
  'adapter.lingshu': '灵枢认知图 (md_cg)',
385
387
  'adapter.generic-json': '通用 JSON 记忆存储',
386
388
  'adapter.none': '无记忆存储',
@@ -552,6 +554,48 @@ window.__ModuleLoader__.load({
552
554
  return new URL(`${API_PREFIX.replace(/^\//, '')}${path}`, base)
553
555
  }
554
556
 
557
+ /**
558
+ * Does the typed phrase match what the Host asked for?
559
+ *
560
+ * Trimmed and case-insensitive on purpose: Android soft keyboards capitalise
561
+ * the first letter of a word, so `Delete` reached a check that only accepted
562
+ * `DELETE` and the confirm button stayed disabled with no explanation. The
563
+ * phrase exists to make the user think, not to test their keyboard.
564
+ */
565
+ function phraseMatches(input, expected) {
566
+ const want = String(expected ?? '').trim()
567
+ if (want === '') return true
568
+ return String(input ?? '').trim().toUpperCase() === want.toUpperCase()
569
+ }
570
+
571
+ /**
572
+ * Explain a refusal that never reached the plugin route.
573
+ *
574
+ * The dsh-go Host guard (and any reverse proxy in front of DSH) answers with
575
+ * `text/plain`, so `response.json()` threw and the panel showed "unreadable
576
+ * response" where the real answer was "not authenticated".
577
+ */
578
+ function httpFallbackError(response) {
579
+ const status = Number(response?.status)
580
+ let guarded = false
581
+ try {
582
+ guarded = response?.headers?.get?.('x-dsh-go-guard') === 'reject'
583
+ } catch {
584
+ guarded = false
585
+ }
586
+ if (status === 401 || status === 403) {
587
+ return new ApiError('E_UNAUTHORIZED', guarded
588
+ ? 'The Host rejected this request before the plugin saw it (dsh-go route guard): the page is not authenticated.'
589
+ : 'This request is not authenticated with the Host.', { status })
590
+ }
591
+ if (status === 503) {
592
+ return new ApiError('E_DISABLED', guarded
593
+ ? 'The Host route guard has no connection service yet; retry once the app has finished starting.'
594
+ : 'The plugin is disabled, or the Host is not ready yet.', { status })
595
+ }
596
+ return new ApiError('E_BAD_RESPONSE', `The Host answered ${Number.isFinite(status) ? status : 'an unexpected status'} without a JSON body.`, { status })
597
+ }
598
+
555
599
  async function api(path, options = {}) {
556
600
  const method = options.method ?? 'GET'
557
601
  const timeoutMs = Number.isFinite(options.timeoutMs) ? options.timeoutMs : REQUEST_TIMEOUT_MS
@@ -575,7 +619,9 @@ window.__ModuleLoader__.load({
575
619
  payload = null
576
620
  }
577
621
  if (payload === null || typeof payload !== 'object') {
578
- throw new ApiError('E_BAD_RESPONSE', 'The Host returned an unreadable response.')
622
+ // A refusal that never reached the plugin route (Host route guard,
623
+ // reverse proxy, HTML error page) still has a status worth explaining.
624
+ throw httpFallbackError(response)
579
625
  }
580
626
  // A batch that partially succeeded is a RESULT, not a refusal: an older
581
627
  // Host marked it `ok:false` without an `error`, which made the Client
@@ -644,6 +690,38 @@ window.__ModuleLoader__.load({
644
690
  return state
645
691
  }
646
692
 
693
+ /**
694
+ * Whether the `shell.overlay` slot actually gave us a seat.
695
+ *
696
+ * On DSH for desktop/web it always does. On dsh-go's native UI the overlay
697
+ * seat is opt-in (`SeatPolicy.p2Overlay`, `optIn: true` in
698
+ * `slot_catalog.dart`), so the host component never mounts — and with it the
699
+ * only confirmation dialog the delete flow had. Settings still gets a page
700
+ * island, so the panel can render that same dialog inline instead of
701
+ * pretending the button did nothing.
702
+ */
703
+ let overlaySeatMounted = false
704
+
705
+ function useOverlaySeatPresent() {
706
+ const [present, setPresent] = useState(overlaySeatMounted === true)
707
+ useEffect(() => {
708
+ // The overlay host mounts after the slot service resolves; a single
709
+ // frame of grace avoids flashing the inline copy on hosts that do have
710
+ // a seat.
711
+ const timer = setTimeout(() => setPresent(overlaySeatMounted === true), 500)
712
+ return () => clearTimeout(timer)
713
+ }, [])
714
+ return present
715
+ }
716
+
717
+ function useInlineDialogState() {
718
+ const payload = useDialogState()
719
+ const overlayPresent = useOverlaySeatPresent()
720
+ if (overlayPresent || payload === null) return null
721
+ // Feedback has no delete semantics and lives in its own tab.
722
+ return payload.kind === 'feedback' ? null : payload
723
+ }
724
+
647
725
  /**
648
726
  * Notification channel for "a mutation changed the session list". The
649
727
  * dialog refreshes the shell, but the Settings section owns a second copy
@@ -1090,7 +1168,7 @@ window.__ModuleLoader__.load({
1090
1168
  const blocked = Array.isArray(preview?.blocked) ? preview.blocked : []
1091
1169
  const confirmation = preview?.confirmation ?? null
1092
1170
  const expectedPhrase = confirmation?.phrase ?? ''
1093
- const phraseOk = expectedPhrase === '' || phrase.trim() === expectedPhrase
1171
+ const phraseOk = phraseMatches(phrase, expectedPhrase)
1094
1172
  const memory = preview?.memory ?? null
1095
1173
  const memorySupported = memory !== null && memory.enabled === true
1096
1174
  && Array.isArray(memory.adapters) && memory.adapters.some((adapter) => adapter.available === true)
@@ -1267,6 +1345,12 @@ window.__ModuleLoader__.load({
1267
1345
  disabled: busy,
1268
1346
  autoFocus: true,
1269
1347
  className: 'dc-input',
1348
+ // The phrase is a count on a phone: no autocorrect, no
1349
+ // sentence capitalisation, digits where digits are expected.
1350
+ inputMode: 'numeric',
1351
+ autoCorrect: 'off',
1352
+ autoCapitalize: 'off',
1353
+ spellCheck: false,
1270
1354
  }))
1271
1355
  : null,
1272
1356
 
@@ -1480,6 +1564,12 @@ window.__ModuleLoader__.load({
1480
1564
  function DialogHost() {
1481
1565
  const payload = useDialogState()
1482
1566
  const flash = useFlashMessage()
1567
+ useEffect(() => {
1568
+ overlaySeatMounted = true
1569
+ return () => {
1570
+ overlaySeatMounted = false
1571
+ }
1572
+ }, [])
1483
1573
  // `kind` is optional: every pre-0.2.2 caller opens a delete dialog, so a
1484
1574
  // payload without a kind keeps its old meaning.
1485
1575
  const dialog = payload === null
@@ -1595,10 +1685,16 @@ window.__ModuleLoader__.load({
1595
1685
  placeholder: 'DELETE',
1596
1686
  className: 'dc-input dc-input-small',
1597
1687
  onChange: (event) => onPhrase(event.target.value),
1688
+ // Without this Android capitalises the first letter and
1689
+ // writes `Delete`; the guard above is case-insensitive now,
1690
+ // but the keyboard should stop guessing anyway.
1691
+ autoCapitalize: 'characters',
1692
+ autoCorrect: 'off',
1693
+ spellCheck: false,
1598
1694
  }),
1599
1695
  h(Button, {
1600
1696
  variant: 'danger',
1601
- disabled: discardBusyId === entry.trashId || discardPhrase.trim() !== 'DELETE',
1697
+ disabled: discardBusyId === entry.trashId || phraseMatches(discardPhrase, 'DELETE') !== true,
1602
1698
  onClick: () => onDiscard(entry.trashId),
1603
1699
  }, t('trash.discard')),
1604
1700
  h(Button, { disabled: discardBusyId === entry.trashId, onClick: onCancel }, t('action.cancel')))
@@ -1640,6 +1736,7 @@ window.__ModuleLoader__.load({
1640
1736
  function SettingsSection() {
1641
1737
  useLocaleTick()
1642
1738
  const mutationVersion = useMutationVersion()
1739
+ const inlineDialog = useInlineDialogState()
1643
1740
  const [tab, setTab] = useState('trash')
1644
1741
  const [state, setState] = useState(null)
1645
1742
  const [sessions, setSessions] = useState([])
@@ -1966,10 +2063,13 @@ window.__ModuleLoader__.load({
1966
2063
  h('input', {
1967
2064
  type: 'text', value: purgePhrase, placeholder: 'DELETE', className: 'dc-input dc-input-small',
1968
2065
  onChange: (event) => setPurgePhrase(event.target.value),
2066
+ autoCapitalize: 'characters',
2067
+ autoCorrect: 'off',
2068
+ spellCheck: false,
1969
2069
  }),
1970
2070
  h(Button, {
1971
2071
  variant: 'danger',
1972
- disabled: purgeBusy === true || purgePhrase.trim() !== 'DELETE',
2072
+ disabled: purgeBusy === true || phraseMatches(purgePhrase, 'DELETE') !== true,
1973
2073
  onClick: () => { void purge(entry.trashId, purgePhrase.trim()) },
1974
2074
  }, t('action.purge')),
1975
2075
  h(Button, { disabled: purgeBusy === true, onClick: () => { setPurgeTarget(null); setPurgePhrase('') } }, t('action.cancel')))
@@ -2033,7 +2133,14 @@ window.__ModuleLoader__.load({
2033
2133
  // without the source the two are indistinguishable in the UI.
2034
2134
  + (typeof record.source === 'string' && record.source !== 'web-ui' ? ` · ${record.source}` : '')
2035
2135
  + (record.error?.message ? ` · ${record.error.message}` : ''))),
2036
- h('div', { className: 'dc-row-time' }, record.actor ?? '')))) : null)
2136
+ h('div', { className: 'dc-row-time' }, record.actor ?? '')))) : null,
2137
+
2138
+ // dsh-go's native UI gives `shell.overlay` no seat by default, so the
2139
+ // dialog host never mounts there and every delete button looked dead.
2140
+ // The panel keeps its own seat, so it renders the same dialog inline.
2141
+ inlineDialog === null ? null : h('div', { className: 'dc-inline-dialog' },
2142
+ h('p', { className: 'dc-hint' }, t('dialog.inlineHint')),
2143
+ h(DeleteDialog, { payload: inlineDialog, key: `inline:${inlineDialog.key ?? ''}` })))
2037
2144
  }
2038
2145
 
2039
2146
  /* ------------------------------------------------------------------ *
@@ -2044,6 +2151,11 @@ window.__ModuleLoader__.load({
2044
2151
  /* 1300 clears the settings modal (1000) and the host panels that also use
2045
2152
  1100, since this backlog shares document.body with them. */
2046
2153
  .dc-backdrop{position:fixed;inset:0;z-index:1300;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.38);padding:16px}
2154
+ /* Inline copy for hosts without an overlay seat (dsh-go native UI): the
2155
+ same dialog, in the page flow instead of on top of it. */
2156
+ .dc-inline-dialog{margin-top:14px;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l1,#e5e6eb)}
2157
+ .dc-inline-dialog .dc-backdrop{position:static;inset:auto;z-index:auto;background:none;padding:0;display:block}
2158
+ .dc-inline-dialog .dc-dialog{width:100%;max-width:none;max-height:none;box-shadow:none;padding:14px}
2047
2159
  .dc-dialog{box-sizing:border-box;width:min(560px,94vw);max-height:88vh;overflow:auto;background:var(--dsw-alias-bg-overlay,#fff);color:var(--dsw-alias-label-primary,#1f2329);border:1px solid var(--dsw-alias-border-l1,#e5e6eb);border-radius:12px;box-shadow:0 18px 60px rgba(0,0,0,.28);padding:20px 20px 16px;font:inherit}
2048
2160
  .dc-dialog-title{margin:0 0 8px;font-size:16px;font-weight:600;line-height:1.4}
2049
2161
  .dc-dialog-body{margin:0 0 12px;font-size:13px;color:var(--dsw-alias-label-secondary,#646a73);line-height:1.6}
@@ -2232,6 +2344,12 @@ window.__ModuleLoader__.load({
2232
2344
  exports.__adapterLabel = adapterLabel
2233
2345
  exports.__adapterReason = adapterReason
2234
2346
  exports.__loadUiFlags = loadUiFlags
2347
+ // Pure helpers the tests assert on directly: the phrase rule and the
2348
+ // non-JSON fallback are exactly where a mobile keyboard or a route
2349
+ // guard changes the outcome.
2350
+ exports.__phraseMatches = phraseMatches
2351
+ exports.__httpFallbackError = httpFallbackError
2352
+ exports.__overlaySeatState = () => ({ mounted: overlaySeatMounted })
2235
2353
  return module.exports
2236
2354
  },
2237
2355
  })
@@ -103,8 +103,13 @@ export function createFileLock({
103
103
  let breakFailures = 0
104
104
 
105
105
  const busyError = () => {
106
- const busy = new Error(`The lock ${lockPath} is held by another process.`)
106
+ // The path is part of the message on purpose: a lock left behind by a
107
+ // killed Host (or a recycled pid that never heartbeats again) blocks every
108
+ // change for up to twenty minutes, and the only fix the user has is
109
+ // deleting that file. Without the path the refusal is a dead end.
110
+ const busy = new Error(`The lock ${lockPath} is held by another process. If this keeps happening, delete that file and retry.`)
107
111
  busy.code = 'E_LOCK_BUSY'
112
+ busy.details = { lockPath }
108
113
  return busy
109
114
  }
110
115
 
package/lib/host/api.js CHANGED
@@ -770,7 +770,12 @@ export function createDeleteApi({ ctx, config, paths, now = Date.now, logger = c
770
770
  // temporary rate limit does not force the user to re-preview.
771
771
  const validated = validateConfirmation(body?.confirmToken, { sessionIds, includeMemory, mode })
772
772
  const phrase = typeof body?.confirmPhrase === 'string' ? body.confirmPhrase.trim() : ''
773
- if (validated.record.phrase !== '' && phrase !== validated.record.phrase) {
773
+ // Compared case-insensitively: Android soft keyboards capitalise the first
774
+ // letter of a sentence, so "Delete" arrived where the Host expected
775
+ // "DELETE" and the only feedback was a refusal with no explanation. The
776
+ // phrase is a deliberate friction, not a spelling test.
777
+ const phraseMatches = validated.record.phrase === '' || phrase.toUpperCase() === validated.record.phrase.toUpperCase()
778
+ if (!phraseMatches) {
774
779
  throw new DeleteError('E_CONFIRM_PHRASE', `Type “${validated.record.phrase}” to confirm this deletion.`, {
775
780
  expected: validated.record.phrase,
776
781
  received: phrase.slice(0, 40),
@@ -901,7 +906,7 @@ export function createDeleteApi({ ctx, config, paths, now = Date.now, logger = c
901
906
 
902
907
  async function purgeEntry(trashId, confirmPhrase) {
903
908
  if (typeof trashId !== 'string' || trashId === '') throw new DeleteError('E_BAD_REQUEST', 'A recycle-bin id is required.', {})
904
- if (typeof confirmPhrase !== 'string' || confirmPhrase.trim() !== 'DELETE') {
909
+ if (typeof confirmPhrase !== 'string' || confirmPhrase.trim().toUpperCase() !== 'DELETE') {
905
910
  throw new DeleteError('E_CONFIRM_PHRASE', 'Type “DELETE” to permanently delete this entry.', { expected: 'DELETE' })
906
911
  }
907
912
  const entry = await trash.read(trashId)
@@ -927,7 +932,7 @@ export function createDeleteApi({ ctx, config, paths, now = Date.now, logger = c
927
932
  // still be on disk" branch below and turn this into an arbitrary-path
928
933
  // existence probe.
929
934
  if (!isTrashId(trashId)) throw new DeleteError('E_BAD_REQUEST', 'The recycle-bin id is malformed.', {})
930
- if (typeof confirmPhrase !== 'string' || confirmPhrase.trim() !== 'DELETE') {
935
+ if (typeof confirmPhrase !== 'string' || confirmPhrase.trim().toUpperCase() !== 'DELETE') {
931
936
  throw new DeleteError('E_CONFIRM_PHRASE', 'Type “DELETE” to discard this incomplete entry.', { expected: 'DELETE' })
932
937
  }
933
938
  let entry = await trash.read(trashId)
package/lib/version.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * asserted against it by `test/manifest.test.mjs` so the two can never drift
6
6
  * (they did: the constant stayed at 0.1.0 while the package reached 0.1.4).
7
7
  */
8
- export const PLUGIN_VERSION = '0.3.14'
8
+ export const PLUGIN_VERSION = '0.3.15'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-conversation-recycle-bin",
3
- "version": "0.3.14",
3
+ "version": "0.3.15",
4
4
  "description": "DSH conversation deletion with an optional, previewed cascade into conversation-associated memory: soft delete + recycle bin, audit trail, batch rate limits and per-session rollback. 删除对话(可选一并删除关联记忆):软删除与回收站、审计留痕、批量限流、失败回滚。",
5
5
  "repository": {
6
6
  "type": "git",