openfox 2.0.79 → 2.0.81
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/{chat-handler-5ZHPYU24.js → chat-handler-NRJWHZB2.js} +12 -12
- package/dist/{chunk-UIU7OGHP.js → chunk-3Q5WQMPA.js} +4 -4
- package/dist/{chunk-NZIYELSQ.js → chunk-4GMRZU7A.js} +2 -2
- package/dist/{chunk-TSVFRWSG.js → chunk-A2IZ4PWQ.js} +8 -5
- package/dist/{chunk-5CQRB7AD.js → chunk-AIIFQYU5.js} +2 -2
- package/dist/{chunk-M7EFXRDS.js → chunk-BUXIESO5.js} +5 -5
- package/dist/{chunk-SGBXBP3S.js → chunk-D25OSL6V.js} +31 -58
- package/dist/{chunk-WUSWNLTV.js → chunk-E3MS5CF7.js} +12 -9
- package/dist/{chunk-VGWJFXPR.js → chunk-EZDTCQMR.js} +9 -9
- package/dist/{chunk-YFVSSMA3.js → chunk-NH2PVB6R.js} +19 -20
- package/dist/{chunk-DI4SIPFT.js → chunk-NLMT2HII.js} +10 -10
- package/dist/{chunk-TO66LKWD.js → chunk-PVO2XVLV.js} +72 -64
- package/dist/{chunk-EHVDAVYG.js → chunk-QHLWWQRC.js} +2 -2
- package/dist/chunk-UP5CYTEC.js +7 -0
- package/dist/{chunk-MTUYDBSL.js → chunk-VZYC5OLW.js} +2 -2
- package/dist/{chunk-AFJLY43Z.js → chunk-WYJTY63G.js} +5 -3
- package/dist/{chunk-ANDWLNG4.js → chunk-XW7BCI3O.js} +7 -7
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{compactor-G7B3V24F.js → compactor-3UHLN554.js} +11 -9
- package/dist/{config-MD74ETY5.js → config-EN3WEH4A.js} +2 -2
- package/dist/{events-KNOZX7YG.js → events-GF2WNELM.js} +3 -3
- package/dist/{folding-OPP2BVUB.js → folding-UACKBHUZ.js} +2 -2
- package/dist/{manager-ATWZUL3O.js → manager-FIE2LCGJ.js} +4 -4
- package/dist/{orchestrator-L6LX5BV7.js → orchestrator-KOL34NS2.js} +11 -11
- package/dist/package.json +1 -1
- package/dist/{path-security-HUXQHEQ5.js → path-security-EKTUMDJW.js} +4 -4
- package/dist/{platform-VBNNMTR5.js → platform-KME5DVX5.js} +3 -3
- package/dist/{processor-UQX5KL56.js → processor-S3SDZHQC.js} +12 -12
- package/dist/{protocol-BXxJmsOW.d.ts → protocol-9WP7lLec.d.ts} +1 -1
- package/dist/provider/index.d.ts +4 -4
- package/dist/{provider-PI3RDDE4.js → provider-TIZV4IFE.js} +3 -3
- package/dist/{serve-QLVPUEB7.js → serve-PESDYZZP.js} +15 -15
- package/dist/server/index.d.ts +4 -3
- package/dist/server/index.js +14 -14
- package/dist/{server-3XUD2NB7.js → server-LWXTOEIJ.js} +13 -13
- package/dist/{settings-6M55N4Q2.js → settings-DMYBLBDQ.js} +2 -2
- package/dist/shared/index.d.ts +3 -3
- package/dist/{tools-HGKUD327.js → tools-FZ7HWHOW.js} +10 -10
- package/dist/{types-o07LJcLI.d.ts → types-BtY5XChg.d.ts} +1 -1
- package/dist/{types-C308SU4B.d.ts → types-ulRvCqQX.d.ts} +1 -0
- package/dist/{update-NUDIMJ4Q.js → update-SVJRA6YZ.js} +2 -2
- package/dist/web/assets/{index-BbJqmNad.js → index-BkC11Dy_.js} +58 -58
- package/dist/web/assets/{index-CiC9LOc0.css → index-CO9RvnPX.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-BRRABRLV.js +0 -7
|
@@ -2,28 +2,28 @@ import {
|
|
|
2
2
|
buildRunChatTurnParams,
|
|
3
3
|
finalizeTurnCompletion,
|
|
4
4
|
generateSessionNameForSession
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3Q5WQMPA.js";
|
|
6
6
|
import {
|
|
7
7
|
runChatTurn
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-EZDTCQMR.js";
|
|
9
|
+
import "./chunk-D25OSL6V.js";
|
|
10
|
+
import "./chunk-AIIFQYU5.js";
|
|
11
11
|
import "./chunk-NWO6GRYE.js";
|
|
12
12
|
import "./chunk-VPFUXGMM.js";
|
|
13
13
|
import "./chunk-37WF2Z3T.js";
|
|
14
14
|
import "./chunk-WGMJCFCE.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-4GMRZU7A.js";
|
|
16
16
|
import "./chunk-EU3WWTFH.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-QHLWWQRC.js";
|
|
18
|
+
import "./chunk-VZYC5OLW.js";
|
|
19
|
+
import "./chunk-WYJTY63G.js";
|
|
20
20
|
import "./chunk-EYIWUONA.js";
|
|
21
21
|
import "./chunk-6AE3JPDJ.js";
|
|
22
22
|
import "./chunk-I72ACQ6R.js";
|
|
23
23
|
import {
|
|
24
24
|
getEventStore
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-BUXIESO5.js";
|
|
26
|
+
import "./chunk-A2IZ4PWQ.js";
|
|
27
27
|
import "./chunk-AANVMTYU.js";
|
|
28
28
|
import "./chunk-RGUUZD5B.js";
|
|
29
29
|
import {
|
|
@@ -37,7 +37,7 @@ import "./chunk-YHEQTVFV.js";
|
|
|
37
37
|
import "./chunk-RMXPVQP4.js";
|
|
38
38
|
import "./chunk-K44MW7JJ.js";
|
|
39
39
|
import "./chunk-X6BXZFO7.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-NH2PVB6R.js";
|
|
41
41
|
import "./chunk-CQGTEGKL.js";
|
|
42
42
|
import "./chunk-5WRI5ZAA.js";
|
|
43
43
|
|
|
@@ -160,4 +160,4 @@ export {
|
|
|
160
160
|
startChatSession,
|
|
161
161
|
stopSessionExecution
|
|
162
162
|
};
|
|
163
|
-
//# sourceMappingURL=chat-handler-
|
|
163
|
+
//# sourceMappingURL=chat-handler-NRJWHZB2.js.map
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
} from "./chunk-EU3WWTFH.js";
|
|
4
4
|
import {
|
|
5
5
|
getMaxVisibleItems
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WYJTY63G.js";
|
|
7
7
|
import {
|
|
8
8
|
combineEventsWithSnapshot,
|
|
9
9
|
getEventStore,
|
|
10
10
|
getRuntimeConfig
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BUXIESO5.js";
|
|
12
12
|
import {
|
|
13
13
|
buildMessagesFromStoredEvents,
|
|
14
14
|
foldPendingConfirmations
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-A2IZ4PWQ.js";
|
|
16
16
|
import {
|
|
17
17
|
updateSessionMetadata
|
|
18
18
|
} from "./chunk-AANVMTYU.js";
|
|
@@ -200,4 +200,4 @@ export {
|
|
|
200
200
|
buildRunChatTurnParams,
|
|
201
201
|
generateSessionNameForSession
|
|
202
202
|
};
|
|
203
|
-
//# sourceMappingURL=chunk-
|
|
203
|
+
//# sourceMappingURL=chunk-3Q5WQMPA.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEventStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BUXIESO5.js";
|
|
4
4
|
import {
|
|
5
5
|
createChatPathConfirmationMessage
|
|
6
6
|
} from "./chunk-SJTG56CH.js";
|
|
@@ -494,4 +494,4 @@ export {
|
|
|
494
494
|
getConfirmationSessionId,
|
|
495
495
|
getPendingConfirmationsBySession
|
|
496
496
|
};
|
|
497
|
-
//# sourceMappingURL=chunk-
|
|
497
|
+
//# sourceMappingURL=chunk-4GMRZU7A.js.map
|
|
@@ -613,12 +613,15 @@ function foldContextState(events, initialWindowId) {
|
|
|
613
613
|
latestContextState
|
|
614
614
|
};
|
|
615
615
|
}
|
|
616
|
-
function foldMode(events) {
|
|
617
|
-
let mode =
|
|
616
|
+
function foldMode(events, defaultMode = "planner") {
|
|
617
|
+
let mode = defaultMode;
|
|
618
618
|
for (const event of events) {
|
|
619
619
|
if (event.type === "mode.changed") {
|
|
620
620
|
const data = event.data;
|
|
621
621
|
mode = data.mode;
|
|
622
|
+
} else if (event.type === "turn.snapshot") {
|
|
623
|
+
const snapshot = event.data;
|
|
624
|
+
mode = snapshot.mode;
|
|
622
625
|
}
|
|
623
626
|
}
|
|
624
627
|
return mode;
|
|
@@ -668,8 +671,8 @@ function foldPendingConfirmations(events) {
|
|
|
668
671
|
}
|
|
669
672
|
return pending;
|
|
670
673
|
}
|
|
671
|
-
function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
|
|
672
|
-
const mode = foldMode(events);
|
|
674
|
+
function foldSessionState(events, initialWindowId, maxTokens, initialMessages, defaultMode) {
|
|
675
|
+
const mode = foldMode(events, defaultMode);
|
|
673
676
|
const phase = foldPhase(events);
|
|
674
677
|
const isRunning = foldIsRunning(events);
|
|
675
678
|
const messages = initialMessages && initialMessages.length > 0 ? foldTurnEventsToSnapshotMessagesFromInitial(events, initialMessages) : foldTurnEventsToSnapshotMessages(events);
|
|
@@ -895,4 +898,4 @@ export {
|
|
|
895
898
|
buildSnapshot,
|
|
896
899
|
buildSnapshotFromSessionState
|
|
897
900
|
};
|
|
898
|
-
//# sourceMappingURL=chunk-
|
|
901
|
+
//# sourceMappingURL=chunk-A2IZ4PWQ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPlatformShell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VZYC5OLW.js";
|
|
4
4
|
import {
|
|
5
5
|
appendLog,
|
|
6
6
|
createProcess,
|
|
@@ -153,4 +153,4 @@ export {
|
|
|
153
153
|
getSessionProcesses2 as getSessionProcesses,
|
|
154
154
|
getProcessLogs
|
|
155
155
|
};
|
|
156
|
-
//# sourceMappingURL=chunk-
|
|
156
|
+
//# sourceMappingURL=chunk-AIIFQYU5.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
foldContextState,
|
|
6
6
|
foldSessionState,
|
|
7
7
|
spreadOptionalMessageFields
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-A2IZ4PWQ.js";
|
|
9
9
|
import {
|
|
10
10
|
updateSessionMessageCount
|
|
11
11
|
} from "./chunk-AANVMTYU.js";
|
|
@@ -793,7 +793,7 @@ function toSnapshotMessage(message) {
|
|
|
793
793
|
...spreadOptionalMessageFields(message)
|
|
794
794
|
};
|
|
795
795
|
}
|
|
796
|
-
function getSessionState(sessionId, maxTokens) {
|
|
796
|
+
function getSessionState(sessionId, maxTokens, defaultMode) {
|
|
797
797
|
const eventStore = getEventStore();
|
|
798
798
|
const { snapshot: latestSnapshot, events: rawEvents } = eventStore.getEventsSinceSnapshot(sessionId);
|
|
799
799
|
const events = combineEventsWithSnapshot(sessionId, latestSnapshot, rawEvents);
|
|
@@ -836,13 +836,13 @@ function getSessionState(sessionId, maxTokens) {
|
|
|
836
836
|
const config = getRuntimeConfig();
|
|
837
837
|
const effectiveMaxTokens = maxTokens ?? config.context.maxTokens;
|
|
838
838
|
if (latestSnapshot) {
|
|
839
|
-
const state = foldSessionState(events, initialWindowId, effectiveMaxTokens);
|
|
839
|
+
const state = foldSessionState(events, initialWindowId, effectiveMaxTokens, void 0, defaultMode);
|
|
840
840
|
return {
|
|
841
841
|
...state,
|
|
842
842
|
messages: buildMessagesFromStoredEvents(events).messages.map(toSnapshotMessage)
|
|
843
843
|
};
|
|
844
844
|
}
|
|
845
|
-
return foldSessionState(events, initialWindowId, effectiveMaxTokens);
|
|
845
|
+
return foldSessionState(events, initialWindowId, effectiveMaxTokens, void 0, defaultMode);
|
|
846
846
|
}
|
|
847
847
|
function getCurrentWindowMessages(sessionId) {
|
|
848
848
|
const currentWindowId = getCurrentContextWindowId(sessionId);
|
|
@@ -1227,4 +1227,4 @@ export {
|
|
|
1227
1227
|
truncateSessionMessages,
|
|
1228
1228
|
getRecentUserPromptsForSession
|
|
1229
1229
|
};
|
|
1230
|
-
//# sourceMappingURL=chunk-
|
|
1230
|
+
//# sourceMappingURL=chunk-BUXIESO5.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
spawnShellProcess,
|
|
9
9
|
startProcessCommand,
|
|
10
10
|
stopProcess
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AIIFQYU5.js";
|
|
12
12
|
import {
|
|
13
13
|
createMcpTools
|
|
14
14
|
} from "./chunk-NWO6GRYE.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
extractSensitivePathsFromCommand,
|
|
26
26
|
registerPathConfirmation,
|
|
27
27
|
requestPathAccess
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4GMRZU7A.js";
|
|
29
29
|
import {
|
|
30
30
|
AskUserInterrupt,
|
|
31
31
|
askUserTool
|
|
@@ -42,13 +42,13 @@ import {
|
|
|
42
42
|
createToolCallEvent,
|
|
43
43
|
createToolResultEvent,
|
|
44
44
|
streamLLMPure
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-QHLWWQRC.js";
|
|
46
46
|
import {
|
|
47
47
|
SETTINGS_KEYS,
|
|
48
48
|
deleteSetting,
|
|
49
49
|
getSetting,
|
|
50
50
|
setSetting
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-WYJTY63G.js";
|
|
52
52
|
import {
|
|
53
53
|
startInspectProxy
|
|
54
54
|
} from "./chunk-EYIWUONA.js";
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
getCurrentWindowMessageOptions,
|
|
66
66
|
getEventStore,
|
|
67
67
|
getRuntimeConfig
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-BUXIESO5.js";
|
|
69
69
|
import {
|
|
70
70
|
buildContextMessagesFromEventHistory,
|
|
71
71
|
foldContextState,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
handleToolResult,
|
|
76
76
|
reorderToolMessages,
|
|
77
77
|
stripOrphanedToolCalls
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-A2IZ4PWQ.js";
|
|
79
79
|
import {
|
|
80
80
|
createChatDoneMessage,
|
|
81
81
|
createChatMessageMessage,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
import {
|
|
104
104
|
loadGlobalConfig,
|
|
105
105
|
saveGlobalConfig
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-NH2PVB6R.js";
|
|
107
107
|
import {
|
|
108
108
|
getGlobalConfigDir
|
|
109
109
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -115,11 +115,22 @@ import { extname, join } from "path";
|
|
|
115
115
|
// src/server/tools/tool-helpers.ts
|
|
116
116
|
import { randomUUID } from "crypto";
|
|
117
117
|
import { resolve, isAbsolute } from "path";
|
|
118
|
-
|
|
118
|
+
var confirmationSeqCounter = 0;
|
|
119
|
+
async function requestUserConfirmation(context, toolLabel, desc) {
|
|
119
120
|
if (context.dangerLevel === "dangerous") return Promise.resolve(true);
|
|
121
|
+
if (toolLabel === "workspace" || toolLabel === "command") {
|
|
122
|
+
try {
|
|
123
|
+
const { getSetting: getSetting2, SETTINGS_KEYS: SETTINGS_KEYS2 } = await import("./settings-DMYBLBDQ.js");
|
|
124
|
+
if (getSetting2(SETTINGS_KEYS2.CONFIRM_ON_WORKSPACE_ACTIONS) !== "true") {
|
|
125
|
+
return Promise.resolve(true);
|
|
126
|
+
}
|
|
127
|
+
} catch {
|
|
128
|
+
}
|
|
129
|
+
}
|
|
120
130
|
if (context.isSubAgent) return Promise.resolve(false);
|
|
121
131
|
if (typeof context.onEvent !== "function") return Promise.resolve(false);
|
|
122
|
-
const
|
|
132
|
+
const seq = ++confirmationSeqCounter;
|
|
133
|
+
const callId = context.toolCallId ? `${context.toolCallId}-${seq}` : randomUUID();
|
|
123
134
|
try {
|
|
124
135
|
const eventStore = getEventStore();
|
|
125
136
|
eventStore.append(context.sessionId, {
|
|
@@ -1038,38 +1049,6 @@ function stripTailPipe(command) {
|
|
|
1038
1049
|
}
|
|
1039
1050
|
|
|
1040
1051
|
// src/server/tools/shell.ts
|
|
1041
|
-
var ESCAPE_PATTERNS = [
|
|
1042
|
-
/\bcd\s+['"]?(?:\.\.|\/|~)/,
|
|
1043
|
-
/\bcd\s+\$/,
|
|
1044
|
-
// cd with variable expansion ($HOME, ${HOME})
|
|
1045
|
-
/\bcd\s+\$\(/,
|
|
1046
|
-
// cd with command substitution $(...)
|
|
1047
|
-
/\bcd\s+`/,
|
|
1048
|
-
// cd with backtick substitution
|
|
1049
|
-
/\bgit\s+-C\s+/,
|
|
1050
|
-
/GIT_DIR=/,
|
|
1051
|
-
/\bgit\s+--work-tree[\s=]/,
|
|
1052
|
-
/\bgit\s+--git-dir[\s=]/
|
|
1053
|
-
];
|
|
1054
|
-
function detectEscapePattern(command) {
|
|
1055
|
-
const normalized = command.replace(/'[^']*'/g, " ").replace(/"[^"]*"/g, " ");
|
|
1056
|
-
for (const pattern of ESCAPE_PATTERNS) {
|
|
1057
|
-
const match = normalized.match(pattern);
|
|
1058
|
-
if (match) {
|
|
1059
|
-
return match[0].trim();
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
const segments = command.split(/[;&|]|&&|\|\|/);
|
|
1063
|
-
for (const segment of segments) {
|
|
1064
|
-
const trimmed = segment.trim();
|
|
1065
|
-
if (/^cd\s+.+\.\./.test(trimmed) || /^cd\s+['"]?\//.test(trimmed) || /^cd\s+['"]?~/.test(trimmed) || /^cd\s+['"]?\.\./.test(trimmed) || /^cd\s+.*\$\(/.test(trimmed) || // cd with $(...) substitution
|
|
1066
|
-
/^cd\s+.*`/.test(trimmed) || // cd with backtick substitution
|
|
1067
|
-
/^cd\s+.*\$\{?[A-Za-z_]/.test(trimmed)) {
|
|
1068
|
-
return trimmed;
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
return null;
|
|
1072
|
-
}
|
|
1073
1052
|
function detectGitMutation(command) {
|
|
1074
1053
|
const gitMatch = command.match(
|
|
1075
1054
|
/\bgit\s+['"]?(?:checkout|switch|branch\s+(-[dDmcMC]|--delete|--move|--copy|--force|-f)|-b\s+\S+|merge|rebase|reset|cherry-pick|worktree|clone|pull|push|fetch|update-ref|symbolic-ref)/
|
|
@@ -1122,7 +1101,7 @@ var runCommandTool = createTool(
|
|
|
1122
1101
|
type: "function",
|
|
1123
1102
|
function: {
|
|
1124
1103
|
name: "run_command",
|
|
1125
|
-
description: 'Execute a shell command. Returns stdout, stderr, and exit code. Does NOT support trailing "&" for backgrounding \u2014 use background_process tool instead.\nCommands run from your working directory automatically
|
|
1104
|
+
description: 'Execute a shell command. Returns stdout, stderr, and exit code. Does NOT support trailing "&" for backgrounding \u2014 use background_process tool instead.\nCommands run from your working directory automatically, so prefer relative paths.',
|
|
1126
1105
|
parameters: {
|
|
1127
1106
|
type: "object",
|
|
1128
1107
|
properties: {
|
|
@@ -1150,16 +1129,6 @@ var runCommandTool = createTool(
|
|
|
1150
1129
|
`Use background_process tool (action: "start") for background/long-running commands instead of '&'. See the tool description for details.`
|
|
1151
1130
|
);
|
|
1152
1131
|
}
|
|
1153
|
-
const escapeMatch = detectEscapePattern(args.command);
|
|
1154
|
-
if (escapeMatch) {
|
|
1155
|
-
const desc = `Command "${args.command}" contains workspace escape pattern "${escapeMatch}". Allow this command?`;
|
|
1156
|
-
const approved = await requestUserConfirmation(context, "command", desc);
|
|
1157
|
-
if (!approved) {
|
|
1158
|
-
return helpers.error(
|
|
1159
|
-
`User denied: command "${escapeMatch}" would escape the workspace. Use the workspace tool to switch workspaces directly.`
|
|
1160
|
-
);
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
1132
|
const mutationMatch = detectGitMutation(args.command);
|
|
1164
1133
|
if (mutationMatch) {
|
|
1165
1134
|
const desc = `Command "${args.command}" modifies Git state (${mutationMatch}). Allow this Git operation?`;
|
|
@@ -2607,8 +2576,12 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
2607
2576
|
sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens, config.subAgentMetadata?.subAgentId);
|
|
2608
2577
|
if (!compacting) {
|
|
2609
2578
|
const contextState2 = sessionManager.getContextState(sessionId);
|
|
2610
|
-
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-
|
|
2611
|
-
if (shouldCompact(
|
|
2579
|
+
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-3UHLN554.js");
|
|
2580
|
+
if (shouldCompact(
|
|
2581
|
+
contextState2.currentTokens,
|
|
2582
|
+
contextState2.maxTokens,
|
|
2583
|
+
sessionManager.getModelCompactionThreshold(sessionId) ?? runtimeConfig.context.compactionThreshold
|
|
2584
|
+
)) {
|
|
2612
2585
|
appendCompactionPrompt(sessionId, append);
|
|
2613
2586
|
compacting = true;
|
|
2614
2587
|
continue;
|
|
@@ -2966,7 +2939,7 @@ async function describeImageFromDataUrl(dataUrl, visionModel, options) {
|
|
|
2966
2939
|
// src/server/context/image-processor.ts
|
|
2967
2940
|
async function loadVisionModelFromGlobalConfig() {
|
|
2968
2941
|
try {
|
|
2969
|
-
const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-
|
|
2942
|
+
const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-EN3WEH4A.js");
|
|
2970
2943
|
const runtimeConfig = getRuntimeConfig();
|
|
2971
2944
|
const mode = runtimeConfig.mode ?? "production";
|
|
2972
2945
|
const globalConfig = await loadGlobalConfig2(mode);
|
|
@@ -3542,7 +3515,7 @@ var callSubAgentTool = {
|
|
|
3542
3515
|
};
|
|
3543
3516
|
}
|
|
3544
3517
|
try {
|
|
3545
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3518
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-FZ7HWHOW.js");
|
|
3546
3519
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3547
3520
|
const turnMetrics = new TurnMetrics();
|
|
3548
3521
|
const result = await executeSubAgent({
|
|
@@ -4545,7 +4518,7 @@ var mcpConfigTool = createTool(
|
|
|
4545
4518
|
mcpNotifyChanged?.(sessionId);
|
|
4546
4519
|
}
|
|
4547
4520
|
async function rebuildTools() {
|
|
4548
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4521
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-FZ7HWHOW.js");
|
|
4549
4522
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
4550
4523
|
setMcpTools2(mcpTools);
|
|
4551
4524
|
}
|
|
@@ -5208,4 +5181,4 @@ export {
|
|
|
5208
5181
|
getToolRegistryForAgent,
|
|
5209
5182
|
createToolRegistry
|
|
5210
5183
|
};
|
|
5211
|
-
//# sourceMappingURL=chunk-
|
|
5184
|
+
//# sourceMappingURL=chunk-D25OSL6V.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPACTION_PROMPT,
|
|
3
3
|
createMessageStartEvent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QHLWWQRC.js";
|
|
5
5
|
import {
|
|
6
6
|
getCurrentWindowMessageOptions
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BUXIESO5.js";
|
|
8
8
|
|
|
9
9
|
// src/server/context/compactor.ts
|
|
10
10
|
function appendCompactionPrompt(sessionId, append) {
|
|
@@ -19,16 +19,19 @@ function appendCompactionPrompt(sessionId, append) {
|
|
|
19
19
|
);
|
|
20
20
|
append({ type: "message.done", data: { messageId: compactPromptMsgId } });
|
|
21
21
|
}
|
|
22
|
+
var COMPACTION_HEADROOM_TOKENS = 5e3;
|
|
23
|
+
var COMPACTION_MAX_RATIO = 0.85;
|
|
22
24
|
function shouldCompact(currentTokens, maxTokens, threshold) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return
|
|
25
|
+
if (threshold <= 0) return false;
|
|
26
|
+
const ceilingRatio = Math.min(1, Math.max(0, (maxTokens - COMPACTION_HEADROOM_TOKENS) / maxTokens));
|
|
27
|
+
const effectiveThreshold = Math.min(threshold, ceilingRatio, COMPACTION_MAX_RATIO);
|
|
28
|
+
return currentTokens > maxTokens * effectiveThreshold;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export {
|
|
30
32
|
appendCompactionPrompt,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
COMPACTION_HEADROOM_TOKENS,
|
|
34
|
+
COMPACTION_MAX_RATIO,
|
|
35
|
+
shouldCompact
|
|
33
36
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-E3MS5CF7.js.map
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
loadAllAgentsDefault,
|
|
10
10
|
processEventsForConversation,
|
|
11
11
|
runTopLevelAgentLoop
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-D25OSL6V.js";
|
|
13
13
|
import {
|
|
14
14
|
PathAccessDeniedError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4GMRZU7A.js";
|
|
16
16
|
import {
|
|
17
17
|
TurnMetrics,
|
|
18
18
|
buildAgentReminder,
|
|
@@ -20,16 +20,16 @@ import {
|
|
|
20
20
|
buildTopLevelSystemPrompt,
|
|
21
21
|
createChatDoneEvent,
|
|
22
22
|
createMessageStartEvent
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-QHLWWQRC.js";
|
|
24
24
|
import {
|
|
25
25
|
getCurrentContextWindowId,
|
|
26
26
|
getCurrentWindowMessageOptions,
|
|
27
27
|
getEventStore,
|
|
28
28
|
getRuntimeConfig
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-BUXIESO5.js";
|
|
30
30
|
import {
|
|
31
31
|
buildSnapshotFromSessionState
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-A2IZ4PWQ.js";
|
|
33
33
|
import {
|
|
34
34
|
logger
|
|
35
35
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -66,7 +66,7 @@ function resolveAgentDef(sessionManager, sessionId) {
|
|
|
66
66
|
}
|
|
67
67
|
async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
68
68
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
69
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
69
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-FZ7HWHOW.js");
|
|
70
70
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
71
71
|
const toolFingerprint = getToolFingerprint(tools);
|
|
72
72
|
const allAgents = await loadAllAgentsDefault();
|
|
@@ -79,7 +79,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
|
79
79
|
async function computeSessionHash(sessionManager, sessionId) {
|
|
80
80
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
81
81
|
const agentDef = await resolveAgentDef(sessionManager, sessionId);
|
|
82
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
82
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-FZ7HWHOW.js");
|
|
83
83
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
84
84
|
const toolFingerprint = getToolFingerprint(tools);
|
|
85
85
|
return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
|
|
@@ -97,7 +97,7 @@ async function applyDynamicContext(sessionManager, sessionId) {
|
|
|
97
97
|
|
|
98
98
|
// src/server/chat/orchestrator.ts
|
|
99
99
|
async function buildRetryPatterns() {
|
|
100
|
-
const { getSetting, SETTINGS_KEYS } = await import("./settings-
|
|
100
|
+
const { getSetting, SETTINGS_KEYS } = await import("./settings-DMYBLBDQ.js");
|
|
101
101
|
const raw = getSetting(SETTINGS_KEYS.RETRY_PATTERNS);
|
|
102
102
|
if (!raw) {
|
|
103
103
|
const oldXmlProtection = getSetting("llm.disableXmlProtection");
|
|
@@ -371,4 +371,4 @@ export {
|
|
|
371
371
|
runChatTurn,
|
|
372
372
|
runAgentTurn
|
|
373
373
|
};
|
|
374
|
-
//# sourceMappingURL=chunk-
|
|
374
|
+
//# sourceMappingURL=chunk-EZDTCQMR.js.map
|
|
@@ -34,7 +34,8 @@ var modelConfigSchema = z.object({
|
|
|
34
34
|
temperature: z.number().optional(),
|
|
35
35
|
topP: z.number().optional(),
|
|
36
36
|
topK: z.number().optional(),
|
|
37
|
-
maxTokens: z.number().optional()
|
|
37
|
+
maxTokens: z.number().optional(),
|
|
38
|
+
compactionThreshold: z.number().min(0).max(0.95).optional()
|
|
38
39
|
}).passthrough();
|
|
39
40
|
var providerSchema = z.object({
|
|
40
41
|
id: z.string(),
|
|
@@ -51,24 +52,22 @@ var providerSchema = z.object({
|
|
|
51
52
|
authAdapter: z.string().optional(),
|
|
52
53
|
transportAdapter: z.string().optional(),
|
|
53
54
|
credentialRef: z.string().optional()
|
|
54
|
-
}).transform(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
})
|
|
71
|
-
);
|
|
55
|
+
}).transform((provider) => ({
|
|
56
|
+
id: provider.id,
|
|
57
|
+
...provider.preset ? { preset: provider.preset } : {},
|
|
58
|
+
name: provider.name ?? provider.id,
|
|
59
|
+
url: provider.url ?? "",
|
|
60
|
+
backend: provider.backend ?? "unknown",
|
|
61
|
+
...provider.apiKey ? { apiKey: provider.apiKey } : {},
|
|
62
|
+
models: provider.models ?? [],
|
|
63
|
+
isActive: provider.isActive ?? false,
|
|
64
|
+
createdAt: provider.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
65
|
+
...provider.isLocal !== void 0 ? { isLocal: provider.isLocal } : {},
|
|
66
|
+
...provider.thinkingField ? { thinkingField: provider.thinkingField } : {},
|
|
67
|
+
...provider.authAdapter ? { authAdapter: provider.authAdapter } : {},
|
|
68
|
+
...provider.transportAdapter ? { transportAdapter: provider.transportAdapter } : {},
|
|
69
|
+
...provider.credentialRef ? { credentialRef: provider.credentialRef } : {}
|
|
70
|
+
}));
|
|
72
71
|
var serverSchema = z.object({
|
|
73
72
|
port: z.number().default(10369),
|
|
74
73
|
host: z.string().default("127.0.0.1"),
|
|
@@ -314,4 +313,4 @@ export {
|
|
|
314
313
|
removeProvider,
|
|
315
314
|
activateProvider
|
|
316
315
|
};
|
|
317
|
-
//# sourceMappingURL=chunk-
|
|
316
|
+
//# sourceMappingURL=chunk-NH2PVB6R.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
computeSessionHash,
|
|
4
4
|
runAgentTurn,
|
|
5
5
|
runChatTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EZDTCQMR.js";
|
|
7
7
|
import {
|
|
8
8
|
deleteItemFromDir,
|
|
9
9
|
devServerManager,
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
jsonSerializer,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
saveItemToDir
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-D25OSL6V.js";
|
|
17
17
|
import {
|
|
18
18
|
checkAborted,
|
|
19
19
|
onProcessEvent,
|
|
20
20
|
spawnShellProcess
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-AIIFQYU5.js";
|
|
22
22
|
import {
|
|
23
23
|
gitSpawnEnv
|
|
24
24
|
} from "./chunk-WGMJCFCE.js";
|
|
@@ -28,17 +28,17 @@ import {
|
|
|
28
28
|
} from "./chunk-EU3WWTFH.js";
|
|
29
29
|
import {
|
|
30
30
|
appendCompactionPrompt
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-E3MS5CF7.js";
|
|
32
32
|
import {
|
|
33
33
|
TurnMetrics,
|
|
34
34
|
createMessageStartEvent
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-QHLWWQRC.js";
|
|
36
36
|
import {
|
|
37
37
|
getPlatformShell
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-VZYC5OLW.js";
|
|
39
39
|
import {
|
|
40
40
|
getMaxVisibleItems
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WYJTY63G.js";
|
|
42
42
|
import {
|
|
43
43
|
killProcessTree,
|
|
44
44
|
terminateProcessTree
|
|
@@ -48,11 +48,11 @@ import {
|
|
|
48
48
|
getCurrentContextWindowId,
|
|
49
49
|
getEventStore,
|
|
50
50
|
getRuntimeConfig
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-BUXIESO5.js";
|
|
52
52
|
import {
|
|
53
53
|
buildMessagesFromStoredEvents,
|
|
54
54
|
foldPendingConfirmations
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-A2IZ4PWQ.js";
|
|
56
56
|
import {
|
|
57
57
|
createChatErrorMessage,
|
|
58
58
|
createChatMessageMessage,
|
|
@@ -2213,4 +2213,4 @@ export {
|
|
|
2213
2213
|
signalMcpReady,
|
|
2214
2214
|
createWebSocketServer
|
|
2215
2215
|
};
|
|
2216
|
-
//# sourceMappingURL=chunk-
|
|
2216
|
+
//# sourceMappingURL=chunk-NLMT2HII.js.map
|