Merge branch 'SciSharp:master' into features/refine-conv-filter
This commit is contained in:
commit
a172375bff
|
|
@ -38,7 +38,7 @@
|
|||
<PackageVersion Include="Nanoid" Version="3.1.0" />
|
||||
<PackageVersion Include="Swashbuckle.AspNetCore" Version="8.1.2" />
|
||||
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
|
||||
<PackageVersion Include="Anthropic.SDK" Version="5.1.1" />
|
||||
<PackageVersion Include="Anthropic.SDK" Version="5.5.0" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageVersion Include="NAudio" Version="2.2.1" />
|
||||
<PackageVersion Include="NAudio.Core" Version="2.2.1" />
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ public class CrontabWatcher : BackgroundService
|
|||
{
|
||||
var cron = services.GetRequiredService<ICrontabService>();
|
||||
var crons = await cron.GetCrontable();
|
||||
var settings = services.GetRequiredService<CrontabSettings>();
|
||||
var publisher = services.GetService<IEventPublisher>();
|
||||
|
||||
foreach (var item in crons)
|
||||
|
|
@ -87,7 +88,7 @@ public class CrontabWatcher : BackgroundService
|
|||
{
|
||||
_logger.LogInformation($"The current time matches the cron expression {item}");
|
||||
|
||||
if (publisher != null)
|
||||
if (publisher != null && settings.EventSubscriber.Enabled)
|
||||
{
|
||||
await publisher.PublishAsync($"Crontab:{item.Title}", item.Cron);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ public class WinOSDriver : IComputerUse
|
|||
case "right_click":
|
||||
WindowsMouseController.RightClick();
|
||||
break;
|
||||
case "cursor_position":
|
||||
var (x, y) = WindowsMouseController.GetCurrentCursorPosition();
|
||||
Console.WriteLine($"Current cursor position: ({x}, {y})");
|
||||
break;
|
||||
default:
|
||||
throw new ToolError($"Action {action} is not supported");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,13 @@ public class WindowsMouseController
|
|||
public int Left, Top, Right, Bottom;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct POINT
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
}
|
||||
|
||||
// Define MONITORINFO structure
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MONITORINFO
|
||||
|
|
@ -34,6 +41,10 @@ public class WindowsMouseController
|
|||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||
private static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool GetCursorPos(out POINT lpPoint);
|
||||
|
||||
|
||||
// Class to hold monitor information
|
||||
public class MonitorInfo
|
||||
{
|
||||
|
|
@ -41,6 +52,13 @@ public class WindowsMouseController
|
|||
public RECT MonitorArea;
|
||||
}
|
||||
|
||||
// Method to get current cursor position
|
||||
public static (int x, int y) GetCurrentCursorPosition()
|
||||
{
|
||||
GetCursorPos(out POINT cursorPos);
|
||||
return (cursorPos.X, cursorPos.Y);
|
||||
}
|
||||
|
||||
// Method to get all connected monitors
|
||||
public static List<MonitorInfo> GetMonitors()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue