@sideboard-ai/core 0.1.324 → 0.1.326

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 (83) hide show
  1. package/dist/{abletime-CU2UPMJF.js → abletime-RDHYSZL2.js} +5 -4
  2. package/dist/{abletime-5ZY3ZUUO.js → abletime-RYYFGKMU.js} +6 -5
  3. package/dist/{abletime-oauth-7EOSBEFM.js → abletime-oauth-OYGS2DAU.js} +3 -3
  4. package/dist/{abletime-oauth-4TTCR3CT.js → abletime-oauth-QR2QDVMK.js} +3 -3
  5. package/dist/{abletime-rest-KOKE7V4B.js → abletime-rest-BKYKNPTC.js} +3 -3
  6. package/dist/{abletime-rest-3TG4G7LW.js → abletime-rest-QDPTWNS4.js} +3 -3
  7. package/dist/agents/claude-runner.cjs +59 -22
  8. package/dist/agents/claude-runner.js +39 -16
  9. package/dist/agents/cursor-runner.cjs +97 -32
  10. package/dist/agents/cursor-runner.js +74 -24
  11. package/dist/{agents-YK65UDLT.js → agents-HANWZNI6.js} +9 -8
  12. package/dist/{agents-LUSTCMDN.js → agents-QO7GKBYT.js} +12 -11
  13. package/dist/{app-settings-XIF4EC4K.js → app-settings-RXBH7KY4.js} +1 -1
  14. package/dist/{app-settings-I5HM5RMP.js → app-settings-TUVLZNDE.js} +1 -1
  15. package/dist/{chunk-7MQSYPAY.js → chunk-2EOLWHXH.js} +206 -188
  16. package/dist/{chunk-QOS4465Y.js → chunk-3Q4XNYHY.js} +1 -1
  17. package/dist/{chunk-RR4WCGNB.js → chunk-46FECFZU.js} +18 -15
  18. package/dist/{chunk-5GDJSFCT.js → chunk-4H5MWZ6J.js} +2 -2
  19. package/dist/{chunk-EQ52JR3Q.js → chunk-5MXLDDYF.js} +1 -1
  20. package/dist/{chunk-NCHOTN3C.js → chunk-5YCKATG6.js} +4 -3
  21. package/dist/{chunk-ROOZDDFA.js → chunk-75RPUXJS.js} +7 -8
  22. package/dist/{chunk-INBUV7HY.js → chunk-B244TJWC.js} +2 -2
  23. package/dist/{chunk-JH5SMVM5.js → chunk-BBNWKL4I.js} +268 -235
  24. package/dist/{chunk-ODH3XHMI.js → chunk-C7HUCBX7.js} +5 -5
  25. package/dist/{chunk-OIHRC2ZJ.js → chunk-D744HOI5.js} +25 -3
  26. package/dist/chunk-DBKHL7NC.js +214 -0
  27. package/dist/chunk-F6GE7V3Q.js +216 -0
  28. package/dist/{chunk-JE3JLHMO.js → chunk-FWVUGLBG.js} +3 -3
  29. package/dist/{chunk-DF5BM5OY.js → chunk-GP3RLZ6A.js} +207 -186
  30. package/dist/{chunk-FR3SAYUL.js → chunk-JM2TGOHP.js} +5 -5
  31. package/dist/{chunk-Y3WREIPQ.js → chunk-K7M7MIWL.js} +12 -210
  32. package/dist/{chunk-FUFNMUNR.js → chunk-KECHK3ZT.js} +7 -8
  33. package/dist/{chunk-EKU7FQVG.js → chunk-KXRF6RNL.js} +2 -2
  34. package/dist/chunk-LRHUBGEM.js +1259 -0
  35. package/dist/{chunk-MZIZTSR2.js → chunk-MAW7DIG7.js} +2 -2
  36. package/dist/{chunk-ZHGMRBSC.js → chunk-NURZOXGN.js} +4 -4
  37. package/dist/{chunk-QIC2JXHW.js → chunk-OOXRMTU6.js} +1 -1
  38. package/dist/{chunk-5XNT6BCG.js → chunk-OPXEJJBM.js} +1 -1
  39. package/dist/chunk-OYRN356W.js +80 -0
  40. package/dist/{chunk-7PVT73H6.js → chunk-PB6HW7SA.js} +12 -210
  41. package/dist/{chunk-B4CDSSRN.js → chunk-Q3FHTGIW.js} +2 -0
  42. package/dist/{chunk-7D5QIU3N.js → chunk-QG4CYRA3.js} +301 -268
  43. package/dist/{chunk-EJ66LEKH.js → chunk-QPSKQP6E.js} +24 -3
  44. package/dist/{chunk-Q3YJZPQI.js → chunk-RZVOX2MT.js} +3 -3
  45. package/dist/chunk-SO7G6O24.js +1445 -0
  46. package/dist/{chunk-YDUHLWI5.js → chunk-SUZOPJZC.js} +21 -7
  47. package/dist/chunk-TMCK5TLA.js +25 -0
  48. package/dist/chunk-W3ZLE4PO.js +77 -0
  49. package/dist/chunk-WUCAVIIP.js +28 -0
  50. package/dist/{chunk-BYUCNIXK.js → chunk-XLVLMQKN.js} +13 -9
  51. package/dist/{chunk-ZIRQZUZY.js → chunk-YGVGXQA7.js} +3 -3
  52. package/dist/{chunk-NXUN4U5P.js → chunk-YWQF7WAG.js} +2 -2
  53. package/dist/{chunk-IFWGG2M2.js → chunk-ZSHS46V5.js} +2 -0
  54. package/dist/{chunk-74OPNF7U.js → chunk-ZUAYA57W.js} +2 -2
  55. package/dist/{conductor-SPZOTC7W.js → conductor-4GVTHUUB.js} +7 -7
  56. package/dist/{conductor-JFABMXDA.js → conductor-TGWI6ETZ.js} +6 -6
  57. package/dist/{coordinator-prompt-K66RGNWK.js → coordinator-prompt-3E6SIDTM.js} +4 -4
  58. package/dist/{coordinator-prompt-Z6UFHFDH.js → coordinator-prompt-WEYJREV6.js} +4 -4
  59. package/dist/{cursor-recover-TEBFKAZ4.js → cursor-recover-7F46PAJ5.js} +1 -1
  60. package/dist/{cursor-recover-OWPQUHFH.js → cursor-recover-BDIAZIE3.js} +1 -1
  61. package/dist/{global-workspace-A6UO6PJV.js → global-workspace-FPDZKUPF.js} +4 -4
  62. package/dist/{global-workspace-RHEO55B4.js → global-workspace-UIEXAG2B.js} +4 -4
  63. package/dist/index.cjs +21094 -20840
  64. package/dist/index.d.cts +36 -17
  65. package/dist/index.d.ts +36 -17
  66. package/dist/index.js +343 -1678
  67. package/dist/linear-6S7MK5YK.js +69 -0
  68. package/dist/linear-Z2T4KUAQ.js +67 -0
  69. package/dist/linear-list-A37WLUBO.js +6 -0
  70. package/dist/linear-list-Q4M7AZO2.js +8 -0
  71. package/dist/mcp/run-stdio.cjs +15903 -15640
  72. package/dist/mcp/run-stdio.js +67 -1247
  73. package/dist/{optional-cli-RMMS5L6F.js → optional-cli-AANBL4U5.js} +3 -3
  74. package/dist/{optional-cli-Y3Z3GIPZ.js → optional-cli-CA4LL322.js} +4 -4
  75. package/dist/{orchestrator-7VTAUY24.js → orchestrator-7FVDBE7Y.js} +15 -13
  76. package/dist/{orchestrator-2O6OJQLX.js → orchestrator-RQXRZW7Z.js} +14 -12
  77. package/dist/{thread-store-3F7GR64A.js → thread-store-4ZN3DS2W.js} +1 -1
  78. package/dist/{thread-store-JRSL4HQY.js → thread-store-IC4BQXDW.js} +1 -1
  79. package/dist/{workspaces-NRKEXOYR.js → workspaces-LEW4UP56.js} +4 -4
  80. package/dist/{workspaces-42E6AGXD.js → workspaces-QONNLHNR.js} +4 -4
  81. package/dist/{worktree-ZDA2UJ7C.js → worktree-6GIONDQO.js} +3 -3
  82. package/dist/{worktree-4NGXCCUO.js → worktree-KFEJAQ2H.js} +3 -3
  83. package/package.json +1 -1
