openfox 1.6.76 → 1.6.78

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 (32) hide show
  1. package/README.md +18 -18
  2. package/dist/agent-defaults/code-reviewer.agent.md +1 -0
  3. package/dist/agent-defaults/explorer.agent.md +2 -1
  4. package/dist/agent-defaults/verifier.agent.md +4 -0
  5. package/dist/{auto-compaction-V3PA77WG.js → auto-compaction-AN3U2AD5.js} +5 -5
  6. package/dist/{chat-handler-7DKHGTVO.js → chat-handler-AIBOSHAQ.js} +8 -8
  7. package/dist/{chunk-LCQ3MPXD.js → chunk-2IZMUXMP.js} +3 -3
  8. package/dist/{chunk-K2V7EW5F.js → chunk-DKKDNJT7.js} +36 -22
  9. package/dist/{chunk-XKIEDGQF.js → chunk-DL6ZILAF.js} +1 -2
  10. package/dist/{chunk-H5EICXF3.js → chunk-GLVNO4DS.js} +188 -91
  11. package/dist/{chunk-NHJ2GVCF.js → chunk-NWXLRRDD.js} +4 -4
  12. package/dist/{chunk-5ZD3GZTK.js → chunk-RJRG2VER.js} +33 -2
  13. package/dist/{chunk-VAMTEAYI.js → chunk-TS5XFQ2D.js} +100 -49
  14. package/dist/{chunk-RQ4XSKUR.js → chunk-VSYJIPRI.js} +3 -3
  15. package/dist/cli/dev.js +1 -1
  16. package/dist/cli/index.js +1 -1
  17. package/dist/{events-BDXQOC7F.js → events-ND5GZBT2.js} +7 -5
  18. package/dist/{folding-2HW7FIKL.js → folding-XIKR6AFM.js} +14 -4
  19. package/dist/{inspect-proxy-Y75AXMRX.js → inspect-proxy-42ZXL2R5.js} +2 -2
  20. package/dist/{orchestrator-KCHEENHK.js → orchestrator-5BY2MH72.js} +6 -6
  21. package/dist/package.json +1 -1
  22. package/dist/{processor-6TS37IYH.js → processor-PV446N55.js} +5 -5
  23. package/dist/{serve-OLDABBV3.js → serve-6ME66XOO.js} +7 -7
  24. package/dist/server/index.js +6 -6
  25. package/dist/server/public/__inspect__.js +161 -142
  26. package/dist/{service-D6LC3CAM.js → service-TU4XSXYJ.js} +33 -2
  27. package/dist/{tools-BHYHS3RY.js → tools-6DXPHBUV.js} +5 -5
  28. package/dist/web/__inspect__.js +178 -155
  29. package/dist/web/assets/{index-DAuZ02-Q.js → index-0igqGWob.js} +65 -65
  30. package/dist/web/index.html +2 -2
  31. package/dist/web/sw.js +1 -1
  32. package/package.json +1 -1
@@ -38,6 +38,9 @@ function updateMessageDone(msg, data) {
38
38
  if (data.partial) msg.partial = true;
39
39
  if (data.promptContext) msg.promptContext = data.promptContext;
40
40
  if (data.tokenCount !== void 0) msg.tokenCount = data.tokenCount;
41
+ if ("preparingToolCalls" in msg) {
42
+ msg.preparingToolCalls = [];
43
+ }
41
44
  }
42
45
  function applyEvents(initialMessages, events, options) {
43
46
  const messages = new Map(initialMessages.map((message) => [message.id, deepCloneMessage(message)]));
@@ -99,7 +102,18 @@ function applyEvents(initialMessages, events, options) {
99
102
  const msg = messages.get(data.messageId);
100
103
  if (msg) {
101
104
  const preparing = msg.preparingToolCalls ?? [];
102
- preparing.push({ index: data.index, name: data.name });
105
+ const existingIndex = preparing.findIndex((p) => p.index === data.index);
106
+ const entry = {
107
+ index: data.index,
108
+ name: data.name,
109
+ ...data.arguments ? { arguments: data.arguments } : {}
110
+ };
111
+ if (existingIndex >= 0) {
112
+ preparing[existingIndex] = entry;
113
+ } else {
114
+ preparing.push(entry);
115
+ }
116
+ ;
103
117
  msg.preparingToolCalls = preparing;
104
118
  }
105
119
  break;
@@ -236,7 +250,7 @@ function cloneMessage(message) {
236
250
  }))
