@seastudio/sdk 3.2.2 → 3.2.5

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.
@@ -51,12 +51,15 @@ var batchFlattenCopyEvidenceOutputSchema = {
51
51
  var fileDownloadEvidenceOutputSchema = {
52
52
  type: "object",
53
53
  properties: {
54
+ location: { type: "string", enum: ["workspace", "absolute"] },
54
55
  rootId: { type: "string" },
56
+ absoluteDir: { type: "string" },
55
57
  path: { type: "string" },
56
58
  savedPath: { type: "string" },
57
- size: { type: "number" }
59
+ size: { type: "number" },
60
+ mime: { type: "string" }
58
61
  },
59
- required: ["rootId", "path", "savedPath", "size"]
62
+ required: ["location", "path", "savedPath", "size"]
60
63
  };
61
64
  var shellCommandEvidenceOutputSchema = {
62
65
  type: "object",
@@ -321,16 +324,20 @@ var fileTools = [
321
324
  }),
322
325
  annotateTool({
323
326
  name: "seastudio-file_download",
324
- description: "\u4ECE\u8FDC\u7A0B URL \u4E0B\u8F7D\u6587\u4EF6\u5230\u6307\u5B9A\u6839\u76EE\u5F55\u548C\u8DEF\u5F84\u3002\u4EC5\u5728\u9700\u8981\u771F\u5B9E\u5F15\u5165\u8FDC\u7AEF\u8D44\u6E90\u65F6\u4F7F\u7528\u3002",
327
+ description: "\u4ECE\u8FDC\u7A0B URL \u4E0B\u8F7D\u6587\u4EF6\u3002\u4E8C\u9009\u4E00\uFF1A\u2460 \u5728 workspace \u6839\u4E0B\u6307\u5B9A\u76F8\u5BF9\u5B50\u76EE\u5F55\uFF08rootId + path\uFF09\uFF1B\u2461 \u6307\u5B9A absoluteDir \u4E3A\u672C\u5730\u7EDD\u5BF9\u8DEF\u5F84\u76EE\u5F55\uFF08\u542B ~/ \u5C55\u5F00\uFF09\uFF0C\u5FFD\u7565 rootId/path\u3002\u4EC5\u5728\u9700\u8981\u771F\u5B9E\u5F15\u5165\u8FDC\u7AEF\u8D44\u6E90\u65F6\u4F7F\u7528\u3002",
325
328
  inputSchema: {
326
329
  type: "object",
327
330
  properties: {
328
- rootId: { type: "string", enum: ["workspace"], description: "\u6839\u76EE\u5F55 ID" },
329
- path: { type: "string", description: "\u4FDD\u5B58\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" },
331
+ rootId: { type: "string", enum: ["workspace"], description: "\u6839\u76EE\u5F55 ID\uFF08\u4E0E path \u8054\u7528\uFF1B\u82E5\u63D0\u4F9B absoluteDir \u5219\u5FFD\u7565\uFF09" },
332
+ path: { type: "string", description: "\u4FDD\u5B58\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF1B\u672A\u4F7F\u7528 absoluteDir \u65F6\u5FC5\u586B\uFF09" },
333
+ absoluteDir: {
334
+ type: "string",
335
+ description: "\u672C\u5730\u7EDD\u5BF9\u8DEF\u5F84\u76EE\u5F55\uFF08\u53EF\u542B ~ \u6216 ~/\uFF09\uFF1B\u82E5\u8BBE\u7F6E\u5219\u4E0B\u8F7D\u5230\u6B64\u76EE\u5F55\uFF0C\u4E0D\u518D\u4F7F\u7528 workspace \u76F8\u5BF9\u8DEF\u5F84"
336
+ },
330
337
  url: { type: "string", description: "\u8FDC\u7A0B\u6587\u4EF6 URL" },
331
338
  filenameHint: { type: "string", description: "\u6587\u4EF6\u540D\u63D0\u793A\uFF08\u53EF\u9009\uFF09" }
332
339
  },
333
- required: ["rootId", "path", "url"]
340
+ required: ["url"]
334
341
  }
335
342
  }, {
336
343
  operationKind: "mutate",
@@ -799,7 +806,13 @@ var seastudio = {
799
806
  });
800
807
  },
801
808
  getUrl: (path, options) => callTool("seastudio-file_get_url", { rootId: options?.rootId ?? "workspace", path }),
802
- download: (url, path, filenameHint, options) => callTool("seastudio-file_download", { rootId: options?.rootId ?? "workspace", path, url, filenameHint }),
809
+ download: (url, path, filenameHint, options) => {
810
+ const absoluteDir = options?.absoluteDir?.trim();
811
+ if (absoluteDir) {
812
+ return callTool("seastudio-file_download", { url, absoluteDir, filenameHint });
813
+ }
814
+ return callTool("seastudio-file_download", { rootId: options?.rootId ?? "workspace", path, url, filenameHint });
815
+ },
803
816
  writeBinary: (path, base64, options) => callTool("seastudio-file_write_binary", { rootId: options?.rootId ?? "workspace", path, base64 }),
804
817
  readBinary: (path, options) => callTool("seastudio-file_read_binary", { rootId: options?.rootId ?? "workspace", path })
805
818
  },
