@xmanrui/dsh-im 3.2.0 → 4.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/README.en.md CHANGED
@@ -98,7 +98,7 @@ dsh plugin --profile web add -w @xmanrui/dsh-im
98
98
 
99
99
  Restart `dsh web`, refresh the browser, then open **Settings → IM Bot**. The top-level IM Bot entry uses `order: 21` to follow **Agent Presets**, and the Plugins page no longer retains the old entry. Upgrading preserves existing bots, credentials, workspaces, Agent Presets, and Session bindings.
100
100
 
101
- Local `dsh web` and DSH Desktop use the current Host's internal `apiProxy` by default, without a loopback HTTP connection. Desktop's compatibility, extended-window, and advanced modes do not require browser access or LAN access to be enabled. An explicit channel `harnessBaseUrl` still uses the existing HTTP/WebSocket connection; failed internal calls never silently switch to another Host.
101
+ Local `dsh web` and DSH Desktop reuse the current Host's internal services by default: legacy Harness releases use `apiProxy`, while current releases automatically use the Typert Gateway plus the Session and Workspace controllers. No Harness address or loopback HTTP connection is required. Desktop's compatibility, extended-window, and advanced modes do not require browser access or LAN access to be enabled. An explicit channel `harnessBaseUrl` is retained only for legacy remote HTTP/WebSocket Harness endpoints; failed internal calls never silently switch to another Host.
102
102
 
103
103
  To try the latest code before it is published to npm, use the GitHub-source installer instead:
104
104
 
package/README.md CHANGED
@@ -101,7 +101,7 @@ dsh plugin --profile web add -w @xmanrui/dsh-im
101
101
 
102
102
  重启 `dsh web`、刷新浏览器,然后打开「设置 → IM机器人」。IM机器人使用 `order: 21`,尽量排在一级设置菜单的「Agent 预设」之后;插件页面不再保留旧入口。从旧版升级不会改变已有机器人、凭据、工作区、Agent Preset 或会话绑定。
103
103
 
104
- 本机 `dsh web` 和 DSH Desktop 默认通过当前 Host 的内部 `apiProxy` 接口通信,不再绕行本机 HTTP 端口。Desktop 的兼容模式、扩展窗口和增强模式均无需开启“允许在浏览器中打开”或局域网访问。渠道配置中显式设置的 `harnessBaseUrl` 仍使用原有 HTTP/WebSocket 连接;内部调用失败不会自动改连其他 Host。
104
+ 本机 `dsh web` 和 DSH Desktop 默认直接复用当前 Host 的内部服务:旧版 Harness 使用 `apiProxy`,新版 Harness 自动使用 Typert Gateway、Session Controller 和 Workspace Controller,不需要配置 Harness 地址,也不绕行本机 HTTP 端口。Desktop 的兼容模式、扩展窗口和增强模式均无需开启“允许在浏览器中打开”或局域网访问。渠道配置中显式设置的 `harnessBaseUrl` 仅保留给旧版远程 HTTP/WebSocket Harness;内部调用失败不会自动改连其他 Host。
105
105
 
106
106
  如需试用尚未发布到 npm 的最新代码,可以改用 GitHub 源安装器:
107
107
 
package/lib/client.js CHANGED
@@ -571,7 +571,7 @@ var React22 = __toESM(require("react"), 1);
571
571
  // package.json
572
572
  var package_default = {
573
573
  name: "@xmanrui/dsh-im",
574
- version: "3.2.0",
574
+ version: "4.0.1",
575
575
  description: "\u628A\u4E5D\u79CD IM \u673A\u5668\u4EBA\u548C\u516C\u7F51 AI Office \u63A5\u5165\u672C\u673A DeepSeek Harness\u3002 Connect nine IM channels and a public AI Office to a local DeepSeek Harness.",
576
576
  keywords: [
577
577
  "deepseek-harness",
@@ -12487,6 +12487,14 @@ function UpdatePanel({ rpcCall, clientVersion, onStatus }) {
12487
12487
  var name = "im-settings";
12488
12488
  var inject = ["slots", "connection", "locale", "workspaces"];
12489
12489
  var IM_PLUGIN_VERSION = package_default.version;
12490
+ function callWorkspaceDirectoryApi(ctx, method, ...args) {
12491
+ const uiWorkspace = typeof ctx.get === "function" ? ctx.get("uiWorkspace") : void 0;
12492
+ const service = typeof uiWorkspace?.[method] === "function" ? uiWorkspace : ctx.workspaces;
12493
+ if (typeof service?.[method] !== "function") {
12494
+ throw new Error("\u65E0\u6CD5\u8BFB\u53D6\u76EE\u5F55\uFF0C\u8BF7\u91CD\u8BD5\u3002");
12495
+ }
12496
+ return service[method](...args);
12497
+ }
12490
12498
  var CHANNELS = Object.freeze([
12491
12499
  { id: "weixin", label: "\u5FAE\u4FE1" },
12492
12500
  { id: "feishu", label: "\u98DE\u4E66" },
@@ -12785,8 +12793,8 @@ function apply(ctx) {
12785
12793
  const officeRpcCall = (endpoint, payload, signal) => ctx.connection.rpc.call(OFFICE_RPC_CHANNEL, endpoint, payload, signal);
12786
12794
  const updateRpcCall = (endpoint, payload, signal) => ctx.connection.rpc.call(UPDATE_RPC_CHANNEL, endpoint, payload, signal);
12787
12795
  const workspaceDirectoryPicker = Object.freeze({
12788
- listDirectory: (path, signal) => ctx.workspaces.listDirectory(path, signal),
12789
- pickDirectory: () => ctx.workspaces.pickDirectory()
12796
+ listDirectory: (path, signal) => callWorkspaceDirectoryApi(ctx, "listDirectory", path, signal),
12797
+ pickDirectory: () => callWorkspaceDirectoryApi(ctx, "pickDirectory")
12790
12798
  });
12791
12799
  ctx.slots.inject("settings.section", () => ctx.slots.register({
12792
12800
  name: "settings.section",