@@ -171,6 +171,8 @@ export const createMynahUi = (
171171) : [ MynahUI , InboundChatApi ] => {
172172 let disclaimerCardActive = ! disclaimerAcknowledged
173173 let programmingModeCardActive = ! pairProgrammingCardAcknowledged
174+ const isFreeTierLimitReached = true
175+ let paidTierCardActive = isFreeTierLimitReached
174176 let contextCommandGroups : ContextCommandGroups | undefined
175177
176178 let chatEventHandlers : ChatEventHandler = {
@@ -264,7 +266,12 @@ export const createMynahUi = (
264266 // We check if tabMetadata.openTabKey exists - if it does and is set to true, we skip showing welcome messages
265267 // since this indicates we're loading a previous chat session rather than starting a new one.
266268 if ( ! tabStore ?. tabMetadata || ! tabStore . tabMetadata . openTabKey ) {
267- defaultTabConfig . chatItems = tabFactory . getChatItems ( true , programmingModeCardActive , [ ] )
269+ defaultTabConfig . chatItems = tabFactory . getChatItems (
270+ true ,
271+ programmingModeCardActive ,
272+ paidTierCardActive ,
273+ [ ]
274+ )
268275 }
269276 mynahUi . updateStore ( tabId , defaultTabConfig )
270277 messager . onTabAdd ( tabId )
@@ -465,6 +472,14 @@ export const createMynahUi = (
465472 }
466473 messager . onPromptInputOptionChange ( { tabId, optionsValues } )
467474 } ,
475+ onPromptInputButtonClick : ( tabId , buttonId , eventId ) => {
476+ const payload : ButtonClickParams = {
477+ tabId,
478+ messageId : 'not-a-message' ,
479+ buttonId : buttonId ,
480+ }
481+ messager . onPromptInputButtonClick ( payload )
482+ } ,
468483 onMessageDismiss : ( tabId , messageId ) => {
469484 if ( messageId === programmerModeCard . messageId ) {
470485 programmingModeCardActive = false
@@ -473,7 +488,7 @@ export const createMynahUi = (
473488 // Update the tab defaults to hide the programmer mode card for new tabs
474489 mynahUi . updateTabDefaults ( {
475490 store : {
476- chatItems : tabFactory . getChatItems ( true , false ) ,
491+ chatItems : tabFactory . getChatItems ( true , false , false ) ,
477492 } ,
478493 } )
479494 }
@@ -494,7 +509,7 @@ export const createMynahUi = (
494509 } ,
495510 } ,
496511 defaults : {
497- store : tabFactory . createTab ( false ) ,
512+ store : tabFactory . createTab ( false , paidTierCardActive ) ,
498513 } ,
499514 config : {
500515 maxTabs : 10 ,
@@ -534,7 +549,7 @@ export const createMynahUi = (
534549 // This distinction helps maintain consistent tab behavior between fresh conversations and restored sessions.
535550 const createTabId = ( openTab ?: boolean ) => {
536551 const tabId = mynahUi . updateStore ( '' , {
537- ...tabFactory . createTab ( disclaimerCardActive ) ,
552+ ...tabFactory . createTab ( disclaimerCardActive , paidTierCardActive ) ,
538553 tabMetadata : { openTabKey : openTab ? true : false } ,
539554 } )
540555 if ( tabId === undefined ) {
@@ -998,7 +1013,12 @@ ${params.message}`,
9981013 const tabId = createTabId ( true )
9991014 if ( tabId ) {
10001015 mynahUi . updateStore ( tabId , {
1001- chatItems : tabFactory . getChatItems ( messages ? false : true , programmingModeCardActive , messages ) ,
1016+ chatItems : tabFactory . getChatItems (
1017+ messages ? false : true ,
1018+ programmingModeCardActive ,
1019+ paidTierCardActive ,
1020+ messages
1021+ ) ,
10021022 } )
10031023 messager . onOpenTab ( requestId , { tabId } )
10041024 } else {
0 commit comments