@sideboard-ai/core 0.1.148 → 0.1.150

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 (60) hide show
  1. package/dist/{abletime-QEVAE67D.js → abletime-223A3LY6.js} +2 -2
  2. package/dist/{abletime-DI55AJX3.js → abletime-CLC5UJC2.js} +2 -2
  3. package/dist/agents/cursor-runner.cjs +85 -45
  4. package/dist/agents/cursor-runner.js +47 -12
  5. package/dist/{agents-DUF4Q2ZI.js → agents-KKXGTEV6.js} +10 -9
  6. package/dist/{agents-INCTFWKA.js → agents-YWBQXOA2.js} +10 -9
  7. package/dist/{app-settings-WJDCJFSY.js → app-settings-3CHCNIMD.js} +5 -1
  8. package/dist/{app-settings-ZCN632OJ.js → app-settings-J3JBCUOT.js} +5 -1
  9. package/dist/{chunk-I77RYPOH.js → chunk-4XNSGDXE.js} +12 -0
  10. package/dist/{chunk-KBWND62T.js → chunk-7F4XE6UG.js} +5 -5
  11. package/dist/{chunk-R4JP32P5.js → chunk-AF6O55PJ.js} +4 -4
  12. package/dist/{chunk-BOD5V52W.js → chunk-B7XK37WZ.js} +1 -1
  13. package/dist/{chunk-BGQBELGJ.js → chunk-CZD4NRDZ.js} +12 -0
  14. package/dist/{chunk-ZVYLEF72.js → chunk-DMRIZR6M.js} +6 -6
  15. package/dist/{chunk-5MS2XTNV.js → chunk-DXCNW2JF.js} +113 -52
  16. package/dist/{chunk-KPIYENTF.js → chunk-FNQNJOHY.js} +89 -5
  17. package/dist/{chunk-ED4UPEJX.js → chunk-G7SIQFBQ.js} +1 -1
  18. package/dist/{chunk-3QRGCKYL.js → chunk-HAS5EPBS.js} +2 -2
  19. package/dist/{chunk-WT5HSFOU.js → chunk-HEII7W3Q.js} +5 -2
  20. package/dist/{chunk-EGDRPA4B.js → chunk-NOTANBYC.js} +6 -6
  21. package/dist/{chunk-CTXQHSTY.js → chunk-NUPITVRF.js} +134 -73
  22. package/dist/{chunk-QTUESPAW.js → chunk-PTOSP4AH.js} +1 -1
  23. package/dist/{chunk-Q62SDB53.js → chunk-QGJHIJHV.js} +2 -2
  24. package/dist/{chunk-YQRBNOIW.js → chunk-SDN4ZYQH.js} +24 -13
  25. package/dist/{chunk-DVM4ID64.js → chunk-UFHNSFAS.js} +89 -5
  26. package/dist/{chunk-N3VNOFXQ.js → chunk-VO4SPEBS.js} +4 -4
  27. package/dist/chunk-VSFGPWCQ.js +62 -0
  28. package/dist/{chunk-N5PM7HGQ.js → chunk-W6N6GQME.js} +1 -1
  29. package/dist/{chunk-FKOIHGKV.js → chunk-WHU7YGWP.js} +1 -1
  30. package/dist/{chunk-VZJVKQHH.js → chunk-WLV7TRMR.js} +1 -1
  31. package/dist/chunk-Y4NAPW5I.js +60 -0
  32. package/dist/{chunk-B3SJXYIJ.js → chunk-Y7YBWWIG.js} +1 -1
  33. package/dist/{chunk-XOKHXFFX.js → chunk-YGGBJY5A.js} +22 -8
  34. package/dist/{chunk-JTPDWTWJ.js → chunk-Z2PVJKMN.js} +137 -114
  35. package/dist/{chunk-YP3CSOZ6.js → chunk-ZGFYFVJF.js} +142 -114
  36. package/dist/{connected-teams-IJUJQ7R6.js → connected-teams-I2WZZZFA.js} +2 -2
  37. package/dist/{connected-teams-4A2AXDNN.js → connected-teams-XO766HB4.js} +2 -2
  38. package/dist/{coordinator-prompt-ZWBMAIWA.js → coordinator-prompt-NYR5TPBD.js} +6 -5
  39. package/dist/{coordinator-prompt-5GXGBGEZ.js → coordinator-prompt-UCQJTFA7.js} +6 -5
  40. package/dist/{global-workspace-2SIPM4PW.js → global-workspace-4QHDAD2D.js} +7 -6
  41. package/dist/{global-workspace-OJRXWXEA.js → global-workspace-4SENNWBU.js} +7 -6
  42. package/dist/index.cjs +1002 -575
  43. package/dist/index.d.cts +91 -10
  44. package/dist/index.d.ts +91 -10
  45. package/dist/index.js +268 -93
  46. package/dist/mcp/run-stdio.cjs +980 -580
  47. package/dist/mcp/run-stdio.js +196 -43
  48. package/dist/{orchestrator-OVYITCO6.js → orchestrator-GZE4X3XV.js} +14 -11
  49. package/dist/{orchestrator-NWIU5TJP.js → orchestrator-QSBRWME5.js} +16 -13
  50. package/dist/{plan-file-6O7G4VPQ.js → plan-file-5S5TUNAW.js} +2 -2
  51. package/dist/{plan-file-PHVKUAEE.js → plan-file-IBSU2PVW.js} +2 -2
  52. package/dist/{run-XQKGHQZ2.js → run-CAGKZLHA.js} +1 -1
  53. package/dist/{run-USF6FRKV.js → run-EBWL2Q4N.js} +1 -1
  54. package/dist/{workspaces-UUJNOO4T.js → workspaces-7S7QKCUE.js} +8 -7
  55. package/dist/{workspaces-3NUUZTQK.js → workspaces-RDUSB6FD.js} +8 -7
  56. package/dist/{worktree-RZRJNHYL.js → worktree-63AGPPLO.js} +5 -4
  57. package/dist/{worktree-UCWWTVLS.js → worktree-JIZ3QMZX.js} +5 -4
  58. package/dist/worktree-exclude-6MQWGWV5.js +11 -0
  59. package/dist/worktree-exclude-TV6EV6BS.js +9 -0
  60. package/package.json +1 -1
