@maxbill/dsh-file-explorer 0.0.0-stage → 1.0.1
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/LICENSE +201 -0
- package/README.en.md +248 -0
- package/README.md +249 -2
- package/assets/icon-180.png +0 -0
- package/assets/icons/archive.svg +5 -0
- package/assets/icons/audio.svg +5 -0
- package/assets/icons/excel.svg +5 -0
- package/assets/icons/file-outline.svg +4 -0
- package/assets/icons/folder.svg +4 -0
- package/assets/icons/image.svg +6 -0
- package/assets/icons/other.svg +5 -0
- package/assets/icons/pdf.svg +5 -0
- package/assets/icons/ppt.svg +5 -0
- package/assets/icons/text.svg +3 -0
- package/assets/icons/video.svg +5 -0
- package/assets/icons/word.svg +5 -0
- package/cordis.patch.yml +7 -0
- package/docs/drag-session.png +0 -0
- package/docs/editor.png +0 -0
- package/docs/grouped.png +0 -0
- package/docs/icon-view.png +0 -0
- package/docs/panel.png +0 -0
- package/docs/session-menu.png +0 -0
- package/docs/workspace-menu.png +0 -0
- package/docs/workspace-switch.png +0 -0
- package/icon.svg +5 -0
- package/lib/client.js +4492 -0
- package/lib/index.js +1676 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +65 -4
- package/screenshots.json +10 -0
- package/scripts/export-icons.mjs +85 -0
package/locale/en.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "File Explorer",
|
|
4
|
+
"description": "Browse local files inside DSH and put them to work: right-click a folder to add it as a workspace, right-click a document to attach it to the conversation — plus icon/list views, previews, draggable columns and a full context menu.",
|
|
5
|
+
"detail": "README.en.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxbill/dsh-file-explorer",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "文件管理器 — 浏览、预览并直接用起来:文件夹一键变成工作区,文档一键加进当前对话 · A file manager for DeepSeek Harness that turns folders into workspaces and documents into conversation attachments",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/index.js",
|
|
9
|
+
"./client": "./lib/client.js",
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
"./icon.svg": "./icon.svg",
|
|
12
|
+
"./locale/*.json": "./locale/*.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"lib",
|
|
16
|
+
"assets",
|
|
17
|
+
"scripts",
|
|
18
|
+
"cordis.patch.yml",
|
|
19
|
+
"icon.svg",
|
|
20
|
+
"locale",
|
|
21
|
+
"README.md",
|
|
22
|
+
"README.en.md",
|
|
23
|
+
"LICENSE",
|
|
24
|
+
"docs",
|
|
25
|
+
"screenshots.json"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"dsh",
|
|
29
|
+
"dsh-plugin",
|
|
30
|
+
"file-explorer",
|
|
31
|
+
"file-manager",
|
|
32
|
+
"文件管理器"
|
|
33
|
+
],
|
|
34
|
+
"icon": "./icon.svg",
|
|
35
|
+
"author": {
|
|
36
|
+
"name": "MaxBill",
|
|
37
|
+
"url": "https://github.com/MaxBill"
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/MaxBill/dsh-file-explorer.git"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/MaxBill/dsh-file-explorer#readme",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/MaxBill/dsh-file-explorer/issues"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"test": "node test/host-api.test.mjs"
|
|
52
|
+
},
|
|
53
|
+
"license": "Apache-2.0",
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public",
|
|
56
|
+
"registry": "https://registry.npmjs.org/"
|
|
57
|
+
},
|
|
58
|
+
"dsh": {
|
|
59
|
+
"manifestVersion": 1,
|
|
60
|
+
"bundle": {
|
|
61
|
+
"patch": "./cordis.patch.yml"
|
|
62
|
+
},
|
|
63
|
+
"client": {
|
|
64
|
+
"platform": "web"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
package/screenshots.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Writes every listing icon out as a standalone SVG file.
|
|
3
|
+
//
|
|
4
|
+
// The browser bundle keeps the artwork inline (no extra requests at runtime):
|
|
5
|
+
// SHAPES holds either a 24-grid stroke path list or { viewBox, parts } filled
|
|
6
|
+
// artwork. This script loads the bundle with a fake React and dumps the file
|
|
7
|
+
// icons into assets/icons/, so the same artwork is browsable in the repo.
|
|
8
|
+
//
|
|
9
|
+
// node scripts/export-icons.mjs
|
|
10
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
11
|
+
import { createRequire } from 'node:module';
|
|
12
|
+
import { dirname, join } from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
|
|
15
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const root = join(here, '..');
|
|
17
|
+
const require = createRequire(import.meta.url);
|
|
18
|
+
|
|
19
|
+
let impl = null;
|
|
20
|
+
globalThis.window = {
|
|
21
|
+
__ModuleLoader__: {
|
|
22
|
+
load: ({ factory }) => {
|
|
23
|
+
const React = new Proxy({}, { get: (_, key) => (key === 'Fragment' ? 'Fragment' : function noop() {}) });
|
|
24
|
+
impl = factory(() => React);
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
require(join(root, 'lib/client.js'));
|
|
30
|
+
if (!impl || !impl.SHAPES) throw new Error('client bundle did not expose SHAPES');
|
|
31
|
+
|
|
32
|
+
// shape name -> file name; only the artwork used in the file list
|
|
33
|
+
const FILES = {
|
|
34
|
+
folderFilled: 'folder',
|
|
35
|
+
fileText: 'text',
|
|
36
|
+
filePdf: 'pdf',
|
|
37
|
+
fileWord: 'word',
|
|
38
|
+
fileExcel: 'excel',
|
|
39
|
+
filePpt: 'ppt',
|
|
40
|
+
fileArchive: 'archive',
|
|
41
|
+
fileImage: 'image',
|
|
42
|
+
fileAudio: 'audio',
|
|
43
|
+
fileVideo: 'video',
|
|
44
|
+
fileOther: 'other',
|
|
45
|
+
file: 'file-outline',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const attr = (name, value) => ' ' + name + '="' + String(value).replace(/"/g, '"') + '"';
|
|
49
|
+
|
|
50
|
+
function toSvg(artwork) {
|
|
51
|
+
if (Array.isArray(artwork)) {
|
|
52
|
+
const parts = artwork.map((d) => ' <path d="' + d + '"/>');
|
|
53
|
+
return [
|
|
54
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">',
|
|
55
|
+
...parts,
|
|
56
|
+
'</svg>',
|
|
57
|
+
'',
|
|
58
|
+
].join('\n');
|
|
59
|
+
}
|
|
60
|
+
const head = [
|
|
61
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="' + artwork.viewBox + '">',
|
|
62
|
+
];
|
|
63
|
+
const body = (artwork.parts || []).map((part) => {
|
|
64
|
+
let out = ' <path';
|
|
65
|
+
out += attr('d', part.d);
|
|
66
|
+
if (part.fill) out += attr('fill', part.fill);
|
|
67
|
+
else out += ' fill="currentColor"';
|
|
68
|
+
if (part.opacity) out += attr('opacity', part.opacity);
|
|
69
|
+
if (part.fillRule) out += attr('fill-rule', part.fillRule);
|
|
70
|
+
return out + '/>';
|
|
71
|
+
});
|
|
72
|
+
return [...head, ...body, '</svg>', ''].join('\n');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const outDir = join(root, 'assets/icons');
|
|
76
|
+
mkdirSync(outDir, { recursive: true });
|
|
77
|
+
|
|
78
|
+
const written = [];
|
|
79
|
+
for (const [shape, name] of Object.entries(FILES)) {
|
|
80
|
+
const artwork = impl.SHAPES[shape];
|
|
81
|
+
if (!artwork) throw new Error('missing shape: ' + shape);
|
|
82
|
+
writeFileSync(join(outDir, name + '.svg'), toSvg(artwork));
|
|
83
|
+
written.push(name + '.svg');
|
|
84
|
+
}
|
|
85
|
+
console.log('wrote ' + written.length + ' icons to assets/icons/: ' + written.join(', '));
|