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으로 남았어요 · 데스크톱에서 보기 →