Open History to see the last commit
1import type {
2 AgentMessage,
3 AgentOptions,
4 InteractionUpdate,
5 Run,
6 RunResult,
7 SDKUserMessage,
8 SendOptions,
9 SteerAckOutcome,
10} from "@cursor/sdk";
11import {
12 type OrchestrationV2ProviderSession,
13 ProviderDriverKind,
14 type ThreadId,
15} from "@t3tools/contracts";
16import * as Context from "effect/Context";
17import * as Deferred from "effect/Deferred";
18import * as Effect from "effect/Effect";
19import * as Layer from "effect/Layer";
20import * as Ref from "effect/Ref";
21import * as Schema from "effect/Schema";
22
23import * as CursorSdk from "./CursorSdk.ts";
24import * as ProviderEventLoggers from "@t3tools/provider-core/server/ProviderEventLoggers";
25
26export const CURSOR_AGENT_SDK_PROTOCOL = "cursor-agent-sdk.local" as const;
27export const CURSOR_PROVIDER = ProviderDriverKind.make("cursor");
28
29export class CursorAgentSdkRunnerError extends Schema.TaggedError<CursorAgentSdkRunnerError>()(
30 "CursorAgentSdkRunnerError",
31 {
32 method: Schema.String,
33 cause: Schema.Defect(),
34 },
35) {
36 override get message(): string {
37 return `Cursor Agent SDK ${this.method} failed.`;
38 }
39}
40
41export function cursorSdkFailureMessage(error: CursorAgentSdkRunnerError): string {
42 const reason = sdkErrorReason(error.cause);
43 return reason === undefined
44 ? error.message
45 : `Cursor Agent SDK ${error.method} failed: ${reason}`;
46}
47
48// The SDK maps backend details to codes like PRO_USER_USAGE_LIMIT or RATE_LIMITED, without a status.
49const CURSOR_USAGE_LIMIT_CODE =
50 /^(?:resource_exhausted|rate_limited(?:_changeable)?|\w*_usage_limit|\w*_rate_limit(?:_exceeded)?)$/i;
51
52export function isCursorUsageLimitError(cause: unknown): boolean {
53 const error = isCursorAgentSdkRunnerError(cause) ? cause.cause : cause;
54 if (typeof error !== "object" || error === null) return false;
55 const code = Reflect.get(error, "code");
56 return (
57 Reflect.get(error, "name") === "RateLimitError" ||
58 Reflect.get(error, "status") === 429 ||
59 (typeof code === "string" && CURSOR_USAGE_LIMIT_CODE.test(code))
60 );
61}
62
63const GENERIC_SDK_ERROR_CODES = new Set(["", "error", "unknown"]);
64
65function sdkErrorReason(cause: unknown): string | undefined {
66 if (!(cause instanceof Error)) return undefined;
67 const message = cause.message.trim();
68 if (message.length === 0) return undefined;
69 const code = Reflect.get(cause, "code");
70 const status = Reflect.get(cause, "status");
71 const details = [
72 ...(typeof code === "string" && !GENERIC_SDK_ERROR_CODES.has(code) && !message.includes(code)
73 ? [code]
74 : []),
75 ...(typeof status === "number" ? [`HTTP ${status}`] : []),
76 ];
77 return details.length === 0 ? message : `${message} (${details.join(", ")})`;
78}
79
80export const isCursorAgentSdkRunnerError = Schema.is(CursorAgentSdkRunnerError);
81
82export interface CursorAgentSdkOpenInput {
83 readonly operation: "create" | "resume";
84 readonly agentId?: string;
85 readonly storeCwd?: string;
86 readonly options: AgentOptions;
87 readonly threadId: ThreadId;
88 readonly providerSessionId: OrchestrationV2ProviderSession["id"];
89}
90
91export interface CursorAgentSdkSendInput<Error> {
92 readonly message: string | SDKUserMessage;
93 readonly options?: Omit<SendOptions, "onDelta">;
94 readonly onDelta?: (update: InteractionUpdate) => Effect.Effect<void, Error>;
95 /** Runs `agent.summarize()` instead, which takes no message or options. */
96 readonly summarize?: boolean;
97}
98
99export interface CursorAgentSdkRun {
100 readonly runId: string;
101 readonly agentId: string;
102 readonly wait: Effect.Effect<RunResult, CursorAgentSdkRunnerError>;
103 readonly cancel: Effect.Effect<void, CursorAgentSdkRunnerError>;
104 /** Absent on test doubles that never steer. The live runner always sets it. */
105 readonly steer?: (text: string) => Effect.Effect<SteerAckOutcome, CursorAgentSdkRunnerError>;
106}
107
108export interface CursorAgentSdkSession {
109 readonly agentId: string;
110 readonly send: <Error>(
111 input: CursorAgentSdkSendInput<Error>,
112 ) => Effect.Effect<CursorAgentSdkRun, CursorAgentSdkRunnerError>;
113 readonly listMessages: Effect.Effect<ReadonlyArray<AgentMessage>, CursorAgentSdkRunnerError>;
114 readonly close: Effect.Effect<void, CursorAgentSdkRunnerError>;
115}
116
117export class CursorAgentSdkRunner extends Context.Service<
118 CursorAgentSdkRunner,
119 {
120 readonly open: (
121 input: CursorAgentSdkOpenInput,
122 ) => Effect.Effect<CursorAgentSdkSession, CursorAgentSdkRunnerError>;
123 readonly assertComplete: Effect.Effect<void, CursorAgentSdkRunnerError>;
124 }
125>()("@t3tools/provider-cursor/server/CursorAgentSdk/CursorAgentSdkRunner") {}
126
127export interface CursorAgentSdkLoggedAgentOptions {
128 readonly model?: AgentOptions["model"];
129 readonly hasName?: boolean;
130 readonly mode?: AgentOptions["mode"];
131 readonly local?: {
132 readonly hasCwd?: boolean;
133 readonly autoReview?: boolean;
134 readonly settingSources?: AgentOptions["local"] extends infer Local
135 ? Local extends { readonly settingSources?: infer Sources }
136 ? Sources
137 : never
138 : never;
139 readonly sandboxEnabled?: boolean;
140 readonly enableAgentRetries?: boolean;
141 readonly hasCustomTools?: boolean;
142 };
143 readonly agents?: ReadonlyArray<string>;
144}
145
146export interface CursorAgentSdkLoggedSendOptions {
147 readonly model?: SendOptions["model"];
148 readonly mode?: SendOptions["mode"];
149 readonly hasMcpServers?: boolean;
150 readonly mcpServerNames?: ReadonlyArray<string>;
151 readonly local?: {
152 readonly force?: boolean;
153 readonly hasCustomTools?: boolean;
154 };
155 readonly idempotencyKey?: string;
156}
157
158export type CursorAgentSdkProtocolLogEvent =
159 | {
160 readonly direction: "outgoing";
161 readonly stage: "decoded";
162 readonly payload: {
163 readonly type: "agent.open";
164 readonly operation: CursorAgentSdkOpenInput["operation"];
165 readonly agentId?: string;
166 readonly options: CursorAgentSdkLoggedAgentOptions;
167 };
168 }
169 | {
170 readonly direction: "incoming";
171 readonly stage: "decoded";
172 readonly payload: {
173 readonly type: "agent.opened";
174 readonly agentId: string;
175 };
176 }
177 | {
178 readonly direction: "outgoing";
179 readonly stage: "decoded";
180 readonly payload: {
181 readonly type: "run.start";
182 readonly message: string | SDKUserMessage;
183 readonly options: CursorAgentSdkLoggedSendOptions;
184 };
185 }
186 | {
187 readonly direction: "incoming";
188 readonly stage: "decoded";
189 readonly payload: {
190 readonly type: "run.started";
191 readonly runId: string;
192 readonly agentId: string;
193 };
194 }
195 | {
196 readonly direction: "incoming";
197 readonly stage: "decoded";
198 readonly payload: {
199 readonly type: "interaction.update";
200 readonly runId: string;
201 readonly update: InteractionUpdate;
202 };
203 }
204 | {
205 readonly direction: "incoming";
206 readonly stage: "decoded";
207 readonly payload: {
208 readonly type: "run.completed";
209 readonly result: RunResult;
210 };
211 }
212 | {
213 readonly direction: "outgoing";
214 readonly stage: "decoded";
215 readonly payload: {
216 readonly type: "run.steer";
217 readonly runId: string;
218 readonly text: string;
219 };
220 }
221 | {
222 readonly direction: "incoming";
223 readonly stage: "decoded";
224 readonly payload: {
225 readonly type: "run.steered";
226 readonly runId: string;
227 readonly outcome: SteerAckOutcome;
228 };
229 }
230 | {
231 readonly direction: "outgoing";
232 readonly stage: "decoded";
233 readonly payload: {
234 readonly type: "run.cancel";
235 readonly runId: string;
236 };
237 }
238 | {
239 readonly direction: "outgoing";
240 readonly stage: "decoded";
241 readonly payload: {
242 readonly type: "agent.messages.list";
243 readonly agentId: string;
244 };
245 }
246 | {
247 readonly direction: "incoming";
248 readonly stage: "decoded";
249 readonly payload: {
250 readonly type: "agent.messages";
251 readonly agentId: string;
252 readonly messages: ReadonlyArray<AgentMessage>;
253 };
254 }
255 | {
256 readonly direction: "outgoing";
257 readonly stage: "decoded";
258 readonly payload: {
259 readonly type: "agent.close";
260 readonly agentId: string;
261 };
262 };
263
264export type CursorAgentSdkProtocolLogger = (
265 event: CursorAgentSdkProtocolLogEvent,
266) => Effect.Effect<void>;
267
268function runnerError(cause: unknown, method: string): CursorAgentSdkRunnerError {
269 return isCursorAgentSdkRunnerError(cause)
270 ? cause
271 : new CursorAgentSdkRunnerError({ method, cause });
272}
273
274function isActiveRunConflict(cause: unknown): boolean {
275 return cause instanceof Error && /already has active run/i.test(cause.message);
276}
277
278export function isCursorCancellationError(cause: unknown): boolean {
279 let current = cause;
280 const seen = new Set<object>();
281
282 while (typeof current === "object" && current !== null && !seen.has(current)) {
283 if (Reflect.get(current, "name") === "AbortError") {
284 return true;
285 }
286 seen.add(current);
287 current = Reflect.get(current, "cause");
288 }
289
290 return false;
291}
292
293export function loggedCursorAgentOptions(options: AgentOptions): CursorAgentSdkLoggedAgentOptions {
294 return {
295 ...(options.model === undefined ? {} : { model: options.model }),
296 ...(options.name === undefined ? {} : { hasName: true }),
297 ...(options.mode === undefined ? {} : { mode: options.mode }),
298 ...(options.local === undefined
299 ? {}
300 : {
301 local: {
302 ...(options.local.cwd === undefined ? {} : { hasCwd: true }),
303 ...(options.local.autoReview === undefined
304 ? {}
305 : { autoReview: options.local.autoReview }),
306 ...(options.local.settingSources === undefined
307 ? {}
308 : { settingSources: options.local.settingSources }),
309 ...(options.local.sandboxOptions === undefined
310 ? {}
311 : { sandboxEnabled: options.local.sandboxOptions.enabled }),
312 ...(options.local.enableAgentRetries === undefined
313 ? {}
314 : { enableAgentRetries: options.local.enableAgentRetries }),
315 ...(options.local.customTools === undefined ? {} : { hasCustomTools: true }),
316 },
317 }),
318 ...(options.agents === undefined ? {} : { agents: Object.keys(options.agents).toSorted() }),
319 };
320}
321
322export function loggedCursorSendOptions(
323 options: Omit<SendOptions, "onDelta"> | undefined,
324): CursorAgentSdkLoggedSendOptions {
325 if (options === undefined) {
326 return {};
327 }
328 const mcpServerNames =
329 options.mcpServers === undefined ? undefined : Object.keys(options.mcpServers).toSorted();
330 return {
331 ...(options.model === undefined ? {} : { model: options.model }),
332 ...(options.mode === undefined ? {} : { mode: options.mode }),
333 ...(mcpServerNames === undefined ? {} : { hasMcpServers: true, mcpServerNames }),
334 ...(options.local === undefined
335 ? {}
336 : {
337 local: {
338 ...(options.local.force === undefined ? {} : { force: options.local.force }),
339 ...(options.local.customTools === undefined ? {} : { hasCustomTools: true }),
340 },
341 }),
342 ...(options.idempotencyKey === undefined ? {} : { idempotencyKey: options.idempotencyKey }),
343 };
344}
345
346function makeCursorAgentSdkProtocolLogger(input: {
347 readonly nativeEventLogger: ProviderEventLoggers.EventNdjsonLogger | undefined;
348 readonly threadId: ThreadId;
349 readonly providerSessionId: OrchestrationV2ProviderSession["id"];
350}): CursorAgentSdkProtocolLogger | undefined {
351 if (input.nativeEventLogger === undefined) {
352 return undefined;
353 }
354 const nativeEventLogger = input.nativeEventLogger;
355 return (event) =>
356 nativeEventLogger
357 .write(
358 {
359 provider: CURSOR_PROVIDER,
360 protocol: CURSOR_AGENT_SDK_PROTOCOL,
361 kind: "protocol",
362 providerSessionId: input.providerSessionId,
363 event,
364 },
365 input.threadId,
366 )
367 .pipe(Effect.ignore);
368}
369
370export const makeCursorAgentSdkRunner = Effect.fn("makeCursorAgentSdkRunner")(function* (
371 protocolLoggerFor: (input: CursorAgentSdkOpenInput) => CursorAgentSdkProtocolLogger | undefined,
372) {
373 const sdk = yield* CursorSdk.CursorSdk;
374
375 // Prime with cursorsandbox before any Full access run; the SDK caches sandbox support per process.
376 const sandboxSupportPrimeStarted = yield* Ref.make(false);
377 const sandboxSupportPrimed = yield* Deferred.make<void>();
378 const primeCursorSandboxSupport = Effect.fn("CursorAgentSdkRunner.primeSandboxSupport")(
379 function* (options: AgentOptions) {
380 if (yield* Ref.getAndSet(sandboxSupportPrimeStarted, true)) {
381 return yield* Deferred.await(sandboxSupportPrimed);
382 }
383 yield* Effect.tryPromise({
384 try: async () => {
385 const cwd = typeof options.local?.cwd === "string" ? options.local.cwd : undefined;
386 const platform = await sdk
387 .load()
388 .createAgentPlatform(cwd === undefined ? {} : { workspaceRef: cwd });
389 const release = await platform.prewarmLocalWorkspace({
390 ...(options.apiKey === undefined ? {} : { apiKey: options.apiKey }),
391 local: {
392 ...(cwd === undefined ? {} : { cwd }),
393 settingSources: [],
394 sandboxOptions: { enabled: true },
395 },
396 });
397 await release();
398 },
399 catch: (cause) => runnerError(cause, "prewarmLocalWorkspace"),
400 }).pipe(Effect.ignore, Effect.ensuring(Deferred.succeed(sandboxSupportPrimed, undefined)));
401 },
402 );
403
404 return CursorAgentSdkRunner.of({
405 open: Effect.fn("CursorAgentSdkRunner.open")(function* (input) {
406 const { Agent, createAgentPlatform } = yield* Effect.try({
407 try: sdk.load,
408 catch: (cause) => runnerError(cause, `agent.${input.operation}`),
409 });
410 if (input.options.local?.sandboxOptions?.enabled === false) {
411 yield* primeCursorSandboxSupport(input.options);
412 }
413 const protocolLogger = protocolLoggerFor(input);
414 const log = (event: CursorAgentSdkProtocolLogEvent) =>
415 protocolLogger === undefined ? Effect.void : protocolLogger(event);
416
417 yield* log({
418 direction: "outgoing",
419 stage: "decoded",
420 payload: {
421 type: "agent.open",
422 operation: input.operation,
423 ...(input.agentId === undefined ? {} : { agentId: input.agentId }),
424 options: loggedCursorAgentOptions(input.options),
425 },
426 });
427
428 // Cursor uses cwd for both execution and store lookup; a moved thread keeps its original store.
429 const storeCwd = input.storeCwd;
430 const storePlatform =
431 input.operation === "resume" &&
432 storeCwd !== undefined &&
433 storeCwd !== input.options.local?.cwd
434 ? yield* Effect.tryPromise({
435 try: () =>
436 createAgentPlatform({
437 workspaceRef: storeCwd,
438 ...(input.options.local?.store === undefined
439 ? {}
440 : { localStore: input.options.local.store }),
441 }),
442 catch: (cause) => runnerError(cause, "agent.resume"),
443 })
444 : undefined;
445 const agent = yield* Effect.tryPromise({
446 try: () =>
447 input.operation === "create"
448 ? Agent.create(input.options)
449 : storePlatform === undefined
450 ? Agent.resume(input.agentId!, input.options)
451 : storePlatform.resumeAgent(input.agentId!, input.options),
452 catch: (cause) => runnerError(cause, `agent.${input.operation}`),
453 });
454
455 yield* log({
456 direction: "incoming",
457 stage: "decoded",
458 payload: {
459 type: "agent.opened",
460 agentId: agent.agentId,
461 },
462 });
463
464 const cwd =
465 typeof input.options.local?.cwd === "string"
466 ? input.options.local.cwd
467 : input.options.local?.cwd?.[0];
468 const runOptions = {
469 runtime: "local" as const,
470 ...(cwd === undefined ? {} : { cwd }),
471 ...(input.options.local?.store === undefined ? {} : { store: input.options.local.store }),
472 };
473 let abandonedRunRecoveryAvailable = input.operation === "resume";
474
475 return {
476 agentId: agent.agentId,
477 send: Effect.fn("CursorAgentSdkSession.send")(function* (sendInput) {
478 const context = yield* Effect.context();
479 yield* log({
480 direction: "outgoing",
481 stage: "decoded",
482 payload: {
483 type: "run.start",
484 message: sendInput.message,
485 options: loggedCursorSendOptions(sendInput.options),
486 },
487 });
488
489 let callbacksReady = false;
490 const pendingUpdates: Array<InteractionUpdate> = [];
491 let callbackFailure: { readonly cause: unknown } | undefined;
492 let callbackChain = Promise.resolve();
493 let runId = "";
494 const dispatchUpdate = (update: InteractionUpdate): Promise<void> => {
495 callbackChain = callbackChain
496 .then(() => {
497 if (callbackFailure !== undefined) {
498 return;
499 }
500 return Effect.runPromiseWith(context)(
501 log({
502 direction: "incoming",
503 stage: "decoded",
504 payload: {
505 type: "interaction.update",
506 runId,
507 update,
508 },
509 }).pipe(Effect.andThen(sendInput.onDelta?.(update) ?? Effect.void)),
510 );
511 })
512 .catch((cause) => {
513 callbackFailure ??= { cause };
514 });
515 return callbackChain;
516 };
517
518 const startRun = () =>
519 Effect.tryPromise({
520 try: () =>
521 sendInput.summarize === true
522 ? agent.summarize()
523 : agent.send(sendInput.message, {
524 ...sendInput.options,
525 onDelta: async ({ update }) => {
526 if (!callbacksReady) {
527 pendingUpdates.push(update);
528 return;
529 }
530 await dispatchUpdate(update);
531 },
532 }),
533 catch: (cause) => runnerError(cause, "run.start"),
534 });
535 const run = yield* startRun().pipe(
536 Effect.catchIf(
537 (error) => abandonedRunRecoveryAvailable && isActiveRunConflict(error.cause),
538 (error) =>
539 Effect.gen(function* () {
540 abandonedRunRecoveryAvailable = false;
541 // Local stores list runs oldest first, so the active run is on the
542 // last page and every page has to be read to reach it.
543 let activeRun: Run | undefined;
544 let cursor: string | undefined;
545 do {
546 const page = yield* Effect.tryPromise({
547 try: () =>
548 storePlatform === undefined
549 ? Agent.listRuns(agent.agentId, {
550 ...runOptions,
551 ...(cursor === undefined ? {} : { cursor }),
552 })
553 : storePlatform.listRuns(
554 agent.agentId,
555 cursor === undefined ? {} : { cursor },
556 ),
557 catch: (cause) => runnerError(cause, "agent.listRuns"),
558 });
559 activeRun =
560 page.items.findLast((candidate) => candidate.status === "running") ??
561 activeRun;
562 cursor = page.nextCursor;
563 } while (cursor !== undefined);
564 if (activeRun === undefined) {
565 return yield* error;
566 }
567 yield* log({
568 direction: "outgoing",
569 stage: "decoded",
570 payload: { type: "run.cancel", runId: activeRun.id },
571 });
572 yield* Effect.tryPromise({
573 try: () =>
574 storePlatform === undefined
575 ? Agent.cancelRun(activeRun.id, runOptions)
576 : storePlatform.cancelRun(activeRun.id),
577 catch: (cause) => runnerError(cause, "agent.cancelRun"),
578 });
579 return yield* startRun();
580 }),
581 ),
582 );
583 abandonedRunRecoveryAvailable = false;
584 runId = run.id;
585 yield* log({
586 direction: "incoming",
587 stage: "decoded",
588 payload: {
589 type: "run.started",
590 runId: run.id,
591 agentId: run.agentId,
592 },
593 });
594 callbacksReady = true;
595 for (const update of pendingUpdates) {
596 yield* Effect.tryPromise({
597 try: () => dispatchUpdate(update),
598 catch: (cause) => runnerError(cause, "run.onDelta"),
599 });
600 }
601
602 return {
603 runId: run.id,
604 agentId: run.agentId,
605 wait: Effect.tryPromise({
606 try: async () => {
607 const result = await run.wait();
608 await callbackChain;
609 if (callbackFailure !== undefined) {
610 throw callbackFailure.cause;
611 }
612 return result;
613 },
614 catch: (cause) => runnerError(cause, "run.wait"),
615 }).pipe(
616 Effect.tap((result) =>
617 log({
618 direction: "incoming",
619 stage: "decoded",
620 payload: {
621 type: "run.completed",
622 result,
623 },
624 }),
625 ),
626 ),
627 steer: Effect.fn("CursorAgentSdkRun.steer")((text: string) =>
628 log({
629 direction: "outgoing",
630 stage: "decoded",
631 payload: {
632 type: "run.steer",
633 runId: run.id,
634 text,
635 },
636 }).pipe(
637 Effect.andThen(
638 Effect.tryPromise({
639 try: () => run.steer?.(text) ?? Promise.resolve("revert_to_followup" as const),
640 catch: (cause) => runnerError(cause, "run.steer"),
641 }),
642 ),
643 Effect.tap((outcome) =>
644 log({
645 direction: "incoming",
646 stage: "decoded",
647 payload: {
648 type: "run.steered",
649 runId: run.id,
650 outcome,
651 },
652 }),
653 ),
654 ),
655 ),
656 cancel: log({
657 direction: "outgoing",
658 stage: "decoded",
659 payload: {
660 type: "run.cancel",
661 runId: run.id,
662 },
663 }).pipe(
664 Effect.andThen(
665 Effect.tryPromise({
666 try: async () => {
667 try {
668 await run.cancel();
669 } catch (cause) {
670 if (!isCursorCancellationError(cause)) {
671 throw cause;
672 }
673 }
674 },
675 catch: (cause) => runnerError(cause, "run.cancel"),
676 }),
677 ),
678 ),
679 } satisfies CursorAgentSdkRun;
680 }),
681 listMessages: log({
682 direction: "outgoing",
683 stage: "decoded",
684 payload: {
685 type: "agent.messages.list",
686 agentId: agent.agentId,
687 },
688 }).pipe(
689 Effect.andThen(
690 Effect.tryPromise({
691 try: () =>
692 storePlatform === undefined
693 ? Agent.messages.list(agent.agentId, {
694 runtime: "local",
695 ...(cwd === undefined ? {} : { cwd }),
696 ...(input.options.local?.store === undefined
697 ? {}
698 : { store: input.options.local.store }),
699 })
700 : storePlatform.getAgentMessages(agent.agentId),
701 catch: (cause) => runnerError(cause, "agent.messages.list"),
702 }),
703 ),
704 Effect.tap((messages) =>
705 log({
706 direction: "incoming",
707 stage: "decoded",
708 payload: {
709 type: "agent.messages",
710 agentId: agent.agentId,
711 messages,
712 },
713 }),
714 ),
715 ),
716 close: log({
717 direction: "outgoing",
718 stage: "decoded",
719 payload: {
720 type: "agent.close",
721 agentId: agent.agentId,
722 },
723 }).pipe(
724 Effect.andThen(
725 Effect.try({
726 try: () => agent.close(),
727 catch: (cause) => runnerError(cause, "agent.close"),
728 }),
729 ),
730 ),
731 } satisfies CursorAgentSdkSession;
732 }),
733 assertComplete: Effect.void,
734 });
735});
736
737export const layer = Layer.effect(
738 CursorAgentSdkRunner,
739 Effect.gen(function* () {
740 const { native: nativeEventLogger } = yield* ProviderEventLoggers.ProviderEventLoggers;
741 return yield* makeCursorAgentSdkRunner((input) =>
742 makeCursorAgentSdkProtocolLogger({
743 nativeEventLogger,
744 threadId: input.threadId,
745 providerSessionId: input.providerSessionId,
746 }),
747 );
748 }),
749);