@seastudio/sdk 5.1.0 → 5.2.0

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.
@@ -536,30 +536,30 @@ var shellTools = [
536
536
  })
537
537
  ];
538
538
 
539
- // src/mcp/seastudio/tools/webview.ts
540
- var SINGLETON_WEBVIEW_RUNTIME_ID = "webview-runtime-default";
541
- var webviewRuntimeIdParam = {
542
- webviewRuntimeId: {
539
+ // src/mcp/seastudio/tools/browser.ts
540
+ var SINGLETON_BROWSER_ID = "browser-default";
541
+ var browserIdParam = {
542
+ browserId: {
543
543
  type: "string",
544
- description: "WebviewRuntime ID\uFF0C\u53EF\u9009\uFF1B\u7F3A\u7701\u4E3A\u5168\u5C40\u5355\u4F8B webview-runtime-default\u3002"
544
+ description: "Browser ID\uFF0C\u53EF\u9009\uFF1B\u7F3A\u7701\u4E3A\u5168\u5C40\u5355\u4F8B browser-default\u3002"
545
545
  }
546
546
  };
547
547
  var tabIdParam = {
548
- tabId: { type: "string", description: "WebviewRuntime tab ID\u3002close/activate/navigate/goBack/goForward/reload/stop \u9700\u8981\u3002" }
548
+ tabId: { type: "string", description: "Browser tab ID\u3002close/activate/navigate/goBack/goForward/reload/stop \u9700\u8981\u3002" }
549
549
  };
550
- var webviewRuntimeTools = [
550
+ var browserTools = [
551
551
  annotateTool({
552
- name: "seastudio-webview_runtime",
553
- description: "\u8BFB\u53D6\u6216\u91CD\u7F6E\u5168\u5C40 WebviewRuntime\u3002\u4F7F\u7528 action \u9009\u62E9 open\u3001list\u3001get \u6216 close\u3002open/get \u8FD4\u56DE\u540C\u4E00\u4E2A webviewRuntimeId\uFF1Bclose \u4F1A\u6E05\u7A7A\u5168\u90E8 tab \u4F46\u4FDD\u7559 runtime \u58F3\u3002",
552
+ name: "seastudio-browser",
553
+ description: "\u8BFB\u53D6\u6216\u91CD\u7F6E Host Browser\u3002\u4F7F\u7528 action \u9009\u62E9 open\u3001list\u3001get \u6216 close\u3002open/get \u8FD4\u56DE\u540C\u4E00\u4E2A browserId\uFF1Bclose \u4F1A\u6E05\u7A7A\u5168\u90E8 tab\u3002",
554
554
  inputSchema: {
555
555
  type: "object",
556
556
  properties: {
557
557
  action: {
558
558
  type: "string",
559
559
  enum: ["open", "list", "get", "close"],
560
- description: "WebviewRuntime \u52A8\u4F5C\u3002\u5168\u5C40\u4EC5\u4E00\u4E2A runtime\uFF1BwebviewRuntimeId \u53EF\u9009\u3002"
560
+ description: "Browser \u52A8\u4F5C\u3002\u5F53\u524D\u5168\u5C40\u53EA\u6709\u4E00\u4E2A browser\uFF1BbrowserId \u53EF\u9009\u3002"
561
561
  },
562
- ...webviewRuntimeIdParam,
562
+ ...browserIdParam,
563
563
  homepage: { type: "string", description: "open \u7684\u53EF\u9009\u9ED8\u8BA4\u9996\u9875\u3002" }
564
564
  },
565
565
  required: ["action"]
@@ -567,43 +567,43 @@ var webviewRuntimeTools = [
567
567
  }, {
568
568
  operationKind: "workflow",
569
569
  requiresExecutionEvidence: false,
570
- rawDomain: "webview"
570
+ rawDomain: "browser"
571
571
  }),
572
572
  annotateTool({
573
- name: "seastudio-webview_runtime_tab",
574
- description: "\u7BA1\u7406\u5168\u5C40 WebviewRuntime \u4E2D\u7684 tab\u3002\u4F7F\u7528 action \u9009\u62E9 create\u3001close\u3001activate\u3001navigate\u3001goBack\u3001goForward\u3001reload \u6216 stop\u3002\u6BCF\u4E2A Host webview \u63D2\u4EF6\u5B9E\u4F8B\u901A\u5E38\u5BF9\u5E94\u4E00\u4E2A ownerInstanceId tab\u3002",
573
+ name: "seastudio-browser_tab",
574
+ description: "\u7BA1\u7406\u5168\u5C40 Browser \u4E2D\u7684 tab\u3002\u4F7F\u7528 action \u9009\u62E9 create\u3001close\u3001activate\u3001navigate\u3001goBack\u3001goForward\u3001reload \u6216 stop\u3002\u6BCF\u4E2A Host browser \u63D2\u4EF6\u5B9E\u4F8B\u901A\u5E38\u5BF9\u5E94\u4E00\u4E2A ownerInstanceId tab\u3002",
575
575
  inputSchema: {
576
576
  type: "object",
577
577
  properties: {
578
578
  action: {
579
579
  type: "string",
580
580
  enum: ["create", "close", "activate", "navigate", "goBack", "goForward", "reload", "stop"],
581
- description: "WebviewRuntime tab \u52A8\u4F5C\u3002webviewRuntimeId \u53EF\u9009\uFF1Bcreate \u53EF\u4F20 ownerInstanceId \u7ED1\u5B9A Host \u63D2\u4EF6\u5B9E\u4F8B\u3002"
581
+ description: "Browser tab \u52A8\u4F5C\u3002browserId \u53EF\u9009\uFF1Bcreate \u53EF\u4F20 ownerInstanceId \u7ED1\u5B9A Host \u63D2\u4EF6\u5B9E\u4F8B\u3002"
582
582
  },
583
- ...webviewRuntimeIdParam,
583
+ ...browserIdParam,
584
584
  ...tabIdParam,
585
585
  url: { type: "string", description: "create \u7684\u521D\u59CB URL\uFF0C\u6216 navigate \u7684\u76EE\u6807 URL/\u641C\u7D22\u8BCD\u3002" },
586
- ownerInstanceId: { type: "string", description: "create \u65F6\u7ED1\u5B9A Host webview \u63D2\u4EF6 instanceId\u3002" }
586
+ ownerInstanceId: { type: "string", description: "create \u65F6\u7ED1\u5B9A Host browser \u63D2\u4EF6 instanceId\u3002" }
587
587
  },
588
588
  required: ["action"]
589
589
  }
590
590
  }, {
591
591
  operationKind: "mutate",
592
592
  requiresExecutionEvidence: false,
593
- rawDomain: "webview"
593
+ rawDomain: "browser"
594
594
  }),
595
595
  annotateTool({
596
- name: "seastudio-webview_runtime_host",
597
- description: "\u5904\u7406 WebviewRuntime \u4E0E UI viewport\u3001\u8BC1\u4E66\u9519\u8BEF\u548C\u9875\u9762\u811A\u672C\u6267\u884C\u76F8\u5173\u7684\u5BBF\u4E3B\u4EA4\u4E92\u3002",
596
+ name: "seastudio-browser_view",
597
+ description: "\u5904\u7406 Browser \u4E0E UI surface\u3001\u8BC1\u4E66\u9519\u8BEF\u548C\u9875\u9762\u811A\u672C\u6267\u884C\u76F8\u5173\u7684\u5BBF\u4E3B\u4EA4\u4E92\u3002",
598
598
  inputSchema: {
599
599
  type: "object",
600
600
  properties: {
601
601
  action: {
602
602
  type: "string",
603
603
  enum: ["bindViewport", "respondCertificate", "evaluate"],
604
- description: "WebviewRuntime host \u52A8\u4F5C\u3002bindViewport \u9700\u8981 rect\uFF1BrespondCertificate \u9700\u8981 requestId \u548C allow\uFF1Bevaluate \u9700\u8981 tabId \u548C script\u3002"
604
+ description: "Browser host \u52A8\u4F5C\u3002bindViewport \u9700\u8981 rect\uFF1BrespondCertificate \u9700\u8981 requestId \u548C allow\uFF1Bevaluate \u9700\u8981 tabId \u548C script\u3002"
605
605
  },
606
- ...webviewRuntimeIdParam,
606
+ ...browserIdParam,
607
607
  ...tabIdParam,
608
608
  ownerInstanceId: { type: "string", description: "bindViewport \u7684 UI owner instance id\u3002" },
609
609
  rect: {
@@ -619,7 +619,7 @@ var webviewRuntimeTools = [
619
619
  },
620
620
  requestId: { type: "string", description: "respondCertificate \u7684\u8BC1\u4E66\u9519\u8BEF\u8BF7\u6C42 ID\u3002" },
621
621
  allow: { type: "boolean", description: "respondCertificate \u662F\u5426\u7EE7\u7EED\u52A0\u8F7D\u8BE5\u8BC1\u4E66\u9519\u8BEF\u9875\u9762\u3002" },
622
- script: { type: "string", description: "evaluate \u8981\u5728 WebviewRuntime \u9875\u9762\u4E2D\u6267\u884C\u7684 JavaScript\u3002" },
622
+ script: { type: "string", description: "evaluate \u8981\u5728 Browser \u9875\u9762\u4E2D\u6267\u884C\u7684 JavaScript\u3002" },
623
623
  timeoutMs: { type: "number", description: "evaluate \u8D85\u65F6\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\u3002" }
624
624
  },
625
625
  required: ["action"]
@@ -627,22 +627,22 @@ var webviewRuntimeTools = [
627
627
  }, {
628
628
  operationKind: "workflow",
629
629
  requiresExecutionEvidence: false,
630
- rawDomain: "webview"
630
+ rawDomain: "browser"
631
631
  }),
632
632
  annotateTool({
633
- name: "seastudio-webview_runtime_show",
634
- description: "\u5728 Host webview runtime \u4E2D\u663E\u793A\u6307\u5B9A URL\uFF08\u53EF\u89C6\u5316\uFF09\u3002\u4F1A\u6253\u5F00\u6216\u6FC0\u6D3B\u5BF9\u5E94 Host \u6807\u7B7E\u9875\uFF0C\u5E76\u628A\u9875\u9762\u5448\u73B0\u7ED9\u7528\u6237\u3002",
633
+ name: "seastudio-browser_show",
634
+ description: "\u5728 Host Browser \u4E2D\u663E\u793A\u6307\u5B9A URL\uFF08\u53EF\u89C6\u5316\uFF09\u3002\u4F1A\u6253\u5F00\u6216\u6FC0\u6D3B\u5BF9\u5E94 Host \u6807\u7B7E\u9875\uFF0C\u5E76\u628A\u9875\u9762\u5448\u73B0\u7ED9\u7528\u6237\u3002",
635
635
  inputSchema: {
636
636
  type: "object",
637
637
  properties: {
638
- url: { type: "string", description: "\u8981\u5728 Host webview runtime \u4E2D\u663E\u793A\u7684 URL \u6216\u641C\u7D22\u8BCD\u3002" }
638
+ url: { type: "string", description: "\u8981\u5728 Host Browser \u4E2D\u663E\u793A\u7684 URL \u6216\u641C\u7D22\u8BCD\u3002" }
639
639
  },
640
640
  required: ["url"]
641
641
  }
642
642
  }, {
643
643
  operationKind: "workflow",
644
644
  requiresExecutionEvidence: false,
645
- rawDomain: "webview"
645
+ rawDomain: "browser"
646
646
  })
647
647
  ];
648
648
 
@@ -889,53 +889,51 @@ var seastudio = {
889
889
  close: (sessionId, force = false) => callShellSessionControl("close", { sessionId, force })
890
890
  }
891
891
  },
892
- webview: {
893
- runtime: {
894
- open: async (options = {}) => parseToolResult(await callTool("seastudio-webview_runtime", { action: "open", ...options })),
895
- list: async () => parseToolResult(await callTool("seastudio-webview_runtime", { action: "list" })),
896
- get: async (webviewRuntimeId = SINGLETON_WEBVIEW_RUNTIME_ID) => parseToolResult(await callTool("seastudio-webview_runtime", { action: "get", webviewRuntimeId })),
897
- close: async (webviewRuntimeId = SINGLETON_WEBVIEW_RUNTIME_ID) => parseToolResult(
898
- await callTool("seastudio-webview_runtime", { action: "close", webviewRuntimeId })
899
- ),
900
- show: async (url) => parseToolResult(
901
- await callTool("seastudio-webview_runtime_show", { url })
902
- ),
903
- evaluate: async (webviewRuntimeId, tabId, script, timeoutMs) => parseToolResult(
904
- await callTool("seastudio-webview_runtime_host", {
905
- action: "evaluate",
906
- webviewRuntimeId,
907
- tabId,
908
- script,
909
- ...timeoutMs ? { timeoutMs } : {}
910
- })
911
- )
912
- },
892
+ browser: {
893
+ open: async (options = {}) => parseToolResult(await callTool("seastudio-browser", { action: "open", ...options })),
894
+ list: async () => parseToolResult(await callTool("seastudio-browser", { action: "list" })),
895
+ get: async (browserId = SINGLETON_BROWSER_ID) => parseToolResult(await callTool("seastudio-browser", { action: "get", browserId })),
896
+ close: async (browserId = SINGLETON_BROWSER_ID) => parseToolResult(
897
+ await callTool("seastudio-browser", { action: "close", browserId })
898
+ ),
899
+ show: async (url) => parseToolResult(
900
+ await callTool("seastudio-browser_show", { url })
901
+ ),
902
+ evaluate: async (browserId, tabId, script, timeoutMs) => parseToolResult(
903
+ await callTool("seastudio-browser_view", {
904
+ action: "evaluate",
905
+ browserId,
906
+ tabId,
907
+ script,
908
+ ...timeoutMs ? { timeoutMs } : {}
909
+ })
910
+ ),
913
911
  tab: {
914
- create: async (webviewRuntimeId = SINGLETON_WEBVIEW_RUNTIME_ID, url, ownerInstanceId) => parseToolResult(
915
- await callTool("seastudio-webview_runtime_tab", {
912
+ create: async (browserId = SINGLETON_BROWSER_ID, url, ownerInstanceId) => parseToolResult(
913
+ await callTool("seastudio-browser_tab", {
916
914
  action: "create",
917
- webviewRuntimeId,
915
+ browserId,
918
916
  ...url ? { url } : {},
919
917
  ...ownerInstanceId ? { ownerInstanceId } : {}
920
918
  })
921
919
  ),
922
- close: async (webviewRuntimeId, tabId) => parseToolResult(
923
- await callTool("seastudio-webview_runtime_tab", { action: "close", webviewRuntimeId, tabId })
920
+ close: async (browserId, tabId) => parseToolResult(
921
+ await callTool("seastudio-browser_tab", { action: "close", browserId, tabId })
924
922
  ),
925
- activate: async (webviewRuntimeId, tabId) => parseToolResult(
926
- await callTool("seastudio-webview_runtime_tab", { action: "activate", webviewRuntimeId, tabId })
923
+ activate: async (browserId, tabId) => parseToolResult(
924
+ await callTool("seastudio-browser_tab", { action: "activate", browserId, tabId })
927
925
  ),
928
- navigate: async (webviewRuntimeId, tabId, url) => parseToolResult(
929
- await callTool("seastudio-webview_runtime_tab", { action: "navigate", webviewRuntimeId, tabId, url })
926
+ navigate: async (browserId, tabId, url) => parseToolResult(
927
+ await callTool("seastudio-browser_tab", { action: "navigate", browserId, tabId, url })
930
928
  ),
931
- goBack: async (webviewRuntimeId, tabId) => parseToolResult(await callTool("seastudio-webview_runtime_tab", { action: "goBack", webviewRuntimeId, tabId })),
932
- goForward: async (webviewRuntimeId, tabId) => parseToolResult(await callTool("seastudio-webview_runtime_tab", { action: "goForward", webviewRuntimeId, tabId })),
933
- reload: async (webviewRuntimeId, tabId) => parseToolResult(await callTool("seastudio-webview_runtime_tab", { action: "reload", webviewRuntimeId, tabId })),
934
- stop: async (webviewRuntimeId, tabId) => parseToolResult(await callTool("seastudio-webview_runtime_tab", { action: "stop", webviewRuntimeId, tabId })),
929
+ goBack: async (browserId, tabId) => parseToolResult(await callTool("seastudio-browser_tab", { action: "goBack", browserId, tabId })),
930
+ goForward: async (browserId, tabId) => parseToolResult(await callTool("seastudio-browser_tab", { action: "goForward", browserId, tabId })),
931
+ reload: async (browserId, tabId) => parseToolResult(await callTool("seastudio-browser_tab", { action: "reload", browserId, tabId })),
932
+ stop: async (browserId, tabId) => parseToolResult(await callTool("seastudio-browser_tab", { action: "stop", browserId, tabId })),
935
933
  getOrCreateForInstance: async (ownerInstanceId, url) => parseToolResult(
936
- await callTool("seastudio-webview_runtime_tab", {
934
+ await callTool("seastudio-browser_tab", {
937
935
  action: "create",
938
- webviewRuntimeId: SINGLETON_WEBVIEW_RUNTIME_ID,
936
+ browserId: SINGLETON_BROWSER_ID,
939
937
  ownerInstanceId,
940
938
  ...url ? { url } : {}
941
939
  })
@@ -943,17 +941,17 @@ var seastudio = {
943
941
  },
944
942
  viewport: {
945
943
  bind: async (rect, options = {}) => parseToolResult(
946
- await callTool("seastudio-webview_runtime_host", {
944
+ await callTool("seastudio-browser_view", {
947
945
  action: "bindViewport",
948
- webviewRuntimeId: options.webviewRuntimeId ?? SINGLETON_WEBVIEW_RUNTIME_ID,
946
+ browserId: options.browserId ?? SINGLETON_BROWSER_ID,
949
947
  rect,
950
948
  ...options.ownerInstanceId ? { ownerInstanceId: options.ownerInstanceId } : {}
951
949
  })
952
950
  )
953
951
  },
954
952
  certificate: {
955
- respond: async (webviewRuntimeId, requestId, allow) => parseToolResult(
956
- await callTool("seastudio-webview_runtime_host", { action: "respondCertificate", webviewRuntimeId, requestId, allow })
953
+ respond: async (browserId, requestId, allow) => parseToolResult(
954
+ await callTool("seastudio-browser_view", { action: "respondCertificate", browserId, requestId, allow })
957
955
  )
958
956
  }
959
957
  }
@@ -1198,14 +1196,14 @@ var SeastudioNotifications = {
1198
1196
  PROPOSAL_FEEDBACK: "seastudio:proposal-feedback",
1199
1197
  /** 插件实例请求更新宿主 plugin tab 标题 */
1200
1198
  PLUGIN_TAB_TITLE_CHANGED: "plugin:tab-title_changed",
1201
- /** WebviewRuntime 状态变化 */
1202
- WEBVIEW_RUNTIME_STATE_CHANGED: "webview-runtime:state_changed",
1203
- /** WebviewRuntime 关闭 */
1204
- WEBVIEW_RUNTIME_CLOSED: "webview-runtime:closed",
1205
- /** WebviewRuntime 证书错误,需要客户端 UI 决策 */
1206
- WEBVIEW_RUNTIME_CERTIFICATE_ERROR: "webview-runtime:certificate_error",
1207
- /** WebviewRuntime 收到网页新标签请求 */
1208
- WEBVIEW_RUNTIME_NEW_TAB_REQUESTED: "webview-runtime:new_tab_requested",
1199
+ /** Browser 状态变化 */
1200
+ BROWSER_STATE_CHANGED: "browser:state_changed",
1201
+ /** Browser 关闭 */
1202
+ BROWSER_CLOSED: "browser:closed",
1203
+ /** Browser 证书错误,需要客户端 UI 决策 */
1204
+ BROWSER_CERTIFICATE_ERROR: "browser:certificate_error",
1205
+ /** Browser 收到网页新标签请求 */
1206
+ BROWSER_NEW_TAB_REQUESTED: "browser:new_tab_requested",
1209
1207
  /**
1210
1208
  * Agent 对话 session:新建。消息历史仍由 Agent 前端持有,宿主仅同步列表用于侧栏。
1211
1209
  * 通常由 Agent 通过 notifications/publish 发出;其他订阅者(含 host-ui)可据此更新 UI。
@@ -1274,8 +1272,8 @@ var allTools = [
1274
1272
  ...agentTabTools,
1275
1273
  ...projectTools,
1276
1274
  ...skillTools,
1277
- ...webviewRuntimeTools
1275
+ ...browserTools
1278
1276
  ];
1279
1277
  var tools = allTools;
1280
1278
 
1281
- export { SINGLETON_WEBVIEW_RUNTIME_ID, SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, callTool, callToolText, dualPathEvidenceOutputSchema, editorTools, fileDownloadEvidenceOutputSchema, fileSaveAsEvidenceOutputSchema, fileTools, fileUrlEvidenceOutputSchema, gitTools, pluginManagementTools, pluginTabTools, projectTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, runOneShotShellCommand, seastudio, shellSessionCloseEvidenceOutputSchema, shellSessionOpenEvidenceOutputSchema, shellSessionRunEvidenceOutputSchema, shellSessionSignalEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, skillTools, tools, webviewRuntimeTools };
1279
+ export { SINGLETON_BROWSER_ID, SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, browserTools, callTool, callToolText, dualPathEvidenceOutputSchema, editorTools, fileDownloadEvidenceOutputSchema, fileSaveAsEvidenceOutputSchema, fileTools, fileUrlEvidenceOutputSchema, gitTools, pluginManagementTools, pluginTabTools, projectTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, runOneShotShellCommand, seastudio, shellSessionCloseEvidenceOutputSchema, shellSessionOpenEvidenceOutputSchema, shellSessionRunEvidenceOutputSchema, shellSessionSignalEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, skillTools, tools };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkCHTNN2X3_cjs = require('./chunk-CHTNN2X3.cjs');
3
+ var chunkLWANMGZ7_cjs = require('./chunk-LWANMGZ7.cjs');
4
4
  var chunk77OAWBLL_cjs = require('./chunk-77OAWBLL.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/Git/\u63D2\u4EF6\u57FA\u7840\u80FD\u529B", tools: chunkCHTNN2X3_cjs.allTools }
14
+ { id: "seastudio", name: "SeaStudio", description: "\u6587\u4EF6/Shell/Git/\u63D2\u4EF6\u57FA\u7840\u80FD\u529B", tools: chunkLWANMGZ7_cjs.allTools }
15
15
  ];
16
16
  function mcpToolToOpenAI(tool) {
17
17
  const normalizedTool = chunk77OAWBLL_cjs.normalizeMCPTool(tool);
@@ -29,7 +29,7 @@ function mcpToolToOpenAI(tool) {
29
29
  };
30
30
  }
31
31
  function listAllTools() {
32
- return [...chunkCHTNN2X3_cjs.allTools];
32
+ return [...chunkLWANMGZ7_cjs.allTools];
33
33
  }
34
34
  function toPackageName(source) {
35
35
  if (source === "seastudio") {
@@ -62,7 +62,7 @@ function normalizeAvailableTool(raw) {
62
62
  };
63
63
  }
64
64
  var MCP_TOOL_PACKAGE_INDEX = new Map(
65
- chunkCHTNN2X3_cjs.allTools.map((tool) => [tool.name, "seastudio"])
65
+ chunkLWANMGZ7_cjs.allTools.map((tool) => [tool.name, "seastudio"])
66
66
  );
67
67
  function getMCPToolPackageIndex() {
68
68
  return new Map(MCP_TOOL_PACKAGE_INDEX);
@@ -538,30 +538,30 @@ var shellTools = [
538
538
  })
539
539
  ];
540
540
 
541
- // src/mcp/seastudio/tools/webview.ts
542
- var SINGLETON_WEBVIEW_RUNTIME_ID = "webview-runtime-default";
543
- var webviewRuntimeIdParam = {
544
- webviewRuntimeId: {
541
+ // src/mcp/seastudio/tools/browser.ts
542
+ var SINGLETON_BROWSER_ID = "browser-default";
543
+ var browserIdParam = {
544
+ browserId: {
545
545
  type: "string",
546
- description: "WebviewRuntime ID\uFF0C\u53EF\u9009\uFF1B\u7F3A\u7701\u4E3A\u5168\u5C40\u5355\u4F8B webview-runtime-default\u3002"
546
+ description: "Browser ID\uFF0C\u53EF\u9009\uFF1B\u7F3A\u7701\u4E3A\u5168\u5C40\u5355\u4F8B browser-default\u3002"
547
547
  }
548
548
  };
549
549
  var tabIdParam = {
550
- tabId: { type: "string", description: "WebviewRuntime tab ID\u3002close/activate/navigate/goBack/goForward/reload/stop \u9700\u8981\u3002" }
550
+ tabId: { type: "string", description: "Browser tab ID\u3002close/activate/navigate/goBack/goForward/reload/stop \u9700\u8981\u3002" }
551
551
  };
552
- var webviewRuntimeTools = [
552
+ var browserTools = [
553
553
  annotateTool({
554
- name: "seastudio-webview_runtime",
555
- description: "\u8BFB\u53D6\u6216\u91CD\u7F6E\u5168\u5C40 WebviewRuntime\u3002\u4F7F\u7528 action \u9009\u62E9 open\u3001list\u3001get \u6216 close\u3002open/get \u8FD4\u56DE\u540C\u4E00\u4E2A webviewRuntimeId\uFF1Bclose \u4F1A\u6E05\u7A7A\u5168\u90E8 tab \u4F46\u4FDD\u7559 runtime \u58F3\u3002",
554
+ name: "seastudio-browser",
555
+ description: "\u8BFB\u53D6\u6216\u91CD\u7F6E Host Browser\u3002\u4F7F\u7528 action \u9009\u62E9 open\u3001list\u3001get \u6216 close\u3002open/get \u8FD4\u56DE\u540C\u4E00\u4E2A browserId\uFF1Bclose \u4F1A\u6E05\u7A7A\u5168\u90E8 tab\u3002",
556
556
  inputSchema: {
557
557
  type: "object",
558
558
  properties: {
559
559
  action: {
560
560
  type: "string",
561
561
  enum: ["open", "list", "get", "close"],
562
- description: "WebviewRuntime \u52A8\u4F5C\u3002\u5168\u5C40\u4EC5\u4E00\u4E2A runtime\uFF1BwebviewRuntimeId \u53EF\u9009\u3002"
562
+ description: "Browser \u52A8\u4F5C\u3002\u5F53\u524D\u5168\u5C40\u53EA\u6709\u4E00\u4E2A browser\uFF1BbrowserId \u53EF\u9009\u3002"
563
563
  },
564
- ...webviewRuntimeIdParam,
564
+ ...browserIdParam,
565
565
  homepage: { type: "string", description: "open \u7684\u53EF\u9009\u9ED8\u8BA4\u9996\u9875\u3002" }
566
566
  },
567
567
  required: ["action"]
@@ -569,43 +569,43 @@ var webviewRuntimeTools = [
569
569
  }, {
570
570
  operationKind: "workflow",
571
571
  requiresExecutionEvidence: false,
572
- rawDomain: "webview"
572
+ rawDomain: "browser"
573
573
  }),
574
574
  annotateTool({
575
- name: "seastudio-webview_runtime_tab",
576
- description: "\u7BA1\u7406\u5168\u5C40 WebviewRuntime \u4E2D\u7684 tab\u3002\u4F7F\u7528 action \u9009\u62E9 create\u3001close\u3001activate\u3001navigate\u3001goBack\u3001goForward\u3001reload \u6216 stop\u3002\u6BCF\u4E2A Host webview \u63D2\u4EF6\u5B9E\u4F8B\u901A\u5E38\u5BF9\u5E94\u4E00\u4E2A ownerInstanceId tab\u3002",
575
+ name: "seastudio-browser_tab",
576
+ description: "\u7BA1\u7406\u5168\u5C40 Browser \u4E2D\u7684 tab\u3002\u4F7F\u7528 action \u9009\u62E9 create\u3001close\u3001activate\u3001navigate\u3001goBack\u3001goForward\u3001reload \u6216 stop\u3002\u6BCF\u4E2A Host browser \u63D2\u4EF6\u5B9E\u4F8B\u901A\u5E38\u5BF9\u5E94\u4E00\u4E2A ownerInstanceId tab\u3002",
577
577
  inputSchema: {
578
578
  type: "object",
579
579
  properties: {
580
580
  action: {
581
581
  type: "string",
582
582
  enum: ["create", "close", "activate", "navigate", "goBack", "goForward", "reload", "stop"],
583
- description: "WebviewRuntime tab \u52A8\u4F5C\u3002webviewRuntimeId \u53EF\u9009\uFF1Bcreate \u53EF\u4F20 ownerInstanceId \u7ED1\u5B9A Host \u63D2\u4EF6\u5B9E\u4F8B\u3002"
583
+ description: "Browser tab \u52A8\u4F5C\u3002browserId \u53EF\u9009\uFF1Bcreate \u53EF\u4F20 ownerInstanceId \u7ED1\u5B9A Host \u63D2\u4EF6\u5B9E\u4F8B\u3002"
584
584
  },
585
- ...webviewRuntimeIdParam,
585
+ ...browserIdParam,
586
586
  ...tabIdParam,
587
587
  url: { type: "string", description: "create \u7684\u521D\u59CB URL\uFF0C\u6216 navigate \u7684\u76EE\u6807 URL/\u641C\u7D22\u8BCD\u3002" },
588
- ownerInstanceId: { type: "string", description: "create \u65F6\u7ED1\u5B9A Host webview \u63D2\u4EF6 instanceId\u3002" }
588
+ ownerInstanceId: { type: "string", description: "create \u65F6\u7ED1\u5B9A Host browser \u63D2\u4EF6 instanceId\u3002" }
589
589
  },
590
590
  required: ["action"]
591
591
  }
592
592
  }, {
593
593
  operationKind: "mutate",
594
594
  requiresExecutionEvidence: false,
595
- rawDomain: "webview"
595
+ rawDomain: "browser"
596
596
  }),
597
597
  annotateTool({
598
- name: "seastudio-webview_runtime_host",
599
- description: "\u5904\u7406 WebviewRuntime \u4E0E UI viewport\u3001\u8BC1\u4E66\u9519\u8BEF\u548C\u9875\u9762\u811A\u672C\u6267\u884C\u76F8\u5173\u7684\u5BBF\u4E3B\u4EA4\u4E92\u3002",
598
+ name: "seastudio-browser_view",
599
+ description: "\u5904\u7406 Browser \u4E0E UI surface\u3001\u8BC1\u4E66\u9519\u8BEF\u548C\u9875\u9762\u811A\u672C\u6267\u884C\u76F8\u5173\u7684\u5BBF\u4E3B\u4EA4\u4E92\u3002",
600
600
  inputSchema: {
601
601
  type: "object",
602
602
  properties: {
603
603
  action: {
604
604
  type: "string",
605
605
  enum: ["bindViewport", "respondCertificate", "evaluate"],
606
- description: "WebviewRuntime host \u52A8\u4F5C\u3002bindViewport \u9700\u8981 rect\uFF1BrespondCertificate \u9700\u8981 requestId \u548C allow\uFF1Bevaluate \u9700\u8981 tabId \u548C script\u3002"
606
+ description: "Browser host \u52A8\u4F5C\u3002bindViewport \u9700\u8981 rect\uFF1BrespondCertificate \u9700\u8981 requestId \u548C allow\uFF1Bevaluate \u9700\u8981 tabId \u548C script\u3002"
607
607
  },
608
- ...webviewRuntimeIdParam,
608
+ ...browserIdParam,
609
609
  ...tabIdParam,
610
610
  ownerInstanceId: { type: "string", description: "bindViewport \u7684 UI owner instance id\u3002" },
611
611
  rect: {
@@ -621,7 +621,7 @@ var webviewRuntimeTools = [
621
621
  },
622
622
  requestId: { type: "string", description: "respondCertificate \u7684\u8BC1\u4E66\u9519\u8BEF\u8BF7\u6C42 ID\u3002" },
623
623
  allow: { type: "boolean", description: "respondCertificate \u662F\u5426\u7EE7\u7EED\u52A0\u8F7D\u8BE5\u8BC1\u4E66\u9519\u8BEF\u9875\u9762\u3002" },
624
- script: { type: "string", description: "evaluate \u8981\u5728 WebviewRuntime \u9875\u9762\u4E2D\u6267\u884C\u7684 JavaScript\u3002" },
624
+ script: { type: "string", description: "evaluate \u8981\u5728 Browser \u9875\u9762\u4E2D\u6267\u884C\u7684 JavaScript\u3002" },
625
625
  timeoutMs: { type: "number", description: "evaluate \u8D85\u65F6\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\u3002" }
626
626
  },
627
627
  required: ["action"]
@@ -629,22 +629,22 @@ var webviewRuntimeTools = [
629
629
  }, {
630
630
  operationKind: "workflow",
631
631
  requiresExecutionEvidence: false,
632
- rawDomain: "webview"
632
+ rawDomain: "browser"
633
633
  }),
634
634
  annotateTool({
635
- name: "seastudio-webview_runtime_show",
636
- description: "\u5728 Host webview runtime \u4E2D\u663E\u793A\u6307\u5B9A URL\uFF08\u53EF\u89C6\u5316\uFF09\u3002\u4F1A\u6253\u5F00\u6216\u6FC0\u6D3B\u5BF9\u5E94 Host \u6807\u7B7E\u9875\uFF0C\u5E76\u628A\u9875\u9762\u5448\u73B0\u7ED9\u7528\u6237\u3002",
635
+ name: "seastudio-browser_show",
636
+ description: "\u5728 Host Browser \u4E2D\u663E\u793A\u6307\u5B9A URL\uFF08\u53EF\u89C6\u5316\uFF09\u3002\u4F1A\u6253\u5F00\u6216\u6FC0\u6D3B\u5BF9\u5E94 Host \u6807\u7B7E\u9875\uFF0C\u5E76\u628A\u9875\u9762\u5448\u73B0\u7ED9\u7528\u6237\u3002",
637
637
  inputSchema: {
638
638
  type: "object",
639
639
  properties: {
640
- url: { type: "string", description: "\u8981\u5728 Host webview runtime \u4E2D\u663E\u793A\u7684 URL \u6216\u641C\u7D22\u8BCD\u3002" }
640
+ url: { type: "string", description: "\u8981\u5728 Host Browser \u4E2D\u663E\u793A\u7684 URL \u6216\u641C\u7D22\u8BCD\u3002" }
641
641
  },
642
642
  required: ["url"]
643
643
  }
644
644
  }, {
645
645
  operationKind: "workflow",
646
646
  requiresExecutionEvidence: false,
647
- rawDomain: "webview"
647
+ rawDomain: "browser"
648
648
  })
649
649
  ];
650
650
 
@@ -891,53 +891,51 @@ var seastudio = {
891
891
  close: (sessionId, force = false) => callShellSessionControl("close", { sessionId, force })
892
892
  }
893
893
  },
894
- webview: {
895
- runtime: {
896
- open: async (options = {}) => parseToolResult(await callTool("seastudio-webview_runtime", { action: "open", ...options })),
897
- list: async () => parseToolResult(await callTool("seastudio-webview_runtime", { action: "list" })),
898
- get: async (webviewRuntimeId = SINGLETON_WEBVIEW_RUNTIME_ID) => parseToolResult(await callTool("seastudio-webview_runtime", { action: "get", webviewRuntimeId })),
899
- close: async (webviewRuntimeId = SINGLETON_WEBVIEW_RUNTIME_ID) => parseToolResult(
900
- await callTool("seastudio-webview_runtime", { action: "close", webviewRuntimeId })
901
- ),
902
- show: async (url) => parseToolResult(
903
- await callTool("seastudio-webview_runtime_show", { url })
904
- ),
905
- evaluate: async (webviewRuntimeId, tabId, script, timeoutMs) => parseToolResult(
906
- await callTool("seastudio-webview_runtime_host", {
907
- action: "evaluate",
908
- webviewRuntimeId,
909
- tabId,
910
- script,
911
- ...timeoutMs ? { timeoutMs } : {}
912
- })
913
- )
914
- },
894
+ browser: {
895
+ open: async (options = {}) => parseToolResult(await callTool("seastudio-browser", { action: "open", ...options })),
896
+ list: async () => parseToolResult(await callTool("seastudio-browser", { action: "list" })),
897
+ get: async (browserId = SINGLETON_BROWSER_ID) => parseToolResult(await callTool("seastudio-browser", { action: "get", browserId })),
898
+ close: async (browserId = SINGLETON_BROWSER_ID) => parseToolResult(
899
+ await callTool("seastudio-browser", { action: "close", browserId })
900
+ ),
901
+ show: async (url) => parseToolResult(
902
+ await callTool("seastudio-browser_show", { url })
903
+ ),
904
+ evaluate: async (browserId, tabId, script, timeoutMs) => parseToolResult(
905
+ await callTool("seastudio-browser_view", {
906
+ action: "evaluate",
907
+ browserId,
908
+ tabId,
909
+ script,
910
+ ...timeoutMs ? { timeoutMs } : {}
911
+ })
912
+ ),
915
913
  tab: {
916
- create: async (webviewRuntimeId = SINGLETON_WEBVIEW_RUNTIME_ID, url, ownerInstanceId) => parseToolResult(
917
- await callTool("seastudio-webview_runtime_tab", {
914
+ create: async (browserId = SINGLETON_BROWSER_ID, url, ownerInstanceId) => parseToolResult(
915
+ await callTool("seastudio-browser_tab", {
918
916
  action: "create",
919
- webviewRuntimeId,
917
+ browserId,
920
918
  ...url ? { url } : {},
921
919
  ...ownerInstanceId ? { ownerInstanceId } : {}
922
920
  })
923
921
  ),
924
- close: async (webviewRuntimeId, tabId) => parseToolResult(
925
- await callTool("seastudio-webview_runtime_tab", { action: "close", webviewRuntimeId, tabId })
922
+ close: async (browserId, tabId) => parseToolResult(
923
+ await callTool("seastudio-browser_tab", { action: "close", browserId, tabId })
926
924
  ),
927
- activate: async (webviewRuntimeId, tabId) => parseToolResult(
928
- await callTool("seastudio-webview_runtime_tab", { action: "activate", webviewRuntimeId, tabId })
925
+ activate: async (browserId, tabId) => parseToolResult(
926
+ await callTool("seastudio-browser_tab", { action: "activate", browserId, tabId })
929
927
  ),
930
- navigate: async (webviewRuntimeId, tabId, url) => parseToolResult(
931
- await callTool("seastudio-webview_runtime_tab", { action: "navigate", webviewRuntimeId, tabId, url })
928
+ navigate: async (browserId, tabId, url) => parseToolResult(
929
+ await callTool("seastudio-browser_tab", { action: "navigate", browserId, tabId, url })
932
930
  ),
933
- goBack: async (webviewRuntimeId, tabId) => parseToolResult(await callTool("seastudio-webview_runtime_tab", { action: "goBack", webviewRuntimeId, tabId })),
934
- goForward: async (webviewRuntimeId, tabId) => parseToolResult(await callTool("seastudio-webview_runtime_tab", { action: "goForward", webviewRuntimeId, tabId })),
935
- reload: async (webviewRuntimeId, tabId) => parseToolResult(await callTool("seastudio-webview_runtime_tab", { action: "reload", webviewRuntimeId, tabId })),
936
- stop: async (webviewRuntimeId, tabId) => parseToolResult(await callTool("seastudio-webview_runtime_tab", { action: "stop", webviewRuntimeId, tabId })),
931
+ goBack: async (browserId, tabId) => parseToolResult(await callTool("seastudio-browser_tab", { action: "goBack", browserId, tabId })),
932
+ goForward: async (browserId, tabId) => parseToolResult(await callTool("seastudio-browser_tab", { action: "goForward", browserId, tabId })),
933
+ reload: async (browserId, tabId) => parseToolResult(await callTool("seastudio-browser_tab", { action: "reload", browserId, tabId })),
934
+ stop: async (browserId, tabId) => parseToolResult(await callTool("seastudio-browser_tab", { action: "stop", browserId, tabId })),
937
935
  getOrCreateForInstance: async (ownerInstanceId, url) => parseToolResult(
938
- await callTool("seastudio-webview_runtime_tab", {
936
+ await callTool("seastudio-browser_tab", {
939
937
  action: "create",
940
- webviewRuntimeId: SINGLETON_WEBVIEW_RUNTIME_ID,
938
+ browserId: SINGLETON_BROWSER_ID,
941
939
  ownerInstanceId,
942
940
  ...url ? { url } : {}
943
941
  })
@@ -945,17 +943,17 @@ var seastudio = {
945
943
  },
946
944
  viewport: {
947
945
  bind: async (rect, options = {}) => parseToolResult(
948
- await callTool("seastudio-webview_runtime_host", {
946
+ await callTool("seastudio-browser_view", {
949
947
  action: "bindViewport",
950
- webviewRuntimeId: options.webviewRuntimeId ?? SINGLETON_WEBVIEW_RUNTIME_ID,
948
+ browserId: options.browserId ?? SINGLETON_BROWSER_ID,
951
949
  rect,
952
950
  ...options.ownerInstanceId ? { ownerInstanceId: options.ownerInstanceId } : {}
953
951
  })
954
952
  )
955
953
  },
956
954
  certificate: {
957
- respond: async (webviewRuntimeId, requestId, allow) => parseToolResult(
958
- await callTool("seastudio-webview_runtime_host", { action: "respondCertificate", webviewRuntimeId, requestId, allow })
955
+ respond: async (browserId, requestId, allow) => parseToolResult(
956
+ await callTool("seastudio-browser_view", { action: "respondCertificate", browserId, requestId, allow })
959
957
  )
960
958
  }
961
959
  }
@@ -1200,14 +1198,14 @@ var SeastudioNotifications = {
1200
1198
  PROPOSAL_FEEDBACK: "seastudio:proposal-feedback",
1201
1199
  /** 插件实例请求更新宿主 plugin tab 标题 */
1202
1200
  PLUGIN_TAB_TITLE_CHANGED: "plugin:tab-title_changed",
1203
- /** WebviewRuntime 状态变化 */
1204
- WEBVIEW_RUNTIME_STATE_CHANGED: "webview-runtime:state_changed",
1205
- /** WebviewRuntime 关闭 */
1206
- WEBVIEW_RUNTIME_CLOSED: "webview-runtime:closed",
1207
- /** WebviewRuntime 证书错误,需要客户端 UI 决策 */
1208
- WEBVIEW_RUNTIME_CERTIFICATE_ERROR: "webview-runtime:certificate_error",
1209
- /** WebviewRuntime 收到网页新标签请求 */
1210
- WEBVIEW_RUNTIME_NEW_TAB_REQUESTED: "webview-runtime:new_tab_requested",
1201
+ /** Browser 状态变化 */
1202
+ BROWSER_STATE_CHANGED: "browser:state_changed",
1203
+ /** Browser 关闭 */
1204
+ BROWSER_CLOSED: "browser:closed",
1205
+ /** Browser 证书错误,需要客户端 UI 决策 */
1206
+ BROWSER_CERTIFICATE_ERROR: "browser:certificate_error",
1207
+ /** Browser 收到网页新标签请求 */
1208
+ BROWSER_NEW_TAB_REQUESTED: "browser:new_tab_requested",
1211
1209
  /**
1212
1210
  * Agent 对话 session:新建。消息历史仍由 Agent 前端持有,宿主仅同步列表用于侧栏。
1213
1211
  * 通常由 Agent 通过 notifications/publish 发出;其他订阅者(含 host-ui)可据此更新 UI。
@@ -1276,11 +1274,11 @@ var allTools = [
1276
1274
  ...agentTabTools,
1277
1275
  ...projectTools,
1278
1276
  ...skillTools,
1279
- ...webviewRuntimeTools
1277
+ ...browserTools
1280
1278
  ];
1281
1279
  var tools = allTools;
1282
1280
 
1283
- exports.SINGLETON_WEBVIEW_RUNTIME_ID = SINGLETON_WEBVIEW_RUNTIME_ID;
1281
+ exports.SINGLETON_BROWSER_ID = SINGLETON_BROWSER_ID;
1284
1282
  exports.SeastudioNotifications = SeastudioNotifications;
1285
1283
  exports.SeastudioRequests = SeastudioRequests;
1286
1284
  exports.agentManagementTools = agentManagementTools;
@@ -1288,6 +1286,7 @@ exports.agentTabTools = agentTabTools;
1288
1286
  exports.allTools = allTools;
1289
1287
  exports.annotateTool = annotateTool;
1290
1288
  exports.batchFlattenCopyEvidenceOutputSchema = batchFlattenCopyEvidenceOutputSchema;
1289
+ exports.browserTools = browserTools;
1291
1290
  exports.callTool = callTool;
1292
1291
  exports.callToolText = callToolText;
1293
1292
  exports.dualPathEvidenceOutputSchema = dualPathEvidenceOutputSchema;
@@ -1313,4 +1312,3 @@ exports.shellSessionSnapshotEvidenceOutputSchema = shellSessionSnapshotEvidenceO
1313
1312
  exports.shellTools = shellTools;
1314
1313
  exports.skillTools = skillTools;
1315
1314
  exports.tools = tools;
1316
- exports.webviewRuntimeTools = webviewRuntimeTools;
@@ -1,4 +1,4 @@
1
- import { allTools } from './chunk-PN3WUVKZ.js';
1
+ import { allTools } from './chunk-352PJTT7.js';
2
2
  import { normalizeMCPTool, normalizeMCPToolObjectSchema, getDefaultClient } from './chunk-6XG5DRQW.js';
3
3
 
4
4
  // src/mcp/index.ts