dsh-as-aistudio 0.4.3 → 0.4.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
@@ -4,6 +4,12 @@
4
4
 
5
5
  ## 中文
6
6
 
7
+ **0.4.4** —— 复制失败的诊断(跟进 `dsh-edit-turn` 0.5.10)。
8
+
9
+ - **组件跟进**:`dsh-edit-turn` **0.5.10**(另三个不变:`dsh-rerun-turn` 0.2.6、`dsh-delete-turn` 0.1.15、`dsh-markdown-bubble` 0.1.5)。
10
+
11
+ - 复制仍拿到改写前的原文时,浏览器**标签页标题**会显示 `[复制诊断] <原因>`,用来定位是哪一环没接管;接管成功时标题自动恢复。
12
+
7
13
  **0.4.3** —— 编辑入口不再"等半天才出现"(`/state` 从 25 MB 降到几百 KB)。
8
14
 
9
15
  - **组件跟进**:`dsh-edit-turn` **0.5.9**(另三个不变:`dsh-rerun-turn` 0.2.6、`dsh-delete-turn` 0.1.15、`dsh-markdown-bubble` 0.1.5)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-as-aistudio",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Google-AI-Studio-style turn controls for DeepSeek Harness, in one install: edit a prompt and re-run it, re-run a reply in place, delete a turn from the model context, and render sent prompts as Markdown. Self-contained: the plugin list shows this one row, and the four components are vendored inside it - installing the studio installs nothing else.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/client.js CHANGED
