openfox 1.6.37 → 1.6.39
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-CQ66MD6K.js → auto-compaction-SCLHKKGA.js} +7 -7
- package/dist/{chat-handler-EJR4GKYO.js → chat-handler-7ARMDWRH.js} +11 -11
- package/dist/{chunk-WJ2DPSZK.js → chunk-2XRQ55GT.js} +31 -31
- package/dist/{chunk-26PIZX2A.js → chunk-5NJ5NQH5.js} +5 -5
- package/dist/{chunk-XKFPU2FA.js → chunk-7JPKRM6M.js} +2 -2
- package/dist/{chunk-AV45GQ7B.js → chunk-BHSTSA7U.js} +3 -3
- package/dist/{chunk-3EHGGBWE.js → chunk-BLNFJ22S.js} +7 -1
- package/dist/{chunk-EEPU4INU.js → chunk-LIMBYVO4.js} +192 -14
- package/dist/{chunk-ZGTXED6Q.js → chunk-NBBX64KC.js} +2 -2
- package/dist/{chunk-RN2O6JK7.js → chunk-O2BOWZKC.js} +2 -2
- package/dist/{chunk-VGFTDBWZ.js → chunk-SHQZ2M6R.js} +2 -2
- package/dist/{chunk-VFHCB5MC.js → chunk-TBSTW3PW.js} +4 -4
- package/dist/{chunk-PMDJEJYY.js → chunk-YVQ6DP5Y.js} +107 -15
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{events-LI4NAFRZ.js → events-FHPSSSE4.js} +4 -4
- package/dist/{folding-HRZMWP4H.js → folding-NEZWWL7K.js} +4 -2
- package/dist/{orchestrator-PCWZF3E5.js → orchestrator-FKVRAIIA.js} +8 -8
- package/dist/package.json +1 -1
- package/dist/{processor-7L64YPQC.js → processor-KR5GNW3S.js} +7 -7
- package/dist/{project-creator-HY32FPFV.js → project-creator-LASKNQPA.js} +3 -3
- package/dist/{projects-GSMMEVSO.js → projects-HEUOWNSR.js} +3 -3
- package/dist/{protocol-BYM6rZvW.d.ts → protocol-Ct6VfOIJ.d.ts} +1 -0
- package/dist/{serve-VZE2CPZ2.js → serve-VYIJRI5T.js} +10 -10
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +9 -9
- package/dist/{settings-3K6P2JN6.js → settings-TWK27GYE.js} +3 -3
- package/dist/shared/index.d.ts +2 -2
- package/dist/{tools-25TQ5NQY.js → tools-6XOZHTF7.js} +7 -7
- package/dist/web/assets/index-CNLQHprm.css +32 -0
- package/dist/web/assets/{index-DapVnjIC.js → index-COmqC5Os.js} +56 -56
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/web/assets/index-CWFxAdkp.css +0 -32
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
maybeAutoCompactContext,
|
|
3
3
|
performManualContextCompaction,
|
|
4
4
|
resolveCompactionStatsIdentity
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5NJ5NQH5.js";
|
|
6
6
|
import "./chunk-NBU6KIOD.js";
|
|
7
7
|
import "./chunk-574HZVLE.js";
|
|
8
8
|
import "./chunk-D4ZLSV6P.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-YVQ6DP5Y.js";
|
|
10
|
+
import "./chunk-LIMBYVO4.js";
|
|
11
11
|
import "./chunk-DZHZ3UUR.js";
|
|
12
12
|
import "./chunk-22CTURMH.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-O2BOWZKC.js";
|
|
14
|
+
import "./chunk-7JPKRM6M.js";
|
|
15
|
+
import "./chunk-BLNFJ22S.js";
|
|
16
16
|
import "./chunk-Y6HBEACI.js";
|
|
17
17
|
import "./chunk-R4HADRYO.js";
|
|
18
18
|
import "./chunk-TVQOONDR.js";
|
|
@@ -23,4 +23,4 @@ export {
|
|
|
23
23
|
performManualContextCompaction,
|
|
24
24
|
resolveCompactionStatsIdentity
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=auto-compaction-
|
|
26
|
+
//# sourceMappingURL=auto-compaction-SCLHKKGA.js.map
|
|
@@ -2,32 +2,32 @@ import {
|
|
|
2
2
|
buildRunChatTurnParams,
|
|
3
3
|
finalizeTurnCompletion,
|
|
4
4
|
getSessionMessageCount
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NBBX64KC.js";
|
|
6
6
|
import {
|
|
7
7
|
applyGeneratedSessionName,
|
|
8
8
|
generateSessionName,
|
|
9
9
|
needsNameGenerationCheck
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BHSTSA7U.js";
|
|
11
11
|
import {
|
|
12
12
|
runChatTurn
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-TBSTW3PW.js";
|
|
14
|
+
import "./chunk-5NJ5NQH5.js";
|
|
15
15
|
import "./chunk-NBU6KIOD.js";
|
|
16
16
|
import "./chunk-574HZVLE.js";
|
|
17
17
|
import "./chunk-D4ZLSV6P.js";
|
|
18
18
|
import {
|
|
19
19
|
getEventStore
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-YVQ6DP5Y.js";
|
|
21
|
+
import "./chunk-LIMBYVO4.js";
|
|
22
22
|
import {
|
|
23
23
|
createChatMessageMessage,
|
|
24
24
|
createPhaseChangedMessage,
|
|
25
25
|
createSessionRunningMessage
|
|
26
26
|
} from "./chunk-DZHZ3UUR.js";
|
|
27
27
|
import "./chunk-22CTURMH.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-O2BOWZKC.js";
|
|
29
|
+
import "./chunk-7JPKRM6M.js";
|
|
30
|
+
import "./chunk-BLNFJ22S.js";
|
|
31
31
|
import "./chunk-Y6HBEACI.js";
|
|
32
32
|
import "./chunk-R4HADRYO.js";
|
|
33
33
|
import "./chunk-TVQOONDR.js";
|
|
@@ -62,7 +62,7 @@ async function startChatSession(sessionId, content, deps, options) {
|
|
|
62
62
|
sessionManager.setRunning(sessionId, true);
|
|
63
63
|
broadcastForSession(sessionId, createSessionRunningMessage(true));
|
|
64
64
|
try {
|
|
65
|
-
const { maybeAutoCompactContext } = await import("./auto-compaction-
|
|
65
|
+
const { maybeAutoCompactContext } = await import("./auto-compaction-SCLHKKGA.js");
|
|
66
66
|
await maybeAutoCompactContext({
|
|
67
67
|
sessionManager,
|
|
68
68
|
sessionId,
|
|
@@ -171,4 +171,4 @@ export {
|
|
|
171
171
|
startChatSession,
|
|
172
172
|
stopSessionExecution
|
|
173
173
|
};
|
|
174
|
-
//# sourceMappingURL=chat-handler-
|
|
174
|
+
//# sourceMappingURL=chat-handler-7ARMDWRH.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateSessionName,
|
|
3
3
|
needsNameGeneration
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BHSTSA7U.js";
|
|
5
5
|
import {
|
|
6
6
|
createVerifierNudgeConfig,
|
|
7
7
|
runBuilderTurn,
|
|
8
8
|
runChatTurn
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TBSTW3PW.js";
|
|
10
10
|
import {
|
|
11
11
|
TurnMetrics,
|
|
12
12
|
agentExists,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
setSkillEnabled,
|
|
48
48
|
skillExists,
|
|
49
49
|
spawnShellProcess
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-5NJ5NQH5.js";
|
|
51
51
|
import {
|
|
52
52
|
getPathSeparator,
|
|
53
53
|
getPlatformShell,
|
|
@@ -94,12 +94,12 @@ import {
|
|
|
94
94
|
updateSessionProvider,
|
|
95
95
|
updateSessionRunning,
|
|
96
96
|
updateSessionSummary
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-YVQ6DP5Y.js";
|
|
98
98
|
import {
|
|
99
99
|
buildContextMessagesFromEventHistory,
|
|
100
100
|
buildMessagesFromStoredEvents,
|
|
101
101
|
foldPendingConfirmations
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-LIMBYVO4.js";
|
|
103
103
|
import {
|
|
104
104
|
createChatErrorMessage,
|
|
105
105
|
createChatMessageMessage,
|
|
@@ -123,10 +123,10 @@ import {
|
|
|
123
123
|
} from "./chunk-22CTURMH.js";
|
|
124
124
|
import {
|
|
125
125
|
getProject
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-7JPKRM6M.js";
|
|
127
127
|
import {
|
|
128
128
|
initDatabase
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-BLNFJ22S.js";
|
|
130
130
|
import {
|
|
131
131
|
computeSessionStats
|
|
132
132
|
} from "./chunk-B7E3BICY.js";
|
|
@@ -5479,7 +5479,7 @@ function createTerminalRoutes() {
|
|
|
5479
5479
|
}
|
|
5480
5480
|
|
|
5481
5481
|
// src/constants.ts
|
|
5482
|
-
var VERSION = "1.6.
|
|
5482
|
+
var VERSION = "1.6.39";
|
|
5483
5483
|
|
|
5484
5484
|
// src/server/index.ts
|
|
5485
5485
|
var __dirname2 = dirname5(fileURLToPath4(import.meta.url));
|
|
@@ -5597,7 +5597,7 @@ async function createServerHandle(config) {
|
|
|
5597
5597
|
res.json({ tools });
|
|
5598
5598
|
});
|
|
5599
5599
|
app.get("/api/projects", async (_req, res) => {
|
|
5600
|
-
const { listProjects } = await import("./projects-
|
|
5600
|
+
const { listProjects } = await import("./projects-HEUOWNSR.js");
|
|
5601
5601
|
const projects = listProjects();
|
|
5602
5602
|
res.json({ projects });
|
|
5603
5603
|
});
|
|
@@ -5606,12 +5606,12 @@ async function createServerHandle(config) {
|
|
|
5606
5606
|
if (!name || !workdir) {
|
|
5607
5607
|
return res.status(400).json({ error: "name and workdir are required" });
|
|
5608
5608
|
}
|
|
5609
|
-
const { createDirectoryWithGit } = await import("./project-creator-
|
|
5609
|
+
const { createDirectoryWithGit } = await import("./project-creator-LASKNQPA.js");
|
|
5610
5610
|
const project = await createDirectoryWithGit(name, workdir);
|
|
5611
5611
|
res.status(201).json({ project });
|
|
5612
5612
|
});
|
|
5613
5613
|
app.get("/api/projects/:id", async (req, res) => {
|
|
5614
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5614
|
+
const { getProject: getProject2 } = await import("./projects-HEUOWNSR.js");
|
|
5615
5615
|
const project = getProject2(req.params.id);
|
|
5616
5616
|
if (!project) {
|
|
5617
5617
|
return res.status(404).json({ error: "Project not found" });
|
|
@@ -5619,7 +5619,7 @@ async function createServerHandle(config) {
|
|
|
5619
5619
|
res.json({ project });
|
|
5620
5620
|
});
|
|
5621
5621
|
app.put("/api/projects/:id", async (req, res) => {
|
|
5622
|
-
const { updateProject } = await import("./projects-
|
|
5622
|
+
const { updateProject } = await import("./projects-HEUOWNSR.js");
|
|
5623
5623
|
const { name, customInstructions } = req.body;
|
|
5624
5624
|
const updates = {};
|
|
5625
5625
|
if (name !== void 0) updates.name = name;
|
|
@@ -5631,7 +5631,7 @@ async function createServerHandle(config) {
|
|
|
5631
5631
|
res.json({ project: updated });
|
|
5632
5632
|
});
|
|
5633
5633
|
app.delete("/api/projects/:id", async (req, res) => {
|
|
5634
|
-
const { getProject: getProject2, deleteProject } = await import("./projects-
|
|
5634
|
+
const { getProject: getProject2, deleteProject } = await import("./projects-HEUOWNSR.js");
|
|
5635
5635
|
const project = getProject2(req.params.id);
|
|
5636
5636
|
if (!project) {
|
|
5637
5637
|
return res.status(404).json({ error: "Project not found" });
|
|
@@ -5640,7 +5640,7 @@ async function createServerHandle(config) {
|
|
|
5640
5640
|
res.json({ success: true });
|
|
5641
5641
|
});
|
|
5642
5642
|
app.get("/api/sessions", async (req, res) => {
|
|
5643
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
5643
|
+
const { getRecentUserPromptsForSession } = await import("./events-FHPSSSE4.js");
|
|
5644
5644
|
const projectId = req.query["projectId"];
|
|
5645
5645
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
5646
5646
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -5673,8 +5673,8 @@ async function createServerHandle(config) {
|
|
|
5673
5673
|
res.status(201).json({ session });
|
|
5674
5674
|
});
|
|
5675
5675
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
5676
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5677
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
5676
|
+
const { getEventStore: getEventStore2 } = await import("./events-FHPSSSE4.js");
|
|
5677
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-NEZWWL7K.js");
|
|
5678
5678
|
const session = sessionManager.getSession(req.params.id);
|
|
5679
5679
|
if (!session) {
|
|
5680
5680
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -5704,8 +5704,8 @@ async function createServerHandle(config) {
|
|
|
5704
5704
|
res.json({ success: true });
|
|
5705
5705
|
});
|
|
5706
5706
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
5707
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5708
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
5707
|
+
const { getEventStore: getEventStore2 } = await import("./events-FHPSSSE4.js");
|
|
5708
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-NEZWWL7K.js");
|
|
5709
5709
|
const sessionId = req.params.id;
|
|
5710
5710
|
const session = sessionManager.getSession(sessionId);
|
|
5711
5711
|
if (!session) {
|
|
@@ -5742,8 +5742,8 @@ async function createServerHandle(config) {
|
|
|
5742
5742
|
res.json({ success: true });
|
|
5743
5743
|
});
|
|
5744
5744
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
5745
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5746
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
5745
|
+
const { getEventStore: getEventStore2 } = await import("./events-FHPSSSE4.js");
|
|
5746
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-NEZWWL7K.js");
|
|
5747
5747
|
const sessionId = req.params.id;
|
|
5748
5748
|
const session = sessionManager.getSession(sessionId);
|
|
5749
5749
|
if (!session) {
|
|
@@ -5781,13 +5781,13 @@ async function createServerHandle(config) {
|
|
|
5781
5781
|
if (!callId || approved === void 0) {
|
|
5782
5782
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5783
5783
|
}
|
|
5784
|
-
const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-
|
|
5784
|
+
const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-6XOZHTF7.js");
|
|
5785
5785
|
const result = providePathConfirmation2(callId, approved, alwaysAllow);
|
|
5786
5786
|
if (!result.found) {
|
|
5787
5787
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
5788
5788
|
}
|
|
5789
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5790
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-
|
|
5789
|
+
const { getEventStore: getEventStore2 } = await import("./events-FHPSSSE4.js");
|
|
5790
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-NEZWWL7K.js");
|
|
5791
5791
|
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-YNVBDNL7.js");
|
|
5792
5792
|
const eventStore = getEventStore2();
|
|
5793
5793
|
const events = eventStore.getEvents(sessionId);
|
|
@@ -5806,7 +5806,7 @@ async function createServerHandle(config) {
|
|
|
5806
5806
|
if (!callId || !answer) {
|
|
5807
5807
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
5808
5808
|
}
|
|
5809
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
5809
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-6XOZHTF7.js");
|
|
5810
5810
|
const found = provideAnswer2(callId, answer);
|
|
5811
5811
|
if (!found) {
|
|
5812
5812
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5842,14 +5842,14 @@ async function createServerHandle(config) {
|
|
|
5842
5842
|
if (!session) {
|
|
5843
5843
|
return res.status(404).json({ error: "Session not found" });
|
|
5844
5844
|
}
|
|
5845
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5846
|
-
const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-
|
|
5845
|
+
const { stopSessionExecution } = await import("./chat-handler-7ARMDWRH.js");
|
|
5846
|
+
const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-6XOZHTF7.js");
|
|
5847
5847
|
stopSessionExecution(sessionId, sessionManager);
|
|
5848
5848
|
abortSession(sessionId);
|
|
5849
5849
|
cancelQuestionsForSession2(sessionId, "Session stopped by user");
|
|
5850
5850
|
cancelPathConfirmationsForSession2(sessionId, "Session stopped by user");
|
|
5851
5851
|
sessionManager.clearMessageQueue(sessionId);
|
|
5852
|
-
const eventStore = (await import("./events-
|
|
5852
|
+
const eventStore = (await import("./events-FHPSSSE4.js")).getEventStore();
|
|
5853
5853
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
5854
5854
|
res.json({ success: true });
|
|
5855
5855
|
});
|
|
@@ -5880,13 +5880,13 @@ async function createServerHandle(config) {
|
|
|
5880
5880
|
res.json({ accepted: true });
|
|
5881
5881
|
});
|
|
5882
5882
|
app.get("/api/settings/:key", async (req, res) => {
|
|
5883
|
-
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-
|
|
5883
|
+
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-TWK27GYE.js");
|
|
5884
5884
|
const key = req.params.key;
|
|
5885
5885
|
const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
5886
5886
|
res.json({ key, value });
|
|
5887
5887
|
});
|
|
5888
5888
|
app.put("/api/settings/:key", async (req, res) => {
|
|
5889
|
-
const { setSetting } = await import("./settings-
|
|
5889
|
+
const { setSetting } = await import("./settings-TWK27GYE.js");
|
|
5890
5890
|
const key = req.params.key;
|
|
5891
5891
|
const { value } = req.body;
|
|
5892
5892
|
if (value === void 0) {
|
|
@@ -6302,7 +6302,7 @@ async function createServerHandle(config) {
|
|
|
6302
6302
|
providerManager
|
|
6303
6303
|
);
|
|
6304
6304
|
const wss = wssExports.wss;
|
|
6305
|
-
const { QueueProcessor } = await import("./processor-
|
|
6305
|
+
const { QueueProcessor } = await import("./processor-KR5GNW3S.js");
|
|
6306
6306
|
const queueProcessor = new QueueProcessor({
|
|
6307
6307
|
sessionManager,
|
|
6308
6308
|
providerManager,
|
|
@@ -6375,4 +6375,4 @@ export {
|
|
|
6375
6375
|
createServerHandle,
|
|
6376
6376
|
createServer
|
|
6377
6377
|
};
|
|
6378
|
-
//# sourceMappingURL=chunk-
|
|
6378
|
+
//# sourceMappingURL=chunk-2XRQ55GT.js.map
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
getContextMessages,
|
|
22
22
|
getCurrentContextWindowId,
|
|
23
23
|
getEventStore
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YVQ6DP5Y.js";
|
|
25
25
|
import {
|
|
26
26
|
createChatDoneMessage,
|
|
27
27
|
createChatMessageMessage,
|
|
@@ -40,10 +40,10 @@ import {
|
|
|
40
40
|
deleteSetting,
|
|
41
41
|
getSetting,
|
|
42
42
|
setSetting
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-O2BOWZKC.js";
|
|
44
44
|
import {
|
|
45
45
|
getProject
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-7JPKRM6M.js";
|
|
47
47
|
import {
|
|
48
48
|
getGlobalConfigDir
|
|
49
49
|
} from "./chunk-R4HADRYO.js";
|
|
@@ -3351,7 +3351,7 @@ var callSubAgentTool = {
|
|
|
3351
3351
|
};
|
|
3352
3352
|
}
|
|
3353
3353
|
try {
|
|
3354
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3354
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-6XOZHTF7.js");
|
|
3355
3355
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3356
3356
|
const turnMetrics = new TurnMetrics();
|
|
3357
3357
|
const result = await executeSubAgent({
|
|
@@ -4480,4 +4480,4 @@ export {
|
|
|
4480
4480
|
getToolRegistryForAgent,
|
|
4481
4481
|
createToolRegistry
|
|
4482
4482
|
};
|
|
4483
|
-
//# sourceMappingURL=chunk-
|
|
4483
|
+
//# sourceMappingURL=chunk-5NJ5NQH5.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDatabase
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BLNFJ22S.js";
|
|
4
4
|
|
|
5
5
|
// src/server/db/projects.ts
|
|
6
6
|
function createProject(name, workdir) {
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
updateProject,
|
|
92
92
|
deleteProject
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-7JPKRM6M.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateSessionMetadata
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YVQ6DP5Y.js";
|
|
4
4
|
import {
|
|
5
5
|
buildMessagesFromStoredEvents,
|
|
6
6
|
foldPendingConfirmations
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LIMBYVO4.js";
|
|
8
8
|
import {
|
|
9
9
|
createSessionStateMessage
|
|
10
10
|
} from "./chunk-DZHZ3UUR.js";
|
|
@@ -108,4 +108,4 @@ export {
|
|
|
108
108
|
needsNameGenerationCheck,
|
|
109
109
|
applyGeneratedSessionName
|
|
110
110
|
};
|
|
111
|
-
//# sourceMappingURL=chunk-
|
|
111
|
+
//# sourceMappingURL=chunk-BHSTSA7U.js.map
|
|
@@ -18,6 +18,12 @@ function initDatabase(config) {
|
|
|
18
18
|
if (result.changes > 0) {
|
|
19
19
|
logger.info("Reset stale running states", { count: result.changes });
|
|
20
20
|
}
|
|
21
|
+
const freelistCount = db.pragma("freelist_count", { simple: true });
|
|
22
|
+
if (freelistCount > 1e4) {
|
|
23
|
+
logger.info("Vacuuming database", { freelistCount });
|
|
24
|
+
db.exec("VACUUM");
|
|
25
|
+
logger.info("Database vacuumed");
|
|
26
|
+
}
|
|
21
27
|
return db;
|
|
22
28
|
}
|
|
23
29
|
function getDatabase() {
|
|
@@ -156,4 +162,4 @@ export {
|
|
|
156
162
|
initDatabase,
|
|
157
163
|
getDatabase
|
|
158
164
|
};
|
|
159
|
-
//# sourceMappingURL=chunk-
|
|
165
|
+
//# sourceMappingURL=chunk-BLNFJ22S.js.map
|
|
@@ -79,13 +79,73 @@ function applyEvents(initialMessages, events, options) {
|
|
|
79
79
|
case "tool.call": {
|
|
80
80
|
const data = event.data;
|
|
81
81
|
const msg = messages.get(data.messageId);
|
|
82
|
-
if (msg)
|
|
82
|
+
if (msg) {
|
|
83
|
+
attachToolCallToMessage(msg, data.toolCall);
|
|
84
|
+
removeFromPreparing(msg, data.toolCall.id);
|
|
85
|
+
}
|
|
83
86
|
break;
|
|
84
87
|
}
|
|
85
88
|
case "tool.result": {
|
|
86
89
|
const data = event.data;
|
|
87
90
|
const msg = messages.get(data.messageId);
|
|
88
|
-
if (msg)
|
|
91
|
+
if (msg) {
|
|
92
|
+
attachToolResultToMessage(msg, data.toolCallId, data.result);
|
|
93
|
+
removeFromPreparing(msg, data.toolCallId);
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
case "tool.preparing": {
|
|
98
|
+
const data = event.data;
|
|
99
|
+
const msg = messages.get(data.messageId);
|
|
100
|
+
if (msg) {
|
|
101
|
+
const preparing = msg.preparingToolCalls ?? [];
|
|
102
|
+
preparing.push({ index: data.index, name: data.name });
|
|
103
|
+
msg.preparingToolCalls = preparing;
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case "tool.output": {
|
|
108
|
+
const data = event.data;
|
|
109
|
+
const msg = findMessageWithToolCall(messages, data.toolCallId);
|
|
110
|
+
if (msg) {
|
|
111
|
+
const tc = msg.toolCalls?.find((tc2) => tc2.id === data.toolCallId);
|
|
112
|
+
if (tc) {
|
|
113
|
+
const output = tc.streamingOutput ?? [];
|
|
114
|
+
output.push({ stream: data.stream, content: data.content, timestamp: event.timestamp });
|
|
115
|
+
tc.streamingOutput = output;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
case "format.retry": {
|
|
121
|
+
const data = event.data;
|
|
122
|
+
for (const msg of messages.values()) {
|
|
123
|
+
const retries = msg.formatRetries ?? [];
|
|
124
|
+
retries.push({ attempt: data.attempt, maxAttempts: data.maxAttempts, timestamp: event.timestamp });
|
|
125
|
+
msg.formatRetries = retries;
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
case "chat.done": {
|
|
130
|
+
const data = event.data;
|
|
131
|
+
const msg = messages.get(data.messageId);
|
|
132
|
+
if (msg) {
|
|
133
|
+
;
|
|
134
|
+
msg.isComplete = true;
|
|
135
|
+
msg.completeReason = data.reason;
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
case "chat.error": {
|
|
140
|
+
const data = event.data;
|
|
141
|
+
for (const msg of messages.values()) {
|
|
142
|
+
if (msg.role === "assistant" && !("isComplete" in msg)) {
|
|
143
|
+
;
|
|
144
|
+
msg.isComplete = true;
|
|
145
|
+
msg.completeReason = "error";
|
|
146
|
+
msg.stats = { error: data.error };
|
|
147
|
+
}
|
|
148
|
+
}
|
|
89
149
|
break;
|
|
90
150
|
}
|
|
91
151
|
case "session.initialized":
|
|
@@ -99,16 +159,27 @@ function applyEvents(initialMessages, events, options) {
|
|
|
99
159
|
case "context.compacted":
|
|
100
160
|
case "file.read":
|
|
101
161
|
case "todo.updated":
|
|
102
|
-
case "chat.done":
|
|
103
|
-
case "chat.error":
|
|
104
|
-
case "format.retry":
|
|
105
|
-
case "tool.preparing":
|
|
106
|
-
case "tool.output":
|
|
107
162
|
break;
|
|
108
163
|
}
|
|
109
164
|
}
|
|
110
165
|
return Array.from(messages.values());
|
|
111
166
|
}
|
|
167
|
+
function removeFromPreparing(msg, _toolCallId) {
|
|
168
|
+
if ("preparingToolCalls" in msg && Array.isArray(msg.preparingToolCalls)) {
|
|
169
|
+
;
|
|
170
|
+
msg.preparingToolCalls = [];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function findMessageWithToolCall(messages, toolCallId) {
|
|
174
|
+
for (const msg of messages.values()) {
|
|
175
|
+
if ("toolCalls" in msg && Array.isArray(msg.toolCalls)) {
|
|
176
|
+
if (msg.toolCalls.some((tc) => tc.id === toolCallId)) {
|
|
177
|
+
return msg;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return void 0;
|
|
182
|
+
}
|
|
112
183
|
function deepCloneMessage(msg) {
|
|
113
184
|
const cloned = { ...msg };
|
|
114
185
|
const obj = cloned;
|
|
@@ -233,6 +304,9 @@ Error: ${toolCall.result.error}` : `Error: ${toolCall.result.error}`),
|
|
|
233
304
|
function applyStoredMessageEvents(initialMessages, events) {
|
|
234
305
|
return applyEvents(initialMessages, events, { timestampAsNumber: false });
|
|
235
306
|
}
|
|
307
|
+
function getTimestamp(event) {
|
|
308
|
+
return event.timestamp ?? Date.now();
|
|
309
|
+
}
|
|
236
310
|
function applyTurnEventsToSnapshotMessages(initialMessages, events) {
|
|
237
311
|
const messages = applyEvents(initialMessages, events, { timestampAsNumber: true });
|
|
238
312
|
return messages.map((msg) => ({ ...msg, isStreaming: msg.isStreaming ?? true }));
|
|
@@ -335,6 +409,9 @@ function buildContextMessagesFromEventHistory(events, windowId, options) {
|
|
|
335
409
|
function foldTurnEventsToSnapshotMessages(events) {
|
|
336
410
|
return applyTurnEventsToSnapshotMessages([], events);
|
|
337
411
|
}
|
|
412
|
+
function foldTurnEventsToSnapshotMessagesFromInitial(events, initialMessages) {
|
|
413
|
+
return applyTurnEventsToSnapshotMessages(initialMessages, events);
|
|
414
|
+
}
|
|
338
415
|
function foldCriteria(events) {
|
|
339
416
|
let criteria = [];
|
|
340
417
|
for (const event of events) {
|
|
@@ -383,8 +460,10 @@ function foldContextState(events, initialWindowId) {
|
|
|
383
460
|
compactionCount = data.contextState.compactionCount;
|
|
384
461
|
latestContextState = data.contextState;
|
|
385
462
|
readFilesMap.clear();
|
|
386
|
-
|
|
387
|
-
|
|
463
|
+
if (data.readFiles) {
|
|
464
|
+
for (const entry of data.readFiles) {
|
|
465
|
+
readFilesMap.set(entry.path, { ...entry });
|
|
466
|
+
}
|
|
388
467
|
}
|
|
389
468
|
break;
|
|
390
469
|
}
|
|
@@ -477,11 +556,11 @@ function foldPendingConfirmations(events) {
|
|
|
477
556
|
}
|
|
478
557
|
return pending;
|
|
479
558
|
}
|
|
480
|
-
function foldSessionState(events, initialWindowId, maxTokens) {
|
|
559
|
+
function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
|
|
481
560
|
const mode = foldMode(events);
|
|
482
561
|
const phase = foldPhase(events);
|
|
483
562
|
const isRunning = foldIsRunning(events);
|
|
484
|
-
const messages = foldTurnEventsToSnapshotMessages(events);
|
|
563
|
+
const messages = initialMessages && initialMessages.length > 0 ? foldTurnEventsToSnapshotMessagesFromInitial(events, initialMessages) : foldTurnEventsToSnapshotMessages(events);
|
|
485
564
|
const criteria = foldCriteria(events);
|
|
486
565
|
const todos = foldTodos(events);
|
|
487
566
|
const contextResult = foldContextState(events, initialWindowId);
|
|
@@ -533,6 +612,87 @@ function foldSessionState(events, initialWindowId, maxTokens) {
|
|
|
533
612
|
}
|
|
534
613
|
}
|
|
535
614
|
}
|
|
615
|
+
let sessionInit;
|
|
616
|
+
let sessionTitle;
|
|
617
|
+
let visionFallbacks = [];
|
|
618
|
+
let formatRetries = [];
|
|
619
|
+
let pendingUserInput;
|
|
620
|
+
let taskStats;
|
|
621
|
+
let messageStats = [];
|
|
622
|
+
let contextWindows = [];
|
|
623
|
+
for (const event of events) {
|
|
624
|
+
switch (event.type) {
|
|
625
|
+
case "session.initialized": {
|
|
626
|
+
const data = event.data;
|
|
627
|
+
sessionInit = {
|
|
628
|
+
projectId: data.projectId,
|
|
629
|
+
workdir: data.workdir,
|
|
630
|
+
contextWindowId: data.contextWindowId,
|
|
631
|
+
...data.maxTokens !== void 0 && { maxTokens: data.maxTokens }
|
|
632
|
+
};
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
case "session.name_generated": {
|
|
636
|
+
const data = event.data;
|
|
637
|
+
sessionTitle = data.name;
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
case "vision_fallback.start": {
|
|
641
|
+
const data = event.data;
|
|
642
|
+
visionFallbacks.push({
|
|
643
|
+
messageId: data.messageId,
|
|
644
|
+
attachmentId: data.attachmentId,
|
|
645
|
+
...data.filename !== void 0 && { filename: data.filename },
|
|
646
|
+
startedAt: getTimestamp(event)
|
|
647
|
+
});
|
|
648
|
+
break;
|
|
649
|
+
}
|
|
650
|
+
case "vision_fallback.done": {
|
|
651
|
+
const data = event.data;
|
|
652
|
+
const existing = visionFallbacks.find((v) => v.messageId === data.messageId && v.attachmentId === data.attachmentId);
|
|
653
|
+
if (existing) {
|
|
654
|
+
existing.description = data.description;
|
|
655
|
+
}
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
case "format.retry": {
|
|
659
|
+
const data = event.data;
|
|
660
|
+
formatRetries.push({
|
|
661
|
+
attempt: data.attempt,
|
|
662
|
+
maxAttempts: data.maxAttempts,
|
|
663
|
+
timestamp: getTimestamp(event)
|
|
664
|
+
});
|
|
665
|
+
break;
|
|
666
|
+
}
|
|
667
|
+
case "chat.ask_user": {
|
|
668
|
+
const data = event.data;
|
|
669
|
+
pendingUserInput = { callId: data.callId, question: data.question };
|
|
670
|
+
break;
|
|
671
|
+
}
|
|
672
|
+
case "task.completed": {
|
|
673
|
+
const data = event.data;
|
|
674
|
+
taskStats = data;
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
case "chat.done": {
|
|
678
|
+
const data = event.data;
|
|
679
|
+
messageStats.push({
|
|
680
|
+
messageId: data.messageId,
|
|
681
|
+
reason: data.reason,
|
|
682
|
+
...data.stats !== void 0 && { stats: data.stats }
|
|
683
|
+
});
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
case "context.compacted": {
|
|
687
|
+
const data = event.data;
|
|
688
|
+
contextWindows.push({
|
|
689
|
+
...data,
|
|
690
|
+
timestamp: getTimestamp(event)
|
|
691
|
+
});
|
|
692
|
+
break;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
536
696
|
return {
|
|
537
697
|
mode,
|
|
538
698
|
phase,
|
|
@@ -544,7 +704,15 @@ function foldSessionState(events, initialWindowId, maxTokens) {
|
|
|
544
704
|
currentContextWindowId: contextResult.currentContextWindowId,
|
|
545
705
|
readFiles: contextResult.readFiles,
|
|
546
706
|
...lastModeWithReminder !== void 0 && { lastModeWithReminder },
|
|
547
|
-
pendingConfirmations
|
|
707
|
+
pendingConfirmations,
|
|
708
|
+
...sessionInit !== void 0 && { sessionInit },
|
|
709
|
+
...sessionTitle !== void 0 && { sessionTitle },
|
|
710
|
+
...visionFallbacks.length > 0 && { visionFallbacks },
|
|
711
|
+
...formatRetries.length > 0 && { formatRetries },
|
|
712
|
+
...pendingUserInput !== void 0 && { pendingUserInput },
|
|
713
|
+
...taskStats !== void 0 && { taskStats },
|
|
714
|
+
...messageStats.length > 0 && { messageStats },
|
|
715
|
+
...contextWindows.length > 0 && { contextWindows }
|
|
548
716
|
};
|
|
549
717
|
}
|
|
550
718
|
function buildSnapshot(foldedState, latestSeq, snapshotAt = Date.now()) {
|
|
@@ -560,7 +728,16 @@ function buildSnapshot(foldedState, latestSeq, snapshotAt = Date.now()) {
|
|
|
560
728
|
readFiles: foldedState.readFiles,
|
|
561
729
|
...foldedState.lastModeWithReminder !== void 0 && { lastModeWithReminder: foldedState.lastModeWithReminder },
|
|
562
730
|
snapshotSeq: latestSeq,
|
|
563
|
-
snapshotAt
|
|
731
|
+
snapshotAt,
|
|
732
|
+
...foldedState.sessionInit !== void 0 && { sessionInit: foldedState.sessionInit },
|
|
733
|
+
...foldedState.sessionTitle !== void 0 && { sessionTitle: foldedState.sessionTitle },
|
|
734
|
+
...foldedState.visionFallbacks !== void 0 && { visionFallbacks: foldedState.visionFallbacks },
|
|
735
|
+
...foldedState.formatRetries !== void 0 && { formatRetries: foldedState.formatRetries },
|
|
736
|
+
...foldedState.pendingUserInput !== void 0 && { pendingUserInput: foldedState.pendingUserInput },
|
|
737
|
+
...foldedState.taskStats !== void 0 && { taskStats: foldedState.taskStats },
|
|
738
|
+
...foldedState.messageStats !== void 0 && { messageStats: foldedState.messageStats },
|
|
739
|
+
...foldedState.pendingConfirmations !== void 0 && { pendingConfirmations: foldedState.pendingConfirmations },
|
|
740
|
+
...foldedState.contextWindows !== void 0 && { contextWindows: foldedState.contextWindows }
|
|
564
741
|
};
|
|
565
742
|
}
|
|
566
743
|
function buildSnapshotFromSessionState(input) {
|
|
@@ -624,6 +801,7 @@ export {
|
|
|
624
801
|
buildContextMessagesFromStoredEvents,
|
|
625
802
|
buildContextMessagesFromEventHistory,
|
|
626
803
|
foldTurnEventsToSnapshotMessages,
|
|
804
|
+
foldTurnEventsToSnapshotMessagesFromInitial,
|
|
627
805
|
foldCriteria,
|
|
628
806
|
foldTodos,
|
|
629
807
|
foldContextState,
|
|
@@ -637,4 +815,4 @@ export {
|
|
|
637
815
|
getMessagesForWindow,
|
|
638
816
|
buildContextMessagesFromMessages
|
|
639
817
|
};
|
|
640
|
-
//# sourceMappingURL=chunk-
|
|
818
|
+
//# sourceMappingURL=chunk-LIMBYVO4.js.map
|