openfox 1.6.96 → 1.6.98
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-M2LTRUXL.js → auto-compaction-ZYKJQPGM.js} +4 -4
- package/dist/{chat-handler-WEG7W3OY.js → chat-handler-N3FYFHYQ.js} +7 -7
- package/dist/{chunk-RREZKLOD.js → chunk-7Y3HFCTD.js} +3 -3
- package/dist/{chunk-2BEPXMWB.js → chunk-I2EVVAG4.js} +2 -2
- package/dist/{chunk-OBJE2622.js → chunk-K7F73QLL.js} +3 -3
- package/dist/{chunk-BK7QEUQF.js → chunk-KR7N2ONG.js} +4 -4
- package/dist/{chunk-EXRMBJME.js → chunk-LC6HW727.js} +122 -96
- package/dist/{chunk-QAN42RJQ.js → chunk-NVVKBL4S.js} +2 -2
- package/dist/{chunk-QWGO6DE3.js → chunk-ROWFVGB6.js} +5 -1
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{events-2UP7O6LW.js → events-Z2SXIOUX.js} +2 -2
- package/dist/{orchestrator-JNDOPIVQ.js → orchestrator-2A6RG6ZR.js} +5 -5
- package/dist/package.json +1 -1
- package/dist/{processor-GISJIZH7.js → processor-V34TTHI2.js} +4 -4
- package/dist/{serve-O5JK3PNM.js → serve-FD3A43KR.js} +6 -6
- package/dist/server/index.js +5 -5
- package/dist/{settings-RMRS6GEW.js → settings-TTYCUHWU.js} +2 -2
- package/dist/{tools-UFAPVX45.js → tools-ASM4FNUG.js} +4 -4
- package/dist/web/assets/{index-C2E3ZO-C.js → index-BhmZRmbE.js} +70 -69
- package/dist/web/assets/{index-FSFABXQ1.css → index-D3nUB0zb.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createVerifierNudgeConfig,
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-K7F73QLL.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-KR7N2ONG.js";
|
|
50
50
|
import {
|
|
51
51
|
getProject
|
|
52
52
|
} from "./chunk-ZHBL5G5X.js";
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
updateSessionProvider,
|
|
97
97
|
updateSessionRunning,
|
|
98
98
|
updateSessionSummary
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-7Y3HFCTD.js";
|
|
100
100
|
import {
|
|
101
101
|
initDatabase
|
|
102
102
|
} from "./chunk-5GVCNVKV.js";
|
|
@@ -146,7 +146,7 @@ import express from "express";
|
|
|
146
146
|
import cors from "cors";
|
|
147
147
|
import { createServer as createHttpServer } from "http";
|
|
148
148
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
149
|
-
import { dirname as
|
|
149
|
+
import { dirname as dirname6, resolve as resolve2, join as join7 } from "path";
|
|
150
150
|
import { readFile as readFile3 } from "fs/promises";
|
|
151
151
|
import { createServer as createViteServer } from "vite";
|
|
152
152
|
|
|
@@ -1670,7 +1670,7 @@ var TERMINAL_BLOCKED = "$blocked";
|
|
|
1670
1670
|
|
|
1671
1671
|
// src/server/workflows/shell.ts
|
|
1672
1672
|
function executeShellCommand(command, cwd, timeout, signal) {
|
|
1673
|
-
return new Promise((
|
|
1673
|
+
return new Promise((resolve3, reject) => {
|
|
1674
1674
|
if (checkAborted(signal)) {
|
|
1675
1675
|
reject(new Error("Aborted"));
|
|
1676
1676
|
return;
|
|
@@ -1682,7 +1682,7 @@ function executeShellCommand(command, cwd, timeout, signal) {
|
|
|
1682
1682
|
const timer = setTimeout(() => {
|
|
1683
1683
|
killed = true;
|
|
1684
1684
|
proc.kill("SIGTERM");
|
|
1685
|
-
|
|
1685
|
+
resolve3({ exitCode: 1, stdout, stderr: stderr + "\nCommand timed out", success: false });
|
|
1686
1686
|
}, timeout);
|
|
1687
1687
|
const onAbort = () => {
|
|
1688
1688
|
if (!killed) {
|
|
@@ -1704,13 +1704,13 @@ function executeShellCommand(command, cwd, timeout, signal) {
|
|
|
1704
1704
|
signal?.removeEventListener("abort", onAbort);
|
|
1705
1705
|
if (killed) return;
|
|
1706
1706
|
const exitCode = code ?? 1;
|
|
1707
|
-
|
|
1707
|
+
resolve3({ exitCode, stdout, stderr, success: exitCode === 0 });
|
|
1708
1708
|
});
|
|
1709
1709
|
proc.on("error", (err) => {
|
|
1710
1710
|
clearTimeout(timer);
|
|
1711
1711
|
signal?.removeEventListener("abort", onAbort);
|
|
1712
1712
|
if (killed) return;
|
|
1713
|
-
|
|
1713
|
+
resolve3({ exitCode: 1, stdout, stderr: err.message, success: false });
|
|
1714
1714
|
});
|
|
1715
1715
|
});
|
|
1716
1716
|
}
|
|
@@ -2304,7 +2304,7 @@ async function isValidToken(token) {
|
|
|
2304
2304
|
|
|
2305
2305
|
// src/server/ws/server.ts
|
|
2306
2306
|
function moduleGitBranch(cwd) {
|
|
2307
|
-
return new Promise((
|
|
2307
|
+
return new Promise((resolve3) => {
|
|
2308
2308
|
const proc = spawn2("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
2309
2309
|
cwd,
|
|
2310
2310
|
stdio: ["ignore", "pipe", "ignore"]
|
|
@@ -2315,16 +2315,16 @@ function moduleGitBranch(cwd) {
|
|
|
2315
2315
|
});
|
|
2316
2316
|
proc.on("close", (code) => {
|
|
2317
2317
|
if (code === 0 && stdout.trim()) {
|
|
2318
|
-
|
|
2318
|
+
resolve3(stdout.trim());
|
|
2319
2319
|
} else {
|
|
2320
|
-
|
|
2320
|
+
resolve3(null);
|
|
2321
2321
|
}
|
|
2322
2322
|
});
|
|
2323
|
-
proc.on("error", () =>
|
|
2323
|
+
proc.on("error", () => resolve3(null));
|
|
2324
2324
|
});
|
|
2325
2325
|
}
|
|
2326
2326
|
function moduleGitDiff(cwd) {
|
|
2327
|
-
return new Promise((
|
|
2327
|
+
return new Promise((resolve3) => {
|
|
2328
2328
|
const proc = spawn2("git", ["diff", "--stat", "--numstat", "--format=", "HEAD"], {
|
|
2329
2329
|
cwd,
|
|
2330
2330
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -2347,7 +2347,7 @@ function moduleGitDiff(cwd) {
|
|
|
2347
2347
|
let statusCode = null;
|
|
2348
2348
|
const processResults = () => {
|
|
2349
2349
|
if (diffCode !== 0 || statusCode !== 0) {
|
|
2350
|
-
|
|
2350
|
+
resolve3({ hash: "", files: [] });
|
|
2351
2351
|
return;
|
|
2352
2352
|
}
|
|
2353
2353
|
const hashProc = spawn2("git", ["rev-parse", "HEAD"], { cwd, stdio: ["ignore", "pipe", "ignore"] });
|
|
@@ -2387,7 +2387,7 @@ function moduleGitDiff(cwd) {
|
|
|
2387
2387
|
deletions: 0
|
|
2388
2388
|
});
|
|
2389
2389
|
}
|
|
2390
|
-
|
|
2390
|
+
resolve3({ hash: hash.trim(), files });
|
|
2391
2391
|
};
|
|
2392
2392
|
proc.on("close", (code) => {
|
|
2393
2393
|
procExited = true;
|
|
@@ -2399,10 +2399,10 @@ function moduleGitDiff(cwd) {
|
|
|
2399
2399
|
statusCode = code;
|
|
2400
2400
|
if (procExited) processResults();
|
|
2401
2401
|
});
|
|
2402
|
-
proc.on("error", () =>
|
|
2402
|
+
proc.on("error", () => resolve3({ hash: "", files: [] }));
|
|
2403
2403
|
statusProc.on("error", () => {
|
|
2404
2404
|
if (!procExited) {
|
|
2405
|
-
|
|
2405
|
+
resolve3({ hash: "", files: [] });
|
|
2406
2406
|
}
|
|
2407
2407
|
});
|
|
2408
2408
|
});
|
|
@@ -3360,19 +3360,19 @@ var LspServer = class {
|
|
|
3360
3360
|
*/
|
|
3361
3361
|
async getDiagnosticsWithWait(path, timeoutMs = DIAGNOSTIC_WAIT_MS) {
|
|
3362
3362
|
if (this.openDocuments.has(path)) {
|
|
3363
|
-
return new Promise((
|
|
3363
|
+
return new Promise((resolve3) => {
|
|
3364
3364
|
const existing = this.diagnostics.get(path);
|
|
3365
3365
|
if (existing !== void 0) {
|
|
3366
3366
|
setTimeout(() => {
|
|
3367
|
-
|
|
3367
|
+
resolve3(this.diagnostics.get(path) ?? []);
|
|
3368
3368
|
}, 100);
|
|
3369
3369
|
return;
|
|
3370
3370
|
}
|
|
3371
3371
|
const timeout = setTimeout(() => {
|
|
3372
3372
|
this.pendingDiagnostics.delete(path);
|
|
3373
|
-
|
|
3373
|
+
resolve3(this.diagnostics.get(path) ?? []);
|
|
3374
3374
|
}, timeoutMs);
|
|
3375
|
-
this.pendingDiagnostics.set(path, { resolve:
|
|
3375
|
+
this.pendingDiagnostics.set(path, { resolve: resolve3, timeout });
|
|
3376
3376
|
});
|
|
3377
3377
|
}
|
|
3378
3378
|
return this.diagnostics.get(path) ?? [];
|
|
@@ -5342,17 +5342,54 @@ function createTerminalRoutes() {
|
|
|
5342
5342
|
return router;
|
|
5343
5343
|
}
|
|
5344
5344
|
|
|
5345
|
-
// src/server/routes/
|
|
5345
|
+
// src/server/routes/directories.ts
|
|
5346
5346
|
import { Router as Router5 } from "express";
|
|
5347
|
+
import { readdir as readdir2 } from "fs/promises";
|
|
5348
|
+
import { resolve, join as join6, dirname as dirname5, basename as basename2 } from "path";
|
|
5349
|
+
function createDirectoryRoutes() {
|
|
5350
|
+
const router = Router5();
|
|
5351
|
+
const DEFAULT_BASE_PATH = process.cwd();
|
|
5352
|
+
router.get("/", async (req, res) => {
|
|
5353
|
+
const path = req.query["path"] || DEFAULT_BASE_PATH;
|
|
5354
|
+
try {
|
|
5355
|
+
const resolvedPath = resolve(path);
|
|
5356
|
+
const entries = await readdir2(resolvedPath, { withFileTypes: true });
|
|
5357
|
+
const directories = entries.filter((entry) => entry.isDirectory()).map((entry) => ({
|
|
5358
|
+
name: entry.name,
|
|
5359
|
+
path: join6(resolvedPath, entry.name)
|
|
5360
|
+
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
5361
|
+
const parent = dirname5(resolvedPath);
|
|
5362
|
+
const hasParent = parent !== resolvedPath;
|
|
5363
|
+
res.json({
|
|
5364
|
+
current: resolvedPath,
|
|
5365
|
+
parent: hasParent ? parent : null,
|
|
5366
|
+
directories,
|
|
5367
|
+
basename: basename2(resolvedPath)
|
|
5368
|
+
});
|
|
5369
|
+
} catch {
|
|
5370
|
+
res.status(400).json({
|
|
5371
|
+
error: "Cannot read directory",
|
|
5372
|
+
current: DEFAULT_BASE_PATH,
|
|
5373
|
+
parent: null,
|
|
5374
|
+
directories: [],
|
|
5375
|
+
basename: basename2(DEFAULT_BASE_PATH)
|
|
5376
|
+
});
|
|
5377
|
+
}
|
|
5378
|
+
});
|
|
5379
|
+
return router;
|
|
5380
|
+
}
|
|
5381
|
+
|
|
5382
|
+
// src/server/routes/auto-update.ts
|
|
5383
|
+
import { Router as Router6 } from "express";
|
|
5347
5384
|
import { spawn as spawn4 } from "child_process";
|
|
5348
5385
|
|
|
5349
5386
|
// src/constants.ts
|
|
5350
|
-
var VERSION = "1.6.
|
|
5387
|
+
var VERSION = "1.6.98";
|
|
5351
5388
|
|
|
5352
5389
|
// src/server/routes/auto-update.ts
|
|
5353
5390
|
var updateInProgress = false;
|
|
5354
5391
|
function createAutoUpdateRoutes(options = {}) {
|
|
5355
|
-
const router =
|
|
5392
|
+
const router = Router6();
|
|
5356
5393
|
router.get("/check", async (req, res) => {
|
|
5357
5394
|
const isTest = req.query["test"] === "1";
|
|
5358
5395
|
const current = VERSION;
|
|
@@ -5361,7 +5398,7 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
5361
5398
|
return;
|
|
5362
5399
|
}
|
|
5363
5400
|
try {
|
|
5364
|
-
const latest = await new Promise((
|
|
5401
|
+
const latest = await new Promise((resolve3, reject) => {
|
|
5365
5402
|
const child = spawn4("npm", ["view", "openfox", "version"], {
|
|
5366
5403
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5367
5404
|
});
|
|
@@ -5371,7 +5408,7 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
5371
5408
|
});
|
|
5372
5409
|
child.on("close", (code) => {
|
|
5373
5410
|
if (code === 0) {
|
|
5374
|
-
|
|
5411
|
+
resolve3(stdout.trim());
|
|
5375
5412
|
} else {
|
|
5376
5413
|
reject(new Error(`npm view exited with code ${code}`));
|
|
5377
5414
|
}
|
|
@@ -5432,7 +5469,7 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
5432
5469
|
}
|
|
5433
5470
|
|
|
5434
5471
|
// src/server/index.ts
|
|
5435
|
-
var __dirname2 =
|
|
5472
|
+
var __dirname2 = dirname6(fileURLToPath4(import.meta.url));
|
|
5436
5473
|
async function createServerHandle(config4) {
|
|
5437
5474
|
setRuntimeConfig(config4);
|
|
5438
5475
|
setLogLevel(config4.logging?.level ?? void 0, config4.mode);
|
|
@@ -5644,7 +5681,7 @@ async function createServerHandle(config4) {
|
|
|
5644
5681
|
res.json({ project });
|
|
5645
5682
|
});
|
|
5646
5683
|
app.get("/api/sessions", async (req, res) => {
|
|
5647
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
5684
|
+
const { getRecentUserPromptsForSession } = await import("./events-Z2SXIOUX.js");
|
|
5648
5685
|
const projectId = req.query["projectId"];
|
|
5649
5686
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
5650
5687
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -5677,7 +5714,7 @@ async function createServerHandle(config4) {
|
|
|
5677
5714
|
res.status(201).json({ session });
|
|
5678
5715
|
});
|
|
5679
5716
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
5680
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5717
|
+
const { getEventStore: getEventStore2 } = await import("./events-Z2SXIOUX.js");
|
|
5681
5718
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-4VHGQE6Y.js");
|
|
5682
5719
|
const session = sessionManager.getSession(req.params.id);
|
|
5683
5720
|
if (!session) {
|
|
@@ -5708,7 +5745,7 @@ async function createServerHandle(config4) {
|
|
|
5708
5745
|
res.json({ success: true });
|
|
5709
5746
|
});
|
|
5710
5747
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
5711
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5748
|
+
const { getEventStore: getEventStore2 } = await import("./events-Z2SXIOUX.js");
|
|
5712
5749
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-4VHGQE6Y.js");
|
|
5713
5750
|
const sessionId = req.params.id;
|
|
5714
5751
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -5746,7 +5783,7 @@ async function createServerHandle(config4) {
|
|
|
5746
5783
|
res.json({ success: true });
|
|
5747
5784
|
});
|
|
5748
5785
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
5749
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5786
|
+
const { getEventStore: getEventStore2 } = await import("./events-Z2SXIOUX.js");
|
|
5750
5787
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-4VHGQE6Y.js");
|
|
5751
5788
|
const sessionId = req.params.id;
|
|
5752
5789
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -5803,12 +5840,12 @@ async function createServerHandle(config4) {
|
|
|
5803
5840
|
if (!callId || approved === void 0) {
|
|
5804
5841
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5805
5842
|
}
|
|
5806
|
-
const { providePathConfirmation } = await import("./tools-
|
|
5843
|
+
const { providePathConfirmation } = await import("./tools-ASM4FNUG.js");
|
|
5807
5844
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
5808
5845
|
if (!result.found) {
|
|
5809
5846
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
5810
5847
|
}
|
|
5811
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5848
|
+
const { getEventStore: getEventStore2 } = await import("./events-Z2SXIOUX.js");
|
|
5812
5849
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-4VHGQE6Y.js");
|
|
5813
5850
|
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-FZUIA4BS.js");
|
|
5814
5851
|
const eventStore = getEventStore2();
|
|
@@ -5827,7 +5864,7 @@ async function createServerHandle(config4) {
|
|
|
5827
5864
|
if (!callId || !answer) {
|
|
5828
5865
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
5829
5866
|
}
|
|
5830
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
5867
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-ASM4FNUG.js");
|
|
5831
5868
|
const found = provideAnswer2(callId, answer);
|
|
5832
5869
|
if (!found) {
|
|
5833
5870
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5863,14 +5900,14 @@ async function createServerHandle(config4) {
|
|
|
5863
5900
|
if (!session) {
|
|
5864
5901
|
return res.status(404).json({ error: "Session not found" });
|
|
5865
5902
|
}
|
|
5866
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5867
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5903
|
+
const { stopSessionExecution } = await import("./chat-handler-N3FYFHYQ.js");
|
|
5904
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-ASM4FNUG.js");
|
|
5868
5905
|
stopSessionExecution(sessionId, sessionManager);
|
|
5869
5906
|
abortSession(sessionId);
|
|
5870
5907
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
5871
5908
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
5872
5909
|
sessionManager.clearMessageQueue(sessionId);
|
|
5873
|
-
const eventStore = (await import("./events-
|
|
5910
|
+
const eventStore = (await import("./events-Z2SXIOUX.js")).getEventStore();
|
|
5874
5911
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
5875
5912
|
res.json({ success: true });
|
|
5876
5913
|
});
|
|
@@ -5884,10 +5921,29 @@ async function createServerHandle(config4) {
|
|
|
5884
5921
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
5885
5922
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
5886
5923
|
}
|
|
5887
|
-
const { truncateSessionMessages } = await import("./events-
|
|
5924
|
+
const { truncateSessionMessages } = await import("./events-Z2SXIOUX.js");
|
|
5888
5925
|
truncateSessionMessages(sessionId, messageIndex);
|
|
5889
5926
|
res.json({ success: true });
|
|
5890
5927
|
});
|
|
5928
|
+
app.post("/api/sessions/:id/replay", async (req, res) => {
|
|
5929
|
+
const sessionId = req.params.id;
|
|
5930
|
+
const session = sessionManager.getSession(sessionId);
|
|
5931
|
+
if (!session) {
|
|
5932
|
+
return res.status(404).json({ error: "Session not found" });
|
|
5933
|
+
}
|
|
5934
|
+
const { messageIndex } = req.body;
|
|
5935
|
+
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
5936
|
+
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
5937
|
+
}
|
|
5938
|
+
const msg = session.messages[messageIndex];
|
|
5939
|
+
if (!msg) {
|
|
5940
|
+
return res.status(400).json({ error: "Message not found at this index" });
|
|
5941
|
+
}
|
|
5942
|
+
const { truncateSessionMessages } = await import("./events-Z2SXIOUX.js");
|
|
5943
|
+
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
5944
|
+
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
5945
|
+
res.json({ success: true });
|
|
5946
|
+
});
|
|
5891
5947
|
app.post("/api/sessions/:id/chat", async (req, res) => {
|
|
5892
5948
|
const sessionId = req.params.id;
|
|
5893
5949
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -5915,7 +5971,7 @@ async function createServerHandle(config4) {
|
|
|
5915
5971
|
res.json({ accepted: true });
|
|
5916
5972
|
});
|
|
5917
5973
|
app.get("/api/settings", async (req, res) => {
|
|
5918
|
-
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-
|
|
5974
|
+
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-TTYCUHWU.js");
|
|
5919
5975
|
const keysParam = req.query["keys"];
|
|
5920
5976
|
if (!keysParam) {
|
|
5921
5977
|
return res.status(400).json({ error: "keys query parameter is required" });
|
|
@@ -5928,19 +5984,19 @@ async function createServerHandle(config4) {
|
|
|
5928
5984
|
res.json(result);
|
|
5929
5985
|
});
|
|
5930
5986
|
app.get("/api/settings/:key", async (req, res) => {
|
|
5931
|
-
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-
|
|
5987
|
+
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-TTYCUHWU.js");
|
|
5932
5988
|
const key = req.params.key;
|
|
5933
5989
|
const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
5934
5990
|
res.json({ key, value });
|
|
5935
5991
|
});
|
|
5936
5992
|
app.get("/api/settings/:key", async (req, res) => {
|
|
5937
|
-
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-
|
|
5993
|
+
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-TTYCUHWU.js");
|
|
5938
5994
|
const key = req.params.key;
|
|
5939
5995
|
const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
5940
5996
|
res.json({ key, value });
|
|
5941
5997
|
});
|
|
5942
5998
|
app.put("/api/settings/:key", async (req, res) => {
|
|
5943
|
-
const { setSetting } = await import("./settings-
|
|
5999
|
+
const { setSetting } = await import("./settings-TTYCUHWU.js");
|
|
5944
6000
|
const key = req.params.key;
|
|
5945
6001
|
const { value } = req.body;
|
|
5946
6002
|
if (value === void 0) {
|
|
@@ -6236,42 +6292,15 @@ async function createServerHandle(config4) {
|
|
|
6236
6292
|
app.get("/api/branch", async (req, res) => {
|
|
6237
6293
|
await getCurrentBranch(req, res);
|
|
6238
6294
|
});
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
const path = req.query["path"] || DEFAULT_BASE_PATH;
|
|
6242
|
-
try {
|
|
6243
|
-
const resolvedPath = resolve(path);
|
|
6244
|
-
const entries = await import("fs/promises").then((m) => m.readdir(resolvedPath, { withFileTypes: true }));
|
|
6245
|
-
const directories = entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => ({
|
|
6246
|
-
name: entry.name,
|
|
6247
|
-
path: join6(resolvedPath, entry.name)
|
|
6248
|
-
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
6249
|
-
const parent = dirname5(resolvedPath);
|
|
6250
|
-
const hasParent = parent !== resolvedPath;
|
|
6251
|
-
res.json({
|
|
6252
|
-
current: resolvedPath,
|
|
6253
|
-
parent: hasParent ? parent : null,
|
|
6254
|
-
directories,
|
|
6255
|
-
basename: basename2(resolvedPath)
|
|
6256
|
-
});
|
|
6257
|
-
} catch {
|
|
6258
|
-
res.status(400).json({
|
|
6259
|
-
error: "Cannot read directory",
|
|
6260
|
-
current: DEFAULT_BASE_PATH,
|
|
6261
|
-
parent: null,
|
|
6262
|
-
directories: [],
|
|
6263
|
-
basename: basename2(DEFAULT_BASE_PATH)
|
|
6264
|
-
});
|
|
6265
|
-
}
|
|
6266
|
-
});
|
|
6267
|
-
const webDir = resolve(__dirname2, "../../web");
|
|
6295
|
+
app.use("/api/directories", createDirectoryRoutes());
|
|
6296
|
+
const webDir = resolve2(__dirname2, "../../web");
|
|
6268
6297
|
const isDev = config4.mode === "development";
|
|
6269
6298
|
let viteServer;
|
|
6270
6299
|
if (isDev) {
|
|
6271
6300
|
logger.info("Dev mode: using Vite middleware");
|
|
6272
6301
|
viteServer = await createViteServer({
|
|
6273
6302
|
root: webDir,
|
|
6274
|
-
configFile:
|
|
6303
|
+
configFile: resolve2(__dirname2, "../../web/vite.config.ts"),
|
|
6275
6304
|
server: { middlewareMode: true },
|
|
6276
6305
|
appType: "spa",
|
|
6277
6306
|
logLevel: "warn"
|
|
@@ -6291,7 +6320,7 @@ async function createServerHandle(config4) {
|
|
|
6291
6320
|
}
|
|
6292
6321
|
});
|
|
6293
6322
|
app.get("/fox.svg", (_req, res) => {
|
|
6294
|
-
readFile3(
|
|
6323
|
+
readFile3(join7(webDir, "fox.svg")).then((content) => {
|
|
6295
6324
|
res.set("Content-Type", "image/svg+xml");
|
|
6296
6325
|
res.send(content);
|
|
6297
6326
|
}).catch(() => {
|
|
@@ -6300,7 +6329,7 @@ async function createServerHandle(config4) {
|
|
|
6300
6329
|
});
|
|
6301
6330
|
app.use(
|
|
6302
6331
|
"/sounds",
|
|
6303
|
-
express.static(
|
|
6332
|
+
express.static(join7(webDir, "public", "sounds"), {
|
|
6304
6333
|
setHeaders: (res) => {
|
|
6305
6334
|
res.set("Content-Type", "audio/mpeg");
|
|
6306
6335
|
}
|
|
@@ -6309,13 +6338,13 @@ async function createServerHandle(config4) {
|
|
|
6309
6338
|
app.use("/__inspect__.js", (_req, res) => {
|
|
6310
6339
|
res.set("Access-Control-Allow-Origin", "*");
|
|
6311
6340
|
res.set("Content-Type", "application/javascript");
|
|
6312
|
-
readFile3(
|
|
6341
|
+
readFile3(join7(webDir, "public", "__inspect__.js")).then((content) => res.send(content)).catch(() => res.status(404).send("Not found"));
|
|
6313
6342
|
});
|
|
6314
6343
|
app.get("/*path", (req, res) => {
|
|
6315
6344
|
if (req.path.startsWith("/api/")) {
|
|
6316
6345
|
return;
|
|
6317
6346
|
}
|
|
6318
|
-
readFile3(
|
|
6347
|
+
readFile3(join7(webDir, "index.html"), "utf-8").then((indexHtml) => viteServer.transformIndexHtml(req.originalUrl, indexHtml)).then((transformed) => res.send(transformed)).catch((err) => {
|
|
6319
6348
|
logger.error("Error serving index.html", { error: err });
|
|
6320
6349
|
res.status(500).send("Server error");
|
|
6321
6350
|
});
|
|
@@ -6323,10 +6352,10 @@ async function createServerHandle(config4) {
|
|
|
6323
6352
|
logger.info("Vite middleware ready", { port: config4.server.port });
|
|
6324
6353
|
}
|
|
6325
6354
|
if (!isDev) {
|
|
6326
|
-
const distWebDir =
|
|
6355
|
+
const distWebDir = resolve2(__dirname2, "web");
|
|
6327
6356
|
app.use(
|
|
6328
6357
|
"/assets",
|
|
6329
|
-
express.static(
|
|
6358
|
+
express.static(join7(distWebDir, "assets"), {
|
|
6330
6359
|
setHeaders: (res, filepath) => {
|
|
6331
6360
|
if (filepath.endsWith(".css")) {
|
|
6332
6361
|
res.set("Content-Type", "text/css");
|
|
@@ -6334,11 +6363,11 @@ async function createServerHandle(config4) {
|
|
|
6334
6363
|
}
|
|
6335
6364
|
})
|
|
6336
6365
|
);
|
|
6337
|
-
app.use("/manifest.webmanifest", express.static(
|
|
6338
|
-
app.use("/registerSW.js", express.static(
|
|
6339
|
-
app.use("/sw.js", express.static(
|
|
6366
|
+
app.use("/manifest.webmanifest", express.static(join7(distWebDir, "manifest.webmanifest")));
|
|
6367
|
+
app.use("/registerSW.js", express.static(join7(distWebDir, "registerSW.js")));
|
|
6368
|
+
app.use("/sw.js", express.static(join7(distWebDir, "sw.js")));
|
|
6340
6369
|
app.get("/fox.svg", (_req, res) => {
|
|
6341
|
-
readFile3(
|
|
6370
|
+
readFile3(join7(distWebDir, "fox.svg")).then((content) => {
|
|
6342
6371
|
res.set("Content-Type", "image/svg+xml");
|
|
6343
6372
|
res.send(content);
|
|
6344
6373
|
}).catch(() => {
|
|
@@ -6347,7 +6376,7 @@ async function createServerHandle(config4) {
|
|
|
6347
6376
|
});
|
|
6348
6377
|
app.use(
|
|
6349
6378
|
"/sounds",
|
|
6350
|
-
express.static(
|
|
6379
|
+
express.static(join7(distWebDir, "sounds"), {
|
|
6351
6380
|
setHeaders: (res) => {
|
|
6352
6381
|
res.set("Content-Type", "audio/mpeg");
|
|
6353
6382
|
}
|
|
@@ -6356,15 +6385,15 @@ async function createServerHandle(config4) {
|
|
|
6356
6385
|
app.use("/__inspect__.js", (_req, res) => {
|
|
6357
6386
|
res.set("Access-Control-Allow-Origin", "*");
|
|
6358
6387
|
res.set("Content-Type", "application/javascript");
|
|
6359
|
-
readFile3(
|
|
6388
|
+
readFile3(join7(distWebDir, "__inspect__.js")).then((content) => res.send(content)).catch(() => res.status(404).send("Not found"));
|
|
6360
6389
|
});
|
|
6361
6390
|
app.use("/__inspect__.js", (_req, res) => {
|
|
6362
6391
|
res.set("Access-Control-Allow-Origin", "*");
|
|
6363
6392
|
res.set("Content-Type", "application/javascript");
|
|
6364
|
-
readFile3(
|
|
6393
|
+
readFile3(join7(distWebDir, "__inspect__.js")).then((content) => res.send(content)).catch(() => res.status(404).send("Not found"));
|
|
6365
6394
|
});
|
|
6366
6395
|
app.get("/", (_req, res) => {
|
|
6367
|
-
readFile3(
|
|
6396
|
+
readFile3(join7(distWebDir, "index.html"), "utf-8").then((content) => res.send(content)).catch(() => {
|
|
6368
6397
|
res.status(404).send("Web UI not built. Run `npm run build:web`");
|
|
6369
6398
|
});
|
|
6370
6399
|
});
|
|
@@ -6372,7 +6401,7 @@ async function createServerHandle(config4) {
|
|
|
6372
6401
|
if (req.path.startsWith("/api/") || req.path.startsWith("/assets/") || req.path.startsWith("/sounds/") || req.path.startsWith("/manifest.webmanifest") || req.path.startsWith("/registerSW.js") || req.path.startsWith("/sw.js") || req.path === "/fox.svg") {
|
|
6373
6402
|
return;
|
|
6374
6403
|
}
|
|
6375
|
-
readFile3(
|
|
6404
|
+
readFile3(join7(distWebDir, "index.html"), "utf-8").then((content) => res.send(content)).catch(() => {
|
|
6376
6405
|
res.status(404).send("Web UI not built");
|
|
6377
6406
|
});
|
|
6378
6407
|
});
|
|
@@ -6387,7 +6416,7 @@ async function createServerHandle(config4) {
|
|
|
6387
6416
|
providerManager
|
|
6388
6417
|
);
|
|
6389
6418
|
const wss = wssExports.wss;
|
|
6390
|
-
const { QueueProcessor } = await import("./processor-
|
|
6419
|
+
const { QueueProcessor } = await import("./processor-V34TTHI2.js");
|
|
6391
6420
|
const queueProcessor = new QueueProcessor({
|
|
6392
6421
|
sessionManager,
|
|
6393
6422
|
providerManager,
|
|
@@ -6407,7 +6436,7 @@ async function createServerHandle(config4) {
|
|
|
6407
6436
|
return {
|
|
6408
6437
|
httpServer,
|
|
6409
6438
|
ctx: { config: config4, sessionManager, llmClient: getLLMClient(), toolRegistry, providerManager },
|
|
6410
|
-
start: (port) => new Promise((
|
|
6439
|
+
start: (port) => new Promise((resolve3, reject) => {
|
|
6411
6440
|
const listenPort = port ?? config4.server.port;
|
|
6412
6441
|
const host = config4.server.host;
|
|
6413
6442
|
httpServer.listen(listenPort, host, () => {
|
|
@@ -6417,11 +6446,11 @@ async function createServerHandle(config4) {
|
|
|
6417
6446
|
logger.info(`OpenFox server running at http://${host}:${actualPort}`);
|
|
6418
6447
|
logger.info(`WebSocket available at ws://${host}:${actualPort}/ws`);
|
|
6419
6448
|
logger.info(`LLM backend: ${client.getBackend()}, model: ${client.getModel()}, url: ${config4.llm.baseUrl}`);
|
|
6420
|
-
|
|
6449
|
+
resolve3({ port: actualPort });
|
|
6421
6450
|
});
|
|
6422
6451
|
httpServer.on("error", reject);
|
|
6423
6452
|
}),
|
|
6424
|
-
close: () => new Promise((
|
|
6453
|
+
close: () => new Promise((resolve3) => {
|
|
6425
6454
|
logger.info("Shutting down...");
|
|
6426
6455
|
void (async () => {
|
|
6427
6456
|
await devServerManager.stopAll();
|
|
@@ -6434,7 +6463,7 @@ async function createServerHandle(config4) {
|
|
|
6434
6463
|
client.terminate();
|
|
6435
6464
|
}
|
|
6436
6465
|
wss.close();
|
|
6437
|
-
httpServer.close(() =>
|
|
6466
|
+
httpServer.close(() => resolve3());
|
|
6438
6467
|
})();
|
|
6439
6468
|
})
|
|
6440
6469
|
};
|
|
@@ -6453,13 +6482,10 @@ async function createServer(config4) {
|
|
|
6453
6482
|
process.on("SIGINT", shutdown);
|
|
6454
6483
|
process.on("SIGTERM", shutdown);
|
|
6455
6484
|
}
|
|
6456
|
-
function basename2(path) {
|
|
6457
|
-
return path.split("/").pop() || path.split("\\").pop() || path;
|
|
6458
|
-
}
|
|
6459
6485
|
|
|
6460
6486
|
export {
|
|
6461
6487
|
VERSION,
|
|
6462
6488
|
createServerHandle,
|
|
6463
6489
|
createServer
|
|
6464
6490
|
};
|
|
6465
|
-
//# sourceMappingURL=chunk-
|
|
6491
|
+
//# sourceMappingURL=chunk-LC6HW727.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEventStore,
|
|
3
3
|
updateSessionMetadata
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7Y3HFCTD.js";
|
|
5
5
|
import {
|
|
6
6
|
buildMessagesFromStoredEvents,
|
|
7
7
|
foldPendingConfirmations
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
needsNameGenerationCheck,
|
|
144
144
|
applyGeneratedSessionName
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-NVVKBL4S.js.map
|
|
@@ -13,6 +13,8 @@ var SETTINGS_KEYS = {
|
|
|
13
13
|
DISPLAY_SHOW_SYNTAX_HIGHLIGHTING: "display.showSyntaxHighlighting",
|
|
14
14
|
DISPLAY_THEME: "display.theme",
|
|
15
15
|
DISPLAY_USER_PRESETS: "display.userPresets",
|
|
16
|
+
DISPLAY_FOLLOW_SYSTEM_THEME: "display.followSystemTheme",
|
|
17
|
+
DISPLAY_SHOW_OPEN_IN_EDITOR: "display.showOpenInEditorLinks",
|
|
16
18
|
LLM_DISABLE_XML_PROTECTION: "llm.disableXmlProtection",
|
|
17
19
|
KEYBINDINGS: "keybindings"
|
|
18
20
|
};
|
|
@@ -24,6 +26,8 @@ var SETTINGS_DEFAULTS = {
|
|
|
24
26
|
[SETTINGS_KEYS.DISPLAY_SHOW_WORKFLOW_BARS]: "true",
|
|
25
27
|
[SETTINGS_KEYS.DISPLAY_SHOW_SYNTAX_HIGHLIGHTING]: "true",
|
|
26
28
|
[SETTINGS_KEYS.DISPLAY_THEME]: JSON.stringify({ preset: "dark" }),
|
|
29
|
+
[SETTINGS_KEYS.DISPLAY_FOLLOW_SYSTEM_THEME]: "true",
|
|
30
|
+
[SETTINGS_KEYS.DISPLAY_SHOW_OPEN_IN_EDITOR]: "false",
|
|
27
31
|
[SETTINGS_KEYS.LLM_DISABLE_XML_PROTECTION]: "false",
|
|
28
32
|
[SETTINGS_KEYS.KEYBINDINGS]: JSON.stringify({
|
|
29
33
|
terminalToggle: { type: "double-press", key: "Control", threshold: 300 },
|
|
@@ -82,4 +86,4 @@ export {
|
|
|
82
86
|
deleteSetting,
|
|
83
87
|
getAllSettings
|
|
84
88
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-ROWFVGB6.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
isStoredEvent,
|
|
38
38
|
isTurnEvent,
|
|
39
39
|
truncateSessionMessages
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-7Y3HFCTD.js";
|
|
41
41
|
import "./chunk-5GVCNVKV.js";
|
|
42
42
|
import {
|
|
43
43
|
buildContextMessagesFromEventHistory,
|
|
@@ -113,4 +113,4 @@ export {
|
|
|
113
113
|
isTurnEvent,
|
|
114
114
|
truncateSessionMessages
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=events-
|
|
116
|
+
//# sourceMappingURL=events-Z2SXIOUX.js.map
|