@sideboard-ai/core 0.1.283 → 0.1.285

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 (51) hide show
  1. package/dist/{abletime-WLDBJJUI.js → abletime-4CH2IOX5.js} +4 -4
  2. package/dist/{abletime-X64E3GUJ.js → abletime-I4RODUKT.js} +4 -4
  3. package/dist/{abletime-oauth-AXR676W5.js → abletime-oauth-7OZZ3ABX.js} +3 -3
  4. package/dist/{abletime-oauth-UWOCEICP.js → abletime-oauth-C2HN2Q6F.js} +3 -3
  5. package/dist/{abletime-rest-S4XWEXV2.js → abletime-rest-E4LBRFLM.js} +3 -3
  6. package/dist/{abletime-rest-LPUDJUEP.js → abletime-rest-WFI2HWBU.js} +3 -3
  7. package/dist/agents/cursor-runner.cjs +54 -14
  8. package/dist/agents/cursor-runner.js +51 -14
  9. package/dist/{agents-XA2E64AW.js → agents-FKMYAKFD.js} +5 -5
  10. package/dist/{agents-2IE4HKHA.js → agents-ITNCZ6CA.js} +7 -7
  11. package/dist/chunk-2GPQZZLY.js +59 -0
  12. package/dist/{chunk-BYZ7F2BQ.js → chunk-2K723QZH.js} +12 -10
  13. package/dist/{chunk-ROPGQRPU.js → chunk-33KDPEK4.js} +1 -1
  14. package/dist/{chunk-W7HIK2A6.js → chunk-5QOLFOAX.js} +19 -3
  15. package/dist/{chunk-I6HSGKMZ.js → chunk-5T4YWFLD.js} +2 -2
  16. package/dist/{chunk-U7HAVAGJ.js → chunk-6CVVNAIU.js} +2 -2
  17. package/dist/{chunk-TQRSVE7D.js → chunk-7IAMHN2N.js} +1 -1
  18. package/dist/{chunk-DQZPF6WL.js → chunk-BMUVNTT4.js} +3 -3
  19. package/dist/{chunk-2KNO2GJQ.js → chunk-C6NVTLZK.js} +16 -14
  20. package/dist/{chunk-VA55JG2I.js → chunk-DEJALWKM.js} +5 -5
  21. package/dist/{chunk-XTPQEZZA.js → chunk-IJMUYHPT.js} +3 -3
  22. package/dist/chunk-JAT3JFOS.js +61 -0
  23. package/dist/{chunk-EIEAR62M.js → chunk-LMWPVC5L.js} +2 -2
  24. package/dist/{chunk-DGPROCE5.js → chunk-LS4FFCPL.js} +3 -3
  25. package/dist/{chunk-P2BSMNHB.js → chunk-PXMLMBMI.js} +1 -1
  26. package/dist/{chunk-UZUXWBXK.js → chunk-S2OOM7AU.js} +1 -1
  27. package/dist/{chunk-BS3QLVPL.js → chunk-TMM4FEZ5.js} +3 -3
  28. package/dist/{chunk-ADXVTKLC.js → chunk-TXHZJESB.js} +4 -4
  29. package/dist/{chunk-K2S33ZCB.js → chunk-U6QDXT4K.js} +20 -4
  30. package/dist/{chunk-GWFVCCJZ.js → chunk-VGNLMGBK.js} +6 -6
  31. package/dist/{chunk-IFURHRAR.js → chunk-VOIWX5HA.js} +1 -1
  32. package/dist/{chunk-PY4UCMRI.js → chunk-VQEARG5H.js} +5 -5
  33. package/dist/{chunk-BDAUPNHL.js → chunk-XSDCLM3F.js} +1 -1
  34. package/dist/{chunk-OCUIZD4Y.js → chunk-XSPOJFTV.js} +6 -6
  35. package/dist/{conductor-U776JSXQ.js → conductor-GBX6LSP2.js} +3 -3
  36. package/dist/{conductor-CNSCOC54.js → conductor-MU3TYVCD.js} +2 -2
  37. package/dist/{connected-teams-JIUOSZ6C.js → connected-teams-AB7ZHJVO.js} +3 -3
  38. package/dist/{connected-teams-RU6VATCM.js → connected-teams-BJ6PMIST.js} +3 -3
  39. package/dist/index.cjs +241 -120
  40. package/dist/index.d.cts +11 -4
  41. package/dist/index.d.ts +11 -4
  42. package/dist/index.js +176 -101
  43. package/dist/mcp/run-stdio.cjs +68 -25
  44. package/dist/mcp/run-stdio.js +10 -10
  45. package/dist/{oauth-S3M7B475.js → oauth-DP4ZV2M2.js} +2 -2
  46. package/dist/{oauth-K6CWZEQO.js → oauth-WCUZ6Z5G.js} +2 -2
  47. package/dist/{orchestrator-FPGVKEID.js → orchestrator-F7KXYDQW.js} +9 -9
  48. package/dist/{orchestrator-HWJHK5NL.js → orchestrator-VUIRO6NC.js} +7 -7
  49. package/package.json +1 -1
  50. package/dist/chunk-N7WZ6NIN.js +0 -41
  51. package/dist/chunk-VKQGAWHY.js +0 -40
