@sideboard-ai/core 0.1.208 → 0.1.209

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-I4IYZBKU.js → abletime-G3MWSZVM.js} +4 -4
  2. package/dist/{abletime-UWSSLXH3.js → abletime-SQREWITG.js} +4 -4
  3. package/dist/{abletime-oauth-UZHPB3W2.js → abletime-oauth-7AOE4KJL.js} +3 -3
  4. package/dist/{abletime-oauth-C3BQXKW3.js → abletime-oauth-SQD6K47H.js} +3 -3
  5. package/dist/{abletime-rest-5YPPEOKK.js → abletime-rest-BXL7QHCX.js} +3 -3
  6. package/dist/{abletime-rest-HYNYDYK3.js → abletime-rest-QRTJH42S.js} +3 -3
  7. package/dist/agents/cursor-runner.js +3 -3
  8. package/dist/{agents-QHQXR55O.js → agents-KA6HDNNP.js} +6 -5
  9. package/dist/{agents-CCS5IEBV.js → agents-U2NVCYGC.js} +6 -5
  10. package/dist/{app-settings-R2KNCT37.js → app-settings-6SZLZNA7.js} +7 -1
  11. package/dist/{app-settings-GJ6KDYEF.js → app-settings-VBQHGX5Z.js} +7 -1
  12. package/dist/{chunk-OP6CFVTB.js → chunk-22A45QOI.js} +2 -2
  13. package/dist/{chunk-NJ2CCLV6.js → chunk-42VGWRSE.js} +2 -2
  14. package/dist/{chunk-X45BV4VX.js → chunk-5LFD3KCJ.js} +5 -5
  15. package/dist/{chunk-F4LZUEIO.js → chunk-B2RPIHNJ.js} +2 -2
  16. package/dist/{chunk-6YZLSZLK.js → chunk-CQZCXRVG.js} +3 -3
  17. package/dist/{chunk-4EGK47WV.js → chunk-FUC3XFE2.js} +215 -0
  18. package/dist/{chunk-C6ZNQV5W.js → chunk-HBL7ILQA.js} +117 -25
  19. package/dist/{chunk-TEDEVD4O.js → chunk-IIENQFJ6.js} +2 -2
  20. package/dist/{chunk-6J4OQ6TF.js → chunk-IOOL3T7Q.js} +3 -3
  21. package/dist/{chunk-A6SOSLUV.js → chunk-KJAHVQL6.js} +24 -94
  22. package/dist/{chunk-7PEIIN7P.js → chunk-MS2P5GXL.js} +24 -87
  23. package/dist/{chunk-C5MNMITQ.js → chunk-MZP2C4KE.js} +119 -25
  24. package/dist/{chunk-7DKX5JLT.js → chunk-OY7THBLG.js} +10 -2
  25. package/dist/{chunk-DNTPX6HV.js → chunk-PTOIWKDU.js} +3 -3
  26. package/dist/{chunk-W6X4GZJG.js → chunk-QVVJO4GN.js} +3 -3
  27. package/dist/{chunk-ZHCB4CKR.js → chunk-RPZFNKND.js} +10 -2
  28. package/dist/{chunk-HA4EZKFY.js → chunk-TZCWNRMC.js} +3 -3
  29. package/dist/{chunk-Y4CF7LHH.js → chunk-VJQDUD24.js} +230 -0
  30. package/dist/chunk-X5B3OS5I.js +34 -0
  31. package/dist/{chunk-WXWJ5MJ4.js → chunk-XRIF6M5H.js} +5 -5
  32. package/dist/{coordinator-prompt-TUHB6ZFA.js → coordinator-prompt-2YCOE5R4.js} +5 -4
  33. package/dist/{coordinator-prompt-WOTJQMD5.js → coordinator-prompt-EO2X2EYW.js} +5 -4
  34. package/dist/{cursor-recover-TXVTLAMA.js → cursor-recover-4PQAADAU.js} +3 -28
  35. package/dist/{global-workspace-V6G2KH2V.js → global-workspace-H2ANUSGR.js} +5 -4
  36. package/dist/{global-workspace-5UUUNA4A.js → global-workspace-JEKMVE42.js} +5 -4
  37. package/dist/index.cjs +671 -384
  38. package/dist/index.d.cts +93 -4
  39. package/dist/index.d.ts +93 -4
  40. package/dist/index.js +52 -19
  41. package/dist/mcp/run-stdio.cjs +637 -384
  42. package/dist/mcp/run-stdio.js +12 -11
  43. package/dist/{orchestrator-D4AQNF25.js → orchestrator-N7LLTK5O.js} +7 -6
  44. package/dist/{orchestrator-4IGHVRAF.js → orchestrator-RUQXDYM7.js} +7 -6
  45. package/dist/{thread-store-ESZYZSVC.js → thread-store-55X2JYDT.js} +2 -1
  46. package/dist/{thread-store-FMWDFAO5.js → thread-store-CMZWM5NY.js} +2 -1
  47. package/dist/{workspaces-CLNANACI.js → workspaces-2YNYLSPV.js} +5 -4
  48. package/dist/{workspaces-PZ36M7EQ.js → workspaces-SVDORZEI.js} +5 -4
  49. package/dist/{worktree-JKTM47K5.js → worktree-5CPGB4D2.js} +4 -3
  50. package/dist/{worktree-NC4XQNQI.js → worktree-YQ6XUSR2.js} +4 -3
  51. package/package.json +1 -1
