@seastudio/sdk 4.0.2 → 4.0.4

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.
@@ -20,6 +20,58 @@ declare const shellSessionSignalEvidenceOutputSchema: MCPToolInputSchema;
20
20
  declare const shellSessionCloseEvidenceOutputSchema: MCPToolInputSchema;
21
21
  declare const fileTools: MCPTool[];
22
22
 
23
+ declare const editorTools: MCPTool[];
24
+
25
+ /**
26
+ * Git MCP Tools
27
+ */
28
+
29
+ declare const gitTools: MCPTool[];
30
+
31
+ type GitChangeKind = 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked' | 'conflicted' | 'unknown';
32
+ type GitLineChangeKind = 'added' | 'modified' | 'deleted';
33
+ interface GitFileChange {
34
+ path: string;
35
+ previousPath?: string;
36
+ stagedStatus: string;
37
+ unstagedStatus: string;
38
+ kind: GitChangeKind;
39
+ raw: string;
40
+ }
41
+ interface GitSummary {
42
+ total: number;
43
+ added: number;
44
+ modified: number;
45
+ deleted: number;
46
+ renamed: number;
47
+ untracked: number;
48
+ conflicted: number;
49
+ unknown: number;
50
+ }
51
+ interface GitLineChange {
52
+ kind: GitLineChangeKind;
53
+ startLine: number;
54
+ endLine: number;
55
+ }
56
+ interface GitChangedParams {
57
+ projectPath: string;
58
+ summary: GitSummary;
59
+ changes: GitFileChange[];
60
+ ignoredPaths?: string[];
61
+ }
62
+ interface GitOpenDiffRequestedParams {
63
+ source: 'workspace' | 'scm';
64
+ rootId?: 'workspace' | `proj-${string}`;
65
+ path: string;
66
+ focus?: 'staged' | 'unstaged' | 'all';
67
+ }
68
+ interface GitStatusResult {
69
+ changes: GitFileChange[];
70
+ summary: GitSummary;
71
+ isRepository: boolean;
72
+ ignoredPaths?: string[];
73
+ }
74
+
23
75
  /**
24
76
  * Shell MCP Tools
25
77
  *
@@ -97,6 +149,10 @@ interface SeastudioFileInfoOptions {
97
149
  interface SeastudioSinglePathOptions {
98
150
  rootId?: SeastudioFilesystemRootId;
99
151
  }
152
+ type SeastudioWriteReviewMode = 'auto' | 'direct' | 'proposal';
153
+ interface SeastudioFileWriteOptions extends SeastudioSinglePathOptions {
154
+ reviewMode?: SeastudioWriteReviewMode;
155
+ }
100
156
  interface SeastudioFileDownloadOptions {
101
157
  rootId?: SeastudioFilesystemRootId;
102
158
  /** 若设置则下载到该本地绝对目录(可含 ~),忽略 path 与 rootId */
@@ -121,6 +177,39 @@ interface SeastudioBatchFlattenPreviewOptions {
121
177
  }
122
178
  interface SeastudioBatchFlattenCopyOptions extends SeastudioFileTransferOptions {
123
179
  }
180
+ interface SeastudioProposalHunk {
181
+ id?: string;
182
+ filePath?: string;
183
+ rootId?: SeastudioFilesystemRootId;
184
+ startLine: number;
185
+ endLine: number;
186
+ originalContent: string;
187
+ proposedContent: string;
188
+ }
189
+ interface SeastudioProposalFile {
190
+ path: string;
191
+ rootId?: SeastudioFilesystemRootId;
192
+ originalContent: string;
193
+ proposedContent: string;
194
+ hunks?: SeastudioProposalHunk[];
195
+ }
196
+ interface SeastudioEditorProposeOptions {
197
+ proposalId?: string;
198
+ title: string;
199
+ files: SeastudioProposalFile[];
200
+ targetPluginId?: string;
201
+ targetInstanceId?: string;
202
+ openFile?: boolean;
203
+ origin?: Record<string, unknown>;
204
+ }
205
+ type SeastudioEditorProposalAction = 'list' | 'get' | 'getForFile' | 'keepAll' | 'undoAll' | 'resolve';
206
+ interface SeastudioEditorProposalOptions {
207
+ action: SeastudioEditorProposalAction;
208
+ proposalId?: string;
209
+ rootId?: SeastudioFilesystemRootId;
210
+ path?: string;
211
+ decision?: 'keep' | 'undo';
212
+ }
124
213
  type SeastudioShellKind = 'bash' | 'pwsh' | 'cmd' | 'sh';
