History

Add workspace file browser and preview panel (#3087)

Julius Marminge committed 4 months agov0.0.28-nightly.20260615.565

Commit de8bdc11 parent 477795662 files · +2850 −9551Browse files

Showing the changes to apps/server/src/workspace/Services/WorkspaceFileSystem.ts (1 of 62 files). Show all

Unified · Split

apps/server/src/workspace/Services/WorkspaceFileSystem.ts+21−2
@@ -10,7 +10,12 @@ import * as Schema from "effect/Schema"; · 9 unmodified lines
10import * as Context from "effect/Context";10import * as Context from "effect/Context";
11import type * as Effect from "effect/Effect";11import type * as Effect from "effect/Effect";
12 12
13import type { ProjectWriteFileInput, ProjectWriteFileResult } from "@t3tools/contracts";13import type {
14 ProjectReadFileInput,
15 ProjectReadFileResult,
16 ProjectWriteFileInput,
17 ProjectWriteFileResult,
18} from "@t3tools/contracts";
14import { WorkspacePathOutsideRootError } from "./WorkspacePaths.ts";19import { WorkspacePathOutsideRootError } from "./WorkspacePaths.ts";
15 20
16export class WorkspaceFileSystemError extends Schema.TaggedErrorClass<WorkspaceFileSystemError>()(21export class WorkspaceFileSystemError extends Schema.TaggedErrorClass<WorkspaceFileSystemError>()(
@@ -22,12 +27,26 @@ export class WorkspaceFileSystemError extends Schema.TaggedErrorClass<WorkspaceF · 5 unmodified lines
22 detail: Schema.String,27 detail: Schema.String,
23 cause: Schema.optional(Schema.Defect()),28 cause: Schema.optional(Schema.Defect()),
24 },29 },
25) {}30) {
31 override get message(): string {
32 return this.detail;
33 }
34}
26 35
27/**36/**
28 * WorkspaceFileSystemShape - Service API for workspace-relative file operations.37 * WorkspaceFileSystemShape - Service API for workspace-relative file operations.
29 */38 */
30export interface WorkspaceFileSystemShape {39export interface WorkspaceFileSystemShape {
40 /**
41 * Read a UTF-8 text file relative to the workspace root.
42 */
43 readonly readFile: (
44 input: ProjectReadFileInput,
45 ) => Effect.Effect<
46 ProjectReadFileResult,
47 WorkspaceFileSystemError | WorkspacePathOutsideRootError
48 >;
49
31 /**50 /**
32 * Write a file relative to the workspace root.51 * Write a file relative to the workspace root.
33 *52 *