@sideboard-ai/core 0.1.111 → 0.1.116

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 (43) hide show
  1. package/dist/agents/cursor-runner.cjs +51 -21
  2. package/dist/agents/cursor-runner.js +3 -3
  3. package/dist/{agents-NN22A4G5.js → agents-7NIX44RB.js} +7 -7
  4. package/dist/{agents-GH3FWDW2.js → agents-DU7DHY7A.js} +10 -10
  5. package/dist/{chunk-JTQQPJAU.js → chunk-4HOFVKPC.js} +52 -38
  6. package/dist/{chunk-4EWPKYOU.js → chunk-4OJMZ6P2.js} +2 -2
  7. package/dist/{chunk-NC3U42ZP.js → chunk-5KSLD4MU.js} +317 -33
  8. package/dist/{chunk-KQBI5HNT.js → chunk-7WC5UWEB.js} +2 -2
  9. package/dist/{chunk-WIHKHR5R.js → chunk-AXQ4ZWHK.js} +5 -0
  10. package/dist/{chunk-LGXBYZZA.js → chunk-DVM4ID64.js} +69 -13
  11. package/dist/{chunk-DMJKOFTO.js → chunk-DWP25N32.js} +44 -35
  12. package/dist/{chunk-2GO3YKBA.js → chunk-EKIDHL2T.js} +4 -4
  13. package/dist/{chunk-C4KHDW3U.js → chunk-FZCIQYNQ.js} +1 -1
  14. package/dist/{chunk-363Z34PY.js → chunk-GBY7OOMB.js} +273 -218
  15. package/dist/{chunk-7KWYXGIU.js → chunk-K3TIQXOH.js} +2 -2
  16. package/dist/{chunk-3KETJKYA.js → chunk-KPIYENTF.js} +69 -13
  17. package/dist/{chunk-KVFNTWFG.js → chunk-OFF5AFCR.js} +300 -43
  18. package/dist/{chunk-VOD3HFLP.js → chunk-XOYQ7LNQ.js} +2 -2
  19. package/dist/{chunk-7YKXHBIW.js → chunk-YMRT2DU6.js} +3 -3
  20. package/dist/{chunk-YXDR43ZC.js → chunk-ZMROW673.js} +5 -5
  21. package/dist/{chunk-YFAXVUY2.js → chunk-ZRCX43LS.js} +2 -2
  22. package/dist/{chunk-AROMOP3C.js → chunk-ZYEFCSZJ.js} +2 -2
  23. package/dist/{connected-teams-M5XNXRI5.js → connected-teams-O6D4PM7A.js} +2 -2
  24. package/dist/{connected-teams-J4I5AKMR.js → connected-teams-ZCOU6KCD.js} +2 -2
  25. package/dist/{coordinator-prompt-AR66L3N4.js → coordinator-prompt-4KCALEKD.js} +3 -3
  26. package/dist/{coordinator-prompt-BHMLWL64.js → coordinator-prompt-FML4I5AR.js} +3 -3
  27. package/dist/{global-workspace-XSUFEIAQ.js → global-workspace-CSWABOG5.js} +4 -4
  28. package/dist/{global-workspace-SKFODUQQ.js → global-workspace-H4YNASM6.js} +4 -4
  29. package/dist/index.cjs +855 -440
  30. package/dist/index.d.cts +59 -1
  31. package/dist/index.d.ts +59 -1
  32. package/dist/index.js +37 -17
  33. package/dist/mcp/run-stdio.cjs +966 -635
  34. package/dist/mcp/run-stdio.js +20 -16
  35. package/dist/{orchestrator-4T2SXDZ7.js → orchestrator-NXPANCZA.js} +8 -8
  36. package/dist/{orchestrator-EP57AB5W.js → orchestrator-ZY4RUJKT.js} +10 -10
  37. package/dist/{run-XKTAJRWF.js → run-USF6FRKV.js} +3 -1
  38. package/dist/{run-CFKZPY7F.js → run-XQKGHQZ2.js} +3 -1
  39. package/dist/{workspaces-XAQVKTLO.js → workspaces-HJ3EVATC.js} +5 -5
  40. package/dist/{workspaces-HV3J4TTW.js → workspaces-QG6PGFQR.js} +5 -5
  41. package/dist/{worktree-XFJED3VU.js → worktree-IW3BX26B.js} +2 -2
  42. package/dist/{worktree-N2EV24EE.js → worktree-OTFQO2W7.js} +2 -2
  43. package/package.json +1 -1
