* feat(client): publish the TypeScript SDK surface Make the high-level client API usable for external integrations and document complete agent, workspace, provider, event, and recipe flows. * fix(client): correlate provider snapshots by daemon cwd Return the daemon's canonical snapshot identity so waitForReady can match updates for relative, tilde, and otherwise non-canonical paths without duplicating filesystem rules in the SDK. * test(server): make snapshot cwd assertion portable * fix(client): gate canonical provider snapshot waits Older daemons do not expose the canonical snapshot identity needed to correlate workspace updates safely. Require the advertised capability and fail with an update-host message instead of guessing across workspaces.
25 lines
598 B
TypeScript
25 lines
598 B
TypeScript
import { createPaseoClient } from "@getpaseo/client";
|
|
|
|
const client = createPaseoClient({ url: "ws://127.0.0.1:6767/ws" });
|
|
|
|
await client.connect();
|
|
|
|
try {
|
|
const agent = await client.agents.create({
|
|
config: {
|
|
provider: "codex/gpt-5.5",
|
|
},
|
|
cwd: process.cwd(),
|
|
prompt: "Inspect this repository and name the next useful task.",
|
|
});
|
|
|
|
const result = await agent.waitForFinish();
|
|
if (result.status !== "idle") {
|
|
throw new Error(result.error ?? `Agent stopped with status: ${result.status}`);
|
|
}
|
|
|
|
console.log(result.lastMessage);
|
|
} finally {
|
|
await client.close();
|
|
}
|