237
251
  } : {},
238
252
  ...message.segments ? { segments: [...message.segments] } : {},
239
- ...message.preparingToolCalls ? { preparingToolCalls: [...message.preparingToolCalls] } : {}
253
+ ...message.preparingToolCalls && message.preparingToolCalls.length > 0 ? { preparingToolCalls: [...message.preparingToolCalls] } : {}
240
254
  };
241
255
  }
242
256
  function spreadOptionalMessageFields(message) {
@@ -256,6 +270,7 @@ function spreadOptionalMessageFields(message) {
256
270
  ...message.isCompactionSummary !== void 0 && { isCompactionSummary: message.isCompactionSummary },
257
271
  ...message.promptContext !== void 0 && { promptContext: message.promptContext },
258
272
  ...message.attachments !== void 0 && { attachments: message.attachments },
273
+ ...message.preparingToolCalls !== void 0 && message.preparingToolCalls.length > 0 && { preparingToolCalls: message.preparingToolCalls },
259
274
  ...message.metadata !== void 0 && { metadata: message.metadata }
260
275
  };
261
276
  }
@@ -281,11 +296,14 @@ function appendSnapshotMessageContext(result, message) {
281
296
  contextMsg.thinkingContent = message.thinkingContent;
282
297
  }
283
298
  if (message.toolCalls && message.toolCalls.length > 0) {
284
- contextMsg.toolCalls = message.toolCalls.map((toolCall) => ({
285
- id: toolCall.id,
286
- name: toolCall.name,
287
- arguments: toolCall.arguments
288
- }));
299
+ const fulfilledToolCalls = message.toolCalls.filter((tc) => tc.result);
300
+ if (fulfilledToolCalls.length > 0) {
301
+ contextMsg.toolCalls = fulfilledToolCalls.map((toolCall) => ({
302
+ id: toolCall.id,
303
+ name: toolCall.name,
304
+ arguments: toolCall.arguments
305
+ }));
306
+ }
289
307
  }
