The host-side handler for FS-adapter RPC. A later /api-backed adapter (mapping ops onto linXiv's /api/notes CRUD, or a real on-disk vault) will implement this; the signatures mirror the HostFsAdapter / FsDirHandle method surface the editor consumes. Each method returns the matching FsResult variant (or throws — the client serializes the error into a texbrain:fs:result { ok: false }).

Implements

Constructors

Methods

  • values() — list immediate children of a directory.

    Parameters

    • path: string

    Returns Promise<
        {
            entries: { kind: "file"
            | "directory"; name: string }[];
            kind: "list";
        },
    >

  • getFile().text()/arrayBuffer() — read a file (base64 when binary).

    Parameters

    • path: string

    Returns Promise<{ binary: boolean; data: string; kind: "readFile" }>

  • createWritable().write — write a file (data is base64 when binary).

    Parameters

    • path: string
    • data: string
    • binary: boolean

    Returns Promise<{ kind: "ok" }>