Skip to content

Commit 8002f0a

Browse files
merge from master
2 parents 2c77bd2 + b6f83e3 commit 8002f0a

File tree

207 files changed

+4520
-952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+4520
-952
lines changed

BotSharp.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Plugin.Graph", "sr
117117
EndProject
118118
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Plugin.AudioHandler", "src\Plugins\BotSharp.Plugin.AudioHandler\BotSharp.Plugin.AudioHandler.csproj", "{F57F4862-F8D4-44A1-AC12-5C131B5C9785}"
119119
EndProject
120+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Core.SideCar", "src\Infrastructure\BotSharp.Core.SideCar\BotSharp.Core.SideCar.csproj", "{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE}"
121+
EndProject
122+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Plugin.VertexAI", "src\Plugins\BotSharp.Plugin.LangChain\BotSharp.Plugin.VertexAI.csproj", "{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B}"
123+
EndProject
120124
Global
121125
GlobalSection(SolutionConfigurationPlatforms) = preSolution
122126
Debug|Any CPU = Debug|Any CPU
@@ -469,6 +473,22 @@ Global
469473
{F57F4862-F8D4-44A1-AC12-5C131B5C9785}.Release|Any CPU.Build.0 = Release|Any CPU
470474
{F57F4862-F8D4-44A1-AC12-5C131B5C9785}.Release|x64.ActiveCfg = Release|Any CPU
471475
{F57F4862-F8D4-44A1-AC12-5C131B5C9785}.Release|x64.Build.0 = Release|Any CPU
476+
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
477+
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
478+
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE}.Debug|x64.ActiveCfg = Debug|Any CPU
479+
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE}.Debug|x64.Build.0 = Debug|Any CPU
480+
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
481+
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE}.Release|Any CPU.Build.0 = Release|Any CPU
482+
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE}.Release|x64.ActiveCfg = Release|Any CPU
483+
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE}.Release|x64.Build.0 = Release|Any CPU
484+
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
485+
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B}.Debug|Any CPU.Build.0 = Debug|Any CPU
486+
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B}.Debug|x64.ActiveCfg = Debug|Any CPU
487+
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B}.Debug|x64.Build.0 = Debug|Any CPU
488+
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B}.Release|Any CPU.ActiveCfg = Release|Any CPU
489+
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B}.Release|Any CPU.Build.0 = Release|Any CPU
490+
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B}.Release|x64.ActiveCfg = Release|Any CPU
491+
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B}.Release|x64.Build.0 = Release|Any CPU
472492
EndGlobalSection
473493
GlobalSection(SolutionProperties) = preSolution
474494
HideSolutionNode = FALSE
@@ -525,6 +545,8 @@ Global
525545
{97A0B191-64D7-4F8A-BFE8-1BFCC5E247E1} = {2635EC9B-2E5F-4313-AC21-0B847F31F36C}
526546
{EBFE97DA-D0BA-48BA-8B5D-083B60348D1D} = {97A0B191-64D7-4F8A-BFE8-1BFCC5E247E1}
527547
{F57F4862-F8D4-44A1-AC12-5C131B5C9785} = {51AFE054-AE99-497D-A593-69BAEFB5106F}
548+
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749}
549+
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B} = {D5293208-2BEF-42FC-A64C-5954F61720BA}
528550
EndGlobalSection
529551
GlobalSection(ExtensibilityGlobals) = postSolution
530552
SolutionGuid = {A9969D89-C98B-40A5-A12B-FC87E55B3A19}

src/Infrastructure/BotSharp.Abstraction/Agents/Enums/BuiltInAgentId.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,9 @@ public class BuiltInAgentId
4646
/// Programming source code generation
4747
/// </summary>
4848
public const string CodeDriver = "c0ded7d9-3f9d-4ef6-b7ce-56a892dcef62";
49+
50+
/// <summary>
51+
/// Evaluate prompt and conversation
52+
/// </summary>
53+
public const string Evaluator = "dfd9b46d-d00c-40af-8a75-3fbdc2b89869";
4954
}

src/Infrastructure/BotSharp.Abstraction/Agents/IAgentService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public interface IAgentService
5555
string GetDataDir();
5656
string GetAgentDataDir(string agentId);
5757

58-
List<Agent> GetAgentsByUser(string userId);
58+
Task<List<UserAgent>> GetUserAgents(string userId);
5959

