RemoteWorkspace class
A Workspace backed by a remote node over the connected ClientRuntime.
File operations run as one-shot commands on the node, so they need only a shell session — the same channel the terminal and agent use — and work from the web client too. (A drive-RPC byte transport can be layered in later for binary/large files.)
- On a POSIX node (or a Windows node whose shell is Git Bash, whose paths
are POSIX —
/c/…):ls,cat,touch,mkdir,test. - On a Windows node (rootPath is a Windows path: its shell is PowerShell
or
cmd): PowerShell — present on every Windows — with .NET's file APIs, which take paths literally (no wildcards). Listings and file contents travel as base64 of their UTF-8 bytes, and error messages as UTF-8 bytes, so names and text survive PowerShell's console code page. Paths are in Windows' native form (see normalizeRemotePath).
A write streams the content over the command's stdin, whatever its size, into a temporary file first: only once all of it has arrived is the target overwritten, so a dropped connection never leaves it truncated.
- Implemented types
Constructors
- RemoteWorkspace({required ClientRuntime client, required String nodeId, required String rootPath, ShellFamily? shellFamily})
Properties
- commandRunner → CommandRunner
-
The streaming command runner backing the terminal panel and the agent's
run_commandtool — local process or remote exec.final - hashCode → int
-
The hash code for this object.
no setterinherited
- isRemote → bool
-
Whether this targets a remote node (drives UI labels like the title bar).
no setteroverride
- rootPath → String
-
The absolute root the IDE is opened on.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> -
Releases any resources (sessions, clients). Safe to call once.
override
-
createDirectory(
String absPath) → Future< void> -
Creates a directory at
absPath(recursively).override -
createFile(
String absPath) → Future< void> -
Creates an empty file at
absPath(with parent directories).override -
exec(
String command, {String? cwd}) → Future< WsExecResult> -
Runs
commandonce and returns its captured output (used for git).cwddefaults to rootPath.override -
exists(
String absPath) → Future< bool> -
Whether
absPathexists (file or directory).override -
isDirectory(
String absPath) → Future< bool> -
Whether
absPathexists and is a directory.override -
list(
String absPath) → Future< List< WsEntry> > -
Lists the entries of directory
absPath.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String absPath) → Future< String> -
Reads the UTF-8 contents of file
absPath.override -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String absPath, String content) → Future< void> -
Creates or overwrites file
absPathwithcontent.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited