···5757 return subscribeSubtextTitleChanges(listener);
5858 }
59596060- async createFile(): Promise<FileSystemEntry> {
6060+ async createFile(_parentId?: string, _name?: string): Promise<FileSystemEntry> {
6161 const handle = await this.documents.createDocument();
6262 return { id: handle.id, name: handle.getTitle() };
6363 }
64646565- async createDirectory(_name: string): Promise<FileSystemEntry> {
6565+ async createDirectory(_name: string, _parentId?: string): Promise<FileSystemEntry> {
6666 throw new Error('Subtext does not support directories');
6767+ }
6868+6969+ async renameFile(_entryId: string, _newName: string): Promise<FileSystemEntry> {
7070+ throw new Error('Subtext does not support renaming');
7171+ }
7272+7373+ async deleteFile(_entryId: string): Promise<void> {
7474+ throw new Error('Subtext does not support deleting');
7575+ }
7676+7777+ async copyFile(_entryId: string): Promise<FileSystemEntry> {
7878+ throw new Error('Subtext does not support copying');
7979+ }
8080+8181+ getPath(_entryId: string): string {
8282+ return '';
6783 }
6884}
+23-2
src/filesystem/types.ts
···5555 * Create a new persisted entry in this source (e.g. a new Habitat docs
5656 * record). The shell optimistically inserts it, then refreshes the listing.
5757 */
5858- createFile(): Promise<FileSystemEntry>;
5858+ createFile(parentId?: string, name?: string): Promise<FileSystemEntry>;
5959 /**
6060 * Create a new directory in this source.
6161 * Providers without directory support may throw or no-op.
6262 */
6363- createDirectory(name: string): Promise<FileSystemEntry>;
6363+ createDirectory(name: string, parentId?: string): Promise<FileSystemEntry>;
6464+ /**
6565+ * Rename an entry (file or directory).
6666+ * Returns the updated entry with the new id and name.
6767+ */
6868+ renameFile(entryId: string, newName: string): Promise<FileSystemEntry>;
6969+ /**
7070+ * Delete an entry (file or directory) permanently.
7171+ */
7272+ deleteFile(entryId: string): Promise<void>;
7373+ /**
7474+ * Duplicate a file. Returns the new entry.
7575+ */
7676+ copyFile(entryId: string): Promise<FileSystemEntry>;
7777+ /**
7878+ * Get the absolute filesystem path for an entry.
7979+ * Used for "Copy Path" to clipboard.
8080+ */
8181+ getPath(entryId: string): string;
6482 /**
6583 * When implemented, called when a listed entry's display name changes
6684 * (e.g. habitat doc heading edits). Used to keep the sidebar in sync.
···85103 writeFile(filePath: string, content: string): Promise<void>;
86104 fileExists(filePath: string): Promise<boolean>;
87105 mkdir(dirPath: string): Promise<void>;
106106+ rename(oldPath: string, newPath: string): Promise<void>;
107107+ deletePath(filePath: string): Promise<void>;
108108+ copyFile(srcPath: string, destPath: string): Promise<void>;
88109}