@dsh-xhl/dsh-file-explorer 0.1.7 → 0.1.9

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/README.md CHANGED
@@ -5,12 +5,14 @@
5
5
  ## 功能
6
6
 
7
7
  - **聊天页标题栏图标**(`conversation.session.header.utilities`):一个内置编辑器图标,点击打开文件预览 / 编辑弹窗(聊天页保持与现状一致,无下拉)
8
- - **Hero / 新建会话页 ButtonGroup**:同一浮层位置由插件定位到会话列右上角(hero 阶段显示,有记录后由标题栏图标接管,无重复);hero 上为**左主按钮 + 右下拉**的组合:
8
+ - **Hero / 新建会话页 ButtonGroup**:通过 `@dsh-xhl/dsh-hero-flex` 插件声明的
9
+ `hero.flex` 槽位渲染(**未安装该插件则不显示**);hero 上为**左主按钮 +
10
+ 右下拉**的组合:
9
11
  - **编辑器**(默认):点击打开文件预览 / 编辑弹窗(Ctrl+P 亦可)
10
12
  - **文件夹**:点击直接打开会话工作区所在的**系统文件夹**(Windows `explorer` / macOS `open` / Linux `xdg-open`)
11
13
  - **VSCode**:点击用 `code` 命令行在 **VS Code** 中打开会话工作区(自动探测安装位置 / PATH;宿主明确报告未安装时该项自动隐藏,探测请求本身失败则保持可见并退避重试)
12
14
  - 选择记忆在 localStorage,点击后底部提示确认打开的路径;下拉选中某项会先切换默认打开方式,随后立即执行对应的打开动作
13
- - 纯插件实现,不改动框架代码(详见 `docs/hero-filex-button.md`)
15
+ - 纯插件实现,不改动框架代码;hero 按钮组渲染依赖独立插件 `@dsh-xhl/dsh-hero-flex`(详见 `docs/hero-filex-button.md`)
14
16
  - **对话内点击文件 → 编辑器预览**:聊天里的文件路径链接(工具行、产物行、正文提及)默认用系统程序打开;插件拦截 `remote.session.openWorkspacePath` 与 `workspaces.openPath` 两条通道,改为在编辑器弹窗中预览(目录或 cwd 外的路径仍落回系统打开)
15
17
  - **文件列表**:左侧目录树(跳过 `node_modules`/`.git`/`dist` 等)
16
18
  - **按文件名过滤**:输入即过滤
@@ -28,7 +30,7 @@ src/
28
30
  + /filex/file 媒体路由(图片/PDF 字节),loopback 信任围栏
29
31
  trust-fence.ts Host-header loopback 校验(DNS-rebinding 防护)
30
32
  client/
31
- index.tsx 入口:聊天页 header 图标(内置编辑器)+ hero 模式 ButtonGroup + overlay 弹窗 + Ctrl+P 快捷键
33
+ index.tsx 入口:聊天页 header 图标(内置编辑器)+ hero 模式 ButtonGroup(hero.flex 槽位)+ overlay 弹窗 + Ctrl+P 快捷键
32
34
  Explorer.tsx 弹窗:文件树 / 文件名过滤 / 全文搜索 / 查看器分派(primitives 重排)
33
35
  TextEditor.tsx CodeMirror 6 编辑器 + 搜索跳转高亮
34
36
  lang.ts 扩展名 → CodeMirror 语言映射
