Files
agent-radar 2ed3415fb7
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 20:17:27 +08:00

38 lines
2.1 KiB
Go

package workspacefiles
import "context"
type WorkspaceResolver interface {
ResolveWorkspaceRoot(ctx context.Context, workspaceID string) (WorkspaceRoot, error)
}
type PathAwareWorkspaceResolver interface {
ResolveWorkspaceRootForPath(ctx context.Context, workspaceID string, path string) (WorkspaceRoot, error)
}
type FileAdapter interface {
ListDirectory(ctx context.Context, root WorkspaceRoot, path LogicalPath, includeHidden bool) (DirectoryListing, error)
CreateFile(ctx context.Context, root WorkspaceRoot, path LogicalPath) (FileEntry, error)
CreateDirectory(ctx context.Context, root WorkspaceRoot, path LogicalPath) (FileEntry, error)
DeleteEntry(ctx context.Context, root WorkspaceRoot, path LogicalPath, kind EntryKind) error
MoveEntry(ctx context.Context, root WorkspaceRoot, path LogicalPath, targetDirectoryPath LogicalPath) (FileEntry, error)
RenameEntry(ctx context.Context, root WorkspaceRoot, path LogicalPath, newName string) (FileEntry, error)
CopyEntry(ctx context.Context, root WorkspaceRoot, path LogicalPath) (FileEntry, error)
PreflightUploadFiles(ctx context.Context, root WorkspaceRoot, targetDirectoryPath LogicalPath, sourcePaths []string) ([]UploadConflict, error)
ReadFile(ctx context.Context, root WorkspaceRoot, path LogicalPath, maxBytes int64) (FileContent, error)
UploadFiles(ctx context.Context, root WorkspaceRoot, targetDirectoryPath LogicalPath, sourcePaths []string, overwrite bool) ([]FileEntry, error)
WriteTextFile(ctx context.Context, root WorkspaceRoot, path LogicalPath, content string) (FileEntry, error)
Search(ctx context.Context, root WorkspaceRoot, input SearchInput) (SearchResult, error)
}
type DirectoryTreePrefetchPolicy interface {
ShouldPrefetchDirectory(root WorkspaceRoot, path LogicalPath) bool
}
// RecentFilesLister is an optional FileAdapter capability: enumerate the
// workspace's recently accessed entries (most-recent first). Adapters that do
// not implement it (e.g. non-macOS hosts) are treated as "no recent files".
type RecentFilesLister interface {
ListRecent(ctx context.Context, root WorkspaceRoot, limit int) (DirectoryListing, error)
}