@sideboard-ai/core 0.1.89 → 0.1.95

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.
Files changed (30) hide show
  1. package/dist/agents/cursor-runner.cjs +129 -14
  2. package/dist/agents/cursor-runner.js +4 -1
  3. package/dist/{agents-LMUFTGKF.js → agents-HBLA6FEV.js} +4 -4
  4. package/dist/{agents-ODBP7J6E.js → agents-WS5QV6LE.js} +5 -5
  5. package/dist/{chunk-WANQFU3S.js → chunk-6XBXVXX2.js} +2 -2
  6. package/dist/{chunk-7D27DD2X.js → chunk-CIRXAYWS.js} +260 -61
  7. package/dist/{chunk-B2KIO2SD.js → chunk-CLGO7TLO.js} +2 -2
  8. package/dist/{chunk-CBJSPTBG.js → chunk-GXSYI7FH.js} +206 -5
  9. package/dist/{chunk-RJLBSYUO.js → chunk-KWNUZ4LR.js} +46 -77
  10. package/dist/{chunk-UHTNJKZX.js → chunk-NR6APJLD.js} +2 -2
  11. package/dist/{chunk-6EZRSCIT.js → chunk-QKYO6BHB.js} +2 -2
  12. package/dist/{chunk-ZXYWWSHZ.js → chunk-R7BQBSDT.js} +254 -61
  13. package/dist/{chunk-JE75QW2I.js → chunk-WBX46OPD.js} +237 -96
  14. package/dist/{chunk-OB6IRIFV.js → chunk-XH2GS2LO.js} +2 -2
  15. package/dist/{chunk-VZ2L4AEJ.js → chunk-XUWDLRAE.js} +2 -2
  16. package/dist/{coordinator-prompt-UK5LYFN5.js → coordinator-prompt-AKEY4WSO.js} +2 -2
  17. package/dist/{coordinator-prompt-CI5SHONJ.js → coordinator-prompt-OQOOD5ET.js} +2 -2
  18. package/dist/{global-workspace-2YZ2V4I5.js → global-workspace-3GNPQCLE.js} +3 -3
  19. package/dist/{global-workspace-JQQLPJM5.js → global-workspace-M3OMVDDH.js} +3 -3
  20. package/dist/index.cjs +1021 -473
  21. package/dist/index.d.cts +91 -20
  22. package/dist/index.d.ts +91 -20
  23. package/dist/index.js +244 -59
  24. package/dist/mcp/run-stdio.cjs +816 -428
  25. package/dist/mcp/run-stdio.js +77 -40
  26. package/dist/{workspaces-YWCC3WV4.js → workspaces-ERZC7ULY.js} +4 -4
  27. package/dist/{workspaces-FDO5L4NI.js → workspaces-J4WG6UFR.js} +4 -4
  28. package/dist/{worktree-7YNSJ224.js → worktree-DA4BOV7G.js} +7 -1
  29. package/dist/{worktree-4555QBQ7.js → worktree-EO5QAGJU.js} +7 -1
  30. package/package.json +1 -1
@@ -3,8 +3,8 @@
3
3
 
4
4
  // src/agents/cursor-runner.ts
5
5
  var import_sdk = require("@cursor/sdk");
6
- var import_node_fs5 = require("fs");
7
- var import_node_path6 = require("path");
6
+ var import_node_fs9 = require("fs");
7
+ var import_node_path10 = require("path");
8
8
  var import_node_readline2 = require("readline");
9
9
 
10
10
  // src/hook/nested-electron-env.ts
@@ -54,6 +54,120 @@ function appDataDir() {
54
54
  return base;
55
55
  }
56
56
 
