@sideboard-ai/core 0.1.136 → 0.1.142

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 (65) hide show
  1. package/dist/{abletime-VTP4JR63.js → abletime-DI55AJX3.js} +2 -2
  2. package/dist/{abletime-DDTV7WO3.js → abletime-QEVAE67D.js} +2 -2
  3. package/dist/agents/cursor-runner.cjs +0 -0
  4. package/dist/agents/cursor-runner.js +1 -1
  5. package/dist/{agents-QNTTLMG2.js → agents-E5AAMHDY.js} +12 -8
  6. package/dist/{agents-ELWR7A2T.js → agents-OEEOIKUB.js} +11 -7
  7. package/dist/{app-settings-U5RZKUXG.js → app-settings-WJDCJFSY.js} +3 -1
  8. package/dist/{app-settings-YQ7YX2CC.js → app-settings-ZCN632OJ.js} +3 -1
  9. package/dist/caffeinate-hold-NBRUWYXO.js +0 -0
  10. package/dist/{chunk-4XKUHP6G.js → chunk-4D4PEBGB.js} +2 -2
  11. package/dist/{chunk-QAV3HGVS.js → chunk-4Q45TLZ5.js} +8 -8
  12. package/dist/chunk-6GN5WPYZ.js +0 -0
  13. package/dist/chunk-B3SJXYIJ.js +0 -0
  14. package/dist/chunk-BD2ICC4D.js +0 -0
  15. package/dist/{chunk-GKKHXZCT.js → chunk-BGQBELGJ.js} +201 -2
  16. package/dist/{chunk-2XXAAIN3.js → chunk-BOD5V52W.js} +1 -1
  17. package/dist/{chunk-JPBRMUM6.js → chunk-CG25RYQQ.js} +87 -41
  18. package/dist/chunk-ED4UPEJX.js +0 -0
  19. package/dist/{chunk-J5IBSVB3.js → chunk-EUXOHTUK.js} +42 -25
  20. package/dist/{chunk-K5YT5GX2.js → chunk-FADNFPZO.js} +4 -4
  21. package/dist/{chunk-TIGKDMIA.js → chunk-FGOD5MQ4.js} +550 -69
  22. package/dist/{chunk-MDCKV2NF.js → chunk-HC5N3BDL.js} +2 -2
  23. package/dist/{chunk-GJBHOJCZ.js → chunk-I77RYPOH.js} +201 -2
  24. package/dist/{chunk-WS5LFFU3.js → chunk-JUWVAMRS.js} +333 -64
  25. package/dist/chunk-KGZBYWZ3.js +0 -0
  26. package/dist/chunk-KLBOWJ74.js +0 -0
  27. package/dist/chunk-KPIYENTF.js +0 -0
  28. package/dist/chunk-N5PM7HGQ.js +0 -0
  29. package/dist/chunk-NSTQ6QKD.js +0 -0
  30. package/dist/{chunk-HQQNLDVC.js → chunk-O3JEC2UJ.js} +8 -8
  31. package/dist/{chunk-TQ4S5AGJ.js → chunk-OHWN4JEL.js} +7 -5
  32. package/dist/{chunk-GSKRGF7B.js → chunk-R2W7A2UO.js} +4 -4
  33. package/dist/chunk-S42XV45P.js +0 -0
  34. package/dist/{chunk-PM3C2J6K.js → chunk-TUGKX5BD.js} +42 -25
  35. package/dist/{chunk-IFZ4MOTN.js → chunk-UG5N7ET3.js} +7 -5
  36. package/dist/{chunk-CYM5DCHI.js → chunk-VHTIHOHE.js} +87 -42
  37. package/dist/{chunk-AT346U23.js → chunk-VZJVKQHH.js} +1 -1
  38. package/dist/{chunk-FSCQXMGI.js → chunk-WT5HSFOU.js} +1 -0
  39. package/dist/connected-teams-IJUJQ7R6.js +0 -0
  40. package/dist/{coordinator-prompt-IPL4Z6SL.js → coordinator-prompt-2LD3C74O.js} +4 -4
  41. package/dist/{coordinator-prompt-2OWSUAUR.js → coordinator-prompt-FBX7Y4EM.js} +4 -4
  42. package/dist/cursor-recover-NOQYOFRF.js +0 -0
  43. package/dist/{global-workspace-NIKZAKOO.js → global-workspace-NG7SU3GV.js} +5 -5
  44. package/dist/{global-workspace-JDUCUL7S.js → global-workspace-OCV77UYF.js} +5 -5
  45. package/dist/index.cjs +1064 -187
  46. package/dist/index.d.cts +239 -62
  47. package/dist/index.d.ts +239 -62
  48. package/dist/index.js +144 -20
  49. package/dist/mcp/run-stdio.cjs +759 -170
  50. package/dist/mcp/run-stdio.js +46 -18
  51. package/dist/oauth-YJBAURIJ.js +0 -0
  52. package/dist/{orchestrator-KK3CUW37.js → orchestrator-4BEZJ2BU.js} +8 -8
  53. package/dist/{orchestrator-6I47JMU2.js → orchestrator-I2T44CRP.js} +9 -9
  54. package/dist/paths-QCI3MTO5.js +0 -0
  55. package/dist/plan-file-PHVKUAEE.js +0 -0
  56. package/dist/run-USF6FRKV.js +0 -0
  57. package/dist/{thread-store-FADXSMEJ.js → thread-store-57ZLHR3A.js} +1 -1
  58. package/dist/{thread-store-CRLQJ2HM.js → thread-store-WGASXXXR.js} +1 -1
  59. package/dist/title-4WAKWZRF.js +0 -0
  60. package/dist/{workspaces-5EWNNALF.js → workspaces-4FUQW5LD.js} +6 -6
  61. package/dist/{workspaces-KZA3TCEE.js → workspaces-PU5YHQ7Z.js} +6 -6
  62. package/dist/{worktree-MX7XBX6Z.js → worktree-GKLPPNWR.js} +3 -3
  63. package/dist/{worktree-BC6XDMQK.js → worktree-Z22HTSCU.js} +3 -3
  64. package/package.json +9 -8
  65. package/LICENSE +0 -190