@@ -3,8 +3,8 @@
3
3
 
4
4
  // src/agents/cursor-runner.ts
5
5
  var import_sdk = require("@cursor/sdk");
6
- var import_node_fs9 = require("fs");
7
- var import_node_path10 = require("path");
6
+ var import_node_fs10 = require("fs");
7
+ var import_node_path11 = require("path");
8
8
  var import_node_readline2 = require("readline");
9
9
 
10
10
  // src/hook/nested-electron-env.ts
@@ -55,14 +55,14 @@ function appDataDir() {
55
55
  }
56
56
 
57
57
  // src/agents/cursor-ripgrep.ts
58
- var import_node_fs8 = require("fs");
58
+ var import_node_fs9 = require("fs");
59
59
  var import_node_module = require("module");
60
- var import_node_path9 = require("path");
60
+ var import_node_path10 = require("path");
61
61
 
62
62
  // src/agents/node-launch.ts
63
- var import_node_fs7 = require("fs");
63
+ var import_node_fs8 = require("fs");
64
64
  var import_node_os4 = require("os");
65
- var import_node_path8 = require("path");
65
+ var import_node_path9 = require("path");
66
66
 
67
67
  // src/git/run.ts
68
68
  var import_execa2 = require("execa");
@@ -73,9 +73,13 @@ var import_node_child_process = require("child_process");
73
73
  var import_node_os3 = require("os");
74
74
  var import_node_path6 = require("path");
75
75
 
76
- // src/agents/packaged-runtime.ts
76
+ // src/git/stale-lock.ts
77
77
  var import_node_fs6 = require("fs");
78
78
  var import_node_path7 = require("path");