@@ -355,6 +355,168 @@ function normalizeVault(raw) {
355
355
  return out;
356
356
  }
357
357
 
358
+ // src/agents/usage.ts
359
+ function sumOptional(a, b) {
360
+ if (a == null && b == null) return void 0;
361
+ return (a ?? 0) + (b ?? 0);
362
+ }
363
+ function fromInclusiveInputUsage(opts) {
364
+ const totalInput = Number(opts.inputTokens) || 0;
365
+ const outputTokens = Number(opts.outputTokens) || 0;
366
+ const cached = Number(opts.cachedInputTokens) || 0;
367
+ if (!totalInput && !outputTokens) return null;
368
+ const cacheReadTokens = cached > 0 ? Math.min(cached, totalInput) : 0;
369
+ return {
370
+ inputTokens: Math.max(0, totalInput - cacheReadTokens),
371
+ outputTokens,
372
+ cacheReadTokens: cacheReadTokens || void 0
373
+ };
374
+ }
375
+ function requestOccupancy(u) {
376
+ return u.inputTokens + (u.cacheReadTokens ?? 0) + (u.cacheWriteTokens ?? 0);
377
+ }
378
+ function mergeUsage(a, b) {
379
+ return {
380
+ inputTokens: (a?.inputTokens ?? 0) + b.inputTokens,
381
+ outputTokens: (a?.outputTokens ?? 0) + b.outputTokens,
382
+ cacheReadTokens: sumOptional(a?.cacheReadTokens, b.cacheReadTokens),
383
+ cacheWriteTokens: sumOptional(a?.cacheWriteTokens, b.cacheWriteTokens),
384
+ costUsd: sumOptional(a?.costUsd, b.costUsd),
385
+ lastRequestTokens: b.lastRequestTokens ?? a?.lastRequestTokens
386
+ };
387
+ }
388
+ function sumUsageList(list) {
389
+ let acc = null;
390
+ for (const u of list) {
391
+ if (!u) continue;
392
+ acc = mergeUsage(acc, {
393
+ inputTokens: u.inputTokens,
394
+ outputTokens: u.outputTokens,
395
+ cacheReadTokens: u.cacheReadTokens,
396
+ cacheWriteTokens: u.cacheWriteTokens,
397
+ costUsd: u.costUsd
398
+ });
399
+ }
400
+ if (!acc) return null;
401
+ return {
402
+ inputTokens: acc.inputTokens,
403
+ outputTokens: acc.outputTokens,
404
+ ...acc.cacheReadTokens != null ? { cacheReadTokens: acc.cacheReadTokens } : {},
405
+ ...acc.cacheWriteTokens != null ? { cacheWriteTokens: acc.cacheWriteTokens } : {},
406
+ ...acc.costUsd != null ? { costUsd: acc.costUsd } : {}
407
+ };
408
+ }
409
+ function hasBilledTokens(u) {
410
+ return Boolean(
411
+ u.inputTokens || u.outputTokens || u.cacheReadTokens || u.cacheWriteTokens
412
+ );
413
+ }
414
+ function applyTurnUsage(current, incoming, scope = "request") {
415
+ if (scope === "turn") {
416
+ if (!hasBilledTokens(incoming) && current && incoming.costUsd != null) {
417
+ return { ...current, costUsd: incoming.costUsd };
418
+ }
419
+ return {
420
+ ...incoming,
421
+ costUsd: incoming.costUsd ?? current?.costUsd,
422
+ lastRequestTokens: current?.lastRequestTokens ?? requestOccupancy(incoming)
423
+ };
424
+ }
425
+ const merged = mergeUsage(current, incoming);
426
+ const occ = incoming.lastRequestTokens != null && incoming.lastRequestTokens > 0 ? incoming.lastRequestTokens : requestOccupancy(incoming);
427
+ return {
428
+ ...merged,
429
+ lastRequestTokens: occ > 0 ? occ : current?.lastRequestTokens ?? occ
430
+ };
431
+ }
432
+ function totalTokens(u) {
433
+ return u.inputTokens + u.outputTokens + (u.cacheReadTokens ?? 0) + (u.cacheWriteTokens ?? 0);
434
+ }
435
+ function contextTokens(u) {
436
+ if (u.lastRequestTokens != null && u.lastRequestTokens > 0) return u.lastRequestTokens;
437
+ return requestOccupancy(u);
438
+ }
439
+
440
+ // src/store/history-retention.ts
441
+ var HISTORY_MAX_COUNT_DEFAULT = 200;
442
+ var HISTORY_MAX_COUNT_MIN = 1;
443
+ var HISTORY_MAX_COUNT_MAX = 2e3;
444
+ var HISTORY_MAX_DAYS_DEFAULT = 0;
445
+ var HISTORY_MAX_DAYS_MAX = 3650;
446
+ var HISTORY_CLEANUP_INTERVAL_HOURS_DEFAULT = 6;
447
+ var HISTORY_DISCARDED_TEXT = "Transcript discarded by History retention.";
448
+ function clampHistoryMaxCount(value) {
449
+ return Math.max(HISTORY_MAX_COUNT_MIN, Math.min(HISTORY_MAX_COUNT_MAX, Math.floor(value)));
450
+ }
451
+ function clampHistoryMaxDays(value) {
452
+ if (!Number.isFinite(value) || value <= 0) return 0;
453
+ return Math.min(HISTORY_MAX_DAYS_MAX, Math.floor(value));
454
+ }
455
+ function archivedUpdatedMs(thread) {
456
+ const updated = Date.parse(thread.updatedAt);
457
+ if (Number.isFinite(updated)) return updated;
458
+ const created = Date.parse(thread.createdAt);
459
+ return Number.isFinite(created) ? created : 0;
460
+ }
461
+ function isHistoryRetentionStub(thread) {
462
+ if ((thread.attachments?.length ?? 0) > 0) return false;
463
+ const messages = thread.messages ?? [];
464
+ if (messages.length === 0) return true;
465
+ if (messages.length > 1) return false;
466
+ const only = messages[0];
467
+ if (only.parts?.length) return false;
468
+ if ((only.attachments?.length ?? 0) > 0) return false;
469
+ const text = (only.text ?? "").trim();
470
+ return text === "" || text === HISTORY_DISCARDED_TEXT;
471
+ }
472
+ function historyRetentionStubMessage(thread) {
473
+ const usage = sumUsageList((thread.messages ?? []).map((m) => m.usage));
474
+ return {
475
+ role: "summary",
476
+ text: HISTORY_DISCARDED_TEXT,
477
+ ts: thread.updatedAt,
478
+ ...usage ? { usage } : {}
479
+ };
480
+ }
481
+ function sortArchivedOldestFirst(threads) {
482
+ return [...threads].sort((a, b) => archivedUpdatedMs(a) - archivedUpdatedMs(b));
483
+ }
484
+ function planHistoryRetention(archived, thresholds = {}) {
485
+ const maxCount = clampHistoryMaxCount(thresholds.maxCount ?? HISTORY_MAX_COUNT_DEFAULT);
486
+ const maxDays = clampHistoryMaxDays(thresholds.maxDays ?? HISTORY_MAX_DAYS_DEFAULT);
487
+ const nowMs = thresholds.nowMs ?? Date.now();
488
+ const oldestFirst = sortArchivedOldestFirst(archived);
489
+ const expiredIds = /* @__PURE__ */ new Set();
490
+ if (maxDays > 0) {
491
+ const cutoff = nowMs - maxDays * 864e5;
492
+ for (const thread of oldestFirst) {
493
+ if (archivedUpdatedMs(thread) < cutoff) expiredIds.add(thread.id);
494
+ }
495
+ }
496
+ const remaining = oldestFirst.filter((t) => !expiredIds.has(t.id));
497
+ const overflow = remaining.length > maxCount ? remaining.slice(0, remaining.length - maxCount) : [];
498
+ const stripIds = [];
499
+ const purgeIds = [...expiredIds];
500
+ const seenPurge = new Set(purgeIds);
501
+ for (const thread of overflow) {
502
+ if (isHistoryRetentionStub(thread)) {
503
+ if (!seenPurge.has(thread.id)) {
504
+ seenPurge.add(thread.id);
505
+ purgeIds.push(thread.id);
506
+ }
507
+ } else {
508
+ stripIds.push(thread.id);
509
+ }
510
+ }
511
+ return { stripIds, purgeIds };
512
+ }
513
+ function planHistoryAgePurge(archived, olderThanDays, nowMs = Date.now()) {
514
+ const days = clampHistoryMaxDays(olderThanDays);
515
+ if (days <= 0) return [];
516
+ const cutoff = nowMs - days * 864e5;
517
+ return sortArchivedOldestFirst(archived).filter((t) => archivedUpdatedMs(t) < cutoff).map((t) => t.id);
518
+ }
519
+
358
520
  // src/store/usage-on-limit.ts
