@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.
- package/dist/{abletime-WZNDTRVL.js → abletime-KOGCIQCO.js} +5 -5
- package/dist/{abletime-BGVOCEOU.js → abletime-VSV6AUBV.js} +5 -5
- package/dist/{abletime-oauth-ZLU2EYRK.js → abletime-oauth-LY7KZICW.js} +4 -4
- package/dist/{abletime-oauth-6M5GWEPX.js → abletime-oauth-QMDV45JC.js} +4 -4
- package/dist/{abletime-rest-WNHIATB3.js → abletime-rest-LXOWKPL7.js} +4 -4
- package/dist/{abletime-rest-F7XG5NGY.js → abletime-rest-NL56UVK5.js} +4 -4
- package/dist/agents/cursor-runner.cjs +39 -35
- package/dist/agents/cursor-runner.js +3 -3
- package/dist/{agents-BTXL6R5I.js → agents-JC6DRIT3.js} +9 -9
- package/dist/{agents-WMN7C322.js → agents-S4HYHRL3.js} +8 -8
- package/dist/{app-settings-KBL2G7M4.js → app-settings-2CFCRYD7.js} +2 -2
- package/dist/{app-settings-UXWCPDEA.js → app-settings-I27UBVI4.js} +2 -2
- package/dist/{caffeinate-hold-OK4JJ5PP.js → caffeinate-hold-FNKIPXDU.js} +2 -2
- package/dist/{caffeinate-hold-22VFDPSO.js → caffeinate-hold-PXHGH7ZN.js} +2 -2
- package/dist/{chunk-7J72QJOM.js → chunk-224IXQOM.js} +1 -1
- package/dist/{chunk-4VGCG2HV.js → chunk-3AJUH66R.js} +2 -2
- package/dist/{chunk-P6ZM5QJW.js → chunk-3PGFAVFL.js} +2 -2
- package/dist/{chunk-RZTRWN2V.js → chunk-4H5WO4H3.js} +1 -1
- package/dist/{chunk-MVLXDYN5.js → chunk-5ELC3KK3.js} +5 -5
- package/dist/{chunk-WPD7BR6C.js → chunk-5SHYLRTU.js} +1 -1
- package/dist/{chunk-S2OEFXST.js → chunk-5UN5C5WP.js} +5 -5
- package/dist/{chunk-RKKTCKVX.js → chunk-6Q2CFQ4D.js} +85 -31
- package/dist/{chunk-WFUDY6PC.js → chunk-A4JGXX2F.js} +155 -24
- package/dist/{chunk-NOIWXANG.js → chunk-ANGPU5JL.js} +284 -15
- package/dist/{chunk-GHRZNPBK.js → chunk-C2CBF4YE.js} +2 -2
- package/dist/{chunk-TNVJPFHM.js → chunk-CJKL7A4G.js} +5 -5
- package/dist/{chunk-SWNEA5OZ.js → chunk-CRAXJAYJ.js} +3 -3
- package/dist/{chunk-C774RJJA.js → chunk-CWHMLCLN.js} +3 -3
- package/dist/{chunk-YWI3IBP2.js → chunk-DQN5U2VH.js} +1 -1
- package/dist/{chunk-2UBVFL2X.js → chunk-DYXNBXE3.js} +306 -17
- package/dist/{chunk-SPAMHHJH.js → chunk-J5GON4SU.js} +1 -1
- package/dist/{chunk-4VFOJZPS.js → chunk-JXZS56VW.js} +3 -3
- package/dist/{chunk-EQNRWDLN.js → chunk-KK63BFYN.js} +151 -24
- package/dist/{chunk-X5B3OS5I.js → chunk-N6XI5KXL.js} +1 -1
- package/dist/{chunk-XJETIO4K.js → chunk-NJ5OXOTN.js} +2 -2
- package/dist/{chunk-RGNPPRZZ.js → chunk-NYAEMZ3L.js} +3 -3
- package/dist/{chunk-7H2CVVLF.js → chunk-O3UAQAYA.js} +3 -3
- package/dist/{chunk-4TYXWPAJ.js → chunk-OJFEVWZN.js} +1 -1
- package/dist/{chunk-I5NC7DWO.js → chunk-P3DCZRER.js} +1 -1
- package/dist/{chunk-TWXSZYR2.js → chunk-RRXRLHIE.js} +5 -5
- package/dist/{chunk-AS4UN7QL.js → chunk-VVOAXBND.js} +5 -5
- package/dist/{chunk-LEYY54BN.js → chunk-XMCJDWPA.js} +88 -33
- package/dist/{connected-teams-KQUDU7LZ.js → connected-teams-62AJRDDD.js} +2 -2
- package/dist/{connected-teams-JUJAQZZE.js → connected-teams-GXV22ZSF.js} +2 -2
- package/dist/{coordinator-prompt-CE7MN6QY.js → coordinator-prompt-2BRUH7PJ.js} +6 -6
- package/dist/{coordinator-prompt-IGDMFKCD.js → coordinator-prompt-BIP7ZEJ3.js} +6 -6
- package/dist/{cursor-recover-DTQAUDGO.js → cursor-recover-DFMCTZA4.js} +2 -2
- package/dist/{cursor-recover-4PQAADAU.js → cursor-recover-K3EBEM7M.js} +2 -2
- package/dist/{global-workspace-7WH24UFO.js → global-workspace-3XZN3QHZ.js} +6 -6
- package/dist/{global-workspace-NCIC2Y2U.js → global-workspace-DWCFG7LP.js} +6 -6
- package/dist/index.cjs +1232 -709
- package/dist/index.d.cts +70 -1
- package/dist/index.d.ts +70 -1
- package/dist/index.js +79 -23
- package/dist/mcp/run-stdio.cjs +1134 -660
- package/dist/mcp/run-stdio.js +45 -22
- package/dist/{orchestrator-7ZEGFPK4.js → orchestrator-AYPDBGIF.js} +10 -10
- package/dist/{orchestrator-R2WCTNJI.js → orchestrator-TEJJAQWP.js} +11 -11
- package/dist/{paths-C2VERLAE.js → paths-LGKOG7MY.js} +1 -1
- package/dist/{paths-LOXCISLX.js → paths-O6ZEAEUD.js} +1 -1
- package/dist/{thread-store-IKJD4EOK.js → thread-store-AYPBEZT5.js} +3 -3
- package/dist/{thread-store-FBK5SZ5P.js → thread-store-YOPKY74K.js} +3 -3
- package/dist/{workspaces-H2TRFDE2.js → workspaces-NYT2472Z.js} +6 -6
- package/dist/{workspaces-NSQZSDQD.js → workspaces-V7522TQH.js} +6 -6
- package/dist/{worktree-W7BSI4GU.js → worktree-AGVPKDBH.js} +5 -5
- package/dist/{worktree-FMIX4BRV.js → worktree-IRALYI6A.js} +5 -5
- package/package.json +1 -1
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
isOrchestratorThread
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RRXRLHIE.js";
|
|
6
6
|
import {
|
|
7
7
|
applyConnectedTeamToCli,
|
|
8
8
|
brightsyMcpServerName,
|
|
9
9
|
ensureCliTeamTracked,
|
|
10
10
|
ensureConnectedBrightsyTeamTokens
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-J5GON4SU.js";
|
|
12
12
|
import {
|
|
13
13
|
loadBrightsyConfig
|
|
14
14
|
} from "./chunk-P2BSMNHB.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
mergeAgentGitAuthEnv,
|
|
21
21
|
resolveAgentGitAuthEnv,
|
|
22
22
|
resolveCodexGitWritableRoots
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-JXZS56VW.js";
|
|
24
24
|
import {
|
|
25
25
|
enrichPathWithNpmGlobalBin,
|
|
26
26
|
isConductorBundledCli,
|
|
@@ -37,10 +37,10 @@ import {
|
|
|
37
37
|
loadAppSettings,
|
|
38
38
|
resolveAgentExecutable,
|
|
39
39
|
resolveClaudeExecutable
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-4H5WO4H3.js";
|
|
41
41
|
import {
|
|
42
42
|
appDataDir
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-KK63BFYN.js";
|
|
44
44
|
import {
|
|
45
45
|
isElectronLikeCommand,
|
|
46
46
|
unwrapStrippedElectronLaunch,
|
|
@@ -1666,7 +1666,76 @@ function clipChatLine(value, max = CHAT_DETAIL_MAX) {
|
|
|
1666
1666
|
if (line.length <= max) return line;
|
|
1667
1667
|
return `${line.slice(0, Math.max(1, max - 1))}\u2026`;
|
|
1668
1668
|
}
|
|
1669
|
+
function isSkillToolName(name) {
|
|
1670
|
+
const n = (name ?? "").trim();
|
|
1671
|
+
if (/^(Skill|SlashCommand)$/i.test(n)) return true;
|
|
1672
|
+
return /(?:^|__)Skill$/i.test(n);
|
|
1673
|
+
}
|
|
1674
|
+
function skillCommandFromInput(input) {
|
|
1675
|
+
const raw = str(input?.skill) ?? str(input?.command) ?? str(input?.name) ?? str(input?.skill_name) ?? str(input?.skillName);
|
|
1676
|
+
if (raw) return raw.replace(/^\//, "").trim() || void 0;
|
|
1677
|
+
const path = str(input?.file_path) ?? str(input?.path);
|
|
1678
|
+
if (path && /SKILL\.md$/i.test(path)) {
|
|
1679
|
+
const parts = path.replace(/\\/g, "/").split("/");
|
|
1680
|
+
const dir = parts[parts.length - 2];
|
|
1681
|
+
if (dir && dir !== "skills") return dir;
|
|
1682
|
+
}
|
|
1683
|
+
return void 0;
|
|
1684
|
+
}
|
|
1685
|
+
function looksLikeSkillBody(text) {
|
|
1686
|
+
const t = text.trim();
|
|
1687
|
+
if (!t) return false;
|
|
1688
|
+
if (/^## Skill: \//m.test(t) && /Follow this skill for the request above:/i.test(t)) {
|
|
1689
|
+
return true;
|
|
1690
|
+
}
|
|
1691
|
+
return skillNameFromFrontmatter(t) != null;
|
|
1692
|
+
}
|
|
1693
|
+
function skillNameFromFrontmatter(text) {
|
|
1694
|
+
const t = text.trim();
|
|
1695
|
+
if (!t.startsWith("---")) return void 0;
|
|
1696
|
+
const close = t.indexOf("\n---", 3);
|
|
1697
|
+
if (close < 0) return void 0;
|
|
1698
|
+
const fm = t.slice(3, close);
|
|
1699
|
+
const m = fm.match(/^\s*name\s*:\s*['"]?([A-Za-z0-9][A-Za-z0-9._-]*)['"]?\s*$/m);
|
|
1700
|
+
return m?.[1];
|
|
1701
|
+
}
|
|
1702
|
+
function skillCommandFromBody(text) {
|
|
1703
|
+
return skillNameFromFrontmatter(text) ?? text.match(/^## Skill: \/([A-Za-z0-9][A-Za-z0-9._-]*)/m)?.[1];
|
|
1704
|
+
}
|
|
1705
|
+
function isCompactToolName(name) {
|
|
1706
|
+
const short = (name ?? "").replace(/^mcp__[^_]+__/, "").trim();
|
|
1707
|
+
return /^(Compact|ConversationCompact|summarize_context|SummarizeContext|SummarizeConversation)$/i.test(
|
|
1708
|
+
short
|
|
1709
|
+
);
|
|
1710
|
+
}
|
|
1711
|
+
function isContextCompactInProgress(text) {
|
|
1712
|
+
return /^Compressing context/i.test(text.trim());
|
|
1713
|
+
}
|
|
1714
|
+
function isContextCompactDone(text) {
|
|
1715
|
+
return /^Context compressed\b/i.test(text.trim());
|
|
1716
|
+
}
|
|
1717
|
+
function looksLikeConversationSummary(text) {
|
|
1718
|
+
const t = text.trim();
|
|
1719
|
+
if (t.length < 80) return false;
|
|
1720
|
+
if (/<summarized_conversation\b/i.test(t) || /<conversation_summary\b/i.test(t)) {
|
|
1721
|
+
return true;
|
|
1722
|
+
}
|
|
1723
|
+
if (/this session is being continued from a previous conversation/i.test(t)) {
|
|
1724
|
+
return true;
|
|
1725
|
+
}
|
|
1726
|
+
if (/conversation compacted|replaced with a summary/i.test(t)) return true;
|
|
1727
|
+
if (/^## Prior summary\b/m.test(t)) return true;
|
|
1728
|
+
if (/_Automatic extractive summary/i.test(t)) return true;
|
|
1729
|
+
if (/"context_summary"\s*:/.test(t)) return true;
|
|
1730
|
+
if (/^(?:#+\s*)?(?:conversation summary|summary of (?:the )?conversation|compacted (?:conversation|context))\b/im.test(
|
|
1731
|
+
t
|
|
1732
|
+
)) {
|
|
1733
|
+
return true;
|
|
1734
|
+
}
|
|
1735
|
+
return false;
|
|
1736
|
+
}
|
|
1669
1737
|
function toolDetail(name, input) {
|
|
1738
|
+
if (isSkillToolName(name) || isCompactToolName(name)) return void 0;
|
|
1670
1739
|
if (!input) return void 0;
|
|
1671
1740
|
const command = str(input.command) ?? str(input.cmd);
|
|
1672
1741
|
if (command) return clipChatLine(command);
|
|
@@ -1718,6 +1787,17 @@ function toolDescription(name, input) {
|
|
|
1718
1787
|
if (/stop_dev_script$/i.test(name)) {
|
|
1719
1788
|
return str(input?.name) ? `Stop ${str(input?.name)}` : "Stop Dev script";
|
|
1720
1789
|
}
|
|
1790
|
+
if (isSkillToolName(name)) {
|
|
1791
|
+
const cmd = skillCommandFromInput(input);
|
|
1792
|
+
return cmd ? `Using /${cmd}` : "Using skill";
|
|
1793
|
+
}
|
|
1794
|
+
if (isCompactToolName(name)) {
|
|
1795
|
+
const trigger = str(input?.trigger);
|
|
1796
|
+
if (trigger && !/^auto$/i.test(trigger) && trigger !== "injected") {
|
|
1797
|
+
return `Summarized conversation (${trigger})`;
|
|
1798
|
+
}
|
|
1799
|
+
return "Summarized conversation";
|
|
1800
|
+
}
|
|
1721
1801
|
if (isSubagentToolName(name)) {
|
|
1722
1802
|
const desc = str(input?.description);
|
|
1723
1803
|
const sub = asRecord(input?.subagentType);
|
|
@@ -1933,10 +2013,107 @@ function withPartTimes(next, prev) {
|
|
|
1933
2013
|
const startedAt = prev && typeof prev.startedAt === "number" ? prev.startedAt : now;
|
|
1934
2014
|
return { ...next, startedAt, updatedAt: now };
|
|
1935
2015
|
}
|
|
2016
|
+
function skillToolFromTextPart(part, id) {
|
|
2017
|
+
const command = skillCommandFromBody(part.text);
|
|
2018
|
+
const input = command ? { skill: command } : void 0;
|
|
2019
|
+
return {
|
|
2020
|
+
type: "tool",
|
|
2021
|
+
id,
|
|
2022
|
+
name: "Skill",
|
|
2023
|
+
input,
|
|
2024
|
+
description: toolDescription("Skill", input),
|
|
2025
|
+
status: "done",
|
|
2026
|
+
result: clipToolResultForStore(part.text),
|
|
2027
|
+
...part.parentId ? { parentId: part.parentId } : {},
|
|
2028
|
+
startedAt: part.startedAt,
|
|
2029
|
+
updatedAt: Date.now()
|
|
2030
|
+
};
|
|
2031
|
+
}
|
|
2032
|
+
function compactToolPart(text, id, opts) {
|
|
2033
|
+
const input = { trigger: opts?.trigger ?? "auto" };
|
|
2034
|
+
return withPartTimes(
|
|
2035
|
+
{
|
|
2036
|
+
type: "tool",
|
|
2037
|
+
id,
|
|
2038
|
+
name: "Compact",
|
|
2039
|
+
input,
|
|
2040
|
+
description: toolDescription("Compact", input),
|
|
2041
|
+
status: opts?.status ?? "done",
|
|
2042
|
+
result: clipToolResultForStore(text) ?? "",
|
|
2043
|
+
...opts?.parentId ? { parentId: opts.parentId } : {}
|
|
2044
|
+
},
|
|
2045
|
+
opts?.prev
|
|
2046
|
+
);
|
|
2047
|
+
}
|
|
2048
|
+
function contextCompactInProgress(parts, parentId) {
|
|
2049
|
+
let compressing = false;
|
|
2050
|
+
for (const p of parts) {
|
|
2051
|
+
if (!sameParentId(p.parentId, parentId)) continue;
|
|
2052
|
+
if (p.type === "thinking" && isContextCompactInProgress(p.text)) compressing = true;
|
|
2053
|
+
if (p.type === "thinking" && isContextCompactDone(p.text)) compressing = false;
|
|
2054
|
+
}
|
|
2055
|
+
return compressing;
|
|
2056
|
+
}
|
|
2057
|
+
function lastRunningCompactIndex(parts, parentId) {
|
|
2058
|
+
for (let i = parts.length - 1; i >= 0; i--) {
|
|
2059
|
+
const p = parts[i];
|
|
2060
|
+
if (p.type === "tool" && isCompactToolName(p.name) && p.status === "running" && sameParentId(p.parentId, parentId)) {
|
|
2061
|
+
return i;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
return -1;
|
|
2065
|
+
}
|
|
2066
|
+
function markRunningCompactDone(parts, parentId) {
|
|
2067
|
+
return parts.map((p) => {
|
|
2068
|
+
if (p.type === "tool" && isCompactToolName(p.name) && p.status === "running" && sameParentId(p.parentId, parentId)) {
|
|
2069
|
+
return withPartTimes({ ...p, status: "done" }, p);
|
|
2070
|
+
}
|
|
2071
|
+
return p;
|
|
2072
|
+
});
|
|
2073
|
+
}
|
|
2074
|
+
function ensureCompactTool(parts, parentId) {
|
|
2075
|
+
const hasCompact = parts.some(
|
|
2076
|
+
(p) => p.type === "tool" && isCompactToolName(p.name) && sameParentId(p.parentId, parentId)
|
|
2077
|
+
);
|
|
2078
|
+
if (hasCompact) return parts;
|
|
2079
|
+
return [
|
|
2080
|
+
...parts,
|
|
2081
|
+
compactToolPart("Context compressed", `compact-${parts.length}`, {
|
|
2082
|
+
parentId,
|
|
2083
|
+
status: "done"
|
|
2084
|
+
})
|
|
2085
|
+
];
|
|
2086
|
+
}
|
|
2087
|
+
function withCompactFinish(parts, thinking, parentId) {
|
|
2088
|
+
if (!isContextCompactDone(thinking)) return parts;
|
|
2089
|
+
return ensureCompactTool(markRunningCompactDone(parts, parentId), parentId);
|
|
2090
|
+
}
|
|
1936
2091
|
function applyAgentEvent(parts, event) {
|
|
1937
2092
|
if (event.type === "stdout") {
|
|
1938
2093
|
const data = event.data;
|
|
1939
2094
|
if (!data) return parts;
|
|
2095
|
+
const runningIdx = lastRunningCompactIndex(parts, event.parentId);
|
|
2096
|
+
if (runningIdx >= 0) {
|
|
2097
|
+
const prev = parts[runningIdx];
|
|
2098
|
+
const next2 = [...parts];
|
|
2099
|
+
next2[runningIdx] = withPartTimes(
|
|
2100
|
+
{
|
|
2101
|
+
...prev,
|
|
2102
|
+
result: clipToolResultForStore(`${prev.result ?? ""}${data}`)
|
|
2103
|
+
},
|
|
2104
|
+
prev
|
|
2105
|
+
);
|
|
2106
|
+
return next2;
|
|
2107
|
+
}
|
|
2108
|
+
if (contextCompactInProgress(parts, event.parentId)) {
|
|
2109
|
+
return [
|
|
2110
|
+
...parts,
|
|
2111
|
+
compactToolPart(data, `compact-${parts.length}`, {
|
|
2112
|
+
parentId: event.parentId,
|
|
2113
|
+
status: "running"
|
|
2114
|
+
})
|
|
2115
|
+
];
|
|
2116
|
+
}
|
|
1940
2117
|
const next = [...parts];
|
|
1941
2118
|
const last = next[next.length - 1];
|
|
1942
2119
|
if (last?.type === "text" && sameParentId(last.parentId, event.parentId)) {
|
|
@@ -1957,6 +2134,16 @@ function applyAgentEvent(parts, event) {
|
|
|
1957
2134
|
})
|
|
1958
2135
|
);
|
|
1959
2136
|
}
|
|
2137
|
+
const acc = next[next.length - 1];
|
|
2138
|
+
if (acc?.type === "text" && looksLikeSkillBody(acc.text)) {
|
|
2139
|
+
next[next.length - 1] = skillToolFromTextPart(acc, `skill-${next.length}`);
|
|
2140
|
+
} else if (acc?.type === "text" && looksLikeConversationSummary(acc.text)) {
|
|
2141
|
+
next[next.length - 1] = compactToolPart(acc.text, `compact-${next.length}`, {
|
|
2142
|
+
parentId: acc.parentId,
|
|
2143
|
+
status: "done",
|
|
2144
|
+
prev: acc
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
1960
2147
|
return next;
|
|
1961
2148
|
}
|
|
1962
2149
|
if (event.type === "thinking") {
|
|
@@ -1975,7 +2162,7 @@ function applyAgentEvent(parts, event) {
|
|
|
1975
2162
|
},
|
|
1976
2163
|
prev
|
|
1977
2164
|
);
|
|
1978
|
-
return next;
|
|
2165
|
+
return withCompactFinish(next, data, event.parentId);
|
|
1979
2166
|
}
|
|
1980
2167
|
}
|
|
1981
2168
|
next.push(
|
|
@@ -1985,7 +2172,7 @@ function applyAgentEvent(parts, event) {
|
|
|
1985
2172
|
...event.parentId ? { parentId: event.parentId } : {}
|
|
1986
2173
|
})
|
|
1987
2174
|
);
|
|
1988
|
-
return next;
|
|
2175
|
+
return withCompactFinish(next, data, event.parentId);
|
|
1989
2176
|
}
|
|
1990
2177
|
const last = next[next.length - 1];
|
|
1991
2178
|
if (last?.type === "thinking" && sameParentId(last.parentId, event.parentId)) {
|
|
@@ -2006,7 +2193,7 @@ function applyAgentEvent(parts, event) {
|
|
|
2006
2193
|
})
|
|
2007
2194
|
);
|
|
2008
2195
|
}
|
|
2009
|
-
return next;
|
|
2196
|
+
return withCompactFinish(next, data, event.parentId);
|
|
2010
2197
|
}
|
|
2011
2198
|
if (event.type === "tool_use") {
|
|
2012
2199
|
const input = asRecord(event.input);
|
|
@@ -2274,6 +2461,87 @@ function claudeResultErrorDetail(obj) {
|
|
|
2274
2461
|
}
|
|
2275
2462
|
return "Claude turn failed";
|
|
2276
2463
|
}
|
|
2464
|
+
function toolResultContent(block) {
|
|
2465
|
+
if (typeof block.content === "string") return block.content;
|
|
2466
|
+
if (Array.isArray(block.content)) {
|
|
2467
|
+
return block.content.map(
|
|
2468
|
+
(c) => typeof c === "string" ? c : c && typeof c === "object" && "text" in c ? String(c.text ?? "") : ""
|
|
2469
|
+
).join("");
|
|
2470
|
+
}
|
|
2471
|
+
if (block.content != null) return JSON.stringify(block.content);
|
|
2472
|
+
return void 0;
|
|
2473
|
+
}
|
|
2474
|
+
function skillToolEventsFromBody(text, parentId) {
|
|
2475
|
+
const command = skillCommandFromBody(text) ?? "skill";
|
|
2476
|
+
const id = `skill-${command}`;
|
|
2477
|
+
return [
|
|
2478
|
+
withEventParentId(
|
|
2479
|
+
{ type: "tool_use", id, name: "Skill", input: { skill: command } },
|
|
2480
|
+
parentId
|
|
2481
|
+
),
|
|
2482
|
+
withEventParentId({ type: "tool_result", id, content: text }, parentId)
|
|
2483
|
+
];
|
|
2484
|
+
}
|
|
2485
|
+
function compactToolEventsFromBody(text, parentId) {
|
|
2486
|
+
const id = "compact-summary";
|
|
2487
|
+
return [
|
|
2488
|
+
withEventParentId(
|
|
2489
|
+
{ type: "tool_use", id, name: "Compact", input: { trigger: "injected" } },
|
|
2490
|
+
parentId
|
|
2491
|
+
),
|
|
2492
|
+
withEventParentId({ type: "tool_result", id, content: text }, parentId)
|
|
2493
|
+
];
|
|
2494
|
+
}
|
|
2495
|
+
function eventsFromInjectedUserText(text, parentId) {
|
|
2496
|
+
if (looksLikeSkillBody(text)) return skillToolEventsFromBody(text, parentId);
|
|
2497
|
+
if (looksLikeConversationSummary(text)) return compactToolEventsFromBody(text, parentId);
|
|
2498
|
+
return [];
|
|
2499
|
+
}
|
|
2500
|
+
function eventsFromUserContent(content, parentId) {
|
|
2501
|
+
if (typeof content === "string" && content.trim()) {
|
|
2502
|
+
return eventsFromInjectedUserText(content, parentId);
|
|
2503
|
+
}
|
|
2504
|
+
if (!Array.isArray(content) || content.length === 0) return [];
|
|
2505
|
+
const out = [];
|
|
2506
|
+
const textBlocks = [];
|
|
2507
|
+
for (const block of content) {
|
|
2508
|
+
if (!block?.type) continue;
|
|
2509
|
+
if (block.type === "tool_use" && block.id && block.name) {
|
|
2510
|
+
out.push(
|
|
2511
|
+
withEventParentId(
|
|
2512
|
+
{
|
|
2513
|
+
type: "tool_use",
|
|
2514
|
+
id: block.id,
|
|
2515
|
+
name: block.name,
|
|
2516
|
+
input: block.input
|
|
2517
|
+
},
|
|
2518
|
+
parentId
|
|
2519
|
+
)
|
|
2520
|
+
);
|
|
2521
|
+
continue;
|
|
2522
|
+
}
|
|
2523
|
+
if (block.type === "tool_result" && block.tool_use_id) {
|
|
2524
|
+
out.push(
|
|
2525
|
+
withEventParentId(
|
|
2526
|
+
{
|
|
2527
|
+
type: "tool_result",
|
|
2528
|
+
id: block.tool_use_id,
|
|
2529
|
+
content: toolResultContent(block),
|
|
2530
|
+
isError: Boolean(block.is_error)
|
|
2531
|
+
},
|
|
2532
|
+
parentId
|
|
2533
|
+
)
|
|
2534
|
+
);
|
|
2535
|
+
continue;
|
|
2536
|
+
}
|
|
2537
|
+
if (block.type === "text" && block.text) textBlocks.push(block.text);
|
|
2538
|
+
}
|
|
2539
|
+
if (out.length > 0) return out;
|
|
2540
|
+
for (const text of textBlocks) {
|
|
2541
|
+
out.push(...eventsFromInjectedUserText(text, parentId));
|
|
2542
|
+
}
|
|
2543
|
+
return out;
|
|
2544
|
+
}
|
|
2277
2545
|
function eventsFromContentBlocks(blocks, parentId) {
|
|
2278
2546
|
if (!blocks?.length) return [];
|
|
2279
2547
|
const out = [];
|
|
@@ -2302,15 +2570,12 @@ function eventsFromContentBlocks(blocks, parentId) {
|
|
|
2302
2570
|
continue;
|
|
2303
2571
|
}
|
|
2304
2572
|
if (block.type === "tool_result" && block.tool_use_id) {
|
|
2305
|
-
const content = typeof block.content === "string" ? block.content : Array.isArray(block.content) ? block.content.map(
|
|
2306
|
-
(c) => typeof c === "string" ? c : c && typeof c === "object" && "text" in c ? String(c.text ?? "") : ""
|
|
2307
|
-
).join("") : block.content != null ? JSON.stringify(block.content) : void 0;
|
|
2308
2573
|
out.push(
|
|
2309
2574
|
withEventParentId(
|
|
2310
2575
|
{
|
|
2311
2576
|
type: "tool_result",
|
|
2312
2577
|
id: block.tool_use_id,
|
|
2313
|
-
content,
|
|
2578
|
+
content: toolResultContent(block),
|
|
2314
2579
|
isError: Boolean(block.is_error)
|
|
2315
2580
|
},
|
|
2316
2581
|
parentId
|
|
@@ -2549,7 +2814,7 @@ var claudeAdapter = {
|
|
|
2549
2814
|
);
|
|
2550
2815
|
}
|
|
2551
2816
|
const mode = permissionMode(thread);
|
|
2552
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
2817
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-3XZN3QHZ.js");
|
|
2553
2818
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
2554
2819
|
const injectedServers = await buildInjectedMcpServers({
|
|
2555
2820
|
includeSideboard: true,
|
|
@@ -2649,7 +2914,10 @@ var claudeAdapter = {
|
|
|
2649
2914
|
if (obj.type === "assistant" || obj.type === "user") {
|
|
2650
2915
|
const parentId = claudeParentToolUseId(obj);
|
|
2651
2916
|
const message = obj.message;
|
|
2652
|
-
const events =
|
|
2917
|
+
const events = obj.type === "user" ? eventsFromUserContent(message?.content, parentId) : eventsFromContentBlocks(
|
|
2918
|
+
Array.isArray(message?.content) ? message.content : void 0,
|
|
2919
|
+
parentId
|
|
2920
|
+
);
|
|
2653
2921
|
if (obj.type === "assistant") {
|
|
2654
2922
|
const usage = usageFromClaude(message?.usage);
|
|
2655
2923
|
if (usage) events.push({ type: "usage", data: usage, scope: "request" });
|
|
@@ -4810,7 +5078,8 @@ async function installNpmGlobalPackage(opts) {
|
|
|
4810
5078
|
exitCode: 0,
|
|
4811
5079
|
stdout: result.stdout,
|
|
4812
5080
|
stderr: result.stderr,
|
|
4813
|
-
|
|
5081
|
+
// Library-only packages (`@cursor/sdk`) have no CLI to look for.
|
|
5082
|
+
message: !opts.cliBin ? `Installed ${opts.npmPackage}` : binPath ? `Installed ${opts.npmPackage} \u2192 ${binPath}` : `Installed ${opts.npmPackage} (CLI not yet on PATH)`
|
|
4814
5083
|
};
|
|
4815
5084
|
}
|
|
4816
5085
|
async function resolveExistingCli(agent) {
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
normalizeAbleTimeCredential,
|
|
7
7
|
normalizeAbleTimeHost,
|
|
8
8
|
rewriteAbleTimeError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VVOAXBND.js";
|
|
10
10
|
import {
|
|
11
11
|
httpFetch
|
|
12
12
|
} from "./chunk-VKQGAWHY.js";
|
|
13
13
|
import {
|
|
14
14
|
getAbleTimeAccessToken,
|
|
15
15
|
getAbleTimeHost
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-4H5WO4H3.js";
|
|
17
17
|
|
|
18
18
|
// src/integrations/abletime-rest.ts
|
|
19
19
|
var ABLETIME_REST_PREFIX = "/api/public/v2";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-ROPGQRPU.js";
|
|
9
9
|
import {
|
|
10
10
|
appDataDir
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-A4JGXX2F.js";
|
|
12
12
|
import {
|
|
13
13
|
run
|
|
14
14
|
} from "./chunk-QVN2WOKJ.js";
|
|
@@ -19,7 +19,7 @@ import { join } from "path";
|
|
|
19
19
|
|
|
20
20
|
// src/brightsy/accounts.ts
|
|
21
21
|
async function loadConnectedTeams() {
|
|
22
|
-
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-
|
|
22
|
+
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-GXV22ZSF.js");
|
|
23
23
|
return listConnectedBrightsyTeams2();
|
|
24
24
|
}
|
|
25
25
|
async function runBrightsyTeamsJson(args) {
|
|
@@ -48,14 +48,14 @@ async function listBrightsyAccounts() {
|
|
|
48
48
|
async function getBrightsySession() {
|
|
49
49
|
try {
|
|
50
50
|
const { ensureBrightsyLocalConfigFresh: ensureBrightsyLocalConfigFresh2 } = await import("./oauth-S3M7B475.js");
|
|
51
|
-
const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-
|
|
51
|
+
const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-GXV22ZSF.js");
|
|
52
52
|
await ensureBrightsyLocalConfigFresh2();
|
|
53
53
|
await ensureConnectedBrightsyTeamTokens2();
|
|
54
54
|
loadBrightsyConfig();
|
|
55
55
|
const data = await runBrightsyTeamsJson([]);
|
|
56
56
|
const accounts = Array.isArray(data.teams) ? data.teams : [];
|
|
57
57
|
const active = data.active ?? accounts.find((a) => a.active) ?? null;
|
|
58
|
-
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-
|
|
58
|
+
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-GXV22ZSF.js");
|
|
59
59
|
const connectedTeams = ensureCliTeamTracked2(
|
|
60
60
|
active ? { id: active.id, slug: active.slug, name: active.name } : void 0
|
|
61
61
|
);
|
|
@@ -95,7 +95,7 @@ async function performBrightsyAccountSwitch(accountIdOrSlug) {
|
|
|
95
95
|
return { cfg, target: data.active };
|
|
96
96
|
}
|
|
97
97
|
async function switchBrightsyAccount(accountIdOrSlug) {
|
|
98
|
-
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-
|
|
98
|
+
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-GXV22ZSF.js");
|
|
99
99
|
await connectBrightsyTeam2(accountIdOrSlug);
|
|
100
100
|
return getBrightsySession();
|
|
101
101
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
textFromAbleTimeDoc
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3PGFAVFL.js";
|
|
4
4
|
import {
|
|
5
5
|
assertAbleTimeCredential,
|
|
6
6
|
callAbleTimeTool,
|
|
7
7
|
normalizeAbleTimeHost,
|
|
8
8
|
rewriteAbleTimeError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5ELC3KK3.js";
|
|
10
10
|
import {
|
|
11
11
|
isAbleTimeConnected,
|
|
12
12
|
saveAbleTimeConnection
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-P3DCZRER.js";
|
|
14
14
|
|
|
15
15
|
// src/integrations/abletime.ts
|
|
16
16
|
var CLOSED_STATES = /* @__PURE__ */ new Set([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_ABLETIME_HOST,
|
|
3
3
|
normalizeAbleTimeHost
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5ELC3KK3.js";
|
|
5
5
|
import {
|
|
6
6
|
httpFetch
|
|
7
7
|
} from "./chunk-N7WZ6NIN.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getAbleTimeHost,
|
|
11
11
|
loadAppSettings,
|
|
12
12
|
saveAbleTimeConnection
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-P3DCZRER.js";
|
|
14
14
|
|
|
15
15
|
// src/integrations/abletime-oauth.ts
|
|
16
16
|
import { createHash, randomBytes } from "crypto";
|
|
@@ -280,7 +280,7 @@ async function startAbleTimeOAuth(opts) {
|
|
|
280
280
|
persistAbleTimeTokens(data, { host });
|
|
281
281
|
const token = data.access_token.trim();
|
|
282
282
|
try {
|
|
283
|
-
const { getAbleTimeOrientation } = await import("./abletime-
|
|
283
|
+
const { getAbleTimeOrientation } = await import("./abletime-VSV6AUBV.js");
|
|
284
284
|
const orientation = await getAbleTimeOrientation({ token, host });
|
|
285
285
|
return saveAbleTimeConnection({
|
|
286
286
|
accessToken: token,
|