@@ -2,7 +2,7 @@ import { LitElement, html, css } from 'lit';
22import { customElement , property , state } from 'lit/decorators.js' ;
33import { classMap } from 'lit/directives/class-map.js' ;
44import { BaseElement } from '../../../core/BaseElement' ;
5- import type { AIComponentState , AIAction } from '../../../core/ai-metadata.types' ;
5+ import type { AIComponentState , AIAction , AIStateExplanation } from '../../../core/ai-metadata.types' ;
66import '../../atoms/button/button' ;
77import '../../atoms/select/select' ;
88import '../../atoms/input/input' ;
@@ -323,17 +323,20 @@ export class ForgePagination extends BaseElement {
323323 override get aiState ( ) : AIComponentState {
324324 return {
325325 ...super . aiState ,
326- currentPage : this . currentPage ,
327- totalPages : this . totalPages ,
328- pageSize : this . pageSize ,
329- totalItems : this . totalItems ,
330- mode : this . mode ,
331- loading : this . loading ,
332- hasMore : this . hasMore
326+ state : {
327+ ...super . aiState . state ,
328+ currentPage : this . currentPage ,
329+ totalPages : this . totalPages ,
330+ pageSize : this . pageSize ,
331+ totalItems : this . totalItems ,
332+ mode : this . mode ,
333+ loading : this . loading ,
334+ hasMore : this . hasMore
335+ }
333336 } ;
334337 }
335338
336- override explainState ( ) : string {
339+ override explainState ( ) : AIStateExplanation {
337340 const parts = [ 'Pagination component' ] ;
338341
339342 if ( this . mode === 'pagination' ) {
@@ -355,7 +358,11 @@ export class ForgePagination extends BaseElement {
355358
356359 if ( this . loading ) parts . push ( 'loading' ) ;
357360
358- return parts . join ( ', ' ) ;
361+ return {
362+ currentState : this . loading ? 'loading' : 'ready' ,
363+ possibleStates : [ 'loading' , 'ready' ] ,
364+ stateDescription : parts . join ( ', ' )
365+ } ;
359366 }
360367
361368 override getPossibleActions ( ) : AIAction [ ] {
@@ -395,7 +402,12 @@ export class ForgePagination extends BaseElement {
395402 name : 'jumpToPage' ,
396403 description : 'Jump to specific page' ,
397404 available : true ,
398- params : [ 'pageNumber' ]
405+ parameters : [ {
406+ name : 'pageNumber' ,
407+ type : 'number' ,
408+ required : true ,
409+ description : 'Page number to navigate to'
410+ } ]
399411 } ) ;
400412 }
401413
@@ -404,7 +416,12 @@ export class ForgePagination extends BaseElement {
404416 name : 'changePageSize' ,
405417 description : 'Change items per page' ,
406418 available : true ,
407- params : [ 'size' ]
419+ parameters : [ {
420+ name : 'size' ,
421+ type : 'number' ,
422+ required : true ,
423+ description : 'Number of items per page'
424+ } ]
408425 } ) ;
409426 }
410427 } else if ( this . mode === 'load-more' && this . hasMore && ! this . loading ) {
0 commit comments