359
521
  var USAGE_ON_LIMIT_VALUES = [
360
522
  "keep_going",
@@ -815,6 +977,24 @@ function normalizeAdvanced(raw) {
815
977
  if (typeof source.autoCleanupOrphans === "boolean") {
816
978
  out.autoCleanupOrphans = source.autoCleanupOrphans;
817
979
  }
980
+ if (typeof source.autoCleanupHistory === "boolean") {
981
+ out.autoCleanupHistory = source.autoCleanupHistory;
982
+ }
983
+ if (typeof source.historyMaxCount === "number" && Number.isFinite(source.historyMaxCount)) {
984
+ out.historyMaxCount = clampHistoryMaxCount(source.historyMaxCount);
985
+ }
986
+ if (typeof source.historyMaxDays === "number" && Number.isFinite(source.historyMaxDays)) {
987
+ out.historyMaxDays = clampHistoryMaxDays(source.historyMaxDays);
988
+ }
989
+ if (typeof source.historyCleanupIntervalHours === "number" && Number.isFinite(source.historyCleanupIntervalHours)) {
990
+ out.historyCleanupIntervalHours = Math.max(
991
+ 1,
992
+ Math.min(168, Math.floor(source.historyCleanupIntervalHours))
993
+ );
994
+ }
995
+ if (typeof source.historyLastCleanupAt === "string" && source.historyLastCleanupAt.trim()) {
996
+ out.historyLastCleanupAt = source.historyLastCleanupAt.trim();
997
+ }
818
998
  if (source.orchestrationQuotaOnLimit === "switch_agent" || source.orchestrationQuotaOnLimit === "wait_reset") {
819
999
  out.orchestrationQuotaOnLimit = source.orchestrationQuotaOnLimit;
820
1000
  }
@@ -1720,6 +1900,24 @@ function updateAdvancedSettings(patch) {
1720
1900
  if (typeof patch.autoCleanupOrphans === "boolean") {
1721
1901
  advanced.autoCleanupOrphans = patch.autoCleanupOrphans;
1722
1902
  }
1903
+ if (typeof patch.autoCleanupHistory === "boolean") {
1904
+ advanced.autoCleanupHistory = patch.autoCleanupHistory;
1905
+ }
1906
+ if (typeof patch.historyMaxCount === "number" && Number.isFinite(patch.historyMaxCount)) {
1907
+ advanced.historyMaxCount = clampHistoryMaxCount(patch.historyMaxCount);
1908
+ }
1909
+ if (typeof patch.historyMaxDays === "number" && Number.isFinite(patch.historyMaxDays)) {
1910
+ advanced.historyMaxDays = clampHistoryMaxDays(patch.historyMaxDays);
1911
+ }
1912
+ if (typeof patch.historyCleanupIntervalHours === "number" && Number.isFinite(patch.historyCleanupIntervalHours)) {
1913
+ advanced.historyCleanupIntervalHours = Math.max(
1914
+ 1,
1915
+ Math.min(168, Math.floor(patch.historyCleanupIntervalHours))
1916
+ );
1917
+ }
1918
+ if (typeof patch.historyLastCleanupAt === "string") {
1919
+ advanced.historyLastCleanupAt = patch.historyLastCleanupAt;
1920
+ }
1723
1921
  if (patch.orchestrationQuotaOnLimit === "switch_agent" || patch.orchestrationQuotaOnLimit === "wait_reset") {
1724
1922
  advanced.orchestrationQuotaOnLimit = patch.orchestrationQuotaOnLimit;
1725
1923
  }
@@ -1770,6 +1968,15 @@ function autoArchiveOnMergeEnabled(settings = loadAppSettings()) {
1770
1968
  function autoCleanupOrphansEnabled(settings = loadAppSettings()) {
1771
1969
  return Boolean(settings.advanced.autoCleanupOrphans);
1772
1970
  }
1971
+ function autoCleanupHistoryEnabled(settings = loadAppSettings()) {
1972
+ return settings.advanced.autoCleanupHistory !== false;
1973
+ }
1974
+ function historyMaxCount(settings = loadAppSettings()) {
1975
+ return clampHistoryMaxCount(settings.advanced.historyMaxCount ?? HISTORY_MAX_COUNT_DEFAULT);
1976
+ }
1977
+ function historyMaxDays(settings = loadAppSettings()) {
1978
+ return clampHistoryMaxDays(settings.advanced.historyMaxDays ?? HISTORY_MAX_DAYS_DEFAULT);
1979
+ }
1773
1980
  function usageOnLimit(settings = loadAppSettings()) {
1774
1981
  return resolveUsageOnLimit(settings.advanced);
1775
1982
  }
@@ -1903,6 +2110,26 @@ export {
1903
2110
  writeSecureJson,
1904
2111
  isSecureFileEncrypted,
1905
2112
  secureFileUnlocksWith,
2113
+ fromInclusiveInputUsage,
2114
+ requestOccupancy,
2115
+ mergeUsage,
2116
+ sumUsageList,
2117
+ applyTurnUsage,
2118
+ totalTokens,
2119
+ contextTokens,
2120
+ HISTORY_MAX_COUNT_DEFAULT,
2121
+ HISTORY_MAX_COUNT_MIN,
2122
+ HISTORY_MAX_COUNT_MAX,
2123
+ HISTORY_MAX_DAYS_DEFAULT,
2124
+ HISTORY_MAX_DAYS_MAX,
2125
+ HISTORY_CLEANUP_INTERVAL_HOURS_DEFAULT,
2126
+ HISTORY_DISCARDED_TEXT,
2127
+ clampHistoryMaxCount,
2128
+ clampHistoryMaxDays,
2129
+ isHistoryRetentionStub,
2130
+ historyRetentionStubMessage,
2131
+ planHistoryRetention,
2132
+ planHistoryAgePurge,
1906
2133
  USAGE_ON_LIMIT_VALUES,
1907
2134
  isUsageOnLimit,
1908
2135
  resolveUsageOnLimit,
@@ -1972,6 +2199,9 @@ export {
1972
2199
  confirmClaudeUsageOverLimitEnabled,
1973
2200
  autoArchiveOnMergeEnabled,
1974
2201
  autoCleanupOrphansEnabled,
2202
+ autoCleanupHistoryEnabled,
2203
+ historyMaxCount,
2204
+ historyMaxDays,
1975
2205
  usageOnLimit,
1976
2206
  orchestrationQuotaOnLimit,
1977
2207
  orchestrationQuotaFallbackAgent,
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {
4
+ appDataDir
5
+ } from "./chunk-EQNRWDLN.js";
6
+
7
+ // src/agents/cursor-store.ts
8
+ import { join } from "path";
9
+ var CURSOR_SDK_STORE_DIR = "cursor-sdk-store";
10
+ function cursorSdkStoreDir(threadId) {
11
+ const root = join(appDataDir(), CURSOR_SDK_STORE_DIR);
12
+ const id = sanitizeCursorStoreSegment(threadId);
13
+ if (!id) return root;
14
+ return join(root, "threads", id);
15
+ }
16
+ function cursorSdkRunsNdjsonPath(threadId) {
17
+ return join(cursorSdkStoreDir(threadId), "runs.ndjson");
18
+ }
19
+ function cursorSdkRunsNdjsonSearchPaths(threadId) {
20
+ const scoped = cursorSdkRunsNdjsonPath(threadId);
21
+ const shared = cursorSdkRunsNdjsonPath(null);
22
+ if (!threadId || !sanitizeCursorStoreSegment(threadId) || scoped === shared) {
23
+ return [shared];
24
+ }
25
+ return [scoped, shared];
26
+ }
27
+ function sanitizeCursorStoreSegment(threadId) {
28
+ return (threadId ?? "").trim().replace(/[^a-zA-Z0-9._-]/g, "_");
29
+ }
30
+
31
+ export {
32
+ cursorSdkStoreDir,
33
+ cursorSdkRunsNdjsonSearchPaths
34
+ };
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  getAbleTimeHost,
8
8
  isAbleTimeConnected
9
- } from "./chunk-4EGK47WV.js";
9
+ } from "./chunk-FUC3XFE2.js";
10
10
 
11
11
  // src/integrations/abletime-mcp.ts
12
12
  var DEFAULT_ABLETIME_HOST = "https://track.abletime.com";
@@ -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-UZHPB3W2.js").then((m) => m.ensureAbleTimeAccessToken());
158
+ const rawToken = opts?.token ?? await import("./abletime-oauth-7AOE4KJL.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-UZHPB3W2.js").then((m) => m.ensureAbleTimeAccessToken());
229
+ const rawToken = opts?.token ?? await import("./abletime-oauth-7AOE4KJL.js").then((m) => m.ensureAbleTimeAccessToken());
230
230
  if (rawToken && ableTimeUsesRest(rawToken)) {
231
- const { callAbleTimeRestTool } = await import("./abletime-rest-HYNYDYK3.js");
231
+ const { callAbleTimeRestTool } = await import("./abletime-rest-QRTJH42S.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-HYNYDYK3.js");
247
+ const { callAbleTimeRestTool } = await import("./abletime-rest-QRTJH42S.js");
248
248
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
249
249
  }
250
250
  throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
@@ -9,13 +9,14 @@ import {
9
9
  enrichWorkspacesWithGithub,
10
10
  ensureGlobalCoordinatorCwd,
11
11
  formatWorkspaceInventory
12
- } from "./chunk-DNTPX6HV.js";
13
- import "./chunk-NJ2CCLV6.js";
12
+ } from "./chunk-PTOIWKDU.js";
13
+ import "./chunk-42VGWRSE.js";
14
14
  import "./chunk-D6JWYJ4P.js";
15
- import "./chunk-ZHCB4CKR.js";
15
+ import "./chunk-RPZFNKND.js";
16
+ import "./chunk-X5B3OS5I.js";
16
17
  import "./chunk-SYFVUF2C.js";
17
18
  import "./chunk-FNQNJOHY.js";
18
- import "./chunk-4EGK47WV.js";
19
+ import "./chunk-FUC3XFE2.js";
19
20
  import "./chunk-NSTQ6QKD.js";
20
21
  import "./chunk-KGZBYWZ3.js";
21
22
  import "./chunk-EQNRWDLN.js";
@@ -7,15 +7,16 @@ import {
7
7
  enrichWorkspacesWithGithub,
8
8
  ensureGlobalCoordinatorCwd,
9
9
  formatWorkspaceInventory
10
- } from "./chunk-HA4EZKFY.js";
11
- import "./chunk-OP6CFVTB.js";
10
+ } from "./chunk-TZCWNRMC.js";
11
+ import "./chunk-22A45QOI.js";
12
12
  import "./chunk-6K64FJDD.js";
13
13
  import "./chunk-QQKDGPUI.js";
14
- import "./chunk-Y4CF7LHH.js";
14
+ import "./chunk-VJQDUD24.js";
15
15
  import "./chunk-4TR3HZFT.js";
16
16
  import "./chunk-WDRMZKVB.js";
17
17
  import "./chunk-JT7R45JB.js";
18
- import "./chunk-7DKX5JLT.js";
18
+ import "./chunk-OY7THBLG.js";
19
+ import "./chunk-7J72QJOM.js";
19
20
  import "./chunk-77WWLBCI.js";
20
21
  import "./chunk-WFUDY6PC.js";
21
22
  import "./chunk-UFHNSFAS.js";
@@ -1,37 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import {
4
- appDataDir
5
- } from "./chunk-EQNRWDLN.js";
4
+ cursorSdkRunsNdjsonSearchPaths
5
+ } from "./chunk-X5B3OS5I.js";
6
+ import "./chunk-EQNRWDLN.js";
6
7
 
7
8
  // src/agents/cursor-recover.ts
8
9
  import { existsSync, readFileSync } from "fs";
9
-
10
- // src/agents/cursor-store.ts
11
- import { join } from "path";
12
- var CURSOR_SDK_STORE_DIR = "cursor-sdk-store";
13
- function cursorSdkStoreDir(threadId) {
14
- const root = join(appDataDir(), CURSOR_SDK_STORE_DIR);
15
- const id = sanitizeCursorStoreSegment(threadId);
16
- if (!id) return root;
17
- return join(root, "threads", id);
18
- }
19
- function cursorSdkRunsNdjsonPath(threadId) {
20
- return join(cursorSdkStoreDir(threadId), "runs.ndjson");
21
- }
22
- function cursorSdkRunsNdjsonSearchPaths(threadId) {
23
- const scoped = cursorSdkRunsNdjsonPath(threadId);
24
- const shared = cursorSdkRunsNdjsonPath(null);
25
- if (!threadId || !sanitizeCursorStoreSegment(threadId) || scoped === shared) {
26
- return [shared];
27
- }
28
- return [scoped, shared];
29
- }
30
- function sanitizeCursorStoreSegment(threadId) {
31
- return (threadId ?? "").trim().replace(/[^a-zA-Z0-9._-]/g, "_");
32
- }
33
-
34
- // src/agents/cursor-recover.ts
35
10
  function recoverFinishedCursorRun(opts) {
36
11
  const agentId = opts.agentId.trim();
37
12
  if (!agentId) return null;
@@ -17,13 +17,14 @@ import {
17
17
  orchestratorSessionPoisonedByBuiltins,
18
18
  slackCoordinatorSourceRef,
19
19
  takenTeamSlugsForOrchestration
20
- } from "./chunk-DNTPX6HV.js";
21
- import "./chunk-NJ2CCLV6.js";
20
+ } from "./chunk-PTOIWKDU.js";
21
+ import "./chunk-42VGWRSE.js";
22
22
  import "./chunk-D6JWYJ4P.js";
23
- import "./chunk-ZHCB4CKR.js";
23
+ import "./chunk-RPZFNKND.js";
24
+ import "./chunk-X5B3OS5I.js";
24
25
  import "./chunk-SYFVUF2C.js";
25
26
  import "./chunk-FNQNJOHY.js";
26
- import "./chunk-4EGK47WV.js";
27
+ import "./chunk-FUC3XFE2.js";
27
28
  import "./chunk-NSTQ6QKD.js";
28
29
  import "./chunk-KGZBYWZ3.js";
29
30
  import {
@@ -15,15 +15,16 @@ import {
15
15
  orchestratorSessionPoisonedByBuiltins,
16
16
  slackCoordinatorSourceRef,
17
17
  takenTeamSlugsForOrchestration
18
- } from "./chunk-HA4EZKFY.js";
19
- import "./chunk-OP6CFVTB.js";
18
+ } from "./chunk-TZCWNRMC.js";
19
+ import "./chunk-22A45QOI.js";
20
20
  import "./chunk-6K64FJDD.js";
21
21
  import "./chunk-QQKDGPUI.js";
22
- import "./chunk-Y4CF7LHH.js";
22
+ import "./chunk-VJQDUD24.js";
23
23
  import "./chunk-4TR3HZFT.js";
24
24
  import "./chunk-WDRMZKVB.js";
25
25
  import "./chunk-JT7R45JB.js";
26
- import "./chunk-7DKX5JLT.js";
26
+ import "./chunk-OY7THBLG.js";
27
+ import "./chunk-7J72QJOM.js";
27
28
  import "./chunk-77WWLBCI.js";
28
29
  import {
29
30
  globalAgentCwd