@@ -96,17 +96,93 @@ function withExportedPath(command, pathValue) {
96
96
  return `export PATH=${posixShellSingleQuote(pathValue)} && ${trimmed}`;
97
97
  }
98
98
 
99
+ // src/git/github-agent-auth.ts
100
+ import { chmodSync, existsSync as existsSync2, mkdirSync, writeFileSync } from "fs";
101
+ import { homedir as homedir2 } from "os";
102
+ import { dirname, join as join2 } from "path";
103
+ function githubAgentAuthDir() {
104
+ const override = process.env.SIDEBOARD_GIT_AUTH_DIR?.trim();
105
+ if (override) return override;
106
+ return join2(homedir2(), ".sideboard-git-auth");
107
+ }
108
+ function githubCredentialStorePath() {
109
+ return join2(githubAgentAuthDir(), "git-credentials");
110
+ }
111
+ function githubGhConfigDir() {
112
+ return join2(githubAgentAuthDir(), "gh");
113
+ }
114
+ function writePrivateFile(file, body) {
115
+ mkdirSync(dirname(file), { recursive: true, mode: 448 });
116
+ try {
117
+ chmodSync(dirname(file), 448);
118
+ } catch {
119
+ }
120
+ writeFileSync(file, body, { encoding: "utf8", mode: 384 });
121
+ try {
122
+ chmodSync(file, 384);
123
+ } catch {
124
+ }
125
+ }
126
+ function gitCredentialStoreContents(token) {
127
+ return `https://x-access-token:${encodeURIComponent(token)}@github.com
128
+ `;
129
+ }
130
+ function ghHostsYml(token, user = "x-access-token") {
131
+ const u = user.replace(/[^A-Za-z0-9._-]/g, "") || "x-access-token";
132
+ return [
133
+ "github.com:",
134
+ " git_protocol: https",
135
+ ` user: ${u}`,
136
+ ` oauth_token: ${token}`,
137
+ " users:",
138
+ ` ${u}:`,
139
+ ` oauth_token: ${token}`,
140
+ ""
141
+ ].join("\n");
142
+ }
143
+ function materializeGithubAgentAuth(token, user) {
144
+ const trimmed = token.trim();
145
+ if (!trimmed) return;
146
+ const root = githubAgentAuthDir();
147
+ mkdirSync(root, { recursive: true, mode: 448 });
148
+ try {
149
+ chmodSync(root, 448);
150
+ } catch {
151
+ }
152
+ writePrivateFile(githubCredentialStorePath(), gitCredentialStoreContents(trimmed));
153
+ const ghDir = githubGhConfigDir();
154
+ mkdirSync(ghDir, { recursive: true, mode: 448 });
155
+ writePrivateFile(join2(ghDir, "hosts.yml"), ghHostsYml(trimmed, user));
156
+ writePrivateFile(join2(ghDir, "config.yml"), "git_protocol: https\nprompt: disabled\n");
157
+ }
158
+ function githubAgentAuthReady() {
159
+ return existsSync2(githubCredentialStorePath()) && existsSync2(join2(githubGhConfigDir(), "hosts.yml"));
160
+ }
161
+ function githubCredentialHelperGitConfig() {
162
+ const file = githubCredentialStorePath();
163
+ return [
164
+ { key: "credential.helper", value: "" },
165
+ { key: "credential.helper", value: `store --file=${file}` }
166
+ ];
167
+ }
168
+ function githubGhConfigEnv() {
169
+ return {
170
+ GH_CONFIG_DIR: githubGhConfigDir(),
171
+ GH_PROMPT_DISABLED: "1"
172
+ };
173
+ }
174
+
99
175
  // src/git/stale-lock.ts
