Skip to content

Commit 8007564

Browse files
committed
Updated stream
1 parent 87d895d commit 8007564

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

cursor-cli-demo/trigger/cursor-agent.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { logger, streams, task } from "@trigger.dev/sdk";
1+
import { logger, task } from "@trigger.dev/sdk";
22
import { mkdirSync } from "fs";
33
import type { CursorEvent } from "@/lib/cursor-events";
44
import { spawnCursorAgent } from "../extensions/cursor-cli";
5+
import { cursorStream } from "./cursor-stream";
56

67
export type CursorAgentPayload = {
78
prompt: string;
@@ -29,7 +30,7 @@ export const cursorAgentTask = task({
2930
{ cwd: workspace, env: { CURSOR_API_KEY: process.env.CURSOR_API_KEY } },
3031
);
3132

32-
const { waitUntilComplete } = streams.pipe("cursor-events", agent.stream);
33+
const { waitUntilComplete } = cursorStream.pipe(agent.stream);
3334

3435
const { exitCode, stderr } = await agent.waitUntilExit();
3536
await waitUntilComplete();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { streams } from "@trigger.dev/sdk";
2+
import type { CursorEvent } from "@/lib/cursor-events";
3+
4+
export const cursorStream = streams.define<CursorEvent>({
5+
id: "cursor-events",
6+
});

0 commit comments

Comments
 (0)