Skip to content

Commit a172375

Browse files
authored
Merge branch 'SciSharp:master' into features/refine-conv-filter
2 parents 0f8d825 + de03268 commit a172375

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<PackageVersion Include="Nanoid" Version="3.1.0" />
3939
<PackageVersion Include="Swashbuckle.AspNetCore" Version="8.1.2" />
4040
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
41-
<PackageVersion Include="Anthropic.SDK" Version="5.1.1" />
41+
<PackageVersion Include="Anthropic.SDK" Version="5.5.0" />
4242
<PackageVersion Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
4343
<PackageVersion Include="NAudio" Version="2.2.1" />
4444
<PackageVersion Include="NAudio.Core" Version="2.2.1" />

src/Infrastructure/BotSharp.Core.Crontab/Services/CrontabWatcher.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private async Task RunCronChecker(IServiceProvider services)
4545
{
4646
var cron = services.GetRequiredService<ICrontabService>();
4747
var crons = await cron.GetCrontable();
48+
var settings = services.GetRequiredService<CrontabSettings>();
4849
var publisher = services.GetService<IEventPublisher>();
4950

5051
foreach (var item in crons)
@@ -87,7 +88,7 @@ private async Task RunCronChecker(IServiceProvider services)
8788
{
8889
_logger.LogInformation($"The current time matches the cron expression {item}");
8990

90-
if (publisher != null)
91+
if (publisher != null && settings.EventSubscriber.Enabled)
9192
{
9293
await publisher.PublishAsync($"Crontab:{item.Title}", item.Cron);
9394
}

src/Plugins/BotSharp.Plugin.OsDriver/WinOSDriver.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public static void TakeAction(string action, string? text, Tuple<int, int>? coor
2929
case "right_click":
3030
WindowsMouseController.RightClick();
3131
break;
32+
case "cursor_position":
33+
var (x, y) = WindowsMouseController.GetCurrentCursorPosition();
34+
Console.WriteLine($"Current cursor position: ({x}, {y})");
35+
break;
3236
default:
3337
throw new ToolError($"Action {action} is not supported");
3438
}

src/Plugins/BotSharp.Plugin.OsDriver/WindowsMouseController.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ public struct RECT
1313
public int Left, Top, Right, Bottom;
1414
}
1515

16+
[StructLayout(LayoutKind.Sequential)]
17+
public struct POINT
18+
{
19+
public int X;
20+
public int Y;
21+
}
22+
1623
// Define MONITORINFO structure
1724
[StructLayout(LayoutKind.Sequential)]
1825
public struct MONITORINFO
@@ -34,13 +41,24 @@ private static extern bool EnumDisplayMonitors(IntPtr hdc, IntPtr lprcClip,
3441
[DllImport("user32.dll", CharSet = CharSet.Auto)]
3542
private static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi);
3643

44+
[DllImport("user32.dll")]
45+
private static extern bool GetCursorPos(out POINT lpPoint);
46+
47+
3748
// Class to hold monitor information
3849
public class MonitorInfo
3950
{
4051
public IntPtr MonitorHandle;
4152
public RECT MonitorArea;
4253
}
4354

55+
// Method to get current cursor position
56+
public static (int x, int y) GetCurrentCursorPosition()
57+
{
58+
GetCursorPos(out POINT cursorPos);
59+
return (cursorPos.X, cursorPos.Y);
60+
}
61+
4462
// Method to get all connected monitors
4563
public static List<MonitorInfo> GetMonitors()
4664
{

0 commit comments

Comments
 (0)