@wisdoverse/dsh-inline-media-viewer 1.0.5 → 1.0.7
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 +4 -1
- package/index.js +3 -4
- package/lib.js +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.7
|
|
4
|
+
|
|
5
|
+
- Resolve backticked media filenames against a preceding backticked directory,
|
|
6
|
+
matching the common "output directory plus file list" response format.
|
|
7
|
+
|
|
8
|
+
## 1.0.6
|
|
9
|
+
|
|
10
|
+
- Resolve workspace media from persisted session metadata when a historical
|
|
11
|
+
conversation is no longer attached to a live host session.
|
|
12
|
+
|
|
3
13
|
## 1.0.5
|
|
4
14
|
|
|
5
15
|
- Register the browser bundle under the scoped package name expected by the
|
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) => {
|
package/index.js
CHANGED
|
@@ -22,12 +22,12 @@ import { isAbsolute, resolve } from "node:path";
|
|
|
22
22
|
import z from "@deepseek-ai/schemastery";
|
|
23
23
|
import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
24
24
|
|
|
25
|
-
import { COMFY_DEFAULT_ORIGIN, MAX_BYTES, comfyUrl, isInside, mimeOf, normalizeComfyOrigin, testing } from "./lib.js";
|
|
25
|
+
import { COMFY_DEFAULT_ORIGIN, MAX_BYTES, comfyUrl, isInside, mimeOf, normalizeComfyOrigin, resolveSessionCwd, testing } from "./lib.js";
|
|
26
26
|
|
|
27
27
|
export { testing } from "./lib.js";
|
|
28
28
|
|
|
29
29
|
export const name = "dsh-inline-media-viewer";
|
|
30
|
-
export const inject = ["connection", "sessions", "settings"];
|
|
30
|
+
export const inject = ["connection", "sessions", "sessionQuery", "settings"];
|
|
31
31
|
|
|
32
32
|
const CHANNEL = "/inline-media";
|
|
33
33
|
const ENDPOINT = "read";
|
|
@@ -119,8 +119,7 @@ async function readRemote(source, signal, settingsValue) {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
async function readLocal(ctx, source, sessionId) {
|
|
122
|
-
const
|
|
123
|
-
const cwd = session?.header?.cwd;
|
|
122
|
+
const cwd = await resolveSessionCwd(ctx.sessions, ctx.sessionQuery, sessionId);
|
|
124
123
|
if (!cwd) throw new Error("session working directory is unavailable");
|
|
125
124
|
const mime = mimeOf(source);
|
|
126
125
|
if (!mime) throw new Error("unsupported media extension");
|
package/lib.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* dsh-inline-media-viewer —
|
|
2
|
+
* dsh-inline-media-viewer — dependency-free helpers.
|
|
3
3
|
*
|
|
4
4
|
* This module has NO runtime dependencies: unit tests and reviewers can import
|
|
5
5
|
* it anywhere. Integration concerns (RPC channel, settings registration) live
|
|
@@ -79,6 +79,11 @@ export function isInside(root, target) {
|
|
|
79
79
|
return rel === "" || (!isAbsolute(rel) && rel !== ".." && !rel.startsWith(`..${sep}`));
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
export async function resolveSessionCwd(sessions, sessionQuery, sessionId) {
|
|
83
|
+
const live = sessions.get(sessionId);
|
|
84
|
+
return live ? live.header.cwd : (await sessionQuery.readSession(sessionId)).session.cwd;
|
|
85
|
+
}
|
|
86
|
+
|
|
82
87
|
/**
|
|
83
88
|
* Parse a user-configured ComfyUI address into a canonical origin URL.
|
|
84
89
|
*
|
|
@@ -175,4 +180,5 @@ export const testing = Object.freeze({
|
|
|
175
180
|
isInside,
|
|
176
181
|
mimeOf,
|
|
177
182
|
normalizeComfyOrigin,
|
|
183
|
+
resolveSessionCwd,
|
|
178
184
|
});
|
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.7",
|
|
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",
|