openfox 2.0.18 → 2.0.21

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 (27) hide show
  1. package/dist/{chat-handler-Z2C4372A.js → chat-handler-KNDSH5WR.js} +6 -6
  2. package/dist/{chunk-LX66KJPL.js → chunk-6PLAWCHQ.js} +31 -56
  3. package/dist/{chunk-VHWUZ7TO.js → chunk-ASM2Z7JU.js} +2 -2
  4. package/dist/{chunk-M6ELTMPZ.js → chunk-FYW7H7KF.js} +2 -2
  5. package/dist/{chunk-J7KOV4ST.js → chunk-GI24G4OW.js} +3 -3
  6. package/dist/{chunk-FERQPF5N.js → chunk-PKW4YDZ6.js} +66 -572
  7. package/dist/{chunk-MPSOO6KF.js → chunk-T67KB6ZS.js} +7 -7
  8. package/dist/{chunk-FCSFHRKI.js → chunk-TVQTTZYW.js} +20 -12
  9. package/dist/{chunk-4MTSWBWH.js → chunk-VDC2QL2O.js} +4 -4
  10. package/dist/{chunk-SYG2ENUQ.js → chunk-YBWY4DKY.js} +2 -2
  11. package/dist/cli/dev.js +1 -1
  12. package/dist/cli/index.js +1 -1
  13. package/dist/{compactor-FAN7KRQN.js → compactor-EOQYEOFS.js} +4 -4
  14. package/dist/{events-4K52FKPR.js → events-JKPHAR5W.js} +3 -3
  15. package/dist/{folding-QIBNKYA6.js → folding-PI67HWBR.js} +2 -2
  16. package/dist/languages.json +403 -0
  17. package/dist/{orchestrator-YPL5S4QN.js → orchestrator-ZVPFU2ZF.js} +5 -5
  18. package/dist/package.json +2 -2
  19. package/dist/{processor-GUUAJ24C.js → processor-DKAYI3PV.js} +6 -6
  20. package/dist/{serve-Z5GO323T.js → serve-EDGPYCDZ.js} +8 -8
  21. package/dist/server/index.js +7 -7
  22. package/dist/{server-IZL6UZEZ.js → server-CN7ML6XN.js} +7 -7
  23. package/dist/{tools-QTEXQQ7Z.js → tools-ZUOBYTVD.js} +4 -4
  24. package/dist/web/assets/{index-ByjaBwIN.js → index-00migM5L.js} +63 -63
  25. package/dist/web/index.html +1 -1
  26. package/dist/web/sw.js +1 -1
  27. package/package.json +2 -2
@@ -5,11 +5,11 @@ import {
5
5
  generateSessionName,
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
- } from "./chunk-J7KOV4ST.js";
8
+ } from "./chunk-GI24G4OW.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-4MTSWBWH.js";
12
- import "./chunk-FCSFHRKI.js";
11
+ } from "./chunk-VDC2QL2O.js";
12
+ import "./chunk-TVQTTZYW.js";
13
13
  import "./chunk-O4TED6AJ.js";
14
14
  import "./chunk-DX37WNM7.js";
15
15
  import "./chunk-DL6ZILAF.js";
@@ -18,8 +18,8 @@ import "./chunk-VRGRAQDG.js";
18
18
  import "./chunk-NWO6GRYE.js";
