| 1 |
import { getPluginSetup } from '@agent/lib/redirects'; |
| 2 |
import { __, sprintf } from '@wordpress/i18n'; |
| 3 |
|
| 4 |
export default { |
| 5 |
id: 'plugin-settings', |
| 6 |
follows: ['recommend-plugins'], |
| 7 |
data: ({ toolCalls }) => |
| 8 |
getPluginSetup( |
| 9 |
toolCalls.findLast(({ id }) => id === 'install-plugin')?.inputs |
| 10 |
?.pluginSlug, |
| 11 |
), |
| 12 |
score: ({ data }) => (data ? 3 : 0), |
| 13 |
content: ({ title, url }) => ({ |
| 14 |
title: sprintf( |
| 15 |
// translators: Title of a card in the AI Agent chat, shown after the agent installed a plugin. %s is the plugin's name. |
| 16 |
__('Set up %s', 'extendify-local'), |
| 17 |
title, |
| 18 |
), |
| 19 |
// translators: Body of a card in the AI Agent chat, shown after the agent installed a plugin that has its own settings page. |
| 20 |
body: __( |
| 21 |
'Open its settings page to finish getting it ready.', |
| 22 |
'extendify-local', |
| 23 |
), |
| 24 |
action: { |
| 25 |
// translators: Button on a card in the AI Agent chat that opens the settings page of a plugin the agent just installed. |
| 26 |
label: __('Go to settings', 'extendify-local'), |
| 27 |
url, |
| 28 |
sameTab: true, |
| 29 |
}, |
| 30 |
}), |
| 31 |
}; |
| 32 |
|