openfox 2.0.11 → 2.0.13
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-VUVDRA2I.js → chat-handler-6NUNVXIU.js} +4 -3
- package/dist/{chunk-M53OBFMI.js → chunk-2VDLXCLO.js} +22 -682
- package/dist/{chunk-JUHZVYUI.js → chunk-EZJUU54W.js} +11 -8
- package/dist/{chunk-ABYYJBNO.js → chunk-FQIT7VIA.js} +2 -2
- package/dist/chunk-FWJ6YXGA.js +34 -0
- package/dist/chunk-L7TDUIQY.js +677 -0
- package/dist/{chunk-GJLXA4BS.js → chunk-VFRWE5X4.js} +59 -146
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/compactor-R7GRFBOU.js +17 -0
- package/dist/{orchestrator-CKCECRNV.js → orchestrator-WXEZHUVQ.js} +4 -3
- package/dist/package.json +1 -1
- package/dist/{processor-L3W54WNO.js → processor-GA5NG3T7.js} +4 -3
- package/dist/{serve-6AKAJZLV.js → serve-TJHQ326L.js} +6 -5
- package/dist/server/index.js +5 -4
- package/dist/{tools-UT5WFO7R.js → tools-THXBQJ7A.js} +3 -2
- package/dist/web/assets/{index-UyPzUt46.js → index-CQw-9GC9.js} +57 -57
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-NZCKCJH5.js +0 -13
- package/dist/compactor-5VQNEYQX.js +0 -9
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PathAccessDeniedError,
|
|
3
|
-
TurnMetrics,
|
|
4
|
-
WORKFLOW_KICKOFF_PROMPT,
|
|
5
3
|
assembleAgentRequest,
|
|
6
|
-
buildAgentReminder,
|
|
7
|
-
buildAgentSmallReminder,
|
|
8
4
|
createAssemblyResult,
|
|
9
|
-
createChatDoneEvent,
|
|
10
|
-
createMessageStartEvent,
|
|
11
5
|
findAgentById,
|
|
12
6
|
getAllInstructions,
|
|
13
7
|
getConversationMessages,
|
|
@@ -17,7 +11,15 @@ import {
|
|
|
17
11
|
loadAllAgentsDefault,
|
|
18
12
|
processEventsForConversation,
|
|
19
13
|
runTopLevelAgentLoop
|
|
20
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2VDLXCLO.js";
|
|
15
|
+
import {
|
|
16
|
+
TurnMetrics,
|
|
17
|
+
WORKFLOW_KICKOFF_PROMPT,
|
|
18
|
+
buildAgentReminder,
|
|
19
|
+
buildAgentSmallReminder,
|
|
20
|
+
createChatDoneEvent,
|
|
21
|
+
createMessageStartEvent
|
|
22
|
+
} from "./chunk-L7TDUIQY.js";
|
|
21
23
|
import {
|
|
22
24
|
getCurrentContextWindowId,
|
|
23
25
|
getCurrentWindowMessageOptions,
|
|
@@ -261,6 +263,7 @@ async function runAgentTurn(options, turnMetrics, agentId, append, callbacks) {
|
|
|
261
263
|
getToolRegistry: () => getToolRegistryForAgent(agentDef),
|
|
262
264
|
getConversationMessages: buildGetConversationMessages(options.sessionId, options.llmClient, append),
|
|
263
265
|
injectAgentReminder: () => injectAgentReminder(options.sessionId, agentDef),
|
|
266
|
+
...options.initialCompacting ? { initialCompacting: true } : {},
|
|
264
267
|
...callbacks?.injectKickoff ? { injectKickoff: callbacks.injectKickoff } : {},
|
|
265
268
|
...callbacks?.onToolExecuted ? { onToolExecuted: callbacks.onToolExecuted } : {}
|
|
266
269
|
},
|
|
@@ -311,4 +314,4 @@ export {
|
|
|
311
314
|
runAgentTurn,
|
|
312
315
|
injectWorkflowKickoffIfNeeded
|
|
313
316
|
};
|
|
314
|
-
//# sourceMappingURL=chunk-
|
|
317
|
+
//# sourceMappingURL=chunk-EZJUU54W.js.map
|
|
@@ -196,7 +196,7 @@ async function runCli(options) {
|
|
|
196
196
|
if (!configExists) {
|
|
197
197
|
await runNetworkSetup(mode);
|
|
198
198
|
}
|
|
199
|
-
const { runServe } = await import("./serve-
|
|
199
|
+
const { runServe } = await import("./serve-TJHQ326L.js");
|
|
200
200
|
const serveOptions = { mode };
|
|
201
201
|
if (values.port) serveOptions.port = parseInt(values.port);
|
|
202
202
|
if (values["no-browser"] === true) serveOptions.openBrowser = false;
|
|
@@ -208,4 +208,4 @@ async function runCli(options) {
|
|
|
208
208
|
export {
|
|
209
209
|
runCli
|
|
210
210
|
};
|
|
211
|
-
//# sourceMappingURL=chunk-
|
|
211
|
+
//# sourceMappingURL=chunk-FQIT7VIA.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPACTION_PROMPT,
|
|
3
|
+
createMessageStartEvent
|
|
4
|
+
} from "./chunk-L7TDUIQY.js";
|
|
5
|
+
import {
|
|
6
|
+
getCurrentWindowMessageOptions
|
|
7
|
+
} from "./chunk-SYG2ENUQ.js";
|
|
8
|
+
|
|
9
|
+
// src/server/context/compactor.ts
|
|
10
|
+
function appendCompactionPrompt(sessionId, append) {
|
|
11
|
+
const compactPromptMsgId = crypto.randomUUID();
|
|
12
|
+
append(
|
|
13
|
+
createMessageStartEvent(compactPromptMsgId, "user", COMPACTION_PROMPT, {
|
|
14
|
+
...getCurrentWindowMessageOptions(sessionId) ?? {},
|
|
15
|
+
isSystemGenerated: true,
|
|
16
|
+
messageKind: "auto-prompt",
|
|
17
|
+
metadata: { type: "compaction", name: "Compaction", color: "#64748b" }
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
append({ type: "message.done", data: { messageId: compactPromptMsgId } });
|
|
21
|
+
}
|
|
22
|
+
function shouldCompact(currentTokens, maxTokens, threshold) {
|
|
23
|
+
return currentTokens > maxTokens * threshold;
|
|
24
|
+
}
|
|
25
|
+
function getCompactionTarget(maxTokens, targetRatio) {
|
|
26
|
+
return Math.floor(maxTokens * targetRatio);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
appendCompactionPrompt,
|
|
31
|
+
shouldCompact,
|
|
32
|
+
getCompactionTarget
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=chunk-FWJ6YXGA.js.map
|