openfox 1.6.52 → 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-43QXHIOZ.js → auto-compaction-JJEWRJWV.js} +4 -4
- package/dist/{chat-handler-UMXEBSMS.js → chat-handler-KVS36WQL.js} +9 -11
- package/dist/{chunk-BMNBXLFY.js → chunk-2W3U4KL3.js} +96 -524
- package/dist/{chunk-H5ZZGLQU.js → chunk-CTAIXOZJ.js} +1 -1
- package/dist/{chunk-XKI3OYFD.js → chunk-ERSDTWU2.js} +2 -2
- package/dist/{chunk-OPT4YF7X.js → chunk-GIPCUPTT.js} +38 -3
- package/dist/{chunk-HQSCGJ6V.js → chunk-KFBIHS3S.js} +6 -26
- package/dist/{chunk-PLIGDCWB.js → chunk-RRNFFFN4.js} +2 -2
- package/dist/{chunk-NVWJC2YZ.js → chunk-Y4UE4ZRG.js} +174 -10
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{orchestrator-JSLETK3F.js → orchestrator-TA4MAODB.js} +5 -5
- package/dist/package.json +9 -4
- package/dist/{processor-Q4NS4MID.js → processor-R3FG6O6H.js} +7 -9
- package/dist/{protocol-GG65P3FF.js → protocol-5AWNGFLH.js} +5 -15
- package/dist/{protocol-BWFqvGie.d.ts → protocol-D8pu3Njm.d.ts} +17 -25
- package/dist/{serve-HPBQJTEZ.js → serve-HJQ7FZ3R.js} +6 -7
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +5 -6
- package/dist/server/public/__inspect__.js +235 -0
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/{tools-DTNPLRKJ.js → tools-T2FCQ5FE.js} +4 -4
- package/dist/web/assets/{index-CugBax2x.js → index-DICFgGhL.js} +49 -49
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +9 -4
- package/dist/chunk-2L4DPLCM.js +0 -44
|
@@ -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
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getEventStore,
|
|
2
3
|
updateSessionMetadata
|
|
3
4
|
} from "./chunk-UQGY56XJ.js";
|
|
4
5
|
import {
|
|
@@ -6,12 +7,44 @@ import {
|
|
|
6
7
|
foldPendingConfirmations
|
|
7
8
|
} from "./chunk-LIMBYVO4.js";
|
|
8
9
|
import {
|
|
10
|
+
createContextStateMessage,
|
|
9
11
|
createSessionStateMessage
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KFBIHS3S.js";
|
|
11
13
|
import {
|
|
12
14
|
logger
|
|
13
15
|
} from "./chunk-PNBH3RAX.js";
|
|
14
16
|
|
|
17
|
+
// src/server/utils/session-utils.ts
|
|
18
|
+
function getSessionMessageCount(sessionId) {
|
|
19
|
+
const eventStore = getEventStore();
|
|
20
|
+
const events = eventStore.getEvents(sessionId);
|
|
21
|
+
let count = 0;
|
|
22
|
+
for (const event of events) {
|
|
23
|
+
if (event.type === "message.start") {
|
|
24
|
+
const data = event.data;
|
|
25
|
+
if (data.role === "user") {
|
|
26
|
+
count++;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return count;
|
|
31
|
+
}
|
|
32
|
+
function finalizeTurnCompletion(sessionId, sessionManager, broadcastForSession) {
|
|
33
|
+
sessionManager.setRunning(sessionId, false);
|
|
34
|
+
const contextState = sessionManager.getContextState(sessionId);
|
|
35
|
+
broadcastForSession(sessionId, createContextStateMessage(contextState));
|
|
36
|
+
}
|
|
37
|
+
function buildRunChatTurnParams(params) {
|
|
38
|
+
return {
|
|
39
|
+
sessionManager: params.sessionManager,
|
|
40
|
+
sessionId: params.sessionId,
|
|
41
|
+
llmClient: params.llmClient,
|
|
42
|
+
signal: params.signal,
|
|
43
|
+
onMessage: params.onMessage,
|
|
44
|
+
...params.statsIdentity ? { statsIdentity: params.statsIdentity } : {}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
15
48
|
// src/server/session/name-generator.ts
|
|
16
49
|
var SESSION_NAME_PROMPT = `Generate a concise, descriptive session name (max 50 characters) based on the user's message.
|
|
17
50
|
Return ONLY the name, nothing else.
|
|
@@ -103,9 +136,11 @@ function applyGeneratedSessionName(sessionId, name, deps) {
|
|
|
103
136
|
}
|
|
104
137
|
|
|
105
138
|
export {
|
|
139
|
+
getSessionMessageCount,
|
|
140
|
+
finalizeTurnCompletion,
|
|
141
|
+
buildRunChatTurnParams,
|
|
106
142
|
generateSessionName,
|
|
107
|
-
needsNameGeneration,
|
|
108
143
|
needsNameGenerationCheck,
|
|
109
144
|
applyGeneratedSessionName
|
|
110
145
|
};
|
|
111
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-GIPCUPTT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServerMessage,
|
|
3
3
|
isClientMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CTAIXOZJ.js";
|
|
5
5
|
|
|
6
6
|
// src/server/ws/protocol.ts
|
|
7
7
|
function enrichMessagesWithToolResults(messages) {
|
|
@@ -135,33 +135,18 @@ function createSessionNameGeneratedMessage(name, sessionId) {
|
|
|
135
135
|
function isSessionLoadPayload(payload) {
|
|
136
136
|
return typeof payload === "object" && payload !== null && "sessionId" in payload;
|
|
137
137
|
}
|
|
138
|
-
function isChatSendPayload(payload) {
|
|
139
|
-
return typeof payload === "object" && payload !== null && "content" in payload;
|
|
140
|
-
}
|
|
141
|
-
function isModeSwitchPayload(payload) {
|
|
142
|
-
return typeof payload === "object" && payload !== null && "mode" in payload;
|
|
143
|
-
}
|
|
144
|
-
function isCriteriaEditPayload(payload) {
|
|
145
|
-
return typeof payload === "object" && payload !== null && "criteria" in payload;
|
|
146
|
-
}
|
|
147
138
|
function isPathConfirmPayload(payload) {
|
|
148
139
|
return typeof payload === "object" && payload !== null && "callId" in payload && "approved" in payload;
|
|
149
140
|
}
|
|
150
141
|
function isAskAnswerPayload(payload) {
|
|
151
142
|
return typeof payload === "object" && payload !== null && "callId" in payload && "answer" in payload;
|
|
152
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
|
+
}
|
|
153
147
|
function createQueueStateMessage(messages) {
|
|
154
148
|
return createServerMessage("queue.state", { messages });
|
|
155
149
|
}
|
|
156
|
-
function isQueueAsapPayload(payload) {
|
|
157
|
-
return typeof payload === "object" && payload !== null && "content" in payload && typeof payload.content === "string";
|
|
158
|
-
}
|
|
159
|
-
function isQueueCompletionPayload(payload) {
|
|
160
|
-
return typeof payload === "object" && payload !== null && "content" in payload && typeof payload.content === "string";
|
|
161
|
-
}
|
|
162
|
-
function isQueueCancelPayload(payload) {
|
|
163
|
-
return typeof payload === "object" && payload !== null && "queueId" in payload && typeof payload.queueId === "string";
|
|
164
|
-
}
|
|
165
150
|
function storedEventToServerMessage(event) {
|
|
166
151
|
switch (event.type) {
|
|
167
152
|
case "message.start": {
|
|
@@ -322,15 +307,10 @@ export {
|
|
|
322
307
|
createContextStateMessage,
|
|
323
308
|
createSessionNameGeneratedMessage,
|
|
324
309
|
isSessionLoadPayload,
|
|
325
|
-
isChatSendPayload,
|
|
326
|
-
isModeSwitchPayload,
|
|
327
|
-
isCriteriaEditPayload,
|
|
328
310
|
isPathConfirmPayload,
|
|
329
311
|
isAskAnswerPayload,
|
|
312
|
+
isUIFeedbackPayload,
|
|
330
313
|
createQueueStateMessage,
|
|
331
|
-
isQueueAsapPayload,
|
|
332
|
-
isQueueCompletionPayload,
|
|
333
|
-
isQueueCancelPayload,
|
|
334
314
|
storedEventToServerMessage
|
|
335
315
|
};
|
|
336
|
-
//# 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));
|
|
@@ -4474,7 +4640,6 @@ export {
|
|
|
4474
4640
|
createToolCallEvent,
|
|
4475
4641
|
createToolResultEvent,
|
|
4476
4642
|
createChatDoneEvent,
|
|
4477
|
-
getAllInstructions,
|
|
4478
4643
|
assembleAgentRequest,
|
|
4479
4644
|
pathExists2 as pathExists,
|
|
4480
4645
|
getDefaultIds,
|
|
@@ -4482,7 +4647,6 @@ export {
|
|
|
4482
4647
|
loadDefaultSkills,
|
|
4483
4648
|
loadUserSkills,
|
|
4484
4649
|
loadAllSkills,
|
|
4485
|
-
getEnabledSkillMetadata,
|
|
4486
4650
|
isSkillEnabled,
|
|
4487
4651
|
setSkillEnabled,
|
|
4488
4652
|
getDefaultSkillIds,
|
|
@@ -4506,4 +4670,4 @@ export {
|
|
|
4506
4670
|
getToolRegistryForAgent,
|
|
4507
4671
|
createToolRegistry
|
|
4508
4672
|
};
|
|
4509
|
-
//# 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,18 +11,18 @@ 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";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-CTAIXOZJ.js";
|
|
26
26
|
import "./chunk-R4HADRYO.js";
|
|
27
27
|
import "./chunk-TVQOONDR.js";
|
|
28
28
|
import "./chunk-VCALN543.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",
|
|
@@ -52,12 +52,15 @@
|
|
|
52
52
|
"duplicate": "npm run duplicate:server && npm run duplicate:web",
|
|
53
53
|
"check": "npm run typecheck && npm run duplicate",
|
|
54
54
|
"clean": "rm -rf dist",
|
|
55
|
-
"prepublishOnly": "npm run build",
|
|
56
|
-
"prepare": "husky"
|
|
55
|
+
"prepublishOnly": "npm run build && npm run test:publish:e2e",
|
|
56
|
+
"prepare": "husky",
|
|
57
|
+
"test:publish:e2e": "tsx scripts/run-publish-e2e.ts"
|
|
57
58
|
},
|
|
58
59
|
"dependencies": {
|
|
59
60
|
"@clack/prompts": "^1.1.0",
|
|
60
61
|
"@fontsource/jetbrains-mono": "^5.2.8",
|
|
62
|
+
"@xterm/addon-fit": "^0.11.0",
|
|
63
|
+
"@xterm/xterm": "^6.0.0",
|
|
61
64
|
"bash-language-server": "^5.4.2",
|
|
62
65
|
"better-sqlite3": "^12.8.0",
|
|
63
66
|
"cors": "^2.8.5",
|
|
@@ -65,6 +68,7 @@
|
|
|
65
68
|
"fast-glob": "^3.3.3",
|
|
66
69
|
"gray-matter": "^4.0.3",
|
|
67
70
|
"html2canvas": "^1.4.1",
|
|
71
|
+
"http-proxy": "^1.18.1",
|
|
68
72
|
"ignore": "^7.0.5",
|
|
69
73
|
"node-pty": "^1.2.0-beta.12",
|
|
70
74
|
"open": "^11.0.0",
|
|
@@ -95,6 +99,7 @@
|
|
|
95
99
|
"@testing-library/react": "^16.3.2",
|
|
96
100
|
"@testing-library/user-event": "^14.6.1",
|
|
97
101
|
"@types/better-sqlite3": "^7.6.13",
|
|
102
|
+
"@types/http-proxy": "^1.17.17",
|
|
98
103
|
"@types/node": "^22.19.15",
|
|
99
104
|
"@types/react": "^19.0.8",
|
|
100
105
|
"@types/react-dom": "^19.0.3",
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
applyGeneratedSessionName,
|
|
2
3
|
buildRunChatTurnParams,
|
|
3
4
|
finalizeTurnCompletion,
|
|
4
|
-
getSessionMessageCount
|
|
5
|
-
} from "./chunk-2L4DPLCM.js";
|
|
6
|
-
import {
|
|
7
|
-
applyGeneratedSessionName,
|
|
8
5
|
generateSessionName,
|
|
6
|
+
getSessionMessageCount,
|
|
9
7
|
needsNameGenerationCheck
|
|
10
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GIPCUPTT.js";
|
|
11
9
|
import {
|
|
12
10
|
getEventStore
|
|
13
11
|
} from "./chunk-UQGY56XJ.js";
|
|
@@ -15,9 +13,9 @@ import "./chunk-LIMBYVO4.js";
|
|
|
15
13
|
import {
|
|
16
14
|
createChatMessageMessage,
|
|
17
15
|
createSessionRunningMessage
|
|
18
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KFBIHS3S.js";
|
|
19
17
|
import "./chunk-BLNFJ22S.js";
|
|
20
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-CTAIXOZJ.js";
|
|
21
19
|
import "./chunk-TVQOONDR.js";
|
|
22
20
|
import {
|
|
23
21
|
logger
|
|
@@ -175,7 +173,7 @@ var QueueProcessor = class {
|
|
|
175
173
|
backend: provider?.backend ?? llmClient.getBackend(),
|
|
176
174
|
model: llmClient.getModel()
|
|
177
175
|
};
|
|
178
|
-
const { runChatTurn } = await import("./orchestrator-
|
|
176
|
+
const { runChatTurn } = await import("./orchestrator-TA4MAODB.js");
|
|
179
177
|
const runChatTurnParams = buildRunChatTurnParams({
|
|
180
178
|
sessionManager,
|
|
181
179
|
sessionId,
|
|
@@ -208,4 +206,4 @@ var QueueProcessor = class {
|
|
|
208
206
|
export {
|
|
209
207
|
QueueProcessor
|
|
210
208
|
};
|
|
211
|
-
//# sourceMappingURL=processor-
|
|
209
|
+
//# sourceMappingURL=processor-R3FG6O6H.js.map
|
|
@@ -29,19 +29,14 @@ import {
|
|
|
29
29
|
createSessionRunningMessage,
|
|
30
30
|
createSessionStateMessage,
|
|
31
31
|
isAskAnswerPayload,
|
|
32
|
-
isChatSendPayload,
|
|
33
|
-
isCriteriaEditPayload,
|
|
34
|
-
isModeSwitchPayload,
|
|
35
32
|
isPathConfirmPayload,
|
|
36
|
-
isQueueAsapPayload,
|
|
37
|
-
isQueueCancelPayload,
|
|
38
|
-
isQueueCompletionPayload,
|
|
39
33
|
isSessionLoadPayload,
|
|
34
|
+
isUIFeedbackPayload,
|
|
40
35
|
parseClientMessage,
|
|
41
36
|
serializeServerMessage,
|
|
42
37
|
storedEventToServerMessage
|
|
43
|
-
} from "./chunk-
|
|
44
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-KFBIHS3S.js";
|
|
39
|
+
import "./chunk-CTAIXOZJ.js";
|
|
45
40
|
export {
|
|
46
41
|
createChatAskUserMessage,
|
|
47
42
|
createChatDeltaMessage,
|
|
@@ -73,16 +68,11 @@ export {
|
|
|
73
68
|
createSessionRunningMessage,
|
|
74
69
|
createSessionStateMessage,
|
|
75
70
|
isAskAnswerPayload,
|
|
76
|
-
isChatSendPayload,
|
|
77
|
-
isCriteriaEditPayload,
|
|
78
|
-
isModeSwitchPayload,
|
|
79
71
|
isPathConfirmPayload,
|
|
80
|
-
isQueueAsapPayload,
|
|
81
|
-
isQueueCancelPayload,
|
|
82
|
-
isQueueCompletionPayload,
|
|
83
72
|
isSessionLoadPayload,
|
|
73
|
+
isUIFeedbackPayload,
|
|
84
74
|
parseClientMessage,
|
|
85
75
|
serializeServerMessage,
|
|
86
76
|
storedEventToServerMessage
|
|
87
77
|
};
|
|
88
|
-
//# sourceMappingURL=protocol-
|
|
78
|
+
//# sourceMappingURL=protocol-5AWNGFLH.js.map
|