@seastudio/sdk 4.0.18 → 5.1.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.
- package/README.md +10 -5
- package/dist/{chunk-TJ3CGHWJ.js → chunk-6XG5DRQW.js} +0 -9
- package/dist/{chunk-3I7UM66P.cjs → chunk-77OAWBLL.cjs} +0 -9
- package/dist/{chunk-M5UESV5E.cjs → chunk-CHTNN2X3.cjs} +87 -85
- package/dist/{chunk-LMANS2IQ.js → chunk-ELOYCCXA.js} +2 -2
- package/dist/{chunk-IAAA5JF6.js → chunk-PN3WUVKZ.js} +83 -81
- package/dist/{chunk-UIRFMS2U.cjs → chunk-SIAVXTH5.cjs} +10 -10
- package/dist/index.cjs +45 -45
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/mcp/core/index.cjs +22 -22
- package/dist/mcp/core/index.d.cts +2 -2
- package/dist/mcp/core/index.d.ts +2 -2
- package/dist/mcp/core/index.js +1 -1
- package/dist/mcp/index.cjs +45 -45
- package/dist/mcp/index.d.cts +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +3 -3
- package/dist/mcp/seastudio/index.cjs +40 -40
- package/dist/mcp/seastudio/index.d.cts +102 -63
- package/dist/mcp/seastudio/index.d.ts +102 -63
- package/dist/mcp/seastudio/index.js +2 -2
- package/dist/{types-D7xY0bt6.d.cts → types-S2uWCEaN.d.cts} +1 -1
- package/dist/{types-D7xY0bt6.d.ts → types-S2uWCEaN.d.ts} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,9 +19,9 @@ pnpm add @seastudio/sdk
|
|
|
19
19
|
| `@seastudio/sdk/mcp/seastudio` | SeaStudio host tools, notifications, and DTO types |
|
|
20
20
|
| `@seastudio/sdk/styles/cosmos.css` | Shared design-system CSS |
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Authentication Session Contract
|
|
23
23
|
|
|
24
|
-
External plugins can subscribe to host-owned
|
|
24
|
+
External plugins can subscribe to host-owned authentication session state without receiving SeaArt tokens.
|
|
25
25
|
|
|
26
26
|
```ts
|
|
27
27
|
import { SeastudioNotifications, type AuthSessionChangedParams } from '@seastudio/sdk/mcp';
|
|
@@ -73,13 +73,13 @@ pnpm release:pack
|
|
|
73
73
|
|
|
74
74
|
## Release Policy
|
|
75
75
|
|
|
76
|
-
`@seastudio/sdk` is the public contract consumed by external plugins. New plugin-facing events, DTOs, tools, or exported types require a semver version bump and a release through GitLab CI.
|
|
76
|
+
`@seastudio/sdk` is the public contract consumed by external plugins. New plugin-facing events, DTOs, tools, or exported types require a semver version bump and a release through GitLab CI. Breaking contract renames require a major version bump.
|
|
77
77
|
|
|
78
78
|
Releases are made from protected tags named `sdk-v<version>`, for example:
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
git tag -a sdk-
|
|
82
|
-
git push origin sdk-
|
|
81
|
+
git tag -a sdk-v5.0.0 -m "Release @seastudio/sdk 5.0.0"
|
|
82
|
+
git push origin sdk-v5.0.0
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
Protected `sdk-v*` tags automatically run `verify:release-artifact` and then
|
|
@@ -88,6 +88,11 @@ masked `NPM_TOKEN` CI variable. The token must be an npm granular access token
|
|
|
88
88
|
scoped to `@seastudio/sdk` publish access and configured to bypass 2FA for CI
|
|
89
89
|
publishing.
|
|
90
90
|
|
|
91
|
+
Do not configure `publish:npm` as a GitLab manual job or protected environment
|
|
92
|
+
deployment. The release gate is the protected `sdk-v*` tag plus the protected
|
|
93
|
+
`NPM_TOKEN`; adding an environment approval reintroduces the same human-click
|
|
94
|
+
path that CI publishing is meant to remove.
|
|
95
|
+
|
|
91
96
|
Do not publish this package from a personal shell as the normal release path.
|
|
92
97
|
The package `prepublishOnly` hook enforces this: local `npm publish`/`pnpm publish`
|
|
93
98
|
fails before contacting npm, so it cannot fall through to an interactive 2FA OTP
|
|
@@ -204,12 +204,6 @@ function setDefaultTransport(transport) {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
// src/mcp/core/client.ts
|
|
207
|
-
var LONG_RUNNING_TOOL_TIMEOUTS = /* @__PURE__ */ new Set([
|
|
208
|
-
"seaflow-canvas_task_wait_result",
|
|
209
|
-
"seaflow-canvas_execute_node_and_wait",
|
|
210
|
-
"seaflow-canvas_task_reconnect"
|
|
211
|
-
]);
|
|
212
|
-
var LONG_RUNNING_TOOL_TIMEOUT_MS = 125e3;
|
|
213
207
|
var readPositiveTimeout = (value) => {
|
|
214
208
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
|
|
215
209
|
return null;
|
|
@@ -286,9 +280,6 @@ var MCPClient = class {
|
|
|
286
280
|
if (argTimeout != null) {
|
|
287
281
|
return Math.max(this.timeout, argTimeout + 5e3);
|
|
288
282
|
}
|
|
289
|
-
if (LONG_RUNNING_TOOL_TIMEOUTS.has(name)) {
|
|
290
|
-
return Math.max(this.timeout, LONG_RUNNING_TOOL_TIMEOUT_MS);
|
|
291
|
-
}
|
|
292
283
|
return this.timeout;
|
|
293
284
|
}
|
|
294
285
|
async callTool(name, args = {}, options) {
|
|
@@ -206,12 +206,6 @@ function setDefaultTransport(transport) {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
// src/mcp/core/client.ts
|
|
209
|
-
var LONG_RUNNING_TOOL_TIMEOUTS = /* @__PURE__ */ new Set([
|
|
210
|
-
"seaflow-canvas_task_wait_result",
|
|
211
|
-
"seaflow-canvas_execute_node_and_wait",
|
|
212
|
-
"seaflow-canvas_task_reconnect"
|
|
213
|
-
]);
|
|
214
|
-
var LONG_RUNNING_TOOL_TIMEOUT_MS = 125e3;
|
|
215
209
|
var readPositiveTimeout = (value) => {
|
|
216
210
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
|
|
217
211
|
return null;
|
|
@@ -288,9 +282,6 @@ var MCPClient = class {
|
|
|
288
282
|
if (argTimeout != null) {
|
|
289
283
|
return Math.max(this.timeout, argTimeout + 5e3);
|
|
290
284
|
}
|
|
291
|
-
if (LONG_RUNNING_TOOL_TIMEOUTS.has(name)) {
|
|
292
|
-
return Math.max(this.timeout, LONG_RUNNING_TOOL_TIMEOUT_MS);
|
|
293
|
-
}
|
|
294
285
|
return this.timeout;
|
|
295
286
|
}
|
|
296
287
|
async callTool(name, args = {}, options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk77OAWBLL_cjs = require('./chunk-77OAWBLL.cjs');
|
|
4
4
|
|
|
5
5
|
// src/mcp/seastudio/tools/file.ts
|
|
6
6
|
function annotateTool(tool, annotations, outputSchema) {
|
|
@@ -538,30 +538,30 @@ var shellTools = [
|
|
|
538
538
|
})
|
|
539
539
|
];
|
|
540
540
|
|
|
541
|
-
// src/mcp/seastudio/tools/
|
|
542
|
-
var
|
|
543
|
-
var
|
|
544
|
-
|
|
541
|
+
// src/mcp/seastudio/tools/webview.ts
|
|
542
|
+
var SINGLETON_WEBVIEW_RUNTIME_ID = "webview-runtime-default";
|
|
543
|
+
var webviewRuntimeIdParam = {
|
|
544
|
+
webviewRuntimeId: {
|
|
545
545
|
type: "string",
|
|
546
|
-
description: "
|
|
546
|
+
description: "WebviewRuntime ID\uFF0C\u53EF\u9009\uFF1B\u7F3A\u7701\u4E3A\u5168\u5C40\u5355\u4F8B webview-runtime-default\u3002"
|
|
547
547
|
}
|
|
548
548
|
};
|
|
549
549
|
var tabIdParam = {
|
|
550
|
-
tabId: { type: "string", description: "
|
|
550
|
+
tabId: { type: "string", description: "WebviewRuntime tab ID\u3002close/activate/navigate/goBack/goForward/reload/stop \u9700\u8981\u3002" }
|
|
551
551
|
};
|
|
552
|
-
var
|
|
552
|
+
var webviewRuntimeTools = [
|
|
553
553
|
annotateTool({
|
|
554
|
-
name: "seastudio-
|
|
555
|
-
description: "\u8BFB\u53D6\u6216\u91CD\u7F6E\u5168\u5C40
|
|
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",
|
|
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: "
|
|
562
|
+
description: "WebviewRuntime \u52A8\u4F5C\u3002\u5168\u5C40\u4EC5\u4E00\u4E2A runtime\uFF1BwebviewRuntimeId \u53EF\u9009\u3002"
|
|
563
563
|
},
|
|
564
|
-
...
|
|
564
|
+
...webviewRuntimeIdParam,
|
|
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 browserRuntimeTools = [
|
|
|
569
569
|
}, {
|
|
570
570
|
operationKind: "workflow",
|
|
571
571
|
requiresExecutionEvidence: false,
|
|
572
|
-
rawDomain: "
|
|
572
|
+
rawDomain: "webview"
|
|
573
573
|
}),
|
|
574
574
|
annotateTool({
|
|
575
|
-
name: "seastudio-
|
|
576
|
-
description: "\u7BA1\u7406\u5168\u5C40
|
|
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",
|
|
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: "
|
|
583
|
+
description: "WebviewRuntime tab \u52A8\u4F5C\u3002webviewRuntimeId \u53EF\u9009\uFF1Bcreate \u53EF\u4F20 ownerInstanceId \u7ED1\u5B9A Host \u63D2\u4EF6\u5B9E\u4F8B\u3002"
|
|
584
584
|
},
|
|
585
|
-
...
|
|
585
|
+
...webviewRuntimeIdParam,
|
|
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
|
|
588
|
+
ownerInstanceId: { type: "string", description: "create \u65F6\u7ED1\u5B9A Host webview \u63D2\u4EF6 instanceId\u3002" }
|
|
589
589
|
},
|
|
590
590
|
required: ["action"]
|
|
591
591
|
}
|
|
592
592
|
}, {
|
|
593
593
|
operationKind: "mutate",
|
|
594
594
|
requiresExecutionEvidence: false,
|
|
595
|
-
rawDomain: "
|
|
595
|
+
rawDomain: "webview"
|
|
596
596
|
}),
|
|
597
597
|
annotateTool({
|
|
598
|
-
name: "seastudio-
|
|
599
|
-
description: "\u5904\u7406
|
|
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",
|
|
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: "
|
|
606
|
+
description: "WebviewRuntime host \u52A8\u4F5C\u3002bindViewport \u9700\u8981 rect\uFF1BrespondCertificate \u9700\u8981 requestId \u548C allow\uFF1Bevaluate \u9700\u8981 tabId \u548C script\u3002"
|
|
607
607
|
},
|
|
608
|
-
...
|
|
608
|
+
...webviewRuntimeIdParam,
|
|
609
609
|
...tabIdParam,
|
|
610
610
|
ownerInstanceId: { type: "string", description: "bindViewport \u7684 UI owner instance id\u3002" },
|
|
611
611
|
rect: {
|
|
@@ -621,7 +621,7 @@ var browserRuntimeTools = [
|
|
|
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
|
|
624
|
+
script: { type: "string", description: "evaluate \u8981\u5728 WebviewRuntime \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 browserRuntimeTools = [
|
|
|
629
629
|
}, {
|
|
630
630
|
operationKind: "workflow",
|
|
631
631
|
requiresExecutionEvidence: false,
|
|
632
|
-
rawDomain: "
|
|
632
|
+
rawDomain: "webview"
|
|
633
633
|
}),
|
|
634
634
|
annotateTool({
|
|
635
|
-
name: "seastudio-
|
|
636
|
-
description: "\u5728
|
|
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",
|
|
637
637
|
inputSchema: {
|
|
638
638
|
type: "object",
|
|
639
639
|
properties: {
|
|
640
|
-
url: { type: "string", description: "\u8981\u5728
|
|
640
|
+
url: { type: "string", description: "\u8981\u5728 Host webview runtime \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: "
|
|
647
|
+
rawDomain: "webview"
|
|
648
648
|
})
|
|
649
649
|
];
|
|
650
650
|
|
|
@@ -661,13 +661,13 @@ function parseToolResult(result) {
|
|
|
661
661
|
return text ? JSON.parse(text) : {};
|
|
662
662
|
}
|
|
663
663
|
async function callTool(name, args = {}) {
|
|
664
|
-
return
|
|
664
|
+
return chunk77OAWBLL_cjs.getDefaultClient().callTool(name, args);
|
|
665
665
|
}
|
|
666
666
|
async function request(method, params) {
|
|
667
|
-
return
|
|
667
|
+
return chunk77OAWBLL_cjs.getDefaultClient().request(method, params);
|
|
668
668
|
}
|
|
669
669
|
async function callToolText(name, args = {}) {
|
|
670
|
-
return
|
|
670
|
+
return chunk77OAWBLL_cjs.getDefaultClient().callToolText(name, args);
|
|
671
671
|
}
|
|
672
672
|
function usesAbsolutePathMode(mode) {
|
|
673
673
|
return mode === "absolute";
|
|
@@ -891,73 +891,71 @@ var seastudio = {
|
|
|
891
891
|
close: (sessionId, force = false) => callShellSessionControl("close", { sessionId, force })
|
|
892
892
|
}
|
|
893
893
|
},
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
open: async (options = {}) => parseToolResult(await callTool("seastudio-
|
|
897
|
-
list: async () => parseToolResult(await callTool("seastudio-
|
|
898
|
-
get: async (
|
|
899
|
-
close: async (
|
|
900
|
-
await callTool("seastudio-
|
|
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
|
+
})
|
|
901
913
|
)
|
|
902
914
|
},
|
|
903
|
-
show: async (url) => parseToolResult(
|
|
904
|
-
await callTool("seastudio-browser_show", { url })
|
|
905
|
-
),
|
|
906
915
|
tab: {
|
|
907
|
-
create: async (
|
|
908
|
-
await callTool("seastudio-
|
|
916
|
+
create: async (webviewRuntimeId = SINGLETON_WEBVIEW_RUNTIME_ID, url, ownerInstanceId) => parseToolResult(
|
|
917
|
+
await callTool("seastudio-webview_runtime_tab", {
|
|
909
918
|
action: "create",
|
|
910
|
-
|
|
919
|
+
webviewRuntimeId,
|
|
911
920
|
...url ? { url } : {},
|
|
912
921
|
...ownerInstanceId ? { ownerInstanceId } : {}
|
|
913
922
|
})
|
|
914
923
|
),
|
|
915
|
-
close: async (
|
|
916
|
-
await callTool("seastudio-
|
|
924
|
+
close: async (webviewRuntimeId, tabId) => parseToolResult(
|
|
925
|
+
await callTool("seastudio-webview_runtime_tab", { action: "close", webviewRuntimeId, tabId })
|
|
917
926
|
),
|
|
918
|
-
activate: async (
|
|
919
|
-
await callTool("seastudio-
|
|
927
|
+
activate: async (webviewRuntimeId, tabId) => parseToolResult(
|
|
928
|
+
await callTool("seastudio-webview_runtime_tab", { action: "activate", webviewRuntimeId, tabId })
|
|
920
929
|
),
|
|
921
|
-
navigate: async (
|
|
922
|
-
await callTool("seastudio-
|
|
930
|
+
navigate: async (webviewRuntimeId, tabId, url) => parseToolResult(
|
|
931
|
+
await callTool("seastudio-webview_runtime_tab", { action: "navigate", webviewRuntimeId, tabId, url })
|
|
923
932
|
),
|
|
924
|
-
goBack: async (
|
|
925
|
-
goForward: async (
|
|
926
|
-
reload: async (
|
|
927
|
-
stop: async (
|
|
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 })),
|
|
928
937
|
getOrCreateForInstance: async (ownerInstanceId, url) => parseToolResult(
|
|
929
|
-
await callTool("seastudio-
|
|
938
|
+
await callTool("seastudio-webview_runtime_tab", {
|
|
930
939
|
action: "create",
|
|
931
|
-
|
|
940
|
+
webviewRuntimeId: SINGLETON_WEBVIEW_RUNTIME_ID,
|
|
932
941
|
ownerInstanceId,
|
|
933
942
|
...url ? { url } : {}
|
|
934
943
|
})
|
|
935
944
|
)
|
|
936
945
|
},
|
|
937
946
|
viewport: {
|
|
938
|
-
bind: async (
|
|
939
|
-
await callTool("seastudio-
|
|
947
|
+
bind: async (rect, options = {}) => parseToolResult(
|
|
948
|
+
await callTool("seastudio-webview_runtime_host", {
|
|
940
949
|
action: "bindViewport",
|
|
941
|
-
|
|
950
|
+
webviewRuntimeId: options.webviewRuntimeId ?? SINGLETON_WEBVIEW_RUNTIME_ID,
|
|
942
951
|
rect,
|
|
943
|
-
...ownerInstanceId ? { ownerInstanceId } : {}
|
|
944
|
-
})
|
|
945
|
-
)
|
|
946
|
-
},
|
|
947
|
-
runtime: {
|
|
948
|
-
evaluate: async (browserSessionId, tabId, script, timeoutMs) => parseToolResult(
|
|
949
|
-
await callTool("seastudio-browser_runtime", {
|
|
950
|
-
action: "evaluate",
|
|
951
|
-
browserSessionId,
|
|
952
|
-
tabId,
|
|
953
|
-
script,
|
|
954
|
-
...timeoutMs ? { timeoutMs } : {}
|
|
952
|
+
...options.ownerInstanceId ? { ownerInstanceId: options.ownerInstanceId } : {}
|
|
955
953
|
})
|
|
956
954
|
)
|
|
957
955
|
},
|
|
958
956
|
certificate: {
|
|
959
|
-
respond: async (
|
|
960
|
-
await callTool("seastudio-
|
|
957
|
+
respond: async (webviewRuntimeId, requestId, allow) => parseToolResult(
|
|
958
|
+
await callTool("seastudio-webview_runtime_host", { action: "respondCertificate", webviewRuntimeId, requestId, allow })
|
|
961
959
|
)
|
|
962
960
|
}
|
|
963
961
|
}
|
|
@@ -1202,14 +1200,14 @@ var SeastudioNotifications = {
|
|
|
1202
1200
|
PROPOSAL_FEEDBACK: "seastudio:proposal-feedback",
|
|
1203
1201
|
/** 插件实例请求更新宿主 plugin tab 标题 */
|
|
1204
1202
|
PLUGIN_TAB_TITLE_CHANGED: "plugin:tab-title_changed",
|
|
1205
|
-
/**
|
|
1206
|
-
|
|
1207
|
-
/**
|
|
1208
|
-
|
|
1209
|
-
/**
|
|
1210
|
-
|
|
1211
|
-
/**
|
|
1212
|
-
|
|
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",
|
|
1213
1211
|
/**
|
|
1214
1212
|
* Agent 对话 session:新建。消息历史仍由 Agent 前端持有,宿主仅同步列表用于侧栏。
|
|
1215
1213
|
* 通常由 Agent 通过 notifications/publish 发出;其他订阅者(含 host-ui)可据此更新 UI。
|
|
@@ -1258,6 +1256,10 @@ var SeastudioNotifications = {
|
|
|
1258
1256
|
HOST_APP_VISIBILITY: "host:app_visibility",
|
|
1259
1257
|
/** Host MCP tools/list 发生变化(例如 Seaflow bridge 动态注册工具) */
|
|
1260
1258
|
RUNTIME_TOOLS_CHANGED: "mcp:runtime_tools_changed",
|
|
1259
|
+
/** Host 精确路由到插件实例的工具调用请求 */
|
|
1260
|
+
PLUGIN_TOOL_CALL: "plugin:tool_call",
|
|
1261
|
+
/** 插件实例返回给 Host 的工具调用结果 */
|
|
1262
|
+
PLUGIN_TOOL_RESULT: "plugin:tool_result",
|
|
1261
1263
|
/** 主程序用户登录态变化;不包含访问令牌 */
|
|
1262
1264
|
AUTH_SESSION_CHANGED: "auth:session_changed"
|
|
1263
1265
|
};
|
|
@@ -1274,11 +1276,11 @@ var allTools = [
|
|
|
1274
1276
|
...agentTabTools,
|
|
1275
1277
|
...projectTools,
|
|
1276
1278
|
...skillTools,
|
|
1277
|
-
...
|
|
1279
|
+
...webviewRuntimeTools
|
|
1278
1280
|
];
|
|
1279
1281
|
var tools = allTools;
|
|
1280
1282
|
|
|
1281
|
-
exports.
|
|
1283
|
+
exports.SINGLETON_WEBVIEW_RUNTIME_ID = SINGLETON_WEBVIEW_RUNTIME_ID;
|
|
1282
1284
|
exports.SeastudioNotifications = SeastudioNotifications;
|
|
1283
1285
|
exports.SeastudioRequests = SeastudioRequests;
|
|
1284
1286
|
exports.agentManagementTools = agentManagementTools;
|
|
@@ -1286,7 +1288,6 @@ exports.agentTabTools = agentTabTools;
|
|
|
1286
1288
|
exports.allTools = allTools;
|
|
1287
1289
|
exports.annotateTool = annotateTool;
|
|
1288
1290
|
exports.batchFlattenCopyEvidenceOutputSchema = batchFlattenCopyEvidenceOutputSchema;
|
|
1289
|
-
exports.browserRuntimeTools = browserRuntimeTools;
|
|
1290
1291
|
exports.callTool = callTool;
|
|
1291
1292
|
exports.callToolText = callToolText;
|
|
1292
1293
|
exports.dualPathEvidenceOutputSchema = dualPathEvidenceOutputSchema;
|
|
@@ -1312,3 +1313,4 @@ exports.shellSessionSnapshotEvidenceOutputSchema = shellSessionSnapshotEvidenceO
|
|
|
1312
1313
|
exports.shellTools = shellTools;
|
|
1313
1314
|
exports.skillTools = skillTools;
|
|
1314
1315
|
exports.tools = tools;
|
|
1316
|
+
exports.webviewRuntimeTools = webviewRuntimeTools;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { allTools } from './chunk-
|
|
2
|
-
import { normalizeMCPTool, normalizeMCPToolObjectSchema, getDefaultClient } from './chunk-
|
|
1
|
+
import { allTools } from './chunk-PN3WUVKZ.js';
|
|
2
|
+
import { normalizeMCPTool, normalizeMCPToolObjectSchema, getDefaultClient } from './chunk-6XG5DRQW.js';
|
|
3
3
|
|
|
4
4
|
// src/mcp/index.ts
|
|
5
5
|
async function loadPlugin(pluginName) {
|