Files
paseo/packages/client/examples/issue-to-agent.ts
T
Mohamed BoudraandGitHub 7954babca6 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.
2026-08-10 13:22:20 +02:00

36 lines
877 B
TypeScript

import { createPaseoClient, type PaseoClient } from "@getpaseo/client";
interface Issue {
id: string;
title: string;
description: string;
repositoryPath: string;
}
export async function startIssue(client: PaseoClient, issue: Issue) {
const workspace = await client.workspaces.open(issue.repositoryPath);
const agent = await workspace.agents.create({
config: {
provider: "codex/gpt-5.5",
},
title: issue.title,
labels: {
"issue-provider": "my-tracker",
"issue-id": issue.id,
},
prompt: [
`Implement issue ${issue.id}: ${issue.title}`,
"",
issue.description,
"",
"Run focused tests and summarize the result.",
].join("\n"),
});
return { workspaceId: workspace.id, agentId: agent.id };
}
export function createClient(url: string): PaseoClient {
return createPaseoClient({ url });
}