@@ -5,7 +5,7 @@ import {
5
5
  guardCursorCustomTool,
6
6
  shouldReturnRunErrorToAgent,
7
7
  sideboardCursorRpcTools
8
- } from "../chunk-NCHOTN3C.js";
8
+ } from "../chunk-5YCKATG6.js";
9
9
  import {
10
10
  createAgentStreamCoalescer
11
11
  } from "../chunk-AXQ4ZWHK.js";
@@ -20,7 +20,7 @@ import {
20
20
  fetchCursorTurnCostUsd,
21
21
  importCursorSdk,
22
22
  resolveCursorSdkRoot
23
- } from "../chunk-ZHGMRBSC.js";
23
+ } from "../chunk-NURZOXGN.js";
24
24
  import {
25
25
  TOOL_RESULT_STORE_MAX_CHARS,
26
26
  createCursorStreamToolProgress,
@@ -29,13 +29,13 @@ import {
29
29
  isCursorIdleAfterCompletedTool,
30
30
  looksLikeCursorStreamCutOff,
31
31
  noteCursorAgentEvent
32
- } from "../chunk-5XNT6BCG.js";
32
+ } from "../chunk-OPXEJJBM.js";
33
33
  import "../chunk-6K64FJDD.js";
34
34
  import {
35
35
  cursorSdkStoreDir
36
36
  } from "../chunk-LG6RJBIY.js";
