openfox 2.0.143 → 2.0.144

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/CHANGELOG.md +11 -0
  3. package/dist/auto-continue-M3RPFGFI.js +111 -0
  4. package/dist/{chat-handler-VDB4CSXK.js → chat-handler-QOOQOHHR.js} +26 -25
  5. package/dist/{chunk-EX6ROYYS.js → chunk-2DBWCXAQ.js} +3 -3
  6. package/dist/chunk-2DVAF6HY.js +447 -0
  7. package/dist/{chunk-CYTC2E3O.js → chunk-3IVJ65IG.js} +12 -10
  8. package/dist/{chunk-IMQDO5EJ.js → chunk-5ONERSDK.js} +124 -107
  9. package/dist/{chunk-QZV3M6V5.js → chunk-5XKWYLBX.js} +18 -16
  10. package/dist/{chunk-KVDOPLXJ.js → chunk-AWBV2VXO.js} +2 -2
  11. package/dist/{chunk-Z4CTMGFH.js → chunk-C4LI5U6L.js} +36 -34
  12. package/dist/{chunk-F3R4YS3F.js → chunk-CCIG3YLG.js} +2 -2
  13. package/dist/{chunk-2CEZQAGQ.js → chunk-DJH6LMBT.js} +2 -2
  14. package/dist/{chunk-EFEHIJXF.js → chunk-E4F32L4Q.js} +2 -2
  15. package/dist/{chunk-CTAYPMB2.js → chunk-FAN4P45J.js} +2 -2
  16. package/dist/{chunk-5KA3L46F.js → chunk-FLTNKZNQ.js} +9 -9
  17. package/dist/{chunk-DNL2NUDB.js → chunk-GZ4EK4LZ.js} +2 -2
  18. package/dist/{chunk-FHBLF2QR.js → chunk-L2RESXUF.js} +2 -2
  19. package/dist/{chunk-VKZBCC75.js → chunk-MBDYJ35W.js} +13 -11
  20. package/dist/{chunk-DQEANXXF.js → chunk-ODETQHMI.js} +3 -3
  21. package/dist/{chunk-H3QN2J4X.js → chunk-OSUEWIVU.js} +10 -8
  22. package/dist/{chunk-HZOL7UEC.js → chunk-QURYQA4D.js} +4 -4
  23. package/dist/{chunk-N5AJHJG5.js → chunk-STVJA7IX.js} +3 -3
  24. package/dist/{chunk-WSDR27YV.js → chunk-UO4X2ENE.js} +2 -2
  25. package/dist/{chunk-SJTBOREW.js → chunk-VFHGN3IS.js} +4 -4
  26. package/dist/{chunk-SKNPOZYP.js → chunk-X6SWZEK7.js} +3 -1
  27. package/dist/{chunk-TIIWXMGE.js → chunk-X7ZAP6YW.js} +2 -2
  28. package/dist/{chunk-MEPTCUYN.js → chunk-YEFZ5HBD.js} +2 -2
  29. package/dist/{chunk-DRIR2IZR.js → chunk-YEW4YEJU.js} +2 -2
  30. package/dist/{chunk-NJFXYSXP.js → chunk-YRSZJ7IZ.js} +11 -441
  31. package/dist/{chunk-7XA3MEX2.js → chunk-Z3C3D4IR.js} +24 -22
  32. package/dist/{chunk-Z7IT3V22.js → chunk-ZONLEX2F.js} +8 -4
  33. package/dist/chunk-ZSGELOTW.js +7 -0
  34. package/dist/cli/dev.js +1 -1
  35. package/dist/cli/index.js +1 -1
  36. package/dist/{client-ZEGIB3MF.js → client-L4PANCG4.js} +4 -4
  37. package/dist/{compactor-2MSRXHVA.js → compactor-53WDNC2S.js} +11 -10
  38. package/dist/{describe-image-QSEMMRV7.js → describe-image-IGLGVEOJ.js} +12 -11
  39. package/dist/{dynamic-context-3THEBFBI.js → dynamic-context-CR4RUXOX.js} +11 -10
  40. package/dist/{events-UAUOGRSV.js → events-ODZ4SSBW.js} +11 -9
  41. package/dist/{export-import-SYYISNTZ.js → export-import-3WOHC7PI.js} +10 -8
  42. package/dist/{folding-IHD244OU.js → folding-V2R2MZ6Y.js} +4 -4
  43. package/dist/{http-client-RA7XFYPO.js → http-client-SZZBSL4U.js} +3 -3
  44. package/dist/{launch-MF2VT7SU.js → launch-4COI5RGL.js} +26 -25
  45. package/dist/{manager-4SMHCFXY.js → manager-PDG7RKPA.js} +4 -4
  46. package/dist/{orchestrator-BU4RJHPZ.js → orchestrator-AMTWA6JO.js} +25 -24
  47. package/dist/package.json +1 -1
  48. package/dist/{path-security-WOA6MTWQ.js → path-security-3YFS3GJQ.js} +9 -8
  49. package/dist/{platform-EAZNZDAE.js → platform-WCXMN4NM.js} +3 -3
  50. package/dist/{processor-IZ4EAHPD.js → processor-UZ7OBCAK.js} +25 -24
  51. package/dist/{provider-YNTH5YG5.js → provider-QE7XSGYA.js} +5 -5
  52. package/dist/{provider-manager-2UENHAAA.js → provider-manager-WW2EF76W.js} +5 -5
  53. package/dist/{registry-C7RKKHZB.js → registry-24U5BZAJ.js} +3 -3
  54. package/dist/{serve-KKAOO7YM.js → serve-NLQ6IB2V.js} +31 -30
  55. package/dist/server/index.js +30 -29
  56. package/dist/{server-PVO4USPN.js → server-YXKUQ3DD.js} +29 -28
  57. package/dist/{service-OQZWTW34.js → service-KMOSB6SU.js} +7 -7
  58. package/dist/{session-overrides-CKS2AVE5.js → session-overrides-GQKE7WGE.js} +5 -5
  59. package/dist/{sessions-DAHLRQE2.js → sessions-A3IZYL6X.js} +4 -4
  60. package/dist/{settings-TR4BF2C4.js → settings-FQUDSGZF.js} +2 -2
  61. package/dist/store-AOZ46PBS.js +23 -0
  62. package/dist/{tasks-WC23TK6I.js → tasks-X5DM553T.js} +7 -7
  63. package/dist/{tools-CECV6XQ6.js → tools-7L63ZMNU.js} +30 -29
  64. package/dist/{update-6MBRWJAV.js → update-IBN2GJUI.js} +2 -2
  65. package/dist/web/assets/{index-CxuR2kCS.js → index-DL26wmhi.js} +74 -74
  66. package/dist/web/index.html +1 -1
  67. package/dist/web/sw.js +1 -1
  68. package/package.json +1 -1
  69. package/dist/chunk-6DLQ2AV4.js +0 -7
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SETTINGS_KEYS,
3
3
  getSetting