@@ -11,13 +11,13 @@ import {
11
11
  } from "./chunk-S42XV45P.js";
12
12
  import {
13
13
  isOrchestratorThread
14
- } from "./chunk-K5YT5GX2.js";
14
+ } from "./chunk-FADNFPZO.js";
15
15
  import {
16
16
  codexUnattendedGitConfigArgs,
17
17
  mergeAgentGitAuthEnv,
18
18
  resolveAgentGitAuthEnv,
19
19
  resolveCodexGitWritableRoots
20
- } from "./chunk-QAV3HGVS.js";
20
+ } from "./chunk-4Q45TLZ5.js";
21
21
  import {
22
22
  enrichPathWithNpmGlobalBin,
23
23
  isConductorBundledCli,
@@ -33,7 +33,7 @@ import {
33
33
  resolveClaudeExecutable,
34
34
  unwrapStrippedElectronLaunch,
35
35
  wrapElectronAsNodeLaunch
36
- } from "./chunk-GKKHXZCT.js";
36
+ } from "./chunk-BGQBELGJ.js";
37
37
  import {
38
38
  appDataDir
39
39
  } from "./chunk-BD2ICC4D.js";
@@ -109,7 +109,7 @@ function applyTurnUsage(current, incoming, scope = "request") {
109
109
  };
110
110
  }
111
111
  const merged = mergeUsage(current, incoming);
