Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): honor Cursor long-context selections #18700

Closedemcee6798(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/18700/headopened View on GitHub

Showing 2 changed files with 241 additions and 0 deletions.

x
0 of 2 viewed, 2 left
205 additions and 0 deletionspackages/provider-cursor/src/server/sdk.test.tsAdded
View file
@@ -0,0 +1,205 @@
+import * as NodeServices from "@effect/platform-node/NodeServices";
+import { describe, expect, it } from "@effect/vitest";
+import * as HostProcess from "@t3tools/shared/HostProcess";
+import * as Effect from "effect/Effect";
+import * as Stream from "effect/Stream";
+import * as ChildProcess from "effect/process/ChildProcess";
+import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
+​
+const cursorSdkUrl = new URL("./sdk.ts", import.meta.url).href;
+​
+// Loads the real SDK in a fresh process. The send probe stops before transport.
+const probeProgram = `
+import { mkdtempSync } from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { createRequire } from "node:module";
+​
+const sdkRequire = createRequire(createRequire(${JSON.stringify(cursorSdkUrl)}).resolve("@cursor/sdk"));
+const { proto3, ScalarType } = sdkRequire("@bufbuild/protobuf");
+const mode = process.argv[1];
+if (mode === "sdk-model-requests") {
+ process.on("uncaughtException", error => {
+ console.error(error.stack);
+ process.exit(1);
+ });
+}
+const dir = mkdtempSync(join(tmpdir(), "cursor-sdk-model-"));
+const { createAgentPlatform } = await import(${JSON.stringify(cursorSdkUrl)});
+​
+if (mode === "sdk-model-requests") {