@sunshaobei/dsh-mcp-manager 0.4.0 → 0.6.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
@@ -474,3 +474,9 @@ exposes no current-session accessor, so the package stopped hand-rolling a
474
474
  ## License
475
475
 
476
476
  MIT
477
+
478
+ ### Session loading and workspace switches
479
+
480
+ After application startup, global MCPs and projects in the official workspace registry are prepared in the background. Configuration saves and source-file changes refresh affected connections. Switching sessions reads a workspace snapshot without waiting for connection, discovery, or retry; newly added workspaces are prepared once in the background.
481
+
482
+ Global connections are shared, while enable switches persist per workspace and apply to the UI, catalog injection, discovery, and execution. Late responses from a previous workspace cannot replace the current workspace snapshot.
package/README.md CHANGED
@@ -243,6 +243,12 @@ await ctx.mcpManager.registerServer({
243
243
  });
244
244
  ```
245
245
 
246
+ ### 会话加载与工作区开关
247
+
248
+ MCP 连接检查在应用启动后于后台预热全局配置及官方工作区列表中的项目;配置编辑保存或来源文件变化时更新相应连接。切换会话只读取对应工作区的缓存快照,不等待 MCP 连接、发现或重试,也不重新检查已预热的连接。应用启动后新添加的工作区会在后台首次准备。
249
+
250
+ 全局 MCP 的连接由应用共享,但启用开关按工作区持久化:在 A 工作区关闭不会影响 B 工作区。该开关同时约束界面、目录注入、搜索、详情和工具执行。快速切换时使用目标工作区的快照,尚无缓存时暂不显示计数;旧工作区的迟到响应不会覆盖当前界面。
251
+
246
252
  ## 数据与安全
247
253
 
248
254
  - 服务器配置:`<DSH_HOME>/dsh-mcp-manager/mcp.json`(仅存 `${ENV}` 引用,**不落盘密钥本身**);
@@ -119,8 +119,8 @@ interface PillPlacementInput {
119
119
  */
120
120
  export declare function pillPlacement(input: PillPlacementInput): ViewportPoint;
121
121
  /**
122
- * 挂载浮窗:胶囊继续挂在会话滚动容器(scrollBody)内并钉住右上角,下拉面板
123
- * fixed 跟随。返回 disposer 函数。
122
+ * Mount both floating elements in the overlay and anchor them to the conversation's viewport rect.
123
+ * Resize, drag and layout changes share one frame-coalesced position update.
124
124
  */
125
125
  export declare function mountFloat(ctx: McpClientContext, state: McpState, actions: UiActions): () => void;
126
126
  export {};
@@ -7,6 +7,8 @@
7
7
  * panel → servers / quick-add / float。
8
8
  */
9
9
  import type { McpState, UiActions } from "../core/state.js";
10
+ /** Switch immediately to this workspace's snapshot; never display another workspace's counts. */
11
+ export declare function activateWorkspace(state: McpState, actions: UiActions, previous?: string): void;
10
12
  /**
11
13
  * 刷新服务器列表与浮窗摘要(单飞:in-flight 复用;#111 变更点驱动)。
12
14
  * 返回 true=成功;false=失败(调用方按退避重试)。
@@ -48,6 +48,12 @@ export declare function renderServer(server: McpServerListEntry, state: McpState
48
48
  tools: boolean;
49
49
  openTools?: Set<string>;
50
50
  }): HTMLElement;
51
+ /**
52
+ * 启用开关(弹窗与浮层共用):开 = enabled:true(连接由后台 reconcile 自行走),
53
+ * 关 = enabled:false(拆连接)。互斥落选条目开 = activate 改选该来源。
54
+ * 连通性失败不阻断开关——开关只表达「要不要用」,连通性由徽章/错误行读数呈现。
55
+ */
56
+ export declare function enabledSwitch(server: McpServerListEntry, state: McpState, actions: UiActions, cwdQuery: string): HTMLElement;
51
57
  /** 渲染服务器列表页(#362 交互拍板 1a:项目级 / 全局级两大分组,各自内部再按状态)。
52
58
  * 单池(#767)后两大分组的服务器都经中间层,工具 checkbox 一律可用。 */
53
59
  export declare function renderServers(state: McpState, actions: UiActions): void;