feat: add exec approval V2 prompt adapter interface#447
Open
AlexAlves87 wants to merge 1 commit into
Open
Conversation
Defines the prompt adapter contract needed before the coordinator (PR7) can be wired up. The interface decouples the coordinator from any UI implementation; the null stub lets PR7 compile and be tested without a WinUI dependency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds the V2 prompt adapter contract needed before the coordinator (PR7) can be wired up. The interface decouples the coordinator from any UI implementation, and the null stub lets PR7 compile and be tested without a WinUI dependency.
What changed
ExecApprovalV2PromptRequest— sealed request type with the 8 fields the presenter needs (DisplayCommand,Cwd,Host,Security,Ask,AgentId,ResolvedPath,SessionKey).AllowAlwaysPatternsis intentionally excluded; it lives onExecApprovalEvaluationand is the coordinator's responsibility to pass through after the decision.IExecApprovalV2PromptHandler— singlePromptAsyncmethod returningTask<ExecApprovalDecision>. Non-nullable contract; implementations fail-closed toDenyon any unhandled error.ExecApprovalV2NullPromptHandler— stub that always returnsDenysynchronously viaTask.FromResult. Never throws. Intended as the default until a real dialog implementation ships.The
V2infix avoids collision with the existingIExecApprovalPromptHandler/ExecApprovalPromptRequesttypes on the legacy path.Testing
12 tests, all passing. Coverage includes stub behavior, the
AllowAlwaysPatternsexclusion verified via reflection, assembly placement, legacy type separation, and a guard that the null stub is not referenced from productionsrc/.Notes
No production wiring in this PR.
SystemCapabilityis untouched. The real dialog implementation is a separate slice after the coordinator lands.Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com