[META] Improve Drupal Assistant Implementation
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3572388. --> Reported by: [b_sharpe](https://www.drupal.org/user/2512258) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The current Drupal Assistant implementation in the demo page was a POC meant to show it can work with AG-UI, this should instead align to become a replacement for the ai_chatbot (Deepchat). This might spawn AI module tickets so we can hook into the events used. </p> <p>We should align also with the <a href="https://project.pages.drupalcode.org/ai/1.2.x/agents/running/polling/">Polling service</a> so this is where we could emit ag-ui events.</p> <p>I believe the following could/should work:</p> <ol> <li>A single, non-streamed request with all events<strong> - This just needs a refactor, technically works</strong></li> <li>A single streamed request with all events emitted in realtime<strong> - This just needs a refactor, technically works</strong></li> <li><del>A long-polling request (see <code>agent_status_poller</code>) to emit events while polling. <strong>This one will need some special considerations as AG-UI really wasn't meant for ajaxing like this, but it's kind of a "poor man&rsquo;s streaming".</strong></del> I believe the next item would also be used here, but just not a queued process.</li> <li>A working version via Pub/Sub, this would be a true "streaming" version, using Mercure or similar. Could look at symfony messenger here as well. See <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/agui/-/work_items/3572037" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/agui/-/work_items/3572037</a></span> and <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/agui/issues/3572933" title="Status: Closed (fixed)">#3572933: Support Input and Steam endpoints</a></span></li> </ol> <p>All of the above will need some planning and integration thoughts.</p> <p>Some supporting Issues:</p> <p><span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/ai/-/work_items/3492940" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/ai/-/work_items/3492940</a></span><br> <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/ai/-/work_items/3560619" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/ai/-/work_items/3560619</a></span></p> <p>Possibly Related:<br> <a href="https://git.drupalcode.org/project/runner/-/merge_requests/2">https://git.drupalcode.org/project/runner/-/merge_requests/2</a><br> <a href="https://git.drupalcode.org/project/ai_runtime/-/tree/1.0.x">https://git.drupalcode.org/project/ai_runtime/-/tree/1.0.x</a></p>
issue