openfox 2.0.0-beta.0 → 2.0.0-beta.10
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/agent-defaults/code-reviewer.agent.md +2 -1
- package/dist/{chat-handler-IVIWOR3D.js → chat-handler-6COBLIDR.js} +14 -27
- package/dist/{chunk-CEZNMLOO.js → chunk-7TTEGAO6.js} +12 -13
- package/dist/{chunk-JZQ644DE.js → chunk-BE2S4NJX.js} +6 -6
- package/dist/{chunk-FQLK5GL5.js → chunk-BVHFMAVN.js} +1 -1
- package/dist/{chunk-UFY4I643.js → chunk-C75I2KZM.js} +135 -147
- package/dist/{chunk-QFSSKIQ3.js → chunk-CDDMHSZF.js} +4 -4
- package/dist/{chunk-RF2JGDSS.js → chunk-DMH6JVPF.js} +13 -10
- package/dist/{chunk-NNEHZT3V.js → chunk-EZUR7OEP.js} +11 -3
- package/dist/{chunk-CTQ2FS4K.js → chunk-G4SACK4E.js} +221 -104
- package/dist/{chunk-ALH4KM2Y.js → chunk-LR5R7EEE.js} +2962 -3249
- package/dist/{chunk-XKR3HCAL.js → chunk-NPHYEUYE.js} +128 -34
- package/dist/{chunk-PSJIT5LZ.js → chunk-RFNEDBVO.js} +4 -4
- package/dist/chunk-RI6GAMNP.js +13 -0
- package/dist/{chunk-HHAJ3QF6.js → chunk-UKTPL5ZG.js} +16 -28
- package/dist/{chunk-HGAMIPFO.js → chunk-VIIRNJDT.js} +39 -178
- package/dist/{chunk-NONI4CRP.js → chunk-XJEOP6XU.js} +5 -32
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/compactor-TDNRM3A7.js +9 -0
- package/dist/{config-YU7NYZYG.js → config-TDVA7MQN.js} +9 -8
- package/dist/{events-OHJWCI3S.js → events-PQ3KTI5H.js} +8 -7
- package/dist/{folding-U6UHQAS5.js → folding-CXORTBAU.js} +2 -2
- package/dist/{orchestrator-7ZXM4J22.js → orchestrator-ZNGTMZ7W.js} +18 -22
- package/dist/package.json +1 -1
- package/dist/{processor-TKBJLQ2N.js → processor-WMAU4C2N.js} +8 -9
- package/dist/{protocol-BQ12Aw5J.d.ts → protocol-CDOV1pyc.d.ts} +13 -38
- package/dist/{protocol-K62EPEGS.js → protocol-CN24IKQN.js} +3 -5
- package/dist/{provider-HTJEB3ON.js → provider-BGH4MBLH.js} +25 -10
- package/dist/{serve-FGPHMDOC.js → serve-7VMTNIXT.js} +25 -26
- package/dist/server/index.d.ts +1 -6
- package/dist/server/index.js +15 -16
- package/dist/{settings-VRAOAPLA.js → settings-6XX56F3F.js} +2 -2
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/{tools-Z7X4HXZN.js → tools-CQGEU3JK.js} +11 -13
- package/dist/web/assets/index-BF6jgTAb.js +299 -0
- package/dist/web/assets/{index-BY8EbT5Z.css → index-CSOB8dwI.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/workflow-defaults/default.workflow.json +18 -4
- package/package.json +1 -1
- package/dist/auto-compaction-UIWTO3H5.js +0 -27
- package/dist/chunk-CGZHLM3K.js +0 -70
- package/dist/chunk-SZKEGZIB.js +0 -140
- package/dist/runtime-config-NPSPMRDA.js +0 -9
- package/dist/vision-fallback-3MIZZ6NQ.js +0 -22
- package/dist/web/assets/index-BDezz42a.js +0 -299
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
maybeAutoCompactContext,
|
|
3
|
-
performManualContextCompaction,
|
|
4
|
-
resolveCompactionStatsIdentity
|
|
5
|
-
} from "./chunk-ALH4KM2Y.js";
|
|
6
|
-
import "./chunk-PSJIT5LZ.js";
|
|
7
|
-
import "./chunk-XAMAYRDA.js";
|
|
8
|
-
import "./chunk-DL6ZILAF.js";
|
|
9
|
-
import "./chunk-PBGOZMVY.js";
|
|
10
|
-
import "./chunk-VRGRAQDG.js";
|
|
11
|
-
import "./chunk-HGAMIPFO.js";
|
|
12
|
-
import "./chunk-XKR3HCAL.js";
|
|
13
|
-
import "./chunk-FBGWG4N6.js";
|
|
14
|
-
import "./chunk-NONI4CRP.js";
|
|
15
|
-
import "./chunk-CEZNMLOO.js";
|
|
16
|
-
import "./chunk-BJYPTN5S.js";
|
|
17
|
-
import "./chunk-FQLK5GL5.js";
|
|
18
|
-
import "./chunk-CQGTEGKL.js";
|
|
19
|
-
import "./chunk-CGZHLM3K.js";
|
|
20
|
-
import "./chunk-SZKEGZIB.js";
|
|
21
|
-
import "./chunk-K44MW7JJ.js";
|
|
22
|
-
export {
|
|
23
|
-
maybeAutoCompactContext,
|
|
24
|
-
performManualContextCompaction,
|
|
25
|
-
resolveCompactionStatsIdentity
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=auto-compaction-UIWTO3H5.js.map
|
package/dist/chunk-CGZHLM3K.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// src/server/config.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var backendSchema = z.enum(["auto", "vllm", "sglang", "ollama", "llamacpp"]).default("auto");
|
|
4
|
-
var envSchema = z.object({
|
|
5
|
-
// New env var name, with fallback to old name for backward compatibility
|
|
6
|
-
OPENFOX_LLM_URL: z.string().url().optional(),
|
|
7
|
-
OPENFOX_VLLM_URL: z.string().url().optional(),
|
|
8
|
-
OPENFOX_BACKEND: backendSchema,
|
|
9
|
-
OPENFOX_MODEL_NAME: z.string().default("qwen3.5-122b-int4-autoround"),
|
|
10
|
-
OPENFOX_MAX_CONTEXT: z.coerce.number().default(2e5),
|
|
11
|
-
OPENFOX_PORT: z.coerce.number().default(10369),
|
|
12
|
-
OPENFOX_HOST: z.string().optional(),
|
|
13
|
-
OPENFOX_WORKDIR: z.string().optional(),
|
|
14
|
-
OPENFOX_DB_PATH: z.string().default("./openfox.db"),
|
|
15
|
-
OPENFOX_LOG_LEVEL: z.enum(["debug", "info", "warn", "error"]).default("info"),
|
|
16
|
-
OPENFOX_DISABLE_THINKING: z.coerce.boolean().default(false),
|
|
17
|
-
OPENFOX_DEV: z.coerce.boolean().default(false)
|
|
18
|
-
});
|
|
19
|
-
function loadConfig() {
|
|
20
|
-
const env = envSchema.parse(process.env);
|
|
21
|
-
const llmUrl = env.OPENFOX_LLM_URL ?? env.OPENFOX_VLLM_URL ?? "http://localhost:8000/v1";
|
|
22
|
-
const workdir = env.OPENFOX_WORKDIR ?? process.cwd();
|
|
23
|
-
return {
|
|
24
|
-
llm: {
|
|
25
|
-
baseUrl: llmUrl,
|
|
26
|
-
model: env.OPENFOX_MODEL_NAME,
|
|
27
|
-
timeout: 3e5,
|
|
28
|
-
// 5 minutes (deprecated, kept for backward compatibility)
|
|
29
|
-
idleTimeout: 3e5,
|
|
30
|
-
// 5 minutes of inactivity
|
|
31
|
-
backend: env.OPENFOX_BACKEND,
|
|
32
|
-
disableThinking: env.OPENFOX_DISABLE_THINKING
|
|
33
|
-
},
|
|
34
|
-
context: {
|
|
35
|
-
maxTokens: env.OPENFOX_MAX_CONTEXT,
|
|
36
|
-
compactionThreshold: 0.85,
|
|
37
|
-
compactionTarget: 0.6
|
|
38
|
-
},
|
|
39
|
-
agent: {
|
|
40
|
-
maxIterations: 10,
|
|
41
|
-
maxConsecutiveFailures: 3,
|
|
42
|
-
toolTimeout: 3e5
|
|
43
|
-
},
|
|
44
|
-
server: {
|
|
45
|
-
port: env.OPENFOX_PORT,
|
|
46
|
-
...env.OPENFOX_HOST !== void 0 ? { host: env.OPENFOX_HOST } : {}
|
|
47
|
-
},
|
|
48
|
-
database: {
|
|
49
|
-
path: env.OPENFOX_DB_PATH
|
|
50
|
-
},
|
|
51
|
-
mode: env.OPENFOX_DEV ? "development" : "production",
|
|
52
|
-
workdir
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// src/server/runtime-config.ts
|
|
57
|
-
var runtimeConfig = null;
|
|
58
|
-
function setRuntimeConfig(config) {
|
|
59
|
-
runtimeConfig = config;
|
|
60
|
-
}
|
|
61
|
-
function getRuntimeConfig() {
|
|
62
|
-
return runtimeConfig ?? loadConfig();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export {
|
|
66
|
-
loadConfig,
|
|
67
|
-
setRuntimeConfig,
|
|
68
|
-
getRuntimeConfig
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=chunk-CGZHLM3K.js.map
|
package/dist/chunk-SZKEGZIB.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
logger
|
|
3
|
-
} from "./chunk-K44MW7JJ.js";
|
|
4
|
-
|
|
5
|
-
// src/server/llm/vision-fallback.ts
|
|
6
|
-
var DEFAULT_CONFIG = {
|
|
7
|
-
enabled: false,
|
|
8
|
-
url: "http://localhost:11434",
|
|
9
|
-
model: "qwen3.5:0.8b",
|
|
10
|
-
timeout: 12e4
|
|
11
|
-
};
|
|
12
|
-
var config = { ...DEFAULT_CONFIG };
|
|
13
|
-
var configLoaded = false;
|
|
14
|
-
var descriptionCache = /* @__PURE__ */ new Map();
|
|
15
|
-
function clearDescriptionCache() {
|
|
16
|
-
descriptionCache.clear();
|
|
17
|
-
}
|
|
18
|
-
function setVisionFallbackConfig(newConfig) {
|
|
19
|
-
config = { ...config, ...newConfig };
|
|
20
|
-
configLoaded = true;
|
|
21
|
-
logger.debug("Vision fallback config updated", { config });
|
|
22
|
-
}
|
|
23
|
-
function getVisionFallbackConfig() {
|
|
24
|
-
return { ...config };
|
|
25
|
-
}
|
|
26
|
-
function isVisionFallbackEnabled() {
|
|
27
|
-
return config.enabled;
|
|
28
|
-
}
|
|
29
|
-
async function ensureVisionFallbackConfigLoaded() {
|
|
30
|
-
if (configLoaded) return;
|
|
31
|
-
try {
|
|
32
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-YU7NYZYG.js");
|
|
33
|
-
const { getRuntimeConfig } = await import("./runtime-config-NPSPMRDA.js");
|
|
34
|
-
const runtimeConfig = getRuntimeConfig();
|
|
35
|
-
const mode = runtimeConfig.mode ?? "production";
|
|
36
|
-
const globalConfig = await loadGlobalConfig(mode);
|
|
37
|
-
const fallback = getVisionFallback(globalConfig);
|
|
38
|
-
config = {
|
|
39
|
-
enabled: fallback.enabled ?? false,
|
|
40
|
-
url: fallback.url ?? "http://localhost:11434",
|
|
41
|
-
model: fallback.model ?? "qwen3.5:0.8b",
|
|
42
|
-
timeout: (fallback.timeout ?? 120) * 1e3
|
|
43
|
-
};
|
|
44
|
-
configLoaded = true;
|
|
45
|
-
logger.debug("Vision fallback config loaded from global config", { config });
|
|
46
|
-
} catch (error) {
|
|
47
|
-
logger.warn("Failed to load vision fallback config from global config", {
|
|
48
|
-
error: error instanceof Error ? error.message : String(error)
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
var IMAGE_PROMPT = `Describe this image in detail. Focus on:
|
|
53
|
-
- What the image shows (UI, diagram, photo, etc.)
|
|
54
|
-
- Any text visible in the image
|
|
55
|
-
- Layout and visual structure
|
|
56
|
-
- Key elements and their relationships
|
|
57
|
-
|
|
58
|
-
Provide a concise but comprehensive description.`;
|
|
59
|
-
async function describeImage(base64Data, options) {
|
|
60
|
-
await ensureVisionFallbackConfigLoaded();
|
|
61
|
-
if (!config.enabled) {
|
|
62
|
-
return "[Image - vision fallback not enabled]";
|
|
63
|
-
}
|
|
64
|
-
const cacheKey = `${base64Data.slice(0, 100)}:${options?.context ?? ""}`;
|
|
65
|
-
const cached = descriptionCache.get(cacheKey);
|
|
66
|
-
if (cached) {
|
|
67
|
-
logger.debug("Using cached image description");
|
|
68
|
-
return cached;
|
|
69
|
-
}
|
|
70
|
-
const timeout = options?.timeout ?? config.timeout;
|
|
71
|
-
try {
|
|
72
|
-
const url = `${config.url}/api/chat`;
|
|
73
|
-
const requestBody = {
|
|
74
|
-
model: config.model,
|
|
75
|
-
messages: [
|
|
76
|
-
{
|
|
77
|
-
role: "user",
|
|
78
|
-
content: options?.context ? `${IMAGE_PROMPT}
|
|
79
|
-
|
|
80
|
-
Context: ${options.context}` : IMAGE_PROMPT,
|
|
81
|
-
images: [base64Data]
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
stream: false,
|
|
85
|
-
think: false
|
|
86
|
-
};
|
|
87
|
-
const timeoutController = new AbortController();
|
|
88
|
-
const timeoutId = setTimeout(() => timeoutController.abort(), timeout);
|
|
89
|
-
const signal = options?.signal ? AbortSignal.any([timeoutController.signal, options.signal]) : timeoutController.signal;
|
|
90
|
-
const response = await fetch(url, {
|
|
91
|
-
method: "POST",
|
|
92
|
-
headers: {
|
|
93
|
-
"Content-Type": "application/json"
|
|
94
|
-
},
|
|
95
|
-
body: JSON.stringify(requestBody),
|
|
96
|
-
signal
|
|
97
|
-
});
|
|
98
|
-
clearTimeout(timeoutId);
|
|
99
|
-
if (!response.ok) {
|
|
100
|
-
const errorText = await response.text().catch(() => "Unknown error");
|
|
101
|
-
logger.error("Vision fallback API error", { status: response.status, error: errorText });
|
|
102
|
-
return `[Image description failed: HTTP ${response.status}]`;
|
|
103
|
-
}
|
|
104
|
-
const data = await response.json();
|
|
105
|
-
const description = data.message?.content?.trim();
|
|
106
|
-
if (!description) {
|
|
107
|
-
logger.warn("Vision fallback returned empty description");
|
|
108
|
-
return "[Image - could not describe]";
|
|
109
|
-
}
|
|
110
|
-
descriptionCache.set(cacheKey, description);
|
|
111
|
-
logger.debug("Cached image description", { cacheKey: cacheKey.slice(0, 20) });
|
|
112
|
-
return description;
|
|
113
|
-
} catch (error) {
|
|
114
|
-
const message = error instanceof Error ? error.message : "Unknown error";
|
|
115
|
-
logger.error("Vision fallback error", { error: message });
|
|
116
|
-
if (message.includes("abort")) {
|
|
117
|
-
return "[Image description timed out]";
|
|
118
|
-
}
|
|
119
|
-
return `[Image description failed: ${message}]`;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
async function describeImageFromDataUrl(dataUrl, options) {
|
|
123
|
-
const base64Match = dataUrl.match(/^data:image\/[^;]+;base64,(.+)$/);
|
|
124
|
-
if (!base64Match || !base64Match[1]) {
|
|
125
|
-
return "[Invalid image data URL]";
|
|
126
|
-
}
|
|
127
|
-
return describeImage(base64Match[1], options);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export {
|
|
131
|
-
descriptionCache,
|
|
132
|
-
clearDescriptionCache,
|
|
133
|
-
setVisionFallbackConfig,
|
|
134
|
-
getVisionFallbackConfig,
|
|
135
|
-
isVisionFallbackEnabled,
|
|
136
|
-
ensureVisionFallbackConfigLoaded,
|
|
137
|
-
describeImage,
|
|
138
|
-
describeImageFromDataUrl
|
|
139
|
-
};
|
|
140
|
-
//# sourceMappingURL=chunk-SZKEGZIB.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
clearDescriptionCache,
|
|
3
|
-
describeImage,
|
|
4
|
-
describeImageFromDataUrl,
|
|
5
|
-
descriptionCache,
|
|
6
|
-
ensureVisionFallbackConfigLoaded,
|
|
7
|
-
getVisionFallbackConfig,
|
|
8
|
-
isVisionFallbackEnabled,
|
|
9
|
-
setVisionFallbackConfig
|
|
10
|
-
} from "./chunk-SZKEGZIB.js";
|
|
11
|
-
import "./chunk-K44MW7JJ.js";
|
|
12
|
-
export {
|
|
13
|
-
clearDescriptionCache,
|
|
14
|
-
describeImage,
|
|
15
|
-
describeImageFromDataUrl,
|
|
16
|
-
descriptionCache,
|
|
17
|
-
ensureVisionFallbackConfigLoaded,
|
|
18
|
-
getVisionFallbackConfig,
|
|
19
|
-
isVisionFallbackEnabled,
|
|
20
|
-
setVisionFallbackConfig
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=vision-fallback-3MIZZ6NQ.js.map
|