@seastudio/sdk 5.0.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.
@@ -1,4 +1,4 @@
1
- import { g as MCPTool, h as MCPToolAnnotations, j as MCPToolInputSchema, k as MCPToolResult } from '../../types-D7xY0bt6.cjs';
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,36 +336,34 @@ interface SeastudioShellOneShotResult {
336
336
  durationMs: number;
337
337
  timedOut: boolean;
338
338
  }
339
- type SeastudioBrowserRuntimeStatus = 'idle' | 'loading' | 'ready' | 'error';
340
- interface SeastudioBrowserRuntimeCertificateError {
339
+ type SeastudioBrowserStatus = 'idle' | 'loading' | 'ready' | 'error';
340
+ interface SeastudioBrowserCertificateError {
341
341
  requestId: string;
342
342
  url: string;
343
343
  error: string;
344
344
  }
345
- interface SeastudioBrowserRuntimeTab {
345
+ interface SeastudioBrowserTab {
346
346
  id: string;
347
347
  title: string;
348
348
  url: string | null;
349
- status: SeastudioBrowserRuntimeStatus;
349
+ status: SeastudioBrowserStatus;
350
350
  errorMessage: string | null;
351
351
  canGoBack: boolean;
352
352
  canGoForward: boolean;
353
- certificateError?: SeastudioBrowserRuntimeCertificateError | null;
353
+ certificateError?: SeastudioBrowserCertificateError | null;
354
354
  ownerInstanceId?: string;
355
355
  }
356
- interface SeastudioBrowserRuntimeState {
357
- browserRuntimeSessionId: string;
356
+ interface SeastudioBrowserState {
357
+ browserId: string;
358
358
  label?: string;
359
359
  storagePartitionKey: string;
360
360
  homepage: string;
361
- tabs: SeastudioBrowserRuntimeTab[];
361
+ tabs: SeastudioBrowserTab[];
362
362
  activeTabId: string | null;
363
- }
364
- interface SeastudioBrowserRuntimeSession extends SeastudioBrowserRuntimeState {
365
363
  createdAt: number;
366
364
  updatedAt: number;
367
365
  }
368
- interface SeastudioBrowserRuntimeSessionOpenOptions {
366
+ interface SeastudioBrowserOpenOptions {
369
367
  label?: string;
370
368
  storagePartitionKey?: string;
371
369
  homepage?: string;
@@ -376,13 +374,13 @@ interface SeastudioBrowserViewportRect {
376
374
  width: number;
377
375
  height: number;
378
376
  }
379
- interface SeastudioBrowserRuntimeViewportBinding {
380
- browserRuntimeSessionId: string;
377
+ interface SeastudioBrowserViewportBinding {
378
+ browserId: string;
381
379
  ownerInstanceId?: string;
382
380
  rect: SeastudioBrowserViewportRect;
383
381
  }
384
- interface SeastudioBrowserRuntimeViewportBindOptions {
385
- browserRuntimeSessionId?: string;
382
+ interface SeastudioBrowserViewportBindOptions {
383
+ browserId?: string;
386
384
  ownerInstanceId?: string;
387
385
  }
388
386
  declare function callTool(name: string, args?: Record<string, unknown>): Promise<MCPToolResult>;
@@ -486,72 +484,68 @@ declare const seastudio: {
486
484
  };
487
485
  };
488
486
  browser: {
489
- runtimeSession: {
490
- open: (options?: SeastudioBrowserRuntimeSessionOpenOptions) => Promise<SeastudioBrowserRuntimeSession>;
491
- list: () => Promise<{
492
- sessions: SeastudioBrowserRuntimeSession[];
493
- }>;
494
- get: (browserRuntimeSessionId?: string) => Promise<SeastudioBrowserRuntimeSession>;
495
- close: (browserRuntimeSessionId?: string) => Promise<{
496
- browserRuntimeSessionId: string;
497
- closed: boolean;
498
- }>;
499
- };
500
- runtimeTab: {
501
- create: (browserRuntimeSessionId?: string, url?: string, ownerInstanceId?: string) => Promise<{
502
- browserRuntimeSessionId: string;
503
- tab: SeastudioBrowserRuntimeTab;
487
+ open: (options?: SeastudioBrowserOpenOptions) => Promise<SeastudioBrowserState>;
488
+ list: () => Promise<{
489
+ browsers: SeastudioBrowserState[];
490
+ }>;
491
+ get: (browserId?: string) => Promise<SeastudioBrowserState>;
492
+ close: (browserId?: string) => Promise<{
493
+ browserId: string;
494
+ closed: boolean;
495
+ }>;
496
+ show: (url: string) => Promise<{
497
+ url: string;
498
+ browserId: string;
499
+ instanceId?: string;
500
+ tab?: SeastudioBrowserTab;
501
+ }>;
502
+ evaluate: <T = unknown>(browserId: string, tabId: string, script: string, timeoutMs?: number) => Promise<{
503
+ result: T;
504
+ }>;
505
+ tab: {
506
+ create: (browserId?: string, url?: string, ownerInstanceId?: string) => Promise<{
507
+ browserId: string;
508
+ tab: SeastudioBrowserTab;
504
509
  activeTabId: string;
505
510
  }>;
506
- close: (browserRuntimeSessionId: string, tabId: string) => Promise<{
507
- browserRuntimeSessionId: string;
511
+ close: (browserId: string, tabId: string) => Promise<{
512
+ browserId: string;
508
513
  closedTabId: string;
509
514
  activeTabId: string | null;
510
515
  }>;
511
- activate: (browserRuntimeSessionId: string, tabId: string) => Promise<{
512
- browserRuntimeSessionId: string;
516
+ activate: (browserId: string, tabId: string) => Promise<{
517
+ browserId: string;
513
518
  activeTabId: string;
514
519
  }>;
515
- navigate: (browserRuntimeSessionId: string, tabId: string, url: string) => Promise<{
516
- browserRuntimeSessionId: string;
520
+ navigate: (browserId: string, tabId: string, url: string) => Promise<{
521
+ browserId: string;
517
522
  tabId: string;
518
523
  url: string;
519
524
  }>;
520
- goBack: (browserRuntimeSessionId: string, tabId: string) => Promise<{
525
+ goBack: (browserId: string, tabId: string) => Promise<{
521
526
  ok: boolean;
522
527
  }>;
523
- goForward: (browserRuntimeSessionId: string, tabId: string) => Promise<{
528
+ goForward: (browserId: string, tabId: string) => Promise<{
524
529
  ok: boolean;
525
530
  }>;
526
- reload: (browserRuntimeSessionId: string, tabId: string) => Promise<{
531
+ reload: (browserId: string, tabId: string) => Promise<{
527
532
  ok: boolean;
528
533
  }>;
529
- stop: (browserRuntimeSessionId: string, tabId: string) => Promise<{
534
+ stop: (browserId: string, tabId: string) => Promise<{
530
535
  ok: boolean;
531
536
  }>;
532
537
  getOrCreateForInstance: (ownerInstanceId: string, url?: string) => Promise<{
533
- browserRuntimeSessionId: string;
534
- tab: SeastudioBrowserRuntimeTab;
538
+ browserId: string;
539
+ tab: SeastudioBrowserTab;
535
540
  activeTabId: string;
536
541
  created: boolean;
537
542
  }>;
538
543
  };
539
544
  viewport: {
540
- bind: (rect: SeastudioBrowserViewportRect, options?: SeastudioBrowserRuntimeViewportBindOptions) => Promise<SeastudioBrowserRuntimeViewportBinding>;
541
- };
542
- runtime: {
543
- show: (url: string) => Promise<{
544
- url: string;
545
- browserRuntimeSessionId: string;
546
- instanceId?: string;
547
- tab?: SeastudioBrowserRuntimeTab;
548
- }>;
549
- evaluate: <T = unknown>(browserRuntimeSessionId: string, tabId: string, script: string, timeoutMs?: number) => Promise<{
550
- result: T;
551
- }>;
545
+ bind: (rect: SeastudioBrowserViewportRect, options?: SeastudioBrowserViewportBindOptions) => Promise<SeastudioBrowserViewportBinding>;
552
546
  };
553
547
  certificate: {
554
- respond: (browserRuntimeSessionId: string, requestId: string, allow: boolean) => Promise<{
548
+ respond: (browserId: string, requestId: string, allow: boolean) => Promise<{
555
549
  ok: boolean;
556
550
  }>;
557
551
  };
@@ -600,8 +594,8 @@ declare const projectTools: MCPTool[];
600
594
 
601
595
  declare const skillTools: MCPTool[];
602
596
 
603
- declare const SINGLETON_BROWSER_RUNTIME_SESSION_ID = "browser-runtime-session-default";
604
- declare const browserRuntimeTools: MCPTool[];
597
+ declare const SINGLETON_BROWSER_ID = "browser-default";
598
+ declare const browserTools: MCPTool[];
605
599
 
606
600
  /**
607
601
  * 插件发送给主程序的请求主题
@@ -685,14 +679,14 @@ declare const SeastudioNotifications: {
685
679
  readonly PROPOSAL_FEEDBACK: "seastudio:proposal-feedback";
686
680
  /** 插件实例请求更新宿主 plugin tab 标题 */
687
681
  readonly PLUGIN_TAB_TITLE_CHANGED: "plugin:tab-title_changed";
688
- /** BrowserRuntimeSession 状态变化 */
689
- readonly BROWSER_RUNTIME_SESSION_CHANGED: "browser-runtime:session_changed";
690
- /** BrowserRuntimeSession 关闭 */
691
- readonly BROWSER_RUNTIME_SESSION_CLOSED: "browser-runtime:session_closed";
692
- /** BrowserRuntimeSession 证书错误,需要客户端 UI 决策 */
693
- readonly BROWSER_RUNTIME_CERTIFICATE_ERROR: "browser-runtime:certificate_error";
694
- /** BrowserRuntimeSession 收到网页新标签请求 */
695
- readonly BROWSER_RUNTIME_NEW_TAB_REQUESTED: "browser-runtime:new_tab_requested";
682
+ /** Browser 状态变化 */
683
+ readonly BROWSER_STATE_CHANGED: "browser:state_changed";
684
+ /** Browser 关闭 */
685
+ readonly BROWSER_CLOSED: "browser:closed";
686
+ /** Browser 证书错误,需要客户端 UI 决策 */
687
+ readonly BROWSER_CERTIFICATE_ERROR: "browser:certificate_error";
688
+ /** Browser 收到网页新标签请求 */
689
+ readonly BROWSER_NEW_TAB_REQUESTED: "browser:new_tab_requested";
696
690
  /**
697
691
  * Agent 对话 session:新建。消息历史仍由 Agent 前端持有,宿主仅同步列表用于侧栏。
698
692
  * 通常由 Agent 通过 notifications/publish 发出;其他订阅者(含 host-ui)可据此更新 UI。
@@ -741,6 +735,10 @@ declare const SeastudioNotifications: {
741
735
  readonly HOST_APP_VISIBILITY: "host:app_visibility";
742
736
  /** Host MCP tools/list 发生变化(例如 Seaflow bridge 动态注册工具) */
743
737
  readonly RUNTIME_TOOLS_CHANGED: "mcp:runtime_tools_changed";
738
+ /** Host 精确路由到插件实例的工具调用请求 */
739
+ readonly PLUGIN_TOOL_CALL: "plugin:tool_call";
740
+ /** 插件实例返回给 Host 的工具调用结果 */
741
+ readonly PLUGIN_TOOL_RESULT: "plugin:tool_result";
744
742
  /** 主程序用户登录态变化;不包含访问令牌 */
745
743
  readonly AUTH_SESSION_CHANGED: "auth:session_changed";
746
744
  };
@@ -814,6 +812,39 @@ interface AuthSessionChangedParams {
814
812
  user: AuthSessionUser | null;
815
813
  };
816
814
  }
815
+ interface PluginToolCallCaller {
816
+ type: 'agent' | 'plugin' | 'host';
817
+ agentInstanceId?: string;
818
+ pluginId?: string;
819
+ pluginInstanceId?: string;
820
+ projectId?: string;
821
+ threadId?: string;
822
+ }
823
+ interface PluginToolCallTarget {
824
+ providerId: string;
825
+ pluginId: string;
826
+ pluginInstanceId: string;
827
+ contractHash: string;
828
+ }
829
+ interface PluginToolCallEnvelope {
830
+ callId: string;
831
+ caller: PluginToolCallCaller;
832
+ target: PluginToolCallTarget;
833
+ toolName: string;
834
+ arguments: Record<string, unknown>;
835
+ timeoutMs: number;
836
+ }
837
+ interface PluginToolCallError {
838
+ name?: string;
839
+ message: string;
840
+ code?: string;
841
+ details?: unknown;
842
+ }
843
+ interface PluginToolResultEnvelope {
844
+ callId: string;
845
+ result?: unknown;
846
+ error?: PluginToolCallError;
847
+ }
817
848
  interface SeastudioDragFileData {
818
849
  sourcePath: string;
819
850
  sourceRootId?: SeastudioDragRootId;
@@ -1102,4 +1133,4 @@ interface HostAppVisibilityParams {
1102
1133
  declare const allTools: MCPTool[];
1103
1134
  declare const tools: MCPTool[];
1104
1135
 
1105
- 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 ProposalChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type ProposalRecord, type ProposalRequestedFile, type ProposalRequestedHunk, type ProposalRequestedParams, type ProposalStatus, type RootsChangedParams, SINGLETON_BROWSER_RUNTIME_SESSION_ID, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioBrowserRuntimeCertificateError, type SeastudioBrowserRuntimeSession, type SeastudioBrowserRuntimeSessionOpenOptions, type SeastudioBrowserRuntimeState, type SeastudioBrowserRuntimeStatus, type SeastudioBrowserRuntimeTab, type SeastudioBrowserRuntimeViewportBindOptions, type SeastudioBrowserRuntimeViewportBinding, type SeastudioBrowserViewportRect, 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 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, browserRuntimeTools, 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 };
1136
+ 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_BROWSER_ID, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioBrowserCertificateError, type SeastudioBrowserOpenOptions, type SeastudioBrowserState, type SeastudioBrowserStatus, type SeastudioBrowserTab, type SeastudioBrowserViewportBindOptions, type SeastudioBrowserViewportBinding, type SeastudioBrowserViewportRect, 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 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, 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,4 +1,4 @@
1
- import { g as MCPTool, h as MCPToolAnnotations, j as MCPToolInputSchema, k as MCPToolResult } from '../../types-D7xY0bt6.js';
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,36 +336,34 @@ interface SeastudioShellOneShotResult {
336
336
  durationMs: number;
337
337
  timedOut: boolean;
338
338
  }
339
- type SeastudioBrowserRuntimeStatus = 'idle' | 'loading' | 'ready' | 'error';
340
- interface SeastudioBrowserRuntimeCertificateError {
339
+ type SeastudioBrowserStatus = 'idle' | 'loading' | 'ready' | 'error';
340
+ interface SeastudioBrowserCertificateError {
341
341
  requestId: string;
342
342
  url: string;
343
343
  error: string;
344
344
  }
345
- interface SeastudioBrowserRuntimeTab {
345
+ interface SeastudioBrowserTab {
346
346
  id: string;
347
347
  title: string;
348
348
  url: string | null;
349
- status: SeastudioBrowserRuntimeStatus;
349
+ status: SeastudioBrowserStatus;
350
350
  errorMessage: string | null;
351
351
  canGoBack: boolean;
352
352
  canGoForward: boolean;
353
- certificateError?: SeastudioBrowserRuntimeCertificateError | null;
353
+ certificateError?: SeastudioBrowserCertificateError | null;
354
354
  ownerInstanceId?: string;
355
355
  }
356
- interface SeastudioBrowserRuntimeState {
357
- browserRuntimeSessionId: string;
356
+ interface SeastudioBrowserState {
357
+ browserId: string;
358
358
  label?: string;
359
359
  storagePartitionKey: string;
360
360
  homepage: string;
361
- tabs: SeastudioBrowserRuntimeTab[];
361
+ tabs: SeastudioBrowserTab[];
362
362
  activeTabId: string | null;
363
- }
364
- interface SeastudioBrowserRuntimeSession extends SeastudioBrowserRuntimeState {
365
363
  createdAt: number;
366
364
  updatedAt: number;
367
365
  }
368
- interface SeastudioBrowserRuntimeSessionOpenOptions {
366
+ interface SeastudioBrowserOpenOptions {
369
367
  label?: string;
370
368
  storagePartitionKey?: string;
371
369
  homepage?: string;
@@ -376,13 +374,13 @@ interface SeastudioBrowserViewportRect {
376
374
  width: number;
377
375
  height: number;
378
376
  }
379
- interface SeastudioBrowserRuntimeViewportBinding {
380
- browserRuntimeSessionId: string;
377
+ interface SeastudioBrowserViewportBinding {
378
+ browserId: string;
381
379
  ownerInstanceId?: string;
382
380
  rect: SeastudioBrowserViewportRect;
383
381
  }
384
- interface SeastudioBrowserRuntimeViewportBindOptions {
385
- browserRuntimeSessionId?: string;
382
+ interface SeastudioBrowserViewportBindOptions {
383
+ browserId?: string;
386
384
  ownerInstanceId?: string;
387
385
  }
388
386
  declare function callTool(name: string, args?: Record<string, unknown>): Promise<MCPToolResult>;
@@ -486,72 +484,68 @@ declare const seastudio: {
486
484
  };
487
485
  };
488
486
  browser: {
489
- runtimeSession: {
490
- open: (options?: SeastudioBrowserRuntimeSessionOpenOptions) => Promise<SeastudioBrowserRuntimeSession>;
491
- list: () => Promise<{
492
- sessions: SeastudioBrowserRuntimeSession[];
493
- }>;
494
- get: (browserRuntimeSessionId?: string) => Promise<SeastudioBrowserRuntimeSession>;
495
- close: (browserRuntimeSessionId?: string) => Promise<{
496
- browserRuntimeSessionId: string;
497
- closed: boolean;
498
- }>;
499
- };
500
- runtimeTab: {
501
- create: (browserRuntimeSessionId?: string, url?: string, ownerInstanceId?: string) => Promise<{
502
- browserRuntimeSessionId: string;
503
- tab: SeastudioBrowserRuntimeTab;
487
+ open: (options?: SeastudioBrowserOpenOptions) => Promise<SeastudioBrowserState>;
488
+ list: () => Promise<{
489
+ browsers: SeastudioBrowserState[];
490
+ }>;
491
+ get: (browserId?: string) => Promise<SeastudioBrowserState>;
492
+ close: (browserId?: string) => Promise<{
493
+ browserId: string;
494
+ closed: boolean;
495
+ }>;
496
+ show: (url: string) => Promise<{
497
+ url: string;
498
+ browserId: string;
499
+ instanceId?: string;
500
+ tab?: SeastudioBrowserTab;
501
+ }>;
502
+ evaluate: <T = unknown>(browserId: string, tabId: string, script: string, timeoutMs?: number) => Promise<{
503
+ result: T;
504
+ }>;
505
+ tab: {
506
+ create: (browserId?: string, url?: string, ownerInstanceId?: string) => Promise<{
507
+ browserId: string;
508
+ tab: SeastudioBrowserTab;
504
509
  activeTabId: string;
505
510
  }>;
506
- close: (browserRuntimeSessionId: string, tabId: string) => Promise<{
507
- browserRuntimeSessionId: string;
511
+ close: (browserId: string, tabId: string) => Promise<{
512
+ browserId: string;
508
513
  closedTabId: string;
509
514
  activeTabId: string | null;
510
515
  }>;
511
- activate: (browserRuntimeSessionId: string, tabId: string) => Promise<{
512
- browserRuntimeSessionId: string;
516
+ activate: (browserId: string, tabId: string) => Promise<{
517
+ browserId: string;
513
518
  activeTabId: string;
514
519
  }>;
515
- navigate: (browserRuntimeSessionId: string, tabId: string, url: string) => Promise<{
516
- browserRuntimeSessionId: string;
520
+ navigate: (browserId: string, tabId: string, url: string) => Promise<{
521
+ browserId: string;
517
522
  tabId: string;
518
523
  url: string;
519
524
  }>;
520
- goBack: (browserRuntimeSessionId: string, tabId: string) => Promise<{
525
+ goBack: (browserId: string, tabId: string) => Promise<{
521
526
  ok: boolean;
522
527
  }>;
523
- goForward: (browserRuntimeSessionId: string, tabId: string) => Promise<{
528
+ goForward: (browserId: string, tabId: string) => Promise<{
524
529
  ok: boolean;
525
530
  }>;
526
- reload: (browserRuntimeSessionId: string, tabId: string) => Promise<{
531
+ reload: (browserId: string, tabId: string) => Promise<{
527
532
  ok: boolean;
528
533
  }>;
529
- stop: (browserRuntimeSessionId: string, tabId: string) => Promise<{
534
+ stop: (browserId: string, tabId: string) => Promise<{
530
535
  ok: boolean;
531
536
  }>;
532
537
  getOrCreateForInstance: (ownerInstanceId: string, url?: string) => Promise<{
533
- browserRuntimeSessionId: string;
534
- tab: SeastudioBrowserRuntimeTab;
538
+ browserId: string;
539
+ tab: SeastudioBrowserTab;
535
540
  activeTabId: string;
536
541
  created: boolean;
537
542
  }>;
538
543
  };
539
544
  viewport: {
540
- bind: (rect: SeastudioBrowserViewportRect, options?: SeastudioBrowserRuntimeViewportBindOptions) => Promise<SeastudioBrowserRuntimeViewportBinding>;
541
- };
542
- runtime: {
543
- show: (url: string) => Promise<{
544
- url: string;
545
- browserRuntimeSessionId: string;
546
- instanceId?: string;
547
- tab?: SeastudioBrowserRuntimeTab;
548
- }>;
549
- evaluate: <T = unknown>(browserRuntimeSessionId: string, tabId: string, script: string, timeoutMs?: number) => Promise<{
550
- result: T;
551
- }>;
545
+ bind: (rect: SeastudioBrowserViewportRect, options?: SeastudioBrowserViewportBindOptions) => Promise<SeastudioBrowserViewportBinding>;
552
546
  };
553
547
  certificate: {
554
- respond: (browserRuntimeSessionId: string, requestId: string, allow: boolean) => Promise<{
548
+ respond: (browserId: string, requestId: string, allow: boolean) => Promise<{
555
549
  ok: boolean;
556
550
  }>;
557
551
  };
@@ -600,8 +594,8 @@ declare const projectTools: MCPTool[];
600
594
 
601
595
  declare const skillTools: MCPTool[];
602
596
 
603
- declare const SINGLETON_BROWSER_RUNTIME_SESSION_ID = "browser-runtime-session-default";
604
- declare const browserRuntimeTools: MCPTool[];
597
+ declare const SINGLETON_BROWSER_ID = "browser-default";
598
+ declare const browserTools: MCPTool[];
605
599
 
606
600
  /**
607
601
  * 插件发送给主程序的请求主题
@@ -685,14 +679,14 @@ declare const SeastudioNotifications: {
685
679
  readonly PROPOSAL_FEEDBACK: "seastudio:proposal-feedback";
686
680
  /** 插件实例请求更新宿主 plugin tab 标题 */
687
681
  readonly PLUGIN_TAB_TITLE_CHANGED: "plugin:tab-title_changed";
688
- /** BrowserRuntimeSession 状态变化 */
689
- readonly BROWSER_RUNTIME_SESSION_CHANGED: "browser-runtime:session_changed";
690
- /** BrowserRuntimeSession 关闭 */
691
- readonly BROWSER_RUNTIME_SESSION_CLOSED: "browser-runtime:session_closed";
692
- /** BrowserRuntimeSession 证书错误,需要客户端 UI 决策 */
693
- readonly BROWSER_RUNTIME_CERTIFICATE_ERROR: "browser-runtime:certificate_error";
694
- /** BrowserRuntimeSession 收到网页新标签请求 */
695
- readonly BROWSER_RUNTIME_NEW_TAB_REQUESTED: "browser-runtime:new_tab_requested";
682
+ /** Browser 状态变化 */
683
+ readonly BROWSER_STATE_CHANGED: "browser:state_changed";
684
+ /** Browser 关闭 */
685
+ readonly BROWSER_CLOSED: "browser:closed";
686
+ /** Browser 证书错误,需要客户端 UI 决策 */
687
+ readonly BROWSER_CERTIFICATE_ERROR: "browser:certificate_error";
688
+ /** Browser 收到网页新标签请求 */
689
+ readonly BROWSER_NEW_TAB_REQUESTED: "browser:new_tab_requested";
696
690
  /**
697
691
  * Agent 对话 session:新建。消息历史仍由 Agent 前端持有,宿主仅同步列表用于侧栏。
698
692
  * 通常由 Agent 通过 notifications/publish 发出;其他订阅者(含 host-ui)可据此更新 UI。
@@ -741,6 +735,10 @@ declare const SeastudioNotifications: {
741
735
  readonly HOST_APP_VISIBILITY: "host:app_visibility";
742
736
  /** Host MCP tools/list 发生变化(例如 Seaflow bridge 动态注册工具) */
743
737
  readonly RUNTIME_TOOLS_CHANGED: "mcp:runtime_tools_changed";
738
+ /** Host 精确路由到插件实例的工具调用请求 */
739
+ readonly PLUGIN_TOOL_CALL: "plugin:tool_call";
740
+ /** 插件实例返回给 Host 的工具调用结果 */
741
+ readonly PLUGIN_TOOL_RESULT: "plugin:tool_result";
744
742
  /** 主程序用户登录态变化;不包含访问令牌 */
745
743
  readonly AUTH_SESSION_CHANGED: "auth:session_changed";
746
744
  };
@@ -814,6 +812,39 @@ interface AuthSessionChangedParams {
814
812
  user: AuthSessionUser | null;
815
813
  };
816
814
  }
815
+ interface PluginToolCallCaller {
816
+ type: 'agent' | 'plugin' | 'host';
817
+ agentInstanceId?: string;
818
+ pluginId?: string;
819
+ pluginInstanceId?: string;
820
+ projectId?: string;
821
+ threadId?: string;
822
+ }
823
+ interface PluginToolCallTarget {
824
+ providerId: string;
825
+ pluginId: string;
826
+ pluginInstanceId: string;
827
+ contractHash: string;
828
+ }
829
+ interface PluginToolCallEnvelope {
830
+ callId: string;
831
+ caller: PluginToolCallCaller;
832
+ target: PluginToolCallTarget;
833
+ toolName: string;
834
+ arguments: Record<string, unknown>;
835
+ timeoutMs: number;
836
+ }
837
+ interface PluginToolCallError {
838
+ name?: string;
839
+ message: string;
840
+ code?: string;
841
+ details?: unknown;
842
+ }
843
+ interface PluginToolResultEnvelope {
844
+ callId: string;
845
+ result?: unknown;
846
+ error?: PluginToolCallError;
847
+ }
817
848
  interface SeastudioDragFileData {
818
849
  sourcePath: string;
819
850
  sourceRootId?: SeastudioDragRootId;
@@ -1102,4 +1133,4 @@ interface HostAppVisibilityParams {
1102
1133
  declare const allTools: MCPTool[];
1103
1134
  declare const tools: MCPTool[];
1104
1135
 
1105
- 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 ProposalChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type ProposalRecord, type ProposalRequestedFile, type ProposalRequestedHunk, type ProposalRequestedParams, type ProposalStatus, type RootsChangedParams, SINGLETON_BROWSER_RUNTIME_SESSION_ID, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioBrowserRuntimeCertificateError, type SeastudioBrowserRuntimeSession, type SeastudioBrowserRuntimeSessionOpenOptions, type SeastudioBrowserRuntimeState, type SeastudioBrowserRuntimeStatus, type SeastudioBrowserRuntimeTab, type SeastudioBrowserRuntimeViewportBindOptions, type SeastudioBrowserRuntimeViewportBinding, type SeastudioBrowserViewportRect, 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 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, browserRuntimeTools, 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 };
1136
+ 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_BROWSER_ID, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioBrowserCertificateError, type SeastudioBrowserOpenOptions, type SeastudioBrowserState, type SeastudioBrowserStatus, type SeastudioBrowserTab, type SeastudioBrowserViewportBindOptions, type SeastudioBrowserViewportBinding, type SeastudioBrowserViewportRect, 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 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, 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,2 +1,2 @@
1
- export { SINGLETON_BROWSER_RUNTIME_SESSION_ID, SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, browserRuntimeTools, 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 } from '../../chunk-FNA3TFHQ.js';
2
- import '../../chunk-TJ3CGHWJ.js';
1
+ 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 } from '../../chunk-352PJTT7.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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seastudio/sdk",
3
- "version": "5.0.0",
3
+ "version": "5.2.0",
4
4
  "description": "SeaStudio SDK - UI 组件 + MCP 信息交换中心",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",