37
37
  import "../chunk-2TUE6JKQ.js";
38
- import "../chunk-YDUHLWI5.js";
38
+ import "../chunk-SUZOPJZC.js";
39
39
  import {
40
40
  dropNestedElectronEnvFromProcess
41
41
  } from "../chunk-4TR3HZFT.js";
@@ -66,10 +66,20 @@ async function acquireCursorCatalogLock(storeDir) {
66
66
  try {
67
67
  return await lockfile.lock(lockPath, {
68
68
  retries: { retries: 40, minTimeout: 50, maxTimeout: 500 },
69
- stale: 5e3,
70
- update: 2e3
69
+ // Repair rewrites run_events.ndjson synchronously while holding the lock.
70
+ // A 5s stale window treats that stall as a dead owner and throws from a
71
+ // timer, which kills the runner mid-turn.
72
+ stale: 3e4,
73
+ update: 1e4,
74
+ onCompromised: (err) => {
75
+ console.error(`[sideboard] cursor catalog lock compromised: ${err.message}`);
76
+ }
71
77
  });
72
- } catch {
78
+ } catch (err) {
79
+ const message = err instanceof Error ? err.message : String(err);
80
+ console.error(
81
+ `[sideboard] cursor catalog lock not acquired (${message}); continuing without the lock`
82
+ );
73
83
  return async () => {
74
84
  };
75
85
  }
@@ -344,8 +354,8 @@ function isUnresumableCursorSession(err) {
344
354
  if (name === "AgentNotFoundError") return true;
345
355
  const lower = cursorErrorMessage(err).toLowerCase();
346
356
  if (!lower) return false;
347
- return /corrupt local agent checkpoint/.test(lower) || /missing root blob/.test(lower) || /\bagent\b.{0,120}\bnot found\b/.test(lower) || // Shared JSONL last-write-wins: `Run run-… not found for agent agent-…`
348
- /\brun\b.{0,80}\bnot found for agent\b/.test(lower) || /cannot resume/.test(lower);
357
+ return /corrupt local agent checkpoint/.test(lower) || /missing root blob/.test(lower) || /\bagent\s+agent-[\w-]+\s+not found\b/.test(lower) || // Shared JSONL last-write-wins: `Run run-… not found for agent agent-…`
358
+ /\brun\s+run-[\w-]+\s+not found for agent\b/.test(lower) || /cannot resume/.test(lower);
349
359
  }
350
360
  function cursorSessionRecoveryMessage(err, agentId) {
351
361
  const detail = cursorErrorMessage(err) || "unresumable session";
@@ -386,13 +396,20 @@ async function retryOnceOnRetryableCursorError(fn, onRetry, delayMs = CURSOR_RET
386
396
  return fn();
387
397
  }
388
398
  }
389
- function cursorSendOptions(mcpServers) {
390
- const opts = { local: { force: true } };
399
+ function cursorSendOptions(mcpServers, mode) {
400
+ const opts = {
401
+ local: { force: true }
402
+ };
403
+ if (mode) opts.mode = mode;
391
404
  if (mcpServers && typeof mcpServers === "object" && Object.keys(mcpServers).length > 0) {
392
405
  opts.mcpServers = mcpServers;
393
406
  }
394
407
  return opts;
395
408
  }
409
+ function cursorDisallowedTools(planMode) {
410
+ if (planMode) return ["read", "shell", "edit", "write", "delete", "task"];
411
+ return ["read"];
412
+ }
396
413
  function withCursorLocalHangGuards(local) {
397
414
  return { ...local, enableAgentRetries: false };
398
415
  }
@@ -433,6 +450,30 @@ async function* iterateUntilIdle(iterable, idleMs, onIdle, activity) {
433
450
  throw err;
434
451
  }
435
452
  }
453
+ function exitWhenFlushed(code) {
454
+ let pending = 2;
455
+ let exited = false;
456
+ const finish = () => {
457
+ pending -= 1;
458
+ if (pending > 0 || exited) return;
459
+ exited = true;
460
+ process.exit(code);
461
+ };
462
+ const flush = (stream) => {
463
+ if (stream.writableEnded) {
464
+ finish();
465
+ return;
466
+ }
467
+ stream.write("", finish);
468
+ };
469
+ flush(process.stdout);
470
+ flush(process.stderr);
471
+ setTimeout(() => {
472
+ if (exited) return;
473
+ exited = true;
474
+ process.exit(code);
475
+ }, 1e3).unref();
476
+ }
436
477
 
437
478
  // src/agents/sliced-file-read.ts
438
479
  import { readFileSync as readFileSync2, realpathSync, statSync } from "fs";
@@ -735,7 +776,7 @@ async function main() {
735
776
  mode,
736
777
  local,
737
778
  name: "Sideboard",
738
- disallowedTools: ["read"],
779
+ disallowedTools: cursorDisallowedTools(req.planMode),
739
780
  ...mcpServers ? { mcpServers } : {}
740
781
  };
741
782
  const retryTransport = (fn) => retryOnceOnRetryableCursorError(fn, (err) => {
@@ -748,14 +789,18 @@ async function main() {
748
789
  const { name: _name, ...opts } = createOpts;
749
790
  return retryTransport(() => Agent.resume(agentId, opts));
750
791
  }
792
+ function promptForNewSession() {
793
+ return req.freshPrompt?.trim() || req.prompt;
794
+ }
751
795
  async function openAgent() {
752
796
  try {
753
- return req.agentId ? await resumeAgent(req.agentId) : await createAgent();
797
+ if (!req.agentId) return { agent: await createAgent(), fresh: true };
798
+ return { agent: await resumeAgent(req.agentId), fresh: false };
754
799
  } catch (err) {
755
800
  if (!isUnresumableCursorSession(err)) throw err;
756
801
  if (repairCursorCatalogForResume(storeRoot, note) && req.agentId) {
757
802
  try {
758
- return await resumeAgent(req.agentId);
803
+ return { agent: await resumeAgent(req.agentId), fresh: false };
759
804
  } catch (err2) {
760
805
  if (!isUnresumableCursorSession(err2)) throw err2;
761
806
  }
@@ -764,7 +809,7 @@ async function main() {
764
809
  type: "stderr",
765
810
  data: cursorSessionRecoveryMessage(err, req.agentId)
766
811
  });
767
- return createAgent();
812
+ return { agent: await createAgent(), fresh: true };
768
813
  }
769
814
  }
770
815
  async function retryAfterBusy(agent) {
@@ -783,7 +828,7 @@ async function main() {
783
828
  }
784
829
  async function sendPrompt(agent, prompt, extra) {
785
830
  const sendOpts = {
786
- ...cursorSendOptions(mcpServers),
831
+ ...cursorSendOptions(mcpServers, mode),
787
832
  ...extra
788
833
  };
789
834
  try {
@@ -814,7 +859,7 @@ async function main() {
814
859
  setTimeout(resolve2, 2e3);
815
860
  })
816
861
  ]).finally(() => {
817
- void closeCursorCatalogTurn().finally(() => process.exit(1));
862
+ void closeCursorCatalogTurn().finally(() => exitWhenFlushed(1));
818
863
  });
819
864
  };
820
865
  process.once("SIGTERM", onSignal);
@@ -900,7 +945,10 @@ async function main() {
900
945
  });
901
946
  return 2;
902
947
  }