4
- } from "./chunk-SKNPOZYP.js";
4
+ } from "./chunk-X6SWZEK7.js";
5
5
  import {
6
6
  getLocale,
7
7
  setLocale,
@@ -21,4 +21,4 @@ function serverT(tx, vars) {
21
21
  export {
22
22
  serverT
23
23
  };
24
- //# sourceMappingURL=chunk-TIIWXMGE.js.map
24
+ //# sourceMappingURL=chunk-X7ZAP6YW.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SETTINGS_KEYS,
3
3
  getSetting
4
- } from "./chunk-SKNPOZYP.js";
4
+ } from "./chunk-X6SWZEK7.js";
5
5
 
6
6
  // src/server/utils/platform.ts
7
7
  import os from "os";
@@ -63,4 +63,4 @@ export {
63
63
  isWindowsPath,
64
64
  isAbsolutePath
65
65
  };
66
- //# sourceMappingURL=chunk-MEPTCUYN.js.map
66
+ //# sourceMappingURL=chunk-YEFZ5HBD.js.map
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  SETTINGS_KEYS,
9
9
  getSetting
10
- } from "./chunk-SKNPOZYP.js";
10
+ } from "./chunk-X6SWZEK7.js";
11
11
  import {
12
12
  logger
13
13
  } from "./chunk-K44MW7JJ.js";
@@ -352,4 +352,4 @@ export {
352
352
  getOverrideAgentIds,
353
353
  resolveDefaultAgentId
354
354
  };
355
- //# sourceMappingURL=chunk-DRIR2IZR.js.map
355
+ //# sourceMappingURL=chunk-YEW4YEJU.js.map
@@ -1,21 +1,11 @@
1
1
  import {
2
- buildContextMessagesFromEventHistory,
3
- buildMessagesFromStoredEvents,
4
2
  buildSnapshot,
5
- foldContextState,
6
3
  foldSessionState,
7
- spreadOptionalMessageFields,
8
4
  trimSnapshotStreamingOutput
9
- } from "./chunk-EFEHIJXF.js";
10
- import {
11
- updateSessionMessageCount
12
- } from "./chunk-F3R4YS3F.js";
13
- import {
14
- getRuntimeConfig
15
- } from "./chunk-DRIR2IZR.js";
5
+ } from "./chunk-E4F32L4Q.js";
16
6
  import {
17
7
  SETTINGS_KEYS
18
- } from "./chunk-SKNPOZYP.js";
8
+ } from "./chunk-X6SWZEK7.js";
19
9
  import {
20
10
  logger
21
11
  } from "./chunk-K44MW7JJ.js";