6060
PluginDef GetPlugin(string agentId);
6161

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
using BotSharp.Abstraction.Users.Models;
2+
13
namespace BotSharp.Abstraction.Agents.Models;
24

35
public class UserAgent
46
{
7+
[JsonPropertyName("id")]
58
public string Id { get; set; } = string.Empty;
9+
10+
[JsonPropertyName("user_id")]
611
public string UserId { get; set; } = string.Empty;
7-
public string AgentId { get; set; } = string.Empty;
8-
public bool Editable { get; set; }
12+
13+
[JsonPropertyName("agent_id")]
14+
public string AgentId { get; set; }
15+
16+
[JsonPropertyName("actions")]
17+
public IEnumerable<string> Actions { get; set; } = [];
18+
19+
[JsonIgnore]
20+
public Agent? Agent { get; set; }
21+
22+
[JsonPropertyName("updated_time")]
923
public DateTime UpdatedTime { get; set; } = DateTime.UtcNow;
24+
25+
[JsonPropertyName("created_time")]
1026
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
1127
}

src/Infrastructure/BotSharp.Abstraction/BotSharp.Abstraction.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>$(TargetFramework)</TargetFramework>
@@ -32,11 +32,13 @@
3232
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
3333
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
3434
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
35+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.1.2" />
3536
<PackageReference Include="System.Memory.Data" Version="8.0.0" />
3637
<PackageReference Include="System.Text.Json" Version="8.0.5" />
3738
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
3839
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
3940
<PackageReference Include="Rougamo.Fody" Version="4.0.0" />
41+
<PackageReference Include="AspectInjector" Version="2.8.2" />
4042
</ItemGroup>
4143

4244
</Project>

src/Infrastructure/BotSharp.Abstraction/Browsing/IWebBrowser.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public interface IWebBrowser
1212
Task<BrowserActionResult> ActionOnElement(MessageInfo message, ElementLocatingArgs location, ElementActionArgs action);
1313
Task<BrowserActionResult> LocateElement(MessageInfo message, ElementLocatingArgs location);
1414
Task DoAction(MessageInfo message, ElementActionArgs action, BrowserActionResult result);
15+
Task PressKey(MessageInfo message, string key);
1516

1617
Task<BrowserActionResult> InputUserText(BrowserActionParams actionParams);
1718
Task<BrowserActionResult> InputUserPassword(BrowserActionParams actionParams);

src/Infrastructure/BotSharp.Abstraction/Browsing/Models/BrowserActionResult.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ public class BrowserActionResult
66
public bool IsSuccess { get; set; }
77
public string? Message { get; set; }
88
public string? StackTrace { get; set; }
9-
public string Selector { get; set; }
10-
public string Body { get; set; }
9+
public string? Selector { get; set; }
10+
public string? Body { get; set; }
1111
public bool IsHighlighted { get; set; }
1212

1313
public override string ToString()

src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementActionArgs.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using BotSharp.Abstraction.Browsing.Enums;
2+
using System.Diagnostics;
23

34
namespace BotSharp.Abstraction.Browsing.Models;
45

6+
[DebuggerStepThrough]
57
public class ElementActionArgs
68
{
79
public BroswerActionEnum Action { get; set; }
@@ -10,6 +12,10 @@ public class ElementActionArgs
1012

1113
public ElementPosition? Position { get; set; }
1214

15+
/// <summary>
16+
/// Delay milliseconds before pressing key
17+
/// </summary>
18+
public int DelayBeforePressingKey { get; set; }
1319
public string? PressKey { get; set; }
1420

1521
/// <summary>

src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementLocatingArgs.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using System.Diagnostics;
2+
13
namespace BotSharp.Abstraction.Browsing.Models;
24

5+
[DebuggerStepThrough]
36
public class ElementLocatingArgs
47
{
58
[JsonPropertyName("match_rule")]

src/Infrastructure/BotSharp.Abstraction/Browsing/Models/MessageInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using BotSharp.Abstraction.Infrastructures;
2+
using System.Diagnostics;
23

34
namespace BotSharp.Abstraction.Browsing.Models;
45

6+
[DebuggerStepThrough]
57
public class MessageInfo : ICacheKey
68
{
79
public string AgentId { get; set; } = null!;

0 commit comments

Comments
 (0)