@@ -1214,6 +1227,12 @@ var SeastudioNotifications = {
1214
1227
  SESSION_SUMMARY: "session:summary",
1215
1228
  /** Agent 对话 session:从宿主列表移除(删除/归档等) */
1216
1229
  SESSION_REMOVED: "session:removed",
1230
+ /**
1231
+ * Agent 在初始化或线程列表与当前选中稳定后,向宿主全量同步:
1232
+ * 每个 agent 实例(通常每项目一个)下的会话列表与当前选中的 sessionId。
1233
+ * 宿主应用此通知重建侧栏列表,避免仅靠逐条 SESSION_CREATED 时重启后空白。
1234
+ */
1235
+ SESSION_STATE_SNAPSHOT: "session:state_snapshot",
1217
1236
  /**
1218
1237
  * 宿主请求 Agent 新建一条对话会话(例如侧栏项目行的「+」)。
1219
1238
  * 通过 notifications/publish + publishTo 定向到对应 Agent 实例。
@@ -53,12 +53,15 @@ var batchFlattenCopyEvidenceOutputSchema = {
53
53
  var fileDownloadEvidenceOutputSchema = {
54
54
  type: "object",
55
55
  properties: {
56
+ location: { type: "string", enum: ["workspace", "absolute"] },
56
57
  rootId: { type: "string" },
58
+ absoluteDir: { type: "string" },
57
59
  path: { type: "string" },
58
60
  savedPath: { type: "string" },
59
- size: { type: "number" }
61
+ size: { type: "number" },
62
+ mime: { type: "string" }
60
63
  },
61
- required: ["rootId", "path", "savedPath", "size"]
64
+ required: ["location", "path", "savedPath", "size"]
62
65
  };
63
66
  var shellCommandEvidenceOutputSchema = {
64
67
  type: "object",
@@ -323,16 +326,20 @@ var fileTools = [
323
326
  }),
324
327
  annotateTool({
325
328
  name: "seastudio-file_download",
326
- description: "\u4ECE\u8FDC\u7A0B URL \u4E0B\u8F7D\u6587\u4EF6\u5230\u6307\u5B9A\u6839\u76EE\u5F55\u548C\u8DEF\u5F84\u3002\u4EC5\u5728\u9700\u8981\u771F\u5B9E\u5F15\u5165\u8FDC\u7AEF\u8D44\u6E90\u65F6\u4F7F\u7528\u3002",
329
+ description: "\u4ECE\u8FDC\u7A0B URL \u4E0B\u8F7D\u6587\u4EF6\u3002\u4E8C\u9009\u4E00\uFF1A\u2460 \u5728 workspace \u6839\u4E0B\u6307\u5B9A\u76F8\u5BF9\u5B50\u76EE\u5F55\uFF08rootId + path\uFF09\uFF1B\u2461 \u6307\u5B9A absoluteDir \u4E3A\u672C\u5730\u7EDD\u5BF9\u8DEF\u5F84\u76EE\u5F55\uFF08\u542B ~/ \u5C55\u5F00\uFF09\uFF0C\u5FFD\u7565 rootId/path\u3002\u4EC5\u5728\u9700\u8981\u771F\u5B9E\u5F15\u5165\u8FDC\u7AEF\u8D44\u6E90\u65F6\u4F7F\u7528\u3002",
327
330
  inputSchema: {
328
331
  type: "object",
329
332
  properties: {
330
- rootId: { type: "string", enum: ["workspace"], description: "\u6839\u76EE\u5F55 ID" },
331
- path: { type: "string", description: "\u4FDD\u5B58\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" },
333
+ rootId: { type: "string", enum: ["workspace"], description: "\u6839\u76EE\u5F55 ID\uFF08\u4E0E path \u8054\u7528\uFF1B\u82E5\u63D0\u4F9B absoluteDir \u5219\u5FFD\u7565\uFF09" },
334
+ path: { type: "string", description: "\u4FDD\u5B58\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF1B\u672A\u4F7F\u7528 absoluteDir \u65F6\u5FC5\u586B\uFF09" },
335
+ absoluteDir: {
336
+ type: "string",
337
+ description: "\u672C\u5730\u7EDD\u5BF9\u8DEF\u5F84\u76EE\u5F55\uFF08\u53EF\u542B ~ \u6216 ~/\uFF09\uFF1B\u82E5\u8BBE\u7F6E\u5219\u4E0B\u8F7D\u5230\u6B64\u76EE\u5F55\uFF0C\u4E0D\u518D\u4F7F\u7528 workspace \u76F8\u5BF9\u8DEF\u5F84"
338
+ },
332
339
  url: { type: "string", description: "\u8FDC\u7A0B\u6587\u4EF6 URL" },
333
340
  filenameHint: { type: "string", description: "\u6587\u4EF6\u540D\u63D0\u793A\uFF08\u53EF\u9009\uFF09" }
334
341
  },
335
- required: ["rootId", "path", "url"]
342
+ required: ["url"]
336
343
  }
337
344
  }, {
338
345
  operationKind: "mutate",
@@ -801,7 +808,13 @@ var seastudio = {
801
808
  });
802
809
  },
803
810
  getUrl: (path, options) => callTool("seastudio-file_get_url", { rootId: options?.rootId ?? "workspace", path }),
804
- download: (url, path, filenameHint, options) => callTool("seastudio-file_download", { rootId: options?.rootId ?? "workspace", path, url, filenameHint }),
811
+ download: (url, path, filenameHint, options) => {
812
+ const absoluteDir = options?.absoluteDir?.trim();
813
+ if (absoluteDir) {
814
+ return callTool("seastudio-file_download", { url, absoluteDir, filenameHint });
815
+ }
816
+ return callTool("seastudio-file_download", { rootId: options?.rootId ?? "workspace", path, url, filenameHint });
817
+ },
805
818
  writeBinary: (path, base64, options) => callTool("seastudio-file_write_binary", { rootId: options?.rootId ?? "workspace", path, base64 }),
806
819
  readBinary: (path, options) => callTool("seastudio-file_read_binary", { rootId: options?.rootId ?? "workspace", path })
807
820
  },
@@ -1216,6 +1229,12 @@ var SeastudioNotifications = {
1216
1229
  SESSION_SUMMARY: "session:summary",
1217
1230
  /** Agent 对话 session:从宿主列表移除(删除/归档等) */
1218
1231
  SESSION_REMOVED: "session:removed",
1232
+ /**
1233
+ * Agent 在初始化或线程列表与当前选中稳定后,向宿主全量同步:
1234
+ * 每个 agent 实例(通常每项目一个)下的会话列表与当前选中的 sessionId。
1235
+ * 宿主应用此通知重建侧栏列表,避免仅靠逐条 SESSION_CREATED 时重启后空白。
1236
+ */
1237
+ SESSION_STATE_SNAPSHOT: "session:state_snapshot",
1219
1238
  /**
1220
1239
  * 宿主请求 Agent 新建一条对话会话(例如侧栏项目行的「+」)。
1221
1240
  * 通过 notifications/publish + publishTo 定向到对应 Agent 实例。
@@ -84,14 +84,21 @@ function MenuItem({
84
84
  onClick,
85
85
  className
86
86
  }) {
87
+ const handlePressStart = (event) => {
88
+ event.stopPropagation();
89
+ if (disabled || event.button !== 0) return;
90
+ onClick();
91
+ };
92
+ const handleKeyboardClick = (event) => {
93
+ event.stopPropagation();
94
+ if (disabled || event.detail !== 0) return;
95
+ onClick();
96
+ };
87
97
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
88
98
  "button",
89
99
  {
90
- onClick: () => {
91
- if (!disabled) {
92
- onClick();
93
- }
94
- },
100
+ onMouseDown: handlePressStart,
101
+ onClick: handleKeyboardClick,
95
102
  disabled,
96
103
  className: cn(
97
104
  "w-full flex items-center gap-2 px-2 py-1.5 text-xs text-left transition-colors rounded-md",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkOYA42WZ4_cjs = require('./chunk-OYA42WZ4.cjs');
3
+ var chunk7LQXYJPQ_cjs = require('./chunk-7LQXYJPQ.cjs');
4
4
  var chunk3I7UM66P_cjs = require('./chunk-3I7UM66P.cjs');
5
5
 
6
6
  // src/mcp/index.ts
@@ -11,7 +11,7 @@ async function loadPlugin(pluginName) {
11
11
  throw new Error(`Unknown plugin: ${pluginName}. \u63D2\u4EF6 MCP \u4E0D\u518D\u901A\u8FC7 SDK \u9759\u6001\u5BFC\u5165\u3002`);
12
12
  }
13
13
  var MCP_PACKAGES = [
14
- { id: "seastudio", name: "SeaStudio", description: "\u6587\u4EF6/Shell/AIGC \u57FA\u7840\u80FD\u529B", tools: chunkOYA42WZ4_cjs.allTools }
14
+ { id: "seastudio", name: "SeaStudio", description: "\u6587\u4EF6/Shell/AIGC \u57FA\u7840\u80FD\u529B", tools: chunk7LQXYJPQ_cjs.allTools }
15
15
  ];
16
16
  function mcpToolToOpenAI(tool) {
17
17
  const normalizedTool = chunk3I7UM66P_cjs.normalizeMCPTool(tool);
@@ -29,7 +29,7 @@ function mcpToolToOpenAI(tool) {
29
29
  };
30
30
  }
31
31
  function listAllTools() {
32
- return [...chunkOYA42WZ4_cjs.allTools];
32
+ return [...chunk7LQXYJPQ_cjs.allTools];
33
33
  }
34
34
  function toPackageName(source) {
35
35
  if (source === "seastudio") {
@@ -59,7 +59,7 @@ function normalizeAvailableTool(raw) {
59
59
  };
60
60
  }
61
61
  var MCP_TOOL_PACKAGE_INDEX = new Map(
62
- chunkOYA42WZ4_cjs.allTools.map((tool) => [tool.name, "seastudio"])
62
+ chunk7LQXYJPQ_cjs.allTools.map((tool) => [tool.name, "seastudio"])
63
63
  );
64
64
  function getMCPToolPackageIndex() {
65
65
  return new Map(MCP_TOOL_PACKAGE_INDEX);
@@ -82,14 +82,21 @@ function MenuItem({
82
82
  onClick,
83
83
  className
84
84
  }) {
85
+ const handlePressStart = (event) => {
86
+ event.stopPropagation();
87
+ if (disabled || event.button !== 0) return;
88
+ onClick();
89
+ };
90
+ const handleKeyboardClick = (event) => {
91
+ event.stopPropagation();
92
+ if (disabled || event.detail !== 0) return;
93
+ onClick();
94
+ };
85
95
  return /* @__PURE__ */ jsx("div", { className: "px-1", children: /* @__PURE__ */ jsxs(
86
96
  "button",
87
97
  {
88
- onClick: () => {
89
- if (!disabled) {
90
- onClick();
91
- }
92
- },
98
+ onMouseDown: handlePressStart,
99
+ onClick: handleKeyboardClick,
93
100
  disabled,
94
101
  className: cn(
95
102
  "w-full flex items-center gap-2 px-2 py-1.5 text-xs text-left transition-colors rounded-md",
@@ -1,4 +1,4 @@
1
- import { allTools } from './chunk-HQB2A35M.js';
1
+ import { allTools } from './chunk-3UVF6MLO.js';
2
2
  import { normalizeMCPTool, normalizeMCPToolObjectSchema, getDefaultClient } from './chunk-TJ3CGHWJ.js';
3
3
 
4
4
  // src/mcp/index.ts
package/dist/index.cjs CHANGED
@@ -1,151 +1,151 @@
1
1
  'use strict';
2
2
 
3
- var chunkZ5Q7SKYD_cjs = require('./chunk-Z5Q7SKYD.cjs');
4
- var chunkSYMWE636_cjs = require('./chunk-SYMWE636.cjs');
5
- var chunkOYA42WZ4_cjs = require('./chunk-OYA42WZ4.cjs');
3
+ var chunkPX2KWRKM_cjs = require('./chunk-PX2KWRKM.cjs');
4
+ var chunkGEPSOYJN_cjs = require('./chunk-GEPSOYJN.cjs');
5
+ var chunk7LQXYJPQ_cjs = require('./chunk-7LQXYJPQ.cjs');
6
6
  var chunk3I7UM66P_cjs = require('./chunk-3I7UM66P.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MCP_PACKAGES", {
11
11
  enumerable: true,
12
- get: function () { return chunkZ5Q7SKYD_cjs.MCP_PACKAGES; }
12
+ get: function () { return chunkPX2KWRKM_cjs.MCP_PACKAGES; }
13
13
  });
14
14
  Object.defineProperty(exports, "getMCPPackageIdForTool", {
15
15
  enumerable: true,
16
- get: function () { return chunkZ5Q7SKYD_cjs.getMCPPackageIdForTool; }
16
+ get: function () { return chunkPX2KWRKM_cjs.getMCPPackageIdForTool; }
17
17
  });
18
18
  Object.defineProperty(exports, "getMCPPackages", {
19
19
  enumerable: true,
20
- get: function () { return chunkZ5Q7SKYD_cjs.getMCPPackages; }
20
+ get: function () { return chunkPX2KWRKM_cjs.getMCPPackages; }
21
21
  });
22
22
  Object.defineProperty(exports, "getMCPToolPackageIndex", {
23
23
  enumerable: true,
24
- get: function () { return chunkZ5Q7SKYD_cjs.getMCPToolPackageIndex; }
24
+ get: function () { return chunkPX2KWRKM_cjs.getMCPToolPackageIndex; }
25
25
  });
26
26
  Object.defineProperty(exports, "getToolsForLLM", {
27
27
  enumerable: true,
28
- get: function () { return chunkZ5Q7SKYD_cjs.getToolsForLLM; }
28
+ get: function () { return chunkPX2KWRKM_cjs.getToolsForLLM; }
29
29
  });
30
30
  Object.defineProperty(exports, "listAllTools", {
31
31
  enumerable: true,
32
- get: function () { return chunkZ5Q7SKYD_cjs.listAllTools; }
32
+ get: function () { return chunkPX2KWRKM_cjs.listAllTools; }
33
33
  });
34
34
  Object.defineProperty(exports, "listAvailableTools", {
35
35
  enumerable: true,
36
- get: function () { return chunkZ5Q7SKYD_cjs.listAvailableTools; }
36
+ get: function () { return chunkPX2KWRKM_cjs.listAvailableTools; }
37
37
  });
38
38
  Object.defineProperty(exports, "listAvailableToolsForLLM", {
39
39
  enumerable: true,
40
- get: function () { return chunkZ5Q7SKYD_cjs.listAvailableToolsForLLM; }
40
+ get: function () { return chunkPX2KWRKM_cjs.listAvailableToolsForLLM; }
41
41
  });
42
42
  Object.defineProperty(exports, "loadPlugin", {
43
43
  enumerable: true,
44
- get: function () { return chunkZ5Q7SKYD_cjs.loadPlugin; }
44
+ get: function () { return chunkPX2KWRKM_cjs.loadPlugin; }
45
45
  });
46
46
  Object.defineProperty(exports, "mcpToolToOpenAI", {
47
47
  enumerable: true,
48
- get: function () { return chunkZ5Q7SKYD_cjs.mcpToolToOpenAI; }
48
+ get: function () { return chunkPX2KWRKM_cjs.mcpToolToOpenAI; }
49
49
  });
50
50
  Object.defineProperty(exports, "DialogBody", {
51
51
  enumerable: true,
52
- get: function () { return chunkSYMWE636_cjs.DialogBody; }
52
+ get: function () { return chunkGEPSOYJN_cjs.DialogBody; }
53
53
  });
54
54
  Object.defineProperty(exports, "DialogButton", {
55
55
  enumerable: true,
56
- get: function () { return chunkSYMWE636_cjs.DialogButton; }
56
+ get: function () { return chunkGEPSOYJN_cjs.DialogButton; }
57
57
  });
58
58
  Object.defineProperty(exports, "DialogContainer", {
59
59
  enumerable: true,
60
- get: function () { return chunkSYMWE636_cjs.DialogContainer; }
60
+ get: function () { return chunkGEPSOYJN_cjs.DialogContainer; }
61
61
  });
62
62
  Object.defineProperty(exports, "DialogFooter", {
63
63
  enumerable: true,
64
- get: function () { return chunkSYMWE636_cjs.DialogFooter; }
64
+ get: function () { return chunkGEPSOYJN_cjs.DialogFooter; }
65
65
  });
66
66
  Object.defineProperty(exports, "DialogHeader", {
67
67
  enumerable: true,
68
- get: function () { return chunkSYMWE636_cjs.DialogHeader; }
68
+ get: function () { return chunkGEPSOYJN_cjs.DialogHeader; }
69
69
  });
70
70
  Object.defineProperty(exports, "DialogOverlay", {
71
71
  enumerable: true,
72
- get: function () { return chunkSYMWE636_cjs.DialogOverlay; }
72
+ get: function () { return chunkGEPSOYJN_cjs.DialogOverlay; }
73
73
  });
74
74
  Object.defineProperty(exports, "MenuContainer", {
75
75
  enumerable: true,
76
- get: function () { return chunkSYMWE636_cjs.MenuContainer; }
76
+ get: function () { return chunkGEPSOYJN_cjs.MenuContainer; }
77
77
  });
78
78
  Object.defineProperty(exports, "MenuEmpty", {
79
79
  enumerable: true,
80
- get: function () { return chunkSYMWE636_cjs.MenuEmpty; }
80
+ get: function () { return chunkGEPSOYJN_cjs.MenuEmpty; }
81
81
  });
82
82
  Object.defineProperty(exports, "MenuItem", {
83
83
  enumerable: true,
84
- get: function () { return chunkSYMWE636_cjs.MenuItem; }
84
+ get: function () { return chunkGEPSOYJN_cjs.MenuItem; }
85
85
  });
86
86
  Object.defineProperty(exports, "MenuSeparator", {
87
87
  enumerable: true,
88
- get: function () { return chunkSYMWE636_cjs.MenuSeparator; }
88
+ get: function () { return chunkGEPSOYJN_cjs.MenuSeparator; }
89
89
  });
90
90
  Object.defineProperty(exports, "Tab", {
91
91
  enumerable: true,
92
- get: function () { return chunkSYMWE636_cjs.Tab; }
92
+ get: function () { return chunkGEPSOYJN_cjs.Tab; }
93
93
  });
94
94
  Object.defineProperty(exports, "cn", {
95
95
  enumerable: true,
96
- get: function () { return chunkSYMWE636_cjs.cn; }
96
+ get: function () { return chunkGEPSOYJN_cjs.cn; }
97
97
  });
98
98
  Object.defineProperty(exports, "showHostContextMenu", {
99
99
  enumerable: true,
100
- get: function () { return chunkSYMWE636_cjs.showHostContextMenu; }
100
+ get: function () { return chunkGEPSOYJN_cjs.showHostContextMenu; }
101
101
  });
102
102
  Object.defineProperty(exports, "SeastudioNotifications", {
103
103
  enumerable: true,
104
- get: function () { return chunkOYA42WZ4_cjs.SeastudioNotifications; }
104
+ get: function () { return chunk7LQXYJPQ_cjs.SeastudioNotifications; }
105
105
  });
106
106
  Object.defineProperty(exports, "SeastudioRequests", {
107
107
  enumerable: true,
108
- get: function () { return chunkOYA42WZ4_cjs.SeastudioRequests; }
108
+ get: function () { return chunk7LQXYJPQ_cjs.SeastudioRequests; }
109
109
  });
110
110
  Object.defineProperty(exports, "agentManagementTools", {
111
111
  enumerable: true,
112
- get: function () { return chunkOYA42WZ4_cjs.agentManagementTools; }
112
+ get: function () { return chunk7LQXYJPQ_cjs.agentManagementTools; }
113
113
  });
114
114
  Object.defineProperty(exports, "agentTabTools", {
115
115
  enumerable: true,
116
- get: function () { return chunkOYA42WZ4_cjs.agentTabTools; }
116
+ get: function () { return chunk7LQXYJPQ_cjs.agentTabTools; }
117
117
  });
118
118
  Object.defineProperty(exports, "fileTools", {
119
119
  enumerable: true,
120
- get: function () { return chunkOYA42WZ4_cjs.fileTools; }
120
+ get: function () { return chunk7LQXYJPQ_cjs.fileTools; }
121
121
  });
122
122
  Object.defineProperty(exports, "pluginManagementTools", {
123
123
  enumerable: true,
124
- get: function () { return chunkOYA42WZ4_cjs.pluginManagementTools; }
124
+ get: function () { return chunk7LQXYJPQ_cjs.pluginManagementTools; }
125
125
  });
126
126
  Object.defineProperty(exports, "pluginTabTools", {
127
127
  enumerable: true,
128
- get: function () { return chunkOYA42WZ4_cjs.pluginTabTools; }
128
+ get: function () { return chunk7LQXYJPQ_cjs.pluginTabTools; }
129
129
  });
130
130
  Object.defineProperty(exports, "seaCloudTools", {
131
131
  enumerable: true,
132
- get: function () { return chunkOYA42WZ4_cjs.seaCloudTools; }
132
+ get: function () { return chunk7LQXYJPQ_cjs.seaCloudTools; }
133
133
  });
134
134
  Object.defineProperty(exports, "seastudio", {
135
135
  enumerable: true,
136
- get: function () { return chunkOYA42WZ4_cjs.seastudio; }
136
+ get: function () { return chunk7LQXYJPQ_cjs.seastudio; }
137
137
  });
138
138
  Object.defineProperty(exports, "seastudioAllTools", {
139
139
  enumerable: true,
140
- get: function () { return chunkOYA42WZ4_cjs.allTools; }
140
+ get: function () { return chunk7LQXYJPQ_cjs.allTools; }
141
141
  });
142
142
  Object.defineProperty(exports, "seastudioTools", {
143
143
  enumerable: true,
144
- get: function () { return chunkOYA42WZ4_cjs.tools; }
144
+ get: function () { return chunk7LQXYJPQ_cjs.tools; }
145
145
  });
146
146
  Object.defineProperty(exports, "shellTools", {
147
147
  enumerable: true,
148
- get: function () { return chunkOYA42WZ4_cjs.shellTools; }
148
+ get: function () { return chunk7LQXYJPQ_cjs.shellTools; }
149
149
  });
150
150
  Object.defineProperty(exports, "MCPClient", {
151
151
  enumerable: true,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { MCP_PACKAGES, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI } from './chunk-RZA5HQMQ.js';
2
- export { DialogBody, DialogButton, DialogContainer, DialogFooter, DialogHeader, DialogOverlay, MenuContainer, MenuEmpty, MenuItem, MenuSeparator, Tab, cn, showHostContextMenu } from './chunk-4JAYW5GM.js';
3
- export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, fileTools, pluginManagementTools, pluginTabTools, seaCloudTools, seastudio, allTools as seastudioAllTools, tools as seastudioTools, shellTools } from './chunk-HQB2A35M.js';
1
+ export { MCP_PACKAGES, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI } from './chunk-YTHD4PO5.js';
2
+ export { DialogBody, DialogButton, DialogContainer, DialogFooter, DialogHeader, DialogOverlay, MenuContainer, MenuEmpty, MenuItem, MenuSeparator, Tab, cn, showHostContextMenu } from './chunk-X62SRZS4.js';
3
+ export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, fileTools, pluginManagementTools, pluginTabTools, seaCloudTools, seastudio, allTools as seastudioAllTools, tools as seastudioTools, shellTools } from './chunk-3UVF6MLO.js';
4
4
  export { MCPClient, MCPServer, PostMessageTransport, callHostTool, callHostToolText, createMCPClient, createMCPServer, createNotification, createRequest, createResponse, getDefaultClient, getDefaultServer, getDefaultTransport, isMCPMessage, isNotification, normalizeMCPTool, normalizeMCPToolInputSchema, normalizeMCPToolObjectSchema, setDefaultClient, setDefaultTransport, startDefaultServer } from './chunk-TJ3CGHWJ.js';
@@ -1,98 +1,98 @@
1
1
  'use strict';
2
2
 
3
- var chunkZ5Q7SKYD_cjs = require('../chunk-Z5Q7SKYD.cjs');
4
- var chunkOYA42WZ4_cjs = require('../chunk-OYA42WZ4.cjs');
3
+ var chunkPX2KWRKM_cjs = require('../chunk-PX2KWRKM.cjs');
4
+ var chunk7LQXYJPQ_cjs = require('../chunk-7LQXYJPQ.cjs');
5
5
  var chunk3I7UM66P_cjs = require('../chunk-3I7UM66P.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "MCP_PACKAGES", {
10
10
  enumerable: true,
11
- get: function () { return chunkZ5Q7SKYD_cjs.MCP_PACKAGES; }
11
+ get: function () { return chunkPX2KWRKM_cjs.MCP_PACKAGES; }
12
12
  });
13
13
  Object.defineProperty(exports, "getMCPPackageIdForTool", {
14
14
  enumerable: true,
15
- get: function () { return chunkZ5Q7SKYD_cjs.getMCPPackageIdForTool; }
15
+ get: function () { return chunkPX2KWRKM_cjs.getMCPPackageIdForTool; }
16
16
  });
17
17
  Object.defineProperty(exports, "getMCPPackages", {
18
18
  enumerable: true,
19
- get: function () { return chunkZ5Q7SKYD_cjs.getMCPPackages; }
19
+ get: function () { return chunkPX2KWRKM_cjs.getMCPPackages; }
20
20
  });
21
21
  Object.defineProperty(exports, "getMCPToolPackageIndex", {
22
22
  enumerable: true,
23
- get: function () { return chunkZ5Q7SKYD_cjs.getMCPToolPackageIndex; }
23
+ get: function () { return chunkPX2KWRKM_cjs.getMCPToolPackageIndex; }
24
24
  });
25
25
  Object.defineProperty(exports, "getToolsForLLM", {
26
26
  enumerable: true,
27
- get: function () { return chunkZ5Q7SKYD_cjs.getToolsForLLM; }
27
+ get: function () { return chunkPX2KWRKM_cjs.getToolsForLLM; }
28
28
  });
29
29
  Object.defineProperty(exports, "listAllTools", {
30
30
  enumerable: true,
31
- get: function () { return chunkZ5Q7SKYD_cjs.listAllTools; }
31
+ get: function () { return chunkPX2KWRKM_cjs.listAllTools; }
32
32
  });
33
33
  Object.defineProperty(exports, "listAvailableTools", {
34
34
  enumerable: true,
35
- get: function () { return chunkZ5Q7SKYD_cjs.listAvailableTools; }
35
+ get: function () { return chunkPX2KWRKM_cjs.listAvailableTools; }
36
36
  });
37
37
  Object.defineProperty(exports, "listAvailableToolsForLLM", {
38
38
  enumerable: true,
39
- get: function () { return chunkZ5Q7SKYD_cjs.listAvailableToolsForLLM; }
39
+ get: function () { return chunkPX2KWRKM_cjs.listAvailableToolsForLLM; }
40
40
  });
41
41
  Object.defineProperty(exports, "loadPlugin", {
42
42
  enumerable: true,
43
- get: function () { return chunkZ5Q7SKYD_cjs.loadPlugin; }
43
+ get: function () { return chunkPX2KWRKM_cjs.loadPlugin; }
44
44
  });
45
45
  Object.defineProperty(exports, "mcpToolToOpenAI", {
46
46
  enumerable: true,
47
- get: function () { return chunkZ5Q7SKYD_cjs.mcpToolToOpenAI; }
47
+ get: function () { return chunkPX2KWRKM_cjs.mcpToolToOpenAI; }
48
48
  });
49
49
  Object.defineProperty(exports, "SeastudioNotifications", {
50
50
  enumerable: true,
51
- get: function () { return chunkOYA42WZ4_cjs.SeastudioNotifications; }
51
+ get: function () { return chunk7LQXYJPQ_cjs.SeastudioNotifications; }
52
52
  });
53
53
  Object.defineProperty(exports, "SeastudioRequests", {
54
54
  enumerable: true,
55
- get: function () { return chunkOYA42WZ4_cjs.SeastudioRequests; }
55
+ get: function () { return chunk7LQXYJPQ_cjs.SeastudioRequests; }
56
56
  });
57
57
  Object.defineProperty(exports, "agentManagementTools", {
58
58
  enumerable: true,
59
- get: function () { return chunkOYA42WZ4_cjs.agentManagementTools; }
59
+ get: function () { return chunk7LQXYJPQ_cjs.agentManagementTools; }
60
60
  });
61
61
  Object.defineProperty(exports, "agentTabTools", {
62
62
  enumerable: true,
63
- get: function () { return chunkOYA42WZ4_cjs.agentTabTools; }
63
+ get: function () { return chunk7LQXYJPQ_cjs.agentTabTools; }
64
64
  });
65
65
  Object.defineProperty(exports, "fileTools", {
66
66
  enumerable: true,
67
- get: function () { return chunkOYA42WZ4_cjs.fileTools; }
67
+ get: function () { return chunk7LQXYJPQ_cjs.fileTools; }
68
68
  });
69
69
  Object.defineProperty(exports, "pluginManagementTools", {
70
70
  enumerable: true,
71
- get: function () { return chunkOYA42WZ4_cjs.pluginManagementTools; }
71
+ get: function () { return chunk7LQXYJPQ_cjs.pluginManagementTools; }
72
72
  });
73
73
  Object.defineProperty(exports, "pluginTabTools", {
74
74
  enumerable: true,
75
- get: function () { return chunkOYA42WZ4_cjs.pluginTabTools; }
75
+ get: function () { return chunk7LQXYJPQ_cjs.pluginTabTools; }
76
76
  });
77
77
  Object.defineProperty(exports, "seaCloudTools", {
78
78
  enumerable: true,
79
- get: function () { return chunkOYA42WZ4_cjs.seaCloudTools; }
79
+ get: function () { return chunk7LQXYJPQ_cjs.seaCloudTools; }
80
80
  });
81
81
  Object.defineProperty(exports, "seastudio", {
82
82
  enumerable: true,
83
- get: function () { return chunkOYA42WZ4_cjs.seastudio; }
83
+ get: function () { return chunk7LQXYJPQ_cjs.seastudio; }
84
84
  });
85
85
  Object.defineProperty(exports, "seastudioAllTools", {
86
86
  enumerable: true,
87
- get: function () { return chunkOYA42WZ4_cjs.allTools; }
87
+ get: function () { return chunk7LQXYJPQ_cjs.allTools; }
88
88
  });
89
89
  Object.defineProperty(exports, "seastudioTools", {
90
90
  enumerable: true,
91
- get: function () { return chunkOYA42WZ4_cjs.tools; }
91
+ get: function () { return chunk7LQXYJPQ_cjs.tools; }
92
92
  });
93
93
  Object.defineProperty(exports, "shellTools", {
94
94
  enumerable: true,
95
- get: function () { return chunkOYA42WZ4_cjs.shellTools; }
95
+ get: function () { return chunk7LQXYJPQ_cjs.shellTools; }
96
96
  });
97
97
  Object.defineProperty(exports, "MCPClient", {
98
98
  enumerable: true,
package/dist/mcp/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { MCP_PACKAGES, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI } from '../chunk-RZA5HQMQ.js';
2
- export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, fileTools, pluginManagementTools, pluginTabTools, seaCloudTools, seastudio, allTools as seastudioAllTools, tools as seastudioTools, shellTools } from '../chunk-HQB2A35M.js';
1
+ export { MCP_PACKAGES, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI } from '../chunk-YTHD4PO5.js';
2
+ export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, fileTools, pluginManagementTools, pluginTabTools, seaCloudTools, seastudio, allTools as seastudioAllTools, tools as seastudioTools, shellTools } from '../chunk-3UVF6MLO.js';
3
3
  export { MCPClient, MCPServer, PostMessageTransport, callHostTool, callHostToolText, createMCPClient, createMCPServer, createNotification, createRequest, createResponse, getDefaultClient, getDefaultServer, getDefaultTransport, isMCPMessage, isNotification, normalizeMCPTool, normalizeMCPToolInputSchema, normalizeMCPToolObjectSchema, setDefaultClient, setDefaultTransport, startDefaultServer } from '../chunk-TJ3CGHWJ.js';
@@ -1,99 +1,99 @@
1
1
  'use strict';
2
2
 
3
- var chunkOYA42WZ4_cjs = require('../../chunk-OYA42WZ4.cjs');
3
+ var chunk7LQXYJPQ_cjs = require('../../chunk-7LQXYJPQ.cjs');
4
4
  require('../../chunk-3I7UM66P.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "SeastudioNotifications", {
9
9
  enumerable: true,
10
- get: function () { return chunkOYA42WZ4_cjs.SeastudioNotifications; }
10
+ get: function () { return chunk7LQXYJPQ_cjs.SeastudioNotifications; }
11
11
  });
12
12
  Object.defineProperty(exports, "SeastudioRequests", {
13
13
  enumerable: true,
14
- get: function () { return chunkOYA42WZ4_cjs.SeastudioRequests; }
14
+ get: function () { return chunk7LQXYJPQ_cjs.SeastudioRequests; }
15
15
  });
16
16
  Object.defineProperty(exports, "agentManagementTools", {
17
17
  enumerable: true,
18
- get: function () { return chunkOYA42WZ4_cjs.agentManagementTools; }
18
+ get: function () { return chunk7LQXYJPQ_cjs.agentManagementTools; }
19
19
  });
20
20
  Object.defineProperty(exports, "agentTabTools", {
21
21
  enumerable: true,
22
- get: function () { return chunkOYA42WZ4_cjs.agentTabTools; }
22
+ get: function () { return chunk7LQXYJPQ_cjs.agentTabTools; }
23
23
  });
24
24
  Object.defineProperty(exports, "allTools", {
25
25
  enumerable: true,
26
- get: function () { return chunkOYA42WZ4_cjs.allTools; }
26
+ get: function () { return chunk7LQXYJPQ_cjs.allTools; }
27
27
  });
28
28
  Object.defineProperty(exports, "annotateTool", {
29
29
  enumerable: true,
30
- get: function () { return chunkOYA42WZ4_cjs.annotateTool; }
30
+ get: function () { return chunk7LQXYJPQ_cjs.annotateTool; }
31
31
  });
32
32
  Object.defineProperty(exports, "batchFlattenCopyEvidenceOutputSchema", {
33
33
  enumerable: true,
34
- get: function () { return chunkOYA42WZ4_cjs.batchFlattenCopyEvidenceOutputSchema; }
34
+ get: function () { return chunk7LQXYJPQ_cjs.batchFlattenCopyEvidenceOutputSchema; }
35
35
  });
36
36
  Object.defineProperty(exports, "callTool", {
37
37
  enumerable: true,
38
- get: function () { return chunkOYA42WZ4_cjs.callTool; }
38
+ get: function () { return chunk7LQXYJPQ_cjs.callTool; }
39
39
  });
40
40
  Object.defineProperty(exports, "callToolText", {
41
41
  enumerable: true,
42
- get: function () { return chunkOYA42WZ4_cjs.callToolText; }
42
+ get: function () { return chunk7LQXYJPQ_cjs.callToolText; }
43
43
  });
44
44
  Object.defineProperty(exports, "dualPathEvidenceOutputSchema", {
45
45
  enumerable: true,
46
- get: function () { return chunkOYA42WZ4_cjs.dualPathEvidenceOutputSchema; }
46
+ get: function () { return chunk7LQXYJPQ_cjs.dualPathEvidenceOutputSchema; }
47
47
  });
48
48
  Object.defineProperty(exports, "fileDownloadEvidenceOutputSchema", {
49
49
  enumerable: true,
50
- get: function () { return chunkOYA42WZ4_cjs.fileDownloadEvidenceOutputSchema; }
50
+ get: function () { return chunk7LQXYJPQ_cjs.fileDownloadEvidenceOutputSchema; }
51
51
  });
52
52
  Object.defineProperty(exports, "fileTools", {
53
53
  enumerable: true,
54
- get: function () { return chunkOYA42WZ4_cjs.fileTools; }
54
+ get: function () { return chunk7LQXYJPQ_cjs.fileTools; }
55
55
  });
56
56
  Object.defineProperty(exports, "pluginManagementTools", {
57
57
  enumerable: true,
58
- get: function () { return chunkOYA42WZ4_cjs.pluginManagementTools; }
58
+ get: function () { return chunk7LQXYJPQ_cjs.pluginManagementTools; }
59
59
  });
60
60
  Object.defineProperty(exports, "pluginTabTools", {
61
61
  enumerable: true,
62
- get: function () { return chunkOYA42WZ4_cjs.pluginTabTools; }
62
+ get: function () { return chunk7LQXYJPQ_cjs.pluginTabTools; }
63
63
  });
64
64
  Object.defineProperty(exports, "request", {
65
65
  enumerable: true,
66
- get: function () { return chunkOYA42WZ4_cjs.request; }
66
+ get: function () { return chunk7LQXYJPQ_cjs.request; }
67
67
  });
68
68
  Object.defineProperty(exports, "rootedPathEvidenceOutputSchema", {
69
69
  enumerable: true,
70
- get: function () { return chunkOYA42WZ4_cjs.rootedPathEvidenceOutputSchema; }
70
+ get: function () { return chunk7LQXYJPQ_cjs.rootedPathEvidenceOutputSchema; }
71
71
  });
72
72
  Object.defineProperty(exports, "rootedWriteEvidenceOutputSchema", {
73
73
  enumerable: true,
74
- get: function () { return chunkOYA42WZ4_cjs.rootedWriteEvidenceOutputSchema; }
74
+ get: function () { return chunk7LQXYJPQ_cjs.rootedWriteEvidenceOutputSchema; }
75
75
  });
76
76
  Object.defineProperty(exports, "seaCloudTools", {
77
77
  enumerable: true,
78
- get: function () { return chunkOYA42WZ4_cjs.seaCloudTools; }
78
+ get: function () { return chunk7LQXYJPQ_cjs.seaCloudTools; }
79
79
  });
80
80
  Object.defineProperty(exports, "seastudio", {
81
81
  enumerable: true,
82
- get: function () { return chunkOYA42WZ4_cjs.seastudio; }
82
+ get: function () { return chunk7LQXYJPQ_cjs.seastudio; }
83
83
  });
84
84
  Object.defineProperty(exports, "shellCommandEvidenceOutputSchema", {
85
85
  enumerable: true,
86
- get: function () { return chunkOYA42WZ4_cjs.shellCommandEvidenceOutputSchema; }
86
+ get: function () { return chunk7LQXYJPQ_cjs.shellCommandEvidenceOutputSchema; }
87
87
  });
88
88
  Object.defineProperty(exports, "shellSessionSnapshotEvidenceOutputSchema", {
89
89
  enumerable: true,
90
- get: function () { return chunkOYA42WZ4_cjs.shellSessionSnapshotEvidenceOutputSchema; }
90
+ get: function () { return chunk7LQXYJPQ_cjs.shellSessionSnapshotEvidenceOutputSchema; }
91
91
  });
92
92
  Object.defineProperty(exports, "shellTools", {
93
93
  enumerable: true,
94
- get: function () { return chunkOYA42WZ4_cjs.shellTools; }
94
+ get: function () { return chunk7LQXYJPQ_cjs.shellTools; }
95
95
  });
96
96
  Object.defineProperty(exports, "tools", {
97
97
  enumerable: true,
98
- get: function () { return chunkOYA42WZ4_cjs.tools; }
98
+ get: function () { return chunk7LQXYJPQ_cjs.tools; }
99
99
  });
@@ -81,6 +81,8 @@ interface SeastudioSinglePathOptions {
81
81
  }
82
82
  interface SeastudioFileDownloadOptions {
83
83
  rootId?: SeastudioFilesystemRootId;
84
+ /** 若设置则下载到该本地绝对目录(可含 ~),忽略 path 与 rootId */
85
+ absoluteDir?: string;
84
86
  }
85
87
  interface SeastudioFileSearchOptions {
86
88
  rootId?: SeastudioFilesystemRootId;
@@ -288,6 +290,12 @@ declare const SeastudioNotifications: {
288
290
  readonly SESSION_SUMMARY: "session:summary";
289
291
  /** Agent 对话 session:从宿主列表移除(删除/归档等) */
290
292
  readonly SESSION_REMOVED: "session:removed";
293
+ /**
294
+ * Agent 在初始化或线程列表与当前选中稳定后,向宿主全量同步:
295
+ * 每个 agent 实例(通常每项目一个)下的会话列表与当前选中的 sessionId。
296
+ * 宿主应用此通知重建侧栏列表,避免仅靠逐条 SESSION_CREATED 时重启后空白。
297
+ */
298
+ readonly SESSION_STATE_SNAPSHOT: "session:state_snapshot";
291
299
  /**
292
300
  * 宿主请求 Agent 新建一条对话会话(例如侧栏项目行的「+」)。
293
301
  * 通过 notifications/publish + publishTo 定向到对应 Agent 实例。
@@ -455,7 +463,7 @@ interface SessionCreatedParams extends SessionNotificationBase {
455
463
  /** 是否同时成为当前选中的 session */
456
464
  isActive?: boolean;
457
465
  }
458
- type SessionSelectedReason = 'user' | 'agent' | 'host';
466
+ type SessionSelectedReason = 'user' | 'agent' | 'host' | 'host_restore';
459
467
  interface SessionSelectedParams extends SessionNotificationBase {
460
468
  /** 变化原因:侧栏点击多为 host,Agent 内切换多为 agent */
461
469
  reason?: SessionSelectedReason;
@@ -472,6 +480,28 @@ interface SessionRemovedParams extends SessionNotificationBase {
472
480
  /** 移除原因,便于调试或 UI 提示 */
473
481
  reason?: 'deleted' | 'archived' | 'closed';
474
482
  }
483
+ /** 单条会话在快照中的描述(与侧栏展示字段对齐,不含消息正文) */
484
+ interface SessionSnapshotItem {
485
+ sessionId: string;
486
+ title?: string;
487
+ summary?: string;
488
+ updatedAt?: string;
489
+ /** 若提供 selectedSessionId,宿主应以该 id 为准标记 isActive */
490
+ isActive?: boolean;
491
+ }
492
+ /** 单个 agent 实例(通常对应一个项目)下的会话全量视图 */
493
+ interface AgentInstanceSessionSnapshot {
494
+ agentInstanceId: string;
495
+ projectId: string;
496
+ /** 当前选中的会话;可为 null 表示无选中 */
497
+ selectedSessionId: string | null;
498
+ sessions: SessionSnapshotItem[];
499
+ }
500
+ /** Agent → 宿主:会话状态全量快照(单 iframe 可只传一条 instances) */
501
+ interface SessionStateSnapshotParams {
502
+ reason?: 'init' | 'refresh';
503
+ instances: AgentInstanceSessionSnapshot[];
504
+ }
475
505
  /** 宿主请求新建会话(无 sessionId,由 Agent 创建后通过 SESSION_CREATED 回传) */
476
506
  interface SessionNewRequestedParams {
477
507
  agentInstanceId: string;
@@ -496,4 +526,4 @@ interface SessionDeleteRequestedParams {
496
526
  declare const allTools: MCPTool[];
497
527
  declare const tools: MCPTool[];
498
528
 
499
- export { type FileDeletedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type RootsChangedParams, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioDragDropParams, type SeastudioDragEnterParams, type SeastudioDragFileData, type SeastudioDragRootId, type SeastudioDragStartParams, type SeastudioFileDownloadOptions, type SeastudioFileInfo, type SeastudioFileInfoOptions, type SeastudioFileListOptions, type SeastudioFileReadOptions, type SeastudioFileSearchMatch, type SeastudioFileSearchOptions, type SeastudioFileTransferOptions, type SeastudioFileTreeOptions, type SeastudioFilesystemRoot, type SeastudioFilesystemRootId, SeastudioNotifications, SeastudioRequests, type SeastudioShellCommandResult, type SeastudioShellSessionEntry, type SeastudioShellSessionEntryLevel, type SeastudioShellSessionSnapshot, type SeastudioSinglePathOptions, type SeastudioWorkspacePathMode, type SessionCreatedParams, type SessionDeleteRequestedParams, type SessionNewRequestedParams, type SessionNotificationBase, type SessionRemovedParams, type SessionSelectedParams, type SessionSelectedReason, type SessionSummaryParams, type TextSendRequestedParams, type TextSendRequestedSelectionRange, type TextSendRequestedSource, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, callTool, callToolText, dualPathEvidenceOutputSchema, fileDownloadEvidenceOutputSchema, fileTools, pluginManagementTools, pluginTabTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, seaCloudTools, seastudio, shellCommandEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, tools };
529
+ export { type AgentInstanceSessionSnapshot, type FileDeletedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type RootsChangedParams, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioDragDropParams, type SeastudioDragEnterParams, type SeastudioDragFileData, type SeastudioDragRootId, type SeastudioDragStartParams, type SeastudioFileDownloadOptions, type SeastudioFileInfo, type SeastudioFileInfoOptions, type SeastudioFileListOptions, type SeastudioFileReadOptions, type SeastudioFileSearchMatch, type SeastudioFileSearchOptions, type SeastudioFileTransferOptions, type SeastudioFileTreeOptions, type SeastudioFilesystemRoot, type SeastudioFilesystemRootId, SeastudioNotifications, SeastudioRequests, type SeastudioShellCommandResult, type SeastudioShellSessionEntry, type SeastudioShellSessionEntryLevel, type SeastudioShellSessionSnapshot, type SeastudioSinglePathOptions, type SeastudioWorkspacePathMode, type SessionCreatedParams, type SessionDeleteRequestedParams, type SessionNewRequestedParams, type SessionNotificationBase, type SessionRemovedParams, type SessionSelectedParams, type SessionSelectedReason, type SessionSnapshotItem, type SessionStateSnapshotParams, type SessionSummaryParams, type TextSendRequestedParams, type TextSendRequestedSelectionRange, type TextSendRequestedSource, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, callTool, callToolText, dualPathEvidenceOutputSchema, fileDownloadEvidenceOutputSchema, fileTools, pluginManagementTools, pluginTabTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, seaCloudTools, seastudio, shellCommandEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, tools };
@@ -81,6 +81,8 @@ interface SeastudioSinglePathOptions {
81
81
  }
82
82
  interface SeastudioFileDownloadOptions {
83
83
  rootId?: SeastudioFilesystemRootId;
84
+ /** 若设置则下载到该本地绝对目录(可含 ~),忽略 path 与 rootId */
85
+ absoluteDir?: string;
84
86
  }
85
87
  interface SeastudioFileSearchOptions {
86
88
  rootId?: SeastudioFilesystemRootId;
@@ -288,6 +290,12 @@ declare const SeastudioNotifications: {
288
290
  readonly SESSION_SUMMARY: "session:summary";
289
291
  /** Agent 对话 session:从宿主列表移除(删除/归档等) */
290
292
  readonly SESSION_REMOVED: "session:removed";
293
+ /**
294
+ * Agent 在初始化或线程列表与当前选中稳定后,向宿主全量同步:
295
+ * 每个 agent 实例(通常每项目一个)下的会话列表与当前选中的 sessionId。
296
+ * 宿主应用此通知重建侧栏列表,避免仅靠逐条 SESSION_CREATED 时重启后空白。
297
+ */
298
+ readonly SESSION_STATE_SNAPSHOT: "session:state_snapshot";
291
299
  /**
292
300
  * 宿主请求 Agent 新建一条对话会话(例如侧栏项目行的「+」)。
293
301
  * 通过 notifications/publish + publishTo 定向到对应 Agent 实例。
@@ -455,7 +463,7 @@ interface SessionCreatedParams extends SessionNotificationBase {
455
463
  /** 是否同时成为当前选中的 session */
456
464
  isActive?: boolean;
457
465
  }
458
- type SessionSelectedReason = 'user' | 'agent' | 'host';
466
+ type SessionSelectedReason = 'user' | 'agent' | 'host' | 'host_restore';
459
467
  interface SessionSelectedParams extends SessionNotificationBase {
460
468
  /** 变化原因:侧栏点击多为 host,Agent 内切换多为 agent */
461
469
  reason?: SessionSelectedReason;
@@ -472,6 +480,28 @@ interface SessionRemovedParams extends SessionNotificationBase {
472
480
  /** 移除原因,便于调试或 UI 提示 */
473
481
  reason?: 'deleted' | 'archived' | 'closed';
474
482
  }
483
+ /** 单条会话在快照中的描述(与侧栏展示字段对齐,不含消息正文) */
484
+ interface SessionSnapshotItem {
485
+ sessionId: string;
486
+ title?: string;
487
+ summary?: string;
488
+ updatedAt?: string;
489
+ /** 若提供 selectedSessionId,宿主应以该 id 为准标记 isActive */
490
+ isActive?: boolean;
491
+ }
492
+ /** 单个 agent 实例(通常对应一个项目)下的会话全量视图 */
493
+ interface AgentInstanceSessionSnapshot {
494
+ agentInstanceId: string;
495
+ projectId: string;
496
+ /** 当前选中的会话;可为 null 表示无选中 */
497
+ selectedSessionId: string | null;
498
+ sessions: SessionSnapshotItem[];
499
+ }
500
+ /** Agent → 宿主:会话状态全量快照(单 iframe 可只传一条 instances) */
501
+ interface SessionStateSnapshotParams {
502
+ reason?: 'init' | 'refresh';
503
+ instances: AgentInstanceSessionSnapshot[];
504
+ }
475
505
  /** 宿主请求新建会话(无 sessionId,由 Agent 创建后通过 SESSION_CREATED 回传) */
476
506
  interface SessionNewRequestedParams {
477
507
  agentInstanceId: string;
@@ -496,4 +526,4 @@ interface SessionDeleteRequestedParams {
496
526
  declare const allTools: MCPTool[];
497
527
  declare const tools: MCPTool[];
498
528
 
499
- export { type FileDeletedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type RootsChangedParams, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioDragDropParams, type SeastudioDragEnterParams, type SeastudioDragFileData, type SeastudioDragRootId, type SeastudioDragStartParams, type SeastudioFileDownloadOptions, type SeastudioFileInfo, type SeastudioFileInfoOptions, type SeastudioFileListOptions, type SeastudioFileReadOptions, type SeastudioFileSearchMatch, type SeastudioFileSearchOptions, type SeastudioFileTransferOptions, type SeastudioFileTreeOptions, type SeastudioFilesystemRoot, type SeastudioFilesystemRootId, SeastudioNotifications, SeastudioRequests, type SeastudioShellCommandResult, type SeastudioShellSessionEntry, type SeastudioShellSessionEntryLevel, type SeastudioShellSessionSnapshot, type SeastudioSinglePathOptions, type SeastudioWorkspacePathMode, type SessionCreatedParams, type SessionDeleteRequestedParams, type SessionNewRequestedParams, type SessionNotificationBase, type SessionRemovedParams, type SessionSelectedParams, type SessionSelectedReason, type SessionSummaryParams, type TextSendRequestedParams, type TextSendRequestedSelectionRange, type TextSendRequestedSource, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, callTool, callToolText, dualPathEvidenceOutputSchema, fileDownloadEvidenceOutputSchema, fileTools, pluginManagementTools, pluginTabTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, seaCloudTools, seastudio, shellCommandEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, tools };
529
+ export { type AgentInstanceSessionSnapshot, type FileDeletedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type RootsChangedParams, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioDragDropParams, type SeastudioDragEnterParams, type SeastudioDragFileData, type SeastudioDragRootId, type SeastudioDragStartParams, type SeastudioFileDownloadOptions, type SeastudioFileInfo, type SeastudioFileInfoOptions, type SeastudioFileListOptions, type SeastudioFileReadOptions, type SeastudioFileSearchMatch, type SeastudioFileSearchOptions, type SeastudioFileTransferOptions, type SeastudioFileTreeOptions, type SeastudioFilesystemRoot, type SeastudioFilesystemRootId, SeastudioNotifications, SeastudioRequests, type SeastudioShellCommandResult, type SeastudioShellSessionEntry, type SeastudioShellSessionEntryLevel, type SeastudioShellSessionSnapshot, type SeastudioSinglePathOptions, type SeastudioWorkspacePathMode, type SessionCreatedParams, type SessionDeleteRequestedParams, type SessionNewRequestedParams, type SessionNotificationBase, type SessionRemovedParams, type SessionSelectedParams, type SessionSelectedReason, type SessionSnapshotItem, type SessionStateSnapshotParams, type SessionSummaryParams, type TextSendRequestedParams, type TextSendRequestedSelectionRange, type TextSendRequestedSource, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, callTool, callToolText, dualPathEvidenceOutputSchema, fileDownloadEvidenceOutputSchema, fileTools, pluginManagementTools, pluginTabTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, seaCloudTools, seastudio, shellCommandEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, tools };
@@ -1,2 +1,2 @@
1
- export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, callTool, callToolText, dualPathEvidenceOutputSchema, fileDownloadEvidenceOutputSchema, fileTools, pluginManagementTools, pluginTabTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, seaCloudTools, seastudio, shellCommandEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, tools } from '../../chunk-HQB2A35M.js';
1
+ export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, callTool, callToolText, dualPathEvidenceOutputSchema, fileDownloadEvidenceOutputSchema, fileTools, pluginManagementTools, pluginTabTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, seaCloudTools, seastudio, shellCommandEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, tools } from '../../chunk-3UVF6MLO.js';
2
2
  import '../../chunk-TJ3CGHWJ.js';
package/dist/ui/index.cjs CHANGED
@@ -1,58 +1,58 @@
1
1
  'use strict';
2
2
 
3
- var chunkSYMWE636_cjs = require('../chunk-SYMWE636.cjs');
3
+ var chunkGEPSOYJN_cjs = require('../chunk-GEPSOYJN.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "DialogBody", {
8
8
  enumerable: true,
9
- get: function () { return chunkSYMWE636_cjs.DialogBody; }
9
+ get: function () { return chunkGEPSOYJN_cjs.DialogBody; }
10
10
  });
11
11
  Object.defineProperty(exports, "DialogButton", {
12
12
  enumerable: true,
13
- get: function () { return chunkSYMWE636_cjs.DialogButton; }
13
+ get: function () { return chunkGEPSOYJN_cjs.DialogButton; }
14
14
  });
15
15
  Object.defineProperty(exports, "DialogContainer", {
16
16
  enumerable: true,
17
- get: function () { return chunkSYMWE636_cjs.DialogContainer; }
17
+ get: function () { return chunkGEPSOYJN_cjs.DialogContainer; }
18
18
  });
19
19
  Object.defineProperty(exports, "DialogFooter", {
20
20
  enumerable: true,
21
- get: function () { return chunkSYMWE636_cjs.DialogFooter; }
21
+ get: function () { return chunkGEPSOYJN_cjs.DialogFooter; }
22
22
  });
23
23
  Object.defineProperty(exports, "DialogHeader", {
24
24
  enumerable: true,
25
- get: function () { return chunkSYMWE636_cjs.DialogHeader; }
25
+ get: function () { return chunkGEPSOYJN_cjs.DialogHeader; }
26
26
  });
27
27
  Object.defineProperty(exports, "DialogOverlay", {
28
28
  enumerable: true,
29
- get: function () { return chunkSYMWE636_cjs.DialogOverlay; }
29
+ get: function () { return chunkGEPSOYJN_cjs.DialogOverlay; }
30
30
  });
31
31
  Object.defineProperty(exports, "MenuContainer", {
32
32
  enumerable: true,
33
- get: function () { return chunkSYMWE636_cjs.MenuContainer; }
33
+ get: function () { return chunkGEPSOYJN_cjs.MenuContainer; }
34
34
  });
35
35
  Object.defineProperty(exports, "MenuEmpty", {
36
36
  enumerable: true,
37
- get: function () { return chunkSYMWE636_cjs.MenuEmpty; }
37
+ get: function () { return chunkGEPSOYJN_cjs.MenuEmpty; }
38
38
  });
39
39
  Object.defineProperty(exports, "MenuItem", {
40
40
  enumerable: true,
41
- get: function () { return chunkSYMWE636_cjs.MenuItem; }
41
+ get: function () { return chunkGEPSOYJN_cjs.MenuItem; }
42
42
  });
43
43
  Object.defineProperty(exports, "MenuSeparator", {
44
44
  enumerable: true,
45
- get: function () { return chunkSYMWE636_cjs.MenuSeparator; }
45
+ get: function () { return chunkGEPSOYJN_cjs.MenuSeparator; }
46
46
  });
47
47
  Object.defineProperty(exports, "Tab", {
48
48
  enumerable: true,
49
- get: function () { return chunkSYMWE636_cjs.Tab; }
49
+ get: function () { return chunkGEPSOYJN_cjs.Tab; }
50
50
  });
51
51
  Object.defineProperty(exports, "cn", {
52
52
  enumerable: true,
53
- get: function () { return chunkSYMWE636_cjs.cn; }
53
+ get: function () { return chunkGEPSOYJN_cjs.cn; }
54
54
  });
55
55
  Object.defineProperty(exports, "showHostContextMenu", {
56
56
  enumerable: true,
57
- get: function () { return chunkSYMWE636_cjs.showHostContextMenu; }
57
+ get: function () { return chunkGEPSOYJN_cjs.showHostContextMenu; }
58
58
  });
package/dist/ui/index.js CHANGED
@@ -1 +1 @@
1
- export { DialogBody, DialogButton, DialogContainer, DialogFooter, DialogHeader, DialogOverlay, MenuContainer, MenuEmpty, MenuItem, MenuSeparator, Tab, cn, showHostContextMenu } from '../chunk-4JAYW5GM.js';
1
+ export { DialogBody, DialogButton, DialogContainer, DialogFooter, DialogHeader, DialogOverlay, MenuContainer, MenuEmpty, MenuItem, MenuSeparator, Tab, cn, showHostContextMenu } from '../chunk-X62SRZS4.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seastudio/sdk",
3
- "version": "3.2.2",
3
+ "version": "3.2.5",
4
4
  "description": "SeaStudio SDK - UI 组件 + MCP 信息交换中心",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",