mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-07 20:28:46 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36b8dd0c12 | ||
|
|
7a7b3fcdca | ||
|
|
794794afe4 |
@@ -40,7 +40,7 @@ jobs:
|
|||||||
- name: Set up .NET
|
- name: Set up .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v4
|
||||||
with:
|
with:
|
||||||
dotnet-version: 9.0.x
|
dotnet-version: 10.0.x
|
||||||
|
|
||||||
- name: Install Linux native dependencies
|
- name: Install Linux native dependencies
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
@@ -115,7 +115,7 @@ jobs:
|
|||||||
- name: Set up .NET
|
- name: Set up .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v4
|
||||||
with:
|
with:
|
||||||
dotnet-version: 9.0.x
|
dotnet-version: 10.0.x
|
||||||
|
|
||||||
- name: Install Linux native dependencies
|
- name: Install Linux native dependencies
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aryx",
|
"name": "aryx",
|
||||||
"version": "0.0.22",
|
"version": "0.0.23",
|
||||||
"description": "Orchestrator for Copilot-powered agent workflows across multiple projects.",
|
"description": "Orchestrator for Copilot-powered agent workflows across multiple projects.",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "dist-electron/main/index.js",
|
"main": "dist-electron/main/index.js",
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ internal sealed class CopilotAgentBundle : IAsyncDisposable
|
|||||||
{
|
{
|
||||||
List<IAsyncDisposable> disposables = [];
|
List<IAsyncDisposable> disposables = [];
|
||||||
List<AIAgent> agents = [];
|
List<AIAgent> agents = [];
|
||||||
CopilotClientOptions clientOptions = CopilotCliPathResolver.CreateClientOptions();
|
|
||||||
ResolvedHookSet configuredHooks = await HookConfigLoader.LoadAsync(command.ProjectPath, cancellationToken)
|
ResolvedHookSet configuredHooks = await HookConfigLoader.LoadAsync(command.ProjectPath, cancellationToken)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
IHookCommandRunner hookCommandRunner = HookCommandRunner.Instance;
|
IHookCommandRunner hookCommandRunner = HookCommandRunner.Instance;
|
||||||
@@ -52,42 +51,48 @@ internal sealed class CopilotAgentBundle : IAsyncDisposable
|
|||||||
disposables.Add(toolingBundle);
|
disposables.Add(toolingBundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Share a single CopilotClient across all agents to avoid spawning
|
|
||||||
// multiple CLI processes that race on token refresh during auto-login.
|
|
||||||
CopilotClient sharedClient = new(clientOptions);
|
|
||||||
await sharedClient.StartAsync(cancellationToken).ConfigureAwait(false);
|
|
||||||
|
|
||||||
IReadOnlyList<WorkflowNodeDto> agentNodes = command.Workflow.GetAllAgentNodes(command.WorkflowLibrary);
|
IReadOnlyList<WorkflowNodeDto> agentNodes = command.Workflow.GetAllAgentNodes(command.WorkflowLibrary);
|
||||||
foreach ((WorkflowNodeDto definition, int agentIndex) in agentNodes.Select((definition, index) => (definition, index)))
|
|
||||||
|
if (agentNodes.Count > 0)
|
||||||
{
|
{
|
||||||
SessionConfig sessionConfig = CreateSessionConfig(
|
CopilotClientOptions clientOptions = CopilotCliPathResolver.CreateClientOptions();
|
||||||
command,
|
|
||||||
definition,
|
|
||||||
agentIndex,
|
|
||||||
(request, invocation) => onPermissionRequest(definition, request, invocation),
|
|
||||||
(request, invocation) => onUserInputRequest(definition, request, invocation),
|
|
||||||
evt => onSessionEvent?.Invoke(definition, evt),
|
|
||||||
configuredHooks,
|
|
||||||
hookCommandRunner);
|
|
||||||
|
|
||||||
ApplySessionTooling(sessionConfig, toolingBundle?.McpServers, toolingBundle?.Tools);
|
// Share a single CopilotClient across all agents to avoid spawning
|
||||||
ApplyPromptInvocation(sessionConfig, command.PromptInvocation);
|
// multiple CLI processes that race on token refresh during auto-login.
|
||||||
|
CopilotClient sharedClient = new(clientOptions);
|
||||||
|
await sharedClient.StartAsync(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
AryxCopilotAgent agent = new(
|
foreach ((WorkflowNodeDto definition, int agentIndex) in agentNodes.Select((definition, index) => (definition, index)))
|
||||||
sharedClient,
|
{
|
||||||
sessionConfig,
|
SessionConfig sessionConfig = CreateSessionConfig(
|
||||||
ownsClient: false,
|
command,
|
||||||
id: definition.GetAgentId(),
|
definition,
|
||||||
name: definition.GetAgentName(),
|
agentIndex,
|
||||||
description: NormalizeOptionalString(definition.Config.Description));
|
(request, invocation) => onPermissionRequest(definition, request, invocation),
|
||||||
|
(request, invocation) => onUserInputRequest(definition, request, invocation),
|
||||||
|
evt => onSessionEvent?.Invoke(definition, evt),
|
||||||
|
configuredHooks,
|
||||||
|
hookCommandRunner);
|
||||||
|
|
||||||
agents.Add(agent);
|
ApplySessionTooling(sessionConfig, toolingBundle?.McpServers, toolingBundle?.Tools);
|
||||||
disposables.Add(agent);
|
ApplyPromptInvocation(sessionConfig, command.PromptInvocation);
|
||||||
|
|
||||||
|
AryxCopilotAgent agent = new(
|
||||||
|
sharedClient,
|
||||||
|
sessionConfig,
|
||||||
|
ownsClient: false,
|
||||||
|
id: definition.GetAgentId(),
|
||||||
|
name: definition.GetAgentName(),
|
||||||
|
description: NormalizeOptionalString(definition.Config.Description));
|
||||||
|
|
||||||
|
agents.Add(agent);
|
||||||
|
disposables.Add(agent);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The bundle owns the shared client — disposed after all agents.
|
||||||
|
disposables.Add(sharedClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The bundle owns the shared client — disposed after all agents.
|
|
||||||
disposables.Add(sharedClient);
|
|
||||||
|
|
||||||
CopilotAgentBundle bundle = new(agents, hasConfiguredHooks: !configuredHooks.IsEmpty);
|
CopilotAgentBundle bundle = new(agents, hasConfiguredHooks: !configuredHooks.IsEmpty);
|
||||||
bundle._disposables.AddRange(disposables);
|
bundle._disposables.AddRange(disposables);
|
||||||
return bundle;
|
return bundle;
|
||||||
|
|||||||
Reference in New Issue
Block a user