Publish the TypeScript SDK and integration guides (#3141)
* 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.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import type { PaseoAgentHandle, PaseoClient } from "@getpaseo/client";
|
||||
|
||||
export async function reviewInParallel(client: PaseoClient, cwd: string): Promise<string[]> {
|
||||
const agents: PaseoAgentHandle[] = [];
|
||||
|
||||
try {
|
||||
agents.push(
|
||||
...(await Promise.all([
|
||||
client.agents.create({
|
||||
config: {
|
||||
provider: "codex/gpt-5.5",
|
||||
},
|
||||
cwd,
|
||||
title: "Correctness review",
|
||||
prompt: "Review the current diff for correctness and missed edge cases.",
|
||||
}),
|
||||
client.agents.create({
|
||||
config: {
|
||||
provider: "claude/claude-sonnet-5",
|
||||
},
|
||||
cwd,
|
||||
title: "Security review",
|
||||
prompt: "Review the current diff for security and unsafe input handling.",
|
||||
}),
|
||||
])),
|
||||
);
|
||||
|
||||
const results = await Promise.all(agents.map((agent) => agent.waitForFinish()));
|
||||
|
||||
return results.map((result) => {
|
||||
if (result.status !== "idle") throw new Error(result.error ?? result.status);
|
||||
return result.lastMessage ?? "";
|
||||
});
|
||||
} finally {
|
||||
await Promise.allSettled(agents.map((agent) => agent.archive()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user