100
- import { existsSync as existsSync2, statSync, unlinkSync } from "fs";
101
- import { join as join2 } from "path";
176
+ import { existsSync as existsSync3, statSync, unlinkSync } from "fs";
177
+ import { join as join3 } from "path";
102
178
  var STALE_INDEX_LOCK_MS = 2e4;
103
179
  function isIndexLockError(text) {
104
180
  return /Unable to create ['"][^'"]*index\.lock['"]: File exists/i.test(text);
105
181
  }
106
182
  function clearStaleIndexLock(gitDir, maxAgeMs = STALE_INDEX_LOCK_MS, now = Date.now()) {
107
- const lockPath = join2(gitDir, "index.lock");
183
+ const lockPath = join3(gitDir, "index.lock");
108
184
  try {
109
- if (!existsSync2(lockPath)) return null;
185
+ if (!existsSync3(lockPath)) return null;
110
186
  if (now - statSync(lockPath).mtimeMs < maxAgeMs) return null;
111
187
  unlinkSync(lockPath);
112
188
  return lockPath;
@@ -208,7 +284,10 @@ async function gh(args, cwd, opts) {
208
284
  timeoutMs: opts?.timeoutMs,
209
285
  env: {
210
286
  GH_PROMPT_DISABLED: "1",
211
- GIT_TERMINAL_PROMPT: "0"
287
+ GIT_TERMINAL_PROMPT: "0",
288
+ // Isolated hosts.yml uses git_protocol: https so `gh pr create` does not
289
+ // shell out over SSH when Settings → Git is SSH (ask_git in Electron).
290
+ ...githubAgentAuthReady() ? githubGhConfigEnv() : {}
212
291
  }
213
292
  });
214
293
  }