79
+
80
+ // src/agents/packaged-runtime.ts
81
+ var import_node_fs7 = require("fs");
82
+ var import_node_path8 = require("path");
79
83
  function electronResourcesPath() {
80
84
  const resources = process.resourcesPath;
81
85
  if (typeof resources !== "string" || !resources) return null;
@@ -84,14 +88,14 @@ function electronResourcesPath() {
84
88
  function packagedCursorRuntimeDir() {
85
89
  const resources = electronResourcesPath();
86
90
  if (!resources) return null;
87
- const dir = (0, import_node_path7.join)(resources, "cursor-runtime");
88
- if (!(0, import_node_fs6.existsSync)((0, import_node_path7.join)(dir, "core-dist", "agents", "cursor-runner.js"))) return null;
91
+ const dir = (0, import_node_path8.join)(resources, "cursor-runtime");
92
+ if (!(0, import_node_fs7.existsSync)((0, import_node_path8.join)(dir, "core-dist", "agents", "cursor-runner.js"))) return null;
89
93
  return dir;
90
94
  }
91
95
  function packagedCursorRipgrepCandidate(platformPkg, binName) {
92
96
  const dir = packagedCursorRuntimeDir();
93
97
  if (!dir) return null;
94
- return (0, import_node_path7.join)(dir, "node_modules", platformPkg, "bin", binName);
98
+ return (0, import_node_path8.join)(dir, "node_modules", platformPkg, "bin", binName);
95
99
  }
96
100
 
97
101
  // src/agents/node-launch.ts
@@ -103,7 +107,7 @@ function unpackedAsarPath(filePath) {
103
107
  if (!isAsarPath(filePath)) return null;
104
108
  const unpacked = filePath.replace(/\.asar(?=[/\\])/, ".asar.unpacked");
105
109
  if (unpacked === filePath) return null;
106
- return (0, import_node_fs7.existsSync)(unpacked) ? unpacked : null;
110
+ return (0, import_node_fs8.existsSync)(unpacked) ? unpacked : null;
107
111
  }
108
112
  function nodeReadableScriptPath(scriptPath) {
109
113
  return unpackedAsarPath(scriptPath) ?? scriptPath;
@@ -119,21 +123,21 @@ function platformRipgrepPackage() {
119
123
  }
120
124
  function usableRipgrepPath(candidate) {
121
125
  const raw = candidate?.trim();
122
- if (!raw || !(0, import_node_path9.isAbsolute)(raw)) return null;
126
+ if (!raw || !(0, import_node_path10.isAbsolute)(raw)) return null;
123
127
  const readable = nodeReadableScriptPath(raw);
124
- if (!(0, import_node_fs8.existsSync)(readable) || isAsarPath(readable)) return null;
128
+ if (!(0, import_node_fs9.existsSync)(readable) || isAsarPath(readable)) return null;
125
129
  return readable;
126
130
  }
127
131
  function walkForBundledRipgrep(startFile) {
128
132
  if (!startFile) return null;
129
133
  const pkg = platformRipgrepPackage();
130
134
  const name = rgBinaryName();
131
- let dir = (0, import_node_path9.dirname)((0, import_node_path9.resolve)(startFile));
132
- const root = (0, import_node_path9.parse)(dir).root;
135
+ let dir = (0, import_node_path10.dirname)((0, import_node_path10.resolve)(startFile));
136
+ const root = (0, import_node_path10.parse)(dir).root;
133
137
  while (dir !== root) {
134
- const hit = usableRipgrepPath((0, import_node_path9.join)(dir, "node_modules", pkg, "bin", name));
138
+ const hit = usableRipgrepPath((0, import_node_path10.join)(dir, "node_modules", pkg, "bin", name));
135
139
  if (hit) return hit;
136
- const next = (0, import_node_path9.dirname)(dir);
140
+ const next = (0, import_node_path10.dirname)(dir);
137
141
  if (next === dir) break;
138
142
  dir = next;
139
143
  }
@@ -143,7 +147,7 @@ function requireResolveBundledRipgrep(fromFile) {
143
147
  try {
144
148
  const req = (0, import_node_module.createRequire)(fromFile);
145
149
  const pkgJson = req.resolve(`${platformRipgrepPackage()}/package.json`);
146
- return usableRipgrepPath((0, import_node_path9.join)((0, import_node_path9.dirname)(pkgJson), "bin", rgBinaryName()));
150
+ return usableRipgrepPath((0, import_node_path10.join)((0, import_node_path10.dirname)(pkgJson), "bin", rgBinaryName()));
147
151
  } catch {
148
152
  return null;
149
153
  }
@@ -395,7 +399,7 @@ function cursorSdkMessageToEvents(msg) {
395
399
  if (msg.type === "tool_call" && msg.call_id && msg.name) {
396
400
  const normalized = normalizeCursorToolCall(msg.name, msg.args);
397
401
  if (msg.status === "running") {
398
- return [
402
+ const events = [
399
403
  {
400
404
  type: "tool_use",
401
405
  id: msg.call_id,
@@ -403,6 +407,16 @@ function cursorSdkMessageToEvents(msg) {
403
407
  input: normalized.input
404
408
  }
405
409
  ];
410
+ const live = unwrapCursorToolResult(msg.result);
411
+ if (live) {
412
+ events.push({
413
+ type: "tool_result",
414
+ id: msg.call_id,
415
+ content: live,
416
+ partial: true
417
+ });
418
+ }
419
+ return events;
406
420
  }
407
421
  if (msg.status === "completed" || msg.status === "error") {
408
422
  return [
@@ -463,6 +477,17 @@ function nestedUpdateToEvents(update, parentId) {
463
477
  isError: cursorToolResultIsError(void 0, update.toolCall.result),
464
478
  parentId
465
479
  });
480
+ } else {
481
+ const live = unwrapCursorToolResult(update.toolCall.result);
482
+ if (live) {
483
+ events.push({
484
+ type: "tool_result",
485
+ id: update.callId,
486
+ content: live,
487
+ partial: true,
488
+ parentId
489
+ });
490
+ }
466
491
  }
467
492
  return events;
468
493
  }
@@ -514,6 +539,11 @@ function createAgentStreamCoalescer(emit2, opts) {
514
539
  return;
515
540
  }
516
541
  if (!event.data) return;
542
+ if (event.type === "thinking" && event.replace) {
543
+ flush();
544
+ emit2(event);
545
+ return;
546
+ }
517
547
  if (pending && pending.type === event.type && parentKey(pending) === parentKey(event)) {
518
548
  pending.data += event.data;
519
549
  } else {
@@ -552,8 +582,8 @@ function modelSelection(model, opts) {
552
582
  return params.length > 0 ? { id, params } : { id };
553
583
  }
554
584
  function localAgentStore() {
555
- const root = (0, import_node_path10.join)(appDataDir(), "cursor-sdk-store");
556
- (0, import_node_fs9.mkdirSync)(root, { recursive: true });
585
+ const root = (0, import_node_path11.join)(appDataDir(), "cursor-sdk-store");
586
+ (0, import_node_fs10.mkdirSync)(root, { recursive: true });
557
587
  return new import_sdk.JsonlLocalAgentStore(root);
558
588
  }
559
589
  async function cancelStaleLocalRuns(agentId, opts) {
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createAgentStreamCoalescer
4
- } from "../chunk-WIHKHR5R.js";
4
+ } from "../chunk-AXQ4ZWHK.js";
5
5
  import {
6
6
  cursorDeltaToEvents,
7
7
  cursorSdkMessageToEvents,
8
8
  ensureCursorRipgrepPath,
9
9
  formatUnknownDetail
10
- } from "../chunk-363Z34PY.js";
10
+ } from "../chunk-GBY7OOMB.js";
11
11
  import {
12
12
  dropNestedElectronEnvFromProcess
13
13
  } from "../chunk-4TR3HZFT.js";
14
14
  import {
15
15
  appDataDir
16
16
  } from "../chunk-QZQEXME2.js";
17
- import "../chunk-LGXBYZZA.js";
17
+ import "../chunk-DVM4ID64.js";
18
18
 
19
19
  // src/agents/cursor-runner.ts
20
20
  import { Agent, CursorAgentError, JsonlLocalAgentStore } from "@cursor/sdk";
@@ -28,20 +28,20 @@ import {
28
28
  resolveCursorModelId,
29
29
  resolveLoginCommand,
30
30
  resolveQuotaFallbackAgent
31
- } from "./chunk-NC3U42ZP.js";
32
- import "./chunk-2GO3YKBA.js";
31
+ } from "./chunk-5KSLD4MU.js";
32
+ import "./chunk-EKIDHL2T.js";
33
33
  import {
34
34
  ORCHESTRATOR_AGENT_KINDS,
35
35
  assertOrchestratorCapableAgent,
36
36
  coerceOrchestratorAgent,
37
37
  isOrchestratorCapableAgent
38
- } from "./chunk-4EWPKYOU.js";
39
- import "./chunk-KQBI5HNT.js";
38
+ } from "./chunk-4OJMZ6P2.js";
39
+ import "./chunk-7WC5UWEB.js";
40
40
  import {
41
41
  cursorSdkMessageToEvents,
42
42
  parseCursorRunnerLine
43
- } from "./chunk-363Z34PY.js";
44
- import "./chunk-C4KHDW3U.js";
43
+ } from "./chunk-GBY7OOMB.js";
44
+ import "./chunk-FZCIQYNQ.js";
45
45
  import "./chunk-FKOIHGKV.js";
46
46
  import "./chunk-4NR5FL46.js";
47
47
  import "./chunk-4TR3HZFT.js";
@@ -57,7 +57,7 @@ import {
57
57
  posixShellSingleQuote,
58
58
  resolveCommandBinarySync,
59
59
  withExportedPath
60
- } from "./chunk-LGXBYZZA.js";
60
+ } from "./chunk-DVM4ID64.js";
61
61
  export {
62
62
  CLAUDE_MODEL_CATALOG,
63
63
  ORCHESTRATOR_AGENT_KINDS,
@@ -32,22 +32,18 @@ import {
32
32
  resolveCursorModelId,
33
33
  resolveLoginCommand,
34
34
  resolveQuotaFallbackAgent
35
- } from "./chunk-KVFNTWFG.js";
36
- import "./chunk-7YKXHBIW.js";
35
+ } from "./chunk-OFF5AFCR.js";
36
+ import "./chunk-YMRT2DU6.js";
37
37
  import {
38
38
  ORCHESTRATOR_AGENT_KINDS,
39
39
  assertOrchestratorCapableAgent,
40
40
  coerceOrchestratorAgent,
41
41
  isOrchestratorCapableAgent
42
- } from "./chunk-VOD3HFLP.js";
43
- import "./chunk-AROMOP3C.js";
44
- import "./chunk-YXDR43ZC.js";
42
+ } from "./chunk-XOYQ7LNQ.js";
43
+ import "./chunk-ZYEFCSZJ.js";
44
+ import "./chunk-ZMROW673.js";
45
45
  import "./chunk-B3SJXYIJ.js";
46
46
  import "./chunk-KYOTBZ6S.js";
47
- import "./chunk-SGEVS5SY.js";
48
- import "./chunk-NSTQ6QKD.js";
49
- import "./chunk-KGZBYWZ3.js";
50
- import "./chunk-BD2ICC4D.js";
51
47
  import {
52
48
  conductorBundledBinDir,
53
49
  enrichPathWithNpmGlobalBin,
@@ -56,7 +52,11 @@ import {
56
52
  posixShellSingleQuote,
57
53
  resolveCommandBinarySync,
58
54
  withExportedPath
59
- } from "./chunk-3KETJKYA.js";
55
+ } from "./chunk-KPIYENTF.js";
56
+ import "./chunk-SGEVS5SY.js";
57
+ import "./chunk-NSTQ6QKD.js";
58
+ import "./chunk-KGZBYWZ3.js";
59
+ import "./chunk-BD2ICC4D.js";
60
60
  export {
61
61
  CLAUDE_MODEL_CATALOG,
62
62
  ORCHESTRATOR_AGENT_KINDS,
@@ -3,6 +3,7 @@
3
3
  import {
4
4
  PLAN_MODE_INSTRUCTION,
5
5
  applyAgentEvent,
6
+ applyAgentRunnerHeapEnv,
6
7
  applyTurnUsage,
7
8
  contextTokens,
8
9
  fallbackTurnFailDetail,
@@ -10,9 +11,12 @@ import {
10
11
  formatTurnExitError,
11
12
  getAdapter,
12
13
  isBrightsyNdjsonLine,
14
+ isPollWrapperToolName,
13
15
  isSessionQuotaLimit,
16
+ liveActivitySummary,
14
17
  looksLikeAgentFailureMessage,
15
18
  looksLikeInvalidAgentSession,
19
+ looksLikeV8Oom,
16
20
  normalizeParseResult,
17
21
  parseBrightsyCliLine,
18
22
  parseSessionQuotaResetAt,
@@ -24,13 +28,13 @@ import {
24
28
  summarizeTurnStderr,
25
29
  toolDescription,
26
30
  turnFailChatText
27
- } from "./chunk-KVFNTWFG.js";
31
+ } from "./chunk-OFF5AFCR.js";
28
32
  import {
29
33
  addWorkspace,
30
34
  ensureWorkspace,
31
35
  removeWorkspace,
32
36
  syncWorkspacesFromThreads
33
- } from "./chunk-YFAXVUY2.js";
37
+ } from "./chunk-ZRCX43LS.js";
34
38
  import {
35
39
  extractPresentedPlan,
36
40
  readPlanFile,
@@ -51,14 +55,14 @@ import {
51
55
  isOrchestratorThread,
52
56
  isSlackCoordinatorThread,
53
57
  orchestratorSessionPoisonedByBuiltins
54
- } from "./chunk-VOD3HFLP.js";
58
+ } from "./chunk-XOYQ7LNQ.js";
55
59
  import {
56
60
  SLACK_REPLY_FORMATTING,
57
61
  coordinatorSystemPrompt,
58
62
  coordinatorTurnReminder,
59
63
  enrichWorkspacesWithGithub,
60
64
  ensureGlobalCoordinatorCwd
61
- } from "./chunk-AROMOP3C.js";
65
+ } from "./chunk-ZYEFCSZJ.js";
62
66
  import {
63
67
  addPrStackLayer,
64
68
  allocateTeamName,
@@ -101,7 +105,7 @@ import {
101
105
  threadDisplayLabel,
102
106
  withRepoGitLock,
103
107
  worktreeNameFromPath
104
- } from "./chunk-YXDR43ZC.js";
108
+ } from "./chunk-ZMROW673.js";
105
109
  import {
106
110
  ATTACHMENTS_DIR,
107
111
  LEGACY_ATTACHMENTS_DIR,
@@ -119,6 +123,14 @@ import {
119
123
  withThreadLock,
120
124
  writeThread
121
125
  } from "./chunk-KYOTBZ6S.js";
126
+ import {
127
+ clearStaleIndexLocks,
128
+ enrichPathWithNpmGlobalBin,
129
+ ensureAgentPath,
130
+ git,
131
+ resolveGitDirsForLockRecovery,
132
+ run
133
+ } from "./chunk-KPIYENTF.js";
122
134
  import {
123
135
  childEnvWithAppSettings,
124
136
  isSecureFileEncrypted,
@@ -148,12 +160,6 @@ import {
148
160
  workspaceSettingsSourceLabel,
149
161
  worktreesRoot
150
162
  } from "./chunk-BD2ICC4D.js";
151
- import {
152
- enrichPathWithNpmGlobalBin,
153
- ensureAgentPath,
154
- git,
155
- run
156
- } from "./chunk-3KETJKYA.js";
157
163
 
158
164
  // src/orchestrator/orchestrator.ts
159
165
  import { EventEmitter } from "events";
@@ -699,6 +705,11 @@ function createAgentStreamCoalescer(emit, opts) {
699
705
  return;
700
706
  }
701
707
  if (!event.data) return;
708
+ if (event.type === "thinking" && event.replace) {
709
+ flush2();
710
+ emit(event);
711
+ return;
712
+ }
702
713
  if (pending && pending.type === event.type && parentKey(pending) === parentKey(event)) {
703
714
  pending.data += event.data;
704
715
  } else {
@@ -731,9 +742,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
731
742
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
732
743
  );
733
744
  }
734
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-SKFODUQQ.js");
745
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-H4YNASM6.js");
735
746
  if (isGlobalThread2(thread)) {
736
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-BHMLWL64.js");
747
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-FML4I5AR.js");
737
748
  ensureGlobalCoordinatorCwd2(
738
749
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
739
750
  );
@@ -750,6 +761,7 @@ async function spawnAgentTurn(thread, input, onEvent) {
750
761
  }
751
762
  const env = childEnvWithAppSettings(cmd.env);
752
763
  applyPromptCacheTtlEnv(thread.agent, env);
764
+ applyAgentRunnerHeapEnv(env);
753
765
  try {
754
766
  if (isOrchestratorThread(thread)) {
755
767
  mergeAgentGitAuthEnv(env, await resolveAgentGitAuthEnv(env));
@@ -2398,7 +2410,7 @@ async function createThread(input, _onSetupLine) {
2398
2410
  return readThread(thread.id) ?? thread;
2399
2411
  }
2400
2412
  async function listLinearIssues(agent, repoPath) {
2401
- const { getAdapter: getAdapter2 } = await import("./agents-GH3FWDW2.js");
2413
+ const { getAdapter: getAdapter2 } = await import("./agents-DU7DHY7A.js");
2402
2414
  await requireAgent(agent, { requireLinear: true });
2403
2415
  const adapter = getAdapter2(agent);
2404
2416
  if (!adapter.listLinearIssues) {
@@ -2446,21 +2458,13 @@ function summarizeTurnLive(parts) {
2446
2458
  (p) => p.type === "tool"
2447
2459
  );
2448
2460
  const lastTool = tools[tools.length - 1];
2449
- const lastToolLabel = lastTool ? lastTool.description || toolDescription(lastTool.name, lastTool.input) || lastTool.name : void 0;
2450
- const running = lastTool?.status === "running";
2461
+ const interesting = [...tools].reverse().find((t) => !isPollWrapperToolName(t.name)) ?? lastTool;
2462
+ const lastToolLabel = interesting ? interesting.description || toolDescription(interesting.name, interesting.input) || interesting.name : void 0;
2451
2463
  const thinking = lastText(parts, "thinking");
2452
2464
  const text = lastText(parts, "text");
2453
2465
  const excerptRaw = thinking || text;
2454
2466
  const excerpt = excerptRaw.length > 280 ? `${excerptRaw.slice(-280)}` : excerptRaw || void 0;
2455
- let summary = "Working\u2026";
2456
- if (lastToolLabel) {
2457
- const verb = running ? lastToolLabel : `Finished ${lastToolLabel}`;
2458
- summary = tools.length > 1 ? `${verb} (${tools.length} tools)` : verb;
2459
- } else if (thinking) {
2460
- summary = "Thinking\u2026";
2461
- } else if (text) {
2462
- summary = "Writing reply\u2026";
2463
- }
2467
+ const summary = liveActivitySummary(parts);
2464
2468
  return {
2465
2469
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2466
2470
  summary,
@@ -2772,7 +2776,7 @@ async function adoptThread(input) {
2772
2776
  throw new Error(`Worktree not found: ${input.worktreePath}`);
2773
2777
  }
2774
2778
  const repoPath = await resolveRepoRoot(input.worktreePath);
2775
- const { stdout: branch } = await import("./run-XKTAJRWF.js").then(
2779
+ const { stdout: branch } = await import("./run-USF6FRKV.js").then(
2776
2780
  ({ git: git2 }) => git2(["rev-parse", "--abbrev-ref", "HEAD"], input.worktreePath)
2777
2781
  );
2778
2782
  const thread = createEmptyThread({
@@ -2787,7 +2791,7 @@ async function adoptThread(input) {
2787
2791
  messages: input.messages ?? []
2788
2792
  });
2789
2793
  writeThread(thread);
2790
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-XAQVKTLO.js");
2794
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-HJ3EVATC.js");
2791
2795
  await ensureWorkspace2(repoPath);
2792
2796
  return thread;
2793
2797
  }
@@ -4084,7 +4088,7 @@ async function confirmLand(thread, opts) {
4084
4088
  if (preview.dirty) {
4085
4089
  committed = await commitAll(thread.worktreePath, meta.commitMessage);
4086
4090
  }
4087
- const { git: git2 } = await import("./run-XKTAJRWF.js");
4091
+ const { git: git2 } = await import("./run-USF6FRKV.js");
4088
4092
  const { stdout: headOut } = await git2(
4089
4093
  ["rev-parse", "--abbrev-ref", "HEAD"],
4090
4094
  thread.worktreePath,
@@ -4642,14 +4646,15 @@ function formatArtifactDirective() {
4642
4646
  return [
4643
4647
  "Sideboard side column (desktop UI):",
4644
4648
  "claude.ai\u2019s \u201CArtifact\u201D tool does NOT exist in Claude Code. That is expected.",
4649
+ "Do not unprompted-duplicate a payload. Chat markdown (including tables) already renders in the transcript \u2014 do not also call present_schema with those same rows just to display them. If the user asks for an editable / interactive table, call present_schema even if markdown already showed the data. Do not also call present_artifact for a document you already fenced in chat.",
4645
4650
  "Documents (HTML/SVG/markdown):",
4646
4651
  "1) Emit a fenced code block tagged `html` (preferred), `svg`, or `markdown` with the FULL document \u2014 Sideboard opens a side column. Example:",
4647
4652
  "```html",
4648
4653
  "<!DOCTYPE html><html><head><title>Demo</title></head><body><h1>Hi</h1></body></html>",
4649
4654
  "```",
4650
- "2) Or call Sideboard MCP `present_artifact` with title, type (html|svg|markdown), and content.",
4655
+ "2) Or call Sideboard MCP `present_artifact` with title, type (html|svg|markdown), and content \u2014 not both a fence and this tool for the same body.",
4651
4656
  "CMS / JSON Schema forms & tables (Brightsy or any schema+schemaUi source):",
4652
- "3) Call Sideboard MCP `present_schema` with title, mode (table|form), and either:",
4657
+ "3) Call Sideboard MCP `present_schema` when the user needs to filter, edit, publish, or persist rows \u2014 including after you already showed a markdown table, if they then ask for an editable table. If they only need to read the data, a markdown table is enough. When you do call it, pass title, mode (table|form), and either:",
4653
4658
  " - datasource=brightsy + resource_id (record type UUID) after fetching types via Brightsy MCP, or",
4654
4659
  " - datasource=inline + resource: { id, title, schema, schemaUi } and optional records/record.",
4655
4660
  "Files / media browser (CMS file manager column):",
@@ -4658,11 +4663,11 @@ function formatArtifactDirective() {
4658
4663
  "Multiple-choice questions:",
4659
4664
  "5) Call Sideboard MCP `ask_user` only when work is blocked on choosing among a few concrete options (approach forks, which API, auth vs cookies). First write a short chat message that explains the decision and what each option means (tradeoffs, when to pick it). Include a description on every option. After calling, stop and wait for their next message with answers. If you are asking a real multiple-choice, use ask_user rather than chat bullets so Sideboard shows the composer picker.",
4660
4665
  "Do not call ask_user for greetings, check-ins, \u201Chello\u201D, open-ended how-can-I-help, or to invent a menu of possible next tasks \u2014 reply in chat. If one option is the obvious default, proceed without asking.",
4661
- "Never say artifacts, CMS UI, or the Files column are unavailable. Prefer present_schema for list/edit/publish; present_files for storage UI; html fences for standalone pages; ask_user only for those blocked predefined-option questions."
4666
+ "Never say artifacts, CMS UI, or the Files column are unavailable. present_schema is for interactive list/edit/publish (use it when they ask to edit, even if chat already had a markdown table); present_files for storage UI; html fences for standalone pages; ask_user only for those blocked predefined-option questions."
4662
4667
  ].join("\n");
4663
4668
  }
4664
4669
  function formatUiReminder() {
4665
- return "Sideboard UI: html fence or present_artifact / present_schema / present_files; ask_user only for a real multiple-choice (not hellos or \u201Cwhat next?\u201D) \u2014 reply in chat. Do not say artifacts/CMS UI are unavailable.";
4670
+ return "Sideboard UI: markdown table is enough to read data; present_schema if they ask to edit/filter (even after markdown); present_files for the file manager. html fence or present_artifact, not both for the same document. ask_user only for a real multiple-choice (not hellos or \u201Cwhat next?\u201D) \u2014 reply in chat. Do not say artifacts/CMS UI are unavailable.";
4666
4671
  }
4667
4672
 
4668
4673
  // src/threads/sync-branch.ts
@@ -4933,7 +4938,7 @@ function formatScheduledPrompt(name, prompt) {
4933
4938
  ${prompt}`;
4934
4939
  }
4935
4940
  async function defaultDeps() {
4936
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-4T2SXDZ7.js");
4941
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-NXPANCZA.js");
4937
4942
  const orch = getOrchestrator2();
4938
4943
  return {
4939
4944
  findThread: (id) => findThreadByRef(id),
@@ -5725,7 +5730,15 @@ var Orchestrator = class {
5725
5730
  hasSession: Boolean(this.requireThread(threadId).sessionId)
5726
5731
  })) {
5727
5732
  updateThread(threadId, { sessionId: null });
5728
- const retryNote = looksLikeInvalidAgentSession(detail) ? "Agent session missing \u2014 starting a fresh session" : "Agent runner crashed \u2014 restarting Node once";
5733
+ try {
5734
+ const gitDirs = await resolveGitDirsForLockRecovery(thread.worktreePath);
5735
+ const clearedLocks = clearStaleIndexLocks(gitDirs, 2e3);
5736
+ if (clearedLocks.length > 0) {
5737
+ pushTurnStderr(stderrTail, "Cleared a stale git lock left by the crashed agent process");
5738
+ }
5739
+ } catch {
5740
+ }
5741
+ const retryNote = looksLikeInvalidAgentSession(detail) ? "Agent session missing \u2014 starting a fresh session" : looksLikeV8Oom(detail) ? "Agent ran out of memory \u2014 starting a fresh session" : "Agent runner crashed \u2014 restarting Node once";
5729
5742
  pushTurnStderr(stderrTail, retryNote);
5730
5743
  this.emit({
5731
5744
  type: "turn_output",
@@ -6197,13 +6210,14 @@ var Orchestrator = class {
6197
6210
  const text = (lastAgent?.text ?? "").trim() || (thread.status === "error" ? lastError ?? "" : "");
6198
6211
  const stillRunning = thread.status === "running" || thread.status === "queued";
6199
6212
  const live = stillRunning ? readTurnLive(thread.id) : null;
6213
+ const queuedHint = thread.status === "queued" && !live?.summary ? "Queued \u2014 waiting for a concurrency slot" : null;
6200
6214
  return {
6201
6215
  text,
6202
6216
  status: thread.status,
6203
6217
  sessionId: thread.sessionId,
6204
6218
  lastError,
6205
6219
  stillRunning,
6206
- progress: live?.summary ?? null,
6220
+ progress: live?.summary ?? queuedHint,
6207
6221
  lastActivityAt: live?.updatedAt ?? null
6208
6222
  };
6209
6223
  }
@@ -6672,7 +6686,7 @@ var Orchestrator = class {
6672
6686
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
6673
6687
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
6674
6688
  try {
6675
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-XAQVKTLO.js");
6689
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-HJ3EVATC.js");
6676
6690
  await ensureWorkspace2(thread.repoPath);
6677
6691
  } catch {
6678
6692
  }
@@ -6726,7 +6740,7 @@ var Orchestrator = class {
6726
6740
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
6727
6741
  );
6728
6742
  }
6729
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-N2EV24EE.js");
6743
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-OTFQO2W7.js");
6730
6744
  const slug = thread.worktreePath.split("/").pop();
6731
6745
  const dest = thread.worktreePath;
6732
6746
  await withRepoGitLock(thread.repoPath, async () => {
@@ -6834,7 +6848,7 @@ async function startOrchestration(opts) {
6834
6848
  sourceRef: "default",
6835
6849
  ...createOpts
6836
6850
  }).catch(async () => {
6837
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-N2EV24EE.js");
6851
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-OTFQO2W7.js");
6838
6852
  const repo = await resolveRepoRoot2(repoPath);
6839
6853
  const def = await resolveDefaultBranch2(repo);
6840
6854
  return orch.createThread({
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ensureGlobalCoordinatorCwd
3
- } from "./chunk-KQBI5HNT.js";
3
+ } from "./chunk-7WC5UWEB.js";
4
4
  import {
5
5
  allocateTeamName,
6
6
  takenSlugsFromThread,
7
7
  teamSlugFromName
8
- } from "./chunk-C4KHDW3U.js";
8
+ } from "./chunk-FZCIQYNQ.js";
9
9
  import {
10
10
  resolveNewThreadOptions,
11
11
  resolveThreadDefaults