SmoothOperator.AgentTools
1.0.102
dotnet add package SmoothOperator.AgentTools --version 1.0.102
NuGet\Install-Package SmoothOperator.AgentTools -Version 1.0.102
<PackageReference Include="SmoothOperator.AgentTools" Version="1.0.102" />
<PackageVersion Include="SmoothOperator.AgentTools" Version="1.0.102" />
<PackageReference Include="SmoothOperator.AgentTools" />
paket add SmoothOperator.AgentTools --version 1.0.102
#r "nuget: SmoothOperator.AgentTools, 1.0.102"
#addin nuget:?package=SmoothOperator.AgentTools&version=1.0.102
#tool nuget:?package=SmoothOperator.AgentTools&version=1.0.102
Smooth Operator Agent Tools - C# Library
This is the official C# library implementation for Smooth Operator Agent Tools, a toolkit designed for developers creating Computer Use Agents on Windows systems. It provides programmatic access to control and interact with the Windows environment, including:
- System Operations: Opening applications, getting window details.
- UI Automation: Retrieving UI element trees (Automation Tree).
- Mouse & Keyboard: Simulating user input (typing, clicking).
- ScreenGrasp Integration: Using AI vision (via ScreenGrasp API) to interact with UI elements based on visual descriptions.
- Chrome Automation: Interacting with Google Chrome.
- Code Execution: Running code snippets.
This library provides a convenient wrapper around the Smooth Operator Tools Server API, allowing you to easily integrate these capabilities into your .NET applications.
Installation
Using the .NET CLI:
dotnet add package SmoothOperator.AgentTools
Or using the NuGet Package Manager console:
Install-Package SmoothOperator.AgentTools
Prerequisites
Google Chrome
The Smooth Operator Agent Tools library requires Google Chrome (or a compatible Chromium-based browser) to be installed on the system for browser automation features to work.
Server Installation
The Smooth Operator client library includes a server component (smooth-operator-server.exe
and associated files) that needs to be installed in your application data directory (%APPDATA%\SmoothOperator\AgentToolsServer
). The necessary server files are embedded as resources within the SmoothOperator.AgentTools
library.
Automatic Installation
When you call client.StartServerAsync()
or client.EnsureInstalledAsync()
for the first time, the library will automatically:
- Check if the server is already installed and up-to-date by comparing version files (
installedversion.txt
). - If necessary, create the directory
%APPDATA%\SmoothOperator\AgentToolsServer
. - Extract the embedded server files into this directory.
- Start the server process (if using
StartServerAsync
).
This ensures the correct server version is always available without manual installation steps.
Features
- Fluent API: Provides a clear and easy-to-use API categorized by functionality (System, Mouse, Keyboard, Screenshot, Automation, Chrome, Code).
All features can be tested and explored through a convenient Windows user interface before implementing them in code. Try them out at Smooth Operator Tools UI.
- Automatic Server Management: The client library can automatically start the background server process when needed.
- Cross-Platform Compatibility (Client): The client library itself runs on any platform supported by .NET.
- Windows Server Requirement: The underlying
smooth-operator-server.exe
currently requires a Windows environment to perform the automation tasks. - Strong Typing: Full C# type safety and IntelliSense support.
Basic Usage
using SmoothOperator.AgentTools;
using SmoothOperator.AgentTools.Models;
async Task Main()
{
// Initialize the client with your API key (required for ScreenGrasp features)
// Get a free key at https://screengrasp.com/api.html
var client = new SmoothOperatorClient("YOUR_SCREENGRASP_API_KEY");
try
{
// Start the Server - this also handles installation/updates and takes a moment
await client.StartServerAsync();
Console.WriteLine("Smooth Operator Server connected.");
// Example: Open Calculator
Console.WriteLine("Opening Calculator...");
await client.System.OpenApplicationAsync("calc.exe");
await Task.Delay(2000); // Wait for app to open
// Example: Type '5*6'
Console.WriteLine("Typing '5*6'...");
await client.Keyboard.TypeAsync("5*6");
await Task.Delay(500);
// Example: Click the 'equals' button using ScreenGrasp
Console.WriteLine("Clicking 'equals' button...");
var clickResult = await client.Mouse.ClickByDescriptionAsync("equals button");
if (!clickResult.Success)
{
Console.WriteLine($"Failed to click 'equals' button: {clickResult.Message}");
}
await Task.Delay(1000); // Wait for calculation
// Example: Get the UI overview of the focused window (Calculator)
Console.WriteLine("Getting UI overview...");
var overviewResult = await client.System.GetOverviewAsync();
if (overviewResult.Success)
{
Console.WriteLine("Calculator UI Overview (Automation Tree):");
Console.WriteLine(overviewResult.Overview.ToJsonString());
}
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}
finally
{
// Stop the server process if it was started by this client instance
client.StopServer();
Console.WriteLine("Smooth Operator Server stopped.");
}
}
(See the example-csharp
project in the repository for a more complete, runnable example.)
Documentation
For detailed API documentation, please refer to:
- Usage Guide: Detailed examples and explanations for common use cases.
- Example Project: Download, follow step-by-step instructions, and have your first automation running in minutes.
- API Documentation: Describes the endpoints of the local tools server the C# client library communicates with.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- NETStandard.Library (>= 2.0.3)
- Newtonsoft.Json (>= 13.0.1)
- System.Net.Http.Json (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.102 | 0 | an hour ago |
1.0.101 | 0 | 18 hours ago |
1.0.100 | 55 | 20 hours ago |
1.0.97 | 75 | 2 days ago |
1.0.96 | 69 | 2 days ago |
1.0.95 | 62 | 2 days ago |
1.0.91 | 69 | 2 days ago |
1.0.89 | 118 | 3 days ago |
1.0.88 | 138 | 3 days ago |
1.0.87 | 149 | 3 days ago |
1.0.86 | 138 | 3 days ago |
1.0.85 | 177 | 4 days ago |
1.0.84 | 178 | 4 days ago |
1.0.83 | 166 | 4 days ago |
1.0.82 | 163 | 4 days ago |
1.0.81 | 187 | 4 days ago |
1.0.79 | 186 | 4 days ago |
1.0.78 | 181 | 4 days ago |
1.0.77 | 183 | 4 days ago |
1.0.75 | 175 | 4 days ago |
1.0.74 | 178 | 4 days ago |
1.0.73 | 190 | 4 days ago |
1.0.71 | 152 | 5 days ago |
1.0.33 | 63 | 9 days ago |
1.0.32 | 75 | 9 days ago |