Archetype SDK
npm i @pairful/archetype-sdkimport {
ClientConnectionService,
ConnectorAdapter,
} from "@pairful/archetype-sdk";
const client = await ClientConnectionService.connect(
ConnectorAdapter.webSocketConnector(url),
{ client: "my-app" },
);
const turn = await client.startTurn("main", "run the tests");
for await (const { event } of client.events(turn)) {
if (event.type === "approval.requested")
await client.respond(turn, event.requestId, { action: "allow" });
}
出力
turn.started
textテストを実行して
approval.requestedbun test
approval.resolvedallow
toolbun test · 12 pass
turn.finished
アプリのセッション一覧にmainとして残りました · デスクトップアプリで見る →