@@ -227,6 +306,11 @@ export {
227
306
  posixShellSingleQuote,
228
307
  resolveCommandBinarySync,
229
308
  withExportedPath,
309
+ githubAgentAuthDir,
310
+ materializeGithubAgentAuth,
311
+ githubAgentAuthReady,
312
+ githubCredentialHelperGitConfig,
313
+ githubGhConfigEnv,
230
314
  clearStaleIndexLocks,
231
315
  run,
232
316
  resolveGitDirsForLockRecovery,
@@ -2,16 +2,16 @@
2
2
 
3
3
  import {
4
4
  ensureGlobalCoordinatorCwd
5
- } from "./chunk-ZVYLEF72.js";
5
+ } from "./chunk-DMRIZR6M.js";
6
6
  import {
7
7
  allocateTeamName,
8
8
  takenSlugsFromThread,
9
9
  teamSlugFromName
10
- } from "./chunk-JTPDWTWJ.js";
10
+ } from "./chunk-Z2PVJKMN.js";
11
11
  import {
12
12
  ATTACHMENTS_DIR,
13
13
  attachmentsGitignoreBody
14
- } from "./chunk-B3SJXYIJ.js";
14
+ } from "./chunk-Y7YBWWIG.js";
15
15
  import {
16
16
  createEmptyThread,
17
17
  listThreads,
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  resolveNewThreadOptions,
23
23
  resolveThreadDefaults
24
- } from "./chunk-BGQBELGJ.js";
24
+ } from "./chunk-CZD4NRDZ.js";
25
25
  import {
26
26
  globalAgentCwd
27
27
  } from "./chunk-BD2ICC4D.js";
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {
4
+ git
5
+ } from "./chunk-FNQNJOHY.js";
6
+
7
+ // src/git/worktree-exclude.ts
8
+ import { mkdirSync, readFileSync, writeFileSync } from "fs";
9
+ import { dirname, join } from "path";
10
+ var WORKTREE_SIDEBOARD_EXCLUDE = ".sideboard/";
11
+ var EXCLUDE_COMMENT = "# Sideboard worktree scratch \u2014 do not commit";
12
+ function excludeHasSideboard(body) {
13
+ return body.split(/\r?\n/).some((line) => {
14
+ const t = line.trim();
15
+ return t === ".sideboard/" || t === ".sideboard" || t === "/.sideboard/";
16
+ });
17
+ }
18
+ async function ensureWorktreeSideboardIgnored(worktreePath) {
19
+ if (!worktreePath.trim()) return;
20
+ const gitDir = await git(["rev-parse", "--absolute-git-dir"], worktreePath, {
21
+ reject: false,
22
+ timeoutMs: 5e3
23
+ });
24
+ if (gitDir.exitCode !== 0) return;
25
+ const dir = gitDir.stdout.trim();
26
+ if (!dir) return;
27
+ const excludePath = join(dir, "info", "exclude");
28
+ mkdirSync(dirname(excludePath), { recursive: true });
29
+ let body = "";
30
+ try {
31
+ body = readFileSync(excludePath, "utf8");
32
+ } catch {
33
+ body = "";
34
+ }
35
+ if (!excludeHasSideboard(body)) {
36
+ const prefix = body && !body.endsWith("\n") ? `${body}
37
+ ` : body;
38
+ writeFileSync(
39
+ excludePath,
40
+ `${prefix}${EXCLUDE_COMMENT}
41
+ ${WORKTREE_SIDEBOARD_EXCLUDE}
42
+ `,
43
+ "utf8"
44
+ );
45
+ }
46
+ const listed = await git(["ls-files", "-z", "--", ".sideboard"], worktreePath, {
47
+ reject: false,
48
+ timeoutMs: 5e3
49
+ });
50
+ if (listed.exitCode !== 0 || !listed.stdout) return;
51
+ const files = listed.stdout.split("\0").filter(Boolean);
52
+ if (files.length === 0) return;
53
+ await git(["update-index", "--skip-worktree", "--", ...files], worktreePath, {
54
+ reject: false,
55
+ timeoutMs: 8e3
56
+ });
57
+ }
58
+
59
+ export {
60
+ WORKTREE_SIDEBOARD_EXCLUDE,
61
+ ensureWorktreeSideboardIgnored
62
+ };
@@ -4,7 +4,7 @@ import {
4
4
  ATTACHMENTS_DIR,
5
5
  LEGACY_ATTACHMENTS_DIR,
6
6
  attachmentsGitignoreBody
7
- } from "./chunk-B3SJXYIJ.js";
7
+ } from "./chunk-Y7YBWWIG.js";
8
8
 
