@sideboard-ai/core 0.1.232 → 0.1.234
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/cursor-runner.cjs +207 -62
- package/dist/agents/cursor-runner.js +24 -10
- package/dist/{agents-TCTEAK6M.js → agents-BTXL6R5I.js} +17 -7
- package/dist/{agents-ENAQHQRZ.js → agents-WMN7C322.js} +16 -6
- package/dist/{chunk-PO4M4JAJ.js → chunk-2P4XKWV2.js} +1 -1
- package/dist/{chunk-FA4CPYCY.js → chunk-2UBVFL2X.js} +81 -41
- package/dist/{chunk-ABOBTSO6.js → chunk-2UG25RMK.js} +18 -5
- package/dist/{chunk-4CZ25DO2.js → chunk-4VFOJZPS.js} +2 -2
- package/dist/{chunk-N5TX66CD.js → chunk-7H2CVVLF.js} +2 -2
- package/dist/{chunk-SZJZEFTY.js → chunk-DD67JWTN.js} +1 -1
- package/dist/{chunk-LLMG6OVS.js → chunk-LEYY54BN.js} +19 -19
- package/dist/{chunk-6L25K7BE.js → chunk-NOIWXANG.js} +224 -73
- package/dist/{chunk-HVUVQXZ2.js → chunk-QVN2WOKJ.js} +18 -5
- package/dist/{chunk-7BZ7DSBN.js → chunk-RKKTCKVX.js} +17 -17
- package/dist/{chunk-HZFLKVGC.js → chunk-S2OEFXST.js} +1 -1
- package/dist/{chunk-SXFRXNBM.js → chunk-SPAMHHJH.js} +1 -1
- package/dist/{chunk-ZXJMAKEP.js → chunk-TNVJPFHM.js} +5 -5
- package/dist/{chunk-UNTOZA3C.js → chunk-TWXSZYR2.js} +1 -1
- package/dist/{chunk-TQBUXKIB.js → chunk-WPD7BR6C.js} +135 -11
- package/dist/{connected-teams-PIBQTOJU.js → connected-teams-JUJAQZZE.js} +2 -2
- package/dist/{connected-teams-RVD3PFAG.js → connected-teams-KQUDU7LZ.js} +2 -2
- package/dist/{coordinator-prompt-YKLXQTWH.js → coordinator-prompt-CE7MN6QY.js} +4 -4
- package/dist/{coordinator-prompt-DFXYTM6D.js → coordinator-prompt-IGDMFKCD.js} +4 -4
- package/dist/{global-workspace-EYZKYHAO.js → global-workspace-7WH24UFO.js} +4 -4
- package/dist/{global-workspace-4SPANNJT.js → global-workspace-NCIC2Y2U.js} +4 -4
- package/dist/index.cjs +519 -326
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +27 -8
- package/dist/mcp/run-stdio.cjs +447 -302
- package/dist/mcp/run-stdio.js +7 -7
- package/dist/{orchestrator-RJX4OKYC.js → orchestrator-7ZEGFPK4.js} +7 -7
- package/dist/{orchestrator-FTHJKPIX.js → orchestrator-R2WCTNJI.js} +8 -8
- package/dist/{run-UEQM4JMZ.js → run-PCX5QWR4.js} +1 -1
- package/dist/{run-QDZCTP4Y.js → run-TB7RBII2.js} +1 -1
- package/dist/{workspaces-73Y7IJY2.js → workspaces-H2TRFDE2.js} +4 -4
- package/dist/{workspaces-FQCSCTNH.js → workspaces-NSQZSDQD.js} +4 -4
- package/dist/{worktree-DOPRKG7K.js → worktree-FMIX4BRV.js} +3 -3
- package/dist/{worktree-36VEFUJN.js → worktree-W7BSI4GU.js} +3 -3
- package/dist/{worktree-exclude-K7QK4RI5.js → worktree-exclude-5N2KTYIT.js} +2 -2
- package/dist/{worktree-exclude-L32WEBX6.js → worktree-exclude-RXZPTCNH.js} +2 -2
- package/package.json +2 -2
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
summarizeTurnStderr,
|
|
43
43
|
toolDescription,
|
|
44
44
|
turnFailChatText
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-NOIWXANG.js";
|
|
46
46
|
import {
|
|
47
47
|
SLACK_REPLY_FORMATTING,
|
|
48
48
|
addWorkspace,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
stageAbsolutePathsAsAttachments,
|
|
66
66
|
stageBuffersAsAttachments,
|
|
67
67
|
syncWorkspacesFromThreads
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-TWXSZYR2.js";
|
|
69
69
|
import {
|
|
70
70
|
addPrStackLayer,
|
|
71
71
|
allocateTeamName,
|
|
@@ -114,7 +114,7 @@ import {
|
|
|
114
114
|
worktreeDisplayLabelForGroup,
|
|
115
115
|
worktreeNameFromPath,
|
|
116
116
|
worktreeSlugForTicket
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-4VFOJZPS.js";
|
|
118
118
|
import {
|
|
119
119
|
ATTACHMENTS_DIR,
|
|
120
120
|
DETACHED_JOBS_DIR,
|
|
@@ -135,7 +135,7 @@ import {
|
|
|
135
135
|
} from "./chunk-XJETIO4K.js";
|
|
136
136
|
import {
|
|
137
137
|
ensureWorktreeSideboardIgnored
|
|
138
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-DD67JWTN.js";
|
|
139
139
|
import {
|
|
140
140
|
clearStaleIndexLocks,
|
|
141
141
|
enrichPathWithNpmGlobalBin,
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
git,
|
|
144
144
|
resolveGitDirsForLockRecovery,
|
|
145
145
|
run
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-2UG25RMK.js";
|
|
147
147
|
import {
|
|
148
148
|
HISTORY_CLEANUP_INTERVAL_HOURS_DEFAULT,
|
|
149
149
|
applyTurnUsage,
|
|
@@ -418,7 +418,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
418
418
|
await continueOnReply(threadId, prompt);
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
421
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
421
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-7ZEGFPK4.js");
|
|
422
422
|
await getOrchestrator2().send(threadId, prompt);
|
|
423
423
|
} catch {
|
|
424
424
|
}
|
|
@@ -896,9 +896,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
896
896
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
897
897
|
);
|
|
898
898
|
}
|
|
899
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
899
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-7WH24UFO.js");
|
|
900
900
|
if (isGlobalThread2(thread)) {
|
|
901
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
901
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-CE7MN6QY.js");
|
|
902
902
|
ensureGlobalCoordinatorCwd2(
|
|
903
903
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
904
904
|
);
|
|
@@ -4541,7 +4541,7 @@ async function adoptThread(input) {
|
|
|
4541
4541
|
throw new Error(`Worktree not found: ${input.worktreePath}`);
|
|
4542
4542
|
}
|
|
4543
4543
|
const repoPath = await resolveRepoRoot(input.worktreePath);
|
|
4544
|
-
const { stdout: branch } = await import("./run-
|
|
4544
|
+
const { stdout: branch } = await import("./run-TB7RBII2.js").then(
|
|
4545
4545
|
({ git: git2 }) => git2(["rev-parse", "--abbrev-ref", "HEAD"], input.worktreePath)
|
|
4546
4546
|
);
|
|
4547
4547
|
const thread = createEmptyThread({
|
|
@@ -4556,9 +4556,9 @@ async function adoptThread(input) {
|
|
|
4556
4556
|
messages: input.messages ?? []
|
|
4557
4557
|
});
|
|
4558
4558
|
writeThread(thread);
|
|
4559
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
4559
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-NSQZSDQD.js");
|
|
4560
4560
|
await ensureWorkspace2(repoPath);
|
|
4561
|
-
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-
|
|
4561
|
+
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-5N2KTYIT.js");
|
|
4562
4562
|
await ensureWorktreeSideboardIgnored2(input.worktreePath);
|
|
4563
4563
|
return thread;
|
|
4564
4564
|
}
|
|
@@ -5961,7 +5961,7 @@ async function confirmLand(thread, opts) {
|
|
|
5961
5961
|
if (preview.dirty) {
|
|
5962
5962
|
committed = await commitAll(thread.worktreePath, meta.commitMessage);
|
|
5963
5963
|
}
|
|
5964
|
-
const { git: git2 } = await import("./run-
|
|
5964
|
+
const { git: git2 } = await import("./run-TB7RBII2.js");
|
|
5965
5965
|
const { stdout: headOut } = await git2(
|
|
5966
5966
|
["rev-parse", "--abbrev-ref", "HEAD"],
|
|
5967
5967
|
thread.worktreePath,
|
|
@@ -7032,7 +7032,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
7032
7032
|
${prompt}`;
|
|
7033
7033
|
}
|
|
7034
7034
|
async function defaultDeps() {
|
|
7035
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
7035
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-7ZEGFPK4.js");
|
|
7036
7036
|
const orch = getOrchestrator2();
|
|
7037
7037
|
return {
|
|
7038
7038
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -9563,7 +9563,7 @@ var Orchestrator = class {
|
|
|
9563
9563
|
this.enforceHistoryRetention();
|
|
9564
9564
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
9565
9565
|
try {
|
|
9566
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
9566
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-NSQZSDQD.js");
|
|
9567
9567
|
await ensureWorkspace2(thread.repoPath);
|
|
9568
9568
|
} catch {
|
|
9569
9569
|
}
|
|
@@ -9617,13 +9617,13 @@ var Orchestrator = class {
|
|
|
9617
9617
|
`Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
|
|
9618
9618
|
);
|
|
9619
9619
|
}
|
|
9620
|
-
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-
|
|
9620
|
+
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-FMIX4BRV.js");
|
|
9621
9621
|
const slug = thread.worktreePath.split("/").pop();
|
|
9622
9622
|
const dest = thread.worktreePath;
|
|
9623
9623
|
await withRepoGitLock(thread.repoPath, async () => {
|
|
9624
9624
|
await git(["worktree", "add", dest, thread.branchName], thread.repoPath);
|
|
9625
9625
|
});
|
|
9626
|
-
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-
|
|
9626
|
+
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-5N2KTYIT.js");
|
|
9627
9627
|
await ensureWorktreeSideboardIgnored2(dest);
|
|
9628
9628
|
void createThreadWorktree2;
|
|
9629
9629
|
void slug;
|
|
@@ -9727,7 +9727,7 @@ async function startOrchestration(opts) {
|
|
|
9727
9727
|
sourceRef: "default",
|
|
9728
9728
|
...createOpts
|
|
9729
9729
|
}).catch(async () => {
|
|
9730
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
9730
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-FMIX4BRV.js");
|
|
9731
9731
|
const repo = await resolveRepoRoot2(repoPath);
|
|
9732
9732
|
const def = await resolveDefaultBranch2(repo);
|
|
9733
9733
|
return orch.createThread({
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-WFUDY6PC.js";
|
|
12
12
|
import {
|
|
13
13
|
run
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QVN2WOKJ.js";
|
|
15
15
|
|
|
16
16
|
// src/brightsy/connected-teams.ts
|
|
17
17
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -19,7 +19,7 @@ import { join } from "path";
|
|
|
19
19
|
|
|
20
20
|
// src/brightsy/accounts.ts
|
|
21
21
|
async function loadConnectedTeams() {
|
|
22
|
-
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-
|
|
22
|
+
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-JUJAQZZE.js");
|
|
23
23
|
return listConnectedBrightsyTeams2();
|
|
24
24
|
}
|
|
25
25
|
async function runBrightsyTeamsJson(args) {
|
|
@@ -48,14 +48,14 @@ async function listBrightsyAccounts() {
|
|
|
48
48
|
async function getBrightsySession() {
|
|
49
49
|
try {
|
|
50
50
|
const { ensureBrightsyLocalConfigFresh: ensureBrightsyLocalConfigFresh2 } = await import("./oauth-S3M7B475.js");
|
|
51
|
-
const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-
|
|
51
|
+
const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-JUJAQZZE.js");
|
|
52
52
|
await ensureBrightsyLocalConfigFresh2();
|
|
53
53
|
await ensureConnectedBrightsyTeamTokens2();
|
|
54
54
|
loadBrightsyConfig();
|
|
55
55
|
const data = await runBrightsyTeamsJson([]);
|
|
56
56
|
const accounts = Array.isArray(data.teams) ? data.teams : [];
|
|
57
57
|
const active = data.active ?? accounts.find((a) => a.active) ?? null;
|
|
58
|
-
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-
|
|
58
|
+
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-JUJAQZZE.js");
|
|
59
59
|
const connectedTeams = ensureCliTeamTracked2(
|
|
60
60
|
active ? { id: active.id, slug: active.slug, name: active.name } : void 0
|
|
61
61
|
);
|
|
@@ -95,7 +95,7 @@ async function performBrightsyAccountSwitch(accountIdOrSlug) {
|
|
|
95
95
|
return { cfg, target: data.active };
|
|
96
96
|
}
|
|
97
97
|
async function switchBrightsyAccount(accountIdOrSlug) {
|
|
98
|
-
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-
|
|
98
|
+
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-JUJAQZZE.js");
|
|
99
99
|
await connectBrightsyTeam2(accountIdOrSlug);
|
|
100
100
|
return getBrightsySession();
|
|
101
101
|
}
|
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
appDataDir
|
|
3
3
|
} from "./chunk-WFUDY6PC.js";
|
|
4
4
|
import {
|
|
5
|
+
npmGlobalNodeModules,
|
|
5
6
|
run
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QVN2WOKJ.js";
|
|
7
8
|
import {
|
|
8
9
|
isElectronLikeCommand,
|
|
9
10
|
wrapElectronAsNodeLaunch
|
|
@@ -750,6 +751,123 @@ async function resolveNodeLaunch(scriptPath) {
|
|
|
750
751
|
};
|
|
751
752
|
}
|
|
752
753
|
|
|
754
|
+
// src/agents/cursor-sdk-resolve.ts
|
|
755
|
+
import { existsSync as existsSync4, readFileSync as readFileSync2 } from "fs";
|
|
756
|
+
import { createRequire } from "module";
|
|
757
|
+
import { basename, dirname as dirname2, join as join4 } from "path";
|
|
758
|
+
import { fileURLToPath, pathToFileURL } from "url";
|
|
759
|
+
var CURSOR_SDK_INSTALL_HINT = "Cursor SDK is not installed. Settings \u2192 Agents \u2192 Cursor \u2192 Install (`npm i -g @cursor/sdk`). Sideboard does not ship the SDK \u2014 update it anytime without a new Sideboard build.";
|
|
760
|
+
function thisModuleFile() {
|
|
761
|
+
const cjsDir = typeof __dirname !== "undefined" ? __dirname : "";
|
|
762
|
+
if (cjsDir) return join4(cjsDir, "cursor-sdk-resolve.js");
|
|
763
|
+
try {
|
|
764
|
+
return fileURLToPath(import.meta.url);
|
|
765
|
+
} catch {
|
|
766
|
+
return join4(process.cwd(), "package.json");
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
function packageRootLooksLikeSdk(dir) {
|
|
770
|
+
try {
|
|
771
|
+
const raw = readFileSync2(join4(dir, "package.json"), "utf8");
|
|
772
|
+
const pkg = JSON.parse(raw);
|
|
773
|
+
return pkg.name === "@cursor/sdk" && existsSync4(dir);
|
|
774
|
+
} catch {
|
|
775
|
+
return false;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
function resolvedPackageRoot(fromFile) {
|
|
779
|
+
try {
|
|
780
|
+
const req = createRequire(fromFile);
|
|
781
|
+
const pkgJson = req.resolve("@cursor/sdk/package.json");
|
|
782
|
+
const root = dirname2(pkgJson);
|
|
783
|
+
return packageRootLooksLikeSdk(root) ? root : null;
|
|
784
|
+
} catch {
|
|
785
|
+
return null;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
function resolveCursorSdkRoot(opts) {
|
|
789
|
+
const env = opts?.env ?? process.env;
|
|
790
|
+
const override = env.SIDEBOARD_CURSOR_SDK?.trim();
|
|
791
|
+
if (override) {
|
|
792
|
+
return packageRootLooksLikeSdk(override) ? override : null;
|
|
793
|
+
}
|
|
794
|
+
const globalNm = npmGlobalNodeModules(env);
|
|
795
|
+
if (globalNm) {
|
|
796
|
+
const globalRoot = join4(globalNm, "@cursor/sdk");
|
|
797
|
+
if (packageRootLooksLikeSdk(globalRoot)) return globalRoot;
|
|
798
|
+
}
|
|
799
|
+
const cwdPkg = join4(process.cwd(), "package.json");
|
|
800
|
+
return resolvedPackageRoot(thisModuleFile()) ?? resolvedPackageRoot(cwdPkg);
|
|
801
|
+
}
|
|
802
|
+
function isCursorSdkInstalled(opts) {
|
|
803
|
+
return Boolean(resolveCursorSdkRoot(opts));
|
|
804
|
+
}
|
|
805
|
+
function exportTarget(value) {
|
|
806
|
+
if (typeof value === "string") return value;
|
|
807
|
+
if (value && typeof value === "object") {
|
|
808
|
+
const v = value;
|
|
809
|
+
return exportTarget(v.import) ?? exportTarget(v.default);
|
|
810
|
+
}
|
|
811
|
+
return null;
|
|
812
|
+
}
|
|
813
|
+
function cursorSdkEsmEntry(root) {
|
|
814
|
+
try {
|
|
815
|
+
const pkg = JSON.parse(readFileSync2(join4(root, "package.json"), "utf8"));
|
|
816
|
+
const exp = pkg.exports;
|
|
817
|
+
const dot = exp && typeof exp === "object" && !Array.isArray(exp) && "." in exp ? exp["."] : exp;
|
|
818
|
+
const rel = exportTarget(dot) ?? (typeof pkg.module === "string" ? pkg.module : null);
|
|
819
|
+
if (!rel) return null;
|
|
820
|
+
const entry = join4(root, rel);
|
|
821
|
+
return existsSync4(entry) ? entry : null;
|
|
822
|
+
} catch {
|
|
823
|
+
return null;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
function unwrapCursorSdkModule(mod) {
|
|
827
|
+
const m = mod;
|
|
828
|
+
if (m && !m.Agent && m.default?.Agent) return m.default;
|
|
829
|
+
return m;
|
|
830
|
+
}
|
|
831
|
+
function cursorSdkHasExpectedExports(mod) {
|
|
832
|
+
const m = mod;
|
|
833
|
+
return typeof m?.Agent === "function" && typeof m?.JsonlLocalAgentStore === "function";
|
|
834
|
+
}
|
|
835
|
+
function cursorSdkMissingExportsMessage(root) {
|
|
836
|
+
return `Cursor SDK at ${root ?? "(unknown)"} is missing expected exports (Agent, JsonlLocalAgentStore) \u2014 reinstall with \`npm i -g @cursor/sdk\`.`;
|
|
837
|
+
}
|
|
838
|
+
async function importCursorSdk(opts) {
|
|
839
|
+
const root = resolveCursorSdkRoot(opts);
|
|
840
|
+
if (!root) return null;
|
|
841
|
+
try {
|
|
842
|
+
let entry = cursorSdkEsmEntry(root);
|
|
843
|
+
if (!entry) {
|
|
844
|
+
const req = createRequire(join4(root, "package.json"));
|
|
845
|
+
entry = req.resolve("@cursor/sdk");
|
|
846
|
+
}
|
|
847
|
+
return unwrapCursorSdkModule(await import(pathToFileURL(entry).href));
|
|
848
|
+
} catch {
|
|
849
|
+
return null;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
function cursorSdkPlatformRipgrepPackage() {
|
|
853
|
+
return `@cursor/sdk-${process.platform}-${process.arch}`;
|
|
854
|
+
}
|
|
855
|
+
function nodeModulesDirForPackageRoot(packageRoot) {
|
|
856
|
+
const parent = dirname2(packageRoot);
|
|
857
|
+
return basename(parent).startsWith("@") ? dirname2(parent) : parent;
|
|
858
|
+
}
|
|
859
|
+
function cursorSdkRipgrepCandidate(opts) {
|
|
860
|
+
const root = resolveCursorSdkRoot(opts);
|
|
861
|
+
if (!root) return null;
|
|
862
|
+
const nm = nodeModulesDirForPackageRoot(root);
|
|
863
|
+
const pkg = cursorSdkPlatformRipgrepPackage();
|
|
864
|
+
const bin = process.platform === "win32" ? "rg.exe" : "rg";
|
|
865
|
+
const sibling = join4(nm, pkg, "bin", bin);
|
|
866
|
+
if (existsSync4(sibling)) return sibling;
|
|
867
|
+
const nested = join4(root, "node_modules", pkg, "bin", bin);
|
|
868
|
+
return existsSync4(nested) ? nested : null;
|
|
869
|
+
}
|
|
870
|
+
|
|
753
871
|
// src/agents/cursor-events.ts
|
|
754
872
|
function usageFromCursor(usage) {
|
|
755
873
|
if (!usage) return null;
|
|
@@ -1059,9 +1177,9 @@ function parseCursorRunnerLine(line) {
|
|
|
1059
1177
|
}
|
|
1060
1178
|
|
|
1061
1179
|
// src/agents/cursor-ripgrep.ts
|
|
1062
|
-
import { existsSync as
|
|
1063
|
-
import { createRequire } from "module";
|
|
1064
|
-
import { dirname as
|
|
1180
|
+
import { existsSync as existsSync5 } from "fs";
|
|
1181
|
+
import { createRequire as createRequire2 } from "module";
|
|
1182
|
+
import { dirname as dirname3, isAbsolute, join as join5, parse, resolve as resolvePath } from "path";
|
|
1065
1183
|
var RIPGREP_ENV = "CURSOR_RIPGREP_PATH";
|
|
1066
1184
|
function rgBinaryName() {
|
|
1067
1185
|
return process.platform === "win32" ? "rg.exe" : "rg";
|
|
@@ -1073,19 +1191,19 @@ function usableRipgrepPath(candidate) {
|
|
|
1073
1191
|
const raw = candidate?.trim();
|
|
1074
1192
|
if (!raw || !isAbsolute(raw)) return null;
|
|
1075
1193
|
const readable = nodeReadableScriptPath(raw);
|
|
1076
|
-
if (!
|
|
1194
|
+
if (!existsSync5(readable) || isAsarPath(readable)) return null;
|
|
1077
1195
|
return readable;
|
|
1078
1196
|
}
|
|
1079
1197
|
function walkForBundledRipgrep(startFile) {
|
|
1080
1198
|
if (!startFile) return null;
|
|
1081
1199
|
const pkg = platformRipgrepPackage();
|
|
1082
1200
|
const name = rgBinaryName();
|
|
1083
|
-
let dir =
|
|
1201
|
+
let dir = dirname3(resolvePath(startFile));
|
|
1084
1202
|
const root = parse(dir).root;
|
|
1085
1203
|
while (dir !== root) {
|
|
1086
|
-
const hit = usableRipgrepPath(
|
|
1204
|
+
const hit = usableRipgrepPath(join5(dir, "node_modules", pkg, "bin", name));
|
|
1087
1205
|
if (hit) return hit;
|
|
1088
|
-
const next =
|
|
1206
|
+
const next = dirname3(dir);
|
|
1089
1207
|
if (next === dir) break;
|
|
1090
1208
|
dir = next;
|
|
1091
1209
|
}
|
|
@@ -1093,9 +1211,9 @@ function walkForBundledRipgrep(startFile) {
|
|
|
1093
1211
|
}
|
|
1094
1212
|
function requireResolveBundledRipgrep(fromFile) {
|
|
1095
1213
|
try {
|
|
1096
|
-
const req =
|
|
1214
|
+
const req = createRequire2(fromFile);
|
|
1097
1215
|
const pkgJson = req.resolve(`${platformRipgrepPackage()}/package.json`);
|
|
1098
|
-
return usableRipgrepPath(
|
|
1216
|
+
return usableRipgrepPath(join5(dirname3(pkgJson), "bin", rgBinaryName()));
|
|
1099
1217
|
} catch {
|
|
1100
1218
|
return null;
|
|
1101
1219
|
}
|
|
@@ -1111,7 +1229,7 @@ function resolveCursorRipgrepPath(opts) {
|
|
|
1111
1229
|
const start = opts?.startFile?.trim() || process.argv[1] || // CJS bundle only — ESM has no __filename; argv[1] is the running script.
|
|
1112
1230
|
// eslint-disable-next-line camelcase
|
|
1113
1231
|
(typeof __filename !== "undefined" ? __filename : "");
|
|
1114
|
-
return walkForBundledRipgrep(start) ?? requireResolveBundledRipgrep(start);
|
|
1232
|
+
return walkForBundledRipgrep(start) ?? usableRipgrepPath(cursorSdkRipgrepCandidate({ env })) ?? requireResolveBundledRipgrep(start);
|
|
1115
1233
|
}
|
|
1116
1234
|
function cursorRipgrepEnv(opts) {
|
|
1117
1235
|
const path = resolveCursorRipgrepPath(opts);
|
|
@@ -1154,6 +1272,12 @@ export {
|
|
|
1154
1272
|
isAsarPath,
|
|
1155
1273
|
applyNodeLaunch,
|
|
1156
1274
|
resolveNodeLaunch,
|
|
1275
|
+
CURSOR_SDK_INSTALL_HINT,
|
|
1276
|
+
resolveCursorSdkRoot,
|
|
1277
|
+
isCursorSdkInstalled,
|
|
1278
|
+
cursorSdkHasExpectedExports,
|
|
1279
|
+
cursorSdkMissingExportsMessage,
|
|
1280
|
+
importCursorSdk,
|
|
1157
1281
|
preferredCursorCostCents,
|
|
1158
1282
|
turnCostUsdFromCursorUsage,
|
|
1159
1283
|
fetchCursorTurnCostUsd,
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
ensureConnectedBrightsyTeamTokens,
|
|
8
8
|
getConnectedBrightsyTeamsRaw,
|
|
9
9
|
listConnectedBrightsyTeams
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TNVJPFHM.js";
|
|
11
11
|
import "./chunk-ROPGQRPU.js";
|
|
12
12
|
import "./chunk-N7WZ6NIN.js";
|
|
13
13
|
import "./chunk-WFUDY6PC.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-QVN2WOKJ.js";
|
|
15
15
|
import "./chunk-4TR3HZFT.js";
|
|
16
16
|
export {
|
|
17
17
|
applyConnectedTeamToCli,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
ensureConnectedBrightsyTeamTokens,
|
|
10
10
|
getConnectedBrightsyTeamsRaw,
|
|
11
11
|
listConnectedBrightsyTeams
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SPAMHHJH.js";
|
|
13
13
|
import "./chunk-P2BSMNHB.js";
|
|
14
14
|
import "./chunk-VKQGAWHY.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-2UG25RMK.js";
|
|
16
16
|
import "./chunk-EQNRWDLN.js";
|
|
17
17
|
import "./chunk-WWUABK6B.js";
|
|
18
18
|
export {
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
enrichWorkspacesWithGithub,
|
|
10
10
|
ensureGlobalCoordinatorCwd,
|
|
11
11
|
formatWorkspaceInventory
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-TWXSZYR2.js";
|
|
13
|
+
import "./chunk-4VFOJZPS.js";
|
|
14
14
|
import "./chunk-D6JWYJ4P.js";
|
|
15
15
|
import "./chunk-XJETIO4K.js";
|
|
16
16
|
import "./chunk-X5B3OS5I.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-DD67JWTN.js";
|
|
18
|
+
import "./chunk-2UG25RMK.js";
|
|
19
19
|
import "./chunk-RZTRWN2V.js";
|
|
20
20
|
import "./chunk-NSTQ6QKD.js";
|
|
21
21
|
import "./chunk-KGZBYWZ3.js";
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
enrichWorkspacesWithGithub,
|
|
8
8
|
ensureGlobalCoordinatorCwd,
|
|
9
9
|
formatWorkspaceInventory
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-S2OEFXST.js";
|
|
11
|
+
import "./chunk-7H2CVVLF.js";
|
|
12
12
|
import "./chunk-6K64FJDD.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-2P4XKWV2.js";
|
|
14
14
|
import "./chunk-I5NC7DWO.js";
|
|
15
15
|
import "./chunk-WDRMZKVB.js";
|
|
16
16
|
import "./chunk-JT7R45JB.js";
|
|
@@ -18,7 +18,7 @@ import "./chunk-4VGCG2HV.js";
|
|
|
18
18
|
import "./chunk-7J72QJOM.js";
|
|
19
19
|
import "./chunk-77WWLBCI.js";
|
|
20
20
|
import "./chunk-WFUDY6PC.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-QVN2WOKJ.js";
|
|
22
22
|
import "./chunk-4TR3HZFT.js";
|
|
23
23
|
export {
|
|
24
24
|
COORDINATOR_TOOL_PLAYBOOK,
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
orchestratorSessionPoisonedByBuiltins,
|
|
18
18
|
slackCoordinatorSourceRef,
|
|
19
19
|
takenTeamSlugsForOrchestration
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-TWXSZYR2.js";
|
|
21
|
+
import "./chunk-4VFOJZPS.js";
|
|
22
22
|
import "./chunk-D6JWYJ4P.js";
|
|
23
23
|
import "./chunk-XJETIO4K.js";
|
|
24
24
|
import "./chunk-X5B3OS5I.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-DD67JWTN.js";
|
|
26
|
+
import "./chunk-2UG25RMK.js";
|
|
27
27
|
import "./chunk-RZTRWN2V.js";
|
|
28
28
|
import "./chunk-NSTQ6QKD.js";
|
|
29
29
|
import "./chunk-KGZBYWZ3.js";
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
orchestratorSessionPoisonedByBuiltins,
|
|
16
16
|
slackCoordinatorSourceRef,
|
|
17
17
|
takenTeamSlugsForOrchestration
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-S2OEFXST.js";
|
|
19
|
+
import "./chunk-7H2CVVLF.js";
|
|
20
20
|
import "./chunk-6K64FJDD.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-2P4XKWV2.js";
|
|
22
22
|
import "./chunk-I5NC7DWO.js";
|
|
23
23
|
import "./chunk-WDRMZKVB.js";
|
|
24
24
|
import "./chunk-JT7R45JB.js";
|
|
@@ -28,7 +28,7 @@ import "./chunk-77WWLBCI.js";
|
|
|
28
28
|
import {
|
|
29
29
|
globalAgentCwd
|
|
30
30
|
} from "./chunk-WFUDY6PC.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-QVN2WOKJ.js";
|
|
32
32
|
import "./chunk-4TR3HZFT.js";
|
|
33
33
|
export {
|
|
34
34
|
GLOBAL_WORKSPACE_ID,
|