@@ -928,6 +918,10 @@ var EventStore = class _EventStore {
928
918
  }
929
919
  };
930
920
  var eventStoreInstance = null;
921
+ var staleRunningSessionIds = [];
922
+ function getStaleRunningSessionIds() {
923
+ return staleRunningSessionIds;
924
+ }
931
925
  function initEventStore(db) {
932
926
  eventStoreInstance = new EventStore(db);
933
927
  try {
@@ -994,6 +988,7 @@ function initEventStore(db) {
994
988
  function resetStaleRunningSessions(eventStore, db) {
995
989
  const sessions = db.prepare(`SELECT id FROM sessions`).all();
996
990
  let resetCount = 0;
991
+ staleRunningSessionIds = [];
997
992
  for (const { id: sessionId } of sessions) {
998
993
  const lastRunningEvent = db.prepare(
999
994
  `
@@ -1010,6 +1005,7 @@ function resetStaleRunningSessions(eventStore, db) {
1010
1005
  data: { isRunning: false }
1011
1006
  });
1012
1007
  resetCount++;
1008
+ staleRunningSessionIds.push(sessionId);
1013
1009
  }
1014
1010
  }
1015
1011
  }
@@ -1057,436 +1053,10 @@ function getEventStore() {
1057
1053
  return eventStoreInstance;
1058
1054
  }
1059
1055
 
1060
- // src/server/events/types.ts
1061
- function isTurnEvent(event) {
1062
- return typeof event === "object" && event !== null && "type" in event && "data" in event && typeof event.type === "string";
1063
- }
1064
- function isStoredEvent(event) {
1065
- return typeof event === "object" && event !== null && "seq" in event && "timestamp" in event && "sessionId" in event && "type" in event && "data" in event;
1066
- }
1067
- function createEvent(type, data) {
1068
- return { type, data };
1069
- }
1070
-
1071
- // src/server/events/session.ts
1072
- function combineEventsWithSnapshot(sessionId, snapshot, events) {
1073
- if (!snapshot) return events;
1074
- const snapshotEvent = {
1075
- seq: 0,
1076
- timestamp: snapshot.snapshotAt,
1077
- sessionId,
1078
- type: "turn.snapshot",
1079
- data: snapshot
1080
- };
1081
- return [snapshotEvent, ...events];
1082
- }
1083
- function toSnapshotMessage(message) {
1084
- return {
1085
- id: message.id,
1086
- role: message.role,
1087
- content: message.content,
1088
- timestamp: new Date(message.timestamp).getTime(),
1089
- ...spreadOptionalMessageFields(message)
1090
- };
1091
- }
1092
- function getSessionState(sessionId, maxTokens, defaultMode) {
1093
- const eventStore = getEventStore();
1094
- const { snapshot: latestSnapshot, events: rawEvents } = eventStore.getEventsSinceSnapshot(sessionId);
1095
- const events = combineEventsWithSnapshot(sessionId, latestSnapshot, rawEvents);
1096
- if (events.length === 0) {
1097
- return void 0;
1098
- }
1099
- let initialWindowId;
1100
- for (const event of events) {
1101
- if (event.type === "session.initialized") {
1102
- const data = event.data;
1103
- initialWindowId = data.contextWindowId;
1104
- break;
1105
- }
1106
- }
1107
- if (!initialWindowId) {
1108
- for (const event of events) {
1109
- if (event.type === "turn.snapshot") {
1110
- const snapshotData = event.data;
1111
- if (snapshotData.sessionInit?.contextWindowId) {
1112
- initialWindowId = snapshotData.sessionInit.contextWindowId;
1113
- break;
1114
- }
1115
- }
1116
- }
1117
- }
1118
- if (!initialWindowId) {
1119
- for (const event of events) {
1120
- if (event.type === "turn.snapshot") {
1121
- const snapshotData = event.data;
1122
- if (snapshotData.currentContextWindowId) {
1123
- initialWindowId = snapshotData.currentContextWindowId;
1124
- break;
1125
- }
1126
- }
1127
- }
1128
- }
1129
- if (!initialWindowId) {
1130
- return void 0;
1131
- }
1132
- const config = getRuntimeConfig();
1133
- const effectiveMaxTokens = maxTokens ?? config.context.maxTokens;
1134
- if (latestSnapshot) {
1135
- const state = foldSessionState(events, initialWindowId, effectiveMaxTokens, void 0, defaultMode);
1136
- return {
1137
- ...state,
1138
- messages: buildMessagesFromStoredEvents(events).messages.map(toSnapshotMessage)
1139
- };
1140
- }
1141
- return foldSessionState(events, initialWindowId, effectiveMaxTokens, void 0, defaultMode);
1142
- }
1143
- function getCurrentWindowMessages(sessionId) {
1144
- const currentWindowId = getCurrentContextWindowId(sessionId);
1145
- if (!currentWindowId) return [];
1146
- const state = getSessionState(sessionId);
1147
- if (!state) return [];
1148
- return state.messages.filter((m) => m.contextWindowId === currentWindowId);
1149
- }
1150
- function getContextMessages(sessionId) {
1151
- const eventStore = getEventStore();
1152
- const currentWindowId = getCurrentContextWindowId(sessionId);
1153
- if (!currentWindowId) return [];
1154
- const { snapshot: ctxSnapshot, events: ctxRawEvents } = eventStore.getEventsSinceSnapshot(sessionId);
1155
- const events = combineEventsWithSnapshot(sessionId, ctxSnapshot, ctxRawEvents);
1156
- if (events.length === 0) return [];
1157
- return buildContextMessagesFromEventHistory(events, currentWindowId, { includeVerifier: false });
1158
- }
1159
- function getCurrentContextWindowId(sessionId) {
1160
- const eventStore = getEventStore();
1161
- const events = eventStore.getEvents(sessionId);
1162
- const contextResult = foldContextState(events, "");
1163
- return contextResult.currentContextWindowId || void 0;
1164
- }
1165
- function getCurrentWindowMessageOptions(sessionId) {
1166
- const contextWindowId = getCurrentContextWindowId(sessionId);
1167
- return contextWindowId ? { contextWindowId } : void 0;
1168
- }
1169
- function getReadFilesCache(sessionId) {
1170
- const state = getSessionState(sessionId);
1171
- return state?.readFiles ?? [];
1172
- }
1173
- function isFileInCache(sessionId, path) {
1174
- const cache = getReadFilesCache(sessionId);
1175
- return cache.some((f) => f.path === path);
1176
- }
1177
- function emitSessionInitialized(sessionId, projectId, workdir, contextWindowId, title) {
1178
- const eventStore = getEventStore();
1179
- eventStore.append(sessionId, {
1180
- type: "session.initialized",
1181
- data: {
1182
- projectId,
1183
- workdir,
1184
- contextWindowId,
1185
- ...title !== void 0 && { title }
1186
- }
1187
- });
1188
- }
1189
- function emitUserMessage(sessionId, content, options) {
1190
- const eventStore = getEventStore();
1191
- const messageId = crypto.randomUUID();
1192
- eventStore.append(sessionId, {
1193
- type: "message.start",
1194
- data: {
1195
- messageId,
1196
- role: "user",
1197
- content,
1198
- ...options?.contextWindowId !== void 0 && { contextWindowId: options.contextWindowId },
1199
- ...options?.isSystemGenerated !== void 0 && { isSystemGenerated: options.isSystemGenerated },
1200
- ...options?.messageKind !== void 0 && { messageKind: options.messageKind },
1201
- ...options?.isCompactionSummary !== void 0 && { isCompactionSummary: options.isCompactionSummary },
1202
- ...options?.tokenCount !== void 0 && { tokenCount: options.tokenCount },
1203
- ...options?.attachments !== void 0 && { attachments: options.attachments },
1204
- ...options?.subAgentId !== void 0 && { subAgentId: options.subAgentId },
1205
- ...options?.subAgentType !== void 0 && { subAgentType: options.subAgentType },
1206
- ...options?.metadata !== void 0 && { metadata: options.metadata }
1207
- }
1208
- });
1209
- eventStore.append(sessionId, {
1210
- type: "message.done",
1211
- data: { messageId }
1212
- });
1213
- updateSessionMessageCount(sessionId, 1);
1214
- return messageId;
1215
- }
1216
- function emitAssistantMessageStart(sessionId, options) {
1217
- const eventStore = getEventStore();
1218
- const messageId = crypto.randomUUID();
1219
- eventStore.append(sessionId, {
1220
- type: "message.start",
1221
- data: {
1222
- messageId,
1223
- role: "assistant",
1224
- ...options?.contextWindowId !== void 0 && { contextWindowId: options.contextWindowId },
1225
- ...options?.subAgentId !== void 0 && { subAgentId: options.subAgentId },
1226
- ...options?.subAgentType !== void 0 && { subAgentType: options.subAgentType }
1227
- }
1228
- });
1229
- updateSessionMessageCount(sessionId, 1);
1230
- return messageId;
1231
- }
1232
- function emitMessageDelta(sessionId, messageId, content) {
1233
- const eventStore = getEventStore();
1234
- eventStore.append(sessionId, {
1235
- type: "message.delta",
1236
- data: { messageId, content }
1237
- });
1238
- }
1239
- function emitMessageThinking(sessionId, messageId, content) {
1240
- const eventStore = getEventStore();
1241
- eventStore.append(sessionId, {
1242
- type: "message.thinking",
1243
- data: { messageId, content }
1244
- });
1245
- }
1246
- function emitMessageDone(sessionId, messageId, options) {
1247
- const eventStore = getEventStore();
1248
- eventStore.append(sessionId, {
1249
- type: "message.done",
1250
- data: {
1251
- messageId,
1252
- ...options?.stats !== void 0 && { stats: options.stats },
1253
- ...options?.segments !== void 0 && { segments: options.segments },
1254
- ...options?.partial !== void 0 && { partial: options.partial },
1255
- ...options?.tokenCount !== void 0 && { tokenCount: options.tokenCount }
1256
- }
1257
- });
1258
- }
1259
- function emitToolPreparing(sessionId, messageId, index, name) {
1260
- const eventStore = getEventStore();
1261
- eventStore.append(sessionId, {
1262
- type: "tool.preparing",
1263
- data: { messageId, index, name }
1264
- });
1265
- }
1266
- function emitToolCall(sessionId, messageId, toolCall) {
1267
- const eventStore = getEventStore();
1268
- eventStore.append(sessionId, {
1269
- type: "tool.call",
1270
- data: { messageId, toolCall }
1271
- });
1272
- }
1273
- function emitToolOutput(sessionId, messageId, toolCallId, stream, content) {
1274
- const eventStore = getEventStore();
1275
- eventStore.append(sessionId, {
1276
- type: "tool.output",
1277
- data: { messageId, toolCallId, stream, content }
1278
- });
1279
- }
1280
- function emitToolResult(sessionId, messageId, toolCallId, result) {
1281
- const eventStore = getEventStore();
1282
- eventStore.append(sessionId, {
1283
- type: "tool.result",
1284
- data: { messageId, toolCallId, result }
1285
- });
1286
- }
1287
- function emitModeChanged(sessionId, mode, auto, reason) {
1288
- const eventStore = getEventStore();
1289
- eventStore.append(sessionId, {
1290
- type: "mode.changed",
1291
- data: {
1292
- mode,
1293
- auto,
1294
- ...reason !== void 0 && { reason }
1295
- }
1296
- });
1297
- }
1298
- function emitPhaseChanged(sessionId, phase) {
1299
- const eventStore = getEventStore();
1300
- eventStore.append(sessionId, {
1301
- type: "phase.changed",
1302
- data: { phase }
1303
- });
1304
- }
1305
- function emitRunningChanged(sessionId, isRunning) {
1306
- const eventStore = getEventStore();
1307
- eventStore.append(sessionId, {
1308
- type: "running.changed",
1309
- data: { isRunning }
1310
- });
1311
- }
1312
- function emitWorkflowExecutionChanged(sessionId, executionId, workflowId, workflowName, workflowColor, status, currentStepId, currentStepName, pendingChoices) {
1313
- const eventStore = getEventStore();
1314
- eventStore.append(sessionId, {
1315
- type: "workflow.execution_changed",
1316
- data: {
1317
- executionId,
1318
- workflowId,
1319
- workflowName,
1320
- ...workflowColor ? { workflowColor } : {},
1321
- status,
1322
- ...currentStepId ? { currentStepId } : {},
1323
- ...currentStepName ? { currentStepName } : {},
1324
- ...pendingChoices !== void 0 ? { pendingChoices } : {}
1325
- }
1326
- });
1327
- }
1328
- function emitCriteriaSet(sessionId, criteria) {
1329
- const eventStore = getEventStore();
1330
- eventStore.append(sessionId, {
1331
- type: "criteria.set",
1332
- data: { criteria }
1333
- });
1334
- }
1335
- function emitCriterionUpdated(sessionId, criterionId, status) {
1336
- const eventStore = getEventStore();
1337
- eventStore.append(sessionId, {
1338
- type: "criterion.updated",
1339
- data: { criterionId, status }
1340
- });
1341
- }
1342
- function emitTodosUpdated(sessionId, todos) {
1343
- const eventStore = getEventStore();
1344
- eventStore.append(sessionId, {
1345
- type: "todo.updated",
1346
- data: { todos }
1347
- });
1348
- }
1349
- function emitMetadataSet(sessionId, key, entries) {
1350
- const eventStore = getEventStore();
1351
- eventStore.append(sessionId, {
1352
- type: "metadata.set",
1353
- data: { key, entries }
1354
- });
1355
- }
1356
- function emitFileRead(sessionId, path, tokenCount, contextWindowId) {
1357
- const eventStore = getEventStore();
1358
- eventStore.append(sessionId, {
1359
- type: "file.read",
1360
- data: { path, tokenCount, contextWindowId }
1361
- });
1362
- }
1363
- function emitContextCompacted(sessionId, closedWindowId, newWindowId, beforeTokens, afterTokens, summary) {
1364
- const eventStore = getEventStore();
1365
- eventStore.append(sessionId, {
1366
- type: "context.compacted",
1367
- data: {
1368
- closedWindowId,
1369
- newWindowId,
1370
- beforeTokens,
1371
- afterTokens,
1372
- summary
1373
- }
1374
- });
1375
- }
1376
- function emitContextState(sessionId, currentTokens, maxTokens, compactionCount, dangerZone, canCompact, subAgentId, dynamicContextChanged) {
1377
- const eventStore = getEventStore();
1378
- eventStore.append(sessionId, {
1379
- type: "context.state",
1380
- data: {
1381
- currentTokens,
1382
- maxTokens,
1383
- compactionCount,
1384
- dangerZone,
1385
- canCompact,
1386
- dynamicContextChanged: dynamicContextChanged ?? false,
1387
- ...subAgentId !== void 0 && { subAgentId }
1388
- }
1389
- });
1390
- }
1391
- function emitChatDone(sessionId, messageId, reason, stats) {
1392
- const eventStore = getEventStore();
1393
- eventStore.append(sessionId, {
1394
- type: "chat.done",
1395
- data: {
1396
- messageId,
1397
- reason,
1398
- ...stats !== void 0 && { stats }
1399
- }
1400
- });
1401
- }
1402
- function emitChatError(sessionId, error, recoverable) {
1403
- const eventStore = getEventStore();
1404
- eventStore.append(sessionId, {
1405
- type: "chat.error",
1406
- data: { error, recoverable }
1407
- });
1408
- }
1409
- function emitPatternRetry(sessionId, messageId, pattern, field, attempt, maxAttempts, matchedContent) {
1410
- const eventStore = getEventStore();
1411
- eventStore.append(sessionId, {
1412
- type: "pattern.retry",
1413
- data: { messageId, pattern, field, attempt, maxAttempts, matchedContent }
1414
- });
1415
- }
1416
- function emitTurnSnapshot(sessionId, snapshot) {
1417
- const eventStore = getEventStore();
1418
- eventStore.append(sessionId, {
1419
- type: "turn.snapshot",
1420
- data: snapshot
1421
- });
1422
- }
1423
- function truncateSessionMessages(sessionId, messageIndex) {
1424
- const eventStore = getEventStore();
1425
- const snapshotEvent = eventStore.getLatestSnapshot(sessionId);
1426
- if (!snapshotEvent) return;
1427
- const snapshot = snapshotEvent.data;
1428
- const messages = snapshot.messages;
1429
- const lastKept = messageIndex + 1;
1430
- if (lastKept < 0 || lastKept >= messages.length) return;
1431
- const truncatedSnapshot = { ...snapshot, messages: messages.slice(0, lastKept) };
1432
- eventStore.deleteEventsAfterSeq(sessionId, snapshotEvent.seq);
1433
- eventStore.append(sessionId, {
1434
- type: "turn.snapshot",
1435
- data: truncatedSnapshot
1436
- });
1437
- const removed = messages.length - lastKept;
1438
- updateSessionMessageCount(sessionId, -removed);
1439
- }
1440
- function getRecentUserPromptsForSession(sessionId, limit = 10) {
1441
- try {
1442
- const eventStore = getEventStore();
1443
- return eventStore.getRecentUserPrompts(sessionId, limit);
1444
- } catch {
1445
- return [];
1446
- }
1447
- }
1448
-
1449
1056
  export {
1450
1057
  EventStore,
1058
+ getStaleRunningSessionIds,
1451
1059
  initEventStore,
1452
- getEventStore,
1453
- isTurnEvent,
1454
- isStoredEvent,
1455
- createEvent,
1456
- combineEventsWithSnapshot,
1457
- getSessionState,
1458
- getCurrentWindowMessages,
1459
- getContextMessages,
1460
- getCurrentContextWindowId,
1461
- getCurrentWindowMessageOptions,
1462
- getReadFilesCache,
1463
- isFileInCache,
1464
- emitSessionInitialized,
1465
- emitUserMessage,
1466
- emitAssistantMessageStart,
1467
- emitMessageDelta,
1468
- emitMessageThinking,
1469
- emitMessageDone,
1470
- emitToolPreparing,
1471
- emitToolCall,
1472
- emitToolOutput,
1473
- emitToolResult,
1474
- emitModeChanged,
1475
- emitPhaseChanged,
1476
- emitRunningChanged,
1477
- emitWorkflowExecutionChanged,
1478
- emitCriteriaSet,
1479
- emitCriterionUpdated,
1480
- emitTodosUpdated,
1481
- emitMetadataSet,
1482
- emitFileRead,
1483
- emitContextCompacted,
1484
- emitContextState,
1485
- emitChatDone,
1486
- emitChatError,
1487
- emitPatternRetry,
1488
- emitTurnSnapshot,
1489
- truncateSessionMessages,
1490
- getRecentUserPromptsForSession
1060
+ getEventStore
1491
1061
  };
1492
- //# sourceMappingURL=chunk-NJFXYSXP.js.map
1062
+ //# sourceMappingURL=chunk-YRSZJ7IZ.js.map
@@ -2,55 +2,57 @@ import {
2
2
  generateSessionNameForSession,
3
3
  getSessionMessageCount,
4
4
  needsNameGeneration
5
- } from "./chunk-CYTC2E3O.js";
5
+ } from "./chunk-3IVJ65IG.js";
6
6
  import {
7
7
  launchWorkflowRun
8
- } from "./chunk-VKZBCC75.js";
8
+ } from "./chunk-MBDYJ35W.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-QZV3M6V5.js";
11
+ } from "./chunk-5XKWYLBX.js";
12
12
  import {
13
13
  applyDynamicContext,
14
14
  computeSessionHash,
15
15
  computeUnifiedDiff
16
- } from "./chunk-H3QN2J4X.js";
16
+ } from "./chunk-OSUEWIVU.js";
17
17
  import {
18
18
  devServerManager
19
- } from "./chunk-Z4CTMGFH.js";
19
+ } from "./chunk-C4LI5U6L.js";
20
20
  import {
21
21
  gitSpawnEnv
22
22
  } from "./chunk-J7GAZGZT.js";
23
23
  import {
24
24
  serverT
25
- } from "./chunk-TIIWXMGE.js";
25
+ } from "./chunk-X7ZAP6YW.js";
26
26
  import {
27
27
  appendCompactionPrompt
28
- } from "./chunk-SJTBOREW.js";
28
+ } from "./chunk-VFHGN3IS.js";
29
29
  import {
30
30
  hasRecentLLMFailure,
31
31
  interruptLLMRetryWait
32
- } from "./chunk-CTAYPMB2.js";
32
+ } from "./chunk-FAN4P45J.js";
33
33
  import {
34
34
  onProcessEvent
35
- } from "./chunk-DQEANXXF.js";
35
+ } from "./chunk-ODETQHMI.js";
36
36
  import {
37
37
  killProcessTree
38
38
  } from "./chunk-I72ACQ6R.js";
39
39
  import {
40
- getPendingQuestionsForSession,
41
- provideAnswer
42
- } from "./chunk-V5AC2TV7.js";
40
+ combineEventsWithSnapshot
41
+ } from "./chunk-2DVAF6HY.js";
43
42
  import {
44
- combineEventsWithSnapshot,
45
43
  getEventStore
46
- } from "./chunk-NJFXYSXP.js";
44
+ } from "./chunk-YRSZJ7IZ.js";
47
45
  import {
48
46
  buildMessagesFromStoredEvents,
49
47
  foldPendingConfirmations
50
- } from "./chunk-EFEHIJXF.js";
48
+ } from "./chunk-E4F32L4Q.js";
51
49
  import {
52
50
  getRuntimeConfig
53
- } from "./chunk-DRIR2IZR.js";
51
+ } from "./chunk-YEW4YEJU.js";
52
+ import {
53
+ getPendingQuestionsForSession,
54
+ provideAnswer
55
+ } from "./chunk-V5AC2TV7.js";
54
56
  import {
55
57
  createChatErrorMessage,
56
58
  createChatMessageMessage,
@@ -69,10 +71,10 @@ import {
69
71
  } from "./chunk-OVAHNEFG.js";
70
72
  import {
71
73
  getPlatformShell
72
- } from "./chunk-MEPTCUYN.js";
74
+ } from "./chunk-YEFZ5HBD.js";
73
75
  import {
74
76
  getMaxVisibleItems
75
- } from "./chunk-SKNPOZYP.js";
77
+ } from "./chunk-X6SWZEK7.js";
76
78
  import {
77
79
  logger
78
80
  } from "./chunk-K44MW7JJ.js";
@@ -1350,8 +1352,8 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
1350
1352
  }
1351
1353
  const session = sessionManager.requireSession(sessionId);
1352
1354
  try {
1353
- const { buildCachedPrompt, computePreviewToolDiff } = await import("./dynamic-context-3THEBFBI.js");
1354
- const allAgents = await import("./registry-C7RKKHZB.js");
1355
+ const { buildCachedPrompt, computePreviewToolDiff } = await import("./dynamic-context-CR4RUXOX.js");
1356
+ const allAgents = await import("./registry-24U5BZAJ.js");
1355
1357
  const agentDef = allAgents.findAgentById(session.mode, await allAgents.loadAllAgentsDefault()) ?? allAgents.findAgentById("planner", await allAgents.loadAllAgentsDefault());
1356
1358
  const modelName = session.providerModel ?? _providerManager?.getCurrentModel();
1357
1359
  const {
@@ -1362,7 +1364,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
1362
1364
  const oldCached = sessionManager.getCachedPrompt(sessionId);
1363
1365
  const oldPrompt = oldCached?.systemPrompt;
1364
1366
  const diff = oldPrompt ? computeUnifiedDiff(oldPrompt, newPrompt) : [];
1365
- const { getToolRegistryForAgent } = await import("./tools-CECV6XQ6.js");
1367
+ const { getToolRegistryForAgent } = await import("./tools-7L63ZMNU.js");
1366
1368
  const unfilteredTools = getToolRegistryForAgent(agentDef).definitions;
1367
1369
  const toolDiff = computePreviewToolDiff(oldCached?.tools, unfilteredTools, newTools);
1368
1370
  send({
@@ -1735,4 +1737,4 @@ export {
1735
1737
  signalMcpReady,
1736
1738
  createWebSocketServer
1737
1739
  };
1738
- //# sourceMappingURL=chunk-7XA3MEX2.js.map
1740
+ //# sourceMappingURL=chunk-Z3C3D4IR.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getPlatformShell
3
- } from "./chunk-MEPTCUYN.js";
3
+ } from "./chunk-YEFZ5HBD.js";
4
4
  import {
5
5
  SETTINGS_KEYS,
6
6
  getSetting
7
- } from "./chunk-SKNPOZYP.js";
7
+ } from "./chunk-X6SWZEK7.js";
8
8
 
9
9
  // src/server/tools/tool-policy.ts
10
10
  var ALWAYS_ALLOWED = /* @__PURE__ */ new Set(["step_done"]);
@@ -265,6 +265,8 @@ Summarize the conversation history concisely, preserving:
265
265
 
266
266
  Do not respond to any questions in the conversation, only output the summary.
267
267
  Be thorough but concise. Output as a structured summary.`;
268
+ var CONTINUE_PROMPT = "Continue your previous response. Do NOT repeat what you already wrote.";
269
+ var CONTINUE_AFTER_STREAM_ERROR_PROMPT = "The LLM stream was interrupted mid-response. Continue exactly where you left off \u2014 do not repeat what was already written.";
268
270
 
269
271
  export {
270
272
  ALWAYS_ALLOWED,
@@ -275,6 +277,8 @@ export {
275
277
  buildTopLevelSystemPrompt,
276
278
  buildAgentReminder,
277
279
  buildAgentSmallReminder,
278
- COMPACTION_PROMPT
280
+ COMPACTION_PROMPT,
281
+ CONTINUE_PROMPT,
282
+ CONTINUE_AFTER_STREAM_ERROR_PROMPT
279
283
  };
280
- //# sourceMappingURL=chunk-Z7IT3V22.js.map
284
+ //# sourceMappingURL=chunk-ZONLEX2F.js.map
@@ -0,0 +1,7 @@
1
+ // src/constants.ts
2
+ var VERSION = "2.0.144";
3
+
4
+ export {
5
+ VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-ZSGELOTW.js.map
package/dist/cli/dev.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-HZOL7UEC.js";
4
+ } from "../chunk-QURYQA4D.js";
5
5
  import "../chunk-AGXJ5O63.js";
6
6
  import "../chunk-2OMGR7LN.js";
7
7
  import {