903
- if (result.status === "cancelled") return 0;
948
+ if (result.status === "cancelled") {
949
+ if (streamIdle) return 1;
950
+ return 0;
951
+ }
904
952
  try {
905
953
  const costUsd = await fetchCursorTurnCostUsd(
906
954
  (opts) => agent.getUsage(opts),
@@ -919,14 +967,16 @@ async function main() {
919
967
  }
920
968
  }
921
969
  try {
922
- let agent = await openAgent();
970
+ const opened = await openAgent();
971
+ let agent = opened.agent;
972
+ const prompt = opened.fresh ? promptForNewSession() : req.prompt;
923
973
  try {
924
974
  try {
925
- return await runTurn(agent);
975
+ return await runTurn(agent, prompt);
926
976
  } catch (err) {
927
977
  if (isAgentBusyError(err)) {
928
978
  await retryAfterBusy(agent);
929
- return await runTurn(agent);
979
+ return await runTurn(agent, prompt);
930
980
  }
931
981
  if (!isUnresumableCursorSession(err)) throw err;
932
982
  const agentId = agent.agentId;
@@ -945,7 +995,7 @@ async function main() {
945
995
  data: cursorSessionRecoveryMessage(err, agentId)
946
996
  });
947
997
  agent = await createAgent();
948
- return await runTurn(agent);
998
+ return await runTurn(agent, promptForNewSession());
949
999
  }
950
1000
  } finally {
951
1001
  await agent[Symbol.asyncDispose]().catch(() => void 0);
@@ -966,9 +1016,9 @@ async function main() {
966
1016
  }
967
1017
  }
968
1018
  main().then(
969
- (code) => process.exit(code),
1019
+ (code) => exitWhenFlushed(code),
970
1020
  (err) => {
971
1021
  emit({ type: "stderr", data: err instanceof Error ? err.message : String(err) });
972
- process.exit(1);
1022
+ exitWhenFlushed(1);
973
1023
  }
974
1024
  );
@@ -46,7 +46,8 @@ import {
46
46
  resolveCursorSdkRoot,
47
47
  resolveQuotaFallbackAgent,
48
48
  turnCostUsdFromCursorUsage
49
- } from "./chunk-7D5QIU3N.js";
49
+ } from "./chunk-QG4CYRA3.js";
50
+ import "./chunk-5MXLDDYF.js";
50
51
  import {
51
52
  getAgentSetupInfo,
52
53
  installAgent,
@@ -58,14 +59,14 @@ import {
58
59
  prepareTerminalCommand,
59
60
  resolveLoginCommand,
60
61
  whichOnPath
61
- } from "./chunk-MZIZTSR2.js";
62
+ } from "./chunk-MAW7DIG7.js";
63
+ import "./chunk-YGVGXQA7.js";
64
+ import "./chunk-75RPUXJS.js";
62
65
  import "./chunk-6U6QRUHY.js";
