Repository navigation
feat(sidekick): Gleap.openSidekick, an agent in a side panel next to the page - #193
Draft
boehlerlukas wants to merge 3 commits into
Draft
boehlerlukas wants to merge 3 commits into
boehlerlukas wants to merge 3 commits into
Conversation
…tive guards) What the page tells the agent (origin + path only: query and fragment never leave the page; title, onboarding step, the app's data, bounded like the server's sanitiser) as one envelope with Kai Copilot (surface 'sidekick'), overlay / push / sheet by viewport, and when a proactive open may show. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t to the page The widget frame gets a 'sidekick' app mode: a full-height panel on the right edge (400 px; a full-screen sheet on phones) over a dim layer that blocks the page (overlay, default) or with the page pushed aside by a margin on <html> (push). Closes by its x, Escape, a click on the dimmed page or closeSidekick(); the page comes back exactly (inline styles, scroll, focus, launcher). The page's context follows SPA navigation. A messenger build without the sidekick falls back to startAgent. API: openSidekick, setSidekickContext, closeSidekick, isSidekickOpen, setSidekickProactive; events sidekick-opened/-closed/-proactive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The socket announces the 'sidekick' cap (the server sends proactive opens only to SDKs that do) and hands 'sidekick' messages to the manager, which shows one at most once per page view, never over something else, never while the person types, and not again for a day after a dismissal. The page poll keeps the open panel's context current. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sidekick mode: an agent in a side panel next to the page
Gleap.openSidekick()opens Kai Support or one of the workspace's customer agents in a full-height panel on the right edge (400 px), with the page's context. The page is dimmed and blocked (overlay, the default) or pushed aside (mode: 'push'); phones get a full-screen sheet. Plan: decision 13 of the Kai re-release (contract in.handover/kai-build/sidekick.md).API
How it works
sidekick): one frame, one connection.sidekick-open/sidekick-contextgo to the Messenger, which shows its SIDEKICK layout (GleapSDK/Messenger-App#268).surface: 'sidekick', pageroute= origin + path, title, step, the app's data). Query and fragment never leave the page; sizes are capped (the server sanitises again).margin-righton<html>(never a transform), only when the page keeps 720 px, else overlay.closeSidekick,Gleap.open()replacing it) gives the page back exactly:<html>inline styles, scroll position, focus, launcher.sidekickcap; asidekickmessage from a workspace trigger opens the panel at most once per page view, never over something else, never while the person types (4 s idle, gives up after 30 s), and not again for a day after it was closed without a reply.startAgentand the AI bar are untouched; a Messenger build without the sidekick cap in its ping makesopenSidekickfall back tostartAgent.Verified
npm test: 35 suites, 595 tests (new:GleapSidekickRules.test.js, context envelope and proactive guards).npm run buildpasses (build outputs not committed).feat/sidekick+ Serverfeat/rr-sidekick): overlay and push open/close with the page restored exactly, Escape and backdrop close, SPA navigation updates the chip and the next message's context, Kai Support and a custom agent answered from the page context (page, onboarding step, plan), a proactive open from an agent event trigger (once per page view, typing guard, dismissal), phone sheet, light and dark. Screenshots:.handover/kai-build/shots/sidekick/.Not in this PR
No version bump or release. Needs GleapSDK/Messenger-App#268 deployed first (older Messenger builds fall back to
startAgent) and the Server branchfeat/rr-sidekickfor the context and proactive opens.🤖 Generated with Claude Code