@sideboard-ai/core 0.1.234 → 0.1.236

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 (67) hide show
  1. package/dist/{abletime-WZNDTRVL.js → abletime-KOGCIQCO.js} +5 -5
  2. package/dist/{abletime-BGVOCEOU.js → abletime-VSV6AUBV.js} +5 -5
  3. package/dist/{abletime-oauth-ZLU2EYRK.js → abletime-oauth-LY7KZICW.js} +4 -4
  4. package/dist/{abletime-oauth-6M5GWEPX.js → abletime-oauth-QMDV45JC.js} +4 -4
  5. package/dist/{abletime-rest-WNHIATB3.js → abletime-rest-LXOWKPL7.js} +4 -4
  6. package/dist/{abletime-rest-F7XG5NGY.js → abletime-rest-NL56UVK5.js} +4 -4
  7. package/dist/agents/cursor-runner.cjs +39 -35
  8. package/dist/agents/cursor-runner.js +3 -3
  9. package/dist/{agents-BTXL6R5I.js → agents-JC6DRIT3.js} +9 -9
  10. package/dist/{agents-WMN7C322.js → agents-S4HYHRL3.js} +8 -8
  11. package/dist/{app-settings-KBL2G7M4.js → app-settings-2CFCRYD7.js} +2 -2
  12. package/dist/{app-settings-UXWCPDEA.js → app-settings-I27UBVI4.js} +2 -2
  13. package/dist/{caffeinate-hold-OK4JJ5PP.js → caffeinate-hold-FNKIPXDU.js} +2 -2
  14. package/dist/{caffeinate-hold-22VFDPSO.js → caffeinate-hold-PXHGH7ZN.js} +2 -2
  15. package/dist/{chunk-7J72QJOM.js → chunk-224IXQOM.js} +1 -1
  16. package/dist/{chunk-4VGCG2HV.js → chunk-3AJUH66R.js} +2 -2
  17. package/dist/{chunk-P6ZM5QJW.js → chunk-3PGFAVFL.js} +2 -2
  18. package/dist/{chunk-RZTRWN2V.js → chunk-4H5WO4H3.js} +1 -1
  19. package/dist/{chunk-MVLXDYN5.js → chunk-5ELC3KK3.js} +5 -5
  20. package/dist/{chunk-WPD7BR6C.js → chunk-5SHYLRTU.js} +1 -1
  21. package/dist/{chunk-S2OEFXST.js → chunk-5UN5C5WP.js} +5 -5
  22. package/dist/{chunk-RKKTCKVX.js → chunk-6Q2CFQ4D.js} +85 -31
  23. package/dist/{chunk-WFUDY6PC.js → chunk-A4JGXX2F.js} +155 -24
  24. package/dist/{chunk-NOIWXANG.js → chunk-ANGPU5JL.js} +284 -15
  25. package/dist/{chunk-GHRZNPBK.js → chunk-C2CBF4YE.js} +2 -2
  26. package/dist/{chunk-TNVJPFHM.js → chunk-CJKL7A4G.js} +5 -5
  27. package/dist/{chunk-SWNEA5OZ.js → chunk-CRAXJAYJ.js} +3 -3
  28. package/dist/{chunk-C774RJJA.js → chunk-CWHMLCLN.js} +3 -3
  29. package/dist/{chunk-YWI3IBP2.js → chunk-DQN5U2VH.js} +1 -1
  30. package/dist/{chunk-2UBVFL2X.js → chunk-DYXNBXE3.js} +306 -17
  31. package/dist/{chunk-SPAMHHJH.js → chunk-J5GON4SU.js} +1 -1
  32. package/dist/{chunk-4VFOJZPS.js → chunk-JXZS56VW.js} +3 -3
  33. package/dist/{chunk-EQNRWDLN.js → chunk-KK63BFYN.js} +151 -24
  34. package/dist/{chunk-X5B3OS5I.js → chunk-N6XI5KXL.js} +1 -1
  35. package/dist/{chunk-XJETIO4K.js → chunk-NJ5OXOTN.js} +2 -2
  36. package/dist/{chunk-RGNPPRZZ.js → chunk-NYAEMZ3L.js} +3 -3
  37. package/dist/{chunk-7H2CVVLF.js → chunk-O3UAQAYA.js} +3 -3
  38. package/dist/{chunk-4TYXWPAJ.js → chunk-OJFEVWZN.js} +1 -1
  39. package/dist/{chunk-I5NC7DWO.js → chunk-P3DCZRER.js} +1 -1
  40. package/dist/{chunk-TWXSZYR2.js → chunk-RRXRLHIE.js} +5 -5
  41. package/dist/{chunk-AS4UN7QL.js → chunk-VVOAXBND.js} +5 -5
  42. package/dist/{chunk-LEYY54BN.js → chunk-XMCJDWPA.js} +88 -33
  43. package/dist/{connected-teams-KQUDU7LZ.js → connected-teams-62AJRDDD.js} +2 -2
  44. package/dist/{connected-teams-JUJAQZZE.js → connected-teams-GXV22ZSF.js} +2 -2
  45. package/dist/{coordinator-prompt-CE7MN6QY.js → coordinator-prompt-2BRUH7PJ.js} +6 -6
  46. package/dist/{coordinator-prompt-IGDMFKCD.js → coordinator-prompt-BIP7ZEJ3.js} +6 -6
  47. package/dist/{cursor-recover-DTQAUDGO.js → cursor-recover-DFMCTZA4.js} +2 -2
  48. package/dist/{cursor-recover-4PQAADAU.js → cursor-recover-K3EBEM7M.js} +2 -2
  49. package/dist/{global-workspace-7WH24UFO.js → global-workspace-3XZN3QHZ.js} +6 -6
  50. package/dist/{global-workspace-NCIC2Y2U.js → global-workspace-DWCFG7LP.js} +6 -6
  51. package/dist/index.cjs +1232 -709
  52. package/dist/index.d.cts +70 -1
  53. package/dist/index.d.ts +70 -1
  54. package/dist/index.js +79 -23
  55. package/dist/mcp/run-stdio.cjs +1134 -660
  56. package/dist/mcp/run-stdio.js +45 -22
  57. package/dist/{orchestrator-7ZEGFPK4.js → orchestrator-AYPDBGIF.js} +10 -10
  58. package/dist/{orchestrator-R2WCTNJI.js → orchestrator-TEJJAQWP.js} +11 -11
  59. package/dist/{paths-C2VERLAE.js → paths-LGKOG7MY.js} +1 -1
  60. package/dist/{paths-LOXCISLX.js → paths-O6ZEAEUD.js} +1 -1
  61. package/dist/{thread-store-IKJD4EOK.js → thread-store-AYPBEZT5.js} +3 -3
  62. package/dist/{thread-store-FBK5SZ5P.js → thread-store-YOPKY74K.js} +3 -3
  63. package/dist/{workspaces-H2TRFDE2.js → workspaces-NYT2472Z.js} +6 -6
  64. package/dist/{workspaces-NSQZSDQD.js → workspaces-V7522TQH.js} +6 -6
  65. package/dist/{worktree-W7BSI4GU.js → worktree-AGVPKDBH.js} +5 -5
  66. package/dist/{worktree-FMIX4BRV.js → worktree-IRALYI6A.js} +5 -5
  67. package/package.json +1 -1
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  isOrchestratorThread
3
- } from "./chunk-S2OEFXST.js";
3
+ } from "./chunk-5UN5C5WP.js";
4
4
  import {
5
5
  codexUnattendedGitConfigArgs,
6
6
  mergeAgentGitAuthEnv,
7
7
  resolveAgentGitAuthEnv,
8
8
  resolveCodexGitWritableRoots
9
- } from "./chunk-7H2CVVLF.js";
9
+ } from "./chunk-O3UAQAYA.js";
10
10
  import {
11
11
  applyConnectedTeamToCli,
12
12
  brightsyMcpServerName,
13
13
  ensureCliTeamTracked,
14
14
  ensureConnectedBrightsyTeamTokens
15
- } from "./chunk-TNVJPFHM.js";
15
+ } from "./chunk-CJKL7A4G.js";
16
16
  import {
17
17
  loadBrightsyConfig
18
18
  } from "./chunk-ROPGQRPU.js";