112
- const occ = requestOccupancy(incoming);
112
+ const occ = incoming.lastRequestTokens != null && incoming.lastRequestTokens > 0 ? incoming.lastRequestTokens : requestOccupancy(incoming);
113
113
  return {
114
114
  ...merged,
115
115
  lastRequestTokens: occ > 0 ? occ : current?.lastRequestTokens ?? occ
@@ -1990,8 +1990,47 @@ function eventsFromClaudeSystem(obj) {
1990
1990
  data: `API retry ${attempt ?? "?"}/${max ?? "?"}${typeof delay === "number" ? ` (wait ${delay}ms)` : ""}`
1991
1991
  };
1992
1992
  }
1993
+ if (subtype === "status") {
1994
+ const status = claudeString(obj, "status");
1995
+ if (status === "compacting") {
1996
+ return { type: "thinking", data: "Compressing context\u2026", replace: true };
1997
+ }
1998
+ return null;
1999
+ }
2000
+ if (subtype === "compact_boundary" || subtype === "compact") {
2001
+ const meta = compactMetadataFromClaude(obj);
2002
+ const trigger = meta.trigger ? ` (${meta.trigger})` : "";
2003
+ const thinking = {
2004
+ type: "thinking",
2005
+ data: `Context compressed${trigger}`
2006
+ };
2007
+ if (meta.postTokens != null && meta.postTokens > 0) {
2008
+ return [
2009
+ thinking,
2010
+ {
2011
+ type: "usage",
2012
+ data: {
2013
+ inputTokens: 0,
2014
+ outputTokens: 0,
2015
+ lastRequestTokens: meta.postTokens
2016
+ },
2017
+ scope: "request"
2018
+ }
2019
+ ];
2020
+ }
2021
+ return thinking;
2022
+ }
1993
2023
  return null;
1994
2024
  }
