openfox 1.6.74 → 1.6.76
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/{ask-3RK5YJZE.js → ask-5SSOA6SZ.js} +2 -2
- package/dist/{auth-LZZX63KI.js → auth-56SIRACI.js} +3 -6
- package/dist/auto-compaction-V3PA77WG.js +27 -0
- package/dist/{branch.api-XADFZZAA.js → branch.api-PWFW26KC.js} +2 -2
- package/dist/{chat-handler-KYMMXPP6.js → chat-handler-7DKHGTVO.js} +31 -29
- package/dist/{chunk-5UTTLO4D.js → chunk-5ZD3GZTK.js} +89 -49
- package/dist/{chunk-AFATQ5LJ.js → chunk-B5AP3RSV.js} +1 -1
- package/dist/{chunk-22CTURMH.js → chunk-BJYPTN5S.js} +1 -1
- package/dist/{chunk-DLINTLB7.js → chunk-BSTVRSV6.js} +7 -5
- package/dist/{chunk-7JPKRM6M.js → chunk-CMQCO27Y.js} +22 -12
- package/dist/{chunk-R4HADRYO.js → chunk-CQGTEGKL.js} +1 -1
- package/dist/{chunk-J5DV33SS.js → chunk-CUDAT6SS.js} +46 -18
- package/dist/{chunk-ETIXH35K.js → chunk-H5EICXF3.js} +499 -277
- package/dist/{chunk-ODOA4RNN.js → chunk-K2V7EW5F.js} +541 -299
- package/dist/{chunk-PNBH3RAX.js → chunk-K44MW7JJ.js} +1 -1
- package/dist/{chunk-BLNFJ22S.js → chunk-KIOUKC3Z.js} +6 -4
- package/dist/{chunk-4CQ7CUQ6.js → chunk-LCQ3MPXD.js} +5 -5
- package/dist/{chunk-CTAIXOZJ.js → chunk-NDJ6FKSP.js} +1 -1
- package/dist/{chunk-IA4O65CR.js → chunk-NHJ2GVCF.js} +100 -68
- package/dist/{chunk-GQZGIMJO.js → chunk-OXI26S7U.js} +12 -7
- package/dist/{chunk-NBU6KIOD.js → chunk-PBGOZMVY.js} +4 -4
- package/dist/{chunk-B7E3BICY.js → chunk-RGRBWDZP.js} +2 -4
- package/dist/{chunk-CLBUWGUB.js → chunk-RQ4XSKUR.js} +15 -16
- package/dist/{chunk-KFBIHS3S.js → chunk-STYHKCG7.js} +20 -14
- package/dist/{chunk-55Z3DJ7G.js → chunk-TGWEH2BC.js} +10 -11
- package/dist/{chunk-TYUNDOX2.js → chunk-UKMRZDWM.js} +90 -41
- package/dist/{chunk-PFRQO5Z3.js → chunk-VAMTEAYI.js} +49 -27
- package/dist/{chunk-574HZVLE.js → chunk-VRGRAQDG.js} +2 -2
- package/dist/{chunk-JQBTYHUR.js → chunk-WR6QCJJO.js} +53 -15
- package/dist/{chunk-RBPOAAIZ.js → chunk-XKIEDGQF.js} +22 -18
- package/dist/cli/dev.js +2 -2
- package/dist/cli/index.js +2 -2
- package/dist/{config-6T4EHAP2.js → config-5CONAOL7.js} +7 -7
- package/dist/{events-LKEZ3YCW.js → events-BDXQOC7F.js} +6 -6
- package/dist/{folding-JN2WT44N.js → folding-2HW7FIKL.js} +2 -2
- package/dist/{inspect-proxy-Y4MRAVB7.js → inspect-proxy-Y75AXMRX.js} +3 -3
- package/dist/{manager-HM2J5VMW.js → manager-W7N3XQ4Q.js} +3 -3
- package/dist/orchestrator-KCHEENHK.js +43 -0
- package/dist/package.json +19 -3
- package/dist/{paths-ZRI56O63.js → paths-X46PPOI2.js} +2 -2
- package/dist/{processor-23O4HPSS.js → processor-6TS37IYH.js} +15 -11
- package/dist/{project-creator-LASKNQPA.js → project-creator-VD7MLOWE.js} +8 -5
- package/dist/{projects-HEUOWNSR.js → projects-XLMSDFTQ.js} +4 -4
- package/dist/{protocol-5AWNGFLH.js → protocol-4CTV7OZC.js} +3 -3
- package/dist/{protocol-DRBnujwe.d.ts → protocol-4xbfAlGO.d.ts} +3 -0
- package/dist/{provider-AKN355YH.js → provider-ESEBV3LL.js} +15 -11
- package/dist/{pwa-GHQCMCIU.js → pwa-76XP2DY2.js} +2 -2
- package/dist/{runtime-config-ZCK74XKM.js → runtime-config-CBJJJGBD.js} +2 -2
- package/dist/{serve-W6CHNSRO.js → serve-OLDABBV3.js} +29 -27
- package/dist/server/index.d.ts +6 -1
- package/dist/server/index.js +22 -22
- package/dist/server/public/__inspect__.js +2 -1
- package/dist/{service-74Z7JK2J.js → service-D6LC3CAM.js} +3 -2
- package/dist/{settings-NI4ITGV6.js → settings-TQNQB56H.js} +4 -4
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/{store-2IF3ZSLD.js → store-OQ45KONN.js} +2 -2
- package/dist/{tools-RUAY6EVI.js → tools-BHYHS3RY.js} +18 -18
- package/dist/{vision-fallback-AXH3BGJC.js → vision-fallback-ED27LH6C.js} +3 -3
- package/dist/web/assets/{index-9GgVgB7B.js → index-DAuZ02-Q.js} +57 -57
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +19 -3
- package/dist/auto-compaction-OW4P2QWQ.js +0 -27
- package/dist/orchestrator-QP4O7MUM.js +0 -43
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K44MW7JJ.js";
|
|
4
4
|
|
|
5
5
|
// src/server/db/index.ts
|
|
6
6
|
import Database from "better-sqlite3";
|
|
@@ -136,7 +136,8 @@ function runMigrations(db2) {
|
|
|
136
136
|
logger.info("Migrating sessions table: adding message_count column");
|
|
137
137
|
db2.exec(`ALTER TABLE sessions ADD COLUMN message_count INTEGER NOT NULL DEFAULT 0`);
|
|
138
138
|
logger.info("Backfilling message counts");
|
|
139
|
-
const backfillResult = db2.prepare(
|
|
139
|
+
const backfillResult = db2.prepare(
|
|
140
|
+
`
|
|
140
141
|
UPDATE sessions
|
|
141
142
|
SET message_count = (
|
|
142
143
|
SELECT COALESCE(
|
|
@@ -152,7 +153,8 @@ function runMigrations(db2) {
|
|
|
152
153
|
AND json_extract(e.payload, '$.role') IN ('user', 'assistant'))
|
|
153
154
|
)
|
|
154
155
|
)
|
|
155
|
-
`
|
|
156
|
+
`
|
|
157
|
+
).run();
|
|
156
158
|
logger.info("Backfilled message counts", { count: backfillResult.changes });
|
|
157
159
|
}
|
|
158
160
|
logger.info("Database migrations completed");
|
|
@@ -162,4 +164,4 @@ export {
|
|
|
162
164
|
initDatabase,
|
|
163
165
|
getDatabase
|
|
164
166
|
};
|
|
165
|
-
//# sourceMappingURL=chunk-
|
|
167
|
+
//# sourceMappingURL=chunk-KIOUKC3Z.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEventStore,
|
|
3
3
|
updateSessionMetadata
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5ZD3GZTK.js";
|
|
5
5
|
import {
|
|
6
6
|
buildMessagesFromStoredEvents,
|
|
7
7
|
foldPendingConfirmations
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VAMTEAYI.js";
|
|
9
9
|
import {
|
|
10
10
|
createContextStateMessage,
|
|
11
11
|
createSessionStateMessage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-STYHKCG7.js";
|
|
13
13
|
import {
|
|
14
14
|
logger
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-K44MW7JJ.js";
|
|
16
16
|
|
|
17
17
|
// src/server/utils/session-utils.ts
|
|
18
18
|
function getSessionMessageCount(sessionId) {
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
needsNameGenerationCheck,
|
|
144
144
|
applyGeneratedSessionName
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-LCQ3MPXD.js.map
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
getToolRegistryForAgent,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
runTopLevelAgentLoop
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-H5EICXF3.js";
|
|
17
17
|
import {
|
|
18
18
|
getCurrentContextWindowId,
|
|
19
19
|
getEventStore
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5ZD3GZTK.js";
|
|
21
21
|
import {
|
|
22
22
|
buildSnapshotFromSessionState
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-VAMTEAYI.js";
|
|
24
24
|
import {
|
|
25
25
|
logger
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-K44MW7JJ.js";
|
|
27
27
|
|
|
28
28
|
// src/server/sub-agents/verifier-helpers.ts
|
|
29
29
|
var MAX_CONSECUTIVE_VERIFIER_NUDGES = 10;
|
|
@@ -99,11 +99,19 @@ async function runChatTurn(options) {
|
|
|
99
99
|
recoverable: false
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
-
eventStore.append(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
eventStore.append(
|
|
103
|
+
sessionId,
|
|
104
|
+
createMessageStartEvent(
|
|
105
|
+
errorMsgId2,
|
|
106
|
+
"user",
|
|
107
|
+
`Access denied: ${error.paths.join(", ")}. If you need this file, explain why and ask the user for permission.`,
|
|
108
|
+
{
|
|
109
|
+
...getCurrentWindowMessageOptions(sessionId) ?? {},
|
|
110
|
+
isSystemGenerated: true,
|
|
111
|
+
messageKind: "correction"
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
);
|
|
107
115
|
eventStore.append(sessionId, createChatDoneEvent(errorMsgId2, "error"));
|
|
108
116
|
return;
|
|
109
117
|
}
|
|
@@ -121,11 +129,19 @@ async function runChatTurn(options) {
|
|
|
121
129
|
recoverable: false
|
|
122
130
|
}
|
|
123
131
|
});
|
|
124
|
-
eventStore.append(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
132
|
+
eventStore.append(
|
|
133
|
+
sessionId,
|
|
134
|
+
createMessageStartEvent(
|
|
135
|
+
errorMsgId,
|
|
136
|
+
"user",
|
|
137
|
+
`Error: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
138
|
+
{
|
|
139
|
+
...getCurrentWindowMessageOptions(sessionId) ?? {},
|
|
140
|
+
isSystemGenerated: true,
|
|
141
|
+
messageKind: "correction"
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
);
|
|
129
145
|
eventStore.append(sessionId, createChatDoneEvent(errorMsgId, "error"));
|
|
130
146
|
} finally {
|
|
131
147
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
@@ -173,17 +189,20 @@ async function runGenericAgentTurn(options, turnMetrics, agentId) {
|
|
|
173
189
|
injectModeReminderIfNeeded(options.sessionManager, options.sessionId, agentId, allAgents, options.onMessage);
|
|
174
190
|
const agentDef = findAgentById(agentId, allAgents) ?? findAgentById("planner", allAgents);
|
|
175
191
|
const subAgentDefs = getSubAgents(allAgents);
|
|
176
|
-
await runTopLevelAgentLoop(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
192
|
+
await runTopLevelAgentLoop(
|
|
193
|
+
{
|
|
194
|
+
mode: agentId,
|
|
195
|
+
sessionManager: options.sessionManager,
|
|
196
|
+
sessionId: options.sessionId,
|
|
197
|
+
llmClient: options.llmClient,
|
|
198
|
+
statsIdentity,
|
|
199
|
+
signal: options.signal,
|
|
200
|
+
onMessage: options.onMessage,
|
|
201
|
+
assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef, subAgentDefs, modelName: options.llmClient.getModel() }),
|
|
202
|
+
getToolRegistry: () => getToolRegistryForAgent(agentDef)
|
|
203
|
+
},
|
|
204
|
+
turnMetrics
|
|
205
|
+
);
|
|
187
206
|
}
|
|
188
207
|
function filterToolRegistryForStepDone(baseRegistry, _injectStepDone) {
|
|
189
208
|
return baseRegistry;
|
|
@@ -198,50 +217,63 @@ async function runBuilderTurn(options, turnMetrics) {
|
|
|
198
217
|
const subAgentDefs = getSubAgents(allAgents);
|
|
199
218
|
let stepDoneCalled = false;
|
|
200
219
|
return {
|
|
201
|
-
...await runTopLevelAgentLoop(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
...await runTopLevelAgentLoop(
|
|
221
|
+
{
|
|
222
|
+
mode: "builder",
|
|
223
|
+
sessionManager,
|
|
224
|
+
sessionId,
|
|
225
|
+
llmClient: options.llmClient,
|
|
226
|
+
statsIdentity,
|
|
227
|
+
signal: options.signal,
|
|
228
|
+
onMessage: options.onMessage,
|
|
229
|
+
assembleRequest: (input) => assembleAgentRequest({
|
|
230
|
+
...input,
|
|
231
|
+
agentDef: builderDef,
|
|
232
|
+
subAgentDefs,
|
|
233
|
+
modelName: options.llmClient.getModel()
|
|
234
|
+
}),
|
|
235
|
+
getToolRegistry: () => {
|
|
236
|
+
const baseRegistry = getToolRegistryForAgent(builderDef);
|
|
237
|
+
return filterToolRegistryForStepDone(baseRegistry, options.injectStepDone === true);
|
|
238
|
+
},
|
|
239
|
+
onToolExecuted: (toolCall, toolResult) => {
|
|
240
|
+
if (toolCall.name === "step_done" && toolResult.success) {
|
|
241
|
+
stepDoneCalled = true;
|
|
242
|
+
}
|
|
243
|
+
if (toolResult.success && ["write_file", "edit_file"].includes(toolCall.name)) {
|
|
244
|
+
const path = toolCall.arguments["path"];
|
|
245
|
+
sessionManager.addModifiedFile(sessionId, path);
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
injectKickoff: () => {
|
|
249
|
+
if (options.injectBuilderKickoff !== true) return;
|
|
250
|
+
const session = sessionManager.requireSession(sessionId);
|
|
251
|
+
const currentWindowMessageOptions = getCurrentContextWindowId(sessionId) ? { contextWindowId: getCurrentContextWindowId(sessionId) } : void 0;
|
|
252
|
+
const events = eventStore.getEvents(sessionId);
|
|
253
|
+
const hasBuilderKickoff = events.some((e) => {
|
|
254
|
+
if (e.type !== "message.start") return false;
|
|
255
|
+
const data = e.data;
|
|
256
|
+
return data.messageKind === "auto-prompt" && data.content?.includes("fulfil the");
|
|
257
|
+
});
|
|
258
|
+
if (!hasBuilderKickoff) {
|
|
259
|
+
const kickoffMsgId = crypto.randomUUID();
|
|
260
|
+
const kickoffContent = BUILDER_KICKOFF_PROMPT(session.criteria.length);
|
|
261
|
+
const msgMetadata = { type: "workflow", name: "Workflow", color: "#f59e0b" };
|
|
262
|
+
eventStore.append(
|
|
263
|
+
sessionId,
|
|
264
|
+
createMessageStartEvent(kickoffMsgId, "user", kickoffContent, {
|
|
265
|
+
...currentWindowMessageOptions ?? {},
|
|
266
|
+
isSystemGenerated: true,
|
|
267
|
+
messageKind: "auto-prompt",
|
|
268
|
+
metadata: msgMetadata
|
|
269
|
+
})
|
|
270
|
+
);
|
|
271
|
+
eventStore.append(sessionId, { type: "message.done", data: { messageId: kickoffMsgId } });
|
|
272
|
+
}
|
|
221
273
|
}
|
|
222
274
|
},
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
const session = sessionManager.requireSession(sessionId);
|
|
226
|
-
const events = eventStore.getEvents(sessionId);
|
|
227
|
-
const hasBuilderKickoff = events.some((e) => {
|
|
228
|
-
if (e.type !== "message.start") return false;
|
|
229
|
-
const data = e.data;
|
|
230
|
-
return data.messageKind === "auto-prompt" && data.content?.includes("fulfil the");
|
|
231
|
-
});
|
|
232
|
-
if (!hasBuilderKickoff) {
|
|
233
|
-
const kickoffMsgId = crypto.randomUUID();
|
|
234
|
-
const kickoffContent = BUILDER_KICKOFF_PROMPT(session.criteria.length);
|
|
235
|
-
eventStore.append(sessionId, createMessageStartEvent(kickoffMsgId, "user", kickoffContent, {
|
|
236
|
-
...getCurrentWindowMessageOptions(sessionId) ?? {},
|
|
237
|
-
isSystemGenerated: true,
|
|
238
|
-
messageKind: "auto-prompt",
|
|
239
|
-
metadata: { type: "workflow", name: "Workflow", color: "#f59e0b" }
|
|
240
|
-
}));
|
|
241
|
-
eventStore.append(sessionId, { type: "message.done", data: { messageId: kickoffMsgId } });
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}, turnMetrics),
|
|
275
|
+
turnMetrics
|
|
276
|
+
),
|
|
245
277
|
stepDoneCalled
|
|
246
278
|
};
|
|
247
279
|
}
|
|
@@ -295,4 +327,4 @@ export {
|
|
|
295
327
|
runBuilderTurn,
|
|
296
328
|
runVerifierTurn
|
|
297
329
|
};
|
|
298
|
-
//# sourceMappingURL=chunk-
|
|
330
|
+
//# sourceMappingURL=chunk-NHJ2GVCF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDatabase
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KIOUKC3Z.js";
|
|
4
4
|
|
|
5
5
|
// src/server/db/settings.ts
|
|
6
6
|
var SETTINGS_KEYS = {
|
|
@@ -18,23 +18,28 @@ var SETTINGS_DEFAULTS = {
|
|
|
18
18
|
[SETTINGS_KEYS.DISPLAY_SHOW_VERBOSE_TOOL_OUTPUT]: "true",
|
|
19
19
|
[SETTINGS_KEYS.DISPLAY_SHOW_STATS]: "true",
|
|
20
20
|
[SETTINGS_KEYS.DISPLAY_SHOW_AGENT_DEFINITIONS]: "true",
|
|
21
|
-
[SETTINGS_KEYS.DISPLAY_SHOW_WORKFLOW_BARS]: "true"
|
|
21
|
+
[SETTINGS_KEYS.DISPLAY_SHOW_WORKFLOW_BARS]: "true",
|
|
22
|
+
[SETTINGS_KEYS.DISPLAY_THEME]: JSON.stringify({ preset: "dark" })
|
|
22
23
|
};
|
|
23
24
|
function getSetting(key) {
|
|
24
25
|
const db = getDatabase();
|
|
25
|
-
const row = db.prepare(
|
|
26
|
+
const row = db.prepare(
|
|
27
|
+
`
|
|
26
28
|
SELECT value FROM settings WHERE key = ?
|
|
27
|
-
`
|
|
29
|
+
`
|
|
30
|
+
).get(key);
|
|
28
31
|
return row?.value ?? null;
|
|
29
32
|
}
|
|
30
33
|
function setSetting(key, value) {
|
|
31
34
|
const db = getDatabase();
|
|
32
35
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
33
|
-
db.prepare(
|
|
36
|
+
db.prepare(
|
|
37
|
+
`
|
|
34
38
|
INSERT INTO settings (key, value, updated_at)
|
|
35
39
|
VALUES (?, ?, ?)
|
|
36
40
|
ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at
|
|
37
|
-
`
|
|
41
|
+
`
|
|
42
|
+
).run(key, value, now);
|
|
38
43
|
}
|
|
39
44
|
function deleteSetting(key) {
|
|
40
45
|
const db = getDatabase();
|
|
@@ -58,4 +63,4 @@ export {
|
|
|
58
63
|
deleteSetting,
|
|
59
64
|
getAllSettings
|
|
60
65
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-OXI26S7U.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
removeProcess,
|
|
8
8
|
startProcess,
|
|
9
9
|
updateStatus
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VRGRAQDG.js";
|
|
11
11
|
|
|
12
12
|
// src/server/tools/background-process/manager.ts
|
|
13
13
|
import { spawn } from "child_process";
|
|
@@ -136,7 +136,7 @@ async function stopProcess(processId, sessionId) {
|
|
|
136
136
|
} catch {
|
|
137
137
|
try {
|
|
138
138
|
process.kill(pid, "SIGKILL");
|
|
139
|
-
} catch
|
|
139
|
+
} catch {
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
resolve();
|
|
@@ -149,7 +149,7 @@ async function stopProcess(processId, sessionId) {
|
|
|
149
149
|
sessionId
|
|
150
150
|
});
|
|
151
151
|
removeProcess(processId, sessionId);
|
|
152
|
-
} catch
|
|
152
|
+
} catch {
|
|
153
153
|
updateStatus(processId, sessionId, "exited", 1);
|
|
154
154
|
emitProcessEvent(processId, {
|
|
155
155
|
type: "backgroundProcess.removed",
|
|
@@ -181,4 +181,4 @@ export {
|
|
|
181
181
|
getSessionProcesses2 as getSessionProcesses,
|
|
182
182
|
getProcessLogs
|
|
183
183
|
};
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-PBGOZMVY.js.map
|
|
@@ -94,9 +94,7 @@ function buildSessionStats(messagesWithStats) {
|
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
function computeSessionStats(messages) {
|
|
97
|
-
const messagesWithStats = messages.filter(
|
|
98
|
-
(msg) => msg.stats !== void 0 && msg.stats !== null
|
|
99
|
-
).sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
|
|
97
|
+
const messagesWithStats = messages.filter((msg) => msg.stats !== void 0 && msg.stats !== null).sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
|
|
100
98
|
if (messagesWithStats.length === 0) {
|
|
101
99
|
return null;
|
|
102
100
|
}
|
|
@@ -125,4 +123,4 @@ function computeSessionStats(messages) {
|
|
|
125
123
|
export {
|
|
126
124
|
computeSessionStats
|
|
127
125
|
};
|
|
128
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-RGRBWDZP.js.map
|
|
@@ -32,9 +32,9 @@ Options:
|
|
|
32
32
|
`);
|
|
33
33
|
}
|
|
34
34
|
async function runNetworkSetup(mode) {
|
|
35
|
-
const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-
|
|
36
|
-
const { saveGlobalConfig } = await import("./config-
|
|
37
|
-
const { getAuthKeyPath } = await import("./paths-
|
|
35
|
+
const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-56SIRACI.js");
|
|
36
|
+
const { saveGlobalConfig } = await import("./config-5CONAOL7.js");
|
|
37
|
+
const { getAuthKeyPath } = await import("./paths-X46PPOI2.js");
|
|
38
38
|
const existingAuth = await loadAuthConfig(mode);
|
|
39
39
|
if (existingAuth) {
|
|
40
40
|
return;
|
|
@@ -94,8 +94,8 @@ async function runNetworkSetup(mode) {
|
|
|
94
94
|
console.log("\u2713 Configuration saved!\n");
|
|
95
95
|
}
|
|
96
96
|
async function runConfig(mode) {
|
|
97
|
-
const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-
|
|
98
|
-
const { getGlobalConfigPath } = await import("./paths-
|
|
97
|
+
const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-5CONAOL7.js");
|
|
98
|
+
const { getGlobalConfigPath } = await import("./paths-X46PPOI2.js");
|
|
99
99
|
const config = await loadGlobalConfig(mode);
|
|
100
100
|
const configPath = getGlobalConfigPath(mode);
|
|
101
101
|
const activeProvider = getActiveProvider(config);
|
|
@@ -149,13 +149,13 @@ async function runCli(options) {
|
|
|
149
149
|
break;
|
|
150
150
|
}
|
|
151
151
|
case "provider": {
|
|
152
|
-
const { runProviderCommand } = await import("./provider-
|
|
152
|
+
const { runProviderCommand } = await import("./provider-ESEBV3LL.js");
|
|
153
153
|
const [, subcommand] = positionals;
|
|
154
154
|
await runProviderCommand(mode, subcommand);
|
|
155
155
|
break;
|
|
156
156
|
}
|
|
157
157
|
case "service": {
|
|
158
|
-
const { runServiceCommand } = await import("./service-
|
|
158
|
+
const { runServiceCommand } = await import("./service-D6LC3CAM.js");
|
|
159
159
|
const [, subcommand] = positionals;
|
|
160
160
|
if (subcommand === "--help" || subcommand === "-h" || values.help) {
|
|
161
161
|
runServiceCommand(mode, void 0);
|
|
@@ -165,7 +165,7 @@ async function runCli(options) {
|
|
|
165
165
|
break;
|
|
166
166
|
}
|
|
167
167
|
case "pwa": {
|
|
168
|
-
const { runPwaCommand, printPwaHelp } = await import("./pwa-
|
|
168
|
+
const { runPwaCommand, printPwaHelp } = await import("./pwa-76XP2DY2.js");
|
|
169
169
|
const [, subcommand] = positionals;
|
|
170
170
|
if (subcommand === "--help" || subcommand === "-h" || values.help) {
|
|
171
171
|
printPwaHelp();
|
|
@@ -185,17 +185,16 @@ async function runCli(options) {
|
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
default: {
|
|
188
|
-
const { configFileExists } = await import("./config-
|
|
188
|
+
const { configFileExists } = await import("./config-5CONAOL7.js");
|
|
189
189
|
const configExists = await configFileExists(mode);
|
|
190
190
|
if (!configExists) {
|
|
191
191
|
await runNetworkSetup(mode);
|
|
192
192
|
}
|
|
193
|
-
const { runServe } = await import("./serve-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
});
|
|
193
|
+
const { runServe } = await import("./serve-OLDABBV3.js");
|
|
194
|
+
const serveOptions = { mode };
|
|
195
|
+
if (values.port) serveOptions.port = parseInt(values.port);
|
|
196
|
+
if (values["no-browser"] === true) serveOptions.openBrowser = false;
|
|
197
|
+
await runServe(serveOptions);
|
|
199
198
|
}
|
|
200
199
|
}
|
|
201
200
|
}
|
|
@@ -203,4 +202,4 @@ async function runCli(options) {
|
|
|
203
202
|
export {
|
|
204
203
|
runCli
|
|
205
204
|
};
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
205
|
+
//# sourceMappingURL=chunk-RQ4XSKUR.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServerMessage,
|
|
3
3
|
isClientMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NDJ6FKSP.js";
|
|
5
5
|
|
|
6
6
|
// src/server/ws/protocol.ts
|
|
7
7
|
function enrichMessagesWithToolResults(messages) {
|
|
@@ -45,7 +45,11 @@ function createErrorMessage(code, message, correlationId) {
|
|
|
45
45
|
}
|
|
46
46
|
function createSessionStateMessage(session, messages, pendingConfirmations = [], correlationId) {
|
|
47
47
|
const enrichedMessages = enrichMessagesWithToolResults(messages);
|
|
48
|
-
return createServerMessage(
|
|
48
|
+
return createServerMessage(
|
|
49
|
+
"session.state",
|
|
50
|
+
{ session, messages: enrichedMessages, pendingConfirmations },
|
|
51
|
+
correlationId
|
|
52
|
+
);
|
|
49
53
|
}
|
|
50
54
|
function createSessionListMessage(sessions, correlationId) {
|
|
51
55
|
return createServerMessage("session.list", { sessions }, correlationId);
|
|
@@ -65,8 +69,8 @@ function createChatDeltaMessage(messageId, content) {
|
|
|
65
69
|
function createChatThinkingMessage(messageId, content) {
|
|
66
70
|
return createServerMessage("chat.thinking", { messageId, content });
|
|
67
71
|
}
|
|
68
|
-
function createChatToolPreparingMessage(messageId, index, name) {
|
|
69
|
-
return createServerMessage("chat.tool_preparing", { messageId, index, name });
|
|
72
|
+
function createChatToolPreparingMessage(messageId, index, name, args) {
|
|
73
|
+
return createServerMessage("chat.tool_preparing", { messageId, index, name, ...args ? { arguments: args } : {} });
|
|
70
74
|
}
|
|
71
75
|
function createChatToolCallMessage(messageId, callId, tool, args) {
|
|
72
76
|
return createServerMessage("chat.tool_call", { messageId, callId, tool, args });
|
|
@@ -96,7 +100,12 @@ function createChatMessageUpdatedMessage(messageId, updates) {
|
|
|
96
100
|
return createServerMessage("chat.message_updated", { messageId, updates });
|
|
97
101
|
}
|
|
98
102
|
function createChatDoneMessage(messageId, reason, stats, agentType) {
|
|
99
|
-
return createServerMessage("chat.done", {
|
|
103
|
+
return createServerMessage("chat.done", {
|
|
104
|
+
messageId,
|
|
105
|
+
reason,
|
|
106
|
+
...stats ? { stats } : {},
|
|
107
|
+
...agentType ? { agentType } : {}
|
|
108
|
+
});
|
|
100
109
|
}
|
|
101
110
|
function createChatErrorMessage(error, recoverable) {
|
|
102
111
|
return createServerMessage("chat.error", { error, recoverable });
|
|
@@ -142,7 +151,9 @@ function isAskAnswerPayload(payload) {
|
|
|
142
151
|
return typeof payload === "object" && payload !== null && "callId" in payload && "answer" in payload;
|
|
143
152
|
}
|
|
144
153
|
function isUIFeedbackPayload(payload) {
|
|
145
|
-
|
|
154
|
+
if (typeof payload !== "object" || payload === null) return false;
|
|
155
|
+
const obj = payload;
|
|
156
|
+
return "sessionId" in payload && typeof obj.sessionId === "string" && "element" in payload && "annotation" in payload && typeof obj.annotation === "string" && "pageUrl" in payload && typeof obj.pageUrl === "string";
|
|
146
157
|
}
|
|
147
158
|
function createQueueStateMessage(messages) {
|
|
148
159
|
return createServerMessage("queue.state", { messages });
|
|
@@ -187,16 +198,11 @@ function storedEventToServerMessage(event) {
|
|
|
187
198
|
}
|
|
188
199
|
case "tool.preparing": {
|
|
189
200
|
const data = event.data;
|
|
190
|
-
return createChatToolPreparingMessage(data.messageId, data.index, data.name);
|
|
201
|
+
return createChatToolPreparingMessage(data.messageId, data.index, data.name, data.arguments);
|
|
191
202
|
}
|
|
192
203
|
case "tool.call": {
|
|
193
204
|
const data = event.data;
|
|
194
|
-
return createChatToolCallMessage(
|
|
195
|
-
data.messageId,
|
|
196
|
-
data.toolCall.id,
|
|
197
|
-
data.toolCall.name,
|
|
198
|
-
data.toolCall.arguments
|
|
199
|
-
);
|
|
205
|
+
return createChatToolCallMessage(data.messageId, data.toolCall.id, data.toolCall.name, data.toolCall.arguments);
|
|
200
206
|
}
|
|
201
207
|
case "tool.output": {
|
|
202
208
|
const data = event.data;
|
|
@@ -313,4 +319,4 @@ export {
|
|
|
313
319
|
createQueueStateMessage,
|
|
314
320
|
storedEventToServerMessage
|
|
315
321
|
};
|
|
316
|
-
//# sourceMappingURL=chunk-
|
|
322
|
+
//# sourceMappingURL=chunk-STYHKCG7.js.map
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
getBackendCapabilities,
|
|
6
6
|
getModelProfile,
|
|
7
7
|
mapFinishReason
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CUDAT6SS.js";
|
|
9
9
|
import {
|
|
10
10
|
ensureVisionFallbackConfigLoaded
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BSTVRSV6.js";
|
|
12
12
|
import {
|
|
13
13
|
logger
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-K44MW7JJ.js";
|
|
15
15
|
|
|
16
16
|
// src/server/llm/models.ts
|
|
17
17
|
var modelCache = /* @__PURE__ */ new Map();
|
|
@@ -191,7 +191,7 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
191
191
|
try {
|
|
192
192
|
const shouldDisableThinking = disableThinking || request.disableThinking === true;
|
|
193
193
|
await ensureVisionFallbackConfigLoaded();
|
|
194
|
-
const { isVisionFallbackEnabled } = await import("./vision-fallback-
|
|
194
|
+
const { isVisionFallbackEnabled } = await import("./vision-fallback-ED27LH6C.js");
|
|
195
195
|
const paramsOptions = {
|
|
196
196
|
model,
|
|
197
197
|
request,
|
|
@@ -252,11 +252,10 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
254
|
} catch (error) {
|
|
255
|
-
logger.error("LLM complete error", { error: error
|
|
256
|
-
throw new LLMError(
|
|
257
|
-
error instanceof Error ? error
|
|
258
|
-
|
|
259
|
-
);
|
|
255
|
+
logger.error("LLM complete error", { error: String(error) });
|
|
256
|
+
throw new LLMError(error instanceof Error ? error.message : "Unknown LLM error", {
|
|
257
|
+
originalError: error instanceof Error ? error : void 0
|
|
258
|
+
});
|
|
260
259
|
}
|
|
261
260
|
},
|
|
262
261
|
async *stream(request) {
|
|
@@ -269,7 +268,7 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
269
268
|
});
|
|
270
269
|
try {
|
|
271
270
|
await ensureVisionFallbackConfigLoaded();
|
|
272
|
-
const { isVisionFallbackEnabled } = await import("./vision-fallback-
|
|
271
|
+
const { isVisionFallbackEnabled } = await import("./vision-fallback-ED27LH6C.js");
|
|
273
272
|
const shouldDisableThinking = disableThinking || request.disableThinking === true;
|
|
274
273
|
const createParams = await buildStreamingCreateParams({
|
|
275
274
|
model,
|
|
@@ -483,4 +482,4 @@ export {
|
|
|
483
482
|
setLlmStatus,
|
|
484
483
|
clearModelCache
|
|
485
484
|
};
|
|
486
|
-
//# sourceMappingURL=chunk-
|
|
485
|
+
//# sourceMappingURL=chunk-TGWEH2BC.js.map
|