dsh-as-aistudio 0.4.4 → 0.4.5

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.5** —— `/state` 再提速(跟进 `dsh-edit-turn` 0.5.11)。
8
+
9
+ - **组件跟进**:`dsh-edit-turn` **0.5.11**、`dsh-rerun-turn` 0.2.6、`dsh-delete-turn` 0.1.15、`dsh-markdown-bubble` 0.1.5。
10
+
11
+ - 回复列表不再构建分块:同一个会话 **2,227 ms → 29 ms**(中间数据 22.4 MB → 1.1 MB)。编辑笔的出现不再等这一下。
12
+
7
13
  **0.4.4** —— 复制失败的诊断(跟进 `dsh-edit-turn` 0.5.10)。
8
14
 
9
15
  - **组件跟进**:`dsh-edit-turn` **0.5.10**(另三个不变:`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.4",
3
+ "version": "0.4.5",
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.10'
46
+ const PLUGIN_VERSION = '0.5.11'
47
47
 
48
48
  // --- copy -----------------------------------------------------------------
49
49
 
@@ -9224,7 +9224,7 @@ window.__ModuleLoader__.load({
9224
9224
  const NS = 'dsh-as-aistudio'
9225
9225
 
9226
9226
  /** Keep in sync with package.json and src/components.js. */
9227
- const PLUGIN_VERSION = '0.4.4'
9227
+ const PLUGIN_VERSION = '0.4.5'
9228
9228
 
9229
9229
  /** Presence marker the live verifier reads. */
9230
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.4'
29
+ export const STUDIO_VERSION = '0.4.5'
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.10, sha256 8bfd50c80995d96e)
3
+ // Source: ../dsh-edit-turn/lib/index.js (v0.5.11, sha256 bd1a9f8f275c3c0f)
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.10'
88
+ export const PLUGIN_VERSION = '0.5.11'
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
@@ -1312,6 +1312,11 @@ export function editableReplies(events, surfaceNodes, options = {}) {
1312
1312
  const head = surfaceNodes[0]
1313
1313
  const patches = options.patches instanceof Map ? options.patches : new Map()
1314
1314
  const patch = options.patch === true
1315
+ // `/state` publishes identities only, so the blocks never leave this function.
1316
+ // Skipping them also skips the per-turn widening below, which walks every reply
1317
+ // of the same turn for every reply: that widening is what made one refresh of a
1318
+ // long session take seconds.
1319
+ const light = options.light === true
1315
1320
  const out = []
1316
1321
  for (const event of events) {
1317
1322
  if (!isAssistantReply(event)) continue
@@ -1331,7 +1336,7 @@ export function editableReplies(events, surfaceNodes, options = {}) {
1331
1336
  // text of that turn is offered, each annotated with the seq it lives in.
1332
1337
  let listed = blocks.map((block) => ({ ...block, seq: event.seq }))
1333
1338
  const carriesAnswer = blocks.some((block) => block.kind === 'text' && block.text.trim() !== '')
1334
- if (patch && carriesAnswer && typeof turn === 'number') {
1339
+ if (!light && patch && carriesAnswer && typeof turn === 'number') {
1335
1340
  const acrossTurn = []
1336
1341
  for (const other of events) {
1337
1342
  if (!isAssistantReply(other) || turnOf.get(other.seq) !== turn) continue
@@ -1345,6 +1350,7 @@ export function editableReplies(events, surfaceNodes, options = {}) {
1345
1350
  if (acrossTurn.length > listed.length) listed = acrossTurn
1346
1351
  }
1347
1352
  out.push({
1353
+ ...(light ? {} : { blocks: listed }),
1348
1354
  seq: event.seq,
1349
1355
  turn: typeof turn === 'number' ? turn : null,
1350
1356
  messageId: messageIdOf(event) ?? null,
@@ -1785,7 +1791,7 @@ async function stateOf(ctx, sessionId, config) {
1785
1791
  // editor promising to keep blocks the host would have to drop.
1786
1792
  const store = resolveAttachmentStore(ctx)
1787
1793
  const turns = editableTurns(events, folded.nodes, { preview: canPreviewAttachments(store) })
1788
- const replies = editableReplies(events, folded.nodes, { patches, patch: config.patch === true }).map(lightReply)
1794
+ const replies = editableReplies(events, folded.nodes, { patches, patch: config.patch === true, light: true }).map(lightReply)
1789
1795
  noteRequest({
1790
1796
  kind: 'state',
1791
1797
  sessionId,
@@ -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.10, sha256 5e1e8cce1d168f6c)
3
+ // Source: ../dsh-edit-turn/lib/patch.js (v0.5.11, 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.10",
2
+ "dsh-edit-turn": "0.5.11",
3
3
  "dsh-rerun-turn": "0.2.6",
4
4
  "dsh-delete-turn": "0.1.15",
5
5
  "dsh-markdown-bubble": "0.1.5"