@@ -2,7 +2,7 @@ import {
2
2
  compactSummaryPart,
3
3
  isInternalAgentStatusText,
4
4
  lastAssistantMessageText
5
- } from "./chunk-BDAUPNHL.js";
5
+ } from "./chunk-XSDCLM3F.js";
6
6
  import {
7
7
  isCloudCoordinatorThread,
8
8
  isGlobalThread,
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-2P4XKWV2.js";
30
30
  import {
31
31
  clipToolResultForStore
32
- } from "./chunk-K2S33ZCB.js";
32
+ } from "./chunk-U6QDXT4K.js";
33
33
  import {
34
34
  ATTACHMENTS_DIR,
35
35
  DETACHED_JOBS_DIR,
@@ -1776,7 +1776,7 @@ var PORT_RANGE_SIZE = 10;
1776
1776
  var RECLAIM_RETRY_DELAY_MS = 40;
1777
1777
  var RECLAIM_TRIES = 8;
1778
1778
  async function killReclaimable(ports, worktreePath, signal) {
1779
- const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-U776JSXQ.js");
1779
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-GBX6LSP2.js");
1780
1780
  if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
1781
1781
  else killListenersOnPorts2(ports);
1782
1782
  }
@@ -8,7 +8,7 @@ import {
8
8
  parseSessionQuotaResetAt,
9
9
  planModeTurnInstruction,
10
10
  resolveQuotaFallbackAgent
11
- } from "./chunk-OCUIZD4Y.js";
11
+ } from "./chunk-XSPOJFTV.js";
12
12
  import {
13
13
  REVIEW_TAB_TITLE,
14
14
  applyWorktreePkgCacheEnv,
@@ -47,7 +47,7 @@ import {
47
47
  worktreeDevProcessKey,
48
48
  worktreeRunProcessKey,
49
49
  worktreeSetupProcessKey
50
- } from "./chunk-DQZPF6WL.js";
50
+ } from "./chunk-BMUVNTT4.js";
51
51
  import {
52
52
  applyAgentEvent,
53
53
  clipAgentEventForPaint,
@@ -62,7 +62,7 @@ import {
62
62
  partsToAssistantText,
63
63
  stripBrightsyNdjsonNoise,
64
64
  toolDescription
65
- } from "./chunk-BDAUPNHL.js";
65
+ } from "./chunk-XSDCLM3F.js";
66
66
  import {
67
67
  titleFromPrompt
68
68
  } from "./chunk-7H655NEW.js";
@@ -164,14 +164,14 @@ import {
164
164
  } from "./chunk-N5UGX3JL.js";
165
165
  import {
166
166
  httpFetch
167
- } from "./chunk-N7WZ6NIN.js";
167
+ } from "./chunk-JAT3JFOS.js";
168
168
  import {
169
169
  createAgentStreamCoalescer
170
170
  } from "./chunk-AXQ4ZWHK.js";
