dsh-as-aistudio 0.5.0 → 0.5.2

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,17 @@
4
4
 
5
5
  ## 中文
6
6
 
7
+ **0.5.2** —— 跟进三个动作组件:设置卡片同时挂到包自己的页面。
8
+
9
+ - dsh-edit-turn 0.5.15 / dsh-rerun-turn 0.2.8 / dsh-delete-turn 0.2.1:新增 `plugins.bundle.config`(key 是裸包名),
10
+ 于是 `#/panel/plugins/<包名>` 直接能看到设置,不再只能从 `…/<包名>/<包名>` 那一层进去。
11
+ - 内嵌浏览器半部随重新 vendor 更新。
12
+
13
+ **0.5.1** —— 组件行标出「动作 / 维护」;跟进内嵌组件。
14
+
15
+ - 面板里每个组件行在名字后多一个徽章:`动作`(edit/rerun/delete/markdown)或 `维护`(log-trim)。
16
+ - 内嵌 dsh-log-trim 升到 0.5.1(双份安装告警)。
17
+
7
18
  **0.5.0** —— 第五个组件:会话日志裁剪(dsh-log-trim 0.5.0)。
8
19
 
9
20
  - **维护型组件**:manifest 新增 `{ id: 'dsh-log-trim', suffix: 'trim', kind: 'maintenance' }`,它没有消息行动作、没有输入区浮层,因此不占 slot / overlay;补丁行、`exports["./trim"]`、vendor 副本与状态行照旧,和其它四个组件一样由本包内置。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-as-aistudio",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
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.14'
46
+ const PLUGIN_VERSION = '0.5.15'
47
47
 
48
48
  // --- copy -----------------------------------------------------------------
49
49
 
@@ -5488,6 +5488,19 @@ window.__ModuleLoader__.load({
5488
5488
  ),
5489
5489
  )
5490
5490
 
