openfox 1.6.53 → 1.6.54
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-NVHM75BN.js → auto-compaction-JJEWRJWV.js} +3 -3
- package/dist/{chat-handler-DERM2S6L.js → chat-handler-KVS36WQL.js} +6 -6
- package/dist/{chunk-JLMCJLTK.js → chunk-2W3U4KL3.js} +12 -11
- package/dist/{chunk-AFIVZZJN.js → chunk-ERSDTWU2.js} +2 -2
- package/dist/{chunk-XRPGQKBM.js → chunk-GIPCUPTT.js} +2 -2
- package/dist/{chunk-5STJLSGO.js → chunk-KFBIHS3S.js} +5 -1
- package/dist/{chunk-4MSEK56X.js → chunk-RRNFFFN4.js} +2 -2
- package/dist/{chunk-DAUVWS5W.js → chunk-Y4UE4ZRG.js} +174 -8
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{orchestrator-FX6SZX4J.js → orchestrator-TA4MAODB.js} +4 -4
- package/dist/package.json +6 -2
- package/dist/{processor-AS6JXF4U.js → processor-R3FG6O6H.js} +4 -4
- package/dist/{protocol-WHHYESPI.js → protocol-5AWNGFLH.js} +4 -2
- package/dist/{protocol-Cmn48nDH.d.ts → protocol-D8pu3Njm.d.ts} +16 -1
- package/dist/{serve-W3EZMXAC.js → serve-HJQ7FZ3R.js} +5 -5
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +4 -4
- package/dist/server/public/__inspect__.js +235 -0
- package/dist/shared/index.d.ts +2 -2
- package/dist/{tools-SJN7IGVF.js → tools-T2FCQ5FE.js} +3 -3
- package/dist/web/assets/{index-Bet4PbsC.js → index-DICFgGhL.js} +33 -33
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +6 -2
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
maybeAutoCompactContext,
|
|
3
3
|
performManualContextCompaction,
|
|
4
4
|
resolveCompactionStatsIdentity
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Y4UE4ZRG.js";
|
|
6
6
|
import "./chunk-NBU6KIOD.js";
|
|
7
7
|
import "./chunk-574HZVLE.js";
|
|
8
8
|
import "./chunk-7JPKRM6M.js";
|
|
9
9
|
import "./chunk-WNZIUQ2L.js";
|
|
10
10
|
import "./chunk-UQGY56XJ.js";
|
|
11
11
|
import "./chunk-LIMBYVO4.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-KFBIHS3S.js";
|
|
13
13
|
import "./chunk-22CTURMH.js";
|
|
14
14
|
import "./chunk-GQZGIMJO.js";
|
|
15
15
|
import "./chunk-BLNFJ22S.js";
|
|
@@ -23,4 +23,4 @@ export {
|
|
|
23
23
|
performManualContextCompaction,
|
|
24
24
|
resolveCompactionStatsIdentity
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=auto-compaction-
|
|
26
|
+
//# sourceMappingURL=auto-compaction-JJEWRJWV.js.map
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
generateSessionName,
|
|
6
6
|
getSessionMessageCount,
|
|
7
7
|
needsNameGenerationCheck
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GIPCUPTT.js";
|
|
9
9
|
import {
|
|
10
10
|
runChatTurn
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-RRNFFFN4.js";
|
|
12
|
+
import "./chunk-Y4UE4ZRG.js";
|
|
13
13
|
import "./chunk-NBU6KIOD.js";
|
|
14
14
|
import "./chunk-574HZVLE.js";
|
|
15
15
|
import "./chunk-7JPKRM6M.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
createChatMessageMessage,
|
|
23
23
|
createPhaseChangedMessage,
|
|
24
24
|
createSessionRunningMessage
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-KFBIHS3S.js";
|
|
26
26
|
import "./chunk-22CTURMH.js";
|
|
27
27
|
import "./chunk-GQZGIMJO.js";
|
|
28
28
|
import "./chunk-BLNFJ22S.js";
|
|
@@ -60,7 +60,7 @@ async function startChatSession(sessionId, content, deps, options) {
|
|
|
60
60
|
sessionManager.setRunning(sessionId, true);
|
|
61
61
|
broadcastForSession(sessionId, createSessionRunningMessage(true));
|
|
62
62
|
try {
|
|
63
|
-
const { maybeAutoCompactContext } = await import("./auto-compaction-
|
|
63
|
+
const { maybeAutoCompactContext } = await import("./auto-compaction-JJEWRJWV.js");
|
|
64
64
|
await maybeAutoCompactContext({
|
|
65
65
|
sessionManager,
|
|
66
66
|
sessionId,
|
|
@@ -169,4 +169,4 @@ export {
|
|
|
169
169
|
startChatSession,
|
|
170
170
|
stopSessionExecution
|
|
171
171
|
};
|
|
172
|
-
//# sourceMappingURL=chat-handler-
|
|
172
|
+
//# sourceMappingURL=chat-handler-KVS36WQL.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createVerifierNudgeConfig,
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RRNFFFN4.js";
|
|
6
6
|
import {
|
|
7
7
|
TurnMetrics,
|
|
8
8
|
agentExists,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
setSkillEnabled,
|
|
39
39
|
skillExists,
|
|
40
40
|
spawnShellProcess
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-Y4UE4ZRG.js";
|
|
42
42
|
import {
|
|
43
43
|
getPathSeparator,
|
|
44
44
|
getPlatformShell,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
parseClientMessage,
|
|
107
107
|
serializeServerMessage,
|
|
108
108
|
storedEventToServerMessage
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-KFBIHS3S.js";
|
|
110
110
|
import {
|
|
111
111
|
EventEmitter,
|
|
112
112
|
cancelQuestionsForSession,
|
|
@@ -5058,7 +5058,7 @@ function createTerminalRoutes() {
|
|
|
5058
5058
|
}
|
|
5059
5059
|
|
|
5060
5060
|
// src/constants.ts
|
|
5061
|
-
var VERSION = "1.6.
|
|
5061
|
+
var VERSION = "1.6.54";
|
|
5062
5062
|
|
|
5063
5063
|
// src/server/index.ts
|
|
5064
5064
|
var __dirname2 = dirname5(fileURLToPath4(import.meta.url));
|
|
@@ -5071,6 +5071,7 @@ async function createServerHandle(config) {
|
|
|
5071
5071
|
const configDir = getGlobalConfigDir(config.mode ?? "production");
|
|
5072
5072
|
const providerManager = createProviderManager(config);
|
|
5073
5073
|
const sessionManager = new SessionManager(providerManager);
|
|
5074
|
+
devServerManager.setSessionManager(sessionManager);
|
|
5074
5075
|
const useMock = process.env["OPENFOX_MOCK_LLM"] === "true";
|
|
5075
5076
|
const getMockClient = useMock ? createMockLLMClient : null;
|
|
5076
5077
|
const getLLMClient = () => getMockClient ? getMockClient() : providerManager.getLLMClient();
|
|
@@ -5360,14 +5361,14 @@ async function createServerHandle(config) {
|
|
|
5360
5361
|
if (!callId || approved === void 0) {
|
|
5361
5362
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5362
5363
|
}
|
|
5363
|
-
const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-
|
|
5364
|
+
const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-T2FCQ5FE.js");
|
|
5364
5365
|
const result = providePathConfirmation2(callId, approved, alwaysAllow);
|
|
5365
5366
|
if (!result.found) {
|
|
5366
5367
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
5367
5368
|
}
|
|
5368
5369
|
const { getEventStore: getEventStore2 } = await import("./events-UCHHTT6X.js");
|
|
5369
5370
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-NEZWWL7K.js");
|
|
5370
|
-
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-
|
|
5371
|
+
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-5AWNGFLH.js");
|
|
5371
5372
|
const eventStore = getEventStore2();
|
|
5372
5373
|
const events = eventStore.getEvents(sessionId);
|
|
5373
5374
|
const messages = buildMessagesFromStoredEvents2(events);
|
|
@@ -5385,7 +5386,7 @@ async function createServerHandle(config) {
|
|
|
5385
5386
|
if (!callId || !answer) {
|
|
5386
5387
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
5387
5388
|
}
|
|
5388
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
5389
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-T2FCQ5FE.js");
|
|
5389
5390
|
const found = provideAnswer2(callId, answer);
|
|
5390
5391
|
if (!found) {
|
|
5391
5392
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5421,8 +5422,8 @@ async function createServerHandle(config) {
|
|
|
5421
5422
|
if (!session) {
|
|
5422
5423
|
return res.status(404).json({ error: "Session not found" });
|
|
5423
5424
|
}
|
|
5424
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5425
|
-
const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-
|
|
5425
|
+
const { stopSessionExecution } = await import("./chat-handler-KVS36WQL.js");
|
|
5426
|
+
const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-T2FCQ5FE.js");
|
|
5426
5427
|
stopSessionExecution(sessionId, sessionManager);
|
|
5427
5428
|
abortSession(sessionId);
|
|
5428
5429
|
cancelQuestionsForSession2(sessionId, "Session stopped by user");
|
|
@@ -5881,7 +5882,7 @@ async function createServerHandle(config) {
|
|
|
5881
5882
|
providerManager
|
|
5882
5883
|
);
|
|
5883
5884
|
const wss = wssExports.wss;
|
|
5884
|
-
const { QueueProcessor } = await import("./processor-
|
|
5885
|
+
const { QueueProcessor } = await import("./processor-R3FG6O6H.js");
|
|
5885
5886
|
const queueProcessor = new QueueProcessor({
|
|
5886
5887
|
sessionManager,
|
|
5887
5888
|
providerManager,
|
|
@@ -5954,4 +5955,4 @@ export {
|
|
|
5954
5955
|
createServerHandle,
|
|
5955
5956
|
createServer
|
|
5956
5957
|
};
|
|
5957
|
-
//# sourceMappingURL=chunk-
|
|
5958
|
+
//# sourceMappingURL=chunk-2W3U4KL3.js.map
|
|
@@ -179,7 +179,7 @@ async function runCli(options) {
|
|
|
179
179
|
if (!configExists) {
|
|
180
180
|
await runNetworkSetup(mode);
|
|
181
181
|
}
|
|
182
|
-
const { runServe } = await import("./serve-
|
|
182
|
+
const { runServe } = await import("./serve-HJQ7FZ3R.js");
|
|
183
183
|
await runServe({
|
|
184
184
|
mode,
|
|
185
185
|
port: values.port ? parseInt(values.port) : void 0,
|
|
@@ -192,4 +192,4 @@ async function runCli(options) {
|
|
|
192
192
|
export {
|
|
193
193
|
runCli
|
|
194
194
|
};
|
|
195
|
-
//# sourceMappingURL=chunk-
|
|
195
|
+
//# sourceMappingURL=chunk-ERSDTWU2.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
createContextStateMessage,
|
|
11
11
|
createSessionStateMessage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KFBIHS3S.js";
|
|
13
13
|
import {
|
|
14
14
|
logger
|
|
15
15
|
} from "./chunk-PNBH3RAX.js";
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
needsNameGenerationCheck,
|
|
144
144
|
applyGeneratedSessionName
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-GIPCUPTT.js.map
|
|
@@ -141,6 +141,9 @@ function isPathConfirmPayload(payload) {
|
|
|
141
141
|
function isAskAnswerPayload(payload) {
|
|
142
142
|
return typeof payload === "object" && payload !== null && "callId" in payload && "answer" in payload;
|
|
143
143
|
}
|
|
144
|
+
function isUIFeedbackPayload(payload) {
|
|
145
|
+
return typeof payload === "object" && payload !== null && "sessionId" in payload && typeof payload.sessionId === "string" && "element" in payload && typeof payload === "object" && "annotation" in payload && typeof payload.annotation === "string" && "pageUrl" in payload && typeof payload.pageUrl === "string";
|
|
146
|
+
}
|
|
144
147
|
function createQueueStateMessage(messages) {
|
|
145
148
|
return createServerMessage("queue.state", { messages });
|
|
146
149
|
}
|
|
@@ -306,7 +309,8 @@ export {
|
|
|
306
309
|
isSessionLoadPayload,
|
|
307
310
|
isPathConfirmPayload,
|
|
308
311
|
isAskAnswerPayload,
|
|
312
|
+
isUIFeedbackPayload,
|
|
309
313
|
createQueueStateMessage,
|
|
310
314
|
storedEventToServerMessage
|
|
311
315
|
};
|
|
312
|
-
//# sourceMappingURL=chunk-
|
|
316
|
+
//# sourceMappingURL=chunk-KFBIHS3S.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
getToolRegistryForAgent,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
runTopLevelAgentLoop
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-Y4UE4ZRG.js";
|
|
17
17
|
import {
|
|
18
18
|
getCurrentContextWindowId,
|
|
19
19
|
getEventStore
|
|
@@ -293,4 +293,4 @@ export {
|
|
|
293
293
|
runBuilderTurn,
|
|
294
294
|
runVerifierTurn
|
|
295
295
|
};
|
|
296
|
-
//# sourceMappingURL=chunk-
|
|
296
|
+
//# sourceMappingURL=chunk-RRNFFFN4.js.map
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
createChatToolOutputMessage,
|
|
34
34
|
createChatVisionFallbackMessage,
|
|
35
35
|
createQueueStateMessage
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-KFBIHS3S.js";
|
|
37
37
|
import {
|
|
38
38
|
AskUserInterrupt,
|
|
39
39
|
askUserTool
|
|
@@ -1258,6 +1258,9 @@ function extractAbsolutePathsFromCommand(command) {
|
|
|
1258
1258
|
const paths = [];
|
|
1259
1259
|
const home = homedir();
|
|
1260
1260
|
let sanitized = command.replace(/https?:\/\/[^\s'"]+/g, " __URL__ ").replace(/ftp:\/\/[^\s'"]+/g, " __URL__ ");
|
|
1261
|
+
sanitized = sanitized.replace(/s\/[^\/]*\/[^\/]*\/[gip]*/g, " __SED__ ");
|
|
1262
|
+
sanitized = sanitized.replace(/s\|[^|]*\|[^|]*\|[gip]*/g, " __SED__ ");
|
|
1263
|
+
sanitized = sanitized.replace(/s:[^:]*:[^:]*:[gip]*/g, " __SED__ ");
|
|
1261
1264
|
const fileUrlMatches = command.matchAll(/file:\/\/([^\s'"]+)/g);
|
|
1262
1265
|
for (const match2 of fileUrlMatches) {
|
|
1263
1266
|
const filePath = match2[1];
|
|
@@ -3377,7 +3380,7 @@ var callSubAgentTool = {
|
|
|
3377
3380
|
};
|
|
3378
3381
|
}
|
|
3379
3382
|
try {
|
|
3380
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3383
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-T2FCQ5FE.js");
|
|
3381
3384
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3382
3385
|
const turnMetrics = new TurnMetrics();
|
|
3383
3386
|
const result = await executeSubAgent({
|
|
@@ -3634,6 +3637,146 @@ var webFetchTool = createTool(
|
|
|
3634
3637
|
import { spawn as spawn4 } from "child_process";
|
|
3635
3638
|
import { readFile as readFile7, writeFile as writeFile5, mkdir as mkdir4 } from "fs/promises";
|
|
3636
3639
|
import { resolve as resolve5, join as join6 } from "path";
|
|
3640
|
+
|
|
3641
|
+
// src/server/dev-server/inspect-proxy.ts
|
|
3642
|
+
import httpProxy from "http-proxy";
|
|
3643
|
+
import { createServer as createHttpServer } from "http";
|
|
3644
|
+
var proxyCache = /* @__PURE__ */ new Map();
|
|
3645
|
+
function getProxy(target) {
|
|
3646
|
+
if (!proxyCache.has(target)) {
|
|
3647
|
+
const proxy = httpProxy.createProxyServer({
|
|
3648
|
+
changeOrigin: true,
|
|
3649
|
+
selfHandleResponse: true
|
|
3650
|
+
});
|
|
3651
|
+
proxy.on("error", (err, _req, res) => {
|
|
3652
|
+
if (res && !res.writableEnded) {
|
|
3653
|
+
res.writeHead(502, { "content-type": "text/plain" });
|
|
3654
|
+
res.end("Proxy error: " + err.message);
|
|
3655
|
+
}
|
|
3656
|
+
});
|
|
3657
|
+
proxyCache.set(target, proxy);
|
|
3658
|
+
}
|
|
3659
|
+
return proxyCache.get(target);
|
|
3660
|
+
}
|
|
3661
|
+
var proxyPool = /* @__PURE__ */ new Map();
|
|
3662
|
+
var nextOffset = 0;
|
|
3663
|
+
function getAvailablePort() {
|
|
3664
|
+
const base = Number(process.env["OPENFOX_BASE_PROXY_PORT"] ?? 1e4);
|
|
3665
|
+
const used = /* @__PURE__ */ new Set();
|
|
3666
|
+
for (const instance of proxyPool.values()) {
|
|
3667
|
+
const addr = instance.server.address();
|
|
3668
|
+
if (addr && typeof addr === "object") used.add(addr.port);
|
|
3669
|
+
}
|
|
3670
|
+
for (let port = base + 1; port < base + 200; port++) {
|
|
3671
|
+
if (!used.has(port)) return port;
|
|
3672
|
+
}
|
|
3673
|
+
return base + (nextOffset++ % 200 + 1);
|
|
3674
|
+
}
|
|
3675
|
+
function startInspectProxy(target, sessionManager) {
|
|
3676
|
+
const port = getAvailablePort();
|
|
3677
|
+
const proxy = getProxy(target);
|
|
3678
|
+
const server = createHttpServer();
|
|
3679
|
+
server.on("request", (req, res) => {
|
|
3680
|
+
if (req.url === "/__openfox_feedback" && req.method === "POST") {
|
|
3681
|
+
let body = "";
|
|
3682
|
+
req.on("data", (chunk) => {
|
|
3683
|
+
body += chunk;
|
|
3684
|
+
});
|
|
3685
|
+
req.on("end", () => {
|
|
3686
|
+
try {
|
|
3687
|
+
const { sessionId, element, annotation, pageUrl } = JSON.parse(body);
|
|
3688
|
+
if (!sessionId) {
|
|
3689
|
+
res.writeHead(400, { "content-type": "application/json" });
|
|
3690
|
+
res.end(JSON.stringify({ error: "sessionId required" }));
|
|
3691
|
+
return;
|
|
3692
|
+
}
|
|
3693
|
+
const elementDesc = element ? `${element.tag}${element.id ? "#" + element.id : ""}` : "unknown";
|
|
3694
|
+
const htmlSnippet = element?.outerHTML ? `
|
|
3695
|
+
Html: ${element.outerHTML.slice(0, 300)}` : "";
|
|
3696
|
+
const content = `# User feedback from page inspection on dev_server
|
|
3697
|
+
|
|
3698
|
+
## Context
|
|
3699
|
+
|
|
3700
|
+
Page: ${pageUrl || ""}
|
|
3701
|
+
Element: ${elementDesc}
|
|
3702
|
+
xPath: ${element?.xpath || ""}${htmlSnippet}
|
|
3703
|
+
|
|
3704
|
+
## Feedback
|
|
3705
|
+
|
|
3706
|
+
${annotation || "(none)"}`;
|
|
3707
|
+
sessionManager.queueMessage(sessionId, "asap", content, [], "ui_feedback");
|
|
3708
|
+
res.writeHead(200, { "content-type": "application/json" });
|
|
3709
|
+
res.end(JSON.stringify({ success: true }));
|
|
3710
|
+
} catch (err) {
|
|
3711
|
+
res.writeHead(400, { "content-type": "application/json" });
|
|
3712
|
+
res.end(JSON.stringify({ error: err instanceof Error ? err.message : "Invalid request" }));
|
|
3713
|
+
}
|
|
3714
|
+
});
|
|
3715
|
+
return;
|
|
3716
|
+
}
|
|
3717
|
+
if (req.url === "/__inspect__.js") {
|
|
3718
|
+
import("fs/promises").then(async ({ readFile: readFile8 }) => {
|
|
3719
|
+
const dir = import.meta.dirname ?? __dirname;
|
|
3720
|
+
try {
|
|
3721
|
+
const content = await readFile8(`${dir}/../public/__inspect__.js`, "utf-8");
|
|
3722
|
+
res.writeHead(200, { "Content-Type": "application/javascript" });
|
|
3723
|
+
res.end(content);
|
|
3724
|
+
} catch {
|
|
3725
|
+
res.writeHead(404);
|
|
3726
|
+
res.end("Not found");
|
|
3727
|
+
}
|
|
3728
|
+
});
|
|
3729
|
+
return;
|
|
3730
|
+
}
|
|
3731
|
+
;
|
|
3732
|
+
proxy.web(req, res, { target }, (err) => {
|
|
3733
|
+
if (err && !res.headersSent) {
|
|
3734
|
+
res.writeHead(502, { "content-type": "text/plain" });
|
|
3735
|
+
res.end("Proxy error: " + err.message);
|
|
3736
|
+
}
|
|
3737
|
+
});
|
|
3738
|
+
proxy.on("proxyRes", (proxyRes) => {
|
|
3739
|
+
const contentType = proxyRes.headers?.["content-type"] ?? "";
|
|
3740
|
+
const isHtml = contentType.includes("text/html") || contentType.includes("application/xhtml+xml");
|
|
3741
|
+
if (!isHtml) {
|
|
3742
|
+
if (res.headersSent) return;
|
|
3743
|
+
res.writeHead(proxyRes.statusCode ?? 200, proxyRes.headers);
|
|
3744
|
+
proxyRes.pipe(res);
|
|
3745
|
+
return;
|
|
3746
|
+
}
|
|
3747
|
+
const chunks = [];
|
|
3748
|
+
proxyRes.on("data", (chunk) => chunks.push(chunk));
|
|
3749
|
+
proxyRes.on("end", () => {
|
|
3750
|
+
try {
|
|
3751
|
+
const html = Buffer.concat(chunks).toString("utf8");
|
|
3752
|
+
const snippet = `<script src="/__inspect__.js"></script>`;
|
|
3753
|
+
const injected = html.replace("</head>", snippet + "</head>");
|
|
3754
|
+
res.writeHead(proxyRes.statusCode ?? 200, {
|
|
3755
|
+
...proxyRes.headers,
|
|
3756
|
+
"content-type": "text/html; charset=utf-8"
|
|
3757
|
+
});
|
|
3758
|
+
res.end(injected);
|
|
3759
|
+
} catch {
|
|
3760
|
+
res.writeHead(500, { "content-type": "text/plain" });
|
|
3761
|
+
res.end("Failed to process response");
|
|
3762
|
+
}
|
|
3763
|
+
});
|
|
3764
|
+
});
|
|
3765
|
+
});
|
|
3766
|
+
server.listen(port, "0.0.0.0", () => {
|
|
3767
|
+
logger.debug("Inspect proxy listening", { port, target });
|
|
3768
|
+
});
|
|
3769
|
+
proxyPool.set(target, { server, target });
|
|
3770
|
+
const cleanup = () => {
|
|
3771
|
+
server.close();
|
|
3772
|
+
proxyCache.delete(target);
|
|
3773
|
+
proxyPool.delete(target);
|
|
3774
|
+
logger.debug("Inspect proxy stopped", { port, target });
|
|
3775
|
+
};
|
|
3776
|
+
return { port, cleanup };
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
// src/server/dev-server/manager.ts
|
|
3637
3780
|
var MAX_LOG_LINES = 2e3;
|
|
3638
3781
|
var MAX_LOG_BYTES = 1e5;
|
|
3639
3782
|
var CONFIG_PATH = ".openfox/dev.json";
|
|
@@ -3656,13 +3799,19 @@ function createInstance() {
|
|
|
3656
3799
|
logs: [],
|
|
3657
3800
|
totalLogBytes: 0,
|
|
3658
3801
|
errorMessage: void 0,
|
|
3659
|
-
exited: true
|
|
3802
|
+
exited: true,
|
|
3803
|
+
inspectProxyPort: null,
|
|
3804
|
+
proxyCleanup: null
|
|
3660
3805
|
};
|
|
3661
3806
|
}
|
|
3662
3807
|
var DevServerManager = class {
|
|
3663
3808
|
instances = /* @__PURE__ */ new Map();
|
|
3664
3809
|
outputListeners = /* @__PURE__ */ new Set();
|
|
3665
3810
|
stateListeners = /* @__PURE__ */ new Set();
|
|
3811
|
+
_sessionManager = null;
|
|
3812
|
+
setSessionManager(sm) {
|
|
3813
|
+
this._sessionManager = sm;
|
|
3814
|
+
}
|
|
3666
3815
|
resolveWorkdir(workdir) {
|
|
3667
3816
|
return resolve5(workdir);
|
|
3668
3817
|
}
|
|
@@ -3696,7 +3845,8 @@ var DevServerManager = class {
|
|
|
3696
3845
|
return {
|
|
3697
3846
|
command: parsed.command,
|
|
3698
3847
|
url: parsed.url,
|
|
3699
|
-
hotReload: parsed.hotReload ?? false
|
|
3848
|
+
hotReload: parsed.hotReload ?? false,
|
|
3849
|
+
disableInspect: parsed.disableInspect ?? false
|
|
3700
3850
|
};
|
|
3701
3851
|
} catch {
|
|
3702
3852
|
return null;
|
|
@@ -3723,6 +3873,16 @@ var DevServerManager = class {
|
|
|
3723
3873
|
instance.totalLogBytes = 0;
|
|
3724
3874
|
instance.errorMessage = void 0;
|
|
3725
3875
|
instance.exited = false;
|
|
3876
|
+
if (!config.disableInspect && config.url && this._sessionManager) {
|
|
3877
|
+
try {
|
|
3878
|
+
const { port, cleanup } = startInspectProxy(config.url, this._sessionManager);
|
|
3879
|
+
instance.inspectProxyPort = port;
|
|
3880
|
+
instance.proxyCleanup = cleanup;
|
|
3881
|
+
logger.debug("Inspect proxy started", { workdir, port, target: config.url });
|
|
3882
|
+
} catch (err) {
|
|
3883
|
+
logger.warn("Failed to start inspect proxy", { workdir, error: err });
|
|
3884
|
+
}
|
|
3885
|
+
}
|
|
3726
3886
|
const resolved = this.resolveWorkdir(workdir);
|
|
3727
3887
|
const shell = getPlatformShell();
|
|
3728
3888
|
const proc = spawn4(shell.command, [...shell.args, config.command], {
|
|
@@ -3796,6 +3956,11 @@ ${recentLogs}`.trim();
|
|
|
3796
3956
|
this.emitStateChange(workdir, "off", void 0);
|
|
3797
3957
|
logger.info("Dev server stopped", { workdir });
|
|
3798
3958
|
}
|
|
3959
|
+
if (instance.proxyCleanup) {
|
|
3960
|
+
instance.proxyCleanup();
|
|
3961
|
+
instance.proxyCleanup = null;
|
|
3962
|
+
instance.inspectProxyPort = null;
|
|
3963
|
+
}
|
|
3799
3964
|
return this.getStatus(workdir);
|
|
3800
3965
|
}
|
|
3801
3966
|
async restart(workdir) {
|
|
@@ -3809,7 +3974,8 @@ ${recentLogs}`.trim();
|
|
|
3809
3974
|
url: instance.config?.url ?? null,
|
|
3810
3975
|
hotReload: instance.config?.hotReload ?? false,
|
|
3811
3976
|
config: instance.config,
|
|
3812
|
-
errorMessage: instance.errorMessage
|
|
3977
|
+
errorMessage: instance.errorMessage,
|
|
3978
|
+
inspectProxyPort: instance.inspectProxyPort
|
|
3813
3979
|
};
|
|
3814
3980
|
}
|
|
3815
3981
|
getLogs(workdir) {
|
|
@@ -4084,12 +4250,12 @@ These processes run independently of agent turns and persist across session comp
|
|
|
4084
4250
|
}
|
|
4085
4251
|
const since = args.since ?? 0;
|
|
4086
4252
|
const maxLines = Math.min(args.maxLines ?? 500, 2e3);
|
|
4087
|
-
const { lines, totalLines, nextOffset, hasMore } = getProcessLogs(args.processId, since, maxLines);
|
|
4253
|
+
const { lines, totalLines, nextOffset: nextOffset2, hasMore } = getProcessLogs(args.processId, since, maxLines);
|
|
4088
4254
|
return helpers.success(JSON.stringify({
|
|
4089
4255
|
processId: args.processId,
|
|
4090
4256
|
lines,
|
|
4091
4257
|
totalLines,
|
|
4092
|
-
nextOffset,
|
|
4258
|
+
nextOffset: nextOffset2,
|
|
4093
4259
|
hasMore,
|
|
4094
4260
|
truncated: hasMore
|
|
4095
4261
|
}, null, 2));
|
|
@@ -4504,4 +4670,4 @@ export {
|
|
|
4504
4670
|
getToolRegistryForAgent,
|
|
4505
4671
|
createToolRegistry
|
|
4506
4672
|
};
|
|
4507
|
-
//# sourceMappingURL=chunk-
|
|
4673
|
+
//# sourceMappingURL=chunk-Y4UE4ZRG.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn,
|
|
5
5
|
runVerifierTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RRNFFFN4.js";
|
|
7
7
|
import {
|
|
8
8
|
TurnMetrics,
|
|
9
9
|
createChatDoneEvent,
|
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
createMessageStartEvent,
|
|
12
12
|
createToolCallEvent,
|
|
13
13
|
createToolResultEvent
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-Y4UE4ZRG.js";
|
|
15
15
|
import "./chunk-NBU6KIOD.js";
|
|
16
16
|
import "./chunk-574HZVLE.js";
|
|
17
17
|
import "./chunk-7JPKRM6M.js";
|
|
18
18
|
import "./chunk-WNZIUQ2L.js";
|
|
19
19
|
import "./chunk-UQGY56XJ.js";
|
|
20
20
|
import "./chunk-LIMBYVO4.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-KFBIHS3S.js";
|
|
22
22
|
import "./chunk-22CTURMH.js";
|
|
23
23
|
import "./chunk-GQZGIMJO.js";
|
|
24
24
|
import "./chunk-BLNFJ22S.js";
|
|
@@ -39,4 +39,4 @@ export {
|
|
|
39
39
|
runChatTurn,
|
|
40
40
|
runVerifierTurn
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=orchestrator-
|
|
42
|
+
//# sourceMappingURL=orchestrator-TA4MAODB.js.map
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openfox",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.54",
|
|
4
4
|
"description": "Local-LLM-first agentic coding assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dev": "OPENFOX_DEV=true tsx watch src/cli/dev.ts --no-browser",
|
|
28
28
|
"dev:web": "vite --config web/vite.config.ts",
|
|
29
29
|
"build": "FORCE_COLOR=1 npm run build:server && FORCE_COLOR=1 npm run build:web",
|
|
30
|
-
"build:server": "FORCE_COLOR=1 tsup && mkdir -p dist/command-defaults dist/skill-defaults dist/agent-defaults dist/workflow-defaults && cp src/server/commands/defaults/*.md dist/command-defaults/ && cp src/server/skills/defaults/*.md dist/skill-defaults/ && cp src/server/agents/defaults/*.md dist/agent-defaults/ && cp src/server/workflows/defaults/*.json dist/workflow-defaults/ && cp src/cli/update.sh dist/cli/ && chmod +x dist/cli/update.sh && cp package.json dist/",
|
|
30
|
+
"build:server": "FORCE_COLOR=1 tsup && mkdir -p dist/command-defaults dist/skill-defaults dist/agent-defaults dist/workflow-defaults && cp src/server/commands/defaults/*.md dist/command-defaults/ && cp src/server/skills/defaults/*.md dist/skill-defaults/ && cp src/server/agents/defaults/*.md dist/agent-defaults/ && cp src/server/workflows/defaults/*.json dist/workflow-defaults/ && cp src/cli/update.sh dist/cli/ && chmod +x dist/cli/update.sh && cp package.json dist/ && cp -r src/server/public dist/server/",
|
|
31
31
|
"build:web": "cd web && FORCE_COLOR=1 vite build --outDir ../dist/web",
|
|
32
32
|
"start": "node dist/cli/index.js",
|
|
33
33
|
"start:dev": "node dist/cli/dev.js",
|
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@clack/prompts": "^1.1.0",
|
|
61
61
|
"@fontsource/jetbrains-mono": "^5.2.8",
|
|
62
|
+
"@xterm/addon-fit": "^0.11.0",
|
|
63
|
+
"@xterm/xterm": "^6.0.0",
|
|
62
64
|
"bash-language-server": "^5.4.2",
|
|
63
65
|
"better-sqlite3": "^12.8.0",
|
|
64
66
|
"cors": "^2.8.5",
|
|
@@ -66,6 +68,7 @@
|
|
|
66
68
|
"fast-glob": "^3.3.3",
|
|
67
69
|
"gray-matter": "^4.0.3",
|
|
68
70
|
"html2canvas": "^1.4.1",
|
|
71
|
+
"http-proxy": "^1.18.1",
|
|
69
72
|
"ignore": "^7.0.5",
|
|
70
73
|
"node-pty": "^1.2.0-beta.12",
|
|
71
74
|
"open": "^11.0.0",
|
|
@@ -96,6 +99,7 @@
|
|
|
96
99
|
"@testing-library/react": "^16.3.2",
|
|
97
100
|
"@testing-library/user-event": "^14.6.1",
|
|
98
101
|
"@types/better-sqlite3": "^7.6.13",
|
|
102
|
+
"@types/http-proxy": "^1.17.17",
|
|
99
103
|
"@types/node": "^22.19.15",
|
|
100
104
|
"@types/react": "^19.0.8",
|
|
101
105
|
"@types/react-dom": "^19.0.3",
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
generateSessionName,
|
|
6
6
|
getSessionMessageCount,
|
|
7
7
|
needsNameGenerationCheck
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GIPCUPTT.js";
|
|
9
9
|
import {
|
|
10
10
|
getEventStore
|
|
11
11
|
} from "./chunk-UQGY56XJ.js";
|
|
@@ -13,7 +13,7 @@ import "./chunk-LIMBYVO4.js";
|
|
|
13
13
|
import {
|
|
14
14
|
createChatMessageMessage,
|
|
15
15
|
createSessionRunningMessage
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KFBIHS3S.js";
|
|
17
17
|
import "./chunk-BLNFJ22S.js";
|
|
18
18
|
import "./chunk-CTAIXOZJ.js";
|
|
19
19
|
import "./chunk-TVQOONDR.js";
|
|
@@ -173,7 +173,7 @@ var QueueProcessor = class {
|
|
|
173
173
|
backend: provider?.backend ?? llmClient.getBackend(),
|
|
174
174
|
model: llmClient.getModel()
|
|
175
175
|
};
|
|
176
|
-
const { runChatTurn } = await import("./orchestrator-
|
|
176
|
+
const { runChatTurn } = await import("./orchestrator-TA4MAODB.js");
|
|
177
177
|
const runChatTurnParams = buildRunChatTurnParams({
|
|
178
178
|
sessionManager,
|
|
179
179
|
sessionId,
|
|
@@ -206,4 +206,4 @@ var QueueProcessor = class {
|
|
|
206
206
|
export {
|
|
207
207
|
QueueProcessor
|
|
208
208
|
};
|
|
209
|
-
//# sourceMappingURL=processor-
|
|
209
|
+
//# sourceMappingURL=processor-R3FG6O6H.js.map
|
|
@@ -31,10 +31,11 @@ import {
|
|
|
31
31
|
isAskAnswerPayload,
|
|
32
32
|
isPathConfirmPayload,
|
|
33
33
|
isSessionLoadPayload,
|
|
34
|
+
isUIFeedbackPayload,
|
|
34
35
|
parseClientMessage,
|
|
35
36
|
serializeServerMessage,
|
|
36
37
|
storedEventToServerMessage
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-KFBIHS3S.js";
|
|
38
39
|
import "./chunk-CTAIXOZJ.js";
|
|
39
40
|
export {
|
|
40
41
|
createChatAskUserMessage,
|
|
@@ -69,8 +70,9 @@ export {
|
|
|
69
70
|
isAskAnswerPayload,
|
|
70
71
|
isPathConfirmPayload,
|
|
71
72
|
isSessionLoadPayload,
|
|
73
|
+
isUIFeedbackPayload,
|
|
72
74
|
parseClientMessage,
|
|
73
75
|
serializeServerMessage,
|
|
74
76
|
storedEventToServerMessage
|
|
75
77
|
};
|
|
76
|
-
//# sourceMappingURL=protocol-
|
|
78
|
+
//# sourceMappingURL=protocol-5AWNGFLH.js.map
|