Class: BridgeClient
Defined in: packages/client/src/bridge/transport.ts:176
Constructors
Constructor
new BridgeClient(
options?):BridgeClient
Defined in: packages/client/src/bridge/transport.ts:183
Parameters
options?
BridgeClientOptions = {}
Returns
BridgeClient
Properties
url
readonlyurl:string
Defined in: packages/client/src/bridge/transport.ts:177
Methods
connect()
connect(
options?):Promise<void>
Defined in: packages/client/src/bridge/transport.ts:230
Ask the visitor to connect this site. Call it from a click handler:
it opens the Leuria app with a leuria://connect link, and the
visitor answers in Leuria's own window. Resolves once allowed; rejects
with LeuriaNotRunningError when Leuria never answered, and
LeuriaNotConnectedError when the visitor said no.
Parameters
options?
ConnectOptions = {}
Returns
Promise<void>
detect()
detect(
timeoutMs?):Promise<Detection>
Defined in: packages/client/src/bridge/transport.ts:196
Is this site connected, and is Leuria running? Without a token, nothing is asked: Leuria doesn't answer sites it doesn't know (and a request to the computer would make the browser ask about local network access).
Parameters
timeoutMs?
number = 1500
Returns
Promise<Detection>
embed()
embed(
texts,kind,signal?):Promise<{model:string;vectors:number[][]; }>
Defined in: packages/client/src/bridge/transport.ts:336
Embed texts with the visitor's embedding model (see Detection.embed).
Parameters
texts
string[]
kind
"query" | "document"
signal?
AbortSignal
Returns
Promise<{ model: string; vectors: number[][]; }>
forget()
forget():
void
Defined in: packages/client/src/bridge/transport.ts:285
Forget this site's token in this browser.
Returns
void
manage()
manage(
options?):void
Defined in: packages/client/src/bridge/transport.ts:279
Open Leuria on this site's settings, where the visitor changes its AI and model. Call it from a click. The link carries nothing secret and changes nothing by itself.
Parameters
options?
openLink?
(url) => void
Returns
void
post()
post<
T>(path,body,init?):Promise<T>
Defined in: packages/client/src/bridge/transport.ts:340
Type Parameters
T
T = unknown
Parameters
path
string
body
unknown
init?
RequestInit = {}
Returns
Promise<T>
startSession()
startSession(
options):Promise<BridgeSession>
Defined in: packages/client/src/bridge/transport.ts:293
Start an agent session: registers the page tools, then starts the visitor's agent with the first prompt.
Parameters
options
Returns
Promise<BridgeSession>