@@ -17,6 +17,7 @@ export class ChatElicitationRequestPart extends Disposable implements IChatElici
1717
1818 private readonly _isHiddenValue = observableValue < boolean > ( 'isHidden' , false ) ;
1919 public readonly isHidden : IObservable < boolean > = this . _isHiddenValue ;
20+ public reject ?: ( ( ) => Promise < void > ) | undefined ;
2021
2122 constructor (
2223 public readonly title : string | IMarkdownString ,
@@ -25,13 +26,20 @@ export class ChatElicitationRequestPart extends Disposable implements IChatElici
2526 public readonly acceptButtonLabel : string ,
2627 public readonly rejectButtonLabel : string | undefined ,
2728 // True when the primary action is accepted, otherwise the action that was selected
28- public readonly _accept : ( value : IAction | true ) => Promise < ElicitationState > ,
29- public readonly _reject ?: ( ) => Promise < ElicitationState > ,
29+ private readonly _accept : ( value : IAction | true ) => Promise < ElicitationState > ,
30+ reject ?: ( ) => Promise < ElicitationState > ,
3031 public readonly source ?: ToolDataSource ,
3132 public readonly moreActions ?: IAction [ ] ,
3233 public readonly onHide ?: ( ) => void ,
3334 ) {
3435 super ( ) ;
36+
37+ if ( reject ) {
38+ this . reject = async ( ) => {
39+ const state = await reject ! ( ) ;
40+ this . state . set ( state , undefined ) ;
41+ } ;
42+ }
3543 }
3644
3745 accept ( value : IAction | true ) : Promise < void > {
0 commit comments