dsh-as-aistudio 0.5.19 → 0.5.20

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,8 @@
4
4
 
5
5
  ## 中文
6
6
 
7
+ **0.5.20** —— 跟进 dsh-log-trim 0.7.7(门槛 256KB,前缀清理失败记跳过)。
8
+
7
9
  **0.5.19** —— 跟进 dsh-log-trim 0.7.6(扫描会计入遮蔽前缀,窗口数真的降下来)。
8
10
 
9
11
  **0.5.18** —— 跟进 dsh-log-trim 0.7.5(裁掉被检查点遮蔽的前缀,窗口数真的降下来)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-as-aistudio",
3
- "version": "0.5.19",
3
+ "version": "0.5.20",
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, render sent prompts as Markdown, and trim idle session logs on boot. Self-contained: the plugin list shows this one row, and the five components (four actions + one maintenance) 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
@@ -9642,7 +9642,7 @@ window.__ModuleLoader__.load({
9642
9642
  const react = require('react')
9643
9643
  const { jsx, jsxs } = require('react/jsx-runtime')
9644
9644
 
9645
- const PLUGIN_VERSION = '0.7.6'
9645
+ const PLUGIN_VERSION = '0.7.7'
9646
9646
  const ROUTE_PREFIX = '/api/dsh-log-trim'
9647
9647
 
9648
9648
  /** The knobs this card edits, in the order they are drawn. */
@@ -10168,7 +10168,7 @@ window.__ModuleLoader__.load({
10168
10168
  const NS = 'dsh-as-aistudio'
10169
10169
 
10170
10170
  /** Keep in sync with package.json and src/components.js. */
10171
- const PLUGIN_VERSION = '0.5.19'
10171
+ const PLUGIN_VERSION = '0.5.20'
10172
10172
 
10173
10173
  /** Presence marker the live verifier reads. */
10174
10174
  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.5.19'
29
+ export const STUDIO_VERSION = '0.5.20'
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.22, sha256 c91f351013c90495)
3
+ // Source: ../dsh-edit-turn/lib/index.js (v0.5.23, sha256 d7b898199cac0386)
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.22'
88
+ export const PLUGIN_VERSION = '0.5.23'
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.22, sha256 5e1e8cce1d168f6c)
3
+ // Source: ../dsh-edit-turn/lib/patch.js (v0.5.23, 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,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.flatten.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/flatten.js (v0.7.6, sha256 3aa1fdcbb120ab06)
3
+ // Source: ../dsh-log-trim/lib/flatten.js (v0.7.7, sha256 3aa1fdcbb120ab06)
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,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.goal-repair.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/goal-repair.js (v0.7.6, sha256 0801a28f35667ee7)
3
+ // Source: ../dsh-log-trim/lib/goal-repair.js (v0.7.7, sha256 0801a28f35667ee7)
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,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.host-libs.mjs), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/host-libs.mjs (v0.7.6, sha256 5ebed01988b5bfcf)
3
+ // Source: ../dsh-log-trim/lib/host-libs.mjs (v0.7.7, sha256 5ebed01988b5bfcf)
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,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/index.js (v0.7.6, sha256 78ee6ff182ff4b93)
3
+ // Source: ../dsh-log-trim/lib/index.js (v0.7.7, sha256 9c7bc26a51828b7b)
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
@@ -44,7 +44,7 @@ import { readLedger, recordFor } from './dsh-log-trim.ledger.js'
44
44
 
45
45
  export const name = 'dsh-log-trim'
46
46
  export const PLUGIN_ID = name
47
- export const PLUGIN_VERSION = '0.7.6'
47
+ export const PLUGIN_VERSION = '0.7.7'
48
48
  export const ROUTE_PREFIX = '/api/dsh-log-trim'
49
49
 
50
50
  /**
@@ -623,7 +623,7 @@ export const DEFAULTS = {
623
623
  repairOnBoot: true,
624
624
  keepWindows: 2,
625
625
  minDroppableEvents: 500,
626
- minBytes: 1048576,
626
+ minBytes: 262144,
627
627
  minRatio: 0.2,
628
628
  requireModelUnchanged: true,
629
629
  dryRun: false,
@@ -1004,9 +1004,10 @@ export async function runScan(config, logger = {}) {
1004
1004
  continue
1005
1005
  }
1006
1006
  }
1007
- // A log smaller than `minBytes` cannot hold four windows, and reading it out
1008
- // is the expensive half of a scan: 94 sessions took 68 s when every one was
1009
- // decoded, and almost all of them are tiny.
1007
+ // A log smaller than `minBytes` is not worth decoding: reading it out is the
1008
+ // expensive half of a scan. It used to be 1 MB on the assumption that four
1009
+ // windows cannot fit below that - but three windows fit in 775 KB, so the
1010
+ // gate now sits at 256 KB.
1010
1011
  let bytes = 0
1011
1012
  try {
1012
1013
  bytes = fs.statSync(logFile).size
@@ -1015,7 +1016,7 @@ export async function runScan(config, logger = {}) {
1015
1016
  continue
1016
1017
  }
1017
1018
  if (bytes < config.minBytes) {
1018
- summary.skipped.push({ sessionId, reason: `只有 ${Math.round(bytes / 1024)} KB,不可能有 4 个窗口` })
1019
+ summary.skipped.push({ sessionId, reason: `只有 ${Math.round(bytes / 1024)} KB,低于最小体积阈值 ${Math.round(config.minBytes / 1024)} KB` })
1019
1020
  continue
1020
1021
  }
1021
1022
  let mtimeMs = 0
@@ -1115,7 +1116,9 @@ export async function runScan(config, logger = {}) {
1115
1116
  mtimeMs = stat.mtimeMs
1116
1117
  }
1117
1118
  } catch (error) {
1118
- summary.failed.push({ sessionId, reason: `清理失败:${error instanceof Error ? error.message : String(error)}` })
1119
+ const text = error instanceof Error ? error.message : String(error)
1120
+ if (text.includes('不需要裁')) summary.skipped.push({ sessionId, reason: text })
1121
+ else summary.failed.push({ sessionId, reason: `清理失败:${text}` })
1119
1122
  continue
1120
1123
  }
1121
1124
  }
@@ -1,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.ledger.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/ledger.js (v0.7.6, sha256 5ca2460b42a3a776)
3
+ // Source: ../dsh-log-trim/lib/ledger.js (v0.7.7, sha256 5ca2460b42a3a776)
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,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.lossless.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/lossless.js (v0.7.6, sha256 7e8478a2fd2ec10b)
3
+ // Source: ../dsh-log-trim/lib/lossless.js (v0.7.7, sha256 7e8478a2fd2ec10b)
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,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.roots.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/roots.js (v0.7.6, sha256 028d9c12a395aaab)
3
+ // Source: ../dsh-log-trim/lib/roots.js (v0.7.7, sha256 028d9c12a395aaab)
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,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.vendor.compact-session.mjs), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/vendor.compact-session.mjs (v0.7.6, sha256 3df242c4e94bd6d9)
3
+ // Source: ../dsh-log-trim/lib/vendor.compact-session.mjs (v0.7.7, sha256 69e33224d92c2157)
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
@@ -2301,6 +2301,9 @@ export async function applyTrim(logFile, keep, options = {}) {
2301
2301
  if (retried.ok) return commitTrim(staged, logFile)
2302
2302
  fs.rmSync(staged.staging, { force: true })
2303
2303
  const bad = retried.checks.filter((check) => !check.ok).map((check) => `${check.name} ${check.detail}`).join(';')
2304
+ // 两次都不过:如果退回后本来就“不需要裁”,那是这份日志结构不适合丢前缀,
2305
+ // 当成跳过而不是失败(扫描不该因为收益型优化失败而报错)。
2306
+ if (String(bad).includes('不需要裁')) throw new Error('不需要裁(前缀清理在这份日志上过不了宿主校验)')
2304
2307
  throw new Error(`裁剪结果没通过宿主校验,未写入:${bad}`)
2305
2308
  }
2306
2309
  const bad = result.checks.filter((check) => !check.ok).map((check) => `${check.name} ${check.detail}`).join(';')
@@ -1,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.verify-session-log.mjs), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/verify-session-log.mjs (v0.7.6, sha256 7cf835c053942961)
3
+ // Source: ../dsh-log-trim/lib/verify-session-log.mjs (v0.7.7, sha256 7cf835c053942961)
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,6 +1,6 @@
1
1
  // dsh-log-trim host half (dsh-log-trim.worker.mjs), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/worker.mjs (v0.7.6, sha256 675a759a767b7e38)
3
+ // Source: ../dsh-log-trim/lib/worker.mjs (v0.7.7, sha256 675a759a767b7e38)
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,7 +1,7 @@
1
1
  {
2
- "dsh-edit-turn": "0.5.22",
2
+ "dsh-edit-turn": "0.5.23",
3
3
  "dsh-rerun-turn": "0.2.11",
4
4
  "dsh-delete-turn": "0.2.4",
5
5
  "dsh-markdown-bubble": "0.1.5",
6
- "dsh-log-trim": "0.7.6"
6
+ "dsh-log-trim": "0.7.7"
7
7
  }