ShellBackedAgentEngineSandboxClient class
Command-based AgentEngineEnvironmentClient that delegates file I/O over shell commands when direct file APIs are unavailable.
- Implemented types
Constructors
-
ShellBackedAgentEngineSandboxClient({required Future<
EnvironmentExecutionResult> commandRunner({required String command, Map<String, String> ? envVars, required String sandboxResourceName, Duration? timeout, String? workingDir}), Future<String> createSandboxFn({required String agentEngineResourceName, String? sandboxConfig, Duration? ttl})?, Future<void> deleteSandboxFn(String sandboxResourceName)?, Future<String> getSandboxStateFn(String sandboxResourceName)?, Future<void> waitUntilRunningFn(String sandboxResourceName)?}) -
Creates a shell-backed Agent Engine sandbox client using
commandRunner.
Properties
-
commandRunner
→ Future<
EnvironmentExecutionResult> Function({required String command, Map<String, String> ? envVars, required String sandboxResourceName, Duration? timeout, String? workingDir}) -
Callback that executes a shell command in the remote Agent Engine sandbox.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createSandbox(
{required String agentEngineResourceName, String? sandboxConfig, Duration? ttl}) → Future< String> -
Creates a new sandbox inside
agentEngineResourceNameand returns its resource name.override -
deleteSandbox(
String sandboxResourceName) → Future< void> -
Deletes the sandbox identified by
sandboxResourceName.override -
execute(
{required String sandboxResourceName, required String command, String? workingDir, Duration? timeout, Map< String, String> ? envVars}) → Future<EnvironmentExecutionResult> -
Executes
commandinsidesandboxResourceName.override -
getSandboxState(
String sandboxResourceName) → Future< String> -
Returns the lifecycle state of
sandboxResourceName(defaults to'STATE_RUNNING').override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pauseSandbox(
String sandboxResourceName) → Future< void> -
Pauses
sandboxResourceNamewhen closing without deletion.override -
readFile(
{required String sandboxResourceName, required String path}) → Future< Uint8List> -
Reads a file at
pathinsidesandboxResourceName.override -
resumeSandbox(
String sandboxResourceName) → Future< void> -
Resumes a paused
sandboxResourceName.override -
toString(
) → String -
A string representation of this object.
inherited
-
waitUntilRunning(
String sandboxResourceName) → Future< void> -
Waits until
sandboxResourceNametransitions to'STATE_RUNNING'.override -
writeFile(
{required String sandboxResourceName, required String path, required List< int> bytes}) → Future<void> -
Writes
bytestopathinsidesandboxResourceName.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited