@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as MCPTool, h as MCPToolAnnotations, j as MCPToolInputSchema, k as MCPToolResult } from '../../types-
|
|
1
|
+
import { g as MCPTool, h as MCPToolAnnotations, j as MCPToolInputSchema, k as MCPToolResult } from '../../types-S2uWCEaN.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Git 共享类型契约
|
|
@@ -336,50 +336,54 @@ interface SeastudioShellOneShotResult {
|
|
|
336
336
|
durationMs: number;
|
|
337
337
|
timedOut: boolean;
|
|
338
338
|
}
|
|
339
|
-
type
|
|
340
|
-
interface
|
|
339
|
+
type SeastudioWebviewRuntimeStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
340
|
+
interface SeastudioWebviewRuntimeCertificateError {
|
|
341
341
|
requestId: string;
|
|
342
342
|
url: string;
|
|
343
343
|
error: string;
|
|
344
344
|
}
|
|
345
|
-
interface
|
|
345
|
+
interface SeastudioWebviewRuntimeTab {
|
|
346
346
|
id: string;
|
|
347
347
|
title: string;
|
|
348
348
|
url: string | null;
|
|
349
|
-
status:
|
|
349
|
+
status: SeastudioWebviewRuntimeStatus;
|
|
350
350
|
errorMessage: string | null;
|
|
351
351
|
canGoBack: boolean;
|
|
352
352
|
canGoForward: boolean;
|
|
353
|
-
certificateError?:
|
|
353
|
+
certificateError?: SeastudioWebviewRuntimeCertificateError | null;
|
|
354
354
|
ownerInstanceId?: string;
|
|
355
355
|
}
|
|
356
|
-
interface
|
|
357
|
-
|
|
356
|
+
interface SeastudioWebviewRuntimeState {
|
|
357
|
+
webviewRuntimeId: string;
|
|
358
358
|
label?: string;
|
|
359
|
-
|
|
359
|
+
storagePartitionKey: string;
|
|
360
360
|
homepage: string;
|
|
361
|
-
tabs:
|
|
361
|
+
tabs: SeastudioWebviewRuntimeTab[];
|
|
362
362
|
activeTabId: string | null;
|
|
363
363
|
}
|
|
364
|
-
interface
|
|
364
|
+
interface SeastudioWebviewRuntime extends SeastudioWebviewRuntimeState {
|
|
365
365
|
createdAt: number;
|
|
366
366
|
updatedAt: number;
|
|
367
367
|
}
|
|
368
|
-
interface
|
|
368
|
+
interface SeastudioWebviewRuntimeOpenOptions {
|
|
369
369
|
label?: string;
|
|
370
|
-
|
|
370
|
+
storagePartitionKey?: string;
|
|
371
371
|
homepage?: string;
|
|
372
372
|
}
|
|
373
|
-
interface
|
|
373
|
+
interface SeastudioWebviewViewportRect {
|
|
374
374
|
x: number;
|
|
375
375
|
y: number;
|
|
376
376
|
width: number;
|
|
377
377
|
height: number;
|
|
378
378
|
}
|
|
379
|
-
interface
|
|
380
|
-
|
|
379
|
+
interface SeastudioWebviewRuntimeViewportBinding {
|
|
380
|
+
webviewRuntimeId: string;
|
|
381
|
+
ownerInstanceId?: string;
|
|
382
|
+
rect: SeastudioWebviewViewportRect;
|
|
383
|
+
}
|
|
384
|
+
interface SeastudioWebviewRuntimeViewportBindOptions {
|
|
385
|
+
webviewRuntimeId?: string;
|
|
381
386
|
ownerInstanceId?: string;
|
|
382
|
-
rect: SeastudioBrowserRect;
|
|
383
387
|
}
|
|
384
388
|
declare function callTool(name: string, args?: Record<string, unknown>): Promise<MCPToolResult>;
|
|
385
389
|
declare function request<T = unknown>(method: string, params?: Record<string, unknown>): Promise<T>;
|
|
@@ -481,73 +485,71 @@ declare const seastudio: {
|
|
|
481
485
|
close: (sessionId: string, force?: boolean) => Promise<MCPToolResult>;
|
|
482
486
|
};
|
|
483
487
|
};
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
open: (options?:
|
|
488
|
+
webview: {
|
|
489
|
+
runtime: {
|
|
490
|
+
open: (options?: SeastudioWebviewRuntimeOpenOptions) => Promise<SeastudioWebviewRuntime>;
|
|
487
491
|
list: () => Promise<{
|
|
488
|
-
|
|
492
|
+
runtimes: SeastudioWebviewRuntime[];
|
|
489
493
|
}>;
|
|
490
|
-
get: (
|
|
491
|
-
close: (
|
|
492
|
-
|
|
494
|
+
get: (webviewRuntimeId?: string) => Promise<SeastudioWebviewRuntime>;
|
|
495
|
+
close: (webviewRuntimeId?: string) => Promise<{
|
|
496
|
+
webviewRuntimeId: string;
|
|
493
497
|
closed: boolean;
|
|
494
498
|
}>;
|
|
499
|
+
show: (url: string) => Promise<{
|
|
500
|
+
url: string;
|
|
501
|
+
webviewRuntimeId: string;
|
|
502
|
+
instanceId?: string;
|
|
503
|
+
tab?: SeastudioWebviewRuntimeTab;
|
|
504
|
+
}>;
|
|
505
|
+
evaluate: <T = unknown>(webviewRuntimeId: string, tabId: string, script: string, timeoutMs?: number) => Promise<{
|
|
506
|
+
result: T;
|
|
507
|
+
}>;
|
|
495
508
|
};
|
|
496
|
-
show: (url: string) => Promise<{
|
|
497
|
-
url: string;
|
|
498
|
-
browserSessionId: string;
|
|
499
|
-
instanceId?: string;
|
|
500
|
-
tab?: SeastudioBrowserTab;
|
|
501
|
-
}>;
|
|
502
509
|
tab: {
|
|
503
|
-
create: (
|
|
504
|
-
|
|
505
|
-
tab:
|
|
510
|
+
create: (webviewRuntimeId?: string, url?: string, ownerInstanceId?: string) => Promise<{
|
|
511
|
+
webviewRuntimeId: string;
|
|
512
|
+
tab: SeastudioWebviewRuntimeTab;
|
|
506
513
|
activeTabId: string;
|
|
507
514
|
}>;
|
|
508
|
-
close: (
|
|
509
|
-
|
|
515
|
+
close: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
516
|
+
webviewRuntimeId: string;
|
|
510
517
|
closedTabId: string;
|
|
511
518
|
activeTabId: string | null;
|
|
512
519
|
}>;
|
|
513
|
-
activate: (
|
|
514
|
-
|
|
520
|
+
activate: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
521
|
+
webviewRuntimeId: string;
|
|
515
522
|
activeTabId: string;
|
|
516
523
|
}>;
|
|
517
|
-
navigate: (
|
|
518
|
-
|
|
524
|
+
navigate: (webviewRuntimeId: string, tabId: string, url: string) => Promise<{
|
|
525
|
+
webviewRuntimeId: string;
|
|
519
526
|
tabId: string;
|
|
520
527
|
url: string;
|
|
521
528
|
}>;
|
|
522
|
-
goBack: (
|
|
529
|
+
goBack: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
523
530
|
ok: boolean;
|
|
524
531
|
}>;
|
|
525
|
-
goForward: (
|
|
532
|
+
goForward: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
526
533
|
ok: boolean;
|
|
527
534
|
}>;
|
|
528
|
-
reload: (
|
|
535
|
+
reload: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
529
536
|
ok: boolean;
|
|
530
537
|
}>;
|
|
531
|
-
stop: (
|
|
538
|
+
stop: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
532
539
|
ok: boolean;
|
|
533
540
|
}>;
|
|
534
541
|
getOrCreateForInstance: (ownerInstanceId: string, url?: string) => Promise<{
|
|
535
|
-
|
|
536
|
-
tab:
|
|
542
|
+
webviewRuntimeId: string;
|
|
543
|
+
tab: SeastudioWebviewRuntimeTab;
|
|
537
544
|
activeTabId: string;
|
|
538
545
|
created: boolean;
|
|
539
546
|
}>;
|
|
540
547
|
};
|
|
541
548
|
viewport: {
|
|
542
|
-
bind: (
|
|
543
|
-
};
|
|
544
|
-
runtime: {
|
|
545
|
-
evaluate: <T = unknown>(browserSessionId: string, tabId: string, script: string, timeoutMs?: number) => Promise<{
|
|
546
|
-
result: T;
|
|
547
|
-
}>;
|
|
549
|
+
bind: (rect: SeastudioWebviewViewportRect, options?: SeastudioWebviewRuntimeViewportBindOptions) => Promise<SeastudioWebviewRuntimeViewportBinding>;
|
|
548
550
|
};
|
|
549
551
|
certificate: {
|
|
550
|
-
respond: (
|
|
552
|
+
respond: (webviewRuntimeId: string, requestId: string, allow: boolean) => Promise<{
|
|
551
553
|
ok: boolean;
|
|
552
554
|
}>;
|
|
553
555
|
};
|
|
@@ -596,8 +598,8 @@ declare const projectTools: MCPTool[];
|
|
|
596
598
|
|
|
597
599
|
declare const skillTools: MCPTool[];
|
|
598
600
|
|
|
599
|
-
declare const
|
|
600
|
-
declare const
|
|
601
|
+
declare const SINGLETON_WEBVIEW_RUNTIME_ID = "webview-runtime-default";
|
|
602
|
+
declare const webviewRuntimeTools: MCPTool[];
|
|
601
603
|
|
|
602
604
|
/**
|
|
603
605
|
* 插件发送给主程序的请求主题
|
|
@@ -681,14 +683,14 @@ declare const SeastudioNotifications: {
|
|
|
681
683
|
readonly PROPOSAL_FEEDBACK: "seastudio:proposal-feedback";
|
|
682
684
|
/** 插件实例请求更新宿主 plugin tab 标题 */
|
|
683
685
|
readonly PLUGIN_TAB_TITLE_CHANGED: "plugin:tab-title_changed";
|
|
684
|
-
/**
|
|
685
|
-
readonly
|
|
686
|
-
/**
|
|
687
|
-
readonly
|
|
688
|
-
/**
|
|
689
|
-
readonly
|
|
690
|
-
/**
|
|
691
|
-
readonly
|
|
686
|
+
/** WebviewRuntime 状态变化 */
|
|
687
|
+
readonly WEBVIEW_RUNTIME_STATE_CHANGED: "webview-runtime:state_changed";
|
|
688
|
+
/** WebviewRuntime 关闭 */
|
|
689
|
+
readonly WEBVIEW_RUNTIME_CLOSED: "webview-runtime:closed";
|
|
690
|
+
/** WebviewRuntime 证书错误,需要客户端 UI 决策 */
|
|
691
|
+
readonly WEBVIEW_RUNTIME_CERTIFICATE_ERROR: "webview-runtime:certificate_error";
|
|
692
|
+
/** WebviewRuntime 收到网页新标签请求 */
|
|
693
|
+
readonly WEBVIEW_RUNTIME_NEW_TAB_REQUESTED: "webview-runtime:new_tab_requested";
|
|
692
694
|
/**
|
|
693
695
|
* Agent 对话 session:新建。消息历史仍由 Agent 前端持有,宿主仅同步列表用于侧栏。
|
|
694
696
|
* 通常由 Agent 通过 notifications/publish 发出;其他订阅者(含 host-ui)可据此更新 UI。
|
|
@@ -737,6 +739,10 @@ declare const SeastudioNotifications: {
|
|
|
737
739
|
readonly HOST_APP_VISIBILITY: "host:app_visibility";
|
|
738
740
|
/** Host MCP tools/list 发生变化(例如 Seaflow bridge 动态注册工具) */
|
|
739
741
|
readonly RUNTIME_TOOLS_CHANGED: "mcp:runtime_tools_changed";
|
|
742
|
+
/** Host 精确路由到插件实例的工具调用请求 */
|
|
743
|
+
readonly PLUGIN_TOOL_CALL: "plugin:tool_call";
|
|
744
|
+
/** 插件实例返回给 Host 的工具调用结果 */
|
|
745
|
+
readonly PLUGIN_TOOL_RESULT: "plugin:tool_result";
|
|
740
746
|
/** 主程序用户登录态变化;不包含访问令牌 */
|
|
741
747
|
readonly AUTH_SESSION_CHANGED: "auth:session_changed";
|
|
742
748
|
};
|
|
@@ -810,6 +816,39 @@ interface AuthSessionChangedParams {
|
|
|
810
816
|
user: AuthSessionUser | null;
|
|
811
817
|
};
|
|
812
818
|
}
|
|
819
|
+
interface PluginToolCallCaller {
|
|
820
|
+
type: 'agent' | 'plugin' | 'host';
|
|
821
|
+
agentInstanceId?: string;
|
|
822
|
+
pluginId?: string;
|
|
823
|
+
pluginInstanceId?: string;
|
|
824
|
+
projectId?: string;
|
|
825
|
+
threadId?: string;
|
|
826
|
+
}
|
|
827
|
+
interface PluginToolCallTarget {
|
|
828
|
+
providerId: string;
|
|
829
|
+
pluginId: string;
|
|
830
|
+
pluginInstanceId: string;
|
|
831
|
+
contractHash: string;
|
|
832
|
+
}
|
|
833
|
+
interface PluginToolCallEnvelope {
|
|
834
|
+
callId: string;
|
|
835
|
+
caller: PluginToolCallCaller;
|
|
836
|
+
target: PluginToolCallTarget;
|
|
837
|
+
toolName: string;
|
|
838
|
+
arguments: Record<string, unknown>;
|
|
839
|
+
timeoutMs: number;
|
|
840
|
+
}
|
|
841
|
+
interface PluginToolCallError {
|
|
842
|
+
name?: string;
|
|
843
|
+
message: string;
|
|
844
|
+
code?: string;
|
|
845
|
+
details?: unknown;
|
|
846
|
+
}
|
|
847
|
+
interface PluginToolResultEnvelope {
|
|
848
|
+
callId: string;
|
|
849
|
+
result?: unknown;
|
|
850
|
+
error?: PluginToolCallError;
|
|
851
|
+
}
|
|
813
852
|
interface SeastudioDragFileData {
|
|
814
853
|
sourcePath: string;
|
|
815
854
|
sourceRootId?: SeastudioDragRootId;
|
|
@@ -1098,4 +1137,4 @@ interface HostAppVisibilityParams {
|
|
|
1098
1137
|
declare const allTools: MCPTool[];
|
|
1099
1138
|
declare const tools: MCPTool[];
|
|
1100
1139
|
|
|
1101
|
-
export { type AgentInstanceSessionSnapshot, type AuthSessionChangedParams, type AuthSessionStatus, type AuthSessionUser, type FileDeletedParams, type FileKeepRequestedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSelectedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type GitBranchInfo, type GitBranchesResult, type GitChangeKind, type GitChangedParams, type GitCommitRef, type GitCommitRefType, type GitFileChange, type GitLineChange, type GitLineChangeKind, type GitLogCommit, type GitLogResult, type GitOpenDiffRequestedParams, type GitStatusResult, type GitSummary, type HostAppVisibilityParams, type PluginTabTitleChangedParams, type
|
|
1140
|
+
export { type AgentInstanceSessionSnapshot, type AuthSessionChangedParams, type AuthSessionStatus, type AuthSessionUser, type FileDeletedParams, type FileKeepRequestedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSelectedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type GitBranchInfo, type GitBranchesResult, type GitChangeKind, type GitChangedParams, type GitCommitRef, type GitCommitRefType, type GitFileChange, type GitLineChange, type GitLineChangeKind, type GitLogCommit, type GitLogResult, type GitOpenDiffRequestedParams, type GitStatusResult, type GitSummary, type HostAppVisibilityParams, type PluginTabTitleChangedParams, type PluginToolCallCaller, type PluginToolCallEnvelope, type PluginToolCallError, type PluginToolCallTarget, type PluginToolResultEnvelope, type ProposalChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type ProposalRecord, type ProposalRequestedFile, type ProposalRequestedHunk, type ProposalRequestedParams, type ProposalStatus, type RootsChangedParams, SINGLETON_WEBVIEW_RUNTIME_ID, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioDragDropParams, type SeastudioDragEnterParams, type SeastudioDragFileData, type SeastudioDragRootId, type SeastudioDragStartParams, type SeastudioEditorProposalAction, type SeastudioEditorProposalOptions, type SeastudioEditorProposeOptions, type SeastudioFileDownloadOptions, type SeastudioFileInfo, type SeastudioFileInfoOptions, type SeastudioFileListOptions, type SeastudioFileReadOptions, type SeastudioFileSaveAsOptions, type SeastudioFileSearchMatch, type SeastudioFileSearchOptions, type SeastudioFileTransferOptions, type SeastudioFileTreeOptions, type SeastudioFileWriteOptions, type SeastudioFilesystemRoot, type SeastudioFilesystemRootId, SeastudioNotifications, type SeastudioProjectInfo, type SeastudioProposalFile, type SeastudioProposalHunk, SeastudioRequests, type SeastudioRootId, type SeastudioShellCloseResult, type SeastudioShellEntry, type SeastudioShellEntryLevel, type SeastudioShellGetEntriesOptions, type SeastudioShellGetEntriesResult, type SeastudioShellKind, type SeastudioShellOneShotResult, type SeastudioShellOpenOptions, type SeastudioShellRunOptions, type SeastudioShellRunResult, type SeastudioShellSession, type SeastudioShellSignalResult, type SeastudioShellWaitResult, type SeastudioSinglePathOptions, type SeastudioWebviewRuntime, type SeastudioWebviewRuntimeCertificateError, type SeastudioWebviewRuntimeOpenOptions, type SeastudioWebviewRuntimeState, type SeastudioWebviewRuntimeStatus, type SeastudioWebviewRuntimeTab, type SeastudioWebviewRuntimeViewportBindOptions, type SeastudioWebviewRuntimeViewportBinding, type SeastudioWebviewViewportRect, type SeastudioWorkspacePathMode, type SeastudioWriteReviewMode, type SessionArchiveRequestedParams, type SessionCreatedParams, type SessionDeleteRequestedParams, type SessionNewRequestedParams, type SessionNotificationBase, type SessionRemovedParams, type SessionRenameRequestedParams, type SessionSelectedParams, type SessionSelectedReason, type SessionSnapshotItem, type SessionStateSnapshotParams, type SessionStatus, type SessionStatusParams, type SessionSummaryParams, type TextSendRequestedParams, type TextSendRequestedSelectionRange, type TextSendRequestedSource, 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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as MCPTool, h as MCPToolAnnotations, j as MCPToolInputSchema, k as MCPToolResult } from '../../types-
|
|
1
|
+
import { g as MCPTool, h as MCPToolAnnotations, j as MCPToolInputSchema, k as MCPToolResult } from '../../types-S2uWCEaN.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Git 共享类型契约
|
|
@@ -336,50 +336,54 @@ interface SeastudioShellOneShotResult {
|
|
|
336
336
|
durationMs: number;
|
|
337
337
|
timedOut: boolean;
|
|
338
338
|
}
|
|
339
|
-
type
|
|
340
|
-
interface
|
|
339
|
+
type SeastudioWebviewRuntimeStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
340
|
+
interface SeastudioWebviewRuntimeCertificateError {
|
|
341
341
|
requestId: string;
|
|
342
342
|
url: string;
|
|
343
343
|
error: string;
|
|
344
344
|
}
|
|
345
|
-
interface
|
|
345
|
+
interface SeastudioWebviewRuntimeTab {
|
|
346
346
|
id: string;
|
|
347
347
|
title: string;
|
|
348
348
|
url: string | null;
|
|
349
|
-
status:
|
|
349
|
+
status: SeastudioWebviewRuntimeStatus;
|
|
350
350
|
errorMessage: string | null;
|
|
351
351
|
canGoBack: boolean;
|
|
352
352
|
canGoForward: boolean;
|
|
353
|
-
certificateError?:
|
|
353
|
+
certificateError?: SeastudioWebviewRuntimeCertificateError | null;
|
|
354
354
|
ownerInstanceId?: string;
|
|
355
355
|
}
|
|
356
|
-
interface
|
|
357
|
-
|
|
356
|
+
interface SeastudioWebviewRuntimeState {
|
|
357
|
+
webviewRuntimeId: string;
|
|
358
358
|
label?: string;
|
|
359
|
-
|
|
359
|
+
storagePartitionKey: string;
|
|
360
360
|
homepage: string;
|
|
361
|
-
tabs:
|
|
361
|
+
tabs: SeastudioWebviewRuntimeTab[];
|
|
362
362
|
activeTabId: string | null;
|
|
363
363
|
}
|
|
364
|
-
interface
|
|
364
|
+
interface SeastudioWebviewRuntime extends SeastudioWebviewRuntimeState {
|
|
365
365
|
createdAt: number;
|
|
366
366
|
updatedAt: number;
|
|
367
367
|
}
|
|
368
|
-
interface
|
|
368
|
+
interface SeastudioWebviewRuntimeOpenOptions {
|
|
369
369
|
label?: string;
|
|
370
|
-
|
|
370
|
+
storagePartitionKey?: string;
|
|
371
371
|
homepage?: string;
|
|
372
372
|
}
|
|
373
|
-
interface
|
|
373
|
+
interface SeastudioWebviewViewportRect {
|
|
374
374
|
x: number;
|
|
375
375
|
y: number;
|
|
376
376
|
width: number;
|
|
377
377
|
height: number;
|
|
378
378
|
}
|
|
379
|
-
interface
|
|
380
|
-
|
|
379
|
+
interface SeastudioWebviewRuntimeViewportBinding {
|
|
380
|
+
webviewRuntimeId: string;
|
|
381
|
+
ownerInstanceId?: string;
|
|
382
|
+
rect: SeastudioWebviewViewportRect;
|
|
383
|
+
}
|
|
384
|
+
interface SeastudioWebviewRuntimeViewportBindOptions {
|
|
385
|
+
webviewRuntimeId?: string;
|
|
381
386
|
ownerInstanceId?: string;
|
|
382
|
-
rect: SeastudioBrowserRect;
|
|
383
387
|
}
|
|
384
388
|
declare function callTool(name: string, args?: Record<string, unknown>): Promise<MCPToolResult>;
|
|
385
389
|
declare function request<T = unknown>(method: string, params?: Record<string, unknown>): Promise<T>;
|
|
@@ -481,73 +485,71 @@ declare const seastudio: {
|
|
|
481
485
|
close: (sessionId: string, force?: boolean) => Promise<MCPToolResult>;
|
|
482
486
|
};
|
|
483
487
|
};
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
open: (options?:
|
|
488
|
+
webview: {
|
|
489
|
+
runtime: {
|
|
490
|
+
open: (options?: SeastudioWebviewRuntimeOpenOptions) => Promise<SeastudioWebviewRuntime>;
|
|
487
491
|
list: () => Promise<{
|
|
488
|
-
|
|
492
|
+
runtimes: SeastudioWebviewRuntime[];
|
|
489
493
|
}>;
|
|
490
|
-
get: (
|
|
491
|
-
close: (
|
|
492
|
-
|
|
494
|
+
get: (webviewRuntimeId?: string) => Promise<SeastudioWebviewRuntime>;
|
|
495
|
+
close: (webviewRuntimeId?: string) => Promise<{
|
|
496
|
+
webviewRuntimeId: string;
|
|
493
497
|
closed: boolean;
|
|
494
498
|
}>;
|
|
499
|
+
show: (url: string) => Promise<{
|
|
500
|
+
url: string;
|
|
501
|
+
webviewRuntimeId: string;
|
|
502
|
+
instanceId?: string;
|
|
503
|
+
tab?: SeastudioWebviewRuntimeTab;
|
|
504
|
+
}>;
|
|
505
|
+
evaluate: <T = unknown>(webviewRuntimeId: string, tabId: string, script: string, timeoutMs?: number) => Promise<{
|
|
506
|
+
result: T;
|
|
507
|
+
}>;
|
|
495
508
|
};
|
|
496
|
-
show: (url: string) => Promise<{
|
|
497
|
-
url: string;
|
|
498
|
-
browserSessionId: string;
|
|
499
|
-
instanceId?: string;
|
|
500
|
-
tab?: SeastudioBrowserTab;
|
|
501
|
-
}>;
|
|
502
509
|
tab: {
|
|
503
|
-
create: (
|
|
504
|
-
|
|
505
|
-
tab:
|
|
510
|
+
create: (webviewRuntimeId?: string, url?: string, ownerInstanceId?: string) => Promise<{
|
|
511
|
+
webviewRuntimeId: string;
|
|
512
|
+
tab: SeastudioWebviewRuntimeTab;
|
|
506
513
|
activeTabId: string;
|
|
507
514
|
}>;
|
|
508
|
-
close: (
|
|
509
|
-
|
|
515
|
+
close: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
516
|
+
webviewRuntimeId: string;
|
|
510
517
|
closedTabId: string;
|
|
511
518
|
activeTabId: string | null;
|
|
512
519
|
}>;
|
|
513
|
-
activate: (
|
|
514
|
-
|
|
520
|
+
activate: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
521
|
+
webviewRuntimeId: string;
|
|
515
522
|
activeTabId: string;
|
|
516
523
|
}>;
|
|
517
|
-
navigate: (
|
|
518
|
-
|
|
524
|
+
navigate: (webviewRuntimeId: string, tabId: string, url: string) => Promise<{
|
|
525
|
+
webviewRuntimeId: string;
|
|
519
526
|
tabId: string;
|
|
520
527
|
url: string;
|
|
521
528
|
}>;
|
|
522
|
-
goBack: (
|
|
529
|
+
goBack: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
523
530
|
ok: boolean;
|
|
524
531
|
}>;
|
|
525
|
-
goForward: (
|
|
532
|
+
goForward: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
526
533
|
ok: boolean;
|
|
527
534
|
}>;
|
|
528
|
-
reload: (
|
|
535
|
+
reload: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
529
536
|
ok: boolean;
|
|
530
537
|
}>;
|
|
531
|
-
stop: (
|
|
538
|
+
stop: (webviewRuntimeId: string, tabId: string) => Promise<{
|
|
532
539
|
ok: boolean;
|
|
533
540
|
}>;
|
|
534
541
|
getOrCreateForInstance: (ownerInstanceId: string, url?: string) => Promise<{
|
|
535
|
-
|
|
536
|
-
tab:
|
|
542
|
+
webviewRuntimeId: string;
|
|
543
|
+
tab: SeastudioWebviewRuntimeTab;
|
|
537
544
|
activeTabId: string;
|
|
538
545
|
created: boolean;
|
|
539
546
|
}>;
|
|
540
547
|
};
|
|
541
548
|
viewport: {
|
|
542
|
-
bind: (
|
|
543
|
-
};
|
|
544
|
-
runtime: {
|
|
545
|
-
evaluate: <T = unknown>(browserSessionId: string, tabId: string, script: string, timeoutMs?: number) => Promise<{
|
|
546
|
-
result: T;
|
|
547
|
-
}>;
|
|
549
|
+
bind: (rect: SeastudioWebviewViewportRect, options?: SeastudioWebviewRuntimeViewportBindOptions) => Promise<SeastudioWebviewRuntimeViewportBinding>;
|
|
548
550
|
};
|
|
549
551
|
certificate: {
|
|
550
|
-
respond: (
|
|
552
|
+
respond: (webviewRuntimeId: string, requestId: string, allow: boolean) => Promise<{
|
|
551
553
|
ok: boolean;
|
|
552
554
|
}>;
|
|
553
555
|
};
|
|
@@ -596,8 +598,8 @@ declare const projectTools: MCPTool[];
|
|
|
596
598
|
|
|
597
599
|
declare const skillTools: MCPTool[];
|
|
598
600
|
|
|
599
|
-
declare const
|
|
600
|
-
declare const
|
|
601
|
+
declare const SINGLETON_WEBVIEW_RUNTIME_ID = "webview-runtime-default";
|
|
602
|
+
declare const webviewRuntimeTools: MCPTool[];
|
|
601
603
|
|
|
602
604
|
/**
|
|
603
605
|
* 插件发送给主程序的请求主题
|
|
@@ -681,14 +683,14 @@ declare const SeastudioNotifications: {
|
|
|
681
683
|
readonly PROPOSAL_FEEDBACK: "seastudio:proposal-feedback";
|
|
682
684
|
/** 插件实例请求更新宿主 plugin tab 标题 */
|
|
683
685
|
readonly PLUGIN_TAB_TITLE_CHANGED: "plugin:tab-title_changed";
|
|
684
|
-
/**
|
|
685
|
-
readonly
|
|
686
|
-
/**
|
|
687
|
-
readonly
|
|
688
|
-
/**
|
|
689
|
-
readonly
|
|
690
|
-
/**
|
|
691
|
-
readonly
|
|
686
|
+
/** WebviewRuntime 状态变化 */
|
|
687
|
+
readonly WEBVIEW_RUNTIME_STATE_CHANGED: "webview-runtime:state_changed";
|
|
688
|
+
/** WebviewRuntime 关闭 */
|
|
689
|
+
readonly WEBVIEW_RUNTIME_CLOSED: "webview-runtime:closed";
|
|
690
|
+
/** WebviewRuntime 证书错误,需要客户端 UI 决策 */
|
|
691
|
+
readonly WEBVIEW_RUNTIME_CERTIFICATE_ERROR: "webview-runtime:certificate_error";
|
|
692
|
+
/** WebviewRuntime 收到网页新标签请求 */
|
|
693
|
+
readonly WEBVIEW_RUNTIME_NEW_TAB_REQUESTED: "webview-runtime:new_tab_requested";
|
|
692
694
|
/**
|
|
693
695
|
* Agent 对话 session:新建。消息历史仍由 Agent 前端持有,宿主仅同步列表用于侧栏。
|
|
694
696
|
* 通常由 Agent 通过 notifications/publish 发出;其他订阅者(含 host-ui)可据此更新 UI。
|
|
@@ -737,6 +739,10 @@ declare const SeastudioNotifications: {
|
|
|
737
739
|
readonly HOST_APP_VISIBILITY: "host:app_visibility";
|
|
738
740
|
/** Host MCP tools/list 发生变化(例如 Seaflow bridge 动态注册工具) */
|
|
739
741
|
readonly RUNTIME_TOOLS_CHANGED: "mcp:runtime_tools_changed";
|
|
742
|
+
/** Host 精确路由到插件实例的工具调用请求 */
|
|
743
|
+
readonly PLUGIN_TOOL_CALL: "plugin:tool_call";
|
|
744
|
+
/** 插件实例返回给 Host 的工具调用结果 */
|
|
745
|
+
readonly PLUGIN_TOOL_RESULT: "plugin:tool_result";
|
|
740
746
|
/** 主程序用户登录态变化;不包含访问令牌 */
|
|
741
747
|
readonly AUTH_SESSION_CHANGED: "auth:session_changed";
|
|
742
748
|
};
|
|
@@ -810,6 +816,39 @@ interface AuthSessionChangedParams {
|
|
|
810
816
|
user: AuthSessionUser | null;
|
|
811
817
|
};
|
|
812
818
|
}
|
|
819
|
+
interface PluginToolCallCaller {
|
|
820
|
+
type: 'agent' | 'plugin' | 'host';
|
|
821
|
+
agentInstanceId?: string;
|
|
822
|
+
pluginId?: string;
|
|
823
|
+
pluginInstanceId?: string;
|
|
824
|
+
projectId?: string;
|
|
825
|
+
threadId?: string;
|
|
826
|
+
}
|
|
827
|
+
interface PluginToolCallTarget {
|
|
828
|
+
providerId: string;
|
|
829
|
+
pluginId: string;
|
|
830
|
+
pluginInstanceId: string;
|
|
831
|
+
contractHash: string;
|
|
832
|
+
}
|
|
833
|
+
interface PluginToolCallEnvelope {
|
|
834
|
+
callId: string;
|
|
835
|
+
caller: PluginToolCallCaller;
|
|
836
|
+
target: PluginToolCallTarget;
|
|
837
|
+
toolName: string;
|
|
838
|
+
arguments: Record<string, unknown>;
|
|
839
|
+
timeoutMs: number;
|
|
840
|
+
}
|
|
841
|
+
interface PluginToolCallError {
|
|
842
|
+
name?: string;
|
|
843
|
+
message: string;
|
|
844
|
+
code?: string;
|
|
845
|
+
details?: unknown;
|
|
846
|
+
}
|
|
847
|
+
interface PluginToolResultEnvelope {
|
|
848
|
+
callId: string;
|
|
849
|
+
result?: unknown;
|
|
850
|
+
error?: PluginToolCallError;
|
|
851
|
+
}
|
|
813
852
|
interface SeastudioDragFileData {
|
|
814
853
|
sourcePath: string;
|
|
815
854
|
sourceRootId?: SeastudioDragRootId;
|
|
@@ -1098,4 +1137,4 @@ interface HostAppVisibilityParams {
|
|
|
1098
1137
|
declare const allTools: MCPTool[];
|
|
1099
1138
|
declare const tools: MCPTool[];
|
|
1100
1139
|
|
|
1101
|
-
export { type AgentInstanceSessionSnapshot, type AuthSessionChangedParams, type AuthSessionStatus, type AuthSessionUser, type FileDeletedParams, type FileKeepRequestedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSelectedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type GitBranchInfo, type GitBranchesResult, type GitChangeKind, type GitChangedParams, type GitCommitRef, type GitCommitRefType, type GitFileChange, type GitLineChange, type GitLineChangeKind, type GitLogCommit, type GitLogResult, type GitOpenDiffRequestedParams, type GitStatusResult, type GitSummary, type HostAppVisibilityParams, type PluginTabTitleChangedParams, type
|
|
1140
|
+
export { type AgentInstanceSessionSnapshot, type AuthSessionChangedParams, type AuthSessionStatus, type AuthSessionUser, type FileDeletedParams, type FileKeepRequestedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSelectedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type GitBranchInfo, type GitBranchesResult, type GitChangeKind, type GitChangedParams, type GitCommitRef, type GitCommitRefType, type GitFileChange, type GitLineChange, type GitLineChangeKind, type GitLogCommit, type GitLogResult, type GitOpenDiffRequestedParams, type GitStatusResult, type GitSummary, type HostAppVisibilityParams, type PluginTabTitleChangedParams, type PluginToolCallCaller, type PluginToolCallEnvelope, type PluginToolCallError, type PluginToolCallTarget, type PluginToolResultEnvelope, type ProposalChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type ProposalRecord, type ProposalRequestedFile, type ProposalRequestedHunk, type ProposalRequestedParams, type ProposalStatus, type RootsChangedParams, SINGLETON_WEBVIEW_RUNTIME_ID, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioDragDropParams, type SeastudioDragEnterParams, type SeastudioDragFileData, type SeastudioDragRootId, type SeastudioDragStartParams, type SeastudioEditorProposalAction, type SeastudioEditorProposalOptions, type SeastudioEditorProposeOptions, type SeastudioFileDownloadOptions, type SeastudioFileInfo, type SeastudioFileInfoOptions, type SeastudioFileListOptions, type SeastudioFileReadOptions, type SeastudioFileSaveAsOptions, type SeastudioFileSearchMatch, type SeastudioFileSearchOptions, type SeastudioFileTransferOptions, type SeastudioFileTreeOptions, type SeastudioFileWriteOptions, type SeastudioFilesystemRoot, type SeastudioFilesystemRootId, SeastudioNotifications, type SeastudioProjectInfo, type SeastudioProposalFile, type SeastudioProposalHunk, SeastudioRequests, type SeastudioRootId, type SeastudioShellCloseResult, type SeastudioShellEntry, type SeastudioShellEntryLevel, type SeastudioShellGetEntriesOptions, type SeastudioShellGetEntriesResult, type SeastudioShellKind, type SeastudioShellOneShotResult, type SeastudioShellOpenOptions, type SeastudioShellRunOptions, type SeastudioShellRunResult, type SeastudioShellSession, type SeastudioShellSignalResult, type SeastudioShellWaitResult, type SeastudioSinglePathOptions, type SeastudioWebviewRuntime, type SeastudioWebviewRuntimeCertificateError, type SeastudioWebviewRuntimeOpenOptions, type SeastudioWebviewRuntimeState, type SeastudioWebviewRuntimeStatus, type SeastudioWebviewRuntimeTab, type SeastudioWebviewRuntimeViewportBindOptions, type SeastudioWebviewRuntimeViewportBinding, type SeastudioWebviewViewportRect, type SeastudioWorkspacePathMode, type SeastudioWriteReviewMode, type SessionArchiveRequestedParams, type SessionCreatedParams, type SessionDeleteRequestedParams, type SessionNewRequestedParams, type SessionNotificationBase, type SessionRemovedParams, type SessionRenameRequestedParams, type SessionSelectedParams, type SessionSelectedReason, type SessionSnapshotItem, type SessionStateSnapshotParams, type SessionStatus, type SessionStatusParams, type SessionSummaryParams, type TextSendRequestedParams, type TextSendRequestedSelectionRange, type TextSendRequestedSource, 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 };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
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 } from '../../chunk-PN3WUVKZ.js';
|
|
2
|
+
import '../../chunk-6XG5DRQW.js';
|
|
@@ -43,7 +43,7 @@ interface MCPToolInputSchema {
|
|
|
43
43
|
interface MCPToolAnnotations {
|
|
44
44
|
operationKind?: 'read' | 'mutate' | 'system' | 'workflow';
|
|
45
45
|
requiresExecutionEvidence?: boolean;
|
|
46
|
-
rawDomain?: 'workspace' | 'filesystem' | 'editor' | 'seaflow' | 'asset' | 'git' | 'preview' | 'shell' | 'browser' | 'excel' | 'word' | 'skill' | `plugin-${string}`;
|
|
46
|
+
rawDomain?: 'workspace' | 'filesystem' | 'editor' | 'seaflow' | 'asset' | 'git' | 'preview' | 'shell' | 'browser' | 'webview' | 'excel' | 'word' | 'skill' | `plugin-${string}`;
|
|
47
47
|
hostForwarding?: {
|
|
48
48
|
timeoutMs?: number;
|
|
49
49
|
};
|
|
@@ -43,7 +43,7 @@ interface MCPToolInputSchema {
|
|
|
43
43
|
interface MCPToolAnnotations {
|
|
44
44
|
operationKind?: 'read' | 'mutate' | 'system' | 'workflow';
|
|
45
45
|
requiresExecutionEvidence?: boolean;
|
|
46
|
-
rawDomain?: 'workspace' | 'filesystem' | 'editor' | 'seaflow' | 'asset' | 'git' | 'preview' | 'shell' | 'browser' | 'excel' | 'word' | 'skill' | `plugin-${string}`;
|
|
46
|
+
rawDomain?: 'workspace' | 'filesystem' | 'editor' | 'seaflow' | 'asset' | 'git' | 'preview' | 'shell' | 'browser' | 'webview' | 'excel' | 'word' | 'skill' | `plugin-${string}`;
|
|
47
47
|
hostForwarding?: {
|
|
48
48
|
timeoutMs?: number;
|
|
49
49
|
};
|