57
+ // src/agents/cursor-ripgrep.ts
58
+ var import_node_fs8 = require("fs");
59
+ var import_node_module = require("module");
60
+ var import_node_path9 = require("path");
61
+ var import_node_url = require("url");
62
+
63
+ // src/agents/node-launch.ts
64
+ var import_node_fs6 = require("fs");
65
+ var import_node_os4 = require("os");
66
+ var import_node_path7 = require("path");
67
+
68
+ // src/git/run.ts
69
+ var import_execa2 = require("execa");
70
+
71
+ // src/agents/path.ts
72
+ var import_node_fs5 = require("fs");
73
+ var import_node_child_process = require("child_process");
74
+ var import_node_os3 = require("os");
75
+ var import_node_path6 = require("path");
76
+
77
+ // src/agents/node-launch.ts
78
+ function isAsarPath(filePath) {
79
+ if (/\.asar\.unpacked([/\\]|$)/.test(filePath)) return false;
80
+ return /\.asar([/\\]|$)/.test(filePath);
81
+ }
82
+ function unpackedAsarPath(filePath) {
83
+ if (!isAsarPath(filePath)) return null;
84
+ const unpacked = filePath.replace(/\.asar(?=[/\\])/, ".asar.unpacked");
85
+ if (unpacked === filePath) return null;
86
+ return (0, import_node_fs6.existsSync)(unpacked) ? unpacked : null;
87
+ }
88
+ function nodeReadableScriptPath(scriptPath) {
89
+ return unpackedAsarPath(scriptPath) ?? scriptPath;
90
+ }
91
+
92
+ // src/agents/packaged-runtime.ts
93
+ var import_node_fs7 = require("fs");
94
+ var import_node_path8 = require("path");
95
+ function electronResourcesPath() {
96
+ const resources = process.resourcesPath;
97
+ if (typeof resources !== "string" || !resources) return null;
98
+ return resources;
99
+ }
100
+ function packagedCursorRuntimeDir() {
101
+ const resources = electronResourcesPath();
102
+ if (!resources) return null;
103
+ const dir = (0, import_node_path8.join)(resources, "cursor-runtime");
104
+ if (!(0, import_node_fs7.existsSync)((0, import_node_path8.join)(dir, "core-dist", "agents", "cursor-runner.js"))) return null;
105
+ return dir;
106
+ }
107
+ function packagedCursorRipgrepCandidate(platformPkg, binName) {
108
+ const dir = packagedCursorRuntimeDir();
109
+ if (!dir) return null;
110
+ return (0, import_node_path8.join)(dir, "node_modules", platformPkg, "bin", binName);
111
+ }
112
+
113
+ // src/agents/cursor-ripgrep.ts
114
+ var import_meta = {};
115
+ var RIPGREP_ENV = "CURSOR_RIPGREP_PATH";
116
+ function rgBinaryName() {
117
+ return process.platform === "win32" ? "rg.exe" : "rg";
118
+ }
119
+ function platformRipgrepPackage() {
120
+ return `@cursor/sdk-${process.platform}-${process.arch}`;
121
+ }
122
+ function usableRipgrepPath(candidate) {
123
+ const raw = candidate?.trim();
124
+ if (!raw || !(0, import_node_path9.isAbsolute)(raw)) return null;
125
+ const readable = nodeReadableScriptPath(raw);
126
+ if (!(0, import_node_fs8.existsSync)(readable) || isAsarPath(readable)) return null;
127
+ return readable;
128
+ }
129
+ function walkForBundledRipgrep(startFile) {
130
+ if (!startFile) return null;
131
+ const pkg = platformRipgrepPackage();
132
+ const name = rgBinaryName();
133
+ let dir = (0, import_node_path9.dirname)((0, import_node_path9.resolve)(startFile));
134
+ const root = (0, import_node_path9.parse)(dir).root;
135
+ while (dir !== root) {
136
+ const hit = usableRipgrepPath((0, import_node_path9.join)(dir, "node_modules", pkg, "bin", name));
137
+ if (hit) return hit;
138
+ const next = (0, import_node_path9.dirname)(dir);
139
+ if (next === dir) break;
140
+ dir = next;
141
+ }
142
+ return null;
143
+ }
144
+ function requireResolveBundledRipgrep(fromFile) {
145
+ try {
146
+ const req = (0, import_node_module.createRequire)(fromFile);
147
+ const pkgJson = req.resolve(`${platformRipgrepPackage()}/package.json`);
148
+ return usableRipgrepPath((0, import_node_path9.join)((0, import_node_path9.dirname)(pkgJson), "bin", rgBinaryName()));
149
+ } catch {
150
+ return null;
151
+ }
152
+ }
153
+ function resolveCursorRipgrepPath(opts) {
154
+ const env = opts?.env ?? process.env;
155
+ const fromEnv = usableRipgrepPath(env[RIPGREP_ENV]);
156
+ if (fromEnv) return fromEnv;
157
+ const fromPackaged = usableRipgrepPath(
158
+ packagedCursorRipgrepCandidate(platformRipgrepPackage(), rgBinaryName())
159
+ );
160
+ if (fromPackaged) return fromPackaged;
161
+ const start = opts?.startFile?.trim() || process.argv[1] || (0, import_node_url.fileURLToPath)(import_meta.url);
162
+ return walkForBundledRipgrep(start) ?? requireResolveBundledRipgrep(start);
163
+ }
164
+ function ensureCursorRipgrepPath(opts) {
165
+ const target = opts?.env ?? process.env;
166
+ const path = resolveCursorRipgrepPath({ env: target, startFile: opts?.startFile });
167
+ if (path) target[RIPGREP_ENV] = path;
168
+ return path;
169
+ }
170
+
57
171
  // src/agents/cursor-session.ts
