@@ -132,7 +132,9 @@ function createRuntime() {
132132 daily : [ ] ,
133133 } ) ) ,
134134 getUsageSnapshot : vi . fn ( ( ) => ( { available : true , entries : [ ] } ) ) ,
135+ noteQuotaDemand : vi . fn ( ( ) => ( { available : true , entries : [ ] } ) ) ,
135136 forceRefresh : vi . fn ( async ( ) => ( { available : true , entries : [ ] } ) ) ,
137+ refreshHistory : vi . fn ( async ( ) => ( { available : true , entries : [ ] } ) ) ,
136138 poll : vi . fn ( async ( ) => ( { available : true , entries : [ ] } ) ) ,
137139 start : vi . fn ( ( ) => { } ) ,
138140 stop : vi . fn ( ( ) => { } ) ,
@@ -2599,6 +2601,12 @@ describe("adeRpcServer", () => {
25992601 expect ( usageActions . structuredContent . actions ) . toContainEqual (
26002602 expect . objectContaining ( { domain : "usage" , action : "getAdeUsageStats" , name : "usage.getAdeUsageStats" } ) ,
26012603 ) ;
2604+ expect ( usageActions . structuredContent . actions ) . toContainEqual (
2605+ expect . objectContaining ( { domain : "usage" , action : "noteQuotaDemand" , name : "usage.noteQuotaDemand" } ) ,
2606+ ) ;
2607+ expect ( usageActions . structuredContent . actions ) . not . toContainEqual (
2608+ expect . objectContaining ( { domain : "usage" , action : "refreshHistory" } ) ,
2609+ ) ;
26022610
26032611 const allDomains = await callTool ( handler , "list_ade_actions" , { domain : "all" } ) ;
26042612 expect ( allDomains ?. isError ) . toBeUndefined ( ) ;
@@ -2727,6 +2735,15 @@ describe("adeRpcServer", () => {
27272735 expect ( fixture . runtime . usageTrackingService . getAdeUsageStats ) . toHaveBeenCalledWith ( { preset : "7d" } ) ;
27282736 expect ( usageStats . structuredContent . result ) . toMatchObject ( { preset : "7d" , daily : [ ] } ) ;
27292737
2738+ const quotaDemand = await callTool ( handler , "run_ade_action" , {
2739+ domain : "usage" ,
2740+ action : "noteQuotaDemand" ,
2741+ args : { } ,
2742+ } ) ;
2743+ expect ( quotaDemand ?. isError ) . toBeUndefined ( ) ;
2744+ expect ( fixture . runtime . usageTrackingService . noteQuotaDemand ) . toHaveBeenCalledWith ( undefined ) ;
2745+ expect ( quotaDemand . structuredContent . result ) . toEqual ( { available : true , entries : [ ] } ) ;
2746+
27302747 } ) ;
27312748
27322749 it ( "records normalized ADE Code actions without recording terminal keystrokes" , async ( ) => {
0 commit comments