package/lib/client.js CHANGED
@@ -37014,29 +37014,24 @@ window.__ModuleLoader__.load({
37014
37014
  */
37015
37015
  const CSS = `
37016
37016
  /* ── header icon (utilities slot) ────────────────────────────────────── */
37017
- /* Same 28×28 round button as dsh-git-gui's header entry (.gg-header-btn):
37018
- the primitive sm button is already 28px tall with a 16px icon, so only
37019
- the width / padding / radius need pinning down. */
37020
- .filex-header-btn{width:28px;height:28px;padding:0;border-radius:14px}
37017
+ /* Same 28×28 header entry as dsh-git-gui's (.gg-header-btn) but with a
37018
+ modest rounded-rectangle corner: the primitive sm button is already 28px
37019
+ tall with a 16px icon, so only the width / padding / radius need pinning
37020
+ down. An 8px radius keeps it a rounded square rather than a full circle. */
37021
+ .filex-header-btn{width:28px;height:28px;padding:0;border-radius:8px}
37021
37022
 
37022
- /* ── hero ButtonGroup (shell.overlay entry) ──────────────────────────── */
37023
- /* The mode group shown only on the hero / new-session screen: the left
37023
+ /* ── hero ButtonGroup (hero.flex slot entry) ─────────────────────────── */
37024
+ /* The mode group shown on the hero / blank-session screen: the left
37024
37025
  button carries the remembered mode's icon, the right chevron the mode
37025
- dropdown. Outer corners reuse the in-chat header-button radius (14px on
37026
- a 28px-tall button = a fully round cap), so the group reads as one pill
37027
- with the same curve as the session header icon. */
37026
+ dropdown. Outer corners use the same rounded-rectangle radius as the
37027
+ header buttons (8px on a 28px-tall button), so the group reads as one
37028
+ pill consistent with the session header icons. The host is the
37029
+ dsh-hero-flex plugin's hf-row (its own stylesheet); this sheet only
37030
+ styles the group itself. */
37028
37031
  .filex-group{display:inline-flex;align-items:center;position:relative;height:28px}
37029
37032
  .filex-group .filex-group-main,.filex-group .filex-group-trigger{height:28px}
37030
- .filex-group .filex-group-main{border-radius:14px 0 0 14px;padding:0 9px}
37031
- .filex-group .filex-group-trigger{margin-left:-1px;border-radius:0 14px 14px 0;border-left:0;padding:0 7px}
37032
-
37033
- /* ── hero floating utility (shell.overlay entry) ─────────────────────── */
37034
- /* The ButtonGroup, pinned by the plugin to the conversation column's
37035
- top-right while the column is in its hero phase. The shell.overlay layer
37036
- is click-through by design, so the entry opts back into pointer events;
37037
- no explicit z-index keeps it below sibling overlay entries (modal,
37038
- notices) and any body-portaled popup. */
37039
- .filex-hero-fab{position:fixed;pointer-events:auto}
37033
+ .filex-group .filex-group-main{border-radius:8px 0 0 8px;padding:0 9px}
37034
+ .filex-group .filex-group-trigger{margin-left:-1px;border-radius:0 8px 8px 0;border-left:0;padding:0 7px}
37040
37035
 
37041
37036
  /* ── transient notice strip ──────────────────────────────────────────── */
37042
37037
  .filex-notice{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:2147483003;display:flex;align-items:center;gap:10px;max-width:70vw;padding:9px 14px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--dsw-alias-state-warn-primary,#f59e0b);background:var(--dsw-alias-bg-layer-2,#1b1b22);border:1px solid rgba(245,158,11,.5);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.45);pointer-events:auto}
@@ -38059,19 +38054,17 @@ window.__ModuleLoader__.load({
38059
38054
  *
38060
38055
  * The in-chat session header (`conversation.session.header.utilities`) keeps
38061
38056
  * a single built-in-editor icon: clicking it opens the file-explorer modal
38062
- * (preview / edit). The hero / new-session floating utility rendered by the
38063
- * plugin itself through the generic `shell.overlay` layer carries the full
38064
- * ButtonGroup — the left button performs the remembered open action
38065
- * (内置编辑器 / 系统文件夹 / VS Code) and the right chevron opens a dropdown
38066
- * to switch between them. Selecting an entry both persists it as the new
38067
- * default and immediately runs that action.
38057
+ * (preview / edit).
38068
38058
  *
38069
- * The floating entry pins itself to the conversation column's top-right
38070
- * while the column is in its hero phase — the no-session hero and the
38071
- * blank-session (new chat) hero, where the session header and its utilities
38072
- * seat are absent or deliberately hidden. It resolves its session itself:
38073
- * the actions fall back to the live selection (`useSessions` →
38074
- * `state.current`) and show a notice when none exists.
38059
+ * The hero / blank-session open-actions ButtonGroup (编辑器 / 系统文件夹 /
38060
+ * VS Code) renders ONLY through the `hero.flex` slot declared by the
38061
+ * dsh-hero-flex plugin, which owns the header's corner seat at priority -1
38062
+ * and hosts the additive flex row beside the right-sidebar expand button.
38063
+ * Without dsh-hero-flex installed the ButtonGroup does not render at all —
38064
+ * this plugin no longer occupies the corner seat nor floats a fallback
38065
+ * overlay. The left button performs the remembered open action and the right
38066
+ * chevron opens a dropdown to switch between them; selecting an entry both
38067
+ * persists it as the new default and immediately runs that action.
38075
38068
  *
38076
38069
  * Session binding: every /filex request is conversation-scoped, so the modal
38077
38070
  * must know WHICH session it belongs to — the host resolves the workspace
@@ -38196,6 +38189,20 @@ window.__ModuleLoader__.load({
38196
38189
  };
38197
38190
  emit();
38198
38191
  }
38192
+ /**
38193
+ * Resolve the session's authoritative working directory from the host
38194
+ * (`session.cwd` reads the session header), falling back to the framework
38195
+ * session-list hint only when the host round-trip fails. This keeps
38196
+ * reveal / vscode pointing at the session's own workspace even when the
38197
+ * session-list snapshot carries no cwd for the bound session.
38198
+ */
38199
+ async function resolveCwdHint(sessionId, fallback) {
38200
+ try {
38201
+ const result = await api.sessionCwd({ sessionId });
38202
+ if (result.cwd !== "") return result.cwd;
38203
+ } catch {}
38204
+ return fallback;
38205
+ }
38199
38206
  /** Ask the host to reveal the session's working folder in the OS file manager. */
38200
38207
  async function openSystemFolder(sessionId, cwd) {
38201
38208
  const resolved = sessionId !== void 0 && sessionId !== "" ? sessionId : activeSessionId;
@@ -38204,7 +38211,8 @@ window.__ModuleLoader__.load({
38204
38211
  return;
38205
38212
  }
38206
38213
  try {
38207
- showNotice(`已打开文件夹:${(await api.fsReveal({ sessionId: resolved }, cwd)).cwd}`);
38214
+ const hint = await resolveCwdHint(resolved, cwd);
38215
+ showNotice(`已打开文件夹:${(await api.fsReveal({ sessionId: resolved }, hint)).cwd}`);
38208
38216
  } catch (error) {
38209
38217
  showNotice(`打开系统文件夹失败:${error instanceof Error ? error.message : String(error)}`);
38210
38218
  }
@@ -38217,7 +38225,8 @@ window.__ModuleLoader__.load({
38217
38225
  return;
38218
38226
  }
38219
38227
  try {
38220
- showNotice(`已在 VS Code 打开:${(await api.fsVscode({ sessionId: resolved }, cwd)).cwd}`);
38228
+ const hint = await resolveCwdHint(resolved, cwd);
38229
+ showNotice(`已在 VS Code 打开:${(await api.fsVscode({ sessionId: resolved }, hint)).cwd}`);
38221
38230
  } catch (error) {
38222
38231
  showNotice(`用 VS Code 打开失败:${error instanceof Error ? error.message : String(error)}`);
38223
38232
  }
@@ -38320,15 +38329,20 @@ window.__ModuleLoader__.load({
38320
38329
  }
38321
38330
  /**
38322
38331
  * The hero ButtonGroup: the left button carries the remembered mode's icon and
38323
- * runs its action, the right chevron opens the mode dropdown. Rendered only on
38324
- * the hero / new-session screen — the in-chat header keeps the single
38325
- * built-in-editor `HeaderIcon`.
38332
+ * runs its action, the right chevron opens the mode dropdown. Rendered only
38333
+ * through the `hero.flex` slot declared by the dsh-hero-flex plugin (hero /
38334
+ * blank-session header) — the in-chat header keeps the single built-in-editor
38335
+ * `HeaderIcon`.
38336
+ *
38337
+ * `sessionId` comes from the slot's session standard kit; without it the
38338
+ * actions fall back to the live selection (`useSessions` → `state.current`)
38339
+ * and show a notice when none exists.
38326
38340
  */
38327
38341
  function HeroGroup(props) {
38328
38342
  const state = (0, react.useSyncExternalStore)(subscribe, getSnapshot);
38329
38343
  const [menuOpen, setMenuOpen] = (0, react.useState)(false);
38330
38344
  const useSessions = props.useSessions ?? (() => void 0);
38331
- const sessionId = useSessions((s) => s.current);
38345
+ const sessionId = props.sessionId;
38332
38346
  const sessionCwd = useSessions((s) => sessionId !== void 0 ? s.byId?.[sessionId]?.cwd : void 0);
38333
38347
  const mode = state.mode;
38334
38348
  const items = state.vscode ? MODE_ITEMS : MODE_ITEMS.filter((item) => item.id !== "vscode");
@@ -38388,58 +38402,6 @@ window.__ModuleLoader__.load({
38388
38402
  })
38389
38403
  });
38390
38404
  }
38391
- /**
38392
- * Hero / new-session floating utility: the hero ButtonGroup, rendered by the
38393
- * plugin itself through the generic `shell.overlay` floating layer (no shell
38394
- * change needed) and pinned to the conversation column's top-right corner —
38395
- * the spot where the session-header utilities sit once a conversation has
38396
- * records. Shown only while the conversation column is in its `hero` phase
38397
- * (no session at all, or a blank session whose header is deliberately
38398
- * hidden); the position is measured from the rendered column root
38399
- * (`[data-phase]`), so sidebar collapse and details-panel toggles are
38400
- * tracked automatically. Clicking behaves exactly like the in-chat icon: in a
38401
- * blank-session hero the actions bind to that session, and with no session
38402
- * at all they surface the no-session notice.
38403
- */
38404
- function HeroFilexButton(props) {
38405
- const [pos, setPos] = (0, react.useState)(null);
38406
- (0, react.useEffect)(() => {
38407
- const update = () => {
38408
- const column = document.querySelector("[data-phase]");
38409
- if (column === null || column.getAttribute("data-phase") !== "hero") {
38410
- setPos(null);
38411
- return;
38412
- }
38413
- const rect = column.getBoundingClientRect();
38414
- if (rect.width === 0 || rect.height === 0) {
38415
- setPos(null);
38416
- return;
38417
- }
38418
- const top = rect.top + 14;
38419
- const right = window.innerWidth - rect.right + 28;
38420
- setPos((current) => current !== null && current.top === top && current.right === right ? current : {
38421
- top,
38422
- right
38423
- });
38424
- };
38425
- const timer = window.setInterval(update, 400);
38426
- window.addEventListener("resize", update);
38427
- update();
38428
- return () => {
38429
- window.clearInterval(timer);
38430
- window.removeEventListener("resize", update);
38431
- };
38432
- }, []);
38433
- if (pos === null) return null;
38434
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
38435
- className: "filex-hero-fab",
38436
- style: {
38437
- top: pos.top,
38438
- right: pos.right
38439
- },
38440
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeroGroup, { useSessions: props.useSessions })
38441
- });
38442
- }
38443
38405
  /** The overlay entry: keyboard shortcut + modal + transient notice. */
38444
38406
  function ExplorerOverlay(props) {
38445
38407
  const state = (0, react.useSyncExternalStore)(subscribe, getSnapshot);
@@ -38515,24 +38477,21 @@ window.__ModuleLoader__.load({
38515
38477
  order: 10,
38516
38478
  label: "文件预览 / 编辑"
38517
38479
  }, HeaderIcon));
38518
- ctx.slots.inject("shell.overlay", () => {
38519
- const overlay = ctx.slots.register({
38520
- name: "shell.overlay",
38521
- id: "file-explorer-overlay",
38522
- order: 100,
38523
- label: "文件预览"
38524
- }, ExplorerOverlay);
38525
- const heroFab = ctx.slots.register({
38526
- name: "shell.overlay",
38527
- id: "file-explorer-hero-fab",
38528
- order: 90,
38529
- label: "文件预览 / 编辑(hero)"
38530
- }, HeroFilexButton);
38531
- return () => {
38532
- overlay();
38533
- heroFab();
38534
- };
38535
- });
38480
+ ctx.slots.inject("shell.overlay", () => ctx.slots.register({
38481
+ name: "shell.overlay",
38482
+ id: "file-explorer-overlay",
38483
+ order: 100,
38484
+ label: "文件预览"
38485
+ }, ExplorerOverlay));
38486
+ ctx.slots.inject("hero.flex", () => ctx.slots.register({
38487
+ name: "hero.flex",
38488
+ id: "file-explorer",
38489
+ order: 10,
38490
+ label: "文件预览 / 编辑(hero)"
38491
+ }, (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeroGroup, {
38492
+ sessionId: props.sessionId,
38493
+ useSessions: props.useSessions
38494
+ })));
38536
38495
  probeVscode();
38537
38496
  ctx.effect(() => {
38538
38497
  const deps = {
package/lib/index.js CHANGED
@@ -134,11 +134,16 @@ function isWithin(parent, child) {
134
134
  if (c === p) return true;
135
135
  return c.startsWith(p + "\\") || c.startsWith(p + "/") || c.startsWith(p + "\\") || c.startsWith(p + "/");
136
136
  }
137
- /** Resolve a session's authoritative working directory (header cwd first, process cwd last). */
137
+ /**
138
+ * Resolve a session's authoritative working directory (header cwd first).
139
+ * A session with no workspace has no meaningful directory — falling back to
140
+ * the host process cwd (the DSH installation's home) would silently point
141
+ * file operations at the wrong tree, so this fails loudly instead.
142
+ */
138
143
  function sessionCwdOf(ctx, sessionId) {
139
144
  const headerCwd = ctx.sessions.get(sessionId)?.header.cwd;
140
145
  if (headerCwd !== void 0 && headerCwd !== "") return resolve(headerCwd);
141
- return process.cwd();
146
+ throw new FilexError("no-workspace", "该会话没有关联的工作区目录。请先为该会话选择一个工作区。", 400);
142
147
  }
143
148
  async function readJsonBody(req) {
144
149
  let raw = "";
@@ -334,15 +339,18 @@ function openInSystemFileManager(target) {
334
339
  }
335
340
  /**
336
341
  * Resolve the directory a reveal/open action should point at. Authoritative
337
- * source: the session's own header cwd. When it is absent (sessions created
338
- * without workspace metadata fall back to the host process cwd — usually
339
- * meaningless), accept the loopback-only client's session-list cwd hint so
340
- * the folder still opens where the user works.
342
+ * source: the session's own header cwd. When it is absent (a session created
343
+ * without workspace metadata), fall back to the loopback-only client's
344
+ * session-list cwd hint — and only then fail loudly, never to the host
345
+ * process cwd (which is the DSH installation's home directory and would make
346
+ * "open folder" appear to open the user's home).
341
347
  */
342
348
  function revealCwdOf(ctx, sessionId, rawHint) {
343
349
  const headerCwd = ctx.sessions.get(sessionId)?.header.cwd;
344
350
  const hint = typeof rawHint === "string" && rawHint !== "" ? rawHint : void 0;
345
- return headerCwd !== void 0 && headerCwd !== "" ? resolve(headerCwd) : hint !== void 0 && isAbsolute(hint) ? resolve(hint) : process.cwd();
351
+ if (headerCwd !== void 0 && headerCwd !== "") return resolve(headerCwd);
352
+ if (hint !== void 0 && isAbsolute(hint)) return resolve(hint);
353
+ throw new FilexError("no-workspace", "该会话没有关联的工作区目录,无法打开系统文件夹。请先为该会话选择一个工作区。", 400);
346
354
  }
347
355
  /**
348
356
  * Locate the VS Code CLI (`code`). Checks the standard install locations
package/package.json CHANGED
@@ -1,113 +1,113 @@
1
- {
2
- "name": "@dsh-xhl/dsh-file-explorer",
3
- "version": "0.1.7",
4
- "description": "DSH 外部编译型插件:工作区文件预览 / 编辑(CodeMirror 6 编辑器 + 文件树 + 全文搜索 + Markdown/HTML/图片/PDF 预览)。移植自同目录下的动态 Cordis 插件版本。",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "types": "lib/types/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./lib/types/index.d.ts",
11
- "default": "./lib/index.js"
12
- },
13
- "./client": "./lib/client.js",
14
- "./package.json": "./package.json"
15
- },
16
- "engines": {
17
- "node": ">=20"
18
- },
19
- "publishConfig": {
20
- "access": "public",
21
- "registry": "https://registry.npmjs.org"
22
- },
23
- "dsh": {
24
- "bundle": {
25
- "patch": "./cordis.patch.yml"
26
- },
27
- "client": {
28
- "inject": [
29
- "@deepseek-ai/dsh-client-runtime",
30
- "@deepseek-ai/dsh-client-ui-slots",
31
- "@deepseek-ai/dsh-client-web-react"
32
- ],
33
- "platform": "web"
34
- }
35
- },
36
- "files": [
37
- "lib/index.js",
38
- "lib/client.js",
39
- "lib/types/**/*.d.ts",
40
- "cordis.patch.yml",
41
- "README.md"
42
- ],
43
- "scripts": {
44
- "build": "tsc -p tsconfig.build.json && tsdown",
45
- "typecheck": "tsc --noEmit",
46
- "bundle": "tsdown",
47
- "prepare": "tsdown"
48
- },
49
- "license": "MIT",
50
- "peerDependencies": {
51
- "@deepseek-ai/cordis": "^4.0.1",
52
- "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
53
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6",
54
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
55
- "@deepseek-ai/dsh-client-web-react": "^0.1.0-rc.6",
56
- "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.6",
57
- "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
58
- "cordis": "^4.0.0-rc.7",
59
- "react": "^18.2.0",
60
- "react-dom": "^18.2.0"
61
- },
62
- "peerDependenciesMeta": {
63
- "cordis": {
64
- "optional": true
65
- }
66
- },
67
- "dependencies": {
68
- "@codemirror/commands": "^6.10.4",
69
- "@codemirror/lang-cpp": "^6.0.3",
70
- "@codemirror/lang-css": "^6.3.1",
71
- "@codemirror/lang-go": "^6.0.1",
72
- "@codemirror/lang-html": "^6.4.12",
73
- "@codemirror/lang-java": "^6.0.2",
74
- "@codemirror/lang-javascript": "^6.2.5",
75
- "@codemirror/lang-json": "^6.0.2",
76
- "@codemirror/lang-markdown": "^6.5.2",
77
- "@codemirror/lang-php": "^6.0.2",
78
- "@codemirror/lang-python": "^6.2.1",
79
- "@codemirror/lang-rust": "^6.0.2",
80
- "@codemirror/lang-sql": "^6.10.0",
81
- "@codemirror/lang-vue": "^0.1.3",
82
- "@codemirror/lang-xml": "^6.1.0",
83
- "@codemirror/lang-yaml": "^6.1.3",
84
- "@codemirror/language": "^6.12.4",
85
- "@codemirror/legacy-modes": "^6.5.3",
86
- "@codemirror/search": "6.7.1",
87
- "@codemirror/state": "^6.7.1",
88
- "@codemirror/view": "^6.43.8",
89
- "@lezer/highlight": "^1.2.3",
90
- "vscode-icons-js": "^11.6.1"
91
- },
92
- "devDependencies": {
93
- "@deepseek-ai/cordis": "^4.0.1",
94
- "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
95
- "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
96
- "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
97
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6",
98
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6",
99
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
100
- "@deepseek-ai/dsh-client-web-react": "^0.1.0-rc.6",
101
- "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.6",
102
- "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
103
- "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
104
- "@types/node": "^22.0.0",
105
- "@types/react": "~18.3.1",
106
- "@types/react-dom": "~18.3.1",
107
- "cordis": "^4.0.0-rc.7",
108
- "react": "^18.2.0",
109
- "react-dom": "^18.2.0",
110
- "tsdown": "^0.22.2",
111
- "typescript": "^5.6.0"
112
- }
113
- }
1
+ {
2
+ "name": "@dsh-xhl/dsh-file-explorer",
3
+ "version": "0.1.9",
4
+ "description": "DSH 外部编译型插件:工作区文件预览 / 编辑(CodeMirror 6 编辑器 + 文件树 + 全文搜索 + Markdown/HTML/图片/PDF 预览)。移植自同目录下的动态 Cordis 插件版本。",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/types/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./client": "./lib/client.js",
14
+ "./package.json": "./package.json"
15
+ },
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public",
21
+ "registry": "https://registry.npmjs.org"
22
+ },
23
+ "dsh": {
24
+ "bundle": {
25
+ "patch": "./cordis.patch.yml"
26
+ },
27
+ "client": {
28
+ "inject": [
29
+ "@deepseek-ai/dsh-client-runtime",
30
+ "@deepseek-ai/dsh-client-ui-slots",
31
+ "@deepseek-ai/dsh-client-web-react"
32
+ ],
33
+ "platform": "web"
34
+ }
35
+ },
36
+ "files": [
37
+ "lib/index.js",
38
+ "lib/client.js",
39
+ "lib/types/**/*.d.ts",
40
+ "cordis.patch.yml",
41
+ "README.md"
42
+ ],
43
+ "scripts": {
44
+ "build": "tsc -p tsconfig.build.json && tsdown",
45
+ "typecheck": "tsc --noEmit",
46
+ "bundle": "tsdown",
47
+ "prepare": "tsdown"
48
+ },
49
+ "license": "MIT",
50
+ "peerDependencies": {
51
+ "@deepseek-ai/cordis": "^4.0.1",
52
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
53
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6",
54
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
55
+ "@deepseek-ai/dsh-client-web-react": "^0.1.0-rc.6",
56
+ "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.6",
57
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
58
+ "cordis": "^4.0.0-rc.7",
59
+ "react": "^18.2.0",
60
+ "react-dom": "^18.2.0"
61
+ },
62
+ "peerDependenciesMeta": {
63
+ "cordis": {
64
+ "optional": true
65
+ }
66
+ },
67
+ "dependencies": {
68
+ "@codemirror/commands": "^6.10.4",
69
+ "@codemirror/lang-cpp": "^6.0.3",
70
+ "@codemirror/lang-css": "^6.3.1",
71
+ "@codemirror/lang-go": "^6.0.1",
72
+ "@codemirror/lang-html": "^6.4.12",
73
+ "@codemirror/lang-java": "^6.0.2",
74
+ "@codemirror/lang-javascript": "^6.2.5",
75
+ "@codemirror/lang-json": "^6.0.2",
76
+ "@codemirror/lang-markdown": "^6.5.2",
77
+ "@codemirror/lang-php": "^6.0.2",
78
+ "@codemirror/lang-python": "^6.2.1",
79
+ "@codemirror/lang-rust": "^6.0.2",
80
+ "@codemirror/lang-sql": "^6.10.0",
81
+ "@codemirror/lang-vue": "^0.1.3",
82
+ "@codemirror/lang-xml": "^6.1.0",
83
+ "@codemirror/lang-yaml": "^6.1.3",
84
+ "@codemirror/language": "^6.12.4",
85
+ "@codemirror/legacy-modes": "^6.5.3",
86
+ "@codemirror/search": "6.7.1",
87
+ "@codemirror/state": "^6.7.1",
88
+ "@codemirror/view": "^6.43.8",
89
+ "@lezer/highlight": "^1.2.3",
90
+ "vscode-icons-js": "^11.6.1"
91
+ },
92
+ "devDependencies": {
93
+ "@deepseek-ai/cordis": "^4.0.1",
94
+ "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
95
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
96
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
97
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6",
98
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6",
99
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
100
+ "@deepseek-ai/dsh-client-web-react": "^0.1.0-rc.6",
101
+ "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.6",
102
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
103
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
104
+ "@types/node": "^22.0.0",
105
+ "@types/react": "~18.3.1",
106
+ "@types/react-dom": "~18.3.1",
107
+ "cordis": "^4.0.0-rc.7",
108
+ "react": "^18.2.0",
109
+ "react-dom": "^18.2.0",
110
+ "tsdown": "^0.22.2",
111
+ "typescript": "^5.6.0"
112
+ }
113
+ }