Files
paseo/packages/client
Mohamed Boudra 8cc8e12007 Keep a healthy host connection from being replaced on stale latency data (#9116)
On a host with two saved connections, the app replaced a working connection with the other one and showed "Reconnecting to host" for about two seconds each time.

The adaptive switch rule needs three consecutive wins of at least 40 ms. It counted the cached alternate sample again on every active-only tick, so one measurement became three wins in 20 seconds. After a liveness-timeout reconnect it also compared the previous socket's heartbeat RTT with the alternate. A win now needs a candidate measured in the current probe cycle and a heartbeat RTT from the socket that is connected now, and the streak resets when the active client leaves connected or a fresh probe of the candidate fails.

Closing a client with subscription releases in flight no longer publishes a false transport close or aborts close() midway. The host runtime does this on every legitimate switch.

Follow-ups: #9147, #9149.
2026-11-09 09:17:44 +07:00
..

@getpaseo/client

TypeScript SDK for building integrations on top of a Paseo daemon.

npm install @getpaseo/client
import { createPaseoClient } from "@getpaseo/client";

const client = createPaseoClient({ url: "ws://127.0.0.1:6767/ws" });
await client.connect();

const agent = await client.agents.create({
  config: { provider: "codex/gpt-5.5" },
  cwd: "/Users/me/dev/storefront",
  prompt: "Review the current diff and name the riskiest change.",
});

const result = await agent.waitForFinish();
console.log(result.lastMessage);

await client.close();

The public API is the package root. Imports under @getpaseo/client/internal/* are unsupported implementation details used by Paseo's own packages.

Read the SDK documentation for agents, workspaces, terminals, provider discovery, events, recipes, and the API reference. Runnable TypeScript patterns also live in examples/.

Runtime

The client needs a WebSocket implementation. Modern browsers and Node.js 22 provide one globally.

Use a WebSocket URL ending in /ws, such as ws://127.0.0.1:6767/ws. Pass password when the daemon requires authentication.

The client advertises its supported protocol capabilities by default. Optional capabilities overrides extend or override that declaration; browser hosting must be supplied by the caller. Connecting alone does not subscribe to agent timelines or catalog events. See the event guide for subscription lifetimes and timeline replacements.

Stability

The high-level API exported from @getpaseo/client is the supported SDK surface. The SDK and daemon remain protocol-compatible across versions, but newly added capabilities can require a newer daemon.