dsh-rewind-plugin 0.15.2 → 0.15.3

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/lib/client.js CHANGED
@@ -1359,9 +1359,9 @@ function createRewindBridge(deps) {
1359
1359
  }
1360
1360
 
1361
1361
  // src/client/build-info.ts
1362
- var PLUGIN_VERSION = true ? "0.15.2" : "dev";
1362
+ var PLUGIN_VERSION = true ? "0.15.3" : "dev";
1363
1363
  var PLUGIN_PACKAGE = "dsh-rewind-plugin";
1364
- var BUILD_HASH = true ? "75d20acc" : "dev";
1364
+ var BUILD_HASH = true ? "f36f8be8" : "dev";
1365
1365
 
1366
1366
  // src/client/locales.ts
1367
1367
  var zh = {
@@ -1586,10 +1586,10 @@ function apply(ctx) {
1586
1586
  };
1587
1587
  const restoreImages = async (sessionId, images) => {
1588
1588
  if (images.length === 0) return;
1589
- const ui = uiConversation();
1589
+ const session = sessionOf(sessionId);
1590
1590
  const conversation = ctx.get("conversation");
1591
1591
  const scope = ctx.sessions.scope?.(sessionId);
1592
- if (ui?.imageUrl === void 0 || conversation?.input === void 0 || conversation.createDrafts === void 0 || scope === void 0) {
1592
+ if (session === void 0 || conversation?.input === void 0 || conversation.createDrafts === void 0 || scope === void 0) {
1593
1593
  rewindLog.warn("refill", "image restore unavailable (conversation services not ready)");
1594
1594
  return;
1595
1595
  }
@@ -1601,11 +1601,12 @@ function apply(ctx) {
1601
1601
  continue;
1602
1602
  }
1603
1603
  try {
1604
- const url = await ui.imageUrl(sessionId, ref);
1605
- const blob = await (await fetch(url)).blob();
1606
- files.push(new File([blob], ref.name ?? `image-${index + 1}.${extension}`, { type: ref.mediaType }));
1604
+ const result = await session.readAttachment(ref.attachmentId);
1605
+ if (!result.ok) throw result.error;
1606
+ const bytes = result.value.data;
1607
+ files.push(new File([bytes], ref.name ?? `image-${index + 1}.${extension}`, { type: ref.mediaType }));
1607
1608
  } catch (error) {
1608
- rewindLog.warn("refill", `image fetch threw for ${ref.attachmentId}`, error);
1609
+ rewindLog.warn("refill", `image read threw for ${ref.attachmentId}`, error);
1609
1610
  }
1610
1611
  }
1611
1612
  if (files.length === 0) return;
@@ -1,26 +1,20 @@
1
1
  /**
2
- * Session-cwd resolution for snapshot tracking reads, mirroring the fs tools'
3
- * own rule (`@deepseek-ai/dsh-tool-fs/session-cwd.ts`): relative paths
4
- * resolve against the calling agent's session workspace
5
- * (`exec.agent.session.header.cwd`), not the server's launch dir.
6
- *
7
- * Pure functions: the session cwd is returned verbatim. The fs tools no longer
8
- * canonicalize a parent-traversing cwd (alpha line), so neither does the
9
- * plugin — snapshot tracking must resolve to the same base the tool wrote to.
2
+ * Session-cwd resolution for snapshot tracking reads: relative paths resolve
3
+ * against the calling agent's session workspace (`exec.agent.session.header.cwd`),
4
+ * returned verbatim — no canonicalization — or `undefined` when the session has
5
+ * none (the filesystem backend then applies its own default base).
10
6
  *
11
7
  * @module dsh-rewind/session-cwd
12
8
  */
13
9
  import type { ToolExecution } from '@deepseek-ai/dsh-tools';
14
10
  /**
15
- * The session workspace cwd to resolve a requested path against, or undefined
16
- * when no session cwd applies (the filesystem backend then uses its own
17
- * default base).
11
+ * The session workspace cwd to resolve a requested path against.
18
12
  * @param cwd - the session's `header.cwd`, if any.
19
- * @returns the cwd unchanged.
13
+ * @returns the cwd unchanged, or undefined when there is none.
20
14
  */
21
15
  export declare function sessionCwd(cwd: string | undefined): string | undefined;
22
16
  /**
23
- * Session cwd for one tool execution (same rule as the fs tools).
17
+ * Session cwd for one tool execution.
24
18
  * @param exec - the tool-execution context; only its optional `agent` is read.
25
19
  * @returns the calling agent's session cwd, or undefined for a non-agent caller.
26
20
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-rewind-plugin",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "In-window conversation rewind with workspace file restore · 同窗口内对话回退并可还原工作区文件",
5
5
  "icon": "./assets/icon.svg",
6
6
  "keywords": [