* 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.
27 lines
649 B
TypeScript
27 lines
649 B
TypeScript
import { createPaseoClient, type PaseoClient } from "@getpaseo/client";
|
|
|
|
export function createClient(url: string): PaseoClient {
|
|
return createPaseoClient({
|
|
url,
|
|
});
|
|
}
|
|
|
|
export async function createOpenAndArchiveWorkspace(url: string, cwd: string): Promise<void> {
|
|
const client = createClient(url);
|
|
|
|
try {
|
|
await client.connect();
|
|
|
|
const created = await client.workspaces.create({
|
|
source: { kind: "directory", path: cwd },
|
|
title: "Fresh SDK workspace",
|
|
});
|
|
const opened = await client.workspaces.open(cwd);
|
|
|
|
await opened.refresh();
|
|
await created.archive();
|
|
} finally {
|
|
await client.close();
|
|
}
|
|
}
|