171
171
  import {
172
172
  applyAgentRunnerHeapEnv,
173
173
  packagedMcpDir
174
- } from "./chunk-IFURHRAR.js";
174
+ } from "./chunk-VOIWX5HA.js";
175
175
  import {
176
176
  fallbackTurnFailDetail,
177
177
  formatAgentErrorContinuePrompt,
@@ -179,13 +179,14 @@ import {
179
179
  looksLikeAgentFailureMessage,
180
180
  looksLikeInvalidAgentSession,
181
181
  looksLikeV8Oom,
182
+ nextCrashContinueCount,
182
183
  pushTurnStderr,
183
184
  shouldFeedErrorBackToAgent,
184
185
  shouldRetryCodexPluginIsolate,
185
186
  shouldRetryFailedAgentTurn,
186
187
  summarizeTurnStderr,
187
188
  turnFailChatText
188
- } from "./chunk-K2S33ZCB.js";
189
+ } from "./chunk-U6QDXT4K.js";
189
190
  import {
190
191
  clearStaleIndexLocks,
191
192
  enrichPathWithNpmGlobalBin,
@@ -2627,7 +2628,7 @@ async function createThread(input, _onSetupLine) {
2627
2628
  let sourceIsFork = false;
2628
2629
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
2629
2630
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
2630
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-X64E3GUJ.js");
2631
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-I4RODUKT.js");
2631
2632
  const task = await ensureAbleTimeTask({
2632
2633
  title: title?.trim() || "Untitled work",
2633
2634
  description: input.prompt?.trim() || void 0
@@ -2738,7 +2739,7 @@ async function createThread(input, _onSetupLine) {
2738
2739
  return readThread(thread.id) ?? thread;
2739
2740
  }
2740
2741
  async function listLinearIssues(agent, repoPath) {
2741
- const { getAdapter: getAdapter2 } = await import("./agents-2IE4HKHA.js");
2742
+ const { getAdapter: getAdapter2 } = await import("./agents-ITNCZ6CA.js");
2742
2743
  await requireAgent(agent, { requireLinear: true });
2743
2744
  const adapter = getAdapter2(agent);
2744
2745
  if (!adapter.listLinearIssues) {
@@ -6435,7 +6436,7 @@ function formatScheduledPrompt(name, prompt) {
6435
6436
  ${prompt}`;
6436
6437
  }
6437
6438
  async function defaultDeps() {
6438
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-FPGVKEID.js");
6439
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-F7KXYDQW.js");
6439
6440
  const orch = getOrchestrator2();
6440
6441
  return {
6441
6442
  findThread: (id) => findThreadByRef(id),
@@ -6603,10 +6604,10 @@ var Orchestrator = class {
6603
6604
  /** Timers for orchestration session-quota auto-resume. */
6604
6605
  quotaResumeTimers = /* @__PURE__ */ new Map();
6605
6606
  /**
6606
- * Threads that already got a crash-continue turn. Cleared on a successful
6607
- * finish or a user send so a later crash can recover again.
6607
+ * Crash-continue count per thread. Cleared on a successful finish or a user
6608
+ * send. Stream cutoffs may resume more than once; other crashes once.
6608
6609
  */
6609
- crashContinued = /* @__PURE__ */ new Set();
6610
+ crashContinued = /* @__PURE__ */ new Map();
6610
6611
  /** Auto-continues after a worktree turn ended while a detached job still runs. */
6611
6612
  jobContinueCount = /* @__PURE__ */ new Map();
6612
6613
  jobContinueNudged = /* @__PURE__ */ new Set();
@@ -7045,7 +7046,6 @@ var Orchestrator = class {
7045
7046
  * next prompt so the same agent can continue instead of sitting on lastError.
7046
7047
  */
7047
7048
  maybeEnqueueCrashContinue(threadId, opts) {
7048
- if (this.crashContinued.has(threadId)) return;
7049
7049
  if (this.haltDrain.has(threadId)) return;
7050
7050
  if (!shouldFeedErrorBackToAgent({
7051
7051
  detail: opts.detail,
@@ -7054,9 +7054,11 @@ var Orchestrator = class {
7054
7054
  })) {
7055
7055
  return;
7056
7056
  }
7057
+ const resumeCount = nextCrashContinueCount(opts.detail, this.crashContinued.get(threadId) ?? 0);
7058
+ if (resumeCount == null) return;
7057
7059
  const thread = readThread(threadId);
7058
7060
  if (!thread || thread.status === "archived") return;
7059
- this.crashContinued.add(threadId);
7061
+ this.crashContinued.set(threadId, resumeCount);
7060
7062
  const prompt = formatAgentErrorContinuePrompt(opts.detail);
7061
7063
  const next = prependQueuedItem(thread.queue, thread.queueAttachments, prompt);
7062
7064
  updateThread(threadId, next);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  httpFetch
3
- } from "./chunk-N7WZ6NIN.js";
3
+ } from "./chunk-JAT3JFOS.js";
4
4
  import {
5
5
  getAbleTimeHost,
6
6
  isAbleTimeConnected
@@ -153,7 +153,7 @@ function textsFromUnknown(value) {
153
153
  return "";
154
154
  }
155
155
  async function abletimeMcpRequest(method, params, opts) {
156
- const rawToken = opts?.token ?? await import("./abletime-oauth-UWOCEICP.js").then((m) => m.ensureAbleTimeAccessToken());
156
+ const rawToken = opts?.token ?? await import("./abletime-oauth-C2HN2Q6F.js").then((m) => m.ensureAbleTimeAccessToken());
157
157
  if (!rawToken?.trim()) {
158
158
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
159
159
  }
@@ -224,9 +224,9 @@ async function callAbleTimeTool(name, args = {}, opts) {
224
224
  if (!opts?.token && !isAbleTimeConnected()) {
225
225
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
226
226
  }
227
- const rawToken = opts?.token ?? await import("./abletime-oauth-UWOCEICP.js").then((m) => m.ensureAbleTimeAccessToken());
227
+ const rawToken = opts?.token ?? await import("./abletime-oauth-C2HN2Q6F.js").then((m) => m.ensureAbleTimeAccessToken());
228
228
  if (rawToken && ableTimeUsesRest(rawToken)) {
229
- const { callAbleTimeRestTool } = await import("./abletime-rest-S4XWEXV2.js");
229
+ const { callAbleTimeRestTool } = await import("./abletime-rest-E4LBRFLM.js");
230
230
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
231
231
  }
232
232
  const requestOpts = { ...opts, pm: opts?.pm ?? abletimeToolUsesPm(name) };
@@ -242,7 +242,7 @@ async function callAbleTimeTool(name, args = {}, opts) {
242
242
  return await call();
243
243
  }
244
244
  if (rawToken && ableTimeUsesRest(rawToken) && isAbleTimeRejectedCredential(message)) {
245
- const { callAbleTimeRestTool } = await import("./abletime-rest-S4XWEXV2.js");
245
+ const { callAbleTimeRestTool } = await import("./abletime-rest-E4LBRFLM.js");
246
246
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
247
247
  }
248
248
  throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DEFAULT_ABLETIME_HOST,
3
3
  normalizeAbleTimeHost
4
- } from "./chunk-VA55JG2I.js";
4
+ } from "./chunk-DEJALWKM.js";
5
5
  import {
6
6
  httpFetch
7
- } from "./chunk-N7WZ6NIN.js";
7
+ } from "./chunk-JAT3JFOS.js";
8
8
  import {
9
9
  disconnectAbleTimeConnection,
10
10
  getAbleTimeHost,
@@ -280,7 +280,7 @@ async function startAbleTimeOAuth(opts) {
280
280
  persistAbleTimeTokens(data, { host });
281
281
  const token = data.access_token.trim();
282
282
  try {
283
- const { getAbleTimeOrientation } = await import("./abletime-X64E3GUJ.js");
283
+ const { getAbleTimeOrientation } = await import("./abletime-I4RODUKT.js");
284
284
  const orientation = await getAbleTimeOrientation({ token, host });
285
285
  return saveAbleTimeConnection({
286
286
  accessToken: token,
@@ -0,0 +1,61 @@
1
+ // src/http/fetch.ts
2
+ var injected = null;
3
+ function setHttpFetchImpl(fetchImpl) {
4
+ injected = fetchImpl;
5
+ }
6
+ var TLS_ISSUER_RE = /UNABLE_TO_GET_ISSUER_CERT|UNABLE_TO_VERIFY_LEAF_SIGNATURE|SELF_SIGNED_CERT_IN_CHAIN/i;
7
+ var TLS_ISSUER_HINT = " \u2014 Node rejected the TLS certificate (corporate VPN/proxy CA). Desktop Linear can still work; reconnecting the API key will not fix this.";
8
+ function isTlsIssuerFailure(code, message) {
9
+ return TLS_ISSUER_RE.test(`${code ?? ""} ${message}`);
10
+ }
11
+ function describeCause(cause, depth = 0) {
12
+ if (depth > 5 || cause == null) return null;
13
+ if (cause instanceof AggregateError) {
14
+ for (const item of cause.errors) {
15
+ const found = describeCause(item, depth + 1);
16
+ if (found && (found.code || found.message)) return found;
17
+ }
18
+ return cause.message ? { message: cause.message } : null;
19
+ }
20
+ if (cause instanceof Error) {
21
+ const code = typeof cause.code === "string" ? cause.code : void 0;
22
+ const nested = describeCause(cause.cause, depth + 1);
23
+ if ((!cause.message || cause.message === "fetch failed") && nested) return nested;
24
+ if (cause.message || code) return { code, message: cause.message };
25
+ return nested;
26
+ }
27
+ return { message: String(cause) };
28
+ }
29
+ function causeSuffix(detail) {
30
+ if (!detail) return "";
31
+ if (detail.code && detail.message) return ` [${detail.code}: ${detail.message}]`;
32
+ if (detail.code) return ` [${detail.code}]`;
33
+ if (detail.message) return ` [${detail.message}]`;
34
+ return "";
35
+ }
36
+ function formatFetchError(err, url, opts) {
37
+ if (!(err instanceof Error)) return `${String(err)} (${url})`;
38
+ const detail = describeCause(err.cause);
39
+ const hintSource = `${err.message} ${detail?.code ?? ""} ${detail?.message ?? ""}`;
40
+ const tls = isTlsIssuerFailure(detail?.code, hintSource);
41
+ const hint = tls ? opts?.tlsHint ?? TLS_ISSUER_HINT : "";
42
+ return `${err.message}${causeSuffix(detail)} (${url})${hint}`;
43
+ }
44
+ function currentHttpFetch() {
45
+ return injected ?? globalThis.fetch.bind(globalThis);
46
+ }
47
+ async function httpFetch(input, init) {
48
+ const url = typeof input === "string" ? input : input.href;
49
+ try {
50
+ return await currentHttpFetch()(url, init);
51
+ } catch (err) {
52
+ throw new Error(formatFetchError(err, url));
53
+ }
54
+ }
55
+
56
+ export {
57
+ setHttpFetchImpl,
58
+ formatFetchError,
59
+ currentHttpFetch,
60
+ httpFetch
61
+ };
@@ -5,7 +5,7 @@ import {
5
5
  compactSummaryPart,
6
6
  isInternalAgentStatusText,
7
7
  lastAssistantMessageText
8
- } from "./chunk-W7HIK2A6.js";
8
+ } from "./chunk-5QOLFOAX.js";
9
9
  import {
10
10
  isCloudCoordinatorThread,
11
11
  isGlobalThread,
@@ -1674,7 +1674,7 @@ var PORT_RANGE_SIZE = 10;
1674
1674
  var RECLAIM_RETRY_DELAY_MS = 40;
1675
1675
  var RECLAIM_TRIES = 8;
1676
1676
  async function killReclaimable(ports, worktreePath, signal) {
1677
- const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-CNSCOC54.js");
1677
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-MU3TYVCD.js");
1678
1678
  if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
1679
1679
  else killListenersOnPorts2(ports);
1680
1680
  }
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  abletimeRestUrl,
3
3
  textFromAbleTimeDoc
4
- } from "./chunk-U7HAVAGJ.js";
4
+ } from "./chunk-6CVVNAIU.js";
5
5
  import {
6
6
  assertAbleTimeCredential,
7
7
  callAbleTimeTool,
8
8
  normalizeAbleTimeHost,
9
9
  rewriteAbleTimeError
10
- } from "./chunk-VA55JG2I.js";
10
+ } from "./chunk-DEJALWKM.js";
11
11
  import {
12
12
  httpFetch
13
- } from "./chunk-N7WZ6NIN.js";
13
+ } from "./chunk-JAT3JFOS.js";
14
14
  import {
15
15
  ATTACHMENTS_DIR,
16
16
  attachmentsGitignoreBody
@@ -2,7 +2,7 @@
2
2
 
3
3
  import {
4
4
  formatFetchError
5
- } from "./chunk-VKQGAWHY.js";
5
+ } from "./chunk-2GPQZZLY.js";
6
6
 
7
7
  // src/brightsy/config.ts
8
8
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  clipToolResultForStore,
3
3
  looksLikeHugeToolResultDump
4
- } from "./chunk-K2S33ZCB.js";
4
+ } from "./chunk-U6QDXT4K.js";
5
5
  import {
6
6
  CLI_DIR
7
7
  } from "./chunk-6K64FJDD.js";
@@ -3,16 +3,16 @@
3
3
  import {
4
4
  abletimeRestUrl,
5
5
  textFromAbleTimeDoc
6
- } from "./chunk-I6HSGKMZ.js";
6
+ } from "./chunk-5T4YWFLD.js";
7
7
  import {
8
8
  assertAbleTimeCredential,
9
9
  callAbleTimeTool,
10
10
  normalizeAbleTimeHost,
11
11
  rewriteAbleTimeError
12
- } from "./chunk-PY4UCMRI.js";
12
+ } from "./chunk-VQEARG5H.js";
13
13
  import {
14
14
  httpFetch
15
- } from "./chunk-VKQGAWHY.js";
15
+ } from "./chunk-2GPQZZLY.js";
16
16
  import {
17
17
  ATTACHMENTS_DIR,
18
18
  attachmentsGitignoreBody
@@ -5,13 +5,13 @@ import {
5
5
  brightsyMcpServerName,
6
6
  ensureCliTeamTracked,
7
7
  ensureConnectedBrightsyTeamTokens
8
- } from "./chunk-TQRSVE7D.js";
8
+ } from "./chunk-7IAMHN2N.js";
9
9
  import {
10
10
  loadBrightsyConfig
11
- } from "./chunk-P2BSMNHB.js";
11
+ } from "./chunk-PXMLMBMI.js";
12
12
  import {
13
13
  httpFetch
14
- } from "./chunk-VKQGAWHY.js";
14
+ } from "./chunk-2GPQZZLY.js";
15
15
  import {
16
16
  extractJsonErrorMessage,
17
17
  formatUnknownDetail,
@@ -21,7 +21,7 @@ import {
21
21
  looksLikeSkillBody,
22
22
  skillCommandFromBody,
23
23
  withEventParentId
24
- } from "./chunk-W7HIK2A6.js";
24
+ } from "./chunk-5QOLFOAX.js";
25
25
  import {
26
26
  isOrchestratorThread
27
27
  } from "./chunk-2SJXQ4UX.js";
@@ -1,3 +1,21 @@
1
+ // src/agents/cursor-stream-cutoff.ts
2
+ var CURSOR_STREAM_CUTOFF = /nghttp2|premature close|\[unavailable\]\s+error\b|http\/2 stream closed|\bcancel \(0x8\)|error code cancel\b/i;
3
+ var CURSOR_STREAM_CUTOFF_CONTINUE_LIMIT = 3;
4
+ function looksLikeCursorStreamCutOff(text) {
5
+ return CURSOR_STREAM_CUTOFF.test(text.trim());
6
+ }
7
+ function cursorStreamCutOffContinueLimit(detail) {
8
+ if (looksLikeCursorStreamCutOff(detail) || /connection stalled/i.test(detail)) {
9
+ return CURSOR_STREAM_CUTOFF_CONTINUE_LIMIT;
10
+ }
11
+ return null;
12
+ }
13
+ function nextCrashContinueCount(detail, used) {
14
+ const limit = cursorStreamCutOffContinueLimit(detail) ?? 1;
15
+ if (used >= limit) return null;
16
+ return used + 1;
17
+ }
18
+
1
19
  // src/agents/error-detail.ts
2
20
  function formatUnknownDetail(err) {
3
21
  if (err == null) return "";
@@ -196,9 +214,6 @@ function looksLikeInvalidAgentSession(text) {
196
214
  if (!lower) return false;
197
215
  return /session not found/.test(lower) || /no conversation found/.test(lower) || /conversation .+ not found/.test(lower) || /thread .+ not found/.test(lower) || /unknown session/.test(lower) || /invalid session/.test(lower) || /session .+ (missing|expired|deleted|gone)/.test(lower) || /cannot resume/.test(lower) || /failed to (load|resume|open) session/.test(lower) || /corrupt local agent checkpoint/.test(lower) || /missing root blob/.test(lower) || /\bagent\b.{0,120}\bnot found\b/.test(lower) || /\brun\b.{0,80}\bnot found for agent\b/.test(lower);
198
216
  }
199
- function looksLikeCursorStreamCutOff(text) {
200
- return /nghttp2|premature close|\[unavailable\]\s+error\b/i.test(text.trim());
201
- }
202
217
  function looksLikeBrightsyEmptyCompletion(text) {
203
218
  const core = text.trim().replace(/^exit\s*\d+:\s*/i, "").replace(/^error:\s*/i, "").trim();
204
219
  return /^i did not receive a valid model response\. please try again\.$/i.test(core);
@@ -370,6 +385,8 @@ function formatTurnExitError(exitCode, stderrSummary) {
370
385
  }
371
386
 
372
387
  export {
388
+ looksLikeCursorStreamCutOff,
389
+ nextCrashContinueCount,
373
390
  formatUnknownDetail,
374
391
  extractJsonErrorMessage,
375
392
  pushTurnStderr,
@@ -379,7 +396,6 @@ export {
379
396
  TOOL_RESULT_STORE_MAX_CHARS,
380
397
  summarizeTurnStderr,
381
398
  looksLikeInvalidAgentSession,
382
- looksLikeCursorStreamCutOff,
383
399
  looksLikeBrightsyEmptyCompletion,
384
400
  shouldRetryFailedAgentTurn,
385
401
  looksLikeAgentFailureMessage,
@@ -5,7 +5,7 @@ import {
5
5
  loadBrightsyConfig,
6
6
  refreshBrightsyAccessToken,
7
7
  saveBrightsyConfig
8
- } from "./chunk-ROPGQRPU.js";
8
+ } from "./chunk-33KDPEK4.js";
9
9
  import {
10
10
  run
11
11
  } from "./chunk-QVN2WOKJ.js";
@@ -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-RU6VATCM.js");
22
+ const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-BJ6PMIST.js");
23
23
  return listConnectedBrightsyTeams2();
24
24
  }
25
25
  async function runBrightsyTeamsJson(args) {
@@ -47,15 +47,15 @@ async function listBrightsyAccounts() {
47
47
  }
48
48
  async function getBrightsySession() {
49
49
  try {
50
- const { ensureBrightsyLocalConfigFresh: ensureBrightsyLocalConfigFresh2 } = await import("./oauth-S3M7B475.js");
51
- const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-RU6VATCM.js");
50
+ const { ensureBrightsyLocalConfigFresh: ensureBrightsyLocalConfigFresh2 } = await import("./oauth-DP4ZV2M2.js");
51
+ const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-BJ6PMIST.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-RU6VATCM.js");
58
+ const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-BJ6PMIST.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-RU6VATCM.js");
98
+ const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-BJ6PMIST.js");
99
99
  await connectBrightsyTeam2(accountIdOrSlug);
100
100
  return getBrightsySession();
101
101
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  extractJsonErrorMessage,
3
3
  formatUnknownDetail
4
- } from "./chunk-K2S33ZCB.js";
4
+ } from "./chunk-U6QDXT4K.js";
5
5
  import {
6
6
  npmGlobalNodeModules,
7
7
  run
@@ -2,7 +2,7 @@
2
2
 
3
3
  import {
4
4
  httpFetch
5
- } from "./chunk-VKQGAWHY.js";
5
+ } from "./chunk-2GPQZZLY.js";
6
6
  import {
7
7
  getAbleTimeHost,
8
8
  isAbleTimeConnected
@@ -155,7 +155,7 @@ function textsFromUnknown(value) {
155
155
  return "";
156
156
  }
157
157
  async function abletimeMcpRequest(method, params, opts) {
158
- const rawToken = opts?.token ?? await import("./abletime-oauth-AXR676W5.js").then((m) => m.ensureAbleTimeAccessToken());
158
+ const rawToken = opts?.token ?? await import("./abletime-oauth-7OZZ3ABX.js").then((m) => m.ensureAbleTimeAccessToken());
159
159
  if (!rawToken?.trim()) {
160
160
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
161
161
  }
@@ -226,9 +226,9 @@ async function callAbleTimeTool(name, args = {}, opts) {
226
226
  if (!opts?.token && !isAbleTimeConnected()) {
227
227
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
228
228
  }
229
- const rawToken = opts?.token ?? await import("./abletime-oauth-AXR676W5.js").then((m) => m.ensureAbleTimeAccessToken());
229
+ const rawToken = opts?.token ?? await import("./abletime-oauth-7OZZ3ABX.js").then((m) => m.ensureAbleTimeAccessToken());
230
230
  if (rawToken && ableTimeUsesRest(rawToken)) {
231
- const { callAbleTimeRestTool } = await import("./abletime-rest-LPUDJUEP.js");
231
+ const { callAbleTimeRestTool } = await import("./abletime-rest-WFI2HWBU.js");
232
232
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
233
233
  }
234
234
  const requestOpts = { ...opts, pm: opts?.pm ?? abletimeToolUsesPm(name) };
@@ -244,7 +244,7 @@ async function callAbleTimeTool(name, args = {}, opts) {
244
244
  return await call();
245
245
  }
246
246
  if (rawToken && ableTimeUsesRest(rawToken) && isAbleTimeRejectedCredential(message)) {
247
- const { callAbleTimeRestTool } = await import("./abletime-rest-LPUDJUEP.js");
247
+ const { callAbleTimeRestTool } = await import("./abletime-rest-WFI2HWBU.js");
248
248
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
249
249
  }
250
250
  throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clipToolResultForStore
3
- } from "./chunk-K2S33ZCB.js";
3
+ } from "./chunk-U6QDXT4K.js";
4
4
 
5
5
  // src/agents/message-parts.ts
6
6
  function asRecord(input) {
@@ -3,13 +3,13 @@ import {
3
3
  brightsyMcpServerName,
4
4
  ensureCliTeamTracked,
5
5
  ensureConnectedBrightsyTeamTokens
6
- } from "./chunk-GWFVCCJZ.js";
6
+ } from "./chunk-VGNLMGBK.js";
7
7
  import {
8
8
  looksLikeConversationSummary,
9
9
  looksLikeSkillBody,
10
10
  skillCommandFromBody,
11
11
  withEventParentId
12
- } from "./chunk-BDAUPNHL.js";
12
+ } from "./chunk-XSDCLM3F.js";
13
13
  import {
14
14
  isOrchestratorThread
15
15
  } from "./chunk-WY2IAB7J.js";
@@ -21,10 +21,10 @@ import {
21
21
  } from "./chunk-K5XSTHHP.js";
22
22
  import {
23
23
  loadBrightsyConfig
24
- } from "./chunk-ROPGQRPU.js";
24
+ } from "./chunk-33KDPEK4.js";
25
25
  import {
26
26
  httpFetch
27
- } from "./chunk-N7WZ6NIN.js";
27
+ } from "./chunk-JAT3JFOS.js";
28
28
  import {
29
29
  CURSOR_SDK_INSTALL_HINT,
30
30
  applyAgentRunnerHeapEnv,
@@ -38,13 +38,13 @@ import {
38
38
  packagedMcpStdioPath,
39
39
  parseCursorRunnerLine,
40
40
  resolveNodeLaunch
41
- } from "./chunk-IFURHRAR.js";
41
+ } from "./chunk-VOIWX5HA.js";
42
42
  import {
43
43
  extractJsonErrorMessage,
44
44
  formatUnknownDetail,
45
45
  looksLikeAgentFailureMessage,
46
46
  looksLikeBrightsyEmptyCompletion
47
- } from "./chunk-K2S33ZCB.js";
47
+ } from "./chunk-U6QDXT4K.js";
48
48
  import {
49
49
  enrichPathWithNpmGlobalBin,
50
50
  isConductorBundledCli,
@@ -31,13 +31,13 @@ import {
31
31
  tryReservePort,
32
32
  tryReservePorts,
33
33
  worktreeRunPortsPath
34
- } from "./chunk-DQZPF6WL.js";
35
- import "./chunk-BDAUPNHL.js";
34
+ } from "./chunk-BMUVNTT4.js";
35
+ import "./chunk-XSDCLM3F.js";
36
36
  import "./chunk-WY2IAB7J.js";
37
37
  import "./chunk-K5XSTHHP.js";
38
38
  import "./chunk-N5UGX3JL.js";
39
39
  import "./chunk-2P4XKWV2.js";
40
- import "./chunk-K2S33ZCB.js";
40
+ import "./chunk-U6QDXT4K.js";
41
41
  import "./chunk-6K64FJDD.js";
42
42
  import "./chunk-UWQ6UCIB.js";
43
43
  import "./chunk-QVN2WOKJ.js";
@@ -33,8 +33,8 @@ import {
33
33
  tryReservePort,
34
34
  tryReservePorts,
35
35
  worktreeRunPortsPath
36
- } from "./chunk-EIEAR62M.js";
37
- import "./chunk-W7HIK2A6.js";
36
+ } from "./chunk-LMWPVC5L.js";
37
+ import "./chunk-5QOLFOAX.js";
38
38
  import "./chunk-2SJXQ4UX.js";
39
39
  import "./chunk-5MGLNVNK.js";
40
40
  import "./chunk-N2WW62LF.js";
@@ -9,9 +9,9 @@ import {
9
9
  ensureConnectedBrightsyTeamTokens,
10
10
  getConnectedBrightsyTeamsRaw,
11
11
  listConnectedBrightsyTeams
12
- } from "./chunk-TQRSVE7D.js";
13
- import "./chunk-P2BSMNHB.js";
14
- import "./chunk-VKQGAWHY.js";
12
+ } from "./chunk-7IAMHN2N.js";
13
+ import "./chunk-PXMLMBMI.js";
14
+ import "./chunk-2GPQZZLY.js";
15
15
  import "./chunk-2UG25RMK.js";
16
16
  import "./chunk-WWUABK6B.js";
17
17
  import "./chunk-H5XL4KUS.js";
@@ -7,9 +7,9 @@ import {
7
7
  ensureConnectedBrightsyTeamTokens,
8
8
  getConnectedBrightsyTeamsRaw,
9
9
  listConnectedBrightsyTeams
10
- } from "./chunk-GWFVCCJZ.js";
11
- import "./chunk-ROPGQRPU.js";
12
- import "./chunk-N7WZ6NIN.js";
10
+ } from "./chunk-VGNLMGBK.js";
11
+ import "./chunk-33KDPEK4.js";
12
+ import "./chunk-JAT3JFOS.js";
13
13
  import "./chunk-QVN2WOKJ.js";
14
14
  import "./chunk-4TR3HZFT.js";
15
15
  import "./chunk-EHT2DRT4.js";