@@ -43,7 +43,7 @@ window.__ModuleLoader__.load({
43
43
  const RERUN_PREFIX = '/dsh-rerun-turn'
44
44
 
45
45
  /** Keep in sync with package.json and lib/index.js. */
46
- const PLUGIN_VERSION = '0.5.9'
46
+ const PLUGIN_VERSION = '0.5.10'
47
47
 
48
48
  // --- copy -----------------------------------------------------------------
49
49
 
@@ -1998,6 +1998,25 @@ window.__ModuleLoader__.load({
1998
1998
  return created
1999
1999
  })()
2000
2000
  const rowCopyText = copyRegistry.text
2001
+
2002
+ // TEMP DIAG (删除时机:复制修好后). 复制按下没被接管时,把原因写进标签页标题:
2003
+ // 不污染剪贴板、不改页面内容,用户念一眼标题即可;成功接管时自动恢复原标题。
2004
+ const copyDiag = (page) => {
2005
+ try {
2006
+ if (page.__dshetTitle === undefined) page.__dshetTitle = document.title
2007
+ const base = String(page.__dshetTitle ?? '')
2008
+ const show = (reason) => {
2009
+ document.title = `[复制诊断] ${reason}${base === '' ? '' : ' · ' + base}`
2010
+ }
2011
+ const clear = () => {
2012
+ if (String(document.title).startsWith('[复制诊断]')) document.title = base
2013
+ }
2014
+ return { show, clear }
2015
+ } catch {
2016
+ return { show: () => {}, clear: () => {} }
2017
+ }
2018
+ }
2019
+ const titleDiag = typeof globalThis !== 'undefined' ? copyDiag(globalThis) : { show: () => {}, clear: () => {} }
2001
2020
  const rowHostText = copyRegistry.host
2002
2021
 
2003
2022
  /**
@@ -2129,6 +2148,11 @@ window.__ModuleLoader__.load({
2129
2148
  const native = clipboard.writeText.bind(clipboard)
2130
2149
  const wrapped = (value) => {
2131
2150
  const rewritten = rewriteCopiedText(String(value ?? ''))
2151
+ if (rewritten === null && rowCopyText.size > 0) {
2152
+ titleDiag.show(`写入没匹配上(登记 ${rowCopyText.size} 行,长度 ${String(value ?? '').length})`)
2153
+ } else if (rewritten !== null) {
2154
+ titleDiag.clear()
2155
+ }
2132
2156
  return rewritten === null ? native(value) : native(rewritten)
2133
2157
  }
2134
2158
  wrapped[CLIPBOARD_WRAPPED] = true
@@ -4969,11 +4993,15 @@ window.__ModuleLoader__.load({
4969
4993
  // Our own buttons sit in the same bar: theirs is not this press.
4970
4994
  if (pluginOwned(button)) return
4971
4995
  const row = button.closest('[data-chat-flow-key]')
4972
- if (row === null) return
4996
+ if (row === null) { titleDiag.show('按钮不在行内'); return }
4973
4997
  const key = row.getAttribute('data-chat-flow-key')
4974
- if (typeof key !== 'string' || key === '') return
4998
+ if (typeof key !== 'string' || key === '') { titleDiag.show('行没有 key'); return }
4975
4999
  const text = rowCopyText.get(key)
4976
- if (typeof text !== 'string') return
5000
+ if (typeof text !== 'string') {
5001
+ titleDiag.show(`这一行没登记文本(登记 ${rowCopyText.size} 行)`)
5002
+ return
5003
+ }
5004
+ titleDiag.clear()
4977
5005
  const write = primitives !== null && primitives !== undefined && typeof primitives.writeClipboard === 'function'
4978
5006
  ? primitives.writeClipboard
4979
5007
  : null
@@ -9196,7 +9224,7 @@ window.__ModuleLoader__.load({
9196
9224
  const NS = 'dsh-as-aistudio'
9197
9225
 
9198
9226
  /** Keep in sync with package.json and src/components.js. */
9199
- const PLUGIN_VERSION = '0.4.3'
9227
+ const PLUGIN_VERSION = '0.4.4'
9200
9228
 
9201
9229
  /** Presence marker the live verifier reads. */
9202
9230
  const DEBUG_KEY = '__DSH_AS_AISTUDIO__'
package/src/components.js CHANGED
@@ -26,7 +26,7 @@
26
26
  export const STUDIO_ID = 'dsh-as-aistudio'
27
27
 
28
28
  /** Keep in sync with package.json and src/client.js. */
29
- export const STUDIO_VERSION = '0.4.3'
29
+ export const STUDIO_VERSION = '0.4.4'
30
30
 
31
31
  /**
32
32
  * The AI Studio action strip this studio composes, in the order the user meets
@@ -1,6 +1,6 @@
1
1
  // dsh-edit-turn host half (dsh-edit-turn.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-edit-turn/lib/index.js (v0.5.9, sha256 a007714c89acfae5)
3
+ // Source: ../dsh-edit-turn/lib/index.js (v0.5.10, sha256 8bfd50c80995d96e)
4
4
  // Regenerate with `npm run vendor`; test/sync.test.js fails when this is stale.
5
5
  //
6
6
  // src/shell.js imports the copy named after the component, which is why the
@@ -85,7 +85,7 @@ export const PLUGIN_ID = 'dsh-edit-turn'
85
85
  export const name = PLUGIN_ID
86
86
 
87
87
  /** Keep in sync with package.json and lib/client.js. */
88
- export const PLUGIN_VERSION = '0.5.9'
88
+ export const PLUGIN_VERSION = '0.5.10'
89
89
 
90
90
  // A ring of the last few requests, answering "did the browser half even ask, and
91
91
  // what did it get?" without needing its console. Read-only diagnostics: the
@@ -1,6 +1,6 @@
1
1
  // dsh-edit-turn host half (dsh-edit-turn.patch.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-edit-turn/lib/patch.js (v0.5.9, sha256 5e1e8cce1d168f6c)
3
+ // Source: ../dsh-edit-turn/lib/patch.js (v0.5.10, sha256 5e1e8cce1d168f6c)
4
4
  // Regenerate with `npm run vendor`; test/sync.test.js fails when this is stale.
5
5
  //
6
6
  // src/shell.js imports the copy named after the component, which is why the
@@ -1,5 +1,5 @@
1
1
  {
2
- "dsh-edit-turn": "0.5.9",
2
+ "dsh-edit-turn": "0.5.10",
3
3
  "dsh-rerun-turn": "0.2.6",
4
4
  "dsh-delete-turn": "0.1.15",
5
5
  "dsh-markdown-bubble": "0.1.5"