290
308
  if (message.attachments !== void 0) {
291
309
  contextMsg.attachments = message.attachments;
@@ -335,6 +353,7 @@ function buildContextMessagesFromStoredEvents(events, windowId, options) {
335
353
  const includeVerifier = options?.includeVerifier ?? true;
336
354
  const messages = [];
337
355
  const messageMap = /* @__PURE__ */ new Map();
356
+ const fulfilledToolCallIds = /* @__PURE__ */ new Set();
338
357
  for (const event of events) {
339
358
  switch (event.type) {
340
359
  case "message.start": {
@@ -352,62 +371,89 @@ function buildContextMessagesFromStoredEvents(events, windowId, options) {
352
371
  break;
353
372
  }
354
373
  case "message.thinking": {
355
- const data = event.data;
356
- const msg = messageMap.get(data.messageId);
357
- if (msg) {
358
- msg.thinkingContent = (msg.thinkingContent ?? "") + data.content;
359
- }
374
+ handleMessageThinking(messageMap, event.data);
360
375
  break;
361
376
  }
362
377
  case "message.delta": {
363
- const data = event.data;
364
- const msg = messageMap.get(data.messageId);
365
- if (msg) {
366
- msg.content += data.content;
367
- }
378
+ handleMessageDelta(messageMap, event.data);
368
379
  break;
369
380
  }
370
381
  case "tool.call": {
371
- const data = event.data;
372
- const msg = messageMap.get(data.messageId);
373
- if (msg) {
374
- if (!msg.toolCalls) msg.toolCalls = [];
375
- msg.toolCalls.push(data.toolCall);
376
- }
382
+ handleToolCall(messageMap, event.data);
377
383
  break;
378
384
  }
379
385
  case "tool.result": {
380
- const data = event.data;
381
- if (messageMap.has(data.messageId)) {
382
- const imageMeta = data.result.metadata;
383
- const msg = {
384
- id: `tool-${data.toolCallId}`,
385
- role: "tool",
386
- content: stripAnsi(
387
- data.result.success ? data.result.output ?? "Success" : data.result.output ? `${data.result.output}
386
+ handleToolResult(
387
+ messages,
388
+ messageMap,
389
+ fulfilledToolCallIds,
390
+ event.data
391
+ );
392
+ break;
393
+ }
394
+ }
395
+ }
396
+ stripOrphanedToolCalls(messages, fulfilledToolCallIds);
397
+ return messages.map(({ id: _id, ...message }) => message);
398
+ }
399
+ function handleMessageThinking(messageMap, data) {
400
+ const msg = messageMap.get(data.messageId);
401
+ if (msg) {
402
+ msg.thinkingContent = (msg.thinkingContent ?? "") + data.content;
403
+ }
404
+ }
405
+ function handleMessageDelta(messageMap, data) {
406
+ const msg = messageMap.get(data.messageId);
407
+ if (msg) {
408
+ msg.content += data.content;
409
+ }
410
+ }
411
+ function handleToolCall(messageMap, data) {
412
+ const msg = messageMap.get(data.messageId);
413
+ if (msg) {
414
+ if (!msg.toolCalls) msg.toolCalls = [];
415
+ msg.toolCalls.push(data.toolCall);
416
+ }
417
+ }
418
+ function handleToolResult(messages, messageMap, fulfilled, data) {
419
+ fulfilled.add(data.toolCallId);
420
+ if (messageMap.has(data.messageId)) {
421
+ const imageMeta = data.result.metadata;
422
+ const toolMsg = {
423
+ id: `tool-${data.toolCallId}`,
424
+ role: "tool",
425
+ content: stripAnsi(
426
+ data.result.success ? data.result.output ?? "Success" : data.result.output ? `${data.result.output}
388
427
 
389
428
  Error: ${data.result.error}` : `Error: ${data.result.error}`
390
- ),
391
- toolCallId: data.toolCallId
392
- };
393
- if (imageMeta?.dataUrl && imageMeta?.mimeType?.startsWith("image/")) {
394
- msg.attachments = [
395
- {
396
- id: crypto.randomUUID(),
397
- filename: imageMeta.path ?? "image",
398
- mimeType: imageMeta.mimeType,
399
- size: imageMeta.size ?? 0,
400
- data: imageMeta.dataUrl
401
- }
402
- ];
403
- }
404
- messages.push(msg);
429
+ ),
430
+ toolCallId: data.toolCallId
431
+ };
432
+ if (imageMeta?.dataUrl && imageMeta?.mimeType?.startsWith("image/")) {
433
+ toolMsg.attachments = [
434
+ {
435
+ id: crypto.randomUUID(),
436
+ filename: imageMeta.path ?? "image",
437
+ mimeType: imageMeta.mimeType,
438
+ size: imageMeta.size ?? 0,
439
+ data: imageMeta.dataUrl
405
440
  }
406
- break;
441
+ ];
442
+ }
443
+ messages.push(toolMsg);
444
+ }
445
+ }
446
+ function stripOrphanedToolCalls(messages, fulfilledToolCallIds) {
447
+ for (const msg of messages) {
448
+ if (msg.role === "assistant" && msg.toolCalls) {
449
+ const fulfilled = msg.toolCalls.filter((tc) => fulfilledToolCallIds.has(tc.id));
450
+ if (fulfilled.length === 0) {
451
+ delete msg.toolCalls;
452
+ } else {
453
+ msg.toolCalls = fulfilled;
407
454
  }
408
455
  }
409
456
  }
410
- return messages.map(({ id: _id, ...message }) => message);
411
457
  }
412
458
  function buildContextMessagesFromEventHistory(events, windowId, options) {
413
459
  const snapshotEvent = [...events].reverse().find((event) => event.type === "turn.snapshot");
@@ -813,6 +859,11 @@ export {
813
859
  spreadOptionalMessageFields,
814
860
  buildMessagesFromStoredEvents,
815
861
  buildContextMessagesFromStoredEvents,
862
+ handleMessageThinking,
863
+ handleMessageDelta,
864
+ handleToolCall,
865
+ handleToolResult,
866
+ stripOrphanedToolCalls,
816
867
  buildContextMessagesFromEventHistory,
817
868
  foldTurnEventsToSnapshotMessages,
818
869
  foldTurnEventsToSnapshotMessagesFromInitial,
@@ -829,4 +880,4 @@ export {
829
880
  getMessagesForWindow,
830
881
  buildContextMessagesFromMessages
831
882
  };
832
- //# sourceMappingURL=chunk-VAMTEAYI.js.map
883
+ //# sourceMappingURL=chunk-TS5XFQ2D.js.map
@@ -155,7 +155,7 @@ async function runCli(options) {
155
155
  break;
156
156
  }
157
157
  case "service": {
158
- const { runServiceCommand } = await import("./service-D6LC3CAM.js");
158
+ const { runServiceCommand } = await import("./service-TU4XSXYJ.js");
159
159
  const [, subcommand] = positionals;
160
160
  if (subcommand === "--help" || subcommand === "-h" || values.help) {
161
161
  runServiceCommand(mode, void 0);
@@ -190,7 +190,7 @@ async function runCli(options) {
190
190
  if (!configExists) {
191
191
  await runNetworkSetup(mode);
192
192
  }
193
- const { runServe } = await import("./serve-OLDABBV3.js");
193
+ const { runServe } = await import("./serve-6ME66XOO.js");
194
194
  const serveOptions = { mode };
195
195
  if (values.port) serveOptions.port = parseInt(values.port);
196
196
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -202,4 +202,4 @@ async function runCli(options) {
202
202
  export {
203
203
  runCli
204
204
  };
205
- //# sourceMappingURL=chunk-RQ4XSKUR.js.map
205
+ //# sourceMappingURL=chunk-VSYJIPRI.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-RQ4XSKUR.js";
4
+ } from "../chunk-VSYJIPRI.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-K44MW7JJ.js";
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-RQ4XSKUR.js";
4
+ } from "../chunk-VSYJIPRI.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-K44MW7JJ.js";
@@ -35,8 +35,9 @@ import {
35
35
  initEventStore,
36
36
  isFileInCache,
37
37
  isStoredEvent,
38
- isTurnEvent
39
- } from "./chunk-5ZD3GZTK.js";
38
+ isTurnEvent,
39
+ truncateSessionMessages
40
+ } from "./chunk-RJRG2VER.js";
40
41
  import "./chunk-KIOUKC3Z.js";
41
42
  import {
42
43
  buildContextMessagesFromEventHistory,
@@ -54,7 +55,7 @@ import {
54
55
  foldTodos,
55
56
  foldTurnEventsToSnapshotMessages,
56
57
  getMessagesForWindow
57
- } from "./chunk-VAMTEAYI.js";
58
+ } from "./chunk-TS5XFQ2D.js";
58
59
  import "./chunk-B5AP3RSV.js";
59
60
  import "./chunk-K44MW7JJ.js";
60
61
  export {
@@ -109,6 +110,7 @@ export {
109
110
  initEventStore,
110
111
  isFileInCache,
111
112
  isStoredEvent,
112
- isTurnEvent
113
+ isTurnEvent,
114
+ truncateSessionMessages
113
115
  };
114
- //# sourceMappingURL=events-BDXQOC7F.js.map
116
+ //# sourceMappingURL=events-ND5GZBT2.js.map
@@ -16,8 +16,13 @@ import {
16
16
  foldTurnEventsToSnapshotMessages,
17
17
  foldTurnEventsToSnapshotMessagesFromInitial,
18
18
  getMessagesForWindow,
19
- spreadOptionalMessageFields
20
- } from "./chunk-VAMTEAYI.js";
19
+ handleMessageDelta,
20
+ handleMessageThinking,
21
+ handleToolCall,
22
+ handleToolResult,
23
+ spreadOptionalMessageFields,
24
+ stripOrphanedToolCalls
25
+ } from "./chunk-TS5XFQ2D.js";
21
26
  export {
22
27
  buildContextMessagesFromEventHistory,
23
28
  buildContextMessagesFromMessages,
@@ -36,6 +41,11 @@ export {
36
41
  foldTurnEventsToSnapshotMessages,
37
42
  foldTurnEventsToSnapshotMessagesFromInitial,
38
43
  getMessagesForWindow,
39
- spreadOptionalMessageFields
44
+ handleMessageDelta,
45
+ handleMessageThinking,
46
+ handleToolCall,
47
+ handleToolResult,
48
+ spreadOptionalMessageFields,
49
+ stripOrphanedToolCalls
40
50
  };
41
- //# sourceMappingURL=folding-2HW7FIKL.js.map
51
+ //# sourceMappingURL=folding-XIKR6AFM.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  startInspectProxy,
3
3
  stopAllInspectProxies
4
- } from "./chunk-XKIEDGQF.js";
4
+ } from "./chunk-DL6ZILAF.js";
5
5
  import "./chunk-K44MW7JJ.js";
6
6
  export {
7
7
  startInspectProxy,
8
8
  stopAllInspectProxies
9
9
  };
10
- //# sourceMappingURL=inspect-proxy-Y75AXMRX.js.map
10
+ //# sourceMappingURL=inspect-proxy-42ZXL2R5.js.map
@@ -3,7 +3,7 @@ import {
3
3
  runBuilderTurn,
4
4
  runChatTurn,
5
5
  runVerifierTurn
6
- } from "./chunk-NHJ2GVCF.js";
6
+ } from "./chunk-NWXLRRDD.js";
7
7
  import {
8
8
  TurnMetrics,
9
9
  createChatDoneEvent,
@@ -11,16 +11,16 @@ import {
11
11
  createMessageStartEvent,
12
12
  createToolCallEvent,
13
13
  createToolResultEvent
14
- } from "./chunk-H5EICXF3.js";
14
+ } from "./chunk-GLVNO4DS.js";
15
15
  import "./chunk-OXI26S7U.js";
16
16
  import "./chunk-CMQCO27Y.js";
17
- import "./chunk-XKIEDGQF.js";
17
+ import "./chunk-DL6ZILAF.js";
18
18
  import "./chunk-PBGOZMVY.js";
19
19
  import "./chunk-VRGRAQDG.js";
20
20
  import "./chunk-CUDAT6SS.js";
21
- import "./chunk-5ZD3GZTK.js";
21
+ import "./chunk-RJRG2VER.js";
22
22
  import "./chunk-KIOUKC3Z.js";
23
- import "./chunk-VAMTEAYI.js";
23
+ import "./chunk-TS5XFQ2D.js";
24
24
  import "./chunk-STYHKCG7.js";
25
25
  import "./chunk-BJYPTN5S.js";
26
26
  import "./chunk-NDJ6FKSP.js";
@@ -40,4 +40,4 @@ export {
40
40
  runChatTurn,
41
41
  runVerifierTurn
42
42
  };
43
- //# sourceMappingURL=orchestrator-KCHEENHK.js.map
43
+ //# sourceMappingURL=orchestrator-5BY2MH72.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "1.6.76",
3
+ "version": "1.6.78",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -5,12 +5,12 @@ import {
5
5
  generateSessionName,
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
- } from "./chunk-LCQ3MPXD.js";
8
+ } from "./chunk-2IZMUXMP.js";
9
9
  import {
10
10
  getEventStore
11
- } from "./chunk-5ZD3GZTK.js";
11
+ } from "./chunk-RJRG2VER.js";
12
12
  import "./chunk-KIOUKC3Z.js";
13
- import "./chunk-VAMTEAYI.js";
13
+ import "./chunk-TS5XFQ2D.js";
14
14
  import {
15
15
  createChatMessageMessage,
16
16
  createSessionRunningMessage
@@ -177,7 +177,7 @@ var QueueProcessor = class {
177
177
  backend: provider?.backend ?? llmClient.getBackend(),
178
178
  model: llmClient.getModel()
179
179
  };
180
- const { runChatTurn } = await import("./orchestrator-KCHEENHK.js");
180
+ const { runChatTurn } = await import("./orchestrator-5BY2MH72.js");
181
181
  const runChatTurnParams = buildRunChatTurnParams({
182
182
  sessionManager,
183
183
  sessionId,
@@ -214,4 +214,4 @@ var QueueProcessor = class {
214
214
  export {
215
215
  QueueProcessor
216
216
  };
217
- //# sourceMappingURL=processor-6TS37IYH.js.map
217
+ //# sourceMappingURL=processor-PV446N55.js.map
@@ -6,20 +6,20 @@ import {
6
6
  import {
7
7
  VERSION,
8
8
  createServer
9
- } from "./chunk-K2V7EW5F.js";
10
- import "./chunk-NHJ2GVCF.js";
11
- import "./chunk-H5EICXF3.js";
9
+ } from "./chunk-DKKDNJT7.js";
10
+ import "./chunk-NWXLRRDD.js";
11
+ import "./chunk-GLVNO4DS.js";
12
12
  import "./chunk-OXI26S7U.js";
13
13
  import "./chunk-CMQCO27Y.js";
14
- import "./chunk-XKIEDGQF.js";
14
+ import "./chunk-DL6ZILAF.js";
15
15
  import "./chunk-PBGOZMVY.js";
16
16
  import "./chunk-VRGRAQDG.js";
17
17
  import "./chunk-WR6QCJJO.js";
18
18
  import "./chunk-TGWEH2BC.js";
19
19
  import "./chunk-CUDAT6SS.js";
20
- import "./chunk-5ZD3GZTK.js";
20
+ import "./chunk-RJRG2VER.js";
21
21
  import "./chunk-KIOUKC3Z.js";
22
- import "./chunk-VAMTEAYI.js";
22
+ import "./chunk-TS5XFQ2D.js";
23
23
  import "./chunk-STYHKCG7.js";
24
24
  import "./chunk-BJYPTN5S.js";
25
25
  import "./chunk-RGRBWDZP.js";
@@ -190,4 +190,4 @@ async function runServe(options) {
190
190
  export {
191
191
  runServe
192
192
  };
193
- //# sourceMappingURL=serve-OLDABBV3.js.map
193
+ //# sourceMappingURL=serve-6ME66XOO.js.map
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  createServer,
3
3
  createServerHandle
4
- } from "../chunk-K2V7EW5F.js";
5
- import "../chunk-NHJ2GVCF.js";
6
- import "../chunk-H5EICXF3.js";
4
+ } from "../chunk-DKKDNJT7.js";
5
+ import "../chunk-NWXLRRDD.js";
6
+ import "../chunk-GLVNO4DS.js";
7
7
  import "../chunk-OXI26S7U.js";
8
8
  import "../chunk-CMQCO27Y.js";
9
- import "../chunk-XKIEDGQF.js";
9
+ import "../chunk-DL6ZILAF.js";
10
10
  import "../chunk-PBGOZMVY.js";
11
11
  import "../chunk-VRGRAQDG.js";
12
12
  import "../chunk-WR6QCJJO.js";
13
13
  import "../chunk-TGWEH2BC.js";
14
14
  import "../chunk-CUDAT6SS.js";
15
- import "../chunk-5ZD3GZTK.js";
15
+ import "../chunk-RJRG2VER.js";
16
16
  import "../chunk-KIOUKC3Z.js";
17
- import "../chunk-VAMTEAYI.js";
17
+ import "../chunk-TS5XFQ2D.js";
18
18
  import "../chunk-STYHKCG7.js";
19
19
  import "../chunk-BJYPTN5S.js";
20
20
  import "../chunk-RGRBWDZP.js";