openfox 1.2.2 → 1.3.2
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-Q36IMXD4.js → auto-compaction-RRFGQDQN.js} +2 -2
- package/dist/{chat-handler-BTU2FLJY.js → chat-handler-34PPF43W.js} +4 -4
- package/dist/{chunk-NGSSEMII.js → chunk-3RQVQEJK.js} +5 -5
- package/dist/{chunk-36AJGM6G.js → chunk-4JBBQQOD.js} +171 -45
- package/dist/{chunk-IBA3NQAD.js → chunk-DJ63VO76.js} +2 -2
- package/dist/{chunk-BNK5N227.js → chunk-FDSMWTWR.js} +2 -2
- package/dist/{chunk-QYRLQ3NK.js → chunk-G6YDTMES.js} +10 -10
- package/dist/{chunk-47TNOR2U.js → chunk-HADOQO3N.js} +13 -13
- package/dist/{chunk-NIQ4X7Y7.js → chunk-O7O3XMWO.js} +2 -2
- package/dist/{chunk-YSPC6TQJ.js → chunk-XHWINXDP.js} +2 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{config-ONC2MTDE.js → config-KP77JNPB.js} +4 -4
- package/dist/{init-TLQQLRGQ.js → init-ZZ6WC5I3.js} +7 -7
- package/dist/{orchestrator-TFJHY67A.js → orchestrator-K6PLFOVY.js} +3 -3
- package/dist/package.json +1 -1
- package/dist/{processor-KJBVOF4W.js → processor-V57VGPXZ.js} +2 -2
- package/dist/{provider-FAO4R2GH.js → provider-672UW7G3.js} +6 -6
- package/dist/{serve-MRW7EKGE.js → serve-EIFTPECR.js} +9 -9
- package/dist/server/index.js +6 -6
- package/dist/{tools-4D6R2BA3.js → tools-KTY6SVMF.js} +2 -2
- package/dist/{vision-fallback-MGSC5SWE.js → vision-fallback-HDVISC2D.js} +2 -2
- package/dist/web/assets/{index-Cy5J_s_s.css → index-BW3T98H-.css} +1 -1
- package/dist/web/assets/{index-rZhr4yUO.js → index-MxvFVrSK.js} +54 -54
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
maybeAutoCompactContext,
|
|
3
3
|
performManualContextCompaction,
|
|
4
4
|
resolveCompactionStatsIdentity
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4JBBQQOD.js";
|
|
6
6
|
import "./chunk-NW7PIZH3.js";
|
|
7
7
|
import "./chunk-WQ4W5H6A.js";
|
|
8
8
|
import "./chunk-S4QKTRGJ.js";
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
performManualContextCompaction,
|
|
21
21
|
resolveCompactionStatsIdentity
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=auto-compaction-
|
|
23
|
+
//# sourceMappingURL=auto-compaction-RRFGQDQN.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runChatTurn
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-O7O3XMWO.js";
|
|
4
|
+
import "./chunk-4JBBQQOD.js";
|
|
5
5
|
import {
|
|
6
6
|
generateSessionName,
|
|
7
7
|
needsNameGeneration
|
|
@@ -59,7 +59,7 @@ async function startChatSession(sessionId, content, deps, options) {
|
|
|
59
59
|
sessionManager.setRunning(sessionId, true);
|
|
60
60
|
broadcastForSession(sessionId, createSessionRunningMessage(true));
|
|
61
61
|
try {
|
|
62
|
-
const { maybeAutoCompactContext } = await import("./auto-compaction-
|
|
62
|
+
const { maybeAutoCompactContext } = await import("./auto-compaction-RRFGQDQN.js");
|
|
63
63
|
await maybeAutoCompactContext({
|
|
64
64
|
sessionManager,
|
|
65
65
|
sessionId,
|
|
@@ -198,4 +198,4 @@ export {
|
|
|
198
198
|
startChatSession,
|
|
199
199
|
stopSessionExecution
|
|
200
200
|
};
|
|
201
|
-
//# sourceMappingURL=chat-handler-
|
|
201
|
+
//# sourceMappingURL=chat-handler-34PPF43W.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
describeImageFromDataUrl,
|
|
3
3
|
ensureVisionFallbackConfigLoaded
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DJ63VO76.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
7
|
} from "./chunk-PNBH3RAX.js";
|
|
@@ -390,7 +390,7 @@ var MODEL_PROFILES = [
|
|
|
390
390
|
topK: 40,
|
|
391
391
|
supportsReasoning: true,
|
|
392
392
|
reasoningAsContent: false,
|
|
393
|
-
defaultMaxTokens:
|
|
393
|
+
defaultMaxTokens: 4092,
|
|
394
394
|
supportsVision: false
|
|
395
395
|
}
|
|
396
396
|
},
|
|
@@ -818,7 +818,7 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
818
818
|
try {
|
|
819
819
|
const shouldDisableThinking = disableThinking || request.disableThinking === true;
|
|
820
820
|
await ensureVisionFallbackConfigLoaded();
|
|
821
|
-
const { isVisionFallbackEnabled } = await import("./vision-fallback-
|
|
821
|
+
const { isVisionFallbackEnabled } = await import("./vision-fallback-HDVISC2D.js");
|
|
822
822
|
const paramsOptions = {
|
|
823
823
|
model,
|
|
824
824
|
request,
|
|
@@ -896,7 +896,7 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
896
896
|
});
|
|
897
897
|
try {
|
|
898
898
|
await ensureVisionFallbackConfigLoaded();
|
|
899
|
-
const { isVisionFallbackEnabled } = await import("./vision-fallback-
|
|
899
|
+
const { isVisionFallbackEnabled } = await import("./vision-fallback-HDVISC2D.js");
|
|
900
900
|
const shouldDisableThinking = disableThinking || request.disableThinking === true;
|
|
901
901
|
const createParams = await buildStreamingCreateParams({
|
|
902
902
|
model,
|
|
@@ -1111,4 +1111,4 @@ export {
|
|
|
1111
1111
|
getLlmStatus,
|
|
1112
1112
|
clearModelCache
|
|
1113
1113
|
};
|
|
1114
|
-
//# sourceMappingURL=chunk-
|
|
1114
|
+
//# sourceMappingURL=chunk-3RQVQEJK.js.map
|
|
@@ -356,10 +356,8 @@ var COMPACTION_PROMPT = `Summarize the conversation history concisely, preservin
|
|
|
356
356
|
6. The user's current question, prompt, or active request
|
|
357
357
|
|
|
358
358
|
Be thorough but concise. Output as a structured summary.
|
|
359
|
-
|
|
360
|
-
IMPORTANT: Do NOT use any tools. Do NOT output XML tags like <tool_call>, <function=>. Only respond with plain text summary.`;
|
|
359
|
+
You may use available tools to read files and verify changes if needed.`;
|
|
361
360
|
var FORMAT_CORRECTION_PROMPT = `IMPORTANT: You MUST use the JSON function calling API. Do NOT output XML tags like <tool_call>, <function=>, or <parameter=>. Your previous attempt was stopped because you used the wrong format. Use the proper tool_calls format.`;
|
|
362
|
-
var MAX_FORMAT_RETRIES = 10;
|
|
363
361
|
|
|
364
362
|
// src/server/chat/request-context.ts
|
|
365
363
|
function getTriggerUserMessage(messages) {
|
|
@@ -732,6 +730,144 @@ async function consumeStreamGenerator(gen, onEvent) {
|
|
|
732
730
|
onEvent(result.value);
|
|
733
731
|
}
|
|
734
732
|
}
|
|
733
|
+
var MAX_TOOL_LOOP_ITERATIONS = 10;
|
|
734
|
+
async function consumeStreamWithToolLoop(options) {
|
|
735
|
+
const {
|
|
736
|
+
messageId,
|
|
737
|
+
systemPrompt,
|
|
738
|
+
llmClient,
|
|
739
|
+
messages,
|
|
740
|
+
tools,
|
|
741
|
+
toolChoice,
|
|
742
|
+
disableThinking,
|
|
743
|
+
signal,
|
|
744
|
+
turnMetrics,
|
|
745
|
+
toolRegistry,
|
|
746
|
+
sessionId,
|
|
747
|
+
workdir,
|
|
748
|
+
onEvent,
|
|
749
|
+
statsIdentity,
|
|
750
|
+
dangerLevel
|
|
751
|
+
} = options;
|
|
752
|
+
const systemMsg = { role: "system", content: systemPrompt };
|
|
753
|
+
let currentMessages = [systemMsg, ...messages];
|
|
754
|
+
let iterations = 0;
|
|
755
|
+
for (; ; ) {
|
|
756
|
+
if (signal?.aborted) {
|
|
757
|
+
return {
|
|
758
|
+
content: "",
|
|
759
|
+
toolCalls: [],
|
|
760
|
+
segments: [],
|
|
761
|
+
usage: { promptTokens: 0, completionTokens: 0 },
|
|
762
|
+
timing: { ttft: 0, completionTime: 0, tps: 0, prefillTps: 0 },
|
|
763
|
+
aborted: true,
|
|
764
|
+
xmlFormatError: false
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
if (++iterations > MAX_TOOL_LOOP_ITERATIONS) {
|
|
768
|
+
throw new Error("Max tool loop iterations exceeded during compaction");
|
|
769
|
+
}
|
|
770
|
+
const streamGen = streamLLMPure({
|
|
771
|
+
messageId,
|
|
772
|
+
systemPrompt: "",
|
|
773
|
+
llmClient,
|
|
774
|
+
messages: currentMessages,
|
|
775
|
+
tools,
|
|
776
|
+
toolChoice,
|
|
777
|
+
disableThinking: disableThinking ?? false,
|
|
778
|
+
signal
|
|
779
|
+
});
|
|
780
|
+
const result = await consumeStreamGenerator(streamGen, onEvent);
|
|
781
|
+
if (result.aborted) {
|
|
782
|
+
return result;
|
|
783
|
+
}
|
|
784
|
+
if (result.xmlFormatError) {
|
|
785
|
+
const correctionMsg = { role: "user", content: FORMAT_CORRECTION_PROMPT };
|
|
786
|
+
currentMessages = [...currentMessages, correctionMsg];
|
|
787
|
+
continue;
|
|
788
|
+
}
|
|
789
|
+
turnMetrics.addLLMCall(result.timing, result.usage.promptTokens, result.usage.completionTokens);
|
|
790
|
+
if (result.toolCalls.length > 0) {
|
|
791
|
+
const stats = turnMetrics.buildStats(statsIdentity, "compaction");
|
|
792
|
+
onEvent(createMessageDoneEvent(messageId, {
|
|
793
|
+
segments: result.segments,
|
|
794
|
+
stats
|
|
795
|
+
}));
|
|
796
|
+
const toolContext = {
|
|
797
|
+
sessionId,
|
|
798
|
+
workdir,
|
|
799
|
+
turnMetrics,
|
|
800
|
+
signal: signal ?? void 0,
|
|
801
|
+
llmClient,
|
|
802
|
+
statsIdentity,
|
|
803
|
+
dangerLevel,
|
|
804
|
+
toolRegistry
|
|
805
|
+
};
|
|
806
|
+
const toolResult = await executeToolBatchWithContext(messageId, result.toolCalls, toolContext, onEvent);
|
|
807
|
+
for (const toolMsg of toolResult.toolMessages) {
|
|
808
|
+
const msg = {
|
|
809
|
+
role: "tool",
|
|
810
|
+
content: toolMsg.content,
|
|
811
|
+
toolCallId: toolMsg.toolCallId ?? ""
|
|
812
|
+
};
|
|
813
|
+
currentMessages.push(msg);
|
|
814
|
+
}
|
|
815
|
+
currentMessages.push({
|
|
816
|
+
role: "assistant",
|
|
817
|
+
content: result.content,
|
|
818
|
+
toolCalls: result.toolCalls
|
|
819
|
+
});
|
|
820
|
+
continue;
|
|
821
|
+
}
|
|
822
|
+
if (!result.content && result.thinkingContent) {
|
|
823
|
+
return {
|
|
824
|
+
...result,
|
|
825
|
+
content: result.thinkingContent
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
return result;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
async function executeToolBatchWithContext(assistantMsgId, toolCalls, ctx, onEvent) {
|
|
832
|
+
const toolMessages = [];
|
|
833
|
+
let criteriaChanged = false;
|
|
834
|
+
for (const toolCall of toolCalls) {
|
|
835
|
+
if (ctx.signal?.aborted) {
|
|
836
|
+
throw new Error("Aborted");
|
|
837
|
+
}
|
|
838
|
+
onEvent(createToolCallEvent(assistantMsgId, toolCall));
|
|
839
|
+
let toolResult;
|
|
840
|
+
try {
|
|
841
|
+
toolResult = await ctx.toolRegistry.execute(toolCall.name, toolCall.arguments, {
|
|
842
|
+
sessionId: ctx.sessionId,
|
|
843
|
+
workdir: ctx.workdir,
|
|
844
|
+
...ctx.signal ? { signal: ctx.signal } : {},
|
|
845
|
+
llmClient: ctx.llmClient,
|
|
846
|
+
statsIdentity: ctx.statsIdentity,
|
|
847
|
+
...ctx.dangerLevel ? { dangerLevel: ctx.dangerLevel } : {},
|
|
848
|
+
toolCallId: toolCall.id
|
|
849
|
+
});
|
|
850
|
+
} catch (error) {
|
|
851
|
+
toolResult = {
|
|
852
|
+
success: false,
|
|
853
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
854
|
+
durationMs: 0,
|
|
855
|
+
truncated: false
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
ctx.turnMetrics.addToolTime(toolResult.durationMs);
|
|
859
|
+
onEvent(createToolResultEvent(assistantMsgId, toolCall.id, toolResult));
|
|
860
|
+
const content = toolResult.success ? toolResult.output ?? "Success" : toolResult.output ? `${toolResult.output}
|
|
861
|
+
|
|
862
|
+
Error: ${toolResult.error}` : `Error: ${toolResult.error}`;
|
|
863
|
+
toolMessages.push({
|
|
864
|
+
role: "tool",
|
|
865
|
+
content,
|
|
866
|
+
toolCallId: toolCall.id
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
return { toolMessages, criteriaChanged };
|
|
870
|
+
}
|
|
735
871
|
|
|
736
872
|
// src/server/agents/registry.ts
|
|
737
873
|
import { readdir, readFile as readFile2, writeFile, copyFile, mkdir, access as access2, unlink } from "fs/promises";
|
|
@@ -2917,7 +3053,7 @@ Error: ${toolResult.error}` : `Error: ${toolResult.error}`,
|
|
|
2917
3053
|
}
|
|
2918
3054
|
return { toolMessages, criteriaChanged, returnValueContent, returnValueResult };
|
|
2919
3055
|
}
|
|
2920
|
-
var
|
|
3056
|
+
var MAX_FORMAT_RETRIES = 10;
|
|
2921
3057
|
var FORMAT_CORRECTION_PROMPT2 = `IMPORTANT: You MUST use the JSON function calling API. Do NOT output XML tags like <tool_call>, <function=>, or <parameter=>. Your previous attempt was stopped because you used the wrong format. Use the proper tool_calls format.`;
|
|
2922
3058
|
function toRequestContextMessages(messages) {
|
|
2923
3059
|
return messages.map((message) => ({
|
|
@@ -2965,7 +3101,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
|
|
|
2965
3101
|
isSystemGenerated: true,
|
|
2966
3102
|
messageKind: "correction"
|
|
2967
3103
|
}));
|
|
2968
|
-
eventStore.append(sessionId, createFormatRetryEvent(formatRetryCount,
|
|
3104
|
+
eventStore.append(sessionId, createFormatRetryEvent(formatRetryCount, MAX_FORMAT_RETRIES));
|
|
2969
3105
|
requestMessages.push({ role: "user", content: FORMAT_CORRECTION_PROMPT2, source: "runtime" });
|
|
2970
3106
|
}
|
|
2971
3107
|
const configDir = getGlobalConfigDir(getRuntimeConfig().mode ?? "production");
|
|
@@ -3029,7 +3165,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
|
|
|
3029
3165
|
eventStore.append(sessionId, event);
|
|
3030
3166
|
});
|
|
3031
3167
|
if (result.xmlFormatError) {
|
|
3032
|
-
if (formatRetryCount <
|
|
3168
|
+
if (formatRetryCount < MAX_FORMAT_RETRIES) {
|
|
3033
3169
|
formatRetryCount += 1;
|
|
3034
3170
|
continue;
|
|
3035
3171
|
} else {
|
|
@@ -3472,7 +3608,7 @@ var callSubAgentTool = {
|
|
|
3472
3608
|
};
|
|
3473
3609
|
}
|
|
3474
3610
|
try {
|
|
3475
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3611
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-KTY6SVMF.js");
|
|
3476
3612
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3477
3613
|
const turnMetrics = new TurnMetrics();
|
|
3478
3614
|
const result = await executeSubAgent({
|
|
@@ -4355,45 +4491,35 @@ ${COMPACTION_PROMPT}
|
|
|
4355
4491
|
const assistantMsgId = crypto.randomUUID();
|
|
4356
4492
|
eventStore.append(sessionId, createMessageStartEvent(assistantMsgId, "assistant", void 0, getCurrentWindowMessageOptions3(sessionId)));
|
|
4357
4493
|
const turnMetrics = new TurnMetrics();
|
|
4358
|
-
const
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
llmClient,
|
|
4365
|
-
messages: [...llmMessages, ...correctionMessages],
|
|
4366
|
-
tools: toolRegistry.definitions,
|
|
4367
|
-
toolChoice: "none",
|
|
4368
|
-
disableThinking: true,
|
|
4369
|
-
...signal ? { signal } : {}
|
|
4370
|
-
});
|
|
4371
|
-
result = await consumeStreamGenerator(streamGen, (event) => {
|
|
4372
|
-
eventStore.append(sessionId, event);
|
|
4373
|
-
});
|
|
4374
|
-
if (result.aborted) {
|
|
4375
|
-
throw new Error("Aborted");
|
|
4376
|
-
}
|
|
4377
|
-
if (!result.xmlFormatError) {
|
|
4378
|
-
break;
|
|
4494
|
+
const compactionToolRegistry = {
|
|
4495
|
+
execute: async (name, args, ctx) => {
|
|
4496
|
+
return toolRegistry.execute(name, args, {
|
|
4497
|
+
...ctx,
|
|
4498
|
+
sessionManager
|
|
4499
|
+
});
|
|
4379
4500
|
}
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4501
|
+
};
|
|
4502
|
+
const result = await consumeStreamWithToolLoop({
|
|
4503
|
+
messageId: assistantMsgId,
|
|
4504
|
+
systemPrompt: assembledRequest.systemPrompt,
|
|
4505
|
+
llmClient,
|
|
4506
|
+
messages: llmMessages,
|
|
4507
|
+
tools: toolRegistry.definitions,
|
|
4508
|
+
toolChoice: "auto",
|
|
4509
|
+
disableThinking: true,
|
|
4510
|
+
turnMetrics,
|
|
4511
|
+
toolRegistry: compactionToolRegistry,
|
|
4512
|
+
sessionId,
|
|
4513
|
+
workdir: session.workdir,
|
|
4514
|
+
onEvent: (event) => eventStore.append(sessionId, event),
|
|
4515
|
+
statsIdentity,
|
|
4516
|
+
...session.dangerLevel ? { dangerLevel: session.dangerLevel } : {},
|
|
4517
|
+
...signal ? { signal } : {}
|
|
4518
|
+
});
|
|
4519
|
+
if (result.aborted) {
|
|
4520
|
+
throw new Error("Aborted");
|
|
4389
4521
|
}
|
|
4390
|
-
turnMetrics.
|
|
4391
|
-
const compactionStats = turnMetrics.buildStats(statsIdentity, "planner");
|
|
4392
|
-
eventStore.append(sessionId, createMessageDoneEvent(assistantMsgId, {
|
|
4393
|
-
segments: result.segments,
|
|
4394
|
-
stats: compactionStats,
|
|
4395
|
-
promptContext: assembledRequest.promptContext
|
|
4396
|
-
}));
|
|
4522
|
+
const compactionStats = turnMetrics.buildStats(statsIdentity, "compaction");
|
|
4397
4523
|
eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "complete", compactionStats));
|
|
4398
4524
|
let summary = (result.content ?? "").trim();
|
|
4399
4525
|
if (!summary && result.thinkingContent != null) {
|
|
@@ -4480,4 +4606,4 @@ export {
|
|
|
4480
4606
|
getToolRegistryForAgent,
|
|
4481
4607
|
createToolRegistry
|
|
4482
4608
|
};
|
|
4483
|
-
//# sourceMappingURL=chunk-
|
|
4609
|
+
//# sourceMappingURL=chunk-4JBBQQOD.js.map
|
|
@@ -29,7 +29,7 @@ function isVisionFallbackEnabled() {
|
|
|
29
29
|
async function ensureVisionFallbackConfigLoaded() {
|
|
30
30
|
if (configLoaded) return;
|
|
31
31
|
try {
|
|
32
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
32
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-KP77JNPB.js");
|
|
33
33
|
const { getRuntimeConfig } = await import("./runtime-config-2XJJIMSC.js");
|
|
34
34
|
const runtimeConfig = getRuntimeConfig();
|
|
35
35
|
const mode = runtimeConfig.mode ?? "production";
|
|
@@ -134,4 +134,4 @@ export {
|
|
|
134
134
|
describeImage,
|
|
135
135
|
describeImageFromDataUrl
|
|
136
136
|
};
|
|
137
|
-
//# sourceMappingURL=chunk-
|
|
137
|
+
//# sourceMappingURL=chunk-DJ63VO76.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
detectBackend,
|
|
3
3
|
detectModel
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3RQVQEJK.js";
|
|
5
5
|
import {
|
|
6
6
|
getGlobalConfigPath
|
|
7
7
|
} from "./chunk-R4HADRYO.js";
|
|
@@ -380,4 +380,4 @@ export {
|
|
|
380
380
|
activateProvider,
|
|
381
381
|
mergeConfigs
|
|
382
382
|
};
|
|
383
|
-
//# sourceMappingURL=chunk-
|
|
383
|
+
//# sourceMappingURL=chunk-FDSMWTWR.js.map
|
|
@@ -24,7 +24,7 @@ Options:
|
|
|
24
24
|
`);
|
|
25
25
|
}
|
|
26
26
|
async function runConfig(mode) {
|
|
27
|
-
const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-
|
|
27
|
+
const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-KP77JNPB.js");
|
|
28
28
|
const { getGlobalConfigPath } = await import("./paths-ZRI56O63.js");
|
|
29
29
|
const config = await loadGlobalConfig(mode);
|
|
30
30
|
const configPath = getGlobalConfigPath(mode);
|
|
@@ -75,8 +75,8 @@ async function runCli(options) {
|
|
|
75
75
|
const [command] = positionals;
|
|
76
76
|
switch (command) {
|
|
77
77
|
case "init": {
|
|
78
|
-
const { runInitWithSelect } = await import("./init-
|
|
79
|
-
const { loadGlobalConfig, getActiveProvider } = await import("./config-
|
|
78
|
+
const { runInitWithSelect } = await import("./init-ZZ6WC5I3.js");
|
|
79
|
+
const { loadGlobalConfig, getActiveProvider } = await import("./config-KP77JNPB.js");
|
|
80
80
|
const config = await loadGlobalConfig(mode);
|
|
81
81
|
const activeProvider = getActiveProvider(config);
|
|
82
82
|
if (activeProvider) {
|
|
@@ -91,17 +91,17 @@ async function runCli(options) {
|
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
93
|
case "provider": {
|
|
94
|
-
const { runProviderCommand } = await import("./provider-
|
|
94
|
+
const { runProviderCommand } = await import("./provider-672UW7G3.js");
|
|
95
95
|
const [, subcommand] = positionals;
|
|
96
96
|
await runProviderCommand(mode, subcommand);
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
99
|
default: {
|
|
100
|
-
const { configFileExists } = await import("./config-
|
|
100
|
+
const { configFileExists } = await import("./config-KP77JNPB.js");
|
|
101
101
|
const configExists = await configFileExists(mode);
|
|
102
102
|
if (!configExists) {
|
|
103
103
|
console.log("Welcome to OpenFox!\n");
|
|
104
|
-
const { trySmartDefaults, saveGlobalConfig, addProvider } = await import("./config-
|
|
104
|
+
const { trySmartDefaults, saveGlobalConfig, addProvider } = await import("./config-KP77JNPB.js");
|
|
105
105
|
const detected = await trySmartDefaults(mode);
|
|
106
106
|
if (detected) {
|
|
107
107
|
console.log(`\u2713 Found ${detected.backend} (${detected.model}) at ${detected.url}`);
|
|
@@ -119,17 +119,17 @@ async function runCli(options) {
|
|
|
119
119
|
models: [],
|
|
120
120
|
isActive: true
|
|
121
121
|
});
|
|
122
|
-
const { setDefaultModelSelection } = await import("./config-
|
|
122
|
+
const { setDefaultModelSelection } = await import("./config-KP77JNPB.js");
|
|
123
123
|
const finalConfig = setDefaultModelSelection(configWithProvider, configWithProvider.providers[0].id, detected.model);
|
|
124
124
|
await saveGlobalConfig(mode, finalConfig);
|
|
125
125
|
console.log("Configuration saved!\n");
|
|
126
126
|
} else {
|
|
127
127
|
console.log("\u2717 No LLM server detected\n");
|
|
128
|
-
const { runInitWithSelect } = await import("./init-
|
|
128
|
+
const { runInitWithSelect } = await import("./init-ZZ6WC5I3.js");
|
|
129
129
|
await runInitWithSelect(mode);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
const { runServe } = await import("./serve-
|
|
132
|
+
const { runServe } = await import("./serve-EIFTPECR.js");
|
|
133
133
|
await runServe({
|
|
134
134
|
mode,
|
|
135
135
|
port: values.port ? parseInt(values.port) : void 0,
|
|
@@ -142,4 +142,4 @@ async function runCli(options) {
|
|
|
142
142
|
export {
|
|
143
143
|
runCli
|
|
144
144
|
};
|
|
145
|
-
//# sourceMappingURL=chunk-
|
|
145
|
+
//# sourceMappingURL=chunk-G6YDTMES.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createVerifierNudgeConfig,
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-O7O3XMWO.js";
|
|
6
6
|
import {
|
|
7
7
|
TurnMetrics,
|
|
8
8
|
agentExists,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
saveSkill,
|
|
41
41
|
setSkillEnabled,
|
|
42
42
|
skillExists
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-4JBBQQOD.js";
|
|
44
44
|
import {
|
|
45
45
|
generateSessionName,
|
|
46
46
|
needsNameGeneration
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
import {
|
|
49
49
|
createProviderManager,
|
|
50
50
|
parseDefaultModelSelection
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-XHWINXDP.js";
|
|
52
52
|
import {
|
|
53
53
|
createSession,
|
|
54
54
|
deleteSession,
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
getBackendDisplayName,
|
|
125
125
|
getLlmStatus,
|
|
126
126
|
getModelProfile
|
|
127
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-3RQVQEJK.js";
|
|
128
128
|
import {
|
|
129
129
|
getGlobalConfigDir
|
|
130
130
|
} from "./chunk-R4HADRYO.js";
|
|
@@ -5788,7 +5788,7 @@ async function createServerHandle(config) {
|
|
|
5788
5788
|
return res.status(400).json({ error: "providerId is required" });
|
|
5789
5789
|
}
|
|
5790
5790
|
sessionManager.setSessionProvider(sessionId, providerId, model ?? "auto");
|
|
5791
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
5791
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-KP77JNPB.js");
|
|
5792
5792
|
const globalConfig = await loadGlobalConfig(config.mode ?? "production");
|
|
5793
5793
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model ?? "auto");
|
|
5794
5794
|
await saveGlobalConfig(config.mode ?? "production", updatedConfig);
|
|
@@ -5853,7 +5853,7 @@ async function createServerHandle(config) {
|
|
|
5853
5853
|
if (!callId || approved === void 0) {
|
|
5854
5854
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5855
5855
|
}
|
|
5856
|
-
const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-
|
|
5856
|
+
const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-KTY6SVMF.js");
|
|
5857
5857
|
const result = providePathConfirmation2(callId, approved, alwaysAllow);
|
|
5858
5858
|
if (!result.found) {
|
|
5859
5859
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
@@ -5878,7 +5878,7 @@ async function createServerHandle(config) {
|
|
|
5878
5878
|
if (!callId || !answer) {
|
|
5879
5879
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
5880
5880
|
}
|
|
5881
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
5881
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-KTY6SVMF.js");
|
|
5882
5882
|
const found = provideAnswer2(callId, answer);
|
|
5883
5883
|
if (!found) {
|
|
5884
5884
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5914,8 +5914,8 @@ async function createServerHandle(config) {
|
|
|
5914
5914
|
if (!session) {
|
|
5915
5915
|
return res.status(404).json({ error: "Session not found" });
|
|
5916
5916
|
}
|
|
5917
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5918
|
-
const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-
|
|
5917
|
+
const { stopSessionExecution } = await import("./chat-handler-34PPF43W.js");
|
|
5918
|
+
const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-KTY6SVMF.js");
|
|
5919
5919
|
stopSessionExecution(sessionId, sessionManager);
|
|
5920
5920
|
abortSession(sessionId);
|
|
5921
5921
|
cancelQuestionsForSession2(sessionId, "Session stopped by user");
|
|
@@ -6030,7 +6030,7 @@ async function createServerHandle(config) {
|
|
|
6030
6030
|
return res.status(400).json({ error: result.error });
|
|
6031
6031
|
}
|
|
6032
6032
|
const llmClient = getLLMClient();
|
|
6033
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6033
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-KP77JNPB.js");
|
|
6034
6034
|
const globalConfig = await loadGlobalConfig(config.mode ?? "production");
|
|
6035
6035
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
6036
6036
|
await saveGlobalConfig(config.mode ?? "production", updatedConfig);
|
|
@@ -6051,7 +6051,7 @@ async function createServerHandle(config) {
|
|
|
6051
6051
|
if (!result.success) {
|
|
6052
6052
|
return res.status(400).json({ error: result.error });
|
|
6053
6053
|
}
|
|
6054
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6054
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-KP77JNPB.js");
|
|
6055
6055
|
const globalConfig = await loadGlobalConfig(config.mode ?? "production");
|
|
6056
6056
|
const updatedProviders = providerManager.getProviders();
|
|
6057
6057
|
const updatedConfig = {
|
|
@@ -6239,7 +6239,7 @@ async function createServerHandle(config) {
|
|
|
6239
6239
|
providerManager
|
|
6240
6240
|
);
|
|
6241
6241
|
const wss = wssExports.wss;
|
|
6242
|
-
const { QueueProcessor } = await import("./processor-
|
|
6242
|
+
const { QueueProcessor } = await import("./processor-V57VGPXZ.js");
|
|
6243
6243
|
const queueProcessor = new QueueProcessor({
|
|
6244
6244
|
sessionManager,
|
|
6245
6245
|
providerManager,
|
|
@@ -6309,4 +6309,4 @@ export {
|
|
|
6309
6309
|
createServerHandle,
|
|
6310
6310
|
createServer
|
|
6311
6311
|
};
|
|
6312
|
-
//# sourceMappingURL=chunk-
|
|
6312
|
+
//# sourceMappingURL=chunk-HADOQO3N.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
getToolRegistryForAgent,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
runTopLevelAgentLoop
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-4JBBQQOD.js";
|
|
17
17
|
import {
|
|
18
18
|
getCurrentContextWindowId,
|
|
19
19
|
getEventStore
|
|
@@ -311,4 +311,4 @@ export {
|
|
|
311
311
|
runBuilderTurn,
|
|
312
312
|
runVerifierTurn
|
|
313
313
|
};
|
|
314
|
-
//# sourceMappingURL=chunk-
|
|
314
|
+
//# sourceMappingURL=chunk-O7O3XMWO.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createLLMClient,
|
|
4
4
|
detectBackend,
|
|
5
5
|
detectModel
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3RQVQEJK.js";
|
|
7
7
|
import {
|
|
8
8
|
logger
|
|
9
9
|
} from "./chunk-PNBH3RAX.js";
|
|
@@ -441,4 +441,4 @@ export {
|
|
|
441
441
|
parseDefaultModelSelection,
|
|
442
442
|
createProviderManager
|
|
443
443
|
};
|
|
444
|
-
//# sourceMappingURL=chunk-
|
|
444
|
+
//# sourceMappingURL=chunk-XHWINXDP.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
saveGlobalConfig,
|
|
14
14
|
setDefaultModelSelection,
|
|
15
15
|
trySmartDefaults
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-FDSMWTWR.js";
|
|
17
|
+
import "./chunk-3RQVQEJK.js";
|
|
18
18
|
import "./chunk-XFXOSPYH.js";
|
|
19
19
|
import "./chunk-R4HADRYO.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-DJ63VO76.js";
|
|
21
21
|
import "./chunk-PNBH3RAX.js";
|
|
22
22
|
export {
|
|
23
23
|
activateProvider,
|
|
@@ -35,4 +35,4 @@ export {
|
|
|
35
35
|
setDefaultModelSelection,
|
|
36
36
|
trySmartDefaults
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=config-
|
|
38
|
+
//# sourceMappingURL=config-KP77JNPB.js.map
|