125
214
  type SeastudioShellEntryLevel = 'command' | 'stdout' | 'meta' | 'exit';
126
215
  interface SeastudioShellEntry {
@@ -259,7 +348,7 @@ declare const seastudio: {
259
348
  file: {
260
349
  getSelected: () => Promise<MCPToolResult>;
261
350
  read: (path: string, options?: SeastudioFileReadOptions) => Promise<MCPToolResult>;
262
- write: (path: string, content: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
351
+ write: (path: string, content: string, options?: SeastudioFileWriteOptions) => Promise<MCPToolResult>;
263
352
  list: (path?: string, options?: SeastudioFileListOptions) => Promise<MCPToolResult>;
264
353
  tree: (path?: string, options?: SeastudioFileTreeOptions) => Promise<MCPToolResult>;
265
354
  delete: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
@@ -287,6 +376,48 @@ declare const seastudio: {
287
376
  writeBinary: (path: string, base64: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
288
377
  readBinary: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
289
378
  };
379
+ git: {
380
+ probe: () => Promise<MCPToolResult>;
381
+ status: (options?: {
382
+ rootId?: SeastudioFilesystemRootId;
383
+ }) => Promise<MCPToolResult>;
384
+ diff: (path: string, options?: {
385
+ rootId?: SeastudioFilesystemRootId;
386
+ scope?: "staged" | "unstaged" | "all";
387
+ }) => Promise<MCPToolResult>;
388
+ show: (path: string, options?: {
389
+ rootId?: SeastudioFilesystemRootId;
390
+ ref?: "HEAD" | "INDEX";
391
+ }) => Promise<MCPToolResult>;
392
+ lineChanges: (path: string, options?: {
393
+ rootId?: SeastudioFilesystemRootId;
394
+ }) => Promise<MCPToolResult>;
395
+ init: (options?: {
396
+ rootId?: SeastudioFilesystemRootId;
397
+ }) => Promise<MCPToolResult>;
398
+ stage: (path: string, options?: {
399
+ rootId?: SeastudioFilesystemRootId;
400
+ }) => Promise<MCPToolResult>;
401
+ stageAll: (options?: {
402
+ rootId?: SeastudioFilesystemRootId;
403
+ }) => Promise<MCPToolResult>;
404
+ unstage: (path: string, options?: {
405
+ rootId?: SeastudioFilesystemRootId;
406
+ }) => Promise<MCPToolResult>;
407
+ unstageAll: (options?: {
408
+ rootId?: SeastudioFilesystemRootId;
409
+ }) => Promise<MCPToolResult>;
410
+ discard: (path: string, options?: {
411
+ rootId?: SeastudioFilesystemRootId;
412
+ }) => Promise<MCPToolResult>;
413
+ commit: (message: string, options?: {
414
+ rootId?: SeastudioFilesystemRootId;
415
+ }) => Promise<MCPToolResult>;
416
+ };
417
+ editor: {
418
+ propose: (options: SeastudioEditorProposeOptions) => Promise<MCPToolResult>;
419
+ proposal: (options: SeastudioEditorProposalOptions) => Promise<MCPToolResult>;
420
+ };
290
421
  shell: {
291
422
  session: {
292
423
  open: (options?: SeastudioShellOpenOptions) => Promise<MCPToolResult>;
@@ -423,6 +554,10 @@ declare const SeastudioRequests: {
423
554
  readonly FILE_SAVED: "request:file_saved";
424
555
  /** 请求发送文本给 Agent -> 主程序发布 TEXT_SEND_REQUESTED */
425
556
  readonly TEXT_SEND: "request:text_send";
557
+ /** 请求在 Code Editor 中打开 Git diff 视图 */
558
+ readonly GIT_OPEN_DIFF: "request:git_open_diff";
559
+ /** 请求提交代码变更提案 -> 主程序发布 PROPOSAL_REQUESTED */
560
+ readonly PROPOSAL_SUBMIT: "request:proposal_submit";
426
561
  };
427
562
  /**
428
563
  * SeaStudio 主程序发布的通知主题
@@ -446,6 +581,14 @@ declare const SeastudioRequests: {
446
581
  declare const SeastudioNotifications: {
447
582
  /** 文件系统变化通知(fs.watch 触发) */
448
583
  readonly FILES_CHANGED: "files:changed";
584
+ /** Git 仓库状态变化(mutate 或 files:changed 后刷新) */
585
+ readonly GIT_CHANGED: "git:changed";
586
+ /** Git diff 打开请求(主程序转发到 Code Editor) */
587
+ readonly GIT_OPEN_DIFF_REQUESTED: "seastudio:git-open_diff_requested";
588
+ /** 代码变更提案请求(主程序转发到 Code Editor) */
589
+ readonly PROPOSAL_REQUESTED: "seastudio:proposal-requested";
590
+ /** 代码变更提案状态变化 */
591
+ readonly PROPOSAL_CHANGED: "seastudio:proposal-changed";
449
592
  /** 文件或目录被重命名/移动 */
450
593
  readonly FILE_RENAMED: "file:renamed";
451
594
  /** 文件或目录被删除/移入回收站 */
@@ -588,9 +731,11 @@ interface FileTransferRequestedParams {
588
731
  kind: 'file' | 'directory';
589
732
  isDirectory: boolean;
590
733
  }
591
- interface FileOpenRequestedParams extends FileTransferRequestedParams {
734
+ interface FileOpenRequestedParams extends Omit<FileTransferRequestedParams, 'source'> {
735
+ source: 'workspace' | 'scm';
592
736
  }
593
- interface FileKeepRequestedParams extends FileTransferRequestedParams {
737
+ interface FileKeepRequestedParams extends Omit<FileTransferRequestedParams, 'source'> {
738
+ source: 'workspace' | 'scm';
594
739
  }
595
740
  interface FileSendRequestedParams extends FileTransferRequestedParams {
596
741
  }
@@ -632,7 +777,7 @@ interface ProposalFeedbackOrigin {
632
777
  interface ProposalFeedbackHunk {
633
778
  id: string;
634
779
  filePath: string;
635
- rootId: 'workspace' | 'assets';
780
+ rootId: SeastudioRootId;
636
781
  startLine: number;
637
782
  endLine: number;
638
783
  originalContent: string;
@@ -640,14 +785,51 @@ interface ProposalFeedbackHunk {
640
785
  }
641
786
  interface ProposalFeedbackFileSummary {
642
787
  path: string;
643
- rootId: 'workspace' | 'assets';
788
+ rootId: SeastudioRootId;
644
789
  acceptedHunkIds: string[];
645
790
  rejectedHunkIds: string[];
646
791
  }
792
+ interface ProposalRequestedHunk {
793
+ id: string;
794
+ filePath: string;
795
+ rootId: SeastudioRootId;
796
+ startLine: number;
797
+ endLine: number;
798
+ originalContent: string;
799
+ proposedContent: string;
800
+ }
801
+ interface ProposalRequestedFile {
802
+ path: string;
803
+ rootId: SeastudioRootId;
804
+ originalContent: string;
805
+ proposedContent: string;
806
+ hunks: ProposalRequestedHunk[];
807
+ }
808
+ interface ProposalRequestedParams {
809
+ proposalId: string;
810
+ title: string;
811
+ origin?: ProposalFeedbackOrigin;
812
+ files: ProposalRequestedFile[];
813
+ openFile?: boolean;
814
+ createdAt?: string;
815
+ }
816
+ type ProposalStatus = 'pending' | 'kept' | 'undone';
817
+ interface ProposalRecord extends ProposalRequestedParams {
818
+ status: ProposalStatus;
819
+ createdAt: string;
820
+ }
821
+ interface ProposalChangedParams {
822
+ proposalId: string;
823
+ status: ProposalStatus;
824
+ files: Array<{
825
+ path: string;
826
+ rootId: SeastudioRootId;
827
+ }>;
828
+ }
647
829
  interface ProposalFeedbackParams {
648
830
  proposalId: string;
649
831
  title: string;
650
- decision: 'rejected' | 'partial';
832
+ decision: 'kept' | 'undone' | 'partial';
651
833
  origin?: ProposalFeedbackOrigin;
652
834
  acceptedFilePaths: string[];
653
835
  rejectedHunks: ProposalFeedbackHunk[];
@@ -661,6 +843,8 @@ interface FileModifiedParams {
661
843
  path: string;
662
844
  /** 是否有未保存的修改 */
663
845
  isDirty: boolean;
846
+ /** 是否存在待确认 AI proposal */
847
+ proposalPending?: boolean;
664
848
  /** 触发来源插件 ID */
665
849
  source?: string;
666
850
  }
@@ -794,4 +978,4 @@ interface SessionDeleteRequestedParams {
794
978
  declare const allTools: MCPTool[];
795
979
  declare const tools: MCPTool[];
796
980
 
797
- export { type AgentInstanceSessionSnapshot, type FileDeletedParams, type FileKeepRequestedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSelectedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type PluginTabTitleChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type RootsChangedParams, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioBrowserCertificateError, type SeastudioBrowserRect, type SeastudioBrowserSession, type SeastudioBrowserSessionOpenOptions, type SeastudioBrowserState, type SeastudioBrowserStatus, type SeastudioBrowserTab, type SeastudioBrowserViewportBinding, type SeastudioDragDropParams, type SeastudioDragEnterParams, type SeastudioDragFileData, type SeastudioDragRootId, type SeastudioDragStartParams, type SeastudioFileDownloadOptions, type SeastudioFileInfo, type SeastudioFileInfoOptions, type SeastudioFileListOptions, type SeastudioFileReadOptions, type SeastudioFileSearchMatch, type SeastudioFileSearchOptions, type SeastudioFileTransferOptions, type SeastudioFileTreeOptions, type SeastudioFilesystemRoot, type SeastudioFilesystemRootId, SeastudioNotifications, type SeastudioProjectInfo, 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 SessionCreatedParams, type SessionDeleteRequestedParams, type SessionNewRequestedParams, type SessionNotificationBase, type SessionRemovedParams, 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, fileDownloadEvidenceOutputSchema, fileTools, fileUrlEvidenceOutputSchema, pluginManagementTools, pluginTabTools, projectTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, runOneShotShellCommand, seaCloudTools, seastudio, shellSessionCloseEvidenceOutputSchema, shellSessionOpenEvidenceOutputSchema, shellSessionRunEvidenceOutputSchema, shellSessionSignalEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, skillTools, tools };
981
+ export { type AgentInstanceSessionSnapshot, type FileDeletedParams, type FileKeepRequestedParams, type FileModifiedParams, type FileOpenRequestedParams, type FileRenamedParams, type FileSavedParams, type FileSelectedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type GitChangeKind, type GitChangedParams, type GitFileChange, type GitLineChange, type GitLineChangeKind, type GitOpenDiffRequestedParams, type GitStatusResult, type GitSummary, type PluginTabTitleChangedParams, type ProposalChangedParams, type ProposalFeedbackFileSummary, type ProposalFeedbackHunk, type ProposalFeedbackOrigin, type ProposalFeedbackParams, type ProposalRecord, type ProposalRequestedFile, type ProposalRequestedHunk, type ProposalRequestedParams, type ProposalStatus, type RootsChangedParams, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioBrowserCertificateError, type SeastudioBrowserRect, type SeastudioBrowserSession, type SeastudioBrowserSessionOpenOptions, type SeastudioBrowserState, type SeastudioBrowserStatus, type SeastudioBrowserTab, type SeastudioBrowserViewportBinding, 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 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 SessionCreatedParams, type SessionDeleteRequestedParams, type SessionNewRequestedParams, type SessionNotificationBase, type SessionRemovedParams, 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, fileTools, fileUrlEvidenceOutputSchema, gitTools, pluginManagementTools, pluginTabTools, projectTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, runOneShotShellCommand, seaCloudTools, seastudio, shellSessionCloseEvidenceOutputSchema, shellSessionOpenEvidenceOutputSchema, shellSessionRunEvidenceOutputSchema, shellSessionSignalEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, skillTools, tools };
@@ -1,2 +1,2 @@
1
- export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, browserRuntimeTools, callTool, callToolText, dualPathEvidenceOutputSchema, fileDownloadEvidenceOutputSchema, fileTools, fileUrlEvidenceOutputSchema, pluginManagementTools, pluginTabTools, projectTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, runOneShotShellCommand, seaCloudTools, seastudio, shellSessionCloseEvidenceOutputSchema, shellSessionOpenEvidenceOutputSchema, shellSessionRunEvidenceOutputSchema, shellSessionSignalEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, skillTools, tools } from '../../chunk-BEYRWP23.js';
1
+ export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, browserRuntimeTools, callTool, callToolText, dualPathEvidenceOutputSchema, editorTools, fileDownloadEvidenceOutputSchema, fileTools, fileUrlEvidenceOutputSchema, gitTools, pluginManagementTools, pluginTabTools, projectTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, runOneShotShellCommand, seaCloudTools, seastudio, shellSessionCloseEvidenceOutputSchema, shellSessionOpenEvidenceOutputSchema, shellSessionRunEvidenceOutputSchema, shellSessionSignalEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, skillTools, tools } from '../../chunk-YEN6XUZ2.js';
2
2
  import '../../chunk-TJ3CGHWJ.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seastudio/sdk",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "SeaStudio SDK - UI 组件 + MCP 信息交换中心",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",