Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent: Use updated agent protocols #44

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Cody.AgentTester/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ private static async Task Initialize()
Webview = "native",
WebviewNativeConfig = new WebviewCapabilities
{
View = WebviewView.Single,
CspSource = "'self' https://cody.vs",
WebviewBundleServingPrefix = "https://cody.vs",
},
Expand Down
6 changes: 4 additions & 2 deletions src/Cody.Core/Agent/IAgentService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Cody.Core.Agent.Protocol;
using Cody.Core.Agent.Protocol;
using System.Collections.Generic;
using System;
using System.Threading.Tasks;

namespace Cody.Core.Agent
Expand Down Expand Up @@ -52,6 +54,6 @@ public interface IAgentService
Task<ChatPanelInfo> NewEditorChat();

[AgentMethod("workspaceFolder/didChange")]
Task WorkspaceFolderDidChange(CodyFilePath path);
Task WorkspaceFolderDidChange(WorkspaceFolderDidChangeEvent uris);
}
}
1 change: 1 addition & 0 deletions src/Cody.Core/Agent/InitializeCallback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public async Task Initialize(IAgentService client)
Webview = "native",
WebviewNativeConfig = new WebviewCapabilities
{
View = WebviewView.Single,
CspSource = "'self' https://cody.vs",
WebviewBundleServingPrefix = "https://cody.vs",
},
Expand Down
13 changes: 7 additions & 6 deletions src/Cody.Core/Agent/Protocol/WebviewCapabilities.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cody.Core.Agent.Protocol
{
public class WebviewCapabilities
{
public string CspSource { get; set; }
public string WebviewBundleServingPrefix { get; set; }
public WebviewView View { get; set; }
}

public enum WebviewView
{
Single,
Multiple
}
}
19 changes: 19 additions & 0 deletions src/Cody.Core/Agent/Protocol/WorkspaceFolderDidChangeEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cody.Core.Agent.Protocol
{
public class WorkspaceFolderDidChangeEvent
{
public List<string> Uris { get; set; }

public WorkspaceFolderDidChangeEvent()
{
Uris = new List<string>();
}
}

}
1 change: 1 addition & 0 deletions src/Cody.Core/Cody.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<Compile Include="Agent\NotificationHandlers.cs" />
<Compile Include="Agent\Protocol\AuthStatus.cs" />
<Compile Include="Agent\Protocol\ChatPanelInfo.cs" />
<Compile Include="Agent\Protocol\WorkspaceFolderDidChangeEvent.cs" />
<Compile Include="Agent\Protocol\TextDocumentShowParamsOptions.cs" />
<Compile Include="Agent\Protocol\TextDocumentShowParams.cs" />
<Compile Include="Agent\Protocol\CodyFilePath.cs" />
Expand Down
Loading
Loading