9
9
  // src/plan/plan-file.ts
10
10
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -10,7 +10,7 @@ function attachmentsGitignoreBody() {
10
10
  }
11
11
  function isWorkspaceScratchPath(relativePath) {
12
12
  const p = relativePath.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/$/, "");
13
- return p === ATTACHMENTS_DIR || p.startsWith(`${ATTACHMENTS_DIR}/`) || p === LEGACY_ATTACHMENTS_DIR || p.startsWith(`${LEGACY_ATTACHMENTS_DIR}/`) || p === ".context" || p.startsWith(".context/");
13
+ return p === ATTACHMENTS_DIR || p.startsWith(`${ATTACHMENTS_DIR}/`) || p === LEGACY_ATTACHMENTS_DIR || p.startsWith(`${LEGACY_ATTACHMENTS_DIR}/`) || p === ".sideboard" || p.startsWith(".sideboard/") || p === ".context" || p.startsWith(".context/");
14
14
  }
15
15
 
16
16
  export {
@@ -6,7 +6,7 @@ import {
6
6
  getAbleTimeHost,
7
7
  isAbleTimeConnected,
8
8
  saveAbleTimeConnection
9
- } from "./chunk-I77RYPOH.js";
9
+ } from "./chunk-4XNSGDXE.js";
10
10
 
11
11
  // src/integrations/abletime-mcp.ts
12
12
  var DEFAULT_ABLETIME_HOST = "https://track.abletime.com";
@@ -0,0 +1,60 @@
1
+ import {
2
+ git
3
+ } from "./chunk-UFHNSFAS.js";
4
+
5
+ // src/git/worktree-exclude.ts
6
+ import { mkdirSync, readFileSync, writeFileSync } from "fs";
7
+ import { dirname, join } from "path";
8
+ var WORKTREE_SIDEBOARD_EXCLUDE = ".sideboard/";
9
+ var EXCLUDE_COMMENT = "# Sideboard worktree scratch \u2014 do not commit";
10
+ function excludeHasSideboard(body) {
11
+ return body.split(/\r?\n/).some((line) => {
12
+ const t = line.trim();
13
+ return t === ".sideboard/" || t === ".sideboard" || t === "/.sideboard/";
14
+ });
15
+ }
16
+ async function ensureWorktreeSideboardIgnored(worktreePath) {
17
+ if (!worktreePath.trim()) return;
18
+ const gitDir = await git(["rev-parse", "--absolute-git-dir"], worktreePath, {
19
+ reject: false,
20
+ timeoutMs: 5e3
21
+ });
22
+ if (gitDir.exitCode !== 0) return;
23
+ const dir = gitDir.stdout.trim();
24
+ if (!dir) return;
25
+ const excludePath = join(dir, "info", "exclude");
26
+ mkdirSync(dirname(excludePath), { recursive: true });
27
+ let body = "";
28
+ try {
29
+ body = readFileSync(excludePath, "utf8");
30
+ } catch {
31
+ body = "";
32
+ }
33
+ if (!excludeHasSideboard(body)) {
34
+ const prefix = body && !body.endsWith("\n") ? `${body}
35
+ ` : body;
36
+ writeFileSync(
37
+ excludePath,
38
+ `${prefix}${EXCLUDE_COMMENT}
39
+ ${WORKTREE_SIDEBOARD_EXCLUDE}
40
+ `,
41
+ "utf8"
42
+ );
43
+ }
44
+ const listed = await git(["ls-files", "-z", "--", ".sideboard"], worktreePath, {
45
+ reject: false,
46
+ timeoutMs: 5e3
47
+ });
48
+ if (listed.exitCode !== 0 || !listed.stdout) return;
49
+ const files = listed.stdout.split("\0").filter(Boolean);
50
+ if (files.length === 0) return;
51
+ await git(["update-index", "--skip-worktree", "--", ...files], worktreePath, {
52
+ reject: false,
53
+ timeoutMs: 8e3
54
+ });
55
+ }
56
+
57
+ export {
58
+ WORKTREE_SIDEBOARD_EXCLUDE,
59
+ ensureWorktreeSideboardIgnored
60
+ };
@@ -13,7 +13,7 @@ function attachmentsGitignoreBody() {
13
13
  }