58
172
  function cursorErrorMessage(err) {
59
173
  if (err instanceof Error) return err.message.trim();
@@ -331,6 +445,7 @@ function createAgentStreamCoalescer(emit2, opts) {
331
445
 
332
446
  // src/agents/cursor-runner.ts
333
447
  dropNestedElectronEnvFromProcess();
448
+ ensureCursorRipgrepPath();
334
449
  function emit(event) {
335
450
  process.stdout.write(`${JSON.stringify(event)}
336
451
  `);
@@ -350,8 +465,8 @@ function modelSelection(model, opts) {
350
465
  return params.length > 0 ? { id, params } : { id };
351
466
  }
352
467
  function localAgentStore() {
353
- const root = (0, import_node_path6.join)(appDataDir(), "cursor-sdk-store");
354
- (0, import_node_fs5.mkdirSync)(root, { recursive: true });
468
+ const root = (0, import_node_path10.join)(appDataDir(), "cursor-sdk-store");
469
+ (0, import_node_fs9.mkdirSync)(root, { recursive: true });
355
470
  return new import_sdk.JsonlLocalAgentStore(root);
356
471
  }
357
472
  async function cancelStaleLocalRuns(agentId, opts) {
@@ -362,10 +477,10 @@ async function cancelStaleLocalRuns(agentId, opts) {
362
477
  limit: 20
363
478
  });
364
479
  let cancelled = 0;
365
- for (const run of listed.items) {
366
- if (run.status !== "running") continue;
480
+ for (const run2 of listed.items) {
481
+ if (run2.status !== "running") continue;
367
482
  try {
368
- await import_sdk.Agent.cancelRun(run.id, {
483
+ await import_sdk.Agent.cancelRun(run2.id, {
369
484
  runtime: "local",
370
485
  cwd: opts.cwd,
371
486
  store: opts.store
@@ -461,11 +576,11 @@ async function main() {
461
576
  let liveRun = null;
462
577
  let shuttingDown = false;
463
578
  const cancelLiveRun = async () => {
464
- const run = liveRun;
579
+ const run2 = liveRun;
465
580
  liveRun = null;
466
- if (!run) return;
581
+ if (!run2) return;
467
582
  try {
468
- await run.cancel();
583
+ await run2.cancel();
469
584
  } catch {
470
585
  }
471
586
  };
@@ -483,17 +598,17 @@ async function main() {
483
598
  process.once("SIGINT", onSignal);
484
599
  async function runTurn(agent) {
485
600
  emit({ type: "session_id", data: agent.agentId });
486
- const run = await sendPrompt(agent);
487
- liveRun = run;
601
+ const run2 = await sendPrompt(agent);
602
+ liveRun = run2;
488
603
  const stream = createAgentStreamCoalescer(emit);
489
604
  try {
490
- for await (const msg of run.stream()) {
605
+ for await (const msg of run2.stream()) {
491
606
  for (const event of cursorSdkMessageToEvents(msg)) {
492
607
  stream.push(event);
493
608
  }
494
609
  }
495
610
  stream.flush();
496
- const result = await run.wait();
611
+ const result = await run2.wait();
497
612
  if (result.status === "error") {
498
613
  const detail = formatUnknownDetail(result.error);
499
614
  emit({
@@ -4,14 +4,16 @@ import {
4
4
  } from "../chunk-MMI4RJ5I.js";
5
5
  import {
6
6
  cursorSdkMessageToEvents,
7
+ ensureCursorRipgrepPath,
7
8
  formatUnknownDetail
8
- } from "../chunk-CBJSPTBG.js";
9
+ } from "../chunk-GXSYI7FH.js";
9
10
  import {
10
11
  dropNestedElectronEnvFromProcess
11
12
  } from "../chunk-TLPJHLLM.js";
12
13
  import {
13
14
  appDataDir
14
15
  } from "../chunk-B4R2VB2A.js";
16
+ import "../chunk-LGXBYZZA.js";
15
17
 
16
18
  // src/agents/cursor-runner.ts
17
19
  import { Agent, CursorAgentError, JsonlLocalAgentStore } from "@cursor/sdk";
@@ -57,6 +59,7 @@ function withCursorLocalHangGuards(local) {
57
59
 
58
60
  // src/agents/cursor-runner.ts
59
61
  dropNestedElectronEnvFromProcess();
62
+ ensureCursorRipgrepPath();
60
63
  function emit(event) {
61
64
  process.stdout.write(`${JSON.stringify(event)}
62
65
  `);
@@ -32,16 +32,16 @@ import {
32
32
  resolveCursorModelId,
33
33
  resolveLoginCommand,
34
34
  resolveQuotaFallbackAgent
35
- } from "./chunk-JE75QW2I.js";
35
+ } from "./chunk-WBX46OPD.js";
36
36
  import "./chunk-DKHGWYWR.js";
37
37
  import {
38
38
  ORCHESTRATOR_AGENT_KINDS,
39
39
  assertOrchestratorCapableAgent,
40
40
  coerceOrchestratorAgent,
41
41
  isOrchestratorCapableAgent
42
- } from "./chunk-UHTNJKZX.js";
43
- import "./chunk-OB6IRIFV.js";
44
- import "./chunk-ZXYWWSHZ.js";
42
+ } from "./chunk-NR6APJLD.js";
43
+ import "./chunk-XH2GS2LO.js";
44
+ import "./chunk-R7BQBSDT.js";
45
45
  import "./chunk-B3SJXYIJ.js";
46
46
  import "./chunk-JOF3XIEM.js";
47
47
  import "./chunk-6LFV4VFI.js";
@@ -28,20 +28,20 @@ import {
28
28
  resolveCursorModelId,
29
29
  resolveLoginCommand,
30
30
  resolveQuotaFallbackAgent
31
- } from "./chunk-RJLBSYUO.js";
31
+ } from "./chunk-KWNUZ4LR.js";
32
32
  import {
33
33
  ORCHESTRATOR_AGENT_KINDS,
34
34
  assertOrchestratorCapableAgent,
35
35
  coerceOrchestratorAgent,
36
36
  isOrchestratorCapableAgent
37
- } from "./chunk-B2KIO2SD.js";
38
- import "./chunk-VZ2L4AEJ.js";
37
+ } from "./chunk-CLGO7TLO.js";
38
+ import "./chunk-XUWDLRAE.js";
39
39
  import "./chunk-QSLE4VEM.js";
40
40
  import {
41
41
  cursorSdkMessageToEvents,
42
42
  parseCursorRunnerLine
43
- } from "./chunk-CBJSPTBG.js";
44
- import "./chunk-7D27DD2X.js";
43
+ } from "./chunk-GXSYI7FH.js";
44
+ import "./chunk-CIRXAYWS.js";
45
45
  import "./chunk-FKOIHGKV.js";
46
46
  import "./chunk-FT2SQOL4.js";
47
47
  import "./chunk-TLPJHLLM.js";
@@ -2,11 +2,11 @@
2
2
 
3
3
  import {
4
4
  isGlobalRepoPath
5
- } from "./chunk-UHTNJKZX.js";
5
+ } from "./chunk-NR6APJLD.js";
6
6
  import {
7
7
  ensureGhPreferOrigin,
8
8
  resolveRepoRoot
9
- } from "./chunk-ZXYWWSHZ.js";
9
+ } from "./chunk-R7BQBSDT.js";
10
10
  import {
11
11
  appDataDir
12
12
  } from "./chunk-JL4SJ6V7.js";