@sideboard-ai/core 0.1.294 → 0.1.296
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/agents/claude-runner.cjs +55 -0
- package/dist/agents/claude-runner.js +57 -1
- package/dist/agents/cursor-runner.cjs +128 -50
- package/dist/agents/cursor-runner.js +63 -44
- package/dist/{agents-2PDBDZPS.js → agents-DZTPUKVF.js} +5 -5
- package/dist/{agents-73JXQXF2.js → agents-ICHYDSCD.js} +8 -8
- package/dist/{chunk-SVQTKVXH.js → chunk-2O3ICR77.js} +4 -4
- package/dist/{chunk-YKO6HG74.js → chunk-67BWWLEB.js} +6 -6
- package/dist/{chunk-JEYJGQ33.js → chunk-6GTABVNG.js} +7 -7
- package/dist/{chunk-YEIPPZ5W.js → chunk-BGEECLKH.js} +2 -2
- package/dist/{chunk-AFLNFGGB.js → chunk-ED4ZXQVO.js} +1 -0
- package/dist/{chunk-MIVX7QKI.js → chunk-HO5R3ZRH.js} +1 -0
- package/dist/{chunk-7UUILVMV.js → chunk-IOY2LF3Y.js} +1 -1
- package/dist/{chunk-K6IOJI3L.js → chunk-J54UPHXZ.js} +71 -2
- package/dist/{chunk-ZEP6JIRF.js → chunk-JWXJXEA3.js} +1 -1
- package/dist/{chunk-YSLCWCMJ.js → chunk-Q3DPZ4DE.js} +1 -1
- package/dist/{chunk-NYBFYFK7.js → chunk-QDA6NXRA.js} +1 -0
- package/dist/{chunk-CECZUHA5.js → chunk-QT36F4TD.js} +55 -26
- package/dist/{chunk-YRXV3E7J.js → chunk-TVN4TDFB.js} +9 -0
- package/dist/{chunk-6SGYGYH7.js → chunk-VXNZG4J6.js} +1 -1
- package/dist/{chunk-BYAFYLLZ.js → chunk-W2A63ZOK.js} +179 -42
- package/dist/{chunk-E7G7RY6T.js → chunk-WQREAX35.js} +2 -2
- package/dist/{chunk-QB5MDOHL.js → chunk-WZLV4WNS.js} +9 -0
- package/dist/{chunk-BJUHZSZQ.js → chunk-ZXWRNA4G.js} +5 -5
- package/dist/{conductor-7DEMFEIO.js → conductor-HJFDYIZD.js} +5 -5
- package/dist/{conductor-ZQZTYXSX.js → conductor-ZXDIA6OF.js} +6 -6
- package/dist/{coordinator-prompt-AROMFCP2.js → coordinator-prompt-ILHSVPOG.js} +3 -3
- package/dist/{coordinator-prompt-K6XHUG3N.js → coordinator-prompt-L3V2CMWX.js} +3 -3
- package/dist/{global-workspace-4WAU4PAL.js → global-workspace-47G453ZU.js} +3 -3
- package/dist/{global-workspace-PX4GUVLW.js → global-workspace-NMRUGGFF.js} +3 -3
- package/dist/index.cjs +1039 -700
- package/dist/index.d.cts +25 -4
- package/dist/index.d.ts +25 -4
- package/dist/index.js +299 -125
- package/dist/mcp/run-stdio.cjs +250 -144
- package/dist/mcp/run-stdio.js +70 -11
- package/dist/{orchestrator-LIEGSQ6M.js → orchestrator-MR7TCIPP.js} +7 -7
- package/dist/{orchestrator-YNEEEP6O.js → orchestrator-ZQU62CES.js} +10 -10
- package/dist/{thread-store-DPKESDFR.js → thread-store-H6D6MDUM.js} +1 -1
- package/dist/{thread-store-X6S2GIR5.js → thread-store-SADLLKRE.js} +1 -1
- package/dist/{workspaces-MFU3IGAP.js → workspaces-PGY4UWZ3.js} +3 -3
- package/dist/{workspaces-U7SSD27C.js → workspaces-WGZPRQJX.js} +3 -3
- package/dist/{worktree-TQKASYPZ.js → worktree-3MF5J5XZ.js} +2 -2
- package/dist/{worktree-2VSHRI72.js → worktree-JZXDAKQF.js} +2 -2
- package/package.json +1 -1
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
compactSummaryPart,
|
|
3
3
|
isInternalAgentStatusText,
|
|
4
4
|
lastAssistantMessageText
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q3DPZ4DE.js";
|
|
6
6
|
import {
|
|
7
7
|
isCloudCoordinatorThread,
|
|
8
8
|
isGlobalThread,
|
|
9
9
|
isOrchestratorThread,
|
|
10
10
|
isSlackCoordinatorThread
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BGEECLKH.js";
|
|
12
12
|
import {
|
|
13
13
|
mergeAgentGitAuthEnv,
|
|
14
14
|
resolveAgentGitAuthEnv
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JWXJXEA3.js";
|
|
16
16
|
import {
|
|
17
17
|
allocateTeamName,
|
|
18
18
|
createEmptyThread,
|
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
updateThread,
|
|
24
24
|
worktreeNameFromPath,
|
|
25
25
|
writeThread
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WZLV4WNS.js";
|
|
27
27
|
import {
|
|
28
28
|
ensureWorktreeSideboardIgnored
|
|
29
29
|
} from "./chunk-2P4XKWV2.js";
|
|
30
30
|
import {
|
|
31
31
|
clipToolResultForStore
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-HO5R3ZRH.js";
|
|
33
33
|
import {
|
|
34
34
|
ATTACHMENTS_DIR,
|
|
35
35
|
DETACHED_JOBS_DIR,
|
|
@@ -1776,7 +1776,7 @@ var PORT_RANGE_SIZE = 10;
|
|
|
1776
1776
|
var RECLAIM_RETRY_DELAY_MS = 40;
|
|
1777
1777
|
var RECLAIM_TRIES = 8;
|
|
1778
1778
|
async function killReclaimable(ports, worktreePath, signal) {
|
|
1779
|
-
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-
|
|
1779
|
+
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-ZXDIA6OF.js");
|
|
1780
1780
|
if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
|
|
1781
1781
|
else killListenersOnPorts2(ports);
|
|
1782
1782
|
}
|
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
looksLikeSkillBody,
|
|
10
10
|
skillCommandFromBody,
|
|
11
11
|
withEventParentId
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Q3DPZ4DE.js";
|
|
13
13
|
import {
|
|
14
14
|
isOrchestratorThread
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BGEECLKH.js";
|
|
16
16
|
import {
|
|
17
17
|
codexUnattendedGitConfigArgs,
|
|
18
18
|
mergeAgentGitAuthEnv,
|
|
19
19
|
resolveAgentGitAuthEnv,
|
|
20
20
|
resolveCodexGitWritableRoots
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JWXJXEA3.js";
|
|
22
22
|
import {
|
|
23
23
|
loadBrightsyConfig
|
|
24
24
|
} from "./chunk-33KDPEK4.js";
|
|
@@ -38,13 +38,13 @@ import {
|
|
|
38
38
|
packagedMcpStdioPath,
|
|
39
39
|
parseCursorRunnerLine,
|
|
40
40
|
resolveNodeLaunch
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-IOY2LF3Y.js";
|
|
42
42
|
import {
|
|
43
43
|
extractJsonErrorMessage,
|
|
44
44
|
formatUnknownDetail,
|
|
45
45
|
looksLikeAgentFailureMessage,
|
|
46
46
|
looksLikeBrightsyEmptyCompletion
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-HO5R3ZRH.js";
|
|
48
48
|
import {
|
|
49
49
|
run
|
|
50
50
|
} from "./chunk-QVN2WOKJ.js";
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
PILOT_TOOL_DESCRIPTIONS,
|
|
59
59
|
PILOT_TOOL_NAMES,
|
|
60
60
|
agentRpcConnectFromMetadata
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-QDA6NXRA.js";
|
|
62
62
|
import {
|
|
63
63
|
claudeChromeEnabled,
|
|
64
64
|
fromInclusiveInputUsage,
|
|
@@ -1755,7 +1755,7 @@ var claudeAdapter = {
|
|
|
1755
1755
|
);
|
|
1756
1756
|
}
|
|
1757
1757
|
const mode = permissionMode(thread);
|
|
1758
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
1758
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-47G453ZU.js");
|
|
1759
1759
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
1760
1760
|
const rpc = worktreeAgentRpc(isOrchestrator);
|
|
1761
1761
|
const injectedServers = await buildInjectedMcpServers({
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ensureGhPreferOrigin,
|
|
4
4
|
resolveGithubRepoSlug,
|
|
5
5
|
resolveRepoRoot
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JWXJXEA3.js";
|
|
7
7
|
import {
|
|
8
8
|
allocateTeamName,
|
|
9
9
|
createEmptyThread,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
teamSlugFromName,
|
|
13
13
|
updateThread,
|
|
14
14
|
writeThread
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WZLV4WNS.js";
|
|
16
16
|
import {
|
|
17
17
|
ATTACHMENTS_DIR,
|
|
18
18
|
attachmentsGitignoreBody
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
HUGE_TOOL_RESULT_SUMMARY,
|
|
2
3
|
clipToolResultForStore,
|
|
4
|
+
formatUnknownDetail,
|
|
5
|
+
looksLikeCursorStreamCutOff,
|
|
3
6
|
looksLikeHugeToolResultDump
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HO5R3ZRH.js";
|
|
5
8
|
import {
|
|
6
9
|
CLI_DIR
|
|
7
10
|
} from "./chunk-6K64FJDD.js";
|
|
@@ -11,7 +14,7 @@ import {
|
|
|
11
14
|
WAIT_FOR_TURN_DESCRIPTION,
|
|
12
15
|
WAIT_FOR_TURN_SCHEMA,
|
|
13
16
|
createPilotRpcExecutors
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QDA6NXRA.js";
|
|
15
18
|
|
|
16
19
|
// src/agents/tool-result-clip.ts
|
|
17
20
|
import { mkdirSync, writeFileSync } from "fs";
|
|
@@ -73,6 +76,68 @@ function clipAgentEventForEmit(event, cwd) {
|
|
|
73
76
|
return event;
|
|
74
77
|
}
|
|
75
78
|
|
|
79
|
+
// src/agents/cursor-tool-guard.ts
|
|
80
|
+
var CURSOR_TOOL_RECOVERY_HINT = "Continue with a smaller request. If you were reading a large file or API payload, pass offset and limit or write the output to .context/cli/ and read a slice. Do not retry the same call.";
|
|
81
|
+
function cursorToolErrorText(err) {
|
|
82
|
+
const raw = formatUnknownDetail(err).replace(/\s+/g, " ").trim();
|
|
83
|
+
const message = looksLikeHugeToolResultDump(raw) ? HUGE_TOOL_RESULT_SUMMARY : (raw || "unknown tool error").slice(0, 500);
|
|
84
|
+
return `Error: ${message}
|
|
85
|
+
${CURSOR_TOOL_RECOVERY_HINT}`;
|
|
86
|
+
}
|
|
87
|
+
function cursorToolErrorResult(err) {
|
|
88
|
+
return {
|
|
89
|
+
isError: true,
|
|
90
|
+
content: [{ type: "text", text: cursorToolErrorText(err) }]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function boundedCursorToolResult(result, opts) {
|
|
94
|
+
const prefix = opts?.name ?? "cursor-tool";
|
|
95
|
+
if (typeof result === "string") {
|
|
96
|
+
return spillAndClipToolResult(result, { cwd: opts?.cwd, prefix });
|
|
97
|
+
}
|
|
98
|
+
if (result == null) {
|
|
99
|
+
return cursorToolErrorText(new Error("tool returned no result"));
|
|
100
|
+
}
|
|
101
|
+
let json;
|
|
102
|
+
try {
|
|
103
|
+
json = JSON.stringify(result);
|
|
104
|
+
} catch (err) {
|
|
105
|
+
return cursorToolErrorText(err);
|
|
106
|
+
}
|
|
107
|
+
return spillAndClipToolResult(json, { cwd: opts?.cwd, prefix });
|
|
108
|
+
}
|
|
109
|
+
function guardCursorCustomTool(tool, opts) {
|
|
110
|
+
const execute = tool.execute.bind(tool);
|
|
111
|
+
return {
|
|
112
|
+
...tool,
|
|
113
|
+
execute: async (args, context) => {
|
|
114
|
+
try {
|
|
115
|
+
const result = await execute(args, context);
|
|
116
|
+
return boundedCursorToolResult(result, opts);
|
|
117
|
+
} catch (err) {
|
|
118
|
+
return cursorToolErrorResult(err);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
var NON_RECOVERABLE_RUN_ERROR = /invalid (?:user )?api key|not logged in|not authenticated|unauthorized|credit balance|out of credits|insufficient.?quota|usage limit|you've hit your|too many requests|rate.?limit/;
|
|
124
|
+
function shouldReturnRunErrorToAgent(detail) {
|
|
125
|
+
const text = detail.trim();
|
|
126
|
+
if (!text) return false;
|
|
127
|
+
if (looksLikeHugeToolResultDump(text) || looksLikeCursorStreamCutOff(text)) return true;
|
|
128
|
+
const head = text.slice(0, 2e3).toLowerCase();
|
|
129
|
+
if (NON_RECOVERABLE_RUN_ERROR.test(head)) return false;
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
function cursorRunErrorRecoveryPrompt(detail) {
|
|
133
|
+
const summary = looksLikeHugeToolResultDump(detail) ? HUGE_TOOL_RESULT_SUMMARY : detail.replace(/\s+/g, " ").trim().slice(0, 400);
|
|
134
|
+
return [
|
|
135
|
+
"A tool call failed before its result reached you. The session is still open.",
|
|
136
|
+
`Error: ${summary || "unknown"}`,
|
|
137
|
+
CURSOR_TOOL_RECOVERY_HINT
|
|
138
|
+
].join("\n");
|
|
139
|
+
}
|
|
140
|
+
|
|
76
141
|
// src/agent-rpc/cursor-tools.ts
|
|
77
142
|
function sideboardCursorRpcTools(opts) {
|
|
78
143
|
const exec = createPilotRpcExecutors(opts);
|
|
@@ -106,5 +171,9 @@ function sideboardCursorRpcTools(opts) {
|
|
|
106
171
|
export {
|
|
107
172
|
clipMcpToolResult,
|
|
108
173
|
clipAgentEventForEmit,
|
|
174
|
+
cursorToolErrorText,
|
|
175
|
+
guardCursorCustomTool,
|
|
176
|
+
shouldReturnRunErrorToAgent,
|
|
177
|
+
cursorRunErrorRecoveryPrompt,
|
|
109
178
|
sideboardCursorRpcTools
|
|
110
179
|
};
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
parseSessionQuotaResetAt,
|
|
28
28
|
planModeTurnInstruction,
|
|
29
29
|
resolveQuotaFallbackAgent
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2O3ICR77.js";
|
|
31
31
|
import {
|
|
32
32
|
REVIEW_TAB_TITLE,
|
|
33
33
|
applyWorktreePkgCacheEnv,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
worktreeDevProcessKey,
|
|
67
67
|
worktreeRunProcessKey,
|
|
68
68
|
worktreeSetupProcessKey
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-ZXWRNA4G.js";
|
|
70
70
|
import {
|
|
71
71
|
applyAgentEvent,
|
|
72
72
|
clipAgentEventForPaint,
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
summarizeTurnStderr,
|
|
94
94
|
toolDescription,
|
|
95
95
|
turnFailChatText
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-ED4ZXQVO.js";
|
|
97
97
|
import {
|
|
98
98
|
SLACK_REPLY_FORMATTING,
|
|
99
99
|
addWorkspace,
|
|
@@ -118,7 +118,7 @@ import {
|
|
|
118
118
|
stageAbsolutePathsAsAttachments,
|
|
119
119
|
stageBuffersAsAttachments,
|
|
120
120
|
syncWorkspacesFromThreads
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-WQREAX35.js";
|
|
122
122
|
import {
|
|
123
123
|
addPrStackLayer,
|
|
124
124
|
allocateTeamSlug,
|
|
@@ -160,7 +160,7 @@ import {
|
|
|
160
160
|
resolveRepoRoot,
|
|
161
161
|
switchWorktreeBranch,
|
|
162
162
|
withRepoGitLock
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-VXNZG4J6.js";
|
|
164
164
|
import {
|
|
165
165
|
clearStaleIndexLocks,
|
|
166
166
|
enrichPathWithNpmGlobalBin,
|
|
@@ -238,7 +238,7 @@ import {
|
|
|
238
238
|
worktreeNameFromPath,
|
|
239
239
|
worktreeSlugForTicket,
|
|
240
240
|
writeThread
|
|
241
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-TVN4TDFB.js";
|
|
242
242
|
import {
|
|
243
243
|
annotateDevAccessRuns,
|
|
244
244
|
appDataDir,
|
|
@@ -292,7 +292,7 @@ function formatInjectedNoticesForTurn(notices) {
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
// src/orchestrator/orchestrator.ts
|
|
295
|
-
import { randomUUID as
|
|
295
|
+
import { randomUUID as randomUUID5 } from "crypto";
|
|
296
296
|
import { existsSync as existsSync14 } from "fs";
|
|
297
297
|
|
|
298
298
|
// src/agents/spawn.ts
|
|
@@ -503,9 +503,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
503
503
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
504
504
|
);
|
|
505
505
|
}
|
|
506
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
506
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-NMRUGGFF.js");
|
|
507
507
|
if (isGlobalThread2(thread)) {
|
|
508
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
508
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-L3V2CMWX.js");
|
|
509
509
|
ensureGlobalCoordinatorCwd2(
|
|
510
510
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
511
511
|
);
|
|
@@ -545,6 +545,7 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
545
545
|
}
|
|
546
546
|
applyManagedAccountEnv(env, thread.agent, resolveAccountForThread(thread, accounts));
|
|
547
547
|
sanitizeAgentHostEnv(env, cmd.cwd);
|
|
548
|
+
env[SIDEBOARD_THREAD_ID_ENV] = thread.id;
|
|
548
549
|
ensureAgentPath(env);
|
|
549
550
|
applyPromptCacheTtlEnv(thread.agent, env);
|
|
550
551
|
applyAgentRunnerHeapEnv(env);
|
|
@@ -1496,6 +1497,31 @@ function thisProcessShouldDrainAgentQueues() {
|
|
|
1496
1497
|
return !isDesktopHostAlive();
|
|
1497
1498
|
}
|
|
1498
1499
|
|
|
1500
|
+
// src/agents/tool-permission.ts
|
|
1501
|
+
import { randomUUID } from "crypto";
|
|
1502
|
+
import { dirname } from "path";
|
|
1503
|
+
var queues = /* @__PURE__ */ new Map();
|
|
1504
|
+
var publisher = null;
|
|
1505
|
+
function setToolPermissionPublisher(next) {
|
|
1506
|
+
publisher = next;
|
|
1507
|
+
}
|
|
1508
|
+
function denied(message) {
|
|
1509
|
+
return { behavior: "deny", message, decisionClassification: "user_reject" };
|
|
1510
|
+
}
|
|
1511
|
+
function clearPrompt(threadId, id) {
|
|
1512
|
+
publisher?.clear(threadId, id);
|
|
1513
|
+
}
|
|
1514
|
+
function denyPendingToolPermissions(threadId) {
|
|
1515
|
+
const q = queues.get(threadId);
|
|
1516
|
+
if (!q?.length) return;
|
|
1517
|
+
const pending = q.splice(0, q.length);
|
|
1518
|
+
queues.delete(threadId);
|
|
1519
|
+
const answer = denied("The turn ended before this was allowed.");
|
|
1520
|
+
for (const item of pending) item.resolve(answer);
|
|
1521
|
+
const last = pending[pending.length - 1];
|
|
1522
|
+
if (last) clearPrompt(threadId, last.id);
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1499
1525
|
// src/orchestrator/notify-orchestrator.ts
|
|
1500
1526
|
var MAX_NOTIFY_ORCHESTRATOR_MESSAGE_CHARS = 1500;
|
|
1501
1527
|
var inputRequiredNotified = /* @__PURE__ */ new Set();
|
|
@@ -1649,6 +1675,7 @@ function writeAgentBlock(threadId, block) {
|
|
|
1649
1675
|
updateThread(threadId, { agentBlock: block });
|
|
1650
1676
|
}
|
|
1651
1677
|
function settleAgentBlock(threadId, parts, failed) {
|
|
1678
|
+
denyPendingToolPermissions(threadId);
|
|
1652
1679
|
const thread = readThread(threadId);
|
|
1653
1680
|
if (!thread || thread.status === "archived") return;
|
|
1654
1681
|
const next = agentBlockAfterTurn({
|
|
@@ -1762,13 +1789,13 @@ function writeStoppedStatus(threadId, reason) {
|
|
|
1762
1789
|
}
|
|
1763
1790
|
|
|
1764
1791
|
// src/orchestrator/steer-request.ts
|
|
1765
|
-
import { randomUUID } from "crypto";
|
|
1792
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
1766
1793
|
function isUnclaimedSteerRequest(req) {
|
|
1767
1794
|
return Boolean(req?.requestId && !req.claimedAt);
|
|
1768
1795
|
}
|
|
1769
1796
|
function nextSteerRequest(existing) {
|
|
1770
1797
|
if (existing?.requestId && !existing.claimedAt) return existing;
|
|
1771
|
-
return { requestId:
|
|
1798
|
+
return { requestId: randomUUID2(), requestedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
1772
1799
|
}
|
|
1773
1800
|
function claimSteerRequest(threadId) {
|
|
1774
1801
|
const pending = readThread(threadId)?.steerRequest;
|
|
@@ -1781,7 +1808,6 @@ function claimSteerRequest(threadId) {
|
|
|
1781
1808
|
// src/threads/agent-purpose-title.ts
|
|
1782
1809
|
function agentPurposeStamp(input) {
|
|
1783
1810
|
if (input.autoContinue) return null;
|
|
1784
|
-
if (input.thread.sourceType === "orchestration") return null;
|
|
1785
1811
|
if (input.thread.title.trim() === REVIEW_TAB_TITLE) return null;
|
|
1786
1812
|
const identities = worktreeIdentityTitles(input.thread);
|
|
1787
1813
|
const titled = input.thread.title?.trim() || "";
|
|
@@ -2859,7 +2885,7 @@ async function forkThreadWorktree(input, onSetupLine) {
|
|
|
2859
2885
|
}
|
|
2860
2886
|
|
|
2861
2887
|
// src/orchestrator/quota-failover.ts
|
|
2862
|
-
import { randomUUID as
|
|
2888
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
2863
2889
|
function managedKindForAgent(agent) {
|
|
2864
2890
|
return agent === "claude" || agent === "codex" ? agent : null;
|
|
2865
2891
|
}
|
|
@@ -2979,7 +3005,7 @@ function buildQuotaHandoffAttachment(from, limitText, fallbackAgent) {
|
|
|
2979
3005
|
...instructions
|
|
2980
3006
|
].join("\n");
|
|
2981
3007
|
return {
|
|
2982
|
-
id:
|
|
3008
|
+
id: randomUUID3(),
|
|
2983
3009
|
name: orch ? "Orchestration quota handoff.md" : "Quota handoff.md",
|
|
2984
3010
|
kind: "transcript",
|
|
2985
3011
|
content: body
|
|
@@ -3119,7 +3145,7 @@ async function adoptThread(input) {
|
|
|
3119
3145
|
messages: input.messages ?? []
|
|
3120
3146
|
});
|
|
3121
3147
|
writeThread(thread);
|
|
3122
|
-
const { addWorkspace: addWorkspace2 } = await import("./workspaces-
|
|
3148
|
+
const { addWorkspace: addWorkspace2 } = await import("./workspaces-PGY4UWZ3.js");
|
|
3123
3149
|
await addWorkspace2(repoPath);
|
|
3124
3150
|
const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-5N2KTYIT.js");
|
|
3125
3151
|
await ensureWorktreeSideboardIgnored(input.worktreePath);
|
|
@@ -3602,7 +3628,7 @@ async function createPrStack(input, onSetupLine) {
|
|
|
3602
3628
|
|
|
3603
3629
|
// src/diff/diff.ts
|
|
3604
3630
|
import { existsSync as existsSync9, mkdirSync, readFileSync as readFileSync6, statSync as statSync2, writeFileSync as writeFileSync5 } from "fs";
|
|
3605
|
-
import { dirname, join as join8 } from "path";
|
|
3631
|
+
import { dirname as dirname2, join as join8 } from "path";
|
|
3606
3632
|
async function inspectGitWorktree(worktreePath) {
|
|
3607
3633
|
if (!worktreePath || !existsSync9(worktreePath)) return "missing_worktree";
|
|
3608
3634
|
const check = await git(["rev-parse", "--is-inside-work-tree"], worktreePath, {
|
|
@@ -4331,7 +4357,7 @@ function assertSafeRelativePath(relativePath) {
|
|
|
4331
4357
|
function writeWorktreeFile(worktreePath, relativePath, content) {
|
|
4332
4358
|
assertSafeRelativePath(relativePath);
|
|
4333
4359
|
const abs = join8(worktreePath, relativePath);
|
|
4334
|
-
mkdirSync(
|
|
4360
|
+
mkdirSync(dirname2(abs), { recursive: true });
|
|
4335
4361
|
writeFileSync5(abs, content, "utf8");
|
|
4336
4362
|
return { path: relativePath };
|
|
4337
4363
|
}
|
|
@@ -4997,7 +5023,7 @@ import { join as join12 } from "path";
|
|
|
4997
5023
|
|
|
4998
5024
|
// src/skills/detached-job-path.ts
|
|
4999
5025
|
import { existsSync as existsSync11 } from "fs";
|
|
5000
|
-
import { dirname as
|
|
5026
|
+
import { dirname as dirname3, join as join11 } from "path";
|
|
5001
5027
|
import { fileURLToPath } from "url";
|
|
5002
5028
|
var DETACHED_JOB_FILENAMES = ["detached-job.cjs", "detached-job.js"];
|
|
5003
5029
|
function compiledModuleDir() {
|
|
@@ -5006,7 +5032,7 @@ function compiledModuleDir() {
|
|
|
5006
5032
|
try {
|
|
5007
5033
|
const url = import.meta.url;
|
|
5008
5034
|
if (typeof url === "string" && url.length > 0) {
|
|
5009
|
-
return
|
|
5035
|
+
return dirname3(fileURLToPath(url));
|
|
5010
5036
|
}
|
|
5011
5037
|
} catch {
|
|
5012
5038
|
}
|
|
@@ -5032,7 +5058,7 @@ function resolveDetachedJobScript() {
|
|
|
5032
5058
|
for (let i = 0; i < 8; i++) {
|
|
5033
5059
|
const candidate = detachedJobScriptIn(dir);
|
|
5034
5060
|
if (candidate) return candidate;
|
|
5035
|
-
const parent =
|
|
5061
|
+
const parent = dirname3(dir);
|
|
5036
5062
|
if (parent === dir) break;
|
|
5037
5063
|
dir = parent;
|
|
5038
5064
|
}
|
|
@@ -5744,7 +5770,7 @@ async function syncThreadBranchFromGit(threadId) {
|
|
|
5744
5770
|
}
|
|
5745
5771
|
|
|
5746
5772
|
// src/store/schedules.ts
|
|
5747
|
-
import { randomUUID as
|
|
5773
|
+
import { randomUUID as randomUUID4 } from "crypto";
|
|
5748
5774
|
import { existsSync as existsSync13, readFileSync as readFileSync8 } from "fs";
|
|
5749
5775
|
import { join as join13 } from "path";
|
|
5750
5776
|
import { Cron } from "croner";
|
|
@@ -5883,7 +5909,7 @@ function buildTask(input, now) {
|
|
|
5883
5909
|
const ts = nowIso(now);
|
|
5884
5910
|
const agent = input.agent ? coerceOrchestratorAgent(input.agent) : null;
|
|
5885
5911
|
return {
|
|
5886
|
-
id:
|
|
5912
|
+
id: randomUUID4(),
|
|
5887
5913
|
name: input.name?.trim() || defaultScheduleName(prompt),
|
|
5888
5914
|
prompt,
|
|
5889
5915
|
enabled: input.enabled !== false,
|
|
@@ -5994,7 +6020,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
5994
6020
|
${prompt}`;
|
|
5995
6021
|
}
|
|
5996
6022
|
async function defaultDeps() {
|
|
5997
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
6023
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-MR7TCIPP.js");
|
|
5998
6024
|
const orch = getOrchestrator2();
|
|
5999
6025
|
return {
|
|
6000
6026
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -7707,7 +7733,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
|
|
|
7707
7733
|
const request = sameIntent ? pending : {
|
|
7708
7734
|
op,
|
|
7709
7735
|
scriptName: scriptName ?? null,
|
|
7710
|
-
requestId:
|
|
7736
|
+
requestId: randomUUID5(),
|
|
7711
7737
|
requestedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
7712
7738
|
};
|
|
7713
7739
|
if (!sameIntent) {
|
|
@@ -8866,7 +8892,7 @@ async function startOrchestration(opts) {
|
|
|
8866
8892
|
sourceRef: "default",
|
|
8867
8893
|
...createOpts
|
|
8868
8894
|
}).catch(async () => {
|
|
8869
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
8895
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-JZXDAKQF.js");
|
|
8870
8896
|
const repo = await resolveRepoRoot2(repoPath);
|
|
8871
8897
|
const def = await resolveDefaultBranch2(repo);
|
|
8872
8898
|
return orch.createThread({
|
|
@@ -8876,7 +8902,7 @@ async function startOrchestration(opts) {
|
|
|
8876
8902
|
repoPath: repo
|
|
8877
8903
|
});
|
|
8878
8904
|
});
|
|
8879
|
-
const { updateThread: upd } = await import("./thread-store-
|
|
8905
|
+
const { updateThread: upd } = await import("./thread-store-H6D6MDUM.js");
|
|
8880
8906
|
const updated = upd(thread.id, {
|
|
8881
8907
|
sourceType: "orchestration",
|
|
8882
8908
|
sourceRef: goal
|
|
@@ -8893,8 +8919,11 @@ export {
|
|
|
8893
8919
|
MAX_RUN_LOG_CHARS,
|
|
8894
8920
|
DEFAULT_RUN_LOG_TAIL_CHARS,
|
|
8895
8921
|
sliceRunLogOutput,
|
|
8922
|
+
setToolPermissionPublisher,
|
|
8896
8923
|
resolveNotifyCallerThread,
|
|
8897
8924
|
notifyOrchestrator,
|
|
8925
|
+
clampBlockReason,
|
|
8926
|
+
writeAgentBlock,
|
|
8898
8927
|
chatBlockedSuffix,
|
|
8899
8928
|
agentBlockFields,
|
|
8900
8929
|
stampAskUserBlock,
|
|
@@ -873,9 +873,18 @@ function branchDisplayLabel(branchName, worktreePath) {
|
|
|
873
873
|
}
|
|
874
874
|
return branchName.trim();
|
|
875
875
|
}
|
|
876
|
+
function taskPurposeTitle(title) {
|
|
877
|
+
const trimmed = title?.trim() ?? "";
|
|
878
|
+
if (!trimmed || teamSlugFromName(trimmed)) return null;
|
|
879
|
+
return trimmed;
|
|
880
|
+
}
|
|
876
881
|
function threadDisplayLabel(thread) {
|
|
877
882
|
if (thread.userSetTitle && thread.title?.trim()) return thread.title.trim();
|
|
878
883
|
if (thread.prTitle?.trim()) return thread.prTitle.trim();
|
|
884
|
+
if (isPlaceholderBranch(thread.branchName, thread.worktreePath)) {
|
|
885
|
+
const purpose = taskPurposeTitle(thread.title);
|
|
886
|
+
if (purpose) return purpose;
|
|
887
|
+
}
|
|
879
888
|
return branchDisplayLabel(thread.branchName, thread.worktreePath);
|
|
880
889
|
}
|
|
881
890
|
function worktreeDisplayLabel(thread) {
|