2025
+ function compactMetadataFromClaude(obj) {
2026
+ const raw = obj.compactMetadata ?? obj.compact_metadata;
2027
+ if (!raw || typeof raw !== "object") return {};
2028
+ const meta = raw;
2029
+ const trigger = typeof meta.trigger === "string" && meta.trigger.trim() ? meta.trigger.trim() : void 0;
2030
+ const post = meta.postTokens ?? meta.post_tokens;
2031
+ const postTokens = typeof post === "number" && Number.isFinite(post) && post > 0 ? Math.round(post) : void 0;
2032
+ return { trigger, postTokens };
2033
+ }
1995
2034
  var claudeAdapter = {
1996
2035
  kind: "claude",
1997
2036
  async detect() {
@@ -2046,7 +2085,7 @@ var claudeAdapter = {
2046
2085
  );
2047
2086
  }
2048
2087
  const mode = permissionMode(thread);
2049
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-JDUCUL7S.js");
2088
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-OCV77UYF.js");
2050
2089
  const isOrchestrator = isOrchestratorThread2(thread);
2051
2090
  const injectedServers = await buildInjectedMcpServers({
2052
2091
  includeSideboard: true,
@@ -3748,61 +3787,41 @@ async function openInSystemTerminal(command) {
3748
3787
  `No terminal found to run: ${trimmed}. Install gnome-terminal (or similar), or run the command manually.`
3749
3788
  );
3750
3789
  }
3751
- async function whichCli(bin) {
3790
+ async function whichOnPath(bin) {
3752
3791
  const which = await run("which", [bin], { reject: false, timeoutMs: 3e3 });
3753
3792
  if (which.exitCode !== 0) return null;
3754
3793
  return which.stdout.trim().split(/\r?\n/).find(Boolean) ?? null;
3755
3794
  }
3756
- async function installAgent(agent) {
3757
- const info = getAgentSetupInfo(agent);
3758
- if (info.kind === "bundled-sdk" || info.kind === "api-key") {
3759
- return {
3760
- ok: true,
3761
- message: info.summary
3762
- };
3763
- }
3764
- if (!info.installCommand) {
3765
- return { ok: false, message: `No install command for ${agent}` };
3766
- }
3767
- if (/curl\s| \|\s*bash/.test(info.installCommand) || !info.npmPackage) {
3768
- await openInSystemTerminal(info.installCommand);
3769
- return {
3770
- ok: true,
3771
- openedTerminal: true,
3772
- command: info.installCommand,
3773
- message: `Opened Terminal to run: ${info.installCommand}`
3774
- };
3775
- }
3795
+ async function installNpmGlobalPackage(opts) {
3776
3796
  enrichPathWithNpmGlobalBin();
3777
- const cliBin = agent === "cursor" ? null : CLI_BIN[agent];
3778
- if (cliBin) {
3779
- const existing = await whichCli(cliBin);
3797
+ if (opts.cliBin) {
3798
+ const existing = await whichOnPath(opts.cliBin);
3780
3799
  if (existing) {
3781
3800
  return {
3782
3801
  ok: true,
3783
3802
  command: existing,
3784
- message: isConductorBundledCli(existing) ? `Using Conductor\u2019s ${cliBin} at ${existing}. No extra install \u2014 Log in only if auth is missing.` : `Already on PATH: ${existing}`
3803
+ message: isConductorBundledCli(existing) ? `Using Conductor\u2019s ${opts.cliBin} at ${existing}. No extra install \u2014 Log in only if auth is missing.` : `Already on PATH: ${existing}`
3785
3804
  };
3786
3805
  }
3787
3806
  }
3788
- const result = await run("npm", ["install", "-g", info.npmPackage], { reject: false });
3807
+ const result = await run("npm", ["install", "-g", opts.npmPackage], { reject: false });
3789
3808
  const ok = result.exitCode === 0;
3790
3809
  if (!ok) {
3791
3810
  try {
3792
- await openInSystemTerminal(info.installCommand);
3811
+ await openInSystemTerminal(opts.installCommand);
3793
3812
  return {
3794
3813
  ok: false,
3795
3814
  openedTerminal: true,
3796
- command: info.installCommand,
3815
+ command: opts.installCommand,
3797
3816
  exitCode: result.exitCode,
3798
3817
  stdout: result.stdout,
3799
3818
  stderr: result.stderr,
3800
- message: `npm install failed (exit ${result.exitCode}). Opened Terminal with: ${info.installCommand}`
3819
+ message: `npm install failed (exit ${result.exitCode}). Opened Terminal with: ${opts.installCommand}`
3801
3820
  };
3802
3821
  } catch {
3803
3822
  return {
3804
3823
  ok: false,
3805
- command: info.installCommand,
3824
+ command: opts.installCommand,
3806
3825
  exitCode: result.exitCode,
3807
3826
  stdout: result.stdout,
3808
3827
  stderr: result.stderr,
@@ -3811,19 +3830,43 @@ async function installAgent(agent) {
3811
3830
  }
3812
3831
  }
3813
3832
  enrichPathWithNpmGlobalBin();
3814
- let binPath = null;
3815
- if (cliBin) {
3816
- binPath = await whichCli(cliBin);
3817
- }
3833
+ const binPath = opts.cliBin ? await whichOnPath(opts.cliBin) : null;
3818
3834
  return {
3819
3835
  ok: true,
3820
- command: info.installCommand,
3836
+ command: opts.installCommand,
3821
3837
  exitCode: 0,
3822
3838
  stdout: result.stdout,
3823
3839
  stderr: result.stderr,
3824
- message: binPath ? `Installed ${info.npmPackage} \u2192 ${binPath}` : `Installed ${info.npmPackage} (CLI not yet on PATH \u2014 Log in still exports Electron\u2019s PATH into Terminal)`
3840
+ message: binPath ? `Installed ${opts.npmPackage} \u2192 ${binPath}` : `Installed ${opts.npmPackage} (CLI not yet on PATH)`
3825
3841
  };
3826
3842
  }
3843
+ async function installAgent(agent) {
3844
+ const info = getAgentSetupInfo(agent);
3845
+ if (info.kind === "bundled-sdk" || info.kind === "api-key") {
3846
+ return {
3847
+ ok: true,
3848
+ message: info.summary
3849
+ };
3850
+ }
3851
+ if (!info.installCommand) {
3852
+ return { ok: false, message: `No install command for ${agent}` };
3853
+ }
3854
+ if (/curl\s| \|\s*bash/.test(info.installCommand) || !info.npmPackage) {
3855
+ await openInSystemTerminal(info.installCommand);
3856
+ return {
3857
+ ok: true,
3858
+ openedTerminal: true,
3859
+ command: info.installCommand,
3860
+ message: `Opened Terminal to run: ${info.installCommand}`
3861
+ };
3862
+ }
3863
+ const cliBin = agent === "cursor" ? null : CLI_BIN[agent];
3864
+ return installNpmGlobalPackage({
3865
+ npmPackage: info.npmPackage,
3866
+ installCommand: info.installCommand,
3867
+ cliBin
3868
+ });
3869
+ }
3827
3870
  async function loginAgent(agent) {
3828
3871
  const info = getAgentSetupInfo(agent);
3829
3872
  const loginCommand = resolveLoginCommand(agent);
@@ -3888,6 +3931,7 @@ export {
3888
3931
  finalizeParts,
3889
3932
  normalizeParseResult,
3890
3933
  sideboardMcpProfile,
3934
+ packagedMcpDir,
3891
3935
  applyAgentRunnerHeapEnv,
3892
3936
  PLAN_MODE_INSTRUCTION,
3893
3937
  permissionMode,
@@ -3914,6 +3958,8 @@ export {
3914
3958
  resolveLoginCommand,
3915
3959
  prepareTerminalCommand,
3916
3960
  openInSystemTerminal,
3961
+ whichOnPath,
3962
+ installNpmGlobalPackage,
3917
3963
  installAgent,
3918
3964
  loginAgent,
3919
3965
  getAdapter,
File without changes
@@ -15,6 +15,7 @@ import {
15
15
  existsSync,
16
16
  readFileSync,
17
17
  renameSync,
18
+ statSync,
18
19
  unlinkSync,
19
20
  writeFileSync,
20
21
  readdirSync
@@ -112,24 +113,43 @@ var listCache = null;
112
113
  function cacheForDir() {
113
114
  const dir = threadsDir();
114
115
  if (!listCache || listCache.dir !== dir) {
115
- listCache = { dir, byId: /* @__PURE__ */ new Map(), listed: false };
116
+ listCache = { dir, byId: /* @__PURE__ */ new Map(), mtimeMs: /* @__PURE__ */ new Map() };
116
117
  }
117
118
  return listCache;
118
119
  }
120
+ function fileMtimeMs(path) {
121
+ try {
122
+ return statSync(path).mtimeMs;
123
+ } catch {
124
+ return null;
125
+ }
126
+ }
127
+ function rememberThread(thread, mtimeMs) {
128
+ const cache = cacheForDir();
129
+ cache.byId.set(thread.id, thread);
130
+ if (mtimeMs != null) cache.mtimeMs.set(thread.id, mtimeMs);
131
+ }
132
+ function forgetThread(id) {
133
+ const cache = cacheForDir();
134
+ cache.byId.delete(id);
135
+ cache.mtimeMs.delete(id);
136
+ }
119
137
  function invalidateThreadListCache() {
120
138
  listCache = null;
121
139
  }
122
- function rememberThread(thread) {
123
- cacheForDir().byId.set(thread.id, thread);
124
- }
125
140
  function readThread(id) {
126
- const cached = cacheForDir().byId.get(id);
127
- if (cached) return cached;
128
141
  const path = threadFilePath(id);
129
- if (!existsSync(path)) return null;
142
+ const mtimeMs = fileMtimeMs(path);
143
+ if (mtimeMs == null) {
144
+ forgetThread(id);
145
+ return null;
146
+ }
147
+ const cache = cacheForDir();
148
+ const cached = cache.byId.get(id);
149
+ if (cached && cache.mtimeMs.get(id) === mtimeMs) return cached;
130
150
  const raw = readFileSync(path, "utf8");
131
151
  const thread = normalizeThread(JSON.parse(raw));
132
- rememberThread(thread);
152
+ rememberThread(thread, mtimeMs);
133
153
  return thread;
134
154
  }
135
155
  function writeThread(thread) {
@@ -138,7 +158,7 @@ function writeThread(thread) {
138
158
  const next = { ...thread, updatedAt: nowIso() };
139
159
  writeFileSync(tmp, JSON.stringify(next, null, 2), "utf8");
140
160
  renameSync(tmp, path);
141
- rememberThread(next);
161
+ rememberThread(next, fileMtimeMs(path) ?? Date.now());
142
162
  }
143
163
  function idPath(id) {
144
164
  return id;
@@ -149,22 +169,19 @@ function isThreadRecordFile(nameOrPath) {
149
169
  }
150
170
  function listThreads(opts) {
151
171
  const cache = cacheForDir();
152
- if (!cache.listed) {
153
- const files = readdirSync(threadsDir()).filter(isThreadRecordFile);
154
- const byId = /* @__PURE__ */ new Map();
155
- for (const f of files) {
156
- try {
157
- const thread = normalizeThread(
158
- JSON.parse(readFileSync(threadFilePath(f.replace(/\.json$/, "")), "utf8"))
159
- );
160
- if (typeof thread.id === "string" && thread.id.length > 0) {
161
- byId.set(thread.id, thread);
162
- }
163
- } catch {
164
- }
172
+ const files = readdirSync(threadsDir()).filter(isThreadRecordFile);
173
+ const seen = /* @__PURE__ */ new Set();
174
+ for (const f of files) {
175
+ const id = f.replace(/\.json$/, "");
176
+ if (!id) continue;
177
+ seen.add(id);
178
+ try {
179
+ readThread(id);
180
+ } catch {
165
181
  }
166
- cache.byId = byId;
167
- cache.listed = true;
182
+ }
183
+ for (const id of [...cache.byId.keys()]) {
184
+ if (!seen.has(id)) forgetThread(id);
168
185
  }
169
186
  const threads = [...cache.byId.values()].sort(
170
187
  (a, b) => b.updatedAt.localeCompare(a.updatedAt)
@@ -173,7 +190,7 @@ function listThreads(opts) {
173
190
  return threads.filter((t) => t.status !== "archived");
174
191
  }
175
192
  function deleteThreadRecord(id) {
176
- cacheForDir().byId.delete(id);
193
+ forgetThread(id);
177
194
  const path = threadFilePath(id);
178
195
  if (existsSync(path)) unlinkSync(path);
179
196
  const lock = threadLockPath(id);
@@ -2,12 +2,12 @@
2
2
 
3
3
  import {
4
4
  ensureGlobalCoordinatorCwd
5
- } from "./chunk-TQ4S5AGJ.js";
5
+ } from "./chunk-OHWN4JEL.js";
6
6
  import {
7
7
  allocateTeamName,
8
8
  takenSlugsFromThread,
9
9
  teamSlugFromName
10
- } from "./chunk-QAV3HGVS.js";
10
+ } from "./chunk-4Q45TLZ5.js";
11
11
  import {
12
12
  ATTACHMENTS_DIR,
13
13
  attachmentsGitignoreBody
@@ -17,11 +17,11 @@ import {
17
17
  listThreads,
18
18
  updateThread,
19
19
  writeThread
20
- } from "./chunk-J5IBSVB3.js";
20
+ } from "./chunk-EUXOHTUK.js";
21
21
  import {
22
22
  resolveNewThreadOptions,
23
23
  resolveThreadDefaults
24
- } from "./chunk-GKKHXZCT.js";
24
+ } from "./chunk-BGQBELGJ.js";
25
25
  import {
26
26
  globalAgentCwd
27
27
  } from "./chunk-BD2ICC4D.js";