5491
+ // 同一张卡也挂在包自己的页面上(`#/panel/plugins/dsh-edit-turn`),
5492
+ // 而不是只藏在 `…/dsh-edit-turn/dsh-edit-turn` 那一层。
5493
+ ctx.slots.inject('plugins.bundle.config', () =>
5494
+ ctx.slots.register(
5495
+ {
5496
+ name: 'plugins.bundle.config',
5497
+ key: 'dsh-edit-turn',
5498
+ locale: NS,
5499
+ },
5500
+ EditorStyleOption,
5501
+ ),
5502
+ )
5503
+
5491
5504
  ctx.slots.inject('conversation.input.overlay', () =>
5492
5505
  ctx.slots.register(
5493
5506
  {
@@ -5527,7 +5540,7 @@ window.__ModuleLoader__.load({
5527
5540
  const ROUTE_PREFIX = '/dsh-rerun-turn'
5528
5541
 
5529
5542
  /** Keep in sync with package.json and lib/index.js. */
5530
- const PLUGIN_VERSION = '0.2.7'
5543
+ const PLUGIN_VERSION = '0.2.8'
5531
5544
 
5532
5545
  // --- copy -----------------------------------------------------------------
5533
5546
 
@@ -7030,6 +7043,19 @@ window.__ModuleLoader__.load({
7030
7043
  AskBeforeRerunOption,
7031
7044
  ),
7032
7045
  )
7046
+
7047
+ // 同一张卡也挂在包自己的页面上(`#/panel/plugins/dsh-rerun-turn`),
7048
+ // 而不是只藏在 `…/dsh-rerun-turn/dsh-rerun-turn` 那一层。
7049
+ ctx.slots.inject('plugins.bundle.config', () =>
7050
+ ctx.slots.register(
7051
+ {
7052
+ name: 'plugins.bundle.config',
7053
+ key: 'dsh-rerun-turn',
7054
+ locale: NS,
7055
+ },
7056
+ AskBeforeRerunOption,
7057
+ ),
7058
+ )
7033
7059
  }
7034
7060
 
7035
7061
  exports.apply = apply
@@ -8629,6 +8655,19 @@ window.__ModuleLoader__.load({
8629
8655
  AskBeforeDeleteOption,
8630
8656
  ),
8631
8657
  )
8658
+
8659
+ // 同一张卡也挂在包自己的页面上(`#/panel/plugins/dsh-delete-turn`),
8660
+ // 而不是只藏在 `…/dsh-delete-turn/dsh-delete-turn` 那一层。
8661
+ ctx.slots.inject('plugins.bundle.config', () =>
8662
+ ctx.slots.register(
8663
+ {
8664
+ name: 'plugins.bundle.config',
8665
+ key: 'dsh-delete-turn',
8666
+ locale: NS,
8667
+ },
8668
+ AskBeforeDeleteOption,
8669
+ ),
8670
+ )
8632
8671
  }
8633
8672
 
8634
8673
  exports.apply = apply
@@ -9575,7 +9614,7 @@ window.__ModuleLoader__.load({
9575
9614
  const react = require('react')
9576
9615
  const { jsx, jsxs } = require('react/jsx-runtime')
9577
9616
 
9578
- const PLUGIN_VERSION = '0.5.0'
9617
+ const PLUGIN_VERSION = '0.5.1'
9579
9618
  const ROUTE_PREFIX = '/api/dsh-log-trim'
9580
9619
 
9581
9620
  /** The knobs this card edits, in the order they are drawn. */
@@ -9988,6 +10027,12 @@ window.__ModuleLoader__.load({
9988
10027
  `版本 ${PLUGIN_VERSION};设置在 ~/.dsh/dsh-log-trim/config.json,配置文件里的那一行只是初始值。`,
9989
10028
  ],
9990
10029
  }),
10030
+ status !== null && status !== undefined && status.duplicateStudio === true
10031
+ ? jsx('p', {
10032
+ style: { ...style.status, color: 'var(--dsw-alias-state-warning-primary, #d98b00)' },
10033
+ children: '检测到同时安装了 dsh-as-aistudio(它内置了本插件):两份会各跑一次启动扫描,建议在插件列表里只保留一份。',
10034
+ })
10035
+ : null,
9991
10036
  jsx('div', {
9992
10037
  style: style.grid,
9993
10038
  children: FIELDS.filter((field) => field.kind === 'select').map((field) =>
@@ -10076,7 +10121,7 @@ window.__ModuleLoader__.load({
10076
10121
  const NS = 'dsh-as-aistudio'
10077
10122
 
10078
10123
  /** Keep in sync with package.json and src/components.js. */
10079
- const PLUGIN_VERSION = '0.5.0'
10124
+ const PLUGIN_VERSION = '0.5.2'
10080
10125
 
10081
10126
  /** Presence marker the live verifier reads. */
10082
10127
  const DEBUG_KEY = '__DSH_AS_AISTUDIO__'
@@ -10117,6 +10162,8 @@ window.__ModuleLoader__.load({
10117
10162
  statusInstalled: '已安装,宿主未挂载',
10118
10163
  statusMissing: '未安装',
10119
10164
  statusUnknown: '宿主未报告',
10165
+ kindAction: '动作',
10166
+ kindMaintenance: '维护',
10120
10167
  hostOnly: '(独立安装时走自己的插件行)',
10121
10168
  row: '行 {row}',
10122
10169
  version: '版本 {version}',
@@ -10143,6 +10190,8 @@ window.__ModuleLoader__.load({
10143
10190
  statusMounted: 'Enabled',
10144
10191
  statusInstalled: 'Installed, host not mounted',
10145
10192
  statusMissing: 'Not installed',
10193
+ kindAction: 'action',
10194
+ kindMaintenance: 'maintenance',
10146
10195
  statusUnknown: 'Host did not report',
10147
10196
  hostOnly: '(a standalone install also shows its own row)',
10148
10197
  row: 'row {row}',
@@ -10554,6 +10603,7 @@ window.__ModuleLoader__.load({
10554
10603
  h('div', { className: 'dsas-rowHead', key: 'head' }, [
10555
10604
  h('span', { className: 'dsas-dot', 'data-state': state, key: 'dot' }),
10556
10605
  h('span', { className: 'dsas-name', key: 'name' }, text.title),
10606
+ h('span', { className: 'dsas-badge', key: 'kind' }, component.kind === 'maintenance' ? t('kindMaintenance') : t('kindAction')),
10557
10607
  h('span', { className: 'dsas-badge', key: 'badge' }, stateLabelText),
10558
10608
  h('span', { className: 'dsas-badge dsas-code', key: 'version' }, version),
10559
10609
  ]),
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.0'
29
+ export const STUDIO_VERSION = '0.5.2'
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-delete-turn host half (dsh-delete-turn.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-delete-turn/src/index.js (v0.2.0, sha256 5dfc53e5c47750f5)
3
+ // Source: ../dsh-delete-turn/src/index.js (v0.2.1, sha256 5dfc53e5c47750f5)
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-delete-turn host half (dsh-delete-turn.logic.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-delete-turn/src/logic.js (v0.2.0, sha256 6da16435446356ca)
3
+ // Source: ../dsh-delete-turn/src/logic.js (v0.2.1, sha256 6da16435446356ca)
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-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.14, sha256 05cfe37224f79543)
3
+ // Source: ../dsh-edit-turn/lib/index.js (v0.5.15, sha256 c743b82073d1ca1a)
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.14'
88
+ export const PLUGIN_VERSION = '0.5.15'
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.14, sha256 5e1e8cce1d168f6c)
3
+ // Source: ../dsh-edit-turn/lib/patch.js (v0.5.15, 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.5.0, sha256 3aa1fdcbb120ab06)
3
+ // Source: ../dsh-log-trim/lib/flatten.js (v0.5.1, 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.host-libs.mjs), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-log-trim/lib/host-libs.mjs (v0.5.0, sha256 5ebed01988b5bfcf)
3
+ // Source: ../dsh-log-trim/lib/host-libs.mjs (v0.5.1, 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.5.0, sha256 f8f01a5f2ae2ca7b)
3
+ // Source: ../dsh-log-trim/lib/index.js (v0.5.1, sha256 bd4d3c438d7c00ba)
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
@@ -42,7 +42,7 @@ import { applyFlatten, applyLossless, applyStreamOnly, planLossless, applyRebuil
42
42
 
43
43
  export const name = 'dsh-log-trim'
44
44
  export const PLUGIN_ID = name
45
- export const PLUGIN_VERSION = '0.5.0'
45
+ export const PLUGIN_VERSION = '0.5.1'
46
46
  export const ROUTE_PREFIX = '/api/dsh-log-trim'
47
47
 
48
48
  /**
@@ -1032,11 +1032,47 @@ function isLoopback(req) {
1032
1032
  * @param {object} ctx - 插件上下文。
1033
1033
  * @param {object} [config] - 用户配置。
1034
1034
  */
1035
+
1036
+ /**
1037
+ * 本机是否同时装了独立的本插件与内嵌了它的聚合包(`dsh-as-aistudio`)。
1038
+ *
1039
+ * 两份会各跑一次启动扫描:都能看见对方的 `.precompact-` 备份,也能同时改写同一份日志。
1040
+ * 这不是错误,是需要提醒的配置。
1041
+ *
1042
+ * @param {string} [home] - 家目录(测试用)。
1043
+ * @returns {boolean} 同时装了就是 true。
1044
+ */
1045
+ export function duplicateStudioInstall(home = os.homedir()) {
1046
+ const profiles = path.join(home, '.dsh', 'profiles')
1047
+ let names = []
1048
+ try {
1049
+ names = fs.readdirSync(profiles)
1050
+ } catch {
1051
+ return false
1052
+ }
1053
+ for (const name of names) {
1054
+ let manifest
1055
+ try {
1056
+ manifest = JSON.parse(fs.readFileSync(path.join(profiles, name, 'package.json'), 'utf8'))
1057
+ } catch {
1058
+ continue
1059
+ }
1060
+ const bundles = Array.isArray(manifest?.dsh?.profile?.bundles) ? manifest.dsh.profile.bundles : []
1061
+ if (bundles.includes('dsh-log-trim') && bundles.includes('dsh-as-aistudio')) return true
1062
+ }
1063
+ return false
1064
+ }
1065
+
1035
1066
  export function apply(ctx, config = {}) {
1036
1067
  // The card can change these while the host runs, so the resolved values live in
1037
1068
  // a box the routes can replace instead of a frozen const.
1038
1069
  let resolved = resolveConfig({ ...config, ...readSavedConfig() })
1039
1070
  const state = { last: null, running: false }
1071
+ // 双份安装:聚合包里已经内嵌了一份裁剪器,再单装一份会各跑一遍启动扫描。
1072
+ const duplicate = duplicateStudioInstall()
1073
+ if (duplicate && typeof ctx.logger?.warn === 'function') {
1074
+ ctx.logger.warn('[dsh-log-trim] 检测到同时安装了 dsh-as-aistudio(内置本插件):两份会各跑一次启动扫描,建议只留一份')
1075
+ }
1040
1076
 
1041
1077
  // A session the GUI has open cannot be rewritten (the host holds its lock).
1042
1078
  // The moment one closes it becomes writable, so the deferred work happens
@@ -1150,7 +1186,7 @@ export function apply(ctx, config = {}) {
1150
1186
  return
1151
1187
  }
1152
1188
  res.setHeader('content-type', 'application/json; charset=utf-8')
1153
- res.end(JSON.stringify({ ok: true, version: PLUGIN_VERSION, config: resolved, running: state.running, last: state.last }, null, 2))
1189
+ res.end(JSON.stringify({ ok: true, version: PLUGIN_VERSION, config: resolved, running: state.running, last: state.last, duplicateStudio: duplicate }, null, 2))
1154
1190
  },
1155
1191
  }),
1156
1192
  )
@@ -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.5.0, sha256 adf9bf5d79aa41b0)
3
+ // Source: ../dsh-log-trim/lib/lossless.js (v0.5.1, sha256 adf9bf5d79aa41b0)
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.5.0, sha256 028d9c12a395aaab)
3
+ // Source: ../dsh-log-trim/lib/roots.js (v0.5.1, 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.5.0, sha256 2c1c819e732c9649)
3
+ // Source: ../dsh-log-trim/lib/vendor.compact-session.mjs (v0.5.1, sha256 2c1c819e732c9649)
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.5.0, sha256 6a0527e8483fb252)
3
+ // Source: ../dsh-log-trim/lib/verify-session-log.mjs (v0.5.1, sha256 6a0527e8483fb252)
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-rerun-turn host half (dsh-rerun-turn.js), VENDORED by tools/vendor.mjs - DO NOT EDIT.
2
2
  //
3
- // Source: ../dsh-rerun-turn/lib/index.js (v0.2.7, sha256 9f163488f55fb398)
3
+ // Source: ../dsh-rerun-turn/lib/index.js (v0.2.8, sha256 9490939d26c589e3)
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
@@ -90,7 +90,7 @@ export const PLUGIN_ID = 'dsh-rerun-turn'
90
90
  export const name = PLUGIN_ID
91
91
 
92
92
  /** Keep in sync with package.json and lib/client.js. */
93
- export const PLUGIN_VERSION = '0.2.7'
93
+ export const PLUGIN_VERSION = '0.2.8'
94
94
 
95
95
  const ROUTE_PREFIX = '/dsh-rerun-turn'
96
96
  // A session id is an OPAQUE string to DSH: the host's own schema is
@@ -1,7 +1,7 @@
1
1
  {
2
- "dsh-edit-turn": "0.5.14",
3
- "dsh-rerun-turn": "0.2.7",
4
- "dsh-delete-turn": "0.2.0",
2
+ "dsh-edit-turn": "0.5.15",
3
+ "dsh-rerun-turn": "0.2.8",
4
+ "dsh-delete-turn": "0.2.1",
5
5
  "dsh-markdown-bubble": "0.1.5",
6
- "dsh-log-trim": "0.5.0"
6
+ "dsh-log-trim": "0.5.1"
7
7
  }