| @@ -16,7 +16,14 @@ | ||
| 16 | 16 | // select-block has no example, so find-agent routes this message. |
| 17 | 17 | // translators: Shown in the AI Agent chat as the user's own request, sent when they click the "Add to menu" button. |
| 18 | 18 | message: __('Add this to the menu', 'extendify-local'), |
| 19 | 19 | }, |
| 20 | - // The publish confirm writes the new status into the context. | |
| 20 | + // Picked after the confirm's reload, so the context holds the saved status. | |
| 21 | 21 | score: ({ context }) => (context?.postStatus === 'publish' ? 1 : 0), |
| 22 | + toolContext: () => { | |
| 23 | + const { postId, postTitle } = window.extAgentData?.context ?? {}; | |
| 24 | + return { | |
| 25 | + refersTo: { postId, postTitle }, | |
| 26 | + nextStep: 'Add this page to the menu', | |
| 27 | + }; | |
| 28 | + }, | |
| 22 | 29 | }; |