mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-07 04:08:45 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b69a9c0f7 | ||
|
|
023ea9b3e4 | ||
|
|
bf2a454ef2 |
+3
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aryx",
|
"name": "aryx",
|
||||||
"version": "0.0.8",
|
"version": "0.0.12",
|
||||||
"description": "Electron orchestrator for Copilot-powered agent workflows across multiple projects.",
|
"description": "Electron 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",
|
||||||
@@ -110,7 +110,8 @@
|
|||||||
"publish": {
|
"publish": {
|
||||||
"provider": "github",
|
"provider": "github",
|
||||||
"owner": "davidkaya",
|
"owner": "davidkaya",
|
||||||
"repo": "aryx"
|
"repo": "aryx",
|
||||||
|
"releaseType": "release"
|
||||||
},
|
},
|
||||||
"win": {
|
"win": {
|
||||||
"target": [
|
"target": [
|
||||||
|
|||||||
@@ -11,14 +11,30 @@ internal static class CopilotSessionHooks
|
|||||||
private const string AllowDecision = "allow";
|
private const string AllowDecision = "allow";
|
||||||
private const string AskDecision = "ask";
|
private const string AskDecision = "ask";
|
||||||
private const string DenyDecision = "deny";
|
private const string DenyDecision = "deny";
|
||||||
|
private const string ExitPlanModeToolName = "exit_plan_mode";
|
||||||
|
private const string FetchCopilotCliDocumentationToolName = "fetch_copilot_cli_documentation";
|
||||||
private const string HandoffToolPrefix = "handoff_to_";
|
private const string HandoffToolPrefix = "handoff_to_";
|
||||||
|
private const string ListAgentsToolName = "list_agents";
|
||||||
|
private const string ReadAgentToolName = "read_agent";
|
||||||
private const string ReportIntentToolName = "report_intent";
|
private const string ReportIntentToolName = "report_intent";
|
||||||
|
private const string SkillToolName = "skill";
|
||||||
|
private const string SqlToolName = "sql";
|
||||||
|
private const string TaskToolName = "task";
|
||||||
private const string TaskCompleteToolName = "task_complete";
|
private const string TaskCompleteToolName = "task_complete";
|
||||||
|
private const string UpdateTodoToolName = "update_todo";
|
||||||
private static readonly HashSet<string> AlwaysAllowedToolNames = new(StringComparer.OrdinalIgnoreCase)
|
private static readonly HashSet<string> AlwaysAllowedToolNames = new(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
{
|
||||||
AskUserToolName,
|
AskUserToolName,
|
||||||
|
ExitPlanModeToolName,
|
||||||
|
FetchCopilotCliDocumentationToolName,
|
||||||
|
ListAgentsToolName,
|
||||||
|
ReadAgentToolName,
|
||||||
ReportIntentToolName,
|
ReportIntentToolName,
|
||||||
|
SkillToolName,
|
||||||
|
SqlToolName,
|
||||||
|
TaskToolName,
|
||||||
TaskCompleteToolName,
|
TaskCompleteToolName,
|
||||||
|
UpdateTodoToolName,
|
||||||
};
|
};
|
||||||
private static readonly JsonSerializerOptions HookJsonOptions = CreateHookJsonOptions();
|
private static readonly JsonSerializerOptions HookJsonOptions = CreateHookJsonOptions();
|
||||||
|
|
||||||
|
|||||||
@@ -108,11 +108,19 @@ public sealed class CopilotSessionHooksTests
|
|||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("ask_user")]
|
[InlineData("ask_user")]
|
||||||
|
[InlineData("exit_plan_mode")]
|
||||||
|
[InlineData("fetch_copilot_cli_documentation")]
|
||||||
|
[InlineData("list_agents")]
|
||||||
|
[InlineData("read_agent")]
|
||||||
[InlineData("report_intent")]
|
[InlineData("report_intent")]
|
||||||
|
[InlineData("skill")]
|
||||||
|
[InlineData("sql")]
|
||||||
|
[InlineData("task")]
|
||||||
[InlineData("task_complete")]
|
[InlineData("task_complete")]
|
||||||
|
[InlineData("update_todo")]
|
||||||
[InlineData("handoff_to_2")]
|
[InlineData("handoff_to_2")]
|
||||||
[InlineData("handoff_to_specialist")]
|
[InlineData("handoff_to_specialist")]
|
||||||
public async Task Create_PreToolUseAutoAllowsInfrastructureTools(string toolName)
|
public async Task Create_PreToolUseAutoAllowsInternalOrchestrationTools(string toolName)
|
||||||
{
|
{
|
||||||
RunTurnCommandDto command = CreateCommandWithToolApproval();
|
RunTurnCommandDto command = CreateCommandWithToolApproval();
|
||||||
SessionHooks hooks = CopilotSessionHooks.Create(command, command.Pattern.Agents[0], ResolvedHookSet.Empty, new RecordingHookCommandRunner());
|
SessionHooks hooks = CopilotSessionHooks.Create(command, command.Pattern.Agents[0], ResolvedHookSet.Empty, new RecordingHookCommandRunner());
|
||||||
@@ -127,6 +135,22 @@ public sealed class CopilotSessionHooksTests
|
|||||||
Assert.Equal("allow", decision?.PermissionDecision);
|
Assert.Equal("allow", decision?.PermissionDecision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task Create_PreToolUseKeepsStoreMemoryUnderApprovalPolicy()
|
||||||
|
{
|
||||||
|
RunTurnCommandDto command = CreateCommandWithToolApproval();
|
||||||
|
SessionHooks hooks = CopilotSessionHooks.Create(command, command.Pattern.Agents[0], ResolvedHookSet.Empty, new RecordingHookCommandRunner());
|
||||||
|
|
||||||
|
PreToolUseHookOutput? decision = await hooks.OnPreToolUse!(
|
||||||
|
new PreToolUseHookInput
|
||||||
|
{
|
||||||
|
ToolName = "store_memory",
|
||||||
|
},
|
||||||
|
null!);
|
||||||
|
|
||||||
|
Assert.Equal("ask", decision?.PermissionDecision);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Create_RunsConfiguredNonPreToolHooks()
|
public async Task Create_RunsConfiguredNonPreToolHooks()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user