mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-23 21:18:40 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b69a9c0f7 | ||
|
|
023ea9b3e4 | ||
|
|
bf2a454ef2 |
+3
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aryx",
|
||||
"version": "0.0.8",
|
||||
"version": "0.0.12",
|
||||
"description": "Electron orchestrator for Copilot-powered agent workflows across multiple projects.",
|
||||
"private": true,
|
||||
"main": "dist-electron/main/index.js",
|
||||
@@ -110,7 +110,8 @@
|
||||
"publish": {
|
||||
"provider": "github",
|
||||
"owner": "davidkaya",
|
||||
"repo": "aryx"
|
||||
"repo": "aryx",
|
||||
"releaseType": "release"
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
|
||||
@@ -11,14 +11,30 @@ internal static class CopilotSessionHooks
|
||||
private const string AllowDecision = "allow";
|
||||
private const string AskDecision = "ask";
|
||||
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 ListAgentsToolName = "list_agents";
|
||||
private const string ReadAgentToolName = "read_agent";
|
||||
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 UpdateTodoToolName = "update_todo";
|
||||
private static readonly HashSet<string> AlwaysAllowedToolNames = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
AskUserToolName,
|
||||
ExitPlanModeToolName,
|
||||
FetchCopilotCliDocumentationToolName,
|
||||
ListAgentsToolName,
|
||||
ReadAgentToolName,
|
||||
ReportIntentToolName,
|
||||
SkillToolName,
|
||||
SqlToolName,
|
||||
TaskToolName,
|
||||
TaskCompleteToolName,
|
||||
UpdateTodoToolName,
|
||||
};
|
||||
private static readonly JsonSerializerOptions HookJsonOptions = CreateHookJsonOptions();
|
||||
|
||||
|
||||
@@ -108,11 +108,19 @@ public sealed class CopilotSessionHooksTests
|
||||
|
||||
[Theory]
|
||||
[InlineData("ask_user")]
|
||||
[InlineData("exit_plan_mode")]
|
||||
[InlineData("fetch_copilot_cli_documentation")]
|
||||
[InlineData("list_agents")]
|
||||
[InlineData("read_agent")]
|
||||
[InlineData("report_intent")]
|
||||
[InlineData("skill")]
|
||||
[InlineData("sql")]
|
||||
[InlineData("task")]
|
||||
[InlineData("task_complete")]
|
||||
[InlineData("update_todo")]
|
||||
[InlineData("handoff_to_2")]
|
||||
[InlineData("handoff_to_specialist")]
|
||||
public async Task Create_PreToolUseAutoAllowsInfrastructureTools(string toolName)
|
||||
public async Task Create_PreToolUseAutoAllowsInternalOrchestrationTools(string toolName)
|
||||
{
|
||||
RunTurnCommandDto command = CreateCommandWithToolApproval();
|
||||
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);
|
||||
}
|
||||
|
||||
[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]
|
||||
public async Task Create_RunsConfiguredNonPreToolHooks()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user