/** * Home — the instructions page: live agent status + the three-ways * distribution guide, every snippet carrying this app's REAL values (no * "replace me" placeholders once linked). */ import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { agentEndpointUrl, appConfig } from "../config"; import { CHAT_PATH } from "../routes"; import { probeAgent, type AgentProbe } from "../lib/status"; import { widgetSnippet } from "../lib/widget"; function chatSnippet(): string { const endpoint = appConfig.link?.endpointUrl ?? "http://localhost:6790"; const api = appConfig.link?.apiBaseUrl ?? "http://localhost:6790"; const appId = appConfig.link?.appId ?? "local"; return [ `import { GuueyChat } from "@guuey/chat/react";`, `import "@guuey/chat/styles.css";`, ``, ` myGuestSecret}`, `/>`, ].join("\n"); } export function Home() { const [probe, setProbe] = useState({ state: "checking" }); useEffect(() => { let cancelled = false; void probeAgent().then((result) => { if (!cancelled) setProbe(result); }); return () => { cancelled = true; }; }, []); const link = appConfig.link; return (

Agent status

Endpoint
{agentEndpointUrl()}
Reachability
{probe.state === "checking" ? "checking…" : null} {probe.state === "reachable" ? reachable : null} {probe.state === "unreachable" ? {probe.hint} : null}
{link ? ( <>
App
{link.appId} ({link.env})
{link.pageUrl ? ( <>
Agent's page
{link.pageUrl}
) : null} ) : ( <>
Deployment
not linked yet — pnpm bootstrap -- --link binds a deployed guuey app
)}

Full detail lives in the CLI: pnpm status (runs{" "} guuey apps get + guuey agent status).

Three ways your users reach this agent

1 · The widget, on any site

One script tag gives any page the floating launcher.

{link ? (
            {widgetSnippet()}
          
) : (

Snippet appears with real values after linking.

)}

2 · Embedded chat, inside your app

The @guuey/chat kit, running on the Chat page of this very app:

          {chatSnippet()}
        

3 · The guuey portal

{link?.slug ? (

Users can find and chat with this agent in the portal:{" "} {link.portalUrl}/agent/{link.slug}

) : link ? (

Claim a public short name first — guuey slug claim <name> — then the portal link (and the agent's own page) light up.

) : (

Available after linking a deployed app.

)}
); }