openfox 1.6.101 → 1.6.102
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/{auto-compaction-JSXVY2CJ.js → auto-compaction-7LMAY5JV.js} +7 -7
- package/dist/{chat-handler-45TB6QWI.js → chat-handler-ZJVIM7U4.js} +10 -10
- package/dist/{chunk-DCYDTDWO.js → chunk-6WZI6F6G.js} +20 -4
- package/dist/{chunk-L6LTCUCO.js → chunk-AI3CY7T6.js} +2 -2
- package/dist/{chunk-SBQ36AOQ.js → chunk-IZC2EZ4D.js} +4 -4
- package/dist/{chunk-MBLZSLPH.js → chunk-J335KZ6U.js} +4 -3
- package/dist/{chunk-UTBDR6KM.js → chunk-MEYDERUX.js} +1 -1
- package/dist/{chunk-NASF624P.js → chunk-PDPXHSNZ.js} +7 -5
- package/dist/{chunk-TYIHIHJF.js → chunk-PSJIT5LZ.js} +3 -1
- package/dist/{chunk-C5U6NRAY.js → chunk-RCQOHFAN.js} +2 -2
- package/dist/{chunk-5LYWA56Z.js → chunk-RYEZ7LDX.js} +60 -7
- package/dist/{chunk-SCAFZ75C.js → chunk-ZPCJLFAG.js} +180 -37
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{events-JP746DV3.js → events-OKTZRT3Y.js} +3 -3
- package/dist/{folding-EQPDQKQS.js → folding-Z3OMWNOE.js} +2 -2
- package/dist/{orchestrator-RRO2XLYZ.js → orchestrator-5EYWRAZ2.js} +8 -8
- package/dist/package.json +3 -1
- package/dist/{processor-C4KLV5SV.js → processor-XJYCHNV6.js} +7 -7
- package/dist/{protocol-BkFgSJVU.d.ts → protocol-CdVNdXi8.d.ts} +5 -1
- package/dist/{protocol-SVQYBN2X.js → protocol-TNC6MCJV.js} +3 -3
- package/dist/{serve-5B36ZPK3.js → serve-SGFEQ5N7.js} +9 -9
- package/dist/server/index.d.ts +10 -1
- package/dist/server/index.js +8 -8
- package/dist/{settings-4334IX63.js → settings-VRAOAPLA.js} +2 -2
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/{tools-AGVKG553.js → tools-WFIYKFBE.js} +7 -7
- package/dist/web/assets/{index-Du9Uz0qZ.js → index-DcGVOFte.js} +61 -61
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +3 -1
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
maybeAutoCompactContext,
|
|
3
3
|
performManualContextCompaction,
|
|
4
4
|
resolveCompactionStatsIdentity
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-RYEZ7LDX.js";
|
|
6
|
+
import "./chunk-PSJIT5LZ.js";
|
|
7
7
|
import "./chunk-XAMAYRDA.js";
|
|
8
8
|
import "./chunk-DL6ZILAF.js";
|
|
9
9
|
import "./chunk-PBGOZMVY.js";
|
|
10
10
|
import "./chunk-VRGRAQDG.js";
|
|
11
11
|
import "./chunk-HGAMIPFO.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-J335KZ6U.js";
|
|
13
13
|
import "./chunk-FBGWG4N6.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-6WZI6F6G.js";
|
|
15
|
+
import "./chunk-RCQOHFAN.js";
|
|
16
16
|
import "./chunk-BJYPTN5S.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-MEYDERUX.js";
|
|
18
18
|
import "./chunk-CQGTEGKL.js";
|
|
19
19
|
import "./chunk-CGZHLM3K.js";
|
|
20
20
|
import "./chunk-SZKEGZIB.js";
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
performManualContextCompaction,
|
|
25
25
|
resolveCompactionStatsIdentity
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=auto-compaction-
|
|
27
|
+
//# sourceMappingURL=auto-compaction-7LMAY5JV.js.map
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
generateSessionName,
|
|
6
6
|
getSessionMessageCount,
|
|
7
7
|
needsNameGenerationCheck
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IZC2EZ4D.js";
|
|
9
9
|
import {
|
|
10
10
|
runChatTurn
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-PDPXHSNZ.js";
|
|
12
|
+
import "./chunk-RYEZ7LDX.js";
|
|
13
|
+
import "./chunk-PSJIT5LZ.js";
|
|
14
14
|
import "./chunk-XAMAYRDA.js";
|
|
15
15
|
import "./chunk-DL6ZILAF.js";
|
|
16
16
|
import "./chunk-PBGOZMVY.js";
|
|
@@ -18,16 +18,16 @@ import "./chunk-VRGRAQDG.js";
|
|
|
18
18
|
import "./chunk-HGAMIPFO.js";
|
|
19
19
|
import {
|
|
20
20
|
getEventStore
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-J335KZ6U.js";
|
|
22
22
|
import "./chunk-FBGWG4N6.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-6WZI6F6G.js";
|
|
24
24
|
import {
|
|
25
25
|
createChatMessageMessage,
|
|
26
26
|
createPhaseChangedMessage,
|
|
27
27
|
createSessionRunningMessage
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-RCQOHFAN.js";
|
|
29
29
|
import "./chunk-BJYPTN5S.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-MEYDERUX.js";
|
|
31
31
|
import "./chunk-CQGTEGKL.js";
|
|
32
32
|
import "./chunk-CGZHLM3K.js";
|
|
33
33
|
import "./chunk-SZKEGZIB.js";
|
|
@@ -61,7 +61,7 @@ async function startChatSession(sessionId, content, deps, options) {
|
|
|
61
61
|
sessionManager.setRunning(sessionId, true);
|
|
62
62
|
broadcastForSession(sessionId, createSessionRunningMessage(true));
|
|
63
63
|
try {
|
|
64
|
-
const { maybeAutoCompactContext } = await import("./auto-compaction-
|
|
64
|
+
const { maybeAutoCompactContext } = await import("./auto-compaction-7LMAY5JV.js");
|
|
65
65
|
await maybeAutoCompactContext({
|
|
66
66
|
sessionManager,
|
|
67
67
|
sessionId,
|
|
@@ -175,4 +175,4 @@ export {
|
|
|
175
175
|
startChatSession,
|
|
176
176
|
stopSessionExecution
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=chat-handler-
|
|
178
|
+
//# sourceMappingURL=chat-handler-ZJVIM7U4.js.map
|
|
@@ -631,11 +631,14 @@ function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
|
|
|
631
631
|
maxTokens,
|
|
632
632
|
compactionCount: contextResult.compactionCount,
|
|
633
633
|
dangerZone: false,
|
|
634
|
-
canCompact: false
|
|
634
|
+
canCompact: false,
|
|
635
|
+
dynamicContextChanged: false
|
|
635
636
|
};
|
|
636
637
|
const contextState = baseContextState.compactionCount !== contextResult.compactionCount || baseContextState.maxTokens !== maxTokens ? { ...baseContextState, compactionCount: contextResult.compactionCount, maxTokens } : { ...baseContextState, maxTokens };
|
|
637
638
|
let messageReminderMode;
|
|
638
639
|
let snapshotReminderMode;
|
|
640
|
+
let cachedSystemPrompt;
|
|
641
|
+
let dynamicContextHash;
|
|
639
642
|
for (let i = events.length - 1; i >= 0; i--) {
|
|
640
643
|
const event = events[i];
|
|
641
644
|
if (event.type === "message.start") {
|
|
@@ -656,6 +659,12 @@ function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
|
|
|
656
659
|
mode: snapshotData.lastModeWithReminder
|
|
657
660
|
};
|
|
658
661
|
}
|
|
662
|
+
if (snapshotData.cachedSystemPrompt && !cachedSystemPrompt) {
|
|
663
|
+
cachedSystemPrompt = snapshotData.cachedSystemPrompt;
|
|
664
|
+
}
|
|
665
|
+
if (snapshotData.dynamicContextHash && !dynamicContextHash) {
|
|
666
|
+
dynamicContextHash = snapshotData.dynamicContextHash;
|
|
667
|
+
}
|
|
659
668
|
}
|
|
660
669
|
}
|
|
661
670
|
let lastModeWithReminder;
|
|
@@ -760,6 +769,8 @@ function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
|
|
|
760
769
|
currentContextWindowId: contextResult.currentContextWindowId,
|
|
761
770
|
readFiles: contextResult.readFiles,
|
|
762
771
|
...lastModeWithReminder !== void 0 && { lastModeWithReminder },
|
|
772
|
+
...cachedSystemPrompt !== void 0 && { cachedSystemPrompt },
|
|
773
|
+
...dynamicContextHash !== void 0 && { dynamicContextHash },
|
|
763
774
|
pendingConfirmations,
|
|
764
775
|
...sessionInit !== void 0 && { sessionInit },
|
|
765
776
|
...sessionTitle !== void 0 && { sessionTitle },
|
|
@@ -783,6 +794,8 @@ function buildSnapshot(foldedState, latestSeq, snapshotAt = Date.now()) {
|
|
|
783
794
|
todos: foldedState.todos,
|
|
784
795
|
readFiles: foldedState.readFiles,
|
|
785
796
|
...foldedState.lastModeWithReminder !== void 0 && { lastModeWithReminder: foldedState.lastModeWithReminder },
|
|
797
|
+
...foldedState.cachedSystemPrompt !== void 0 && { cachedSystemPrompt: foldedState.cachedSystemPrompt },
|
|
798
|
+
...foldedState.dynamicContextHash !== void 0 && { dynamicContextHash: foldedState.dynamicContextHash },
|
|
786
799
|
snapshotSeq: latestSeq,
|
|
787
800
|
snapshotAt,
|
|
788
801
|
...foldedState.sessionInit !== void 0 && { sessionInit: foldedState.sessionInit },
|
|
@@ -828,7 +841,8 @@ function buildSnapshotFromSessionState(input) {
|
|
|
828
841
|
maxTokens: foldedState.contextState.maxTokens,
|
|
829
842
|
compactionCount: session.executionState?.compactionCount ?? foldedState.contextState.compactionCount,
|
|
830
843
|
dangerZone: foldedState.contextState.dangerZone,
|
|
831
|
-
canCompact: foldedState.contextState.canCompact
|
|
844
|
+
canCompact: foldedState.contextState.canCompact,
|
|
845
|
+
dynamicContextChanged: foldedState.contextState.dynamicContextChanged
|
|
832
846
|
},
|
|
833
847
|
currentContextWindowId: foldedState.currentContextWindowId,
|
|
834
848
|
todos: foldedState.todos,
|
|
@@ -836,7 +850,9 @@ function buildSnapshotFromSessionState(input) {
|
|
|
836
850
|
snapshotSeq: latestSeq,
|
|
837
851
|
snapshotAt,
|
|
838
852
|
...foldedState.sessionInit !== void 0 && { sessionInit: foldedState.sessionInit },
|
|
839
|
-
...foldedState.lastModeWithReminder !== void 0 && { lastModeWithReminder: foldedState.lastModeWithReminder }
|
|
853
|
+
...foldedState.lastModeWithReminder !== void 0 && { lastModeWithReminder: foldedState.lastModeWithReminder },
|
|
854
|
+
...input.cachedSystemPrompt !== void 0 ? { cachedSystemPrompt: input.cachedSystemPrompt } : foldedState.cachedSystemPrompt !== void 0 ? { cachedSystemPrompt: foldedState.cachedSystemPrompt } : {},
|
|
855
|
+
...input.dynamicContextHash !== void 0 ? { dynamicContextHash: input.dynamicContextHash } : foldedState.dynamicContextHash !== void 0 ? { dynamicContextHash: foldedState.dynamicContextHash } : {}
|
|
840
856
|
};
|
|
841
857
|
}
|
|
842
858
|
function getMessagesForWindow(messages, windowId) {
|
|
@@ -878,4 +894,4 @@ export {
|
|
|
878
894
|
getMessagesForWindow,
|
|
879
895
|
buildContextMessagesFromMessages
|
|
880
896
|
};
|
|
881
|
-
//# sourceMappingURL=chunk-
|
|
897
|
+
//# sourceMappingURL=chunk-6WZI6F6G.js.map
|
|
@@ -191,7 +191,7 @@ async function runCli(options) {
|
|
|
191
191
|
if (!configExists) {
|
|
192
192
|
await runNetworkSetup(mode);
|
|
193
193
|
}
|
|
194
|
-
const { runServe } = await import("./serve-
|
|
194
|
+
const { runServe } = await import("./serve-SGFEQ5N7.js");
|
|
195
195
|
const serveOptions = { mode };
|
|
196
196
|
if (values.port) serveOptions.port = parseInt(values.port);
|
|
197
197
|
if (values["no-browser"] === true) serveOptions.openBrowser = false;
|
|
@@ -203,4 +203,4 @@ async function runCli(options) {
|
|
|
203
203
|
export {
|
|
204
204
|
runCli
|
|
205
205
|
};
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
206
|
+
//# sourceMappingURL=chunk-AI3CY7T6.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEventStore,
|
|
3
3
|
updateSessionMetadata
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-J335KZ6U.js";
|
|
5
5
|
import {
|
|
6
6
|
buildMessagesFromStoredEvents,
|
|
7
7
|
foldPendingConfirmations
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6WZI6F6G.js";
|
|
9
9
|
import {
|
|
10
10
|
createContextStateMessage,
|
|
11
11
|
createSessionStateMessage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RCQOHFAN.js";
|
|
13
13
|
import {
|
|
14
14
|
logger
|
|
15
15
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
needsNameGenerationCheck,
|
|
144
144
|
applyGeneratedSessionName
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-IZC2EZ4D.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
foldSessionState,
|
|
10
10
|
spreadOptionalMessageFields,
|
|
11
11
|
stripPromptContextMessages
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6WZI6F6G.js";
|
|
13
13
|
import {
|
|
14
14
|
getRuntimeConfig
|
|
15
15
|
} from "./chunk-CGZHLM3K.js";
|
|
@@ -1072,7 +1072,7 @@ function emitContextCompacted(sessionId, closedWindowId, newWindowId, beforeToke
|
|
|
1072
1072
|
}
|
|
1073
1073
|
});
|
|
1074
1074
|
}
|
|
1075
|
-
function emitContextState(sessionId, currentTokens, maxTokens, compactionCount, dangerZone, canCompact, subAgentId) {
|
|
1075
|
+
function emitContextState(sessionId, currentTokens, maxTokens, compactionCount, dangerZone, canCompact, subAgentId, dynamicContextChanged) {
|
|
1076
1076
|
const eventStore = getEventStore();
|
|
1077
1077
|
eventStore.append(sessionId, {
|
|
1078
1078
|
type: "context.state",
|
|
@@ -1082,6 +1082,7 @@ function emitContextState(sessionId, currentTokens, maxTokens, compactionCount,
|
|
|
1082
1082
|
compactionCount,
|
|
1083
1083
|
dangerZone,
|
|
1084
1084
|
canCompact,
|
|
1085
|
+
dynamicContextChanged: dynamicContextChanged ?? false,
|
|
1085
1086
|
...subAgentId !== void 0 && { subAgentId }
|
|
1086
1087
|
}
|
|
1087
1088
|
});
|
|
@@ -1267,4 +1268,4 @@ export {
|
|
|
1267
1268
|
compactContext,
|
|
1268
1269
|
getRecentUserPromptsForSession
|
|
1269
1270
|
};
|
|
1270
|
-
//# sourceMappingURL=chunk-
|
|
1271
|
+
//# sourceMappingURL=chunk-J335KZ6U.js.map
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
getToolRegistryForAgent,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
runTopLevelAgentLoop
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RYEZ7LDX.js";
|
|
17
17
|
import {
|
|
18
18
|
getCurrentContextWindowId,
|
|
19
19
|
getEventStore
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-J335KZ6U.js";
|
|
21
21
|
import {
|
|
22
22
|
buildSnapshotFromSessionState
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-6WZI6F6G.js";
|
|
24
24
|
import {
|
|
25
25
|
logger
|
|
26
26
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -313,10 +313,12 @@ function buildSnapshot(sessionManager, sessionId, _lastStats) {
|
|
|
313
313
|
const session = sessionManager.requireSession(sessionId);
|
|
314
314
|
const events = eventStore.getEvents(sessionId);
|
|
315
315
|
const latestSeq = eventStore.getLatestSeq(sessionId) ?? 0;
|
|
316
|
+
const cachedPrompt = sessionManager.getCachedPrompt(sessionId);
|
|
316
317
|
return buildSnapshotFromSessionState({
|
|
317
318
|
session,
|
|
318
319
|
events,
|
|
319
|
-
latestSeq
|
|
320
|
+
latestSeq,
|
|
321
|
+
...cachedPrompt ? { cachedSystemPrompt: cachedPrompt.systemPrompt, dynamicContextHash: cachedPrompt.hash } : {}
|
|
320
322
|
});
|
|
321
323
|
}
|
|
322
324
|
|
|
@@ -327,4 +329,4 @@ export {
|
|
|
327
329
|
runBuilderTurn,
|
|
328
330
|
runVerifierTurn
|
|
329
331
|
};
|
|
330
|
-
//# sourceMappingURL=chunk-
|
|
332
|
+
//# sourceMappingURL=chunk-PDPXHSNZ.js.map
|
|
@@ -16,6 +16,7 @@ var SETTINGS_KEYS = {
|
|
|
16
16
|
DISPLAY_FOLLOW_SYSTEM_THEME: "display.followSystemTheme",
|
|
17
17
|
DISPLAY_SHOW_OPEN_IN_EDITOR: "display.showOpenInEditorLinks",
|
|
18
18
|
LLM_DISABLE_XML_PROTECTION: "llm.disableXmlProtection",
|
|
19
|
+
LLM_DYNAMIC_SYSTEM_PROMPT: "llm.dynamicSystemPrompt",
|
|
19
20
|
KEYBINDINGS: "keybindings"
|
|
20
21
|
};
|
|
21
22
|
var SETTINGS_DEFAULTS = {
|
|
@@ -29,6 +30,7 @@ var SETTINGS_DEFAULTS = {
|
|
|
29
30
|
[SETTINGS_KEYS.DISPLAY_FOLLOW_SYSTEM_THEME]: "true",
|
|
30
31
|
[SETTINGS_KEYS.DISPLAY_SHOW_OPEN_IN_EDITOR]: "false",
|
|
31
32
|
[SETTINGS_KEYS.LLM_DISABLE_XML_PROTECTION]: "false",
|
|
33
|
+
[SETTINGS_KEYS.LLM_DYNAMIC_SYSTEM_PROMPT]: "false",
|
|
32
34
|
[SETTINGS_KEYS.KEYBINDINGS]: JSON.stringify({
|
|
33
35
|
terminalToggle: { type: "double-press", key: "Control", threshold: 300 },
|
|
34
36
|
quickAction: { type: "double-press", key: "Shift", threshold: 300 },
|
|
@@ -86,4 +88,4 @@ export {
|
|
|
86
88
|
deleteSetting,
|
|
87
89
|
getAllSettings
|
|
88
90
|
};
|
|
89
|
-
//# sourceMappingURL=chunk-
|
|
91
|
+
//# sourceMappingURL=chunk-PSJIT5LZ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServerMessage,
|
|
3
3
|
isClientMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MEYDERUX.js";
|
|
5
5
|
|
|
6
6
|
// src/server/ws/protocol.ts
|
|
7
7
|
function enrichMessagesWithToolResults(messages) {
|
|
@@ -326,4 +326,4 @@ export {
|
|
|
326
326
|
createQueueStateMessage,
|
|
327
327
|
storedEventToServerMessage
|
|
328
328
|
};
|
|
329
|
-
//# sourceMappingURL=chunk-
|
|
329
|
+
//# sourceMappingURL=chunk-RCQOHFAN.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
SETTINGS_KEYS,
|
|
3
3
|
deleteSetting,
|
|
4
4
|
getSetting
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PSJIT5LZ.js";
|
|
6
6
|
import {
|
|
7
7
|
getProject
|
|
8
8
|
} from "./chunk-XAMAYRDA.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
import {
|
|
32
32
|
getCurrentContextWindowId,
|
|
33
33
|
getEventStore
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-J335KZ6U.js";
|
|
35
35
|
import {
|
|
36
36
|
buildContextMessagesFromEventHistory,
|
|
37
37
|
foldContextState,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
handleToolCall,
|
|
41
41
|
handleToolResult,
|
|
42
42
|
stripOrphanedToolCalls
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-6WZI6F6G.js";
|
|
44
44
|
import {
|
|
45
45
|
createChatDoneMessage,
|
|
46
46
|
createChatMessageMessage,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
createChatPathConfirmationMessage,
|
|
49
49
|
createChatVisionFallbackMessage,
|
|
50
50
|
createQueueStateMessage
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-RCQOHFAN.js";
|
|
52
52
|
import {
|
|
53
53
|
AskUserInterrupt,
|
|
54
54
|
askUserTool
|
|
@@ -2976,6 +2976,16 @@ async function deleteProjectSkill(projectDir, skillId) {
|
|
|
2976
2976
|
return deleteItemFromDir(getProjectSkillsDir(projectDir), skillId, SKILL_EXTENSION);
|
|
2977
2977
|
}
|
|
2978
2978
|
|
|
2979
|
+
// src/server/chat/dynamic-context.ts
|
|
2980
|
+
import { createHash as createHash2 } from "crypto";
|
|
2981
|
+
function computeDynamicContextHash(instructionContent, skills) {
|
|
2982
|
+
const dynamicInputs = JSON.stringify({
|
|
2983
|
+
instructions: instructionContent,
|
|
2984
|
+
skills: skills.map((s) => s.id).sort()
|
|
2985
|
+
});
|
|
2986
|
+
return createHash2("sha256").update(dynamicInputs).digest("hex");
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2979
2989
|
// src/server/chat/agent-loop.ts
|
|
2980
2990
|
import stripAnsi from "strip-ansi";
|
|
2981
2991
|
|
|
@@ -3272,7 +3282,8 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
|
|
|
3272
3282
|
const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
|
|
3273
3283
|
const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
|
|
3274
3284
|
if (signal?.aborted) throw new Error("Aborted");
|
|
3275
|
-
const
|
|
3285
|
+
const isDynamicMode = getSetting(SETTINGS_KEYS.LLM_DYNAMIC_SYSTEM_PROMPT) === "true";
|
|
3286
|
+
const assembleFreshRequest = () => config.assembleRequest({
|
|
3276
3287
|
workdir: session.workdir,
|
|
3277
3288
|
messages: requestMessages,
|
|
3278
3289
|
injectedFiles,
|
|
@@ -3281,6 +3292,44 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
|
|
|
3281
3292
|
...instructionContent ? { customInstructions: instructionContent } : {},
|
|
3282
3293
|
...skills.length > 0 ? { skills } : {}
|
|
3283
3294
|
});
|
|
3295
|
+
let assembledRequest;
|
|
3296
|
+
if (isDynamicMode) {
|
|
3297
|
+
assembledRequest = assembleFreshRequest();
|
|
3298
|
+
} else {
|
|
3299
|
+
const dynamicHash = computeDynamicContextHash(instructionContent, skills);
|
|
3300
|
+
const execState = session.executionState;
|
|
3301
|
+
const hashMatch = execState?.dynamicContextHash === dynamicHash;
|
|
3302
|
+
const hasCached = !!execState?.cachedSystemPrompt;
|
|
3303
|
+
if (hasCached && hashMatch) {
|
|
3304
|
+
assembledRequest = createAssemblyResult({
|
|
3305
|
+
systemPrompt: execState.cachedSystemPrompt,
|
|
3306
|
+
messages: requestMessages,
|
|
3307
|
+
injectedFiles,
|
|
3308
|
+
requestTools: toolRegistry.definitions,
|
|
3309
|
+
toolChoice: "auto",
|
|
3310
|
+
disableThinking: false
|
|
3311
|
+
});
|
|
3312
|
+
if (sessionManager.getDynamicContextChanged(sessionId)) {
|
|
3313
|
+
sessionManager.setDynamicContextChanged(sessionId, false);
|
|
3314
|
+
}
|
|
3315
|
+
} else if (hasCached) {
|
|
3316
|
+
assembledRequest = createAssemblyResult({
|
|
3317
|
+
systemPrompt: execState.cachedSystemPrompt,
|
|
3318
|
+
messages: requestMessages,
|
|
3319
|
+
injectedFiles,
|
|
3320
|
+
requestTools: toolRegistry.definitions,
|
|
3321
|
+
toolChoice: "auto",
|
|
3322
|
+
disableThinking: false
|
|
3323
|
+
});
|
|
3324
|
+
if (!sessionManager.getDynamicContextChanged(sessionId)) {
|
|
3325
|
+
sessionManager.setDynamicContextChanged(sessionId, true);
|
|
3326
|
+
}
|
|
3327
|
+
} else {
|
|
3328
|
+
assembledRequest = assembleFreshRequest();
|
|
3329
|
+
sessionManager.setCachedPrompt(sessionId, assembledRequest.systemPrompt, dynamicHash);
|
|
3330
|
+
sessionManager.setDynamicContextChanged(sessionId, false);
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3284
3333
|
const assistantMsgId = crypto.randomUUID();
|
|
3285
3334
|
eventStore.append(
|
|
3286
3335
|
sessionId,
|
|
@@ -3940,7 +3989,7 @@ var callSubAgentTool = {
|
|
|
3940
3989
|
};
|
|
3941
3990
|
}
|
|
3942
3991
|
try {
|
|
3943
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3992
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-WFIYKFBE.js");
|
|
3944
3993
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3945
3994
|
const turnMetrics = new TurnMetrics();
|
|
3946
3995
|
const result = await executeSubAgent({
|
|
@@ -5100,6 +5149,7 @@ export {
|
|
|
5100
5149
|
agentExists,
|
|
5101
5150
|
saveAgent,
|
|
5102
5151
|
deleteAgent,
|
|
5152
|
+
buildTopLevelSystemPrompt,
|
|
5103
5153
|
buildAgentReminder,
|
|
5104
5154
|
BUILDER_KICKOFF_PROMPT,
|
|
5105
5155
|
VERIFIER_KICKOFF_PROMPT,
|
|
@@ -5110,10 +5160,12 @@ export {
|
|
|
5110
5160
|
createToolResultEvent,
|
|
5111
5161
|
createChatDoneEvent,
|
|
5112
5162
|
assembleAgentRequest,
|
|
5163
|
+
getAllInstructions,
|
|
5113
5164
|
loadDefaultSkills,
|
|
5114
5165
|
loadUserSkills,
|
|
5115
5166
|
loadProjectSkills,
|
|
5116
5167
|
loadAllSkills,
|
|
5168
|
+
getEnabledSkillMetadata,
|
|
5117
5169
|
isSkillEnabled,
|
|
5118
5170
|
getDefaultSkillIds,
|
|
5119
5171
|
isDefaultSkill,
|
|
@@ -5126,6 +5178,7 @@ export {
|
|
|
5126
5178
|
maybeAutoCompactContext,
|
|
5127
5179
|
performManualContextCompaction,
|
|
5128
5180
|
resolveCompactionStatsIdentity,
|
|
5181
|
+
computeDynamicContextHash,
|
|
5129
5182
|
runTopLevelAgentLoop,
|
|
5130
5183
|
executeSubAgent,
|
|
5131
5184
|
devServerManager,
|
|
@@ -5138,4 +5191,4 @@ export {
|
|
|
5138
5191
|
getToolRegistryForAgent,
|
|
5139
5192
|
createToolRegistry
|
|
5140
5193
|
};
|
|
5141
|
-
//# sourceMappingURL=chunk-
|
|
5194
|
+
//# sourceMappingURL=chunk-RYEZ7LDX.js.map
|