The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(tour): gui_tour start with no steps runs the app's built-in tour
alt-glitch890976c224ba
diff --git a/apps/desktop/src/app/chat/built-in-tour.ts b/apps/desktop/src/app/chat/built-in-tour.tsnew file mode 100644index 00000000000..36c972f3d9a--- /dev/null+++ b/apps/desktop/src/app/chat/built-in-tour.ts@@ -0,0 +1,107 @@+/**+ * The app's own tour — what `gui_tour` runs when it starts with no steps.+ *+ * The app owns the stops (stable `data-tour` handles) and their copy, so a+ * look around is one tool call. Before this, the model scanned `targets` and+ * wrote its own step list: two round trips before anything moved on screen,+ * built from raw DOM labels. A stop whose handle is not on screen right now (a+ * mode without that nav row, a collapsed pane) is dropped, never guessed at.+ */++import type { TourPreset } from '@hermes/shared'++import { getLocalCatalog, getLocalModelsStatus } from '@/hermes'+import { runtimeTranslations } from '@/i18n'+import { localSetupEligible } from '@/lib/tips/local-cta'+import { startTour, type TourResult } from '@/lib/tour'+import { $interfaceMode } from '@/store/interface-mode'+import { $localModelsEnabled } from '@/store/local-models-flag'+import { $connection } from '@/store/session'++const SELECTORS = {+ capabilities: '[data-tour="sidebar-nav-capabilities"]',+ composer: '[data-tour="composer"]',+ messaging: '[data-tour="sidebar-nav-messaging"]',+ model: '[data-tour="model-pill"]',+ newSession: '[data-tour="sidebar-nav-new-session"]',+ rightPane: '[data-tour="right-pane-toggle"]',+ sessions: '[data-tour="sessions-sidebar"]'+}++type StopId = keyof typeof SELECTORS++/** Where their conversations live, where they ask for a job, how to start a+ * fresh one, which model answers. */+const ESSENTIALS: StopId[] = ['sessions', 'composer', 'newSession', 'model']++/** Full adds what the interface mode puts on screen:+ * Simple is for talking to Hermes, Advanced has the working pane. */+const SIMPLE_EXTRAS: StopId[] = ['capabilities', 'messaging']+const ADVANCED_EXTRAS: StopId[] = ['rightPane', 'capabilities']++const PRESET_STOPS = {+ full: () => [...ESSENTIALS, ...($interfaceMode.get() === 'simple' ? SIMPLE_EXTRAS : ADVANCED_EXTRAS)],+ quick: () => ESSENTIALS+} satisfies Record<TourPreset, () => StopId[]>++/** A slow fit answer drops the local line rather than holding the tour. */+const LOCAL_FIT_WAIT_MS = 2_000++/** The tour collector's visibility rule minus its in-viewport test: a stop+ * scrolled out of view still counts, because driver.js scrolls to it. A+ * keep-alive tab hidden with `data-pane-hidden` keeps its box, so the+ * attribute decides, then size. */+function onScreen(selector: string): boolean {+ const node = document.querySelector(selector)++ if (!node || node.closest('[data-pane-hidden]')) {+ return false+ }++ const { height, width } = node.getBoundingClientRect()++ return width >= 4 && height >= 4+}++/** Whether the model stop says this computer can run a local model. It is the+ * local-setup tip's answer (the backend's catalog `fits` check, on a local+ * connection, with nothing set up yet), and only where the Local Models pane+ * exists to point at. */+async function canRunLocalModel(): Promise<boolean> {+ const mode = $connection.get()?.mode ?? null++ if (!$localModelsEnabled.get() || mode !== 'local') {+ return false+ }++ const read = Promise.all([getLocalModelsStatus(), getLocalCatalog()]).then(+ ([status, catalog]) => localSetupEligible(mode, status, catalog.models),+ () => false+ )++ let timer: ReturnType<typeof setTimeout> | undefined+ const late = new Promise<boolean>(resolve => (timer = setTimeout(() => resolve(false), LOCAL_FIT_WAIT_MS)))++ return Promise.race([read, late]).finally(() => clearTimeout(timer))+}++/** Run the built-in tour. Never throws; failures come back like any tour+ * action's, so the agent can say so in words. */+export async function runBuiltInTour(preset: TourPreset): Promise<TourResult> {+ const stops = PRESET_STOPS[preset]().filter(id => onScreen(SELECTORS[id]))++ if (stops.length === 0) {+ return { error: 'None of the built-in tour targets are on screen.', success: false }+ }++ const localLine = stops.includes('model') && (await canRunLocalModel())+ const copy = runtimeTranslations().appTour++ return startTour(+ stops.map(id => ({+ selector: SELECTORS[id],+ text: id === 'model' && localLine ? `${copy.model.text} ${copy.modelLocal}` : copy[id].text,+ title: copy[id].title+ }))+ )+}diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.tsindex a596acac024..fd8484b13de 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.ts+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.ts@@ -635,26 +635,35 @@ const tour: Handler = ({ isActiveSession, request, sessionId }) => {return}- void import('@/lib/tour')- .then(({ runTour }) =>- runTour(- {- kind: (str(p.action) || 'stop') as TourAction['kind'],- selector: p.selector as never,- side: p.side as TourStep['side'],- startAt: p.step_index as never,- steps: p.steps as TourStep[] | undefined,- text: p.text as never,- title: p.title as never- },- p.surface === 'preview' ? 'preview' : 'app',- previewOwnerFor(sessionId)- )- )- .then(- result => answerValue(request, result),- error => answerValue(request, { error: error instanceof Error ? error.message : String(error), success: false })- )+ const kind = (str(p.action) || 'stop') as TourAction['kind']++ // start with no steps is the app's own tour: one call, the app owns the stops.+ // The backend validated `preset`; absent means full.+ const run =+ kind === 'start' && !Array.isArray(p.steps)+ ? import('@/app/chat/built-in-tour').then(({ runBuiltInTour }) =>+ runBuiltInTour(p.preset === 'quick' ? 'quick' : 'full')+ )+ : import('@/lib/tour').then(({ runTour }) =>+ runTour(+ {+ kind,+ selector: p.selector as never,+ side: p.side as TourStep['side'],+ startAt: p.step_index as never,+ steps: p.steps as TourStep[] | undefined,+ text: p.text as never,+ title: p.title as never+ },+ p.surface === 'preview' ? 'preview' : 'app',+ previewOwnerFor(sessionId)+ )+ )++ void run.then(+ result => answerValue(request, result),+ error => answerValue(request, { error: error instanceof Error ? error.message : String(error), success: false })+ )}/** Method → handler. Every `ServerRequestMap` key the desktop answers. */diff --git a/apps/desktop/src/components/shared-metrics/consent-dialog.tsx b/apps/desktop/src/components/shared-metrics/consent-dialog.tsxindex e6e6b3812ec..bb8f62bf7e7 100644--- a/apps/desktop/src/components/shared-metrics/consent-dialog.tsx+++ b/apps/desktop/src/components/shared-metrics/consent-dialog.tsx@@ -13,6 +13,7 @@ import {} from '@/components/ui/dialog'import { useI18n } from '@/i18n'import { ChevronDown } from '@/lib/icons'+import { $tourActive } from '@/lib/tour/tour-active'import { cn } from '@/lib/utils'import { notifyError } from '@/store/notifications'import { $desktopOnboarding } from '@/store/onboarding'@@ -55,6 +56,7 @@ export function SharedMetricsConsentDialog({ enabled, profile, requestGateway }:const copy = t.sharedMetricsconst onboarding = useStore($desktopOnboarding)const surfaces = useStore($onboardingSurfaces)+ const tourActive = useStore($tourActive)const detailsId = useId()const consent = useStore($sharedMetricsConsent)const detailsOpen = useStore($sharedMetricsDetailsOpen)@@ -63,13 +65,14 @@ export function SharedMetricsConsentDialog({ enabled, profile, requestGateway }:const scopedRequest = useMemo(() => sharedMetricsProfileRequester(requestGateway, profile), [profile, requestGateway])- // Never over the provider picker, the free-tier welcome or the guided chat:+ // Never over the provider picker, the free-tier welcome, the guided chat or a tour on screen:// the question belongs to the moment after setup.const onboardingSettled =(onboarding.configured === true || onboarding.firstRunSkipped) &&!onboarding.manual &&!onboarding.freeTierReady &&- surfaces.size === 0+ surfaces.size === 0 &&+ !tourActiveconst ready = enabled && onboardingSettleddiff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex 417adaf1451..df861811215 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -1,5 +1,6 @@import { FIELD_DESCRIPTIONS, FIELD_LABELS } from '@/app/settings/constants'+import { enAppTour, enHandoffTour } from './en_app_tour'import { enAuxTasks } from './en_aux_tasks'import { enBoot } from './en_boot'import { enCatalogInstall } from './en_catalog_install'@@ -20,6 +21,7 @@ export const en: Translations = {}},sharedMetrics: enSharedMetrics,+ appTour: enAppTour,// English editorial copy stays in the shipped JSONL; other locales override it.intro: { stock: {}, custom: () => [] },connectors: {@@ -4203,16 +4205,7 @@ export const en: Translations = {versionDetailsUncommittedChanges: 'uncommitted changes'},- handoffTour: {- profileTitle: 'Your first task runs on the default profile',- profileText:- 'This rail switches profiles. The one lit up now is default, where the task session lives. The other one is the setup profile, where the welcome chat lives.',- sessionsTitle: 'Each profile keeps its own sessions',- sessionsText:- 'This list belongs to the default profile. New session starts one on whichever profile is selected. Switch profiles on the rail and the list changes with it.',- stayTitle: 'Hermes is one click away',- stayText: 'Switch to the setup profile and open Welcome to Hermes whenever you want a hand. It stays there.'- },+ handoffTour: enHandoffTour,guidedGreeting: {line: "Hey, come on in. I'm Hermes. Give me two minutes to set the place up around you, then we'll put me to work on something you actually want done.\n\nFirst though, what should I call you?",nameSuggestion: (name: string) => `(I can also just call you ${name}, if you prefer.)`diff --git a/apps/desktop/src/i18n/en_app_tour.ts b/apps/desktop/src/i18n/en_app_tour.tsnew file mode 100644index 00000000000..073b41ae3a6--- /dev/null+++ b/apps/desktop/src/i18n/en_app_tour.ts@@ -0,0 +1,23 @@+import type { Translations } from './types'++export const enAppTour: Translations['appTour'] = {+ sessions: { title: 'Your chats', text: 'Every conversation lives here. Search, pin or reopen any of them.' },+ composer: { title: 'Ask here', text: 'Say what you want done. Type @ to bring in a file.' },+ newSession: { title: 'Start fresh', text: 'A new session gets its own context. Use one per job.' },+ model: { title: 'Model picker', text: 'Chooses which model answers you.' },+ modelLocal: 'This computer can run one locally: Settings > Providers > Local Models.',+ capabilities: { title: 'Capabilities', text: 'Skills, tools and plugins Hermes can use. Add more here.' },+ messaging: { title: 'Messaging', text: 'Reach Hermes from Telegram, Slack, Discord and more.' },+ rightPane: { title: 'The working pane', text: 'Opens files, terminal, review and the in-app browser on the right.' }+}++export const enHandoffTour: Translations['handoffTour'] = {+ profileTitle: 'Your first task runs on the default profile',+ profileText:+ 'This rail switches profiles. The one lit up now is default, where the task session lives. The other one is the setup profile, where the welcome chat lives.',+ sessionsTitle: 'Each profile keeps its own sessions',+ sessionsText:+ 'This list belongs to the default profile. New session starts one on whichever profile is selected. Switch profiles on the rail and the list changes with it.',+ stayTitle: 'Hermes is one click away',+ stayText: 'Switch to the setup profile and open Welcome to Hermes whenever you want a hand. It stays there.'+}diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.tsindex f5a22c9444d..4e7130698b8 100644--- a/apps/desktop/src/i18n/types.ts+++ b/apps/desktop/src/i18n/types.ts@@ -8,6 +8,7 @@import type { ErrorCodeKey } from '@/lib/error-surface'import type { TipId } from '@/lib/tips/catalog'+import type { AppTourTranslations, HandoffTourTranslations } from './types_app_tour'import type { AuxTaskCopyMap } from './types_aux_tasks'import type { BootTranslations } from './types_boot'import type { CatalogInstallTranslations } from './types_catalog_install'@@ -70,6 +71,7 @@ interface ModeOptionCopy {export interface Translations extends NoticeTranslations {/** Shared-metrics consent: first-run dialog + Settings › Safety toggles. */sharedMetrics: SharedMetricsTranslations+ appTour: AppTourTranslationsexternalOpenFailed: {title: stringmessage: string@@ -3500,19 +3502,12 @@ export interface Translations extends NoticeTranslations {versionDetailsUncommittedChanges: string}+ handoffTour: HandoffTourTranslations/** The guided first run's pre-written opening line — banked, not generated,* so the first paint costs no model time. Translated per locale because the* model is told to speak the user's language from its first real turn, and* an English opener above a Japanese reply reads as two different agents.* `nameSuggestion` offers the OS account name as a default. */- handoffTour: {- profileTitle: string- profileText: string- sessionsTitle: string- sessionsText: string- stayTitle: string- stayText: string- }guidedGreeting: {line: stringnameSuggestion: (name: string) => stringdiff --git a/apps/desktop/src/i18n/types_app_tour.ts b/apps/desktop/src/i18n/types_app_tour.tsnew file mode 100644index 00000000000..4b9dded5484--- /dev/null+++ b/apps/desktop/src/i18n/types_app_tour.ts@@ -0,0 +1,27 @@+interface TourStopCopy {+ title: string+ text: string+}++/** The app's own tour, run when `gui_tour` starts with no steps. */+export interface AppTourTranslations {+ sessions: TourStopCopy+ composer: TourStopCopy+ newSession: TourStopCopy+ model: TourStopCopy+ /** Appended to the model stop when this computer can run a local model. */+ modelLocal: string+ capabilities: TourStopCopy+ messaging: TourStopCopy+ rightPane: TourStopCopy+}++/** The tour that closes the guided first run (components/onboarding-chat/signpost.ts). */+export interface HandoffTourTranslations {+ profileTitle: string+ profileText: string+ sessionsTitle: string+ sessionsText: string+ stayTitle: string+ stayText: string+}diff --git a/apps/desktop/src/lib/tour/engine.ts b/apps/desktop/src/lib/tour/engine.tsindex 42892e89992..1034163abc2 100644--- a/apps/desktop/src/lib/tour/engine.ts+++ b/apps/desktop/src/lib/tour/engine.ts@@ -77,6 +77,8 @@ export interface TourHost {navigate?: (to: string) => void/** Reveal a desktop pane by name. */revealPane?: (pane: string) => void+ /** The tour ended, however it ended (Esc, the ✕, an overlay click, the last step). */+ onEnd?: () => void}/** A normalized action. `kind` is the verb; the rest is per-verb payload. */@@ -281,6 +283,14 @@ export function runTourEngine(doc.body.classList.remove('driver-active', 'driver-fade', 'driver-simple', 'driver-no-scroll')}+ /** Every way a driver goes away funnels here, so the host hears about each one. */+ const ended = () => {+ holder.driver = undefined+ holder.release?.()+ holder.release = undefined+ host?.onEnd?.()+ }+if (kind === 'show') {const gone = unmatched([action])@@ -290,7 +300,8 @@ export function runTourEngine(if (!holder.driver) {clearOrphans()- holder.driver = factory(base)+ // Esc, the ✕ and an overlay click end a one-off highlight too.+ holder.driver = factory({ ...base, onDestroyed: ended })}// A one-off highlight is its own arrival, so it uses the settle-down enter.@@ -325,9 +336,7 @@ export function runTourEngine(holder.driver = factory({...base,onDestroyed: () => {- holder.driver = undefined- holder.release?.()- holder.release = undefined+ ended()if (origin !== undefined && host?.navigate && host.currentRoute?.() !== origin) {host.navigate(origin)diff --git a/apps/desktop/src/lib/tour/run-tour.ts b/apps/desktop/src/lib/tour/run-tour.tsindex cac18dc6007..d37bcc6f319 100644--- a/apps/desktop/src/lib/tour/run-tour.ts+++ b/apps/desktop/src/lib/tour/run-tour.ts@@ -31,6 +31,7 @@ import {type TourStyle} from './engine'import { type Stage, stopSpotlightBlur, syncSpotlightBlur } from './spotlight-blur'+import { $tourActive } from './tour-active'/** Which document a tour runs against. */export type TourSurface = 'app' | 'preview'@@ -44,7 +45,8 @@ const APP_HOST: TourHost = {navigate: to => {window.location.hash = to},- revealPane: pane => void revealDesktopPane(pane)+ revealPane: pane => void revealDesktopPane(pane),+ onEnd: () => $tourActive.set(false)}/** The app's own overlay treatment: a softly rounded cutout and a transition@@ -85,6 +87,8 @@ export async function runTour(// Mirror driver.js's cutout onto a blur layer for as long as the tour is// up, and drop the whole thing once it isn't. The layer reads driver's own// per-frame stage rect, so it eases between steps exactly like the cutout.+ $tourActive.set(isTourActive())+if (isTourActive()) {syncSpotlightBlur(() => (appHolder.driver?.getState?.('__activeStagePosition') as null | Stage) ?? null)} else {diff --git a/apps/desktop/src/lib/tour/tour-active.ts b/apps/desktop/src/lib/tour/tour-active.tsnew file mode 100644index 00000000000..36f603a07e7--- /dev/null+++ b/apps/desktop/src/lib/tour/tour-active.ts@@ -0,0 +1,5 @@+import { atom } from 'nanostores'++/** Reactive twin of `isTourActive` for UI that must wait out a tour. Lives apart from+ * run-tour.ts, which is dynamic-imported to keep driver.js off the boot path. */+export const $tourActive = atom(false)diff --git a/apps/shared/src/gateway-contract.generated.ts b/apps/shared/src/gateway-contract.generated.tsindex 59bf5d62c15..3ff1bce356e 100644--- a/apps/shared/src/gateway-contract.generated.ts+++ b/apps/shared/src/gateway-contract.generated.ts@@ -4500,6 +4500,7 @@ export interface TourRequestParams {side?: string | nullsteps?: TourStep[] | nullstep_index?: number | null+ preset?: TourPreset | null}export interface TourStep {selector?: string | null@@ -4508,6 +4509,8 @@ export interface TourStep {side?: string | null[key: string]: unknown}+/** Which built-in tour ``start`` without steps runs. The wire contract imports this enum. */+export type TourPreset = 'quick' | 'full'export interface DisplayInstallSudoParams {session_id: stringprofile_key: stringdiff --git a/apps/shared/src/gateway-contract.openrpc.json b/apps/shared/src/gateway-contract.openrpc.jsonindex e658afe5bbb..8a00ed09f29 100644--- a/apps/shared/src/gateway-contract.openrpc.json+++ b/apps/shared/src/gateway-contract.openrpc.json@@ -36903,6 +36903,15 @@"title": "ToolsetsListResult","type": "object"},+ "TourPreset": {+ "description": "Which built-in tour ``start`` without steps runs. The wire contract imports this enum.",+ "enum": [+ "quick",+ "full"+ ],+ "title": "TourPreset",+ "type": "string"+ },"TourRequestParams": {"additionalProperties": false,"description": "``tools/tour_tool.py`` field set.",@@ -37001,6 +37010,17 @@],"default": null,"title": "Step Index"+ },+ "preset": {+ "anyOf": [+ {+ "$ref": "#/components/schemas/TourPreset"+ },+ {+ "type": "null"+ }+ ],+ "default": null}},"required": [diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.jsonindex 7651b31eafc..8525ac102ce 100644--- a/locales/_keys.desktop.json+++ b/locales/_keys.desktop.json@@ -40,6 +40,21 @@"agents.waitingActivity","agents.workers","agents.workersActive",+ "appTour.capabilities.text",+ "appTour.capabilities.title",+ "appTour.composer.text",+ "appTour.composer.title",+ "appTour.messaging.text",+ "appTour.messaging.title",+ "appTour.model.text",+ "appTour.model.title",+ "appTour.modelLocal",+ "appTour.newSession.text",+ "appTour.newSession.title",+ "appTour.rightPane.text",+ "appTour.rightPane.title",+ "appTour.sessions.text",+ "appTour.sessions.title","artifactCard.generating","artifactCard.kind.code","artifactCard.kind.html",diff --git a/tests/tools/test_tour_tool.py b/tests/tools/test_tour_tool.pyindex c0d946fcd02..7435299b507 100644--- a/tests/tools/test_tour_tool.py+++ b/tests/tools/test_tour_tool.py@@ -31,7 +31,9 @@ def test_show_needs_something_to_point_at_or_say():def test_start_validates_its_steps():- assert "non-empty steps" in _run(action="start")["error"]+ # No steps is the app's built-in tour; it exists only on the app surface.+ assert "error" not in _run(action="start")+ assert "surface='app'" in _run(action="start", surface="preview")["error"]assert "non-empty steps" in _run(action="start", steps=[])["error"]assert "steps[1] must be an object" in _run(action="start", steps=[{"selector": "#a"}, "nope"])["error"]assert "steps[1] needs" in _run(action="start", steps=[{"selector": "#a"}, {}])["error"]diff --git a/tools/tour_tool.py b/tools/tour_tool.pyindex a5ea91c8c89..abe469b1841 100644--- a/tools/tour_tool.py+++ b/tools/tour_tool.py@@ -1,11 +1,14 @@-"""Guided tour (highlight + narrate UI elements) in the Hermes desktop GUI: the agent discovers-targets (``action="targets"``), then highlights one step at a time (``show``) or hands over a-step list the user pages (``start``). Round-trips through the gateway blocking-prompt bridge-(``tour.request``/``tour.respond``) so the agent learns whether the selector matched. Registered in-``desktop_ui`` and hidden from the model when tours are off: a tour covers the whole screen, so "off"-must mean the model is never told the tool exists rather than offered a call that fails."""+"""Guided tour (highlight + narrate UI elements) in the Hermes desktop GUI: ``start`` with no+steps runs the app's own built-in tour (``preset`` quick or full); for a custom one the agent+discovers targets (``action="targets"``), then highlights one step at a time (``show``) or hands+over a step list the user pages (``start`` + ``steps``). Round-trips through the gateway+blocking-prompt bridge (``tour.request``/``tour.respond``) so the agent learns whether the+selector matched. Registered in ``desktop_ui`` and hidden from the model when tours are off: a+tour covers the whole screen, so "off" must mean the model is never told the tool exists rather+than offered a call that fails."""import json+from enum import StrEnumfrom typing import Callable, Optionalfrom tools import desktop_ui@@ -16,10 +19,20 @@ SURFACES = ("app", "preview")SIDES = ("top", "right", "bottom", "left")+class TourPreset(StrEnum):+ """Which built-in tour ``start`` without steps runs. The wire contract imports this enum."""++ quick = "quick"+ full = "full"+++PRESETS = tuple(TourPreset)++def tour_tool(action: str = "", surface: Optional[str] = None, selector: Optional[str] = None,title: Optional[str] = None, text: Optional[str] = None, side: Optional[str] = None,steps: Optional[list] = None, step_index: Optional[int] = None,- callback: Optional[Callable] = None) -> str:+ preset: Optional[str] = None, callback: Optional[Callable] = None) -> str:"""Dispatch one tour action to the desktop renderer and return its outcome."""if callback is None:return tool_error("tour is only available in the Hermes desktop app.")@@ -31,19 +44,24 @@ def tour_tool(action: str = "", surface: Optional[str] = None, selector: Optionareturn tool_error(f"surface must be one of: {', '.join(SURFACES)}.")if side is not None and side not in SIDES:return tool_error(f"side must be one of: {', '.join(SIDES)}.")+ if preset is not None and preset not in PRESETS:+ return tool_error(f"preset must be one of: {', '.join(PRESETS)}.")# Every highlighted moment needs something to point at or something to say.if verb == "show" and not (selector or title or text):return tool_error("show needs a selector (and/or title/text for the popover).")- if verb == "start":+ # start without steps is the app's built-in tour, which only exists on the app surface.+ if verb == "start" and steps is None and where != "app":+ return tool_error("The built-in tour runs on surface='app'; pass steps for a preview tour.")+ if verb == "start" and steps is not None:if not isinstance(steps, list) or not steps:- return tool_error("start needs a non-empty steps array.")+ return tool_error("start needs a non-empty steps array, or no steps for the built-in tour.")for i, step in enumerate(steps):if not isinstance(step, dict):return tool_error(f"steps[{i}] must be an object.")if not (step.get("selector") or step.get("title") or step.get("text")):return tool_error(f"steps[{i}] needs a selector and/or title/text.")fields = {"action": verb, "surface": where, "selector": selector, "title": title,- "text": text, "side": side, "steps": steps, "step_index": step_index}+ "text": text, "side": side, "steps": steps, "step_index": step_index, "preset": preset}try:raw = callback({key: val for key, val in fields.items() if val is not None})except Exception as exc:@@ -83,14 +101,16 @@ TOUR_SCHEMA = {"description": ("Guided tour in the desktop GUI: dim the screen, highlight an ""element, attach a titled popover. Surfaces: 'app' (Hermes itself) "- "or 'preview' (the page in the preview pane). ALWAYS call "- "action='targets' first — prefer targets marked stable:true (their "- "selectors survive re-renders); re-scan if one stops matching. Then "- "narrate with action='show' (one highlight per call, replaces the "- "last — pair each with a chat message) or hand over with "- "action='start' + steps (user gets Next/Prev; 'next'/'prev' also "- "page it). 'stop' clears. Use for how-does-X-work / where-is-Y "- "walkthroughs."+ "or 'preview' (the page in the preview pane). A general look around "+ "the app is ONE call: action='start' with no steps runs the app's "+ "built-in tour (preset 'quick' or 'full', default full). For a "+ "custom tour, call action='targets' first — prefer targets marked "+ "stable:true (their selectors survive re-renders); re-scan if one "+ "stops matching. Then narrate with action='show' (one highlight per "+ "call, replaces the last — pair each with a chat message) or hand "+ "over with action='start' + steps (user gets Next/Prev; "+ "'next'/'prev' also page it). 'stop' clears. Use for "+ "how-does-X-work / where-is-Y walkthroughs."),"parameters": {"type": "object",@@ -98,7 +118,7 @@ TOUR_SCHEMA = {"action": {"type": "string","enum": list(ACTIONS),- "description": "targets first; show narrates; start hands over.",+ "description": "start alone runs the built-in tour; targets first for custom steps.",},"surface": {"type": "string",@@ -119,7 +139,12 @@ TOUR_SCHEMA = {"steps": {"type": "array","items": _STEP_SCHEMA,- "description": "start: ordered steps.",+ "description": "start: ordered steps; omit for the built-in tour.",+ },+ "preset": {+ "type": "string",+ "enum": list(PRESETS),+ "description": "start without steps: 'quick' (four essentials) or 'full'.",},"step_index": {"type": "integer",@@ -141,5 +166,5 @@ registry.register(handler=lambda args, **kw: tour_tool(action=args.get("action", ""), callback=kw.get("callback"),**{k: args.get(k) for k in ("surface", "selector", "title", "text", "side", "steps",- "step_index")}),+ "step_index", "preset")}),emoji="🧭")diff --git a/tui_gateway/contracts/server_requests.py b/tui_gateway/contracts/server_requests.pyindex e0ef4ef4043..1bfaad225e7 100644--- a/tui_gateway/contracts/server_requests.py+++ b/tui_gateway/contracts/server_requests.py@@ -9,6 +9,8 @@ from __future__ import annotationsfrom pydantic import Field+from tools.tour_tool import TourPreset+from .base import JsonValue, Params, Payload, Result, WireEnumfrom .registry import event, server_request@@ -199,6 +201,7 @@ class TourRequestParams(ServerRequestParams):side: str | None = Nonesteps: list[TourStep] | None = Nonestep_index: int | None = None+ preset: TourPreset | None = Noneserver_request("tour", params=TourRequestParams, result=ValueResult,