@wisdoverse/dsh-inline-media-viewer 1.0.6 → 1.0.8
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 +10 -0
- package/client/client.js +8 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.8
|
|
4
|
+
|
|
5
|
+
- Preserve output-directory context across assistant steps in one turn, so a
|
|
6
|
+
later final answer containing only media filenames still renders previews.
|
|
7
|
+
|
|
8
|
+
## 1.0.7
|
|
9
|
+
|
|
10
|
+
- Resolve backticked media filenames against a preceding backticked directory,
|
|
11
|
+
matching the common "output directory plus file list" response format.
|
|
12
|
+
|
|
3
13
|
## 1.0.6
|
|
4
14
|
|
|
5
15
|
- Resolve workspace media from persisted session metadata when a historical
|
package/client/client.js
CHANGED
|
@@ -79,6 +79,7 @@ window.__ModuleLoader__.load({
|
|
|
79
79
|
function extractCandidates(text) {
|
|
80
80
|
const found = [];
|
|
81
81
|
const seen = new Set();
|
|
82
|
+
let directory = "";
|
|
82
83
|
const add = (raw) => {
|
|
83
84
|
const source = cleanCandidate(raw);
|
|
84
85
|
const kind = mediaKind(source);
|
|
@@ -92,7 +93,9 @@ window.__ModuleLoader__.load({
|
|
|
92
93
|
return " ".repeat(match.length);
|
|
93
94
|
});
|
|
94
95
|
plain = plain.replace(/`([^`\n]+)`/g, (match, source) => {
|
|
95
|
-
|
|
96
|
+
const value = cleanCandidate(source);
|
|
97
|
+
if (/[/\\]$/.test(value)) directory = value;
|
|
98
|
+
else add(directory && !/[/\\]/.test(value) ? `${directory}${value}` : value);
|
|
96
99
|
return " ".repeat(match.length);
|
|
97
100
|
});
|
|
98
101
|
plain = plain.replace(/https?:\/\/[^\s<>"'`]+/gi, (source) => {
|
|
@@ -112,22 +115,15 @@ window.__ModuleLoader__.load({
|
|
|
112
115
|
function selectMedia(owner) {
|
|
113
116
|
const settings = readSettings();
|
|
114
117
|
if (!settings.autoRender) return null;
|
|
115
|
-
const
|
|
116
|
-
const seen = new Set();
|
|
118
|
+
const text = [];
|
|
117
119
|
for (const step of owner.turn.steps) {
|
|
118
120
|
const assistant = step.data.get("assistant-step");
|
|
119
121
|
if (!assistant || !assistant.finalNode || assistant.finalNode.seq > owner.seq || !Array.isArray(assistant.blocks)) continue;
|
|
120
|
-
|
|
122
|
+
text.push(...assistant.blocks
|
|
121
123
|
.filter((block) => block && block.kind === "text" && typeof block.text === "string")
|
|
122
|
-
.map((block) => block.text)
|
|
123
|
-
.join("\n");
|
|
124
|
-
for (const candidate of extractCandidates(text)) {
|
|
125
|
-
if (seen.has(candidate.source)) continue;
|
|
126
|
-
seen.add(candidate.source);
|
|
127
|
-
candidates.push(candidate);
|
|
128
|
-
if (candidates.length === settings.displayCap) return candidates;
|
|
129
|
-
}
|
|
124
|
+
.map((block) => block.text));
|
|
130
125
|
}
|
|
126
|
+
const candidates = extractCandidates(text.join("\n")).slice(0, settings.displayCap);
|
|
131
127
|
return candidates.length === 0 ? null : candidates;
|
|
132
128
|
}
|
|
133
129
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wisdoverse/dsh-inline-media-viewer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Persistent inline image, video, and audio previews for DeepSeek Harness Web conversations, with workspace-confined local reads and an optional ComfyUI proxy.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|