@@ -36,7 +36,7 @@ import {
36
36
  packagedMcpStdioPath,
37
37
  parseCursorRunnerLine,
38
38
  resolveNodeLaunch
39
- } from "./chunk-WPD7BR6C.js";
39
+ } from "./chunk-5SHYLRTU.js";
40
40
  import {
41
41
  claudeChromeEnabled,
42
42
  fromInclusiveInputUsage,
@@ -45,10 +45,10 @@ import {
45
45
  loadAppSettings,
46
46
  resolveAgentExecutable,
47
47
  resolveClaudeExecutable
48
- } from "./chunk-I5NC7DWO.js";
48
+ } from "./chunk-P3DCZRER.js";
49
49
  import {
50
50
  appDataDir
51
- } from "./chunk-WFUDY6PC.js";
51
+ } from "./chunk-A4JGXX2F.js";
52
52
  import {
53
53
  enrichPathWithNpmGlobalBin,
54
54
  isConductorBundledCli,
@@ -1154,7 +1154,76 @@ function visibleToolRowDetail(detail, description, worktreePath) {
1154
1154
  if (parts.length >= 2) return `\u2026/${parts.slice(-2).join("/")}`;
1155
1155
  return base;
1156
1156
  }
1157
+ function isSkillToolName(name) {
1158
+ const n = (name ?? "").trim();
1159
+ if (/^(Skill|SlashCommand)$/i.test(n)) return true;
1160
+ return /(?:^|__)Skill$/i.test(n);
1161
+ }
1162
+ function skillCommandFromInput(input) {
1163
+ const raw = str(input?.skill) ?? str(input?.command) ?? str(input?.name) ?? str(input?.skill_name) ?? str(input?.skillName);
1164
+ if (raw) return raw.replace(/^\//, "").trim() || void 0;
1165
+ const path = str(input?.file_path) ?? str(input?.path);
1166
+ if (path && /SKILL\.md$/i.test(path)) {
1167
+ const parts = path.replace(/\\/g, "/").split("/");
1168
+ const dir = parts[parts.length - 2];
1169
+ if (dir && dir !== "skills") return dir;
1170
+ }
1171
+ return void 0;
1172
+ }
1173
+ function looksLikeSkillBody(text) {
1174
+ const t = text.trim();
1175
+ if (!t) return false;
1176
+ if (/^## Skill: \//m.test(t) && /Follow this skill for the request above:/i.test(t)) {
1177
+ return true;
1178
+ }
1179
+ return skillNameFromFrontmatter(t) != null;
1180
+ }
1181
+ function skillNameFromFrontmatter(text) {
1182
+ const t = text.trim();
1183
+ if (!t.startsWith("---")) return void 0;
1184
+ const close = t.indexOf("\n---", 3);
1185
+ if (close < 0) return void 0;
1186
+ const fm = t.slice(3, close);
1187
+ const m = fm.match(/^\s*name\s*:\s*['"]?([A-Za-z0-9][A-Za-z0-9._-]*)['"]?\s*$/m);
1188
+ return m?.[1];
1189
+ }
1190
+ function skillCommandFromBody(text) {
1191
+ return skillNameFromFrontmatter(text) ?? text.match(/^## Skill: \/([A-Za-z0-9][A-Za-z0-9._-]*)/m)?.[1];
1192
+ }
1193
+ function isCompactToolName(name) {
1194
+ const short = (name ?? "").replace(/^mcp__[^_]+__/, "").trim();
1195
+ return /^(Compact|ConversationCompact|summarize_context|SummarizeContext|SummarizeConversation)$/i.test(
1196
+ short
1197
+ );
1198
+ }
1199
+ function isContextCompactInProgress(text) {
1200
+ return /^Compressing context/i.test(text.trim());
1201
+ }
1202
+ function isContextCompactDone(text) {
1203
+ return /^Context compressed\b/i.test(text.trim());
1204
+ }
1205
+ function looksLikeConversationSummary(text) {
1206
+ const t = text.trim();
1207
+ if (t.length < 80) return false;
1208
+ if (/<summarized_conversation\b/i.test(t) || /<conversation_summary\b/i.test(t)) {
1209
+ return true;
1210
+ }
1211
+ if (/this session is being continued from a previous conversation/i.test(t)) {
1212
+ return true;
1213
+ }
1214
+ if (/conversation compacted|replaced with a summary/i.test(t)) return true;
1215
+ if (/^## Prior summary\b/m.test(t)) return true;
1216
+ if (/_Automatic extractive summary/i.test(t)) return true;
1217
+ if (/"context_summary"\s*:/.test(t)) return true;
1218
+ if (/^(?:#+\s*)?(?:conversation summary|summary of (?:the )?conversation|compacted (?:conversation|context))\b/im.test(
1219
+ t
1220
+ )) {
1221
+ return true;
1222
+ }
1223
+ return false;
1224
+ }
1157
1225
  function toolDetail(name, input) {
1226
+ if (isSkillToolName(name) || isCompactToolName(name)) return void 0;
1158
1227
  if (!input) return void 0;
1159
1228
  const command = str(input.command) ?? str(input.cmd);
1160
1229
  if (command) return clipChatLine(command);
@@ -1206,6 +1275,17 @@ function toolDescription(name, input) {
1206
1275
  if (/stop_dev_script$/i.test(name)) {
1207
1276
  return str(input?.name) ? `Stop ${str(input?.name)}` : "Stop Dev script";
1208
1277
  }
1278
+ if (isSkillToolName(name)) {
1279
+ const cmd = skillCommandFromInput(input);
1280
+ return cmd ? `Using /${cmd}` : "Using skill";
1281
+ }
1282
+ if (isCompactToolName(name)) {
1283
+ const trigger = str(input?.trigger);
1284
+ if (trigger && !/^auto$/i.test(trigger) && trigger !== "injected") {
1285
+ return `Summarized conversation (${trigger})`;
1286
+ }
1287
+ return "Summarized conversation";
1288
+ }
1209
1289
  if (isSubagentToolName(name)) {
1210
1290
  const desc = str(input?.description);
1211
1291
  const sub = asRecord(input?.subagentType);
@@ -1325,6 +1405,8 @@ function toolActivityLine(parts) {
1325
1405
  });
1326
1406
  if (tools.length === 0) return null;
1327
1407
  const edited = [];
1408
+ const skillNames = [];
1409
+ let compacts = 0;
1328
1410
  let reads = 0;
1329
1411
  let searches = 0;
1330
1412
  let shells = 0;
@@ -1333,7 +1415,12 @@ function toolActivityLine(parts) {
1333
1415
  let deletions = 0;
1334
1416
  for (const tool of tools) {
1335
1417
  const kind = classifyTool(tool.name);
1336
- if (kind === "edit") {
1418
+ if (isSkillToolName(tool.name)) {
1419
+ const cmd = skillCommandFromInput(tool.input);
1420
+ skillNames.push(cmd ? `/${cmd}` : "skill");
1421
+ } else if (isCompactToolName(tool.name)) {
1422
+ compacts += 1;
1423
+ } else if (kind === "edit") {
1337
1424
  const path = tool.filePath ?? toolFilePath(tool.input);
1338
1425
  edited.push({
1339
1426
  name: path ? fileBasename(path) : tool.name,
@@ -1361,6 +1448,10 @@ function toolActivityLine(parts) {
1361
1448
  else if (searches > 1) bits.push(`${searches} searches`);
1362
1449
  if (shells === 1) bits.push("ran 1 command");
1363
1450
  else if (shells > 1) bits.push(`ran ${shells} commands`);
1451
+ if (skillNames.length === 1) bits.push(`used ${skillNames[0]}`);
1452
+ else if (skillNames.length > 1) bits.push(`used ${skillNames.length} skills`);
1453
+ if (compacts === 1) bits.push("summarized conversation");
1454
+ else if (compacts > 1) bits.push(`summarized conversation \xD7${compacts}`);
1364
1455
  if (others === 1) bits.push("1 tool");
1365
1456
  else if (others > 1) bits.push(`${others} tools`);
1366
1457
  if (bits.length === 0) return null;
@@ -1493,10 +1584,107 @@ function withPartTimes(next, prev) {
1493
1584
  const startedAt = prev && typeof prev.startedAt === "number" ? prev.startedAt : now;
1494
1585
  return { ...next, startedAt, updatedAt: now };
1495
1586
  }
1587
+ function skillToolFromTextPart(part, id) {
1588
+ const command = skillCommandFromBody(part.text);
1589
+ const input = command ? { skill: command } : void 0;
1590
+ return {
1591
+ type: "tool",
1592
+ id,
1593
+ name: "Skill",
1594
+ input,
1595
+ description: toolDescription("Skill", input),
1596
+ status: "done",
1597
+ result: clipToolResultForStore(part.text),
1598
+ ...part.parentId ? { parentId: part.parentId } : {},
1599
+ startedAt: part.startedAt,
1600
+ updatedAt: Date.now()
1601
+ };
1602
+ }
1603
+ function compactToolPart(text, id, opts) {
1604
+ const input = { trigger: opts?.trigger ?? "auto" };
1605
+ return withPartTimes(
1606
+ {
1607
+ type: "tool",
1608
+ id,
1609
+ name: "Compact",
1610
+ input,
1611
+ description: toolDescription("Compact", input),
1612
+ status: opts?.status ?? "done",
1613
+ result: clipToolResultForStore(text) ?? "",
1614
+ ...opts?.parentId ? { parentId: opts.parentId } : {}
1615
+ },
1616
+ opts?.prev
1617
+ );
1618
+ }
1619
+ function contextCompactInProgress(parts, parentId) {
1620
+ let compressing = false;
1621
+ for (const p of parts) {
1622
+ if (!sameParentId(p.parentId, parentId)) continue;
1623
+ if (p.type === "thinking" && isContextCompactInProgress(p.text)) compressing = true;
1624
+ if (p.type === "thinking" && isContextCompactDone(p.text)) compressing = false;
1625
+ }
1626
+ return compressing;
1627
+ }
1628
+ function lastRunningCompactIndex(parts, parentId) {
1629
+ for (let i = parts.length - 1; i >= 0; i--) {
1630
+ const p = parts[i];
1631
+ if (p.type === "tool" && isCompactToolName(p.name) && p.status === "running" && sameParentId(p.parentId, parentId)) {
1632
+ return i;
1633
+ }
1634
+ }
1635
+ return -1;
1636
+ }
1637
+ function markRunningCompactDone(parts, parentId) {
1638
+ return parts.map((p) => {
1639
+ if (p.type === "tool" && isCompactToolName(p.name) && p.status === "running" && sameParentId(p.parentId, parentId)) {
1640
+ return withPartTimes({ ...p, status: "done" }, p);
1641
+ }
1642
+ return p;
1643
+ });
1644
+ }
1645
+ function ensureCompactTool(parts, parentId) {
1646
+ const hasCompact = parts.some(
1647
+ (p) => p.type === "tool" && isCompactToolName(p.name) && sameParentId(p.parentId, parentId)
1648
+ );
1649
+ if (hasCompact) return parts;
1650
+ return [
1651
+ ...parts,
1652
+ compactToolPart("Context compressed", `compact-${parts.length}`, {
1653
+ parentId,
1654
+ status: "done"
1655
+ })
1656
+ ];
1657
+ }
1658
+ function withCompactFinish(parts, thinking, parentId) {
1659
+ if (!isContextCompactDone(thinking)) return parts;
1660
+ return ensureCompactTool(markRunningCompactDone(parts, parentId), parentId);
1661
+ }
1496
1662
  function applyAgentEvent(parts, event) {
1497
1663
  if (event.type === "stdout") {
1498
1664
  const data = event.data;
1499
1665
  if (!data) return parts;
1666
+ const runningIdx = lastRunningCompactIndex(parts, event.parentId);
1667
+ if (runningIdx >= 0) {
1668
+ const prev = parts[runningIdx];
1669
+ const next2 = [...parts];
1670
+ next2[runningIdx] = withPartTimes(
1671
+ {
1672
+ ...prev,
1673
+ result: clipToolResultForStore(`${prev.result ?? ""}${data}`)
1674
+ },
1675
+ prev
1676
+ );
1677
+ return next2;
1678
+ }
1679
+ if (contextCompactInProgress(parts, event.parentId)) {
1680
+ return [
1681
+ ...parts,
1682
+ compactToolPart(data, `compact-${parts.length}`, {
1683
+ parentId: event.parentId,
1684
+ status: "running"
1685
+ })
1686
+ ];
1687
+ }
1500
1688
  const next = [...parts];
1501
1689
  const last = next[next.length - 1];
1502
1690
  if (last?.type === "text" && sameParentId(last.parentId, event.parentId)) {
@@ -1517,6 +1705,16 @@ function applyAgentEvent(parts, event) {
1517
1705
  })
1518
1706
  );
1519
1707
  }
1708
+ const acc = next[next.length - 1];
1709
+ if (acc?.type === "text" && looksLikeSkillBody(acc.text)) {
1710
+ next[next.length - 1] = skillToolFromTextPart(acc, `skill-${next.length}`);
1711
+ } else if (acc?.type === "text" && looksLikeConversationSummary(acc.text)) {
1712
+ next[next.length - 1] = compactToolPart(acc.text, `compact-${next.length}`, {
1713
+ parentId: acc.parentId,
1714
+ status: "done",
1715
+ prev: acc
1716
+ });
1717
+ }
1520
1718
  return next;
1521
1719
  }
1522
1720
  if (event.type === "thinking") {
@@ -1535,7 +1733,7 @@ function applyAgentEvent(parts, event) {
1535
1733
  },
1536
1734
  prev
1537
1735
  );
1538
- return next;
1736
+ return withCompactFinish(next, data, event.parentId);
1539
1737
  }
1540
1738
  }
1541
1739
  next.push(
@@ -1545,7 +1743,7 @@ function applyAgentEvent(parts, event) {
1545
1743
  ...event.parentId ? { parentId: event.parentId } : {}
1546
1744
  })
1547
1745
  );
1548
- return next;
1746
+ return withCompactFinish(next, data, event.parentId);
1549
1747
  }
1550
1748
  const last = next[next.length - 1];
1551
1749
  if (last?.type === "thinking" && sameParentId(last.parentId, event.parentId)) {
@@ -1566,7 +1764,7 @@ function applyAgentEvent(parts, event) {
1566
1764
  })
1567
1765
  );
1568
1766
  }
1569
- return next;
1767
+ return withCompactFinish(next, data, event.parentId);
1570
1768
  }
1571
1769
  if (event.type === "tool_use") {
1572
1770
  const input = asRecord(event.input);
@@ -1845,6 +2043,87 @@ function claudeResultErrorDetail(obj) {
1845
2043
  }
1846
2044
  return "Claude turn failed";
1847
2045
  }
2046
+ function toolResultContent(block) {
2047
+ if (typeof block.content === "string") return block.content;
2048
+ if (Array.isArray(block.content)) {
2049
+ return block.content.map(
2050
+ (c) => typeof c === "string" ? c : c && typeof c === "object" && "text" in c ? String(c.text ?? "") : ""
2051
+ ).join("");
2052
+ }
2053
+ if (block.content != null) return JSON.stringify(block.content);
2054
+ return void 0;
2055
+ }
2056
+ function skillToolEventsFromBody(text, parentId) {
2057
+ const command = skillCommandFromBody(text) ?? "skill";
2058
+ const id = `skill-${command}`;
2059
+ return [
2060
+ withEventParentId(
2061
+ { type: "tool_use", id, name: "Skill", input: { skill: command } },
2062
+ parentId
2063
+ ),
2064
+ withEventParentId({ type: "tool_result", id, content: text }, parentId)
2065
+ ];
2066
+ }
2067
+ function compactToolEventsFromBody(text, parentId) {
2068
+ const id = "compact-summary";
2069
+ return [
2070
+ withEventParentId(
2071
+ { type: "tool_use", id, name: "Compact", input: { trigger: "injected" } },
2072
+ parentId
2073
+ ),
2074
+ withEventParentId({ type: "tool_result", id, content: text }, parentId)
2075
+ ];
2076
+ }
2077
+ function eventsFromInjectedUserText(text, parentId) {
2078
+ if (looksLikeSkillBody(text)) return skillToolEventsFromBody(text, parentId);
2079
+ if (looksLikeConversationSummary(text)) return compactToolEventsFromBody(text, parentId);
2080
+ return [];
2081
+ }
2082
+ function eventsFromUserContent(content, parentId) {
2083
+ if (typeof content === "string" && content.trim()) {
2084
+ return eventsFromInjectedUserText(content, parentId);
2085
+ }
2086
+ if (!Array.isArray(content) || content.length === 0) return [];
2087
+ const out = [];
2088
+ const textBlocks = [];
2089
+ for (const block of content) {
2090
+ if (!block?.type) continue;
2091
+ if (block.type === "tool_use" && block.id && block.name) {
2092
+ out.push(
2093
+ withEventParentId(
2094
+ {
2095
+ type: "tool_use",
2096
+ id: block.id,
2097
+ name: block.name,
2098
+ input: block.input
2099
+ },
2100
+ parentId
2101
+ )
2102
+ );
2103
+ continue;
2104
+ }
2105
+ if (block.type === "tool_result" && block.tool_use_id) {
2106
+ out.push(
2107
+ withEventParentId(
2108
+ {
2109
+ type: "tool_result",
2110
+ id: block.tool_use_id,
2111
+ content: toolResultContent(block),
2112
+ isError: Boolean(block.is_error)
2113
+ },
2114
+ parentId
2115
+ )
2116
+ );
2117
+ continue;
2118
+ }
2119
+ if (block.type === "text" && block.text) textBlocks.push(block.text);
2120
+ }
2121
+ if (out.length > 0) return out;
2122
+ for (const text of textBlocks) {
2123
+ out.push(...eventsFromInjectedUserText(text, parentId));
2124
+ }
2125
+ return out;
2126
+ }
1848
2127
  function eventsFromContentBlocks(blocks, parentId) {
1849
2128
  if (!blocks?.length) return [];
1850
2129
  const out = [];
@@ -1873,15 +2152,12 @@ function eventsFromContentBlocks(blocks, parentId) {
1873
2152
  continue;
1874
2153
  }
1875
2154
  if (block.type === "tool_result" && block.tool_use_id) {
1876
- const content = typeof block.content === "string" ? block.content : Array.isArray(block.content) ? block.content.map(
1877
- (c) => typeof c === "string" ? c : c && typeof c === "object" && "text" in c ? String(c.text ?? "") : ""
1878
- ).join("") : block.content != null ? JSON.stringify(block.content) : void 0;
1879
2155
  out.push(
1880
2156
  withEventParentId(
1881
2157
  {
1882
2158
  type: "tool_result",
1883
2159
  id: block.tool_use_id,
1884
- content,
2160
+ content: toolResultContent(block),
1885
2161
  isError: Boolean(block.is_error)
1886
2162
  },
1887
2163
  parentId
@@ -2120,7 +2396,7 @@ var claudeAdapter = {
2120
2396
  );
2121
2397
  }
2122
2398
  const mode = permissionMode(thread);
2123
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-NCIC2Y2U.js");
2399
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-DWCFG7LP.js");
2124
2400
  const isOrchestrator = isOrchestratorThread2(thread);
2125
2401
  const injectedServers = await buildInjectedMcpServers({
2126
2402
  includeSideboard: true,
@@ -2220,7 +2496,10 @@ var claudeAdapter = {
2220
2496
  if (obj.type === "assistant" || obj.type === "user") {
2221
2497
  const parentId = claudeParentToolUseId(obj);
2222
2498
  const message = obj.message;
2223
- const events = eventsFromContentBlocks(message?.content, parentId);
2499
+ const events = obj.type === "user" ? eventsFromUserContent(message?.content, parentId) : eventsFromContentBlocks(
2500
+ Array.isArray(message?.content) ? message.content : void 0,
2501
+ parentId
2502
+ );
2224
2503
  if (obj.type === "assistant") {
2225
2504
  const usage = usageFromClaude(message?.usage);
2226
2505
  if (usage) events.push({ type: "usage", data: usage, scope: "request" });
@@ -3998,7 +4277,8 @@ async function installNpmGlobalPackage(opts) {
3998
4277
  exitCode: 0,
3999
4278
  stdout: result.stdout,
4000
4279
  stderr: result.stderr,
4001
- message: binPath ? `Installed ${opts.npmPackage} \u2192 ${binPath}` : `Installed ${opts.npmPackage} (CLI not yet on PATH)`
4280
+ // Library-only packages (`@cursor/sdk`) have no CLI to look for.
4281
+ message: !opts.cliBin ? `Installed ${opts.npmPackage}` : binPath ? `Installed ${opts.npmPackage} \u2192 ${binPath}` : `Installed ${opts.npmPackage} (CLI not yet on PATH)`
4002
4282
  };
4003
4283
  }
4004
4284
  async function resolveExistingCli(agent) {
@@ -4095,6 +4375,15 @@ function allAdapters() {
4095
4375
 
4096
4376
  export {
4097
4377
  visibleToolRowDetail,
4378
+ isSkillToolName,
4379
+ skillCommandFromInput,
4380
+ looksLikeSkillBody,
4381
+ skillNameFromFrontmatter,
4382
+ skillCommandFromBody,
4383
+ isCompactToolName,
4384
+ isContextCompactInProgress,
4385
+ isContextCompactDone,
4386
+ looksLikeConversationSummary,
4098
4387
  toolDetail,
4099
4388
  toolDescription,
4100
4389
  isSubagentToolName,
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-2UG25RMK.js";
14
14
  import {
15
15
  appDataDir
16
- } from "./chunk-EQNRWDLN.js";
16
+ } from "./chunk-KK63BFYN.js";
17
17
 
18
18
  // src/brightsy/connected-teams.ts
19
19
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-D6JWYJ4P.js";
6
6
  import {
7
7
  listThreads
8
- } from "./chunk-XJETIO4K.js";
8
+ } from "./chunk-NJ5OXOTN.js";
9
9
  import {
10
10
  ensureWorktreeSideboardIgnored
11
11
  } from "./chunk-DD67JWTN.js";
@@ -22,10 +22,10 @@ import {
22
22
  import {
23
23
  getGithubGitAuthMode,
24
24
  getGithubPat
25
- } from "./chunk-RZTRWN2V.js";
25
+ } from "./chunk-4H5WO4H3.js";
26
26
  import {
27
27
  worktreesRoot
28
- } from "./chunk-EQNRWDLN.js";
28
+ } from "./chunk-KK63BFYN.js";
29
29
 
30
30
  // src/git/worktree.ts
31
31
  import { randomBytes } from "crypto";