19
19
  import {
20
20
  getEventStore
21
- } from "./chunk-SYG2ENUQ.js";
22
- import "./chunk-LX66KJPL.js";
21
+ } from "./chunk-YBWY4DKY.js";
22
+ import "./chunk-6PLAWCHQ.js";
23
23
  import {
24
24
  createChatMessageMessage,
25
25
  createPhaseChangedMessage,
@@ -164,4 +164,4 @@ export {
164
164
  startChatSession,
165
165
  stopSessionExecution
166
166
  };
167
- //# sourceMappingURL=chat-handler-Z2C4372A.js.map
167
+ //# sourceMappingURL=chat-handler-KNDSH5WR.js.map
@@ -210,7 +210,7 @@ function deepCloneMessage(msg) {
210
210
  return cloned;
211
211
  }
212
212
 
213
- // src/server/events/folding.ts
213
+ // src/server/events/fold-messages.ts
214
214
  import stripAnsi from "strip-ansi";
215
215
  function cloneMessage(message) {
216
216
  return {
@@ -282,13 +282,9 @@ function appendSnapshotMessageContext(result, message) {
282
282
  contextMsg.attachments = message.attachments;
283
283
  }
284
284
  result.push(contextMsg);
285
- if (!message.toolCalls) {
286
- return;
287
- }
285
+ if (!message.toolCalls) return;
288
286
  for (const toolCall of message.toolCalls) {
289
- if (!toolCall.result) {
290
- continue;
291
- }
287
+ if (!toolCall.result) continue;
292
288
  result.push({
293
289
  role: "tool",
294
290
  content: stripAnsi(
@@ -303,9 +299,6 @@ Error: ${toolCall.result.error}` : `Error: ${toolCall.result.error}`
303
299
  function applyStoredMessageEvents(initialMessages, events) {
304
300
  return applyEvents(initialMessages, events, { timestampAsNumber: false });
305
301
  }
306
- function getTimestamp(event) {
307
- return event.timestamp ?? Date.now();
308
- }
309
302
  function applyTurnEventsToSnapshotMessages(initialMessages, events) {
310
303
  const messages = applyEvents(initialMessages, events, {
311
304
  timestampAsNumber: true
@@ -435,9 +428,7 @@ function buildContextMessagesFromEventHistory(events, windowId, options) {
435
428
  }
436
429
  const snapshot = snapshotEvent.data;
437
430
  const snapshotMessages = snapshot.messages.reduce((result, message) => {
438
- if (!shouldIncludeContextMessage(message, windowId, options)) {
439
- return result;
440
- }
431
+ if (!shouldIncludeContextMessage(message, windowId, options)) return result;
441
432
  appendSnapshotMessageContext(result, message);
442
433
  return result;
443
434
  }, []);
@@ -450,6 +441,21 @@ function foldTurnEventsToSnapshotMessages(events) {
450
441
  function foldTurnEventsToSnapshotMessagesFromInitial(events, initialMessages) {
451
442
  return applyTurnEventsToSnapshotMessages(initialMessages, events);
452
443
  }
444
+ function getMessagesForWindow(messages, windowId) {
445
+ return messages.filter((m) => m.contextWindowId === windowId);
446
+ }
447
+ function buildContextMessagesFromMessages(messages, windowId) {
448
+ return getMessagesForWindow(messages, windowId).reduce((result, message) => {
449
+ if (!shouldIncludeContextMessage(message, windowId)) return result;
450
+ appendSnapshotMessageContext(result, message);
451
+ return result;
452
+ }, []);
453
+ }
454
+
455
+ // src/server/events/fold-state.ts
456
+ function getTimestamp(event) {
457
+ return event.timestamp ?? Date.now();
458
+ }
453
459
  function foldCriteria(events) {
454
460
  let criteria = [];
455
461
  for (const event of events) {
@@ -531,10 +537,7 @@ function foldContextState(events, initialWindowId) {
531
537
  case "file.read": {
532
538
  const data = event.data;
533
539
  if (data.contextWindowId === currentContextWindowId) {
534
- readFilesMap.set(data.path, {
535
- path: data.path,
536
- tokenCount: data.tokenCount
537
- });
540
+ readFilesMap.set(data.path, { path: data.path, tokenCount: data.tokenCount });
538
541
  }
539
542
  break;
540
543
  }
@@ -627,15 +630,10 @@ function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
627
630
  const event = events[i];
628
631
  if (event.type === "turn.snapshot") {
629
632
  const snapshotData = event.data;
630
- if (snapshotData.cachedSystemPrompt && !cachedSystemPrompt) {
631
- cachedSystemPrompt = snapshotData.cachedSystemPrompt;
632
- }
633
- if (snapshotData.dynamicContextHash && !dynamicContextHash) {
634
- dynamicContextHash = snapshotData.dynamicContextHash;
635
- }
636
- if (snapshotData.metadataEntries && Object.keys(metadataEntries).length === 0) {
633
+ if (snapshotData.cachedSystemPrompt && !cachedSystemPrompt) cachedSystemPrompt = snapshotData.cachedSystemPrompt;
634
+ if (snapshotData.dynamicContextHash && !dynamicContextHash) dynamicContextHash = snapshotData.dynamicContextHash;
635
+ if (snapshotData.metadataEntries && Object.keys(metadataEntries).length === 0)
637
636
  metadataEntries = snapshotData.metadataEntries;
638
- }
639
637
  }
640
638
  }
641
639
  let sessionInit;
@@ -678,18 +676,12 @@ function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
678
676
  const existing = visionFallbacks.find(
679
677
  (v) => v.messageId === data.messageId && v.attachmentId === data.attachmentId
680
678
  );
681
- if (existing) {
682
- existing.description = data.description;
683
- }
679
+ if (existing) existing.description = data.description;
684
680
  break;
685
681
  }
686
682
  case "pattern.retry": {
687
683
  const data = event.data;
688
- formatRetries.push({
689
- attempt: data.attempt,
690
- maxAttempts: data.maxAttempts,
691
- timestamp: getTimestamp(event)
692
- });
684
+ formatRetries.push({ attempt: data.attempt, maxAttempts: data.maxAttempts, timestamp: getTimestamp(event) });
693
685
  break;
694
686
  }
695
687
  case "chat.ask_user": {
@@ -713,10 +705,7 @@ function foldSessionState(events, initialWindowId, maxTokens, initialMessages) {
713
705
  }
714
706
  case "context.compacted": {
715
707
  const data = event.data;
716
- contextWindows.push({
717
- ...data,
718
- timestamp: getTimestamp(event)
719
- });
708
+ contextWindows.push({ ...data, timestamp: getTimestamp(event) });
720
709
  break;
721
710
  }
722
711
  }
@@ -782,9 +771,7 @@ function buildSnapshotFromSessionState(input) {
782
771
  break;
783
772
  }
784
773
  }
785
- if (!initialWindowId) {
786
- initialWindowId = "legacy-window-1";
787
- }
774
+ if (!initialWindowId) initialWindowId = "legacy-window-1";
788
775
  const foldedState = foldSessionState(events, initialWindowId, maxTokens);
789
776
  const latestSnapshotIndex = events.map((event) => event.type).lastIndexOf("turn.snapshot");
790
777
  const latestSnapshotEvent = latestSnapshotIndex >= 0 ? events[latestSnapshotIndex] : void 0;
@@ -817,18 +804,6 @@ function buildSnapshotFromSessionState(input) {
817
804
  ...input.dynamicContextHash !== void 0 ? { dynamicContextHash: input.dynamicContextHash } : foldedState.dynamicContextHash !== void 0 ? { dynamicContextHash: foldedState.dynamicContextHash } : {}
818
805
  };
819
806
  }
820
- function getMessagesForWindow(messages, windowId) {
821
- return messages.filter((m) => m.contextWindowId === windowId);
822
- }
823
- function buildContextMessagesFromMessages(messages, windowId) {
824
- return getMessagesForWindow(messages, windowId).reduce((result, message) => {
825
- if (!shouldIncludeContextMessage(message, windowId)) {
826
- return result;
827
- }
828
- appendSnapshotMessageContext(result, message);
829
- return result;
830
- }, []);
831
- }
832
807
 
833
808
  export {
834
809
  spreadOptionalMessageFields,
@@ -842,6 +817,8 @@ export {
842
817
  buildContextMessagesFromEventHistory,
843
818
  foldTurnEventsToSnapshotMessages,
844
819
  foldTurnEventsToSnapshotMessagesFromInitial,
820
+ getMessagesForWindow,
821
+ buildContextMessagesFromMessages,
845
822
  foldCriteria,
846
823
  foldTodos,
847
824
  foldMetadata,
@@ -852,8 +829,6 @@ export {
852
829
  foldPendingConfirmations,
853
830
  foldSessionState,
854
831
  buildSnapshot,
855
- buildSnapshotFromSessionState,
856
- getMessagesForWindow,
857
- buildContextMessagesFromMessages
832
+ buildSnapshotFromSessionState
858
833
  };
859
- //# sourceMappingURL=chunk-LX66KJPL.js.map
834
+ //# sourceMappingURL=chunk-6PLAWCHQ.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-DX37WNM7.js";
5
5
  import {
6
6
  getCurrentWindowMessageOptions
7
- } from "./chunk-SYG2ENUQ.js";
7
+ } from "./chunk-YBWY4DKY.js";
8
8
 
9
9
  // src/server/context/compactor.ts
10
10
  function appendCompactionPrompt(sessionId, append) {
@@ -31,4 +31,4 @@ export {
31
31
  shouldCompact,
32
32
  getCompactionTarget
33
33
  };
34
- //# sourceMappingURL=chunk-VHWUZ7TO.js.map
34
+ //# sourceMappingURL=chunk-ASM2Z7JU.js.map
@@ -196,7 +196,7 @@ async function runCli(options) {
196
196
  if (!configExists) {
197
197
  await runNetworkSetup(mode);
198
198
  }
199
- const { runServe } = await import("./serve-Z5GO323T.js");
199
+ const { runServe } = await import("./serve-EDGPYCDZ.js");
200
200
  const serveOptions = { mode };
201
201
  if (values.port) serveOptions.port = parseInt(values.port);
202
202
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -208,4 +208,4 @@ async function runCli(options) {
208
208
  export {
209
209
  runCli
210
210
  };
211
- //# sourceMappingURL=chunk-M6ELTMPZ.js.map
211
+ //# sourceMappingURL=chunk-FYW7H7KF.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getEventStore,
3
3
  updateSessionMetadata
4
- } from "./chunk-SYG2ENUQ.js";
4
+ } from "./chunk-YBWY4DKY.js";
5
5
  import {
6
6
  buildMessagesFromStoredEvents,
7
7
  foldPendingConfirmations
8
- } from "./chunk-LX66KJPL.js";
8
+ } from "./chunk-6PLAWCHQ.js";
9
9
  import {
10
10
  createContextStateMessage,
11
11
  createSessionStateMessage
@@ -154,4 +154,4 @@ export {
154
154
  needsNameGenerationCheck,
155
155
  applyGeneratedSessionName
156
156
  };
157
- //# sourceMappingURL=chunk-J7KOV4ST.js.map
157
+ //# sourceMappingURL=chunk-GI24G4OW.js.map