14
14
  function isWorkspaceScratchPath(relativePath) {
15
15
  const p = relativePath.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/$/, "");
16
- return p === ATTACHMENTS_DIR || p.startsWith(`${ATTACHMENTS_DIR}/`) || p === LEGACY_ATTACHMENTS_DIR || p.startsWith(`${LEGACY_ATTACHMENTS_DIR}/`) || p === ".context" || p.startsWith(".context/");
16
+ return p === ATTACHMENTS_DIR || p.startsWith(`${ATTACHMENTS_DIR}/`) || p === LEGACY_ATTACHMENTS_DIR || p.startsWith(`${LEGACY_ATTACHMENTS_DIR}/`) || p === ".sideboard" || p.startsWith(".sideboard/") || p === ".context" || p.startsWith(".context/");
17
17
  }
18
18
 
19
19
  export {
@@ -5,26 +5,26 @@ import {
5
5
  brightsyMcpServerName,
6
6
  ensureCliTeamTracked,
7
7
  ensureConnectedBrightsyTeamTokens
8
- } from "./chunk-ED4UPEJX.js";
8
+ } from "./chunk-G7SIQFBQ.js";
9
9
  import {
10
10
  loadBrightsyConfig
11
11
  } from "./chunk-S42XV45P.js";
12
12
  import {
13
13
  isOrchestratorThread
14
- } from "./chunk-N3VNOFXQ.js";
14
+ } from "./chunk-VO4SPEBS.js";
15
15
  import {
16
16
  codexUnattendedGitConfigArgs,
17
17
  mergeAgentGitAuthEnv,
18
18
  resolveAgentGitAuthEnv,
19
19
  resolveCodexGitWritableRoots
20
- } from "./chunk-JTPDWTWJ.js";
20
+ } from "./chunk-Z2PVJKMN.js";
21
21
  import {
22
22
  enrichPathWithNpmGlobalBin,
23
23
  isConductorBundledCli,
24
24
  resolveCommandBinarySync,
25
25
  run,
26
26
  withExportedPath
27
- } from "./chunk-KPIYENTF.js";
27
+ } from "./chunk-FNQNJOHY.js";
28
28
  import {
29
29
  claudeChromeEnabled,
30
30
  isElectronLikeCommand,
@@ -33,7 +33,7 @@ import {
33
33
  resolveClaudeExecutable,
34
34
  unwrapStrippedElectronLaunch,
35
35
  wrapElectronAsNodeLaunch
36
- } from "./chunk-BGQBELGJ.js";
36
+ } from "./chunk-CZD4NRDZ.js";
37
37
  import {
38
38
  appDataDir
39
39
  } from "./chunk-BD2ICC4D.js";
