openfox 1.6.92 → 1.6.93
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-7AGIGW6F.js → auto-compaction-WYN4P4R3.js} +4 -4
- package/dist/{chat-handler-UPAEF6HR.js → chat-handler-ROOMX2UY.js} +6 -6
- package/dist/{chunk-ARJIHQ3S.js → chunk-32WAUDDK.js} +3 -3
- package/dist/{chunk-7KO2BQFQ.js → chunk-LABBIL3K.js} +7 -7
- package/dist/{chunk-RJIPM7CO.js → chunk-RMQ4WCEK.js} +2 -2
- package/dist/{chunk-WBQNIWAQ.js → chunk-TWGL3Y6S.js} +5 -5
- package/dist/{chunk-2BS6LMIU.js → chunk-UAV33LRW.js} +20 -20
- package/dist/{chunk-BHZL3N2F.js → chunk-YG2QBUYJ.js} +12 -12
- package/dist/{chunk-CHICEUV6.js → chunk-Z774ZQUP.js} +4 -4
- package/dist/{chunk-2TKN2X2A.js → chunk-ZK3EZTHT.js} +2 -2
- package/dist/{chunk-7QG6LY5Q.js → chunk-ZV2PE3KT.js} +3 -3
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{config-7XJQNOKX.js → config-TSGOFNJW.js} +5 -5
- package/dist/{orchestrator-M4WINFF3.js → orchestrator-5I4LBRSY.js} +5 -5
- package/dist/package.json +1 -1
- package/dist/{processor-D4XQ5QMB.js → processor-47OC5EUI.js} +2 -2
- package/dist/{provider-UO5PAZQQ.js → provider-JIFQ47HT.js} +7 -7
- package/dist/{serve-Z5FNJUDT.js → serve-JQTSGHFU.js} +9 -9
- package/dist/server/index.js +7 -7
- package/dist/{tools-NFFQWH6M.js → tools-U6I43EN4.js} +4 -4
- package/dist/{vision-fallback-GZZWU7CR.js → vision-fallback-FBOTVWEX.js} +2 -2
- package/dist/web/assets/{index-SkaCnTiV.js → index-CjiS1Y5o.js} +1 -1
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
maybeAutoCompactContext,
|
|
3
3
|
performManualContextCompaction,
|
|
4
4
|
resolveCompactionStatsIdentity
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-32WAUDDK.js";
|
|
6
6
|
import "./chunk-PQCFNTFJ.js";
|
|
7
7
|
import "./chunk-ZHBL5G5X.js";
|
|
8
8
|
import "./chunk-DL6ZILAF.js";
|
|
9
9
|
import "./chunk-PBGOZMVY.js";
|
|
10
10
|
import "./chunk-VRGRAQDG.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-RMQ4WCEK.js";
|
|
12
12
|
import "./chunk-YTPPQK55.js";
|
|
13
13
|
import "./chunk-5GVCNVKV.js";
|
|
14
14
|
import "./chunk-XVWVAWSG.js";
|
|
@@ -17,11 +17,11 @@ import "./chunk-BJYPTN5S.js";
|
|
|
17
17
|
import "./chunk-ERFRUQQR.js";
|
|
18
18
|
import "./chunk-CQGTEGKL.js";
|
|
19
19
|
import "./chunk-RW25DL5R.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-Z774ZQUP.js";
|
|
21
21
|
import "./chunk-K44MW7JJ.js";
|
|
22
22
|
export {
|
|
23
23
|
maybeAutoCompactContext,
|
|
24
24
|
performManualContextCompaction,
|
|
25
25
|
resolveCompactionStatsIdentity
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=auto-compaction-
|
|
27
|
+
//# sourceMappingURL=auto-compaction-WYN4P4R3.js.map
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
} from "./chunk-XGJ7HDQ7.js";
|
|
9
9
|
import {
|
|
10
10
|
runChatTurn
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-ZK3EZTHT.js";
|
|
12
|
+
import "./chunk-32WAUDDK.js";
|
|
13
13
|
import "./chunk-PQCFNTFJ.js";
|
|
14
14
|
import "./chunk-ZHBL5G5X.js";
|
|
15
15
|
import "./chunk-DL6ZILAF.js";
|
|
16
16
|
import "./chunk-PBGOZMVY.js";
|
|
17
17
|
import "./chunk-VRGRAQDG.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-RMQ4WCEK.js";
|
|
19
19
|
import {
|
|
20
20
|
getEventStore
|
|
21
21
|
} from "./chunk-YTPPQK55.js";
|
|
@@ -30,7 +30,7 @@ import "./chunk-BJYPTN5S.js";
|
|
|
30
30
|
import "./chunk-ERFRUQQR.js";
|
|
31
31
|
import "./chunk-CQGTEGKL.js";
|
|
32
32
|
import "./chunk-RW25DL5R.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-Z774ZQUP.js";
|
|
34
34
|
import {
|
|
35
35
|
logger
|
|
36
36
|
} from "./chunk-K44MW7JJ.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-WYN4P4R3.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-ROOMX2UY.js.map
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getBackendCapabilities,
|
|
28
28
|
getModelProfile,
|
|
29
29
|
streamWithSegments
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-RMQ4WCEK.js";
|
|
31
31
|
import {
|
|
32
32
|
getCurrentContextWindowId,
|
|
33
33
|
getEventStore
|
|
@@ -3881,7 +3881,7 @@ var callSubAgentTool = {
|
|
|
3881
3881
|
};
|
|
3882
3882
|
}
|
|
3883
3883
|
try {
|
|
3884
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3884
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-U6I43EN4.js");
|
|
3885
3885
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3886
3886
|
const turnMetrics = new TurnMetrics();
|
|
3887
3887
|
const result = await executeSubAgent({
|
|
@@ -5080,4 +5080,4 @@ export {
|
|
|
5080
5080
|
getToolRegistryForAgent,
|
|
5081
5081
|
createToolRegistry
|
|
5082
5082
|
};
|
|
5083
|
-
//# sourceMappingURL=chunk-
|
|
5083
|
+
//# sourceMappingURL=chunk-32WAUDDK.js.map
|
|
@@ -33,7 +33,7 @@ Options:
|
|
|
33
33
|
}
|
|
34
34
|
async function runNetworkSetup(mode) {
|
|
35
35
|
const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-56SIRACI.js");
|
|
36
|
-
const { saveGlobalConfig } = await import("./config-
|
|
36
|
+
const { saveGlobalConfig } = await import("./config-TSGOFNJW.js");
|
|
37
37
|
const { getAuthKeyPath } = await import("./paths-X46PPOI2.js");
|
|
38
38
|
const existingAuth = await loadAuthConfig(mode);
|
|
39
39
|
if (existingAuth) {
|
|
@@ -89,12 +89,12 @@ async function runNetworkSetup(mode) {
|
|
|
89
89
|
logging: { level: "error" },
|
|
90
90
|
database: { path: "" },
|
|
91
91
|
workspace: { workdir: process.cwd() },
|
|
92
|
-
visionFallback: { enabled: false, url: "http://localhost:11434", model: "qwen3
|
|
92
|
+
visionFallback: { enabled: false, url: "http://localhost:11434", model: "qwen3.5:0.8b", timeout: 120 }
|
|
93
93
|
});
|
|
94
94
|
console.log("\u2713 Configuration saved!\n");
|
|
95
95
|
}
|
|
96
96
|
async function runConfig(mode) {
|
|
97
|
-
const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-
|
|
97
|
+
const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-TSGOFNJW.js");
|
|
98
98
|
const { getGlobalConfigPath } = await import("./paths-X46PPOI2.js");
|
|
99
99
|
const config = await loadGlobalConfig(mode);
|
|
100
100
|
const configPath = getGlobalConfigPath(mode);
|
|
@@ -150,7 +150,7 @@ async function runCli(options) {
|
|
|
150
150
|
break;
|
|
151
151
|
}
|
|
152
152
|
case "provider": {
|
|
153
|
-
const { runProviderCommand } = await import("./provider-
|
|
153
|
+
const { runProviderCommand } = await import("./provider-JIFQ47HT.js");
|
|
154
154
|
const [, subcommand] = positionals;
|
|
155
155
|
await runProviderCommand(mode, subcommand);
|
|
156
156
|
break;
|
|
@@ -186,12 +186,12 @@ async function runCli(options) {
|
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
188
|
default: {
|
|
189
|
-
const { configFileExists } = await import("./config-
|
|
189
|
+
const { configFileExists } = await import("./config-TSGOFNJW.js");
|
|
190
190
|
const configExists = await configFileExists(mode);
|
|
191
191
|
if (!configExists) {
|
|
192
192
|
await runNetworkSetup(mode);
|
|
193
193
|
}
|
|
194
|
-
const { runServe } = await import("./serve-
|
|
194
|
+
const { runServe } = await import("./serve-JQTSGHFU.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-LABBIL3K.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
describeImageFromDataUrl
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z774ZQUP.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
6
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -801,4 +801,4 @@ export {
|
|
|
801
801
|
extractThinking,
|
|
802
802
|
streamWithSegments
|
|
803
803
|
};
|
|
804
|
-
//# sourceMappingURL=chunk-
|
|
804
|
+
//# sourceMappingURL=chunk-RMQ4WCEK.js.map
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
getBackendCapabilities,
|
|
6
6
|
getModelProfile,
|
|
7
7
|
mapFinishReason
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RMQ4WCEK.js";
|
|
9
9
|
import {
|
|
10
10
|
ensureVisionFallbackConfigLoaded
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Z774ZQUP.js";
|
|
12
12
|
import {
|
|
13
13
|
logger
|
|
14
14
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -188,7 +188,7 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
188
188
|
try {
|
|
189
189
|
const shouldDisableThinking = disableThinking || request.disableThinking === true;
|
|
190
190
|
await ensureVisionFallbackConfigLoaded();
|
|
191
|
-
const { isVisionFallbackEnabled } = await import("./vision-fallback-
|
|
191
|
+
const { isVisionFallbackEnabled } = await import("./vision-fallback-FBOTVWEX.js");
|
|
192
192
|
const paramsOptions = {
|
|
193
193
|
model,
|
|
194
194
|
request,
|
|
@@ -265,7 +265,7 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
265
265
|
});
|
|
266
266
|
try {
|
|
267
267
|
await ensureVisionFallbackConfigLoaded();
|
|
268
|
-
const { isVisionFallbackEnabled } = await import("./vision-fallback-
|
|
268
|
+
const { isVisionFallbackEnabled } = await import("./vision-fallback-FBOTVWEX.js");
|
|
269
269
|
const shouldDisableThinking = disableThinking || request.disableThinking === true;
|
|
270
270
|
const createParams = await buildStreamingCreateParams({
|
|
271
271
|
model,
|
|
@@ -478,4 +478,4 @@ export {
|
|
|
478
478
|
getLlmStatus,
|
|
479
479
|
clearModelCache
|
|
480
480
|
};
|
|
481
|
-
//# sourceMappingURL=chunk-
|
|
481
|
+
//# sourceMappingURL=chunk-TWGL3Y6S.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createVerifierNudgeConfig,
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZK3EZTHT.js";
|
|
6
6
|
import {
|
|
7
7
|
TurnMetrics,
|
|
8
8
|
agentExists,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
saveSkillToProject,
|
|
47
47
|
skillExists,
|
|
48
48
|
spawnShellProcess
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-32WAUDDK.js";
|
|
50
50
|
import {
|
|
51
51
|
getProject
|
|
52
52
|
} from "./chunk-ZHBL5G5X.js";
|
|
@@ -59,18 +59,18 @@ import {
|
|
|
59
59
|
import {
|
|
60
60
|
createProviderManager,
|
|
61
61
|
parseDefaultModelSelection
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-ZV2PE3KT.js";
|
|
63
63
|
import {
|
|
64
64
|
SessionNotFoundError,
|
|
65
65
|
createLLMClient,
|
|
66
66
|
detectModel,
|
|
67
67
|
getLlmStatus
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-TWGL3Y6S.js";
|
|
69
69
|
import {
|
|
70
70
|
detectBackend,
|
|
71
71
|
getBackendDisplayName,
|
|
72
72
|
getModelProfile
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-RMQ4WCEK.js";
|
|
74
74
|
import {
|
|
75
75
|
createSession,
|
|
76
76
|
deleteSession,
|
|
@@ -5359,7 +5359,7 @@ import { Router as Router5 } from "express";
|
|
|
5359
5359
|
import { spawn as spawn4 } from "child_process";
|
|
5360
5360
|
|
|
5361
5361
|
// src/constants.ts
|
|
5362
|
-
var VERSION = "1.6.
|
|
5362
|
+
var VERSION = "1.6.93";
|
|
5363
5363
|
|
|
5364
5364
|
// src/server/routes/auto-update.ts
|
|
5365
5365
|
var updateInProgress = false;
|
|
@@ -5732,7 +5732,7 @@ async function createServerHandle(config4) {
|
|
|
5732
5732
|
return res.status(400).json({ error: "providerId is required" });
|
|
5733
5733
|
}
|
|
5734
5734
|
sessionManager.setSessionProvider(sessionId, providerId, model ?? "auto");
|
|
5735
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
5735
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-TSGOFNJW.js");
|
|
5736
5736
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
5737
5737
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model ?? "auto");
|
|
5738
5738
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -5815,7 +5815,7 @@ async function createServerHandle(config4) {
|
|
|
5815
5815
|
if (!callId || approved === void 0) {
|
|
5816
5816
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5817
5817
|
}
|
|
5818
|
-
const { providePathConfirmation } = await import("./tools-
|
|
5818
|
+
const { providePathConfirmation } = await import("./tools-U6I43EN4.js");
|
|
5819
5819
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
5820
5820
|
if (!result.found) {
|
|
5821
5821
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
@@ -5839,7 +5839,7 @@ async function createServerHandle(config4) {
|
|
|
5839
5839
|
if (!callId || !answer) {
|
|
5840
5840
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
5841
5841
|
}
|
|
5842
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
5842
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-U6I43EN4.js");
|
|
5843
5843
|
const found = provideAnswer2(callId, answer);
|
|
5844
5844
|
if (!found) {
|
|
5845
5845
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5875,8 +5875,8 @@ async function createServerHandle(config4) {
|
|
|
5875
5875
|
if (!session) {
|
|
5876
5876
|
return res.status(404).json({ error: "Session not found" });
|
|
5877
5877
|
}
|
|
5878
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5879
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5878
|
+
const { stopSessionExecution } = await import("./chat-handler-ROOMX2UY.js");
|
|
5879
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-U6I43EN4.js");
|
|
5880
5880
|
stopSessionExecution(sessionId, sessionManager);
|
|
5881
5881
|
abortSession(sessionId);
|
|
5882
5882
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
@@ -5948,14 +5948,14 @@ async function createServerHandle(config4) {
|
|
|
5948
5948
|
let visionFallback;
|
|
5949
5949
|
let globalWorkdir;
|
|
5950
5950
|
try {
|
|
5951
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
5951
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-TSGOFNJW.js");
|
|
5952
5952
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
5953
5953
|
const fallback = getVisionFallback(globalConfig);
|
|
5954
5954
|
if (fallback) {
|
|
5955
5955
|
visionFallback = {
|
|
5956
5956
|
enabled: fallback.enabled ?? false,
|
|
5957
5957
|
url: fallback.url ?? "http://localhost:11434",
|
|
5958
|
-
model: fallback.model ?? "qwen3
|
|
5958
|
+
model: fallback.model ?? "qwen3.5:0.8b",
|
|
5959
5959
|
timeout: fallback.timeout ?? 120
|
|
5960
5960
|
};
|
|
5961
5961
|
}
|
|
@@ -6027,7 +6027,7 @@ async function createServerHandle(config4) {
|
|
|
6027
6027
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
6028
6028
|
}
|
|
6029
6029
|
try {
|
|
6030
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
6030
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-TSGOFNJW.js");
|
|
6031
6031
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6032
6032
|
const providerBackend = backend;
|
|
6033
6033
|
const configWithProvider = addProvider(globalConfig, {
|
|
@@ -6060,7 +6060,7 @@ async function createServerHandle(config4) {
|
|
|
6060
6060
|
app.post("/api/init/config", async (req, res) => {
|
|
6061
6061
|
const { workdir, visionFallback } = req.body;
|
|
6062
6062
|
try {
|
|
6063
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6063
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TSGOFNJW.js");
|
|
6064
6064
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6065
6065
|
const updatedConfig = {
|
|
6066
6066
|
...globalConfig,
|
|
@@ -6088,7 +6088,7 @@ async function createServerHandle(config4) {
|
|
|
6088
6088
|
});
|
|
6089
6089
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
6090
6090
|
const { id } = req.params;
|
|
6091
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
6091
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-TSGOFNJW.js");
|
|
6092
6092
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6093
6093
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
6094
6094
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6108,7 +6108,7 @@ async function createServerHandle(config4) {
|
|
|
6108
6108
|
return res.status(400).json({ error: result.error });
|
|
6109
6109
|
}
|
|
6110
6110
|
const llmClient = getLLMClient();
|
|
6111
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6111
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-TSGOFNJW.js");
|
|
6112
6112
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6113
6113
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
6114
6114
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6139,7 +6139,7 @@ async function createServerHandle(config4) {
|
|
|
6139
6139
|
if (!result.success) {
|
|
6140
6140
|
return res.status(400).json({ error: result.error });
|
|
6141
6141
|
}
|
|
6142
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6142
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TSGOFNJW.js");
|
|
6143
6143
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6144
6144
|
const updatedProviders = providerManager.getProviders();
|
|
6145
6145
|
const updatedConfig = {
|
|
@@ -6380,7 +6380,7 @@ async function createServerHandle(config4) {
|
|
|
6380
6380
|
providerManager
|
|
6381
6381
|
);
|
|
6382
6382
|
const wss = wssExports.wss;
|
|
6383
|
-
const { QueueProcessor } = await import("./processor-
|
|
6383
|
+
const { QueueProcessor } = await import("./processor-47OC5EUI.js");
|
|
6384
6384
|
const queueProcessor = new QueueProcessor({
|
|
6385
6385
|
sessionManager,
|
|
6386
6386
|
providerManager,
|
|
@@ -6455,4 +6455,4 @@ export {
|
|
|
6455
6455
|
createServerHandle,
|
|
6456
6456
|
createServer
|
|
6457
6457
|
};
|
|
6458
|
-
//# sourceMappingURL=chunk-
|
|
6458
|
+
//# sourceMappingURL=chunk-UAV33LRW.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
detectModel
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TWGL3Y6S.js";
|
|
4
4
|
import {
|
|
5
5
|
detectBackend
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RMQ4WCEK.js";
|
|
7
7
|
import {
|
|
8
8
|
getGlobalConfigPath
|
|
9
9
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -93,10 +93,10 @@ var workspaceSchema = z.object({
|
|
|
93
93
|
var visionFallbackSchema = z.object({
|
|
94
94
|
enabled: z.boolean().default(false),
|
|
95
95
|
url: z.string().default("http://localhost:11434"),
|
|
96
|
-
model: z.string().default("qwen3
|
|
96
|
+
model: z.string().default("qwen3.5:0.8b"),
|
|
97
97
|
timeout: z.number().default(120)
|
|
98
98
|
});
|
|
99
|
-
var defaultVisionFallback = { enabled: false, url: "http://localhost:11434", model: "qwen3
|
|
99
|
+
var defaultVisionFallback = { enabled: false, url: "http://localhost:11434", model: "qwen3.5:0.8b", timeout: 120 };
|
|
100
100
|
var configSchema = z.object({
|
|
101
101
|
providers: z.array(providerSchema).default([]),
|
|
102
102
|
defaultModelSelection: z.string().optional(),
|
|
@@ -240,7 +240,7 @@ async function loadGlobalConfig(mode) {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
function getDefaultVisionFallback() {
|
|
243
|
-
return { enabled: false, url: "http://localhost:11434", model: "qwen3
|
|
243
|
+
return { enabled: false, url: "http://localhost:11434", model: "qwen3.5:0.8b", timeout: 120 };
|
|
244
244
|
}
|
|
245
245
|
async function saveGlobalConfig(mode, config) {
|
|
246
246
|
const configPath = getGlobalConfigPath(mode);
|
|
@@ -256,7 +256,7 @@ async function saveGlobalConfig(mode, config) {
|
|
|
256
256
|
visionFallback: config.visionFallback ?? {
|
|
257
257
|
enabled: false,
|
|
258
258
|
url: "http://localhost:11434",
|
|
259
|
-
model: "qwen3
|
|
259
|
+
model: "qwen3.5:0.8b",
|
|
260
260
|
timeout: 120
|
|
261
261
|
}
|
|
262
262
|
};
|
|
@@ -291,7 +291,7 @@ function setDefaultModelSelection(config, providerId, model) {
|
|
|
291
291
|
visionFallback: config.visionFallback ?? {
|
|
292
292
|
enabled: false,
|
|
293
293
|
url: "http://localhost:11434",
|
|
294
|
-
model: "qwen3
|
|
294
|
+
model: "qwen3.5:0.8b",
|
|
295
295
|
timeout: 120
|
|
296
296
|
}
|
|
297
297
|
};
|
|
@@ -318,7 +318,7 @@ function addProvider(config, provider) {
|
|
|
318
318
|
visionFallback: config.visionFallback ?? {
|
|
319
319
|
enabled: false,
|
|
320
320
|
url: "http://localhost:11434",
|
|
321
|
-
model: "qwen3
|
|
321
|
+
model: "qwen3.5:0.8b",
|
|
322
322
|
timeout: 120
|
|
323
323
|
}
|
|
324
324
|
};
|
|
@@ -348,7 +348,7 @@ function removeProvider(config, providerId) {
|
|
|
348
348
|
visionFallback: config.visionFallback ?? {
|
|
349
349
|
enabled: false,
|
|
350
350
|
url: "http://localhost:11434",
|
|
351
|
-
model: "qwen3
|
|
351
|
+
model: "qwen3.5:0.8b",
|
|
352
352
|
timeout: 120
|
|
353
353
|
}
|
|
354
354
|
};
|
|
@@ -368,7 +368,7 @@ function activateProvider(config, providerId) {
|
|
|
368
368
|
visionFallback: config.visionFallback ?? {
|
|
369
369
|
enabled: false,
|
|
370
370
|
url: "http://localhost:11434",
|
|
371
|
-
model: "qwen3
|
|
371
|
+
model: "qwen3.5:0.8b",
|
|
372
372
|
timeout: 120
|
|
373
373
|
}
|
|
374
374
|
};
|
|
@@ -385,7 +385,7 @@ function activateProvider(config, providerId) {
|
|
|
385
385
|
visionFallback: config.visionFallback ?? {
|
|
386
386
|
enabled: false,
|
|
387
387
|
url: "http://localhost:11434",
|
|
388
|
-
model: "qwen3
|
|
388
|
+
model: "qwen3.5:0.8b",
|
|
389
389
|
timeout: 120
|
|
390
390
|
}
|
|
391
391
|
};
|
|
@@ -435,4 +435,4 @@ export {
|
|
|
435
435
|
activateProvider,
|
|
436
436
|
mergeConfigs
|
|
437
437
|
};
|
|
438
|
-
//# sourceMappingURL=chunk-
|
|
438
|
+
//# sourceMappingURL=chunk-YG2QBUYJ.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
var DEFAULT_CONFIG = {
|
|
7
7
|
enabled: false,
|
|
8
8
|
url: "http://localhost:11434",
|
|
9
|
-
model: "qwen3
|
|
9
|
+
model: "qwen3.5:0.8b",
|
|
10
10
|
timeout: 12e4
|
|
11
11
|
};
|
|
12
12
|
var config = { ...DEFAULT_CONFIG };
|
|
@@ -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-TSGOFNJW.js");
|
|
33
33
|
const { getRuntimeConfig } = await import("./runtime-config-CYHDAC7W.js");
|
|
34
34
|
const runtimeConfig = getRuntimeConfig();
|
|
35
35
|
const mode = runtimeConfig.mode ?? "production";
|
|
@@ -38,7 +38,7 @@ async function ensureVisionFallbackConfigLoaded() {
|
|
|
38
38
|
config = {
|
|
39
39
|
enabled: fallback.enabled ?? false,
|
|
40
40
|
url: fallback.url ?? "http://localhost:11434",
|
|
41
|
-
model: fallback.model ?? "qwen3
|
|
41
|
+
model: fallback.model ?? "qwen3.5:0.8b",
|
|
42
42
|
timeout: (fallback.timeout ?? 120) * 1e3
|
|
43
43
|
};
|
|
44
44
|
configLoaded = true;
|
|
@@ -137,4 +137,4 @@ export {
|
|
|
137
137
|
describeImage,
|
|
138
138
|
describeImageFromDataUrl
|
|
139
139
|
};
|
|
140
|
-
//# sourceMappingURL=chunk-
|
|
140
|
+
//# sourceMappingURL=chunk-Z774ZQUP.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
getToolRegistryForAgent,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
runTopLevelAgentLoop
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-32WAUDDK.js";
|
|
17
17
|
import {
|
|
18
18
|
getCurrentContextWindowId,
|
|
19
19
|
getEventStore
|
|
@@ -327,4 +327,4 @@ export {
|
|
|
327
327
|
runBuilderTurn,
|
|
328
328
|
runVerifierTurn
|
|
329
329
|
};
|
|
330
|
-
//# sourceMappingURL=chunk-
|
|
330
|
+
//# sourceMappingURL=chunk-ZK3EZTHT.js.map
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
clearModelCache,
|
|
3
3
|
createLLMClient,
|
|
4
4
|
detectModel
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TWGL3Y6S.js";
|
|
6
6
|
import {
|
|
7
7
|
detectBackend,
|
|
8
8
|
getModelProfile
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RMQ4WCEK.js";
|
|
10
10
|
import {
|
|
11
11
|
logger
|
|
12
12
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -511,4 +511,4 @@ export {
|
|
|
511
511
|
parseDefaultModelSelection,
|
|
512
512
|
createProviderManager
|
|
513
513
|
};
|
|
514
|
-
//# sourceMappingURL=chunk-
|
|
514
|
+
//# sourceMappingURL=chunk-ZV2PE3KT.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-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-YG2QBUYJ.js";
|
|
17
|
+
import "./chunk-TWGL3Y6S.js";
|
|
18
|
+
import "./chunk-RMQ4WCEK.js";
|
|
19
19
|
import "./chunk-CQGTEGKL.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-Z774ZQUP.js";
|
|
21
21
|
import "./chunk-K44MW7JJ.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-TSGOFNJW.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn,
|
|
5
5
|
runVerifierTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZK3EZTHT.js";
|
|
7
7
|
import {
|
|
8
8
|
TurnMetrics,
|
|
9
9
|
createChatDoneEvent,
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
createMessageStartEvent,
|
|
12
12
|
createToolCallEvent,
|
|
13
13
|
createToolResultEvent
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-32WAUDDK.js";
|
|
15
15
|
import "./chunk-PQCFNTFJ.js";
|
|
16
16
|
import "./chunk-ZHBL5G5X.js";
|
|
17
17
|
import "./chunk-DL6ZILAF.js";
|
|
18
18
|
import "./chunk-PBGOZMVY.js";
|
|
19
19
|
import "./chunk-VRGRAQDG.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-RMQ4WCEK.js";
|
|
21
21
|
import "./chunk-YTPPQK55.js";
|
|
22
22
|
import "./chunk-5GVCNVKV.js";
|
|
23
23
|
import "./chunk-XVWVAWSG.js";
|
|
@@ -26,7 +26,7 @@ import "./chunk-BJYPTN5S.js";
|
|
|
26
26
|
import "./chunk-ERFRUQQR.js";
|
|
27
27
|
import "./chunk-CQGTEGKL.js";
|
|
28
28
|
import "./chunk-RW25DL5R.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-Z774ZQUP.js";
|
|
30
30
|
import "./chunk-K44MW7JJ.js";
|
|
31
31
|
export {
|
|
32
32
|
TurnMetrics,
|
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
runChatTurn,
|
|
41
41
|
runVerifierTurn
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=orchestrator-
|
|
43
|
+
//# sourceMappingURL=orchestrator-5I4LBRSY.js.map
|
package/dist/package.json
CHANGED
|
@@ -177,7 +177,7 @@ var QueueProcessor = class {
|
|
|
177
177
|
backend: provider?.backend ?? llmClient.getBackend(),
|
|
178
178
|
model: llmClient.getModel()
|
|
179
179
|
};
|
|
180
|
-
const { runChatTurn } = await import("./orchestrator-
|
|
180
|
+
const { runChatTurn } = await import("./orchestrator-5I4LBRSY.js");
|
|
181
181
|
const runChatTurnParams = buildRunChatTurnParams({
|
|
182
182
|
sessionManager,
|
|
183
183
|
sessionId,
|
|
@@ -221,4 +221,4 @@ var QueueProcessor = class {
|
|
|
221
221
|
export {
|
|
222
222
|
QueueProcessor
|
|
223
223
|
};
|
|
224
|
-
//# sourceMappingURL=processor-
|
|
224
|
+
//# sourceMappingURL=processor-47OC5EUI.js.map
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
loadGlobalConfig,
|
|
6
6
|
removeProvider,
|
|
7
7
|
saveGlobalConfig
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YG2QBUYJ.js";
|
|
9
9
|
import {
|
|
10
10
|
fetchAvailableModelsFromBackend
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZV2PE3KT.js";
|
|
12
12
|
import {
|
|
13
13
|
detectModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TWGL3Y6S.js";
|
|
15
15
|
import {
|
|
16
16
|
detectBackend
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RMQ4WCEK.js";
|
|
18
18
|
import "./chunk-CQGTEGKL.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-Z774ZQUP.js";
|
|
20
20
|
import "./chunk-K44MW7JJ.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/provider.ts
|
|
@@ -248,7 +248,7 @@ async function runProviderAdd(mode) {
|
|
|
248
248
|
isActive: makeActive
|
|
249
249
|
});
|
|
250
250
|
if (makeActive) {
|
|
251
|
-
const { setDefaultModelSelection } = await import("./config-
|
|
251
|
+
const { setDefaultModelSelection } = await import("./config-TSGOFNJW.js");
|
|
252
252
|
newConfig = setDefaultModelSelection(
|
|
253
253
|
newConfig,
|
|
254
254
|
newConfig.providers[newConfig.providers.length - 1].id,
|
|
@@ -376,4 +376,4 @@ export {
|
|
|
376
376
|
runProviderRemove,
|
|
377
377
|
runProviderUse
|
|
378
378
|
};
|
|
379
|
-
//# sourceMappingURL=provider-
|
|
379
|
+
//# sourceMappingURL=provider-JIFQ47HT.js.map
|
|
@@ -2,21 +2,21 @@ import {
|
|
|
2
2
|
getActiveProvider,
|
|
3
3
|
getDefaultModel,
|
|
4
4
|
loadGlobalConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YG2QBUYJ.js";
|
|
6
6
|
import {
|
|
7
7
|
VERSION,
|
|
8
8
|
createServer
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-UAV33LRW.js";
|
|
10
|
+
import "./chunk-ZK3EZTHT.js";
|
|
11
|
+
import "./chunk-32WAUDDK.js";
|
|
12
12
|
import "./chunk-PQCFNTFJ.js";
|
|
13
13
|
import "./chunk-ZHBL5G5X.js";
|
|
14
14
|
import "./chunk-DL6ZILAF.js";
|
|
15
15
|
import "./chunk-PBGOZMVY.js";
|
|
16
16
|
import "./chunk-VRGRAQDG.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-ZV2PE3KT.js";
|
|
18
|
+
import "./chunk-TWGL3Y6S.js";
|
|
19
|
+
import "./chunk-RMQ4WCEK.js";
|
|
20
20
|
import "./chunk-YTPPQK55.js";
|
|
21
21
|
import "./chunk-5GVCNVKV.js";
|
|
22
22
|
import "./chunk-XVWVAWSG.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
loadConfig
|
|
34
34
|
} from "./chunk-RW25DL5R.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-Z774ZQUP.js";
|
|
36
36
|
import {
|
|
37
37
|
logger
|
|
38
38
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -190,4 +190,4 @@ async function runServe(options) {
|
|
|
190
190
|
export {
|
|
191
191
|
runServe
|
|
192
192
|
};
|
|
193
|
-
//# sourceMappingURL=serve-
|
|
193
|
+
//# sourceMappingURL=serve-JQTSGHFU.js.map
|
package/dist/server/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer,
|
|
3
3
|
createServerHandle
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-UAV33LRW.js";
|
|
5
|
+
import "../chunk-ZK3EZTHT.js";
|
|
6
|
+
import "../chunk-32WAUDDK.js";
|
|
7
7
|
import "../chunk-PQCFNTFJ.js";
|
|
8
8
|
import "../chunk-ZHBL5G5X.js";
|
|
9
9
|
import "../chunk-DL6ZILAF.js";
|
|
10
10
|
import "../chunk-PBGOZMVY.js";
|
|
11
11
|
import "../chunk-VRGRAQDG.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-ZV2PE3KT.js";
|
|
13
|
+
import "../chunk-TWGL3Y6S.js";
|
|
14
|
+
import "../chunk-RMQ4WCEK.js";
|
|
15
15
|
import "../chunk-YTPPQK55.js";
|
|
16
16
|
import "../chunk-5GVCNVKV.js";
|
|
17
17
|
import "../chunk-XVWVAWSG.js";
|
|
@@ -21,7 +21,7 @@ import "../chunk-RGRBWDZP.js";
|
|
|
21
21
|
import "../chunk-ERFRUQQR.js";
|
|
22
22
|
import "../chunk-CQGTEGKL.js";
|
|
23
23
|
import "../chunk-RW25DL5R.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-Z774ZQUP.js";
|
|
25
25
|
import "../chunk-K44MW7JJ.js";
|
|
26
26
|
export {
|
|
27
27
|
createServer,
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
requestPathAccess,
|
|
12
12
|
stepDoneTool,
|
|
13
13
|
validateToolAction
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-32WAUDDK.js";
|
|
15
15
|
import "./chunk-PQCFNTFJ.js";
|
|
16
16
|
import "./chunk-ZHBL5G5X.js";
|
|
17
17
|
import "./chunk-DL6ZILAF.js";
|
|
18
18
|
import "./chunk-PBGOZMVY.js";
|
|
19
19
|
import "./chunk-VRGRAQDG.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-RMQ4WCEK.js";
|
|
21
21
|
import "./chunk-YTPPQK55.js";
|
|
22
22
|
import "./chunk-5GVCNVKV.js";
|
|
23
23
|
import "./chunk-XVWVAWSG.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import "./chunk-ERFRUQQR.js";
|
|
31
31
|
import "./chunk-CQGTEGKL.js";
|
|
32
32
|
import "./chunk-RW25DL5R.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-Z774ZQUP.js";
|
|
34
34
|
import "./chunk-K44MW7JJ.js";
|
|
35
35
|
export {
|
|
36
36
|
AskUserInterrupt,
|
|
@@ -49,4 +49,4 @@ export {
|
|
|
49
49
|
stepDoneTool,
|
|
50
50
|
validateToolAction
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=tools-
|
|
52
|
+
//# sourceMappingURL=tools-U6I43EN4.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getVisionFallbackConfig,
|
|
8
8
|
isVisionFallbackEnabled,
|
|
9
9
|
setVisionFallbackConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Z774ZQUP.js";
|
|
11
11
|
import "./chunk-K44MW7JJ.js";
|
|
12
12
|
export {
|
|
13
13
|
clearDescriptionCache,
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
isVisionFallbackEnabled,
|
|
20
20
|
setVisionFallbackConfig
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=vision-fallback-
|
|
22
|
+
//# sourceMappingURL=vision-fallback-FBOTVWEX.js.map
|
|
@@ -173,4 +173,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
173
173
|
|
|
174
174
|
${ae}`:ae;(de=Y.current)==null||de.scrollTo({top:Y.current.scrollHeight,behavior:"smooth"}),N(xr,dt!=null&&dt.length?dt:void 0,{messageKind:"command",isSystemGenerated:!0}),Ae()},onSelectWorkflow:Bt,onOpenCommandsManager:()=>v(!0),onOpenWorkflowsManager:()=>_(!0),onAttach:Cn,textareaContent:r,attachments:o.length>0?o:void 0,criteria:(D==null?void 0:D.criteria)??[]})]})]})]}),l.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(II,{}),l.jsx(BI,{})]}),l.jsx(sB,{})]})]}),l.jsx(Hk,{isOpen:g,onClose:()=>v(!1)}),l.jsx(Uk,{isOpen:b,onClose:()=>_(!1)}),l.jsx(xB,{isOpen:S,onClose:()=>j(!1),onSearchMessages:()=>E(!0),isAutoScrollActive:ct,onToggleAutoScroll:ut,textareaContent:r,onCloseComplete:nw,onCloseCompleteAction:()=>window.dispatchEvent(new CustomEvent("open-session-dropdown")),onSelectCommand:async(ae,we)=>{const qe=await hn.getState().fetchCommand(ae);if(qe){const dt=we!=null&&we.trim()?`${we.trim()}
|
|
175
175
|
|
|
176
|
-
${qe.prompt}`:qe.prompt;qe.metadata.agentMode&&ye.getState().switchMode(qe.metadata.agentMode),N(dt,o!=null&&o.length?o:void 0,{messageKind:"command",isSystemGenerated:!0}),Ae()}},onSelectWorkflow:ae=>{const we=r.trim()||void 0,qe=o.length>0?o:void 0;(D==null?void 0:D.mode)==="planner"?ye.getState().acceptAndBuild(ae,we,qe):ye.getState().launchRunner(we,qe,ae),Ae()}})]}),C&&l.jsx(bB,{isOpen:C,onClose:()=>E(!1),messages:$,onSelectMessage:Re})]})}k.memo(function({item:t}){const[n,r]=k.useState(!1);return t.type==="start"?l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-amber-500/10 border border-amber-500/30 rounded text-amber-300 text-sm",children:[l.jsx("span",{className:"animate-pulse",children:"●"}),l.jsx("span",{children:"Delegating image to fallback vision model..."}),t.filename&&l.jsxs("span",{className:"text-amber-400/70",children:["(",t.filename,")"]})]}):l.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 bg-accent-success/10 border border-accent-success/30 rounded",children:[l.jsx("span",{className:"text-accent-success",children:"✓"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-accent-success text-sm",children:"Image description done"}),l.jsx("button",{type:"button",onClick:()=>r(!n),className:"text-xs text-accent-primary hover:text-accent-primary/80 transition-colors",children:n?"Hide":"Show"})]}),n&&t.description&&l.jsx("div",{className:"mt-2 text-xs prose prose-invert prose-sm max-w-none",children:l.jsx(Es,{content:t.description})})]})]})});function AS({isOpen:e,isRetry:t,onSubmit:n,onCancel:r}){const[a,o]=k.useState(""),u=k.useRef(null);k.useEffect(()=>{e&&(o(""),setTimeout(()=>{var p;return(p=u.current)==null?void 0:p.focus()},100))},[e]);const d=p=>{p.preventDefault(),a.trim()&&n(a)};return l.jsx(Et,{isOpen:e,onClose:r,title:t?"Invalid Password":"Password Required",size:"sm",children:l.jsxs("form",{onSubmit:d,className:"space-y-4",children:[l.jsx("p",{className:"text-text-secondary text-sm",children:t?"The password you entered was incorrect. Please try again.":"This server requires a password to connect."}),l.jsx(ad,{ref:u,type:"password",value:a,onChange:p=>o(p.target.value),placeholder:"Enter password",autoFocus:!0}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(Ye,{type:"button",variant:"secondary",onClick:r,children:"Cancel"}),l.jsx(Ye,{type:"submit",disabled:!a.trim(),children:t?"Try Again":"Connect"})]})]})})}const MB=[8e3,11434,8080],RB=[{name:"OpenCode Go",url:"https://opencode.ai/zen/go/v1",backend:"opencode-go"}];function DS(e){switch(e){case"vllm":return"vLLM";case"sglang":return"SGLang";case"ollama":return"Ollama";case"llamacpp":return"llama.cpp";case"openai":return"OpenAI";case"anthropic":return"Anthropic";case"opencode-go":return"OpenCode Go";case"auto":return"Auto";case"unknown":return"Unknown";default:return e}}function LB({currentStep:e,totalSteps:t,labels:n,onStepClick:r}){return l.jsx("div",{className:"flex justify-center py-6",children:l.jsx("div",{className:"flex items-center",children:Array.from({length:t},(a,o)=>{const u=o+1,d=u<e,p=u===e;return l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{onClick:()=>r==null?void 0:r(u),className:`size-8 rounded-full flex items-center justify-center text-sm font-medium transition-colors shrink-0 ${d?"bg-accent-primary text-text-primary hover:opacity-80":p?"bg-accent-primary text-text-primary":"bg-bg-tertiary text-text-muted"}`,children:d?"✓":u}),l.jsx("button",{onClick:()=>r==null?void 0:r(u),className:`ml-2 mr-4 text-sm whitespace-nowrap hidden sm:block ${p?"text-text-primary font-medium":"text-text-muted hover:text-text-secondary"}`,children:n[o]}),o<t-1&&l.jsx("div",{className:`w-12 sm:w-20 h-0.5 mr-4 ${d?"bg-accent-primary":"bg-border"}`})]},o)})})})}function OB({onNext:e}){const[t,n]=k.useState([]),[r,a]=k.useState([]),[o,u]=k.useState(!1),[d,p]=k.useState(""),[f,m]=k.useState(""),[g,v]=k.useState(""),[b,_]=k.useState("auto"),[S,j]=k.useState(!1),[C,E]=k.useState(null),[A,O]=k.useState(null),[z,B]=k.useState(null),[Y,ee]=k.useState("");k.useEffect(()=>{ie()},[]);async function ie(){try{const T=await ke("/api/providers");if(T.ok){const F=(await T.json()).providers.map(I=>({id:I.id,name:I.name,url:I.url,backend:I.backend,model:null,apiKey:I.apiKey}));n(F),a(F)}}catch{}}async function D(T){j(!0),E(null);const N=b!=="auto";try{const I=await(await ke("/api/providers/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:T,skipBackendDetection:N})})).json();I.success?(N||_(I.backend??"auto"),E({success:!0,model:I.model??void 0})):E({success:!1,error:I.error??"Connection failed"})}catch(F){E({success:!1,error:F instanceof Error?F.message:"Connection failed"})}j(!1)}function $(){if(!f)return;const T=d||`Provider ${r.length+1}`,N={id:`temp-${Date.now()}`,name:T,url:f,backend:C!=null&&C.success?b:"auto",model:C!=null&&C.success?C.model??null:null,apiKey:g||void 0};a([...r,N]),p(""),m(""),v(""),E(null)}function H(T){O(T),t.some(F=>F.id===T)?ke(`/api/providers/${T}`,{method:"DELETE"}).then(()=>{a(r.filter(F=>F.id!==T)),n(t.filter(F=>F.id!==T)),O(null)}).catch(()=>{O(null)}):(a(r.filter(F=>F.id!==T)),O(null))}async function U(){for(const N of r)(N.id.startsWith("temp-")||!t.some(F=>F.id===N.id))&&((await ke("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.name,url:N.url,backend:N.backend,model:N.model,apiKey:N.apiKey})})).ok||console.error("Failed to add provider",N));const T=r.filter(N=>!N.id.startsWith("temp-"));e({providers:T})}const q=r.length>0;return l.jsxs("div",{className:"max-w-xl mx-auto",children:[l.jsx("h2",{className:"text-2xl font-bold text-text-primary mb-2",children:"LLM Providers"}),l.jsx("p",{className:"text-text-secondary mb-8",children:"Manage your LLM server connections"}),l.jsxs("div",{className:"space-y-4",children:[r.length>0?l.jsx("div",{className:"space-y-2",children:r.map(T=>l.jsxs("div",{className:"flex items-center justify-between bg-bg-secondary rounded-lg p-4 border border-border",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"px-2 py-0.5 bg-accent-primary/25 text-accent-primary rounded text-xs font-medium",children:DS(T.backend)}),z===T.id?l.jsx("input",{type:"text",value:Y,onChange:N=>ee(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(a(r.map(F=>F.id===T.id?{...F,name:Y}:F)),B(null)),N.key==="Escape"&&B(null)},onBlur:()=>{a(r.map(N=>N.id===T.id?{...N,name:Y}:N)),B(null)},className:"px-2 py-0.5 bg-bg-primary border border-accent-primary rounded text-text-primary text-sm focus:outline-none",autoFocus:!0}):l.jsx("span",{className:"text-text-primary font-medium cursor-pointer hover:text-accent-primary",onClick:()=>{B(T.id),ee(T.name)},title:"Click to edit",children:T.name})]}),l.jsx("p",{className:"text-text-muted text-sm mt-1",children:T.url}),T.model&&l.jsxs("p",{className:"text-text-secondary text-xs mt-0.5",children:["Model: ",T.model]})]}),l.jsx("button",{onClick:()=>H(T.id),disabled:A===T.id,className:"p-2 text-text-muted hover:text-red-500 transition-colors disabled:opacity-50",title:"Remove provider",children:l.jsx(Ju,{})})]},T.id))}):l.jsx("div",{className:"bg-bg-secondary rounded-lg p-8 text-center border border-border",children:l.jsx("p",{className:"text-text-muted",children:"No providers configured yet"})}),o?l.jsxs("form",{onSubmit:T=>{T.preventDefault(),f&&$()},className:"space-y-4 p-4 bg-bg-tertiary rounded-lg",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-2",children:"Service Presets"}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:RB.map(T=>l.jsx("button",{type:"button",onClick:()=>{p(T.name),m(T.url),_(T.backend),E(null)},className:`p-2 rounded border text-center text-sm transition-colors ${f===T.url?"border-accent-primary bg-accent-primary/10 text-accent-primary":"border-border hover:border-text-muted text-text-secondary"}`,children:T.name},T.name))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-2",children:"Local Presets"}),l.jsx("div",{className:"grid grid-cols-3 gap-2",children:MB.map(T=>l.jsxs("button",{type:"button",onClick:()=>{p(""),m(`http://localhost:${T}`),_("auto"),E(null)},className:`p-2 rounded border text-center text-sm transition-colors ${f===`http://localhost:${T}`?"border-accent-primary bg-accent-primary/10 text-accent-primary":"border-border hover:border-text-muted text-text-secondary"}`,children:["localhost:",T]},T))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Or enter address manually"}),l.jsx("input",{type:"text",name:"url",value:f,onChange:T=>{m(T.target.value),E(null)},onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),D(f))},placeholder:"http://localhost:8000","data-testid":"onboarding-provider-url-input",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Provider name (optional)"}),l.jsx("input",{type:"text",name:"name",value:d,onChange:T=>p(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),$())},placeholder:"My LLM Server",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"API key (optional)"}),l.jsx("input",{type:"password",name:"apiKey",value:g,onChange:T=>v(T.target.value),placeholder:"sk-...",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]}),C&&l.jsx("div",{className:`p-3 rounded-lg ${C.success?"bg-accent-primary/10":"bg-red-500/10"}`,children:C.success?l.jsxs("p",{className:"text-accent-primary font-medium",children:["✓ Connected to ",DS(b),C.model&&` (${C.model})`]}):l.jsx("p",{className:"text-red-500",children:C.error})}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{type:"button",onClick:()=>D(f),disabled:!f||S,"data-testid":"onboarding-test-connection-button",className:"flex-1 px-4 py-2 bg-bg-secondary border border-border rounded-lg hover:border-text-muted disabled:opacity-50",children:S?l.jsx(Ga,{className:"w-4 h-4"}):"Test Connection"}),l.jsx("button",{type:"submit",disabled:!f,"data-testid":"onboarding-add-provider-submit-button",className:"flex-1 px-4 py-2 bg-accent-primary text-text-primary rounded-lg hover:bg-accent-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors font-medium",children:C!=null&&C.success?"Add Provider ✓":"Add Provider"})]}),l.jsx("button",{type:"button",onClick:()=>{u(!1),p(""),m(""),E(null)},className:"w-full text-center text-text-muted hover:text-text-secondary text-sm",children:"Cancel"})]}):l.jsxs("button",{onClick:()=>u(!0),"data-testid":"onboarding-add-provider-button",className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-bg-secondary border border-dashed border-border rounded-lg text-text-secondary hover:text-text-primary hover:border-text-muted transition-colors",children:[l.jsx(Ga,{className:"w-4 h-4"}),"Add Provider"]}),l.jsx("button",{onClick:U,disabled:!q,"data-testid":"onboarding-continue-button",className:"w-full mt-6 px-6 py-3 bg-accent-primary text-text-primary rounded-lg font-medium hover:bg-accent-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Continue"})]})]})}function IB({onNext:e}){const[t,n]=k.useState(""),[r,a]=k.useState(!1);return k.useEffect(()=>{ke("/api/config").then(o=>o.json()).then(o=>{o.workdir?n(o.workdir):fetch("/api/directories?path="+encodeURIComponent("/home")).then(u=>u.json()).then(u=>{u.current&&n(u.current)}).catch(()=>{})}).catch(()=>{fetch("/api/directories?path="+encodeURIComponent("/home")).then(o=>o.json()).then(o=>{o.current&&n(o.current)}).catch(()=>{})})},[]),l.jsxs("div",{className:"max-w-xl mx-auto",children:[l.jsx("h2",{className:"text-2xl font-bold text-text-primary mb-2",children:"Your Projects Folder"}),l.jsx("p",{className:"text-text-secondary mb-8",children:"Where should OpenFox create project folders?"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Workspace directory"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),placeholder:"/home/user/projects","data-testid":"onboarding-workdir-input",className:"flex-1 px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"}),l.jsx("button",{onClick:()=>a(!0),className:"px-4 py-2 bg-bg-secondary border border-border rounded-lg hover:border-text-muted",children:"Browse"})]})]}),r&&l.jsx(cw,{initialPath:t||void 0,onSelect:o=>{n(o),a(!1)},onClose:()=>a(!1)}),l.jsx("button",{onClick:()=>e({workdir:t}),disabled:!t,"data-testid":"onboarding-workdir-continue-button",className:"w-full mt-6 px-6 py-3 bg-accent-primary text-text-primary rounded-lg font-medium hover:bg-accent-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Continue"})]})]})}function BB({onNext:e}){const[t,n]=k.useState(!1),[r,a]=k.useState("http://localhost:11434"),[o,u]=k.useState("qwen3-vl:2b"),{copied:d,copy:p}=Mk();k.useEffect(()=>{ke("/api/config").then(m=>m.json()).then(m=>{m.visionFallback&&(n(m.visionFallback.enabled),a(m.visionFallback.url),u(m.visionFallback.model))}).catch(()=>{})},[]);function f(m){if(m){e({});return}e({visionFallback:{enabled:t,url:r,model:o,timeout:120}})}return l.jsxs("div",{className:"max-w-xl mx-auto",children:[l.jsx("h2",{className:"text-2xl font-bold text-text-primary mb-2",children:"Vision (Optional)"}),l.jsx("p",{className:"text-text-secondary mb-8",children:"Configure a vision model for non-vision models"}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"bg-bg-secondary rounded-lg p-4 border border-border",children:[l.jsx("p",{className:"text-text-secondary text-sm mb-2",children:"To enable vision support, you need an Ollama server with a vision model:"}),l.jsx("a",{href:"https://ollama.com/download",target:"_blank",rel:"noopener noreferrer",className:"text-accent-primary hover:underline text-sm",children:"Download Ollama"}),l.jsxs("div",{className:"mt-3 p-2 bg-bg-primary rounded border border-border flex items-center justify-between gap-2",children:[l.jsx("code",{className:"text-text-secondary text-xs",children:"ollama pull qwen3-vl:2b"}),l.jsx("button",{onClick:()=>p("ollama pull qwen3-vl:2b"),className:"text-text-muted hover:text-text-primary transition-colors",title:"Copy",children:d?l.jsx(ns,{className:"w-4 h-4 text-accent-primary"}):l.jsx(Sj,{className:"w-4 h-4"})})]})]}),l.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:t,onChange:m=>n(m.target.checked),className:"w-5 h-5 rounded border-border bg-bg-secondary text-accent-primary focus:ring-accent-primary"}),l.jsx("span",{className:"text-text-primary",children:"Enable vision fallback for non-vision models"})]}),t&&l.jsxs("div",{className:"space-y-4 pl-8",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Vision server URL"}),l.jsx("input",{type:"text",value:r,onChange:m=>a(m.target.value),placeholder:"http://localhost:11434",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Vision model name"}),l.jsx("input",{type:"text",value:o,onChange:m=>u(m.target.value),placeholder:"qwen3-vl:2b",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]})]}),l.jsxs("div",{className:"flex items-center justify-between pt-4",children:[l.jsx("button",{onClick:()=>f(!0),"data-testid":"onboarding-skip-button",className:"text-text-muted hover:text-text-secondary text-sm underline",children:"Skip for now"}),l.jsx("button",{onClick:()=>f(!1),className:"px-6 py-3 bg-accent-primary text-text-primary rounded-lg font-medium hover:bg-accent-primary/90 transition-colors",children:"Finish Setup"})]})]})]})}function zB({onComplete:e}){const[t,n]=k.useState(1),[r,a]=k.useState(!1),[o,u]=k.useState({});async function d(g){u(v=>({...v,providers:g.providers})),n(2)}async function p(g){u(v=>({...v,...g})),n(3)}async function f(g){a(!0);try{if(!(await ke("/api/init/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workdir:o.workdir,visionFallback:g.visionFallback})})).ok)throw new Error("Failed to save config");e()}catch(v){console.error("Failed to save onboarding data:",v),a(!1)}}const m=g=>{n(g)};return l.jsxs("div",{className:"w-full max-w-xl mx-auto px-6 py-16 relative",children:[l.jsx($l,{onClick:e,className:"absolute top-4 right-4 p-2",variant:"modal",size:"xl"}),l.jsx(LB,{currentStep:t,totalSteps:3,labels:["LLM Server","Projects Folder","Vision"],onStepClick:m}),l.jsx("div",{className:"max-w-xl mx-auto",children:r?l.jsxs("div",{className:"text-center",children:[l.jsx(Ga,{className:"w-6 h-6"}),l.jsx("p",{className:"mt-4 text-text-secondary",children:"Saving your settings..."})]}):l.jsxs(l.Fragment,{children:[t===1&&l.jsx(OB,{onNext:d}),t===2&&l.jsx(IB,{onNext:p}),t===3&&l.jsx(BB,{onNext:f})]})})]})}const MS="openfox_updated_to",RS="update_pending";function PB(){const[e,t]=k.useState(!1),n=localStorage.getItem(MS),r=localStorage.getItem(RS);k.useEffect(()=>{if(!n||!r)return;const o=setTimeout(()=>t(!0),3e4);return()=>clearTimeout(o)},[n,r]);const a=()=>{localStorage.removeItem(MS),localStorage.removeItem(RS),t(!0)};return e||r!=="true"||!n?null:l.jsxs("div",{className:"fixed bottom-20 left-1/2 -translate-x-1/2 z-[100] flex items-center gap-3 px-4 py-2.5 bg-bg-secondary border border-border rounded-lg shadow-xl animate-slide-down",role:"status","aria-live":"polite",children:[l.jsx("div",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-accent-primary/20",children:l.jsx(ns,{className:"w-3 h-3 text-accent-primary"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"text-sm font-medium text-text-primary",children:"OpenFox updated successfully"}),l.jsxs("span",{className:"text-xs text-text-muted",children:["Now running ",n]})]}),l.jsx("button",{onClick:a,className:"ml-2 p-1 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors","aria-label":"Dismiss",children:l.jsx(s1,{className:"w-3.5 h-3.5"})})]})}typeof window<"u"&&(yn.getState().loadUserPresets(),yn.getState().applySavedTheme());function zg(){return typeof window>"u"?!1:localStorage.getItem("openfox_token")!==null}function Vk(){return l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(Ul,{})})}function HB({sidebarOpen:e,onSidebarToggle:t}){const[,n]=Dm("/p/:projectId"),r=n==null?void 0:n.projectId,a=ye(f=>f.connectionStatus),o=ye(f=>f.clearSession),u=Ut(f=>f.currentProject),d=zg(),p=a==="connected"||d;return k.useEffect(()=>{p&&r&&(u==null?void 0:u.id)!==r&&Ut.getState().loadProject(r),p&&r&&(ye.getState().listSessions(r),o())},[p,r,u==null?void 0:u.id,o]),!u||u.id!==r?l.jsx(Vk,{}):l.jsxs(l.Fragment,{children:[l.jsx(aw,{projectId:r,isOpen:e,onClose:t}),l.jsx("div",{className:"flex-1 min-w-0 bg-primary",children:l.jsx(B3,{})})]})}function FB({sidebarOpen:e,onSidebarToggle:t,rightSidebarOpen:n,onRightSidebarToggle:r}){const[,a]=Dm("/p/:projectId/s/:sessionId"),o=a==null?void 0:a.projectId,u=a==null?void 0:a.sessionId,[,d]=Hr(),p=ye(A=>A.connectionStatus),f=ye(A=>A.currentSession),m=ye(A=>A.loadSession),g=ye(A=>A.listSessions),v=ye(A=>A.pendingSessionCreate),b=ye(A=>A.error),_=ye(A=>A.clearError),S=Ut(A=>A.currentProject),j=Ut(A=>A.loadProject),C=zg(),E=p==="connected"||C;return k.useEffect(()=>{E&&o&&(S==null?void 0:S.id)!==o&&j(o),E&&u&&(f==null?void 0:f.id)!==u&&m(u),E&&o&&g(o)},[E,o,S==null?void 0:S.id,j,u,f==null?void 0:f.id,m,g,v]),k.useEffect(()=>{(b==null?void 0:b.code)==="NOT_FOUND"&&o&&(_(),d(`/p/${o}`))},[b,o,_,d]),!S||S.id!==o?l.jsx(Vk,{}):l.jsxs(l.Fragment,{children:[l.jsx(aw,{projectId:o,isOpen:e,onClose:t}),l.jsx("div",{className:"flex-1 min-w-0 bg-primary",children:l.jsx(DB,{criteriaSidebarOpen:n,onCriteriaSidebarToggle:r})})]})}function $B(){const e=Mt(n=>n.fetchConfig);function t(){e(),window.history.back()}return l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsx(zB,{onComplete:t})})}function UB(){const{connectionStatus:e}=mj(),t=Mt(N=>N.fetchConfig),n=Mt(N=>N.refreshProviderModels),r=wn(N=>N.getSetting),a=Mt(N=>N.providers),o=Mt(N=>N.activeProviderId),[,u]=Hr(),d=zg(),[p,f]=k.useState(!1);k.useEffect(()=>{(e==="connected"||d)&&t().then(()=>{f(!0);for(const N of zS)r(N);r(Qe.DISPLAY_THEME),r(Qe.DISPLAY_USER_PRESETS)})},[e,d,t,r]),k.useEffect(()=>{p&&o&&n(o).then(()=>{const N=Mt.getState().defaultModelSelection;(N?N.split("/")[0]:null)!==o&&t()})},[p,o,n,t]);const m=wn(N=>N.settings);k.useEffect(()=>{p&&a.length===0&&u("/onboarding")},[p,a.length]),k.useEffect(()=>{const{applyPreset:N,applyTokens:F}=yn.getState(),I=m[Qe.DISPLAY_THEME],J=m[Qe.DISPLAY_USER_PRESETS];if(J&&localStorage.setItem("openfox:userPresets",J),I){localStorage.setItem("openfox:theme",I);try{const R=JSON.parse(I);R.preset&&R.tokens?(N(R.preset),yn.setState({basePreset:R.preset}),F(R.tokens)):R.preset?N(R.preset):R.tokens&&F(R.tokens)}catch{N("dark")}}else N("dark")},[m[Qe.DISPLAY_THEME],m[Qe.DISPLAY_USER_PRESETS]]);const g=()=>{const N=localStorage.getItem("openfox:leftSidebar");return N!==null?N==="true":!0},v=()=>{const N=localStorage.getItem("openfox:rightSidebar");return N!==null?N==="true":!0},[b,_]=k.useState(g),[S,j]=k.useState(v),[C,E]=k.useState(!1),[A,O]=k.useState(!1),[z,B]=k.useState(!1),Y=SN();k.useEffect(()=>{const N=()=>{B(window.innerWidth<768)};return N(),window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[]);const ee=z?C:b,ie=z?A:S,D=()=>{z?E(!C):_(!b)},$=()=>{z?O(!A):j(!S)};k.useEffect(()=>{z||localStorage.setItem("openfox:leftSidebar",String(b))},[b,z]),k.useEffect(()=>{z||localStorage.setItem("openfox:rightSidebar",String(S))},[S,z]),k.useEffect(()=>{(e==="connected"||d)&&t()},[e,t,d]);const H=ye(N=>N.showPasswordModal),U=ye(N=>N.passwordModalRetry),q=ye(N=>N.submitPassword),T=ye(N=>N.cancelPassword);return e!=="connected"&&!H&&!d?l.jsxs(l.Fragment,{children:[l.jsx(AS,{isOpen:!0,isRetry:U,onSubmit:q,onCancel:T}),l.jsx("div",{className:"h-screen flex items-center justify-center",children:l.jsx(R3,{text:"Connecting to server..."})})]}):l.jsxs(l.Fragment,{children:[l.jsx(AS,{isOpen:H,isRetry:U,onSubmit:q,onCancel:T}),l.jsxs("div",{className:"flex flex-col",style:{height:z?`calc(${Y.offsetTop}px + ${Y.height}px)`:"100vh"},children:[l.jsx(E3,{}),l.jsx(S3,{onMenuClick:D,onCriteriaToggle:$}),l.jsx("div",{className:"flex-1 flex overflow-hidden",children:l.jsxs(WN,{children:[l.jsx(Xo,{path:"/onboarding",children:l.jsx($B,{})}),l.jsx(Xo,{path:"/p/:projectId/s/:sessionId",children:l.jsx(FB,{sidebarOpen:ee,onSidebarToggle:D,rightSidebarOpen:ie,onRightSidebarToggle:$})}),l.jsx(Xo,{path:"/p/:projectId/new",children:l.jsx(I3,{})}),l.jsx(Xo,{path:"/p/:projectId",children:l.jsx(HB,{sidebarOpen:ee,onSidebarToggle:D})}),l.jsx(Xo,{path:"/",children:l.jsx(O3,{})})]})})]}),l.jsx(PB,{})]})}xN.createRoot(document.getElementById("root")).render(l.jsx(zn.StrictMode,{children:l.jsx(UB,{})}));
|
|
176
|
+
${qe.prompt}`:qe.prompt;qe.metadata.agentMode&&ye.getState().switchMode(qe.metadata.agentMode),N(dt,o!=null&&o.length?o:void 0,{messageKind:"command",isSystemGenerated:!0}),Ae()}},onSelectWorkflow:ae=>{const we=r.trim()||void 0,qe=o.length>0?o:void 0;(D==null?void 0:D.mode)==="planner"?ye.getState().acceptAndBuild(ae,we,qe):ye.getState().launchRunner(we,qe,ae),Ae()}})]}),C&&l.jsx(bB,{isOpen:C,onClose:()=>E(!1),messages:$,onSelectMessage:Re})]})}k.memo(function({item:t}){const[n,r]=k.useState(!1);return t.type==="start"?l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-amber-500/10 border border-amber-500/30 rounded text-amber-300 text-sm",children:[l.jsx("span",{className:"animate-pulse",children:"●"}),l.jsx("span",{children:"Delegating image to fallback vision model..."}),t.filename&&l.jsxs("span",{className:"text-amber-400/70",children:["(",t.filename,")"]})]}):l.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 bg-accent-success/10 border border-accent-success/30 rounded",children:[l.jsx("span",{className:"text-accent-success",children:"✓"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-accent-success text-sm",children:"Image description done"}),l.jsx("button",{type:"button",onClick:()=>r(!n),className:"text-xs text-accent-primary hover:text-accent-primary/80 transition-colors",children:n?"Hide":"Show"})]}),n&&t.description&&l.jsx("div",{className:"mt-2 text-xs prose prose-invert prose-sm max-w-none",children:l.jsx(Es,{content:t.description})})]})]})});function AS({isOpen:e,isRetry:t,onSubmit:n,onCancel:r}){const[a,o]=k.useState(""),u=k.useRef(null);k.useEffect(()=>{e&&(o(""),setTimeout(()=>{var p;return(p=u.current)==null?void 0:p.focus()},100))},[e]);const d=p=>{p.preventDefault(),a.trim()&&n(a)};return l.jsx(Et,{isOpen:e,onClose:r,title:t?"Invalid Password":"Password Required",size:"sm",children:l.jsxs("form",{onSubmit:d,className:"space-y-4",children:[l.jsx("p",{className:"text-text-secondary text-sm",children:t?"The password you entered was incorrect. Please try again.":"This server requires a password to connect."}),l.jsx(ad,{ref:u,type:"password",value:a,onChange:p=>o(p.target.value),placeholder:"Enter password",autoFocus:!0}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(Ye,{type:"button",variant:"secondary",onClick:r,children:"Cancel"}),l.jsx(Ye,{type:"submit",disabled:!a.trim(),children:t?"Try Again":"Connect"})]})]})})}const MB=[8e3,11434,8080],RB=[{name:"OpenCode Go",url:"https://opencode.ai/zen/go/v1",backend:"opencode-go"}];function DS(e){switch(e){case"vllm":return"vLLM";case"sglang":return"SGLang";case"ollama":return"Ollama";case"llamacpp":return"llama.cpp";case"openai":return"OpenAI";case"anthropic":return"Anthropic";case"opencode-go":return"OpenCode Go";case"auto":return"Auto";case"unknown":return"Unknown";default:return e}}function LB({currentStep:e,totalSteps:t,labels:n,onStepClick:r}){return l.jsx("div",{className:"flex justify-center py-6",children:l.jsx("div",{className:"flex items-center",children:Array.from({length:t},(a,o)=>{const u=o+1,d=u<e,p=u===e;return l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{onClick:()=>r==null?void 0:r(u),className:`size-8 rounded-full flex items-center justify-center text-sm font-medium transition-colors shrink-0 ${d?"bg-accent-primary text-text-primary hover:opacity-80":p?"bg-accent-primary text-text-primary":"bg-bg-tertiary text-text-muted"}`,children:d?"✓":u}),l.jsx("button",{onClick:()=>r==null?void 0:r(u),className:`ml-2 mr-4 text-sm whitespace-nowrap hidden sm:block ${p?"text-text-primary font-medium":"text-text-muted hover:text-text-secondary"}`,children:n[o]}),o<t-1&&l.jsx("div",{className:`w-12 sm:w-20 h-0.5 mr-4 ${d?"bg-accent-primary":"bg-border"}`})]},o)})})})}function OB({onNext:e}){const[t,n]=k.useState([]),[r,a]=k.useState([]),[o,u]=k.useState(!1),[d,p]=k.useState(""),[f,m]=k.useState(""),[g,v]=k.useState(""),[b,_]=k.useState("auto"),[S,j]=k.useState(!1),[C,E]=k.useState(null),[A,O]=k.useState(null),[z,B]=k.useState(null),[Y,ee]=k.useState("");k.useEffect(()=>{ie()},[]);async function ie(){try{const T=await ke("/api/providers");if(T.ok){const F=(await T.json()).providers.map(I=>({id:I.id,name:I.name,url:I.url,backend:I.backend,model:null,apiKey:I.apiKey}));n(F),a(F)}}catch{}}async function D(T){j(!0),E(null);const N=b!=="auto";try{const I=await(await ke("/api/providers/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:T,skipBackendDetection:N})})).json();I.success?(N||_(I.backend??"auto"),E({success:!0,model:I.model??void 0})):E({success:!1,error:I.error??"Connection failed"})}catch(F){E({success:!1,error:F instanceof Error?F.message:"Connection failed"})}j(!1)}function $(){if(!f)return;const T=d||`Provider ${r.length+1}`,N={id:`temp-${Date.now()}`,name:T,url:f,backend:C!=null&&C.success?b:"auto",model:C!=null&&C.success?C.model??null:null,apiKey:g||void 0};a([...r,N]),p(""),m(""),v(""),E(null)}function H(T){O(T),t.some(F=>F.id===T)?ke(`/api/providers/${T}`,{method:"DELETE"}).then(()=>{a(r.filter(F=>F.id!==T)),n(t.filter(F=>F.id!==T)),O(null)}).catch(()=>{O(null)}):(a(r.filter(F=>F.id!==T)),O(null))}async function U(){for(const N of r)(N.id.startsWith("temp-")||!t.some(F=>F.id===N.id))&&((await ke("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.name,url:N.url,backend:N.backend,model:N.model,apiKey:N.apiKey})})).ok||console.error("Failed to add provider",N));const T=r.filter(N=>!N.id.startsWith("temp-"));e({providers:T})}const q=r.length>0;return l.jsxs("div",{className:"max-w-xl mx-auto",children:[l.jsx("h2",{className:"text-2xl font-bold text-text-primary mb-2",children:"LLM Providers"}),l.jsx("p",{className:"text-text-secondary mb-8",children:"Manage your LLM server connections"}),l.jsxs("div",{className:"space-y-4",children:[r.length>0?l.jsx("div",{className:"space-y-2",children:r.map(T=>l.jsxs("div",{className:"flex items-center justify-between bg-bg-secondary rounded-lg p-4 border border-border",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"px-2 py-0.5 bg-accent-primary/25 text-accent-primary rounded text-xs font-medium",children:DS(T.backend)}),z===T.id?l.jsx("input",{type:"text",value:Y,onChange:N=>ee(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(a(r.map(F=>F.id===T.id?{...F,name:Y}:F)),B(null)),N.key==="Escape"&&B(null)},onBlur:()=>{a(r.map(N=>N.id===T.id?{...N,name:Y}:N)),B(null)},className:"px-2 py-0.5 bg-bg-primary border border-accent-primary rounded text-text-primary text-sm focus:outline-none",autoFocus:!0}):l.jsx("span",{className:"text-text-primary font-medium cursor-pointer hover:text-accent-primary",onClick:()=>{B(T.id),ee(T.name)},title:"Click to edit",children:T.name})]}),l.jsx("p",{className:"text-text-muted text-sm mt-1",children:T.url}),T.model&&l.jsxs("p",{className:"text-text-secondary text-xs mt-0.5",children:["Model: ",T.model]})]}),l.jsx("button",{onClick:()=>H(T.id),disabled:A===T.id,className:"p-2 text-text-muted hover:text-red-500 transition-colors disabled:opacity-50",title:"Remove provider",children:l.jsx(Ju,{})})]},T.id))}):l.jsx("div",{className:"bg-bg-secondary rounded-lg p-8 text-center border border-border",children:l.jsx("p",{className:"text-text-muted",children:"No providers configured yet"})}),o?l.jsxs("form",{onSubmit:T=>{T.preventDefault(),f&&$()},className:"space-y-4 p-4 bg-bg-tertiary rounded-lg",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-2",children:"Service Presets"}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:RB.map(T=>l.jsx("button",{type:"button",onClick:()=>{p(T.name),m(T.url),_(T.backend),E(null)},className:`p-2 rounded border text-center text-sm transition-colors ${f===T.url?"border-accent-primary bg-accent-primary/10 text-accent-primary":"border-border hover:border-text-muted text-text-secondary"}`,children:T.name},T.name))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-2",children:"Local Presets"}),l.jsx("div",{className:"grid grid-cols-3 gap-2",children:MB.map(T=>l.jsxs("button",{type:"button",onClick:()=>{p(""),m(`http://localhost:${T}`),_("auto"),E(null)},className:`p-2 rounded border text-center text-sm transition-colors ${f===`http://localhost:${T}`?"border-accent-primary bg-accent-primary/10 text-accent-primary":"border-border hover:border-text-muted text-text-secondary"}`,children:["localhost:",T]},T))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Or enter address manually"}),l.jsx("input",{type:"text",name:"url",value:f,onChange:T=>{m(T.target.value),E(null)},onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),D(f))},placeholder:"http://localhost:8000","data-testid":"onboarding-provider-url-input",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Provider name (optional)"}),l.jsx("input",{type:"text",name:"name",value:d,onChange:T=>p(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),$())},placeholder:"My LLM Server",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"API key (optional)"}),l.jsx("input",{type:"password",name:"apiKey",value:g,onChange:T=>v(T.target.value),placeholder:"sk-...",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]}),C&&l.jsx("div",{className:`p-3 rounded-lg ${C.success?"bg-accent-primary/10":"bg-red-500/10"}`,children:C.success?l.jsxs("p",{className:"text-accent-primary font-medium",children:["✓ Connected to ",DS(b),C.model&&` (${C.model})`]}):l.jsx("p",{className:"text-red-500",children:C.error})}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{type:"button",onClick:()=>D(f),disabled:!f||S,"data-testid":"onboarding-test-connection-button",className:"flex-1 px-4 py-2 bg-bg-secondary border border-border rounded-lg hover:border-text-muted disabled:opacity-50",children:S?l.jsx(Ga,{className:"w-4 h-4"}):"Test Connection"}),l.jsx("button",{type:"submit",disabled:!f,"data-testid":"onboarding-add-provider-submit-button",className:"flex-1 px-4 py-2 bg-accent-primary text-text-primary rounded-lg hover:bg-accent-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors font-medium",children:C!=null&&C.success?"Add Provider ✓":"Add Provider"})]}),l.jsx("button",{type:"button",onClick:()=>{u(!1),p(""),m(""),E(null)},className:"w-full text-center text-text-muted hover:text-text-secondary text-sm",children:"Cancel"})]}):l.jsxs("button",{onClick:()=>u(!0),"data-testid":"onboarding-add-provider-button",className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-bg-secondary border border-dashed border-border rounded-lg text-text-secondary hover:text-text-primary hover:border-text-muted transition-colors",children:[l.jsx(Ga,{className:"w-4 h-4"}),"Add Provider"]}),l.jsx("button",{onClick:U,disabled:!q,"data-testid":"onboarding-continue-button",className:"w-full mt-6 px-6 py-3 bg-accent-primary text-text-primary rounded-lg font-medium hover:bg-accent-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Continue"})]})]})}function IB({onNext:e}){const[t,n]=k.useState(""),[r,a]=k.useState(!1);return k.useEffect(()=>{ke("/api/config").then(o=>o.json()).then(o=>{o.workdir?n(o.workdir):fetch("/api/directories?path="+encodeURIComponent("/home")).then(u=>u.json()).then(u=>{u.current&&n(u.current)}).catch(()=>{})}).catch(()=>{fetch("/api/directories?path="+encodeURIComponent("/home")).then(o=>o.json()).then(o=>{o.current&&n(o.current)}).catch(()=>{})})},[]),l.jsxs("div",{className:"max-w-xl mx-auto",children:[l.jsx("h2",{className:"text-2xl font-bold text-text-primary mb-2",children:"Your Projects Folder"}),l.jsx("p",{className:"text-text-secondary mb-8",children:"Where should OpenFox create project folders?"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Workspace directory"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),placeholder:"/home/user/projects","data-testid":"onboarding-workdir-input",className:"flex-1 px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"}),l.jsx("button",{onClick:()=>a(!0),className:"px-4 py-2 bg-bg-secondary border border-border rounded-lg hover:border-text-muted",children:"Browse"})]})]}),r&&l.jsx(cw,{initialPath:t||void 0,onSelect:o=>{n(o),a(!1)},onClose:()=>a(!1)}),l.jsx("button",{onClick:()=>e({workdir:t}),disabled:!t,"data-testid":"onboarding-workdir-continue-button",className:"w-full mt-6 px-6 py-3 bg-accent-primary text-text-primary rounded-lg font-medium hover:bg-accent-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Continue"})]})]})}function BB({onNext:e}){const[t,n]=k.useState(!1),[r,a]=k.useState("http://localhost:11434"),[o,u]=k.useState("qwen3.5:0.8b"),{copied:d,copy:p}=Mk();k.useEffect(()=>{ke("/api/config").then(m=>m.json()).then(m=>{m.visionFallback&&(n(m.visionFallback.enabled),a(m.visionFallback.url),u(m.visionFallback.model))}).catch(()=>{})},[]);function f(m){if(m){e({});return}e({visionFallback:{enabled:t,url:r,model:o,timeout:120}})}return l.jsxs("div",{className:"max-w-xl mx-auto",children:[l.jsx("h2",{className:"text-2xl font-bold text-text-primary mb-2",children:"Vision (Optional)"}),l.jsx("p",{className:"text-text-secondary mb-8",children:"Configure a vision model for non-vision models"}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"bg-bg-secondary rounded-lg p-4 border border-border",children:[l.jsx("p",{className:"text-text-secondary text-sm mb-2",children:"To enable vision support, you need an Ollama server with a vision model:"}),l.jsx("a",{href:"https://ollama.com/download",target:"_blank",rel:"noopener noreferrer",className:"text-accent-primary hover:underline text-sm",children:"Download Ollama"}),l.jsxs("div",{className:"mt-3 p-2 bg-bg-primary rounded border border-border flex items-center justify-between gap-2",children:[l.jsx("code",{className:"text-text-secondary text-xs",children:"ollama pull qwen3.5:0.8b"}),l.jsx("button",{onClick:()=>p("ollama pull qwen3.5:0.8b"),className:"text-text-muted hover:text-text-primary transition-colors",title:"Copy",children:d?l.jsx(ns,{className:"w-4 h-4 text-accent-primary"}):l.jsx(Sj,{className:"w-4 h-4"})})]})]}),l.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:t,onChange:m=>n(m.target.checked),className:"w-5 h-5 rounded border-border bg-bg-secondary text-accent-primary focus:ring-accent-primary"}),l.jsx("span",{className:"text-text-primary",children:"Enable vision fallback for non-vision models"})]}),t&&l.jsxs("div",{className:"space-y-4 pl-8",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Vision server URL"}),l.jsx("input",{type:"text",value:r,onChange:m=>a(m.target.value),placeholder:"http://localhost:11434",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm text-text-secondary mb-1",children:"Vision model name"}),l.jsx("input",{type:"text",value:o,onChange:m=>u(m.target.value),placeholder:"qwen3.5:0.8b",className:"w-full px-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:border-accent-primary"})]})]}),l.jsxs("div",{className:"flex items-center justify-between pt-4",children:[l.jsx("button",{onClick:()=>f(!0),"data-testid":"onboarding-skip-button",className:"text-text-muted hover:text-text-secondary text-sm underline",children:"Skip for now"}),l.jsx("button",{onClick:()=>f(!1),className:"px-6 py-3 bg-accent-primary text-text-primary rounded-lg font-medium hover:bg-accent-primary/90 transition-colors",children:"Finish Setup"})]})]})]})}function zB({onComplete:e}){const[t,n]=k.useState(1),[r,a]=k.useState(!1),[o,u]=k.useState({});async function d(g){u(v=>({...v,providers:g.providers})),n(2)}async function p(g){u(v=>({...v,...g})),n(3)}async function f(g){a(!0);try{if(!(await ke("/api/init/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workdir:o.workdir,visionFallback:g.visionFallback})})).ok)throw new Error("Failed to save config");e()}catch(v){console.error("Failed to save onboarding data:",v),a(!1)}}const m=g=>{n(g)};return l.jsxs("div",{className:"w-full max-w-xl mx-auto px-6 py-16 relative",children:[l.jsx($l,{onClick:e,className:"absolute top-4 right-4 p-2",variant:"modal",size:"xl"}),l.jsx(LB,{currentStep:t,totalSteps:3,labels:["LLM Server","Projects Folder","Vision"],onStepClick:m}),l.jsx("div",{className:"max-w-xl mx-auto",children:r?l.jsxs("div",{className:"text-center",children:[l.jsx(Ga,{className:"w-6 h-6"}),l.jsx("p",{className:"mt-4 text-text-secondary",children:"Saving your settings..."})]}):l.jsxs(l.Fragment,{children:[t===1&&l.jsx(OB,{onNext:d}),t===2&&l.jsx(IB,{onNext:p}),t===3&&l.jsx(BB,{onNext:f})]})})]})}const MS="openfox_updated_to",RS="update_pending";function PB(){const[e,t]=k.useState(!1),n=localStorage.getItem(MS),r=localStorage.getItem(RS);k.useEffect(()=>{if(!n||!r)return;const o=setTimeout(()=>t(!0),3e4);return()=>clearTimeout(o)},[n,r]);const a=()=>{localStorage.removeItem(MS),localStorage.removeItem(RS),t(!0)};return e||r!=="true"||!n?null:l.jsxs("div",{className:"fixed bottom-20 left-1/2 -translate-x-1/2 z-[100] flex items-center gap-3 px-4 py-2.5 bg-bg-secondary border border-border rounded-lg shadow-xl animate-slide-down",role:"status","aria-live":"polite",children:[l.jsx("div",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-accent-primary/20",children:l.jsx(ns,{className:"w-3 h-3 text-accent-primary"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"text-sm font-medium text-text-primary",children:"OpenFox updated successfully"}),l.jsxs("span",{className:"text-xs text-text-muted",children:["Now running ",n]})]}),l.jsx("button",{onClick:a,className:"ml-2 p-1 rounded hover:bg-bg-tertiary text-text-muted hover:text-text-primary transition-colors","aria-label":"Dismiss",children:l.jsx(s1,{className:"w-3.5 h-3.5"})})]})}typeof window<"u"&&(yn.getState().loadUserPresets(),yn.getState().applySavedTheme());function zg(){return typeof window>"u"?!1:localStorage.getItem("openfox_token")!==null}function Vk(){return l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(Ul,{})})}function HB({sidebarOpen:e,onSidebarToggle:t}){const[,n]=Dm("/p/:projectId"),r=n==null?void 0:n.projectId,a=ye(f=>f.connectionStatus),o=ye(f=>f.clearSession),u=Ut(f=>f.currentProject),d=zg(),p=a==="connected"||d;return k.useEffect(()=>{p&&r&&(u==null?void 0:u.id)!==r&&Ut.getState().loadProject(r),p&&r&&(ye.getState().listSessions(r),o())},[p,r,u==null?void 0:u.id,o]),!u||u.id!==r?l.jsx(Vk,{}):l.jsxs(l.Fragment,{children:[l.jsx(aw,{projectId:r,isOpen:e,onClose:t}),l.jsx("div",{className:"flex-1 min-w-0 bg-primary",children:l.jsx(B3,{})})]})}function FB({sidebarOpen:e,onSidebarToggle:t,rightSidebarOpen:n,onRightSidebarToggle:r}){const[,a]=Dm("/p/:projectId/s/:sessionId"),o=a==null?void 0:a.projectId,u=a==null?void 0:a.sessionId,[,d]=Hr(),p=ye(A=>A.connectionStatus),f=ye(A=>A.currentSession),m=ye(A=>A.loadSession),g=ye(A=>A.listSessions),v=ye(A=>A.pendingSessionCreate),b=ye(A=>A.error),_=ye(A=>A.clearError),S=Ut(A=>A.currentProject),j=Ut(A=>A.loadProject),C=zg(),E=p==="connected"||C;return k.useEffect(()=>{E&&o&&(S==null?void 0:S.id)!==o&&j(o),E&&u&&(f==null?void 0:f.id)!==u&&m(u),E&&o&&g(o)},[E,o,S==null?void 0:S.id,j,u,f==null?void 0:f.id,m,g,v]),k.useEffect(()=>{(b==null?void 0:b.code)==="NOT_FOUND"&&o&&(_(),d(`/p/${o}`))},[b,o,_,d]),!S||S.id!==o?l.jsx(Vk,{}):l.jsxs(l.Fragment,{children:[l.jsx(aw,{projectId:o,isOpen:e,onClose:t}),l.jsx("div",{className:"flex-1 min-w-0 bg-primary",children:l.jsx(DB,{criteriaSidebarOpen:n,onCriteriaSidebarToggle:r})})]})}function $B(){const e=Mt(n=>n.fetchConfig);function t(){e(),window.history.back()}return l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsx(zB,{onComplete:t})})}function UB(){const{connectionStatus:e}=mj(),t=Mt(N=>N.fetchConfig),n=Mt(N=>N.refreshProviderModels),r=wn(N=>N.getSetting),a=Mt(N=>N.providers),o=Mt(N=>N.activeProviderId),[,u]=Hr(),d=zg(),[p,f]=k.useState(!1);k.useEffect(()=>{(e==="connected"||d)&&t().then(()=>{f(!0);for(const N of zS)r(N);r(Qe.DISPLAY_THEME),r(Qe.DISPLAY_USER_PRESETS)})},[e,d,t,r]),k.useEffect(()=>{p&&o&&n(o).then(()=>{const N=Mt.getState().defaultModelSelection;(N?N.split("/")[0]:null)!==o&&t()})},[p,o,n,t]);const m=wn(N=>N.settings);k.useEffect(()=>{p&&a.length===0&&u("/onboarding")},[p,a.length]),k.useEffect(()=>{const{applyPreset:N,applyTokens:F}=yn.getState(),I=m[Qe.DISPLAY_THEME],J=m[Qe.DISPLAY_USER_PRESETS];if(J&&localStorage.setItem("openfox:userPresets",J),I){localStorage.setItem("openfox:theme",I);try{const R=JSON.parse(I);R.preset&&R.tokens?(N(R.preset),yn.setState({basePreset:R.preset}),F(R.tokens)):R.preset?N(R.preset):R.tokens&&F(R.tokens)}catch{N("dark")}}else N("dark")},[m[Qe.DISPLAY_THEME],m[Qe.DISPLAY_USER_PRESETS]]);const g=()=>{const N=localStorage.getItem("openfox:leftSidebar");return N!==null?N==="true":!0},v=()=>{const N=localStorage.getItem("openfox:rightSidebar");return N!==null?N==="true":!0},[b,_]=k.useState(g),[S,j]=k.useState(v),[C,E]=k.useState(!1),[A,O]=k.useState(!1),[z,B]=k.useState(!1),Y=SN();k.useEffect(()=>{const N=()=>{B(window.innerWidth<768)};return N(),window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[]);const ee=z?C:b,ie=z?A:S,D=()=>{z?E(!C):_(!b)},$=()=>{z?O(!A):j(!S)};k.useEffect(()=>{z||localStorage.setItem("openfox:leftSidebar",String(b))},[b,z]),k.useEffect(()=>{z||localStorage.setItem("openfox:rightSidebar",String(S))},[S,z]),k.useEffect(()=>{(e==="connected"||d)&&t()},[e,t,d]);const H=ye(N=>N.showPasswordModal),U=ye(N=>N.passwordModalRetry),q=ye(N=>N.submitPassword),T=ye(N=>N.cancelPassword);return e!=="connected"&&!H&&!d?l.jsxs(l.Fragment,{children:[l.jsx(AS,{isOpen:!0,isRetry:U,onSubmit:q,onCancel:T}),l.jsx("div",{className:"h-screen flex items-center justify-center",children:l.jsx(R3,{text:"Connecting to server..."})})]}):l.jsxs(l.Fragment,{children:[l.jsx(AS,{isOpen:H,isRetry:U,onSubmit:q,onCancel:T}),l.jsxs("div",{className:"flex flex-col",style:{height:z?`calc(${Y.offsetTop}px + ${Y.height}px)`:"100vh"},children:[l.jsx(E3,{}),l.jsx(S3,{onMenuClick:D,onCriteriaToggle:$}),l.jsx("div",{className:"flex-1 flex overflow-hidden",children:l.jsxs(WN,{children:[l.jsx(Xo,{path:"/onboarding",children:l.jsx($B,{})}),l.jsx(Xo,{path:"/p/:projectId/s/:sessionId",children:l.jsx(FB,{sidebarOpen:ee,onSidebarToggle:D,rightSidebarOpen:ie,onRightSidebarToggle:$})}),l.jsx(Xo,{path:"/p/:projectId/new",children:l.jsx(I3,{})}),l.jsx(Xo,{path:"/p/:projectId",children:l.jsx(HB,{sidebarOpen:ee,onSidebarToggle:D})}),l.jsx(Xo,{path:"/",children:l.jsx(O3,{})})]})})]}),l.jsx(PB,{})]})}xN.createRoot(document.getElementById("root")).render(l.jsx(zn.StrictMode,{children:l.jsx(UB,{})}));
|
package/dist/web/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/png" href="/assets/openfox.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, height=device-height" />
|
|
7
7
|
<title>OpenFox</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CjiS1Y5o.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-CM0cLwa6.css">
|
|
10
10
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
11
11
|
<body class="bg-bg-primary text-text-primary font-mono">
|
package/dist/web/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const
|
|
1
|
+
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),d={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>d[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-7fc22fbe"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"83980a9dbd9ddf3d7746186101ca7deb"},{url:"__inspect__.js",revision:"878b477aaf1805c028895f3d3bb4af71"},{url:"assets/index-CjiS1Y5o.js",revision:null},{url:"assets/index-CM0cLwa6.css",revision:null},{url:"assets/html2canvas.esm-QH1iLAAe.js",revision:null},{url:"assets/openfox-192.png",revision:"79feeb86d692c274854e37959a7dae67"},{url:"assets/openfox-512.png",revision:"fee24b214220594b4f595a467e73036e"},{url:"manifest.webmanifest",revision:"c25f372c782e623ab1e768a8dfe350ca"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
|