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 +9 -8
- package/lib/types/session-cwd.d.ts +7 -13
- package/package.json +1 -1
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.
|
|
1362
|
+
var PLUGIN_VERSION = true ? "0.15.3" : "dev";
|
|
1363
1363
|
var PLUGIN_PACKAGE = "dsh-rewind-plugin";
|
|
1364
|
-
var BUILD_HASH = true ? "
|
|
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
|
|
1589
|
+
const session = sessionOf(sessionId);
|
|
1590
1590
|
const conversation = ctx.get("conversation");
|
|
1591
1591
|
const scope = ctx.sessions.scope?.(sessionId);
|
|
1592
|
-
if (
|
|
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
|
|
1605
|
-
|
|
1606
|
-
|
|
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
|
|
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
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* (
|
|
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
|
|
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
|
|
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
|
*/
|