feat: virtual demo endpoints + Settings UX overhaul (closes #211)#214
Merged
Conversation
Demo auth is now handled inside the demo container (blanket-allow on a private docker network), no per-user pubkey lookup needed. See #211.
Onboarding drops Server Setup, Endpoints, MCP and Advanced steps; users land in the app right after passkey + notifications. Endpoints page no longer carries the UV hint-block, gains an Add Endpoint wizard that prepends a Server Setup step for first-time users, and renders the default shellwatch@ prefix as a gray adornment with a warning on blur. New /settings/setup tab consolidates the lifted help content. /settings/keys renamed to Passkeys; file-based SSH keys move to a separate admin-only Other SSH Keys tab. formatEndpointAddress always renders the username so the wire-level user is unambiguous in the UI.
Add Endpoint and Generate API Key now sit below the list, left-aligned, in the same .register-section pattern as Add passkey. Generate API Key opens a form modal (label + scopes) instead of an inline form; the existing key-display modal still shows the minted key. Demo Endpoints toggle moves to sit next to the section headline instead of the right edge.
… cards Replace the three-section Setup tab with five collapsible cards (SSH Server, Endpoint, MCP Client, ShellWatch Agent, ShellWatch PAM). Each card has a short explanation and minimum-step setup; Endpoint Setup adds a full field reference covering Label, Address, Description (with a callout on its role for MCP agents), UV, and SSH Agent Forwarding. MCP URL renders the actual origin; Agent install link points at the dedicated agent/v* release stream on GitHub; OpenSSH 10.3+ client requirement noted for the Agent flow. PAM step 3 spells out that the endpoint needs agent forwarding so SSH_AUTH_SOCK is forwarded. ServerSetupGuide placeholder shows a realistic example webauthn-sk one-liner.
…nts to MCP SeedEndpointSchema gains an optional description (max 1000 chars), which propagates to seedAdminEndpoints inserts and to the demo-endpoint synthesizer — so operator-configured context now surfaces in MCP's list_endpoints response. AgentSession and the shellwatch_manage_endpoints tool merge demo entries into the per-account list when accounts.showDemoEndpoints is on; read resolves demo:* ids via the synthesizer; create/update/delete reject demo ids with a clear error. AgentSession.createSession also resolves demo ids so MCP-driven session opens reach demo principals.
…coverage, signal-chip badge Hide the Demo Endpoints section + toggle on deployments with no demoEndpoints in config (new demoEndpointsAvailable field on /api/auth/me). Thread $account?.name into the wizard's ServerSetupGuide so the authorized_keys comment carries the real account, not 'user'. Sidebar gains a demo signal-chip below the endpoint label, reusing the global .badge convention. Doc comments on the showDemoEndpoints visibility-vs-auth semantics and on the seed-export side effect of formatEndpointAddress always emitting the username. Locks in the c228350 MCP demo wiring with 7 REST + 6 MCP integration tests.
Two-case unit test for the field that gates the Settings → Endpoints demo section: false when the operator configured no demoEndpoints, true when at least one is present. Behavior was indirectly exercised in demo-endpoints-flow.test.ts; this nails it down in the most direct test surface.
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.
Closes #211.
Summary
demoEndpointsconfig — virtual, config-only endpoints merged into every account's endpoint list, gated by a per-accountshowDemoEndpointstoggle (default on).Settings → Setuptab and aligns the primary-action affordances across all Settings pages.Settings → KeystoPasskeys; file-based SSH keys split into a separate admin-onlyOther SSH Keystab.list_endpointsresponse.What's in
Demo endpoints
demoEndpointsconfig block (same shape asseedAdminEndpoints, plus optionaldescription).endpointstable; merged intoGET /api/endpointsat read time via stabledemo:<hash>ids.accounts.show_demo_endpointscolumn (migration0008_demo_endpoints_support); default on for everyone./api/auth/mereturnsshowDemoEndpoints+demoEndpointsAvailableso the UI hides the whole Demo section on deployments with no demo entries configured.demo:*ids (REST + MCP) with a clear "read-only" error.seedAdminEndpointsalso gains the optionaldescriptionfield, plumbed through to the seed insert.MCP integration
AgentSession.listEndpoints()merges demo entries when the account's toggle is on.AgentSession.createSession()resolvesdemo:*ids via the synthesizer, so agents can open demo sessions.shellwatch_manage_endpointslist/read merge demo entries (list gated by toggle; read works regardless so a known id stays resolvable); create/update/delete refusedemo:*ids.Onboarding
Settings → Setup tab (new)
docs.shellwatch.ai. Agent install link points at theagent/v*release stream on GitHub.Settings → Passkeys (renamed from Keys)
Other SSH Keystab (only visible when admin AND has file keys registered).Add Endpoint
shellwatch@prefix + yellow warning on blur when no user was typed; both disappear on focus.formatEndpointAddressalways renders the username (even the defaultshellwatch) so the wire-level user is unambiguous in the UI.Aligned action affordances
.register-sectionpattern).Sidebar
demosignal-chip below the label, reusing the global.badgeconvention (6px accent-colored dot + lowercase text).Out of scope (decided)
feat /demo/authorized-keysand its revert commit in this branch document that decision.Test plan
pnpm typecheck,pnpm check:svelte,pnpm lint,pnpm spdx:checkcleanpnpm test— 336 unit tests pass (was 330)pnpm test:integration— 138 integration tests pass (was 131)src/test/integration/demo-endpoints-flow.test.ts— REST merge (toggle on/off), PUT/DELETE rejection ondemo:*, POST/api/sessionsopens demo regardless of toggle, 404 on unknown demo id.src/mcp/server.test.ts— MCP list merges/excludes per toggle, read resolves demo regardless, create/update/delete rejectdemo:*.shellwatch@prefix + yellow warning; focus → both disappeardemoEndpointsin config) does NOT show the Demo sectionlist_endpointscall surfaces demo entries with their description