@@ -283,7 +283,7 @@ function looksLikeRetryableRunnerCrash(text) {
283
283
  const lower = text.trim().toLowerCase();
284
284
  if (/cannot find (?:package|module)|err_module_not_found/.test(lower)) return false;
285
285
  if (!lower) return true;
286
- return /uv_run|spineventloopinternal|libuv|homebrew node \+ shared libuv|cursor runner crashed in node|hascustomhostobject|electroninitializeicuandstartnode|nested chromium|truncated crash dump|connection stalled|sig(?:segv|abrt|ill)|segmentation fault|illegal instruction|fatal error/.test(
286
+ return /uv_run|spineventloopinternal|libuv|homebrew node \+ shared libuv|cursor runner crashed in node|hascustomhostobject|electroninitializeicuandstartnode|nested chromium|truncated crash dump|connection stalled|network request failed|cursor startup failed:.+\(retryable\)|sig(?:segv|abrt|ill)|segmentation fault|illegal instruction|fatal error/.test(
287
287
  lower
288
288
  );
289
289
  }
@@ -351,6 +351,9 @@ function humanizeAgentFailDetail(detail) {
351
351
  if (/connection stalled/.test(lower)) {
352
352
  return /retry the turn/i.test(raw) ? raw : `${raw} \u2014 retry the turn (Sideboard will start a fresh Cursor session).`;
353
353
  }
354
+ if (/network request failed|cursor startup failed:.+\(retryable\)/.test(lower)) {
355
+ return /retry the turn/i.test(raw) ? raw : `${raw} \u2014 retry the turn (a transient Cursor SDK network error).`;
356
+ }
354
357
  return raw;
355
358
  }
356
359
  function turnFailChatText(opts) {
@@ -876,6 +879,13 @@ function isSubagentToolName(name) {
876
879
  if (/^(task|agent|spawn_agent)$/i.test(n)) return true;
877
880
  return /connectedAgentRequest/i.test(n);
878
881
  }
882
+ function isInternalAgentStatusText(text) {
883
+ const t = text.trim();
884
+ if (!t) return false;
885
+ if (/waiting for gate to pass/i.test(t)) return true;
886
+ if (/^agent is running\b/i.test(t) && t.length < 160) return true;
887
+ return false;
888
+ }
879
889
  function isPollWrapperToolName(name) {
880
890
  const n = (name ?? "").replace(/[_-]/g, "");
881
891
  return /^(taskoutput|taskstop|sleep)$/i.test(n);
@@ -883,7 +893,10 @@ function isPollWrapperToolName(name) {
883
893
  function lastTextPart(parts, type) {
884
894
  for (let i = parts.length - 1; i >= 0; i--) {
885
895
  const p = parts[i];
886
- if (p.type === type && p.text.trim()) return p.text.trim();
896
+ if (p.type !== type) continue;
897
+ const text = p.text.trim();
898
+ if (!text || isInternalAgentStatusText(text)) continue;
899
+ return text;
887
900
  }
888
901
  return "";
889
902
  }
@@ -2085,7 +2098,7 @@ var claudeAdapter = {
2085
2098
  );
2086
2099
  }
2087
2100
  const mode = permissionMode(thread);
2088
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-2SIPM4PW.js");
2101
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-4QHDAD2D.js");
2089
2102
  const isOrchestrator = isOrchestratorThread2(thread);
2090
2103
  const injectedServers = await buildInjectedMcpServers({
2091
2104
  includeSideboard: true,
@@ -3922,6 +3935,7 @@ export {
3922
3935
  listBrightsyChatTargets,
3923
3936
  brightsyAdapter,
3924
3937
  toolDescription,
3938
+ isInternalAgentStatusText,
3925
3939
  isPollWrapperToolName,
3926
3940
  liveActivitySummary,
3927
3941
  applyAgentEvent,