63
66
  import "./chunk-E63AM3PW.js";
64
- import "./chunk-2GPQZZLY.js";
65
- import "./chunk-EQ52JR3Q.js";
66
- import "./chunk-ZIRQZUZY.js";
67
- import "./chunk-ROOZDDFA.js";
68
67
  import "./chunk-N2WW62LF.js";
68
+ import "./chunk-2GPQZZLY.js";
69
+ import "./chunk-WUCAVIIP.js";
69
70
  import "./chunk-4YXZOXMT.js";
70
71
  import {
71
72
  conductorBundledBinDir,
@@ -83,12 +84,12 @@ import {
83
84
  assertOrchestratorCapableAgent,
84
85
  coerceOrchestratorAgent,
85
86
  isOrchestratorCapableAgent
86
- } from "./chunk-OIHRC2ZJ.js";
87
+ } from "./chunk-D744HOI5.js";
87
88
  import "./chunk-NSTQ6QKD.js";
88
89
  import "./chunk-WWUABK6B.js";
89
90
  import "./chunk-FJZWM2ON.js";
90
91
  import "./chunk-J2LNLI4S.js";
91
- import "./chunk-B4CDSSRN.js";
92
+ import "./chunk-Q3FHTGIW.js";
92
93
  import "./chunk-WMZIANPV.js";
