dsh-as-aistudio 0.5.21 → 0.5.23

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,10 @@
4
4
 
5
5
  ## 中文
6
6
 
7
+ **0.5.23** —— 跟进 dsh-edit-turn 0.5.24(深色皮肤下编辑器黑底黑字)。
8
+
9
+ **0.5.22** —— 跟进 dsh-log-trim 0.7.9(最小日志体积可填小数)。
10
+
7
11
  **0.5.21** —— 跟进 dsh-log-trim 0.7.8(「不需要裁」记跳过)。
8
12
 
9
13
  **0.5.20** —— 跟进 dsh-log-trim 0.7.7(门槛 256KB,前缀清理失败记跳过)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-as-aistudio",
3
- "version": "0.5.21",
3
+ "version": "0.5.23",
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
@@ -369,11 +369,39 @@ window.__ModuleLoader__.load({
369
369
  clearVar('--dshet-panel')
370
370
  clearVar('--dshet-chip')
371
371
  clearVar('--dshet-field')
372
+ clearVar('--dshet-ink')
373
+ clearVar('--dshet-ink-dim')
374
+ clearVar('--dshet-ink-soft')
372
375
  } else {
373
376
  const fieldSolid = solid(layer2) ?? panelSolid
374
377
  setVar('--dshet-panel', css(panelSolid))
375
378
  setVar('--dshet-chip', css(panelSolid))
376
379
  setVar('--dshet-field', css(fieldSolid))
380
+ // 文字颜色必须和「我们自己画的那块底」配,而不是和主题的底色配:
381
+ // 皮肤可能只覆盖了表面色、没覆盖 label-primary(或把它定义在别的
382
+ // 作用域),这时 `var(--dsw-alias-label-primary, #0f1524)` 会落到近黑,
383
+ // 深色面板上就是「黑底黑字」——看起来像整块黑板。
384
+ // 用面板亮度直接决定前景色。
385
+ const channel = (value) => {
386
+ const v = value / 255
387
+ return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4
388
+ }
389
+ const panelLuminance = 0.2126 * channel(panelSolid.r) + 0.7152 * channel(panelSolid.g) + 0.0722 * channel(panelSolid.b)
390
+ const declaredInk = read('--dsw-alias-label-primary')
391
+ const readableOnDark = panelLuminance < 0.4
392
+ const declaredContrast = declaredInk === null
393
+ ? 0
394
+ : Math.abs(0.2126 * channel(declaredInk.r) + 0.7152 * channel(declaredInk.g) + 0.0722 * channel(declaredInk.b) - panelLuminance)
395
+ if (declaredContrast < 0.24) {
396
+ // 主题给的前景在这个面板上没有对比度(或根本没给)——自己配一套。
397
+ setVar('--dshet-ink', readableOnDark ? '#f2f4f8' : '#0f1524')
398
+ setVar('--dshet-ink-dim', readableOnDark ? 'rgba(242,244,248,.76)' : 'rgba(15,21,36,.72)')
399
+ setVar('--dshet-ink-soft', readableOnDark ? 'rgba(242,244,248,.58)' : 'rgba(15,21,36,.55)')
400
+ } else {
401
+ clearVar('--dshet-ink')
402
+ clearVar('--dshet-ink-dim')
403
+ clearVar('--dshet-ink-soft')
404
+ }
377
405
  }
378
406
  if (accent === null) {
379
407
  clearVar('--dshet-on-accent')
@@ -9642,7 +9670,7 @@ window.__ModuleLoader__.load({
9642
9670
  const react = require('react')
9643
9671
  const { jsx, jsxs } = require('react/jsx-runtime')
9644
9672
 
9645
- const PLUGIN_VERSION = '0.7.8'
9673
+ const PLUGIN_VERSION = '0.7.9'
9646
9674
  const ROUTE_PREFIX = '/api/dsh-log-trim'
9647
9675
 
9648
9676
  /** The knobs this card edits, in the order they are drawn. */
@@ -9690,7 +9718,7 @@ window.__ModuleLoader__.load({
9690
9718
  hint: '每次改写日志记一笔(窗口数 / 事件数 / 字节),写到 ~/.dsh/dsh-log-trim/ledger.json;dsh-session-pages 会读它显示,其它插件也能读。关掉就不记',
9691
9719
  kind: 'toggle',
9692
9720
  },
9693
- { key: 'minBytes', label: '最小日志体积', hint: '小于它就根本不读,默认 1 MB', min: 0, max: 200, step: 1, kind: 'mb' },
9721
+ { key: 'minBytes', label: '最小日志体积', hint: '小于它就根本不读,默认 0.25 MB(256 KB);可填小数,如 0.25 / 0.5', min: 0, max: 200, step: 0.25, kind: 'mb' },
9694
9722
  {
9695
9723
  key: 'backupKeep',
9696
9724
  label: '保留备份数',
@@ -9774,7 +9802,7 @@ window.__ModuleLoader__.load({
9774
9802
 
9775
9803
  /** One number input bound to a config key. */
9776
9804
  function NumberField({ field, value, onChange }) {
9777
- const shown = field.kind === 'ratio' ? Math.round(Number(value) * 100) : field.kind === 'mb' ? Math.round(Number(value) / 1048576) : Number(value)
9805
+ const shown = field.kind === 'ratio' ? Math.round(Number(value) * 100) : field.kind === 'mb' ? Number((Number(value) / 1048576).toFixed(2)) : Number(value)
9778
9806
  return jsxs('label', {
9779
9807
  style: style.row,
9780
9808
  children: [
@@ -10168,7 +10196,7 @@ window.__ModuleLoader__.load({
10168
10196
  const NS = 'dsh-as-aistudio'
10169
10197
 
10170
10198
  /** Keep in sync with package.json and src/components.js. */
10171
- const PLUGIN_VERSION = '0.5.21'
10199
+ const PLUGIN_VERSION = '0.5.23'
10172
10200
 
10173
10201
  /** Presence marker the live verifier reads. */
10174
10202
  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.21'
29
+ export const STUDIO_VERSION = '0.5.23'
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.23, sha256 d7b898199cac0386)
3
+ // Source: ../dsh-edit-turn/lib/index.js (v0.5.24, sha256 66aa182a980bfac6)
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.23'
88
+ export const PLUGIN_VERSION = '0.5.24'
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.23, sha256 5e1e8cce1d168f6c)
3
+ // Source: ../dsh-edit-turn/lib/patch.js (v0.5.24, 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.8, sha256 3aa1fdcbb120ab06)
3
+ // Source: ../dsh-log-trim/lib/flatten.js (v0.7.9, 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.8, sha256 0801a28f35667ee7)
3
+ // Source: ../dsh-log-trim/lib/goal-repair.js (v0.7.9, 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.8, sha256 5ebed01988b5bfcf)
3
+ // Source: ../dsh-log-trim/lib/host-libs.mjs (v0.7.9, 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.8, sha256 860ac9d48e3492d3)
3
+ // Source: ../dsh-log-trim/lib/index.js (v0.7.9, sha256 8de453b1edc314b0)
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.8'
47
+ export const PLUGIN_VERSION = '0.7.9'
48
48
  export const ROUTE_PREFIX = '/api/dsh-log-trim'
49
49
 
50
50
  /**
@@ -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.8, sha256 5ca2460b42a3a776)
3
+ // Source: ../dsh-log-trim/lib/ledger.js (v0.7.9, 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.8, sha256 7e8478a2fd2ec10b)
3
+ // Source: ../dsh-log-trim/lib/lossless.js (v0.7.9, 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.8, sha256 028d9c12a395aaab)
3
+ // Source: ../dsh-log-trim/lib/roots.js (v0.7.9, 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.8, sha256 69e33224d92c2157)
3
+ // Source: ../dsh-log-trim/lib/vendor.compact-session.mjs (v0.7.9, 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
@@ -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.8, sha256 7cf835c053942961)
3
+ // Source: ../dsh-log-trim/lib/verify-session-log.mjs (v0.7.9, 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.8, sha256 675a759a767b7e38)
3
+ // Source: ../dsh-log-trim/lib/worker.mjs (v0.7.9, 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.23",
2
+ "dsh-edit-turn": "0.5.24",
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.8"
6
+ "dsh-log-trim": "0.7.9"
7
7
  }