@maxbill/dsh-file-explorer 0.0.0-stage → 1.1.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/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
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "文件管理器",
4
+ "description": "在 DSH 里浏览本机文件,并且接着用起来:文件夹右键「添加为工作区」,文档右键「添加到会话」,另有图标/列表视图、预览、可拖拽列宽与完整右键菜单。",
5
+ "detail": "README.md"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "@maxbill/dsh-file-explorer",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.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
+ }
@@ -0,0 +1,10 @@
1
+ [
2
+ "docs/panel.png",
3
+ "docs/icon-view.png",
4
+ "docs/grouped.png",
5
+ "docs/editor.png",
6
+ "docs/workspace-menu.png",
7
+ "docs/session-menu.png",
8
+ "docs/drag-session.png",
9
+ "docs/workspace-switch.png"
10
+ ]
@@ -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(', '));