93
94
  import "./chunk-KGZBYWZ3.js";
94
95
  import "./chunk-WOU343SI.js";
@@ -37,9 +37,7 @@ import {
37
37
  planModeTurnInstruction,
38
38
  resolveCursorModelId,
39
39
  resolveQuotaFallbackAgent
40
- } from "./chunk-JH5SMVM5.js";
41
- import "./chunk-S5CJUIPY.js";
42
- import "./chunk-QIC2JXHW.js";
40
+ } from "./chunk-BBNWKL4I.js";
43
41
  import {
44
42
  getAgentSetupInfo,
45
43
  installAgent,
@@ -51,10 +49,13 @@ import {
51
49
  prepareTerminalCommand,
52
50
  resolveLoginCommand,
53
51
  whichOnPath
54
- } from "./chunk-5GDJSFCT.js";
55
- import "./chunk-JE3JLHMO.js";
56
- import "./chunk-FUFNMUNR.js";
57
- import "./chunk-IFWGG2M2.js";
52
+ } from "./chunk-4H5MWZ6J.js";
53
+ import "./chunk-S5CJUIPY.js";
54
+ import "./chunk-TMCK5TLA.js";
55
+ import "./chunk-OOXRMTU6.js";
56
+ import "./chunk-FWVUGLBG.js";
57
+ import "./chunk-KECHK3ZT.js";
58
+ import "./chunk-ZSHS46V5.js";
58
59
  import "./chunk-QKHEVSB5.js";
59
60
  import "./chunk-RSA47QYR.js";
60
61
  import "./chunk-JAT3JFOS.js";
@@ -67,8 +68,8 @@ import {
67
68
  preferredCursorCostCents,
68
69
  resolveCursorSdkRoot,
69
70
  turnCostUsdFromCursorUsage
70
- } from "./chunk-ZHGMRBSC.js";
71
- import "./chunk-5XNT6BCG.js";
71
+ } from "./chunk-NURZOXGN.js";
72
+ import "./chunk-OPXEJJBM.js";
72
73
  import "./chunk-6K64FJDD.js";
73
74
  import "./chunk-LG6RJBIY.js";
74
75
  import {
@@ -82,13 +83,13 @@ import {
82
83
  resolveCommandBinarySync,
83
84
  withExportedPath
84
85
  } from "./chunk-2TUE6JKQ.js";
85
- import "./chunk-YDUHLWI5.js";
86
+ import "./chunk-SUZOPJZC.js";
86
87
  import {
87
88
  ORCHESTRATOR_AGENT_KINDS,
88
89
  assertOrchestratorCapableAgent,
89
90
  coerceOrchestratorAgent,
90
91
  isOrchestratorCapableAgent
91
- } from "./chunk-EJ66LEKH.js";
92
+ } from "./chunk-QPSKQP6E.js";
92
93
  import "./chunk-77WWLBCI.js";
93
94
  import "./chunk-4TR3HZFT.js";
94
95
  import "./chunk-WDRMZKVB.js";
@@ -107,7 +107,7 @@ import {
107
107
  updateProjectProfileSettings,
108
108
  usageOnLimit,
109
109
  writeViewerContext
110
- } from "./chunk-EJ66LEKH.js";
110
+ } from "./chunk-QPSKQP6E.js";
111
111
  import "./chunk-77WWLBCI.js";
112
112
  import "./chunk-4TR3HZFT.js";
113
113
  import "./chunk-WDRMZKVB.js";
@@ -109,7 +109,7 @@ import {
109
109
  updateProjectProfileSettings,
110
110
  usageOnLimit,
111
111
  writeViewerContext
112
- } from "./chunk-OIHRC2ZJ.js";
112
+ } from "./chunk-D744HOI5.js";
113
113
  import "./chunk-NSTQ6QKD.js";
114
114
  import "./chunk-WWUABK6B.js";
115
115
  import "./chunk-FJZWM2ON.js";