openfox 1.6.4 → 1.6.6

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 (28) hide show
  1. package/dist/{auto-compaction-BRT6SDEP.js → auto-compaction-3RZRYJJU.js} +5 -5
  2. package/dist/{chat-handler-55LA4LI2.js → chat-handler-M5YTW4BH.js} +7 -7
  3. package/dist/{chunk-4HSEOMJV.js → chunk-3XEAHQIB.js} +23 -22
  4. package/dist/{chunk-EBOKO2PW.js → chunk-4DPU247N.js} +4 -4
  5. package/dist/{chunk-S73ATBSR.js → chunk-7H3O5YYX.js} +4 -4
  6. package/dist/{chunk-AJMU5EFR.js → chunk-DBDUBKRJ.js} +2 -2
  7. package/dist/{chunk-GBBTJ6ND.js → chunk-JAFNVZWY.js} +30 -7
  8. package/dist/{chunk-XQQ2BRJA.js → chunk-Y6HBEACI.js} +1 -1
  9. package/dist/{chunk-CIXMZ73F.js → chunk-ZRDRYL6W.js} +4 -3
  10. package/dist/cli/dev.js +1 -1
  11. package/dist/cli/index.js +1 -1
  12. package/dist/{events-OZKDX6XE.js → events-EILPWKYE.js} +2 -2
  13. package/dist/{orchestrator-IEYZSNVH.js → orchestrator-IEMRFHNX.js} +6 -6
  14. package/dist/package.json +1 -1
  15. package/dist/{processor-I4BGYK3T.js → processor-MSHA2CGY.js} +5 -5
  16. package/dist/{protocol-ODKD7QJO.js → protocol-EX726YIK.js} +3 -3
  17. package/dist/{protocol-vX_YbJXE.d.ts → protocol-I7rn7Msg.d.ts} +2 -0
  18. package/dist/{serve-OKXWQVUY.js → serve-PLWVGFNJ.js} +7 -7
  19. package/dist/server/index.d.ts +2 -2
  20. package/dist/server/index.js +6 -6
  21. package/dist/shared/index.d.ts +2 -2
  22. package/dist/shared/index.js +1 -1
  23. package/dist/{tools-GQ3PJL6N.js → tools-SEY5EQUM.js} +5 -5
  24. package/dist/web/assets/{index-UAOTZy0A.css → index-DOwkDgJu.css} +1 -1
  25. package/dist/web/assets/{index-CVXbXCkK.js → index-TAQh3Ryg.js} +58 -58
  26. package/dist/web/index.html +2 -2
  27. package/dist/web/sw.js +1 -1
  28. package/package.json +1 -1
@@ -2,18 +2,18 @@ import {
2
2
  maybeAutoCompactContext,
3
3
  performManualContextCompaction,
4
4
  resolveCompactionStatsIdentity
5
- } from "./chunk-GBBTJ6ND.js";
5
+ } from "./chunk-JAFNVZWY.js";
6
6
  import "./chunk-NBU6KIOD.js";
7
7
  import "./chunk-574HZVLE.js";
8
8
  import "./chunk-XFXOSPYH.js";
9
- import "./chunk-CIXMZ73F.js";
9
+ import "./chunk-ZRDRYL6W.js";
10
10
  import "./chunk-WQ4W5H6A.js";
11
- import "./chunk-EBOKO2PW.js";
11
+ import "./chunk-4DPU247N.js";
12
12
  import "./chunk-22CTURMH.js";
13
13
  import "./chunk-7IOZFJBW.js";
14
14
  import "./chunk-XKFPU2FA.js";
15
15
  import "./chunk-3EHGGBWE.js";
16
- import "./chunk-XQQ2BRJA.js";
16
+ import "./chunk-Y6HBEACI.js";
17
17
  import "./chunk-R4HADRYO.js";
18
18
  import "./chunk-TVQOONDR.js";
19
19
  import "./chunk-PNBH3RAX.js";
@@ -22,4 +22,4 @@ export {
22
22
  performManualContextCompaction,
23
23
  resolveCompactionStatsIdentity
24
24
  };
25
- //# sourceMappingURL=auto-compaction-BRT6SDEP.js.map
25
+ //# sourceMappingURL=auto-compaction-3RZRYJJU.js.map
@@ -4,15 +4,15 @@ import {
4
4
  } from "./chunk-QDEKU5RL.js";
5
5
  import {
6
6
  runChatTurn
7
- } from "./chunk-S73ATBSR.js";
8
- import "./chunk-GBBTJ6ND.js";
7
+ } from "./chunk-7H3O5YYX.js";
8
+ import "./chunk-JAFNVZWY.js";
9
9
  import "./chunk-NBU6KIOD.js";
10
10
  import "./chunk-574HZVLE.js";
11
11
  import "./chunk-XFXOSPYH.js";
12
12
  import {
13
13
  getEventStore,
14
14
  updateSessionMetadata
15
- } from "./chunk-CIXMZ73F.js";
15
+ } from "./chunk-ZRDRYL6W.js";
16
16
  import {
17
17
  buildMessagesFromStoredEvents,
18
18
  foldPendingConfirmations
@@ -23,12 +23,12 @@ import {
23
23
  createPhaseChangedMessage,
24
24
  createSessionRunningMessage,
25
25
  createSessionStateMessage
26
- } from "./chunk-EBOKO2PW.js";
26
+ } from "./chunk-4DPU247N.js";
27
27
  import "./chunk-22CTURMH.js";
28
28
  import "./chunk-7IOZFJBW.js";
29
29
  import "./chunk-XKFPU2FA.js";
30
30
  import "./chunk-3EHGGBWE.js";
31
- import "./chunk-XQQ2BRJA.js";
31
+ import "./chunk-Y6HBEACI.js";
32
32
  import "./chunk-R4HADRYO.js";
33
33
  import "./chunk-TVQOONDR.js";
34
34
  import {
@@ -61,7 +61,7 @@ async function startChatSession(sessionId, content, deps, options) {
61
61
  sessionManager.setRunning(sessionId, true);
62
62
  broadcastForSession(sessionId, createSessionRunningMessage(true));
63
63
  try {
64
- const { maybeAutoCompactContext } = await import("./auto-compaction-BRT6SDEP.js");
64
+ const { maybeAutoCompactContext } = await import("./auto-compaction-3RZRYJJU.js");
65
65
  await maybeAutoCompactContext({
66
66
  sessionManager,
67
67
  sessionId,
@@ -200,4 +200,4 @@ export {
200
200
  startChatSession,
201
201
  stopSessionExecution
202
202
  };
203
- //# sourceMappingURL=chat-handler-55LA4LI2.js.map
203
+ //# sourceMappingURL=chat-handler-M5YTW4BH.js.map
@@ -6,7 +6,7 @@ import {
6
6
  createVerifierNudgeConfig,
7
7
  runBuilderTurn,
8
8
  runChatTurn
9
- } from "./chunk-S73ATBSR.js";
9
+ } from "./chunk-7H3O5YYX.js";
10
10
  import {
11
11
  TurnMetrics,
12
12
  agentExists,
@@ -44,7 +44,7 @@ import {
44
44
  saveSkill,
45
45
  setSkillEnabled,
46
46
  skillExists
47
- } from "./chunk-GBBTJ6ND.js";
47
+ } from "./chunk-JAFNVZWY.js";
48
48
  import {
49
49
  getPathSeparator,
50
50
  getPlatformShell,
@@ -89,7 +89,7 @@ import {
89
89
  updateSessionProvider,
90
90
  updateSessionRunning,
91
91
  updateSessionSummary
92
- } from "./chunk-CIXMZ73F.js";
92
+ } from "./chunk-ZRDRYL6W.js";
93
93
  import {
94
94
  buildContextMessagesFromEventHistory,
95
95
  buildMessagesFromStoredEvents,
@@ -110,7 +110,7 @@ import {
110
110
  parseClientMessage,
111
111
  serializeServerMessage,
112
112
  storedEventToServerMessage
113
- } from "./chunk-EBOKO2PW.js";
113
+ } from "./chunk-4DPU247N.js";
114
114
  import {
115
115
  EventEmitter,
116
116
  cancelQuestionsForSession,
@@ -127,7 +127,7 @@ import {
127
127
  } from "./chunk-QY7BMXWT.js";
128
128
  import {
129
129
  createServerMessage
130
- } from "./chunk-XQQ2BRJA.js";
130
+ } from "./chunk-Y6HBEACI.js";
131
131
  import {
132
132
  getGlobalConfigDir
133
133
  } from "./chunk-R4HADRYO.js";
@@ -4545,7 +4545,7 @@ ${summary}`, {
4545
4545
  * Emits a context.state event with the real promptTokens from the LLM.
4546
4546
  * maxTokens comes from providerManager.getCurrentModelContext() - the currently selected model's limit.
4547
4547
  */
4548
- setCurrentContextSize(sessionId, promptTokens) {
4548
+ setCurrentContextSize(sessionId, promptTokens, subAgentId) {
4549
4549
  const state = getSessionState(sessionId, this.providerManager.getCurrentModelContext());
4550
4550
  const maxTokens = this.providerManager.getCurrentModelContext();
4551
4551
  const compactionCount = state?.contextState.compactionCount ?? 0;
@@ -4555,9 +4555,10 @@ ${summary}`, {
4555
4555
  maxTokens,
4556
4556
  compactionCount,
4557
4557
  isInDangerZone(promptTokens, maxTokens),
4558
- canCompact(promptTokens, maxTokens)
4558
+ canCompact(promptTokens, maxTokens),
4559
+ subAgentId
4559
4560
  );
4560
- logger.debug("Context state updated", { sessionId, promptTokens, maxTokens });
4561
+ logger.debug("Context state updated", { sessionId, promptTokens, maxTokens, subAgentId });
4561
4562
  }
4562
4563
  // ============================================================================
4563
4564
  // Criteria Operations (delegates to EventStore)
@@ -5543,7 +5544,7 @@ function createTerminalRoutes() {
5543
5544
  }
5544
5545
 
5545
5546
  // src/constants.ts
5546
- var VERSION = "1.6.4";
5547
+ var VERSION = "1.6.6";
5547
5548
 
5548
5549
  // src/server/index.ts
5549
5550
  var __dirname2 = dirname5(fileURLToPath4(import.meta.url));
@@ -5708,7 +5709,7 @@ async function createServerHandle(config) {
5708
5709
  res.json({ success: true });
5709
5710
  });
5710
5711
  app.get("/api/sessions", async (req, res) => {
5711
- const { getRecentUserPromptsForSession } = await import("./events-OZKDX6XE.js");
5712
+ const { getRecentUserPromptsForSession } = await import("./events-EILPWKYE.js");
5712
5713
  const projectId = req.query["projectId"];
5713
5714
  const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
5714
5715
  const offset = parseInt(req.query["offset"]) || 0;
@@ -5741,7 +5742,7 @@ async function createServerHandle(config) {
5741
5742
  res.status(201).json({ session });
5742
5743
  });
5743
5744
  app.get("/api/sessions/:id", async (req, res) => {
5744
- const { getEventStore: getEventStore2 } = await import("./events-OZKDX6XE.js");
5745
+ const { getEventStore: getEventStore2 } = await import("./events-EILPWKYE.js");
5745
5746
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-NZYOXNKK.js");
5746
5747
  const session = sessionManager.getSession(req.params.id);
5747
5748
  if (!session) {
@@ -5772,7 +5773,7 @@ async function createServerHandle(config) {
5772
5773
  res.json({ success: true });
5773
5774
  });
5774
5775
  app.post("/api/sessions/:id/provider", async (req, res) => {
5775
- const { getEventStore: getEventStore2 } = await import("./events-OZKDX6XE.js");
5776
+ const { getEventStore: getEventStore2 } = await import("./events-EILPWKYE.js");
5776
5777
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-NZYOXNKK.js");
5777
5778
  const sessionId = req.params.id;
5778
5779
  const session = sessionManager.getSession(sessionId);
@@ -5810,7 +5811,7 @@ async function createServerHandle(config) {
5810
5811
  res.json({ success: true });
5811
5812
  });
5812
5813
  app.put("/api/sessions/:id/mode", async (req, res) => {
5813
- const { getEventStore: getEventStore2 } = await import("./events-OZKDX6XE.js");
5814
+ const { getEventStore: getEventStore2 } = await import("./events-EILPWKYE.js");
5814
5815
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-NZYOXNKK.js");
5815
5816
  const sessionId = req.params.id;
5816
5817
  const session = sessionManager.getSession(sessionId);
@@ -5849,14 +5850,14 @@ async function createServerHandle(config) {
5849
5850
  if (!callId || approved === void 0) {
5850
5851
  return res.status(400).json({ error: "callId and approved are required" });
5851
5852
  }
5852
- const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-GQ3PJL6N.js");
5853
+ const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-SEY5EQUM.js");
5853
5854
  const result = providePathConfirmation2(callId, approved, alwaysAllow);
5854
5855
  if (!result.found) {
5855
5856
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
5856
5857
  }
5857
- const { getEventStore: getEventStore2 } = await import("./events-OZKDX6XE.js");
5858
+ const { getEventStore: getEventStore2 } = await import("./events-EILPWKYE.js");
5858
5859
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-NZYOXNKK.js");
5859
- const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-ODKD7QJO.js");
5860
+ const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-EX726YIK.js");
5860
5861
  const eventStore = getEventStore2();
5861
5862
  const events = eventStore.getEvents(sessionId);
5862
5863
  const messages = buildMessagesFromStoredEvents2(events);
@@ -5874,7 +5875,7 @@ async function createServerHandle(config) {
5874
5875
  if (!callId || !answer) {
5875
5876
  return res.status(400).json({ error: "callId and answer are required" });
5876
5877
  }
5877
- const { provideAnswer: provideAnswer2 } = await import("./tools-GQ3PJL6N.js");
5878
+ const { provideAnswer: provideAnswer2 } = await import("./tools-SEY5EQUM.js");
5878
5879
  const found = provideAnswer2(callId, answer);
5879
5880
  if (!found) {
5880
5881
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -5910,14 +5911,14 @@ async function createServerHandle(config) {
5910
5911
  if (!session) {
5911
5912
  return res.status(404).json({ error: "Session not found" });
5912
5913
  }
5913
- const { stopSessionExecution } = await import("./chat-handler-55LA4LI2.js");
5914
- const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-GQ3PJL6N.js");
5914
+ const { stopSessionExecution } = await import("./chat-handler-M5YTW4BH.js");
5915
+ const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-SEY5EQUM.js");
5915
5916
  stopSessionExecution(sessionId, sessionManager);
5916
5917
  abortSession(sessionId);
5917
5918
  cancelQuestionsForSession2(sessionId, "Session stopped by user");
5918
5919
  cancelPathConfirmationsForSession2(sessionId, "Session stopped by user");
5919
5920
  sessionManager.clearMessageQueue(sessionId);
5920
- const eventStore = (await import("./events-OZKDX6XE.js")).getEventStore();
5921
+ const eventStore = (await import("./events-EILPWKYE.js")).getEventStore();
5921
5922
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
5922
5923
  res.json({ success: true });
5923
5924
  });
@@ -6359,7 +6360,7 @@ async function createServerHandle(config) {
6359
6360
  providerManager
6360
6361
  );
6361
6362
  const wss = wssExports.wss;
6362
- const { QueueProcessor } = await import("./processor-I4BGYK3T.js");
6363
+ const { QueueProcessor } = await import("./processor-MSHA2CGY.js");
6363
6364
  const queueProcessor = new QueueProcessor({
6364
6365
  sessionManager,
6365
6366
  providerManager,
@@ -6432,4 +6433,4 @@ export {
6432
6433
  createServerHandle,
6433
6434
  createServer
6434
6435
  };
6435
- //# sourceMappingURL=chunk-4HSEOMJV.js.map
6436
+ //# sourceMappingURL=chunk-3XEAHQIB.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createServerMessage,
3
3
  isClientMessage
4
- } from "./chunk-XQQ2BRJA.js";
4
+ } from "./chunk-Y6HBEACI.js";
5
5
 
6
6
  // src/server/ws/protocol.ts
7
7
  function enrichMessagesWithToolResults(messages) {
@@ -95,8 +95,8 @@ function createChatMessageMessage(message) {
95
95
  function createChatMessageUpdatedMessage(messageId, updates) {
96
96
  return createServerMessage("chat.message_updated", { messageId, updates });
97
97
  }
98
- function createChatDoneMessage(messageId, reason, stats) {
99
- return createServerMessage("chat.done", { messageId, reason, ...stats ? { stats } : {} });
98
+ function createChatDoneMessage(messageId, reason, stats, agentType) {
99
+ return createServerMessage("chat.done", { messageId, reason, ...stats ? { stats } : {}, ...agentType ? { agentType } : {} });
100
100
  }
101
101
  function createChatErrorMessage(error, recoverable) {
102
102
  return createServerMessage("chat.error", { error, recoverable });
@@ -340,4 +340,4 @@ export {
340
340
  isQueueCancelPayload,
341
341
  storedEventToServerMessage
342
342
  };
343
- //# sourceMappingURL=chunk-EBOKO2PW.js.map
343
+ //# sourceMappingURL=chunk-4DPU247N.js.map
@@ -13,17 +13,17 @@ import {
13
13
  getToolRegistryForAgent,
14
14
  loadAllAgentsDefault,
15
15
  runTopLevelAgentLoop
16
- } from "./chunk-GBBTJ6ND.js";
16
+ } from "./chunk-JAFNVZWY.js";
17
17
  import {
18
18
  getCurrentContextWindowId,
19
19
  getEventStore
20
- } from "./chunk-CIXMZ73F.js";
20
+ } from "./chunk-ZRDRYL6W.js";
21
21
  import {
22
22
  buildSnapshotFromSessionState
23
23
  } from "./chunk-WQ4W5H6A.js";
24
24
  import {
25
25
  createChatMessageMessage
26
- } from "./chunk-EBOKO2PW.js";
26
+ } from "./chunk-4DPU247N.js";
27
27
  import {
28
28
  logger
29
29
  } from "./chunk-PNBH3RAX.js";
@@ -311,4 +311,4 @@ export {
311
311
  runBuilderTurn,
312
312
  runVerifierTurn
313
313
  };
314
- //# sourceMappingURL=chunk-S73ATBSR.js.map
314
+ //# sourceMappingURL=chunk-7H3O5YYX.js.map
@@ -154,7 +154,7 @@ async function runCli(options) {
154
154
  if (!configExists) {
155
155
  await runNetworkSetup(mode);
156
156
  }
157
- const { runServe } = await import("./serve-OKXWQVUY.js");
157
+ const { runServe } = await import("./serve-PLWVGFNJ.js");
158
158
  await runServe({
159
159
  mode,
160
160
  port: values.port ? parseInt(values.port) : void 0,
@@ -167,4 +167,4 @@ async function runCli(options) {
167
167
  export {
168
168
  runCli
169
169
  };
170
- //# sourceMappingURL=chunk-AJMU5EFR.js.map
170
+ //# sourceMappingURL=chunk-DBDUBKRJ.js.map
@@ -18,14 +18,16 @@ import {
18
18
  getContextMessages,
19
19
  getCurrentContextWindowId,
20
20
  getEventStore
21
- } from "./chunk-CIXMZ73F.js";
21
+ } from "./chunk-ZRDRYL6W.js";
22
22
  import {
23
+ createChatDoneMessage,
23
24
  createChatMessageMessage,
25
+ createChatMessageUpdatedMessage,
24
26
  createChatPathConfirmationMessage,
25
27
  createChatToolOutputMessage,
26
28
  createChatVisionFallbackMessage,
27
29
  createQueueStateMessage
28
- } from "./chunk-EBOKO2PW.js";
30
+ } from "./chunk-4DPU247N.js";
29
31
  import {
30
32
  AskUserInterrupt,
31
33
  askUserTool
@@ -3401,6 +3403,13 @@ async function executeSubAgent(options) {
3401
3403
  if (signal?.aborted) {
3402
3404
  throw new Error("Aborted");
3403
3405
  }
3406
+ await maybeAutoCompactContext({
3407
+ sessionManager,
3408
+ sessionId,
3409
+ llmClient,
3410
+ statsIdentity: resolveCompactionStatsIdentity(llmClient),
3411
+ ...signal ? { signal } : {}
3412
+ });
3404
3413
  const assistantMsgId = crypto.randomUUID();
3405
3414
  eventStore.append(sessionId, createMessageStartEvent(assistantMsgId, "assistant", void 0, {
3406
3415
  ...currentWindowMessageOptions ?? {},
@@ -3444,6 +3453,7 @@ async function executeSubAgent(options) {
3444
3453
  throw new Error("Aborted");
3445
3454
  }
3446
3455
  turnMetrics.addLLMCall(result.timing, result.usage.promptTokens, result.usage.completionTokens);
3456
+ sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens, subAgentId);
3447
3457
  finalContent = result.content;
3448
3458
  customMessages.push({
3449
3459
  role: "assistant",
@@ -3528,9 +3538,22 @@ async function executeSubAgent(options) {
3528
3538
  });
3529
3539
  if (batchResult.returnValueContent) {
3530
3540
  returnValueContent = batchResult.returnValueContent;
3531
- }
3532
- if (batchResult.returnValueResult) {
3533
3541
  returnValueResult = batchResult.returnValueResult;
3542
+ customMessages = [...customMessages, ...batchResult.toolMessages];
3543
+ const stats = turnMetrics.buildStats(statsIdentity, subAgentType);
3544
+ eventStore.append(sessionId, createMessageDoneEvent(assistantMsgId, {
3545
+ segments: result.segments,
3546
+ stats,
3547
+ promptContext
3548
+ }));
3549
+ if (onMessage) {
3550
+ onMessage(createChatMessageUpdatedMessage(assistantMsgId, { isStreaming: false, stats, promptContext }));
3551
+ }
3552
+ eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "complete", stats));
3553
+ if (onMessage) {
3554
+ onMessage(createChatDoneMessage(assistantMsgId, "complete", stats, "sub-agent"));
3555
+ }
3556
+ break;
3534
3557
  }
3535
3558
  customMessages = [...customMessages, ...batchResult.toolMessages];
3536
3559
  session = sessionManager.requireSession(sessionId);
@@ -3625,7 +3648,7 @@ var callSubAgentTool = {
3625
3648
  };
3626
3649
  }
3627
3650
  try {
3628
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-GQ3PJL6N.js");
3651
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-SEY5EQUM.js");
3629
3652
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3630
3653
  const turnMetrics = new TurnMetrics();
3631
3654
  const result = await executeSubAgent({
@@ -4693,7 +4716,7 @@ ${COMPACTION_PROMPT}
4693
4716
  function resolveCompactionStatsIdentity(llmClient, getActiveProvider) {
4694
4717
  const provider = getActiveProvider?.();
4695
4718
  const model = llmClient.getModel();
4696
- const backend = provider?.backend ?? (llmClient.getBackend() === "unknown" ? "unknown" : llmClient.getBackend());
4719
+ const backend = llmClient.getBackend?.() ?? "unknown";
4697
4720
  return {
4698
4721
  providerId: provider?.id ?? `provider:${model}`,
4699
4722
  providerName: provider?.name ?? "Unknown Provider",
@@ -4758,4 +4781,4 @@ export {
4758
4781
  getToolRegistryForAgent,
4759
4782
  createToolRegistry
4760
4783
  };
4761
- //# sourceMappingURL=chunk-GBBTJ6ND.js.map
4784
+ //# sourceMappingURL=chunk-JAFNVZWY.js.map
@@ -26,4 +26,4 @@ export {
26
26
  isClientMessage,
27
27
  isServerMessage
28
28
  };
29
- //# sourceMappingURL=chunk-XQQ2BRJA.js.map
29
+ //# sourceMappingURL=chunk-Y6HBEACI.js.map
@@ -970,7 +970,7 @@ function emitContextCompacted(sessionId, closedWindowId, newWindowId, beforeToke
970
970
  }
971
971
  });
972
972
  }
973
- function emitContextState(sessionId, currentTokens, maxTokens, compactionCount, dangerZone, canCompact) {
973
+ function emitContextState(sessionId, currentTokens, maxTokens, compactionCount, dangerZone, canCompact, subAgentId) {
974
974
  const eventStore = getEventStore();
975
975
  eventStore.append(sessionId, {
976
976
  type: "context.state",
@@ -979,7 +979,8 @@ function emitContextState(sessionId, currentTokens, maxTokens, compactionCount,
979
979
  maxTokens,
980
980
  compactionCount,
981
981
  dangerZone,
982
- canCompact
982
+ canCompact,
983
+ ...subAgentId !== void 0 && { subAgentId }
983
984
  }
984
985
  });
985
986
  }
@@ -1143,4 +1144,4 @@ export {
1143
1144
  compactContext,
1144
1145
  getRecentUserPromptsForSession
1145
1146
  };
1146
- //# sourceMappingURL=chunk-CIXMZ73F.js.map
1147
+ //# sourceMappingURL=chunk-ZRDRYL6W.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-AJMU5EFR.js";
4
+ } from "../chunk-DBDUBKRJ.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-PNBH3RAX.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-AJMU5EFR.js";
4
+ } from "../chunk-DBDUBKRJ.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-PNBH3RAX.js";
@@ -36,7 +36,7 @@ import {
36
36
  isFileInCache,
37
37
  isStoredEvent,
38
38
  isTurnEvent
39
- } from "./chunk-CIXMZ73F.js";
39
+ } from "./chunk-ZRDRYL6W.js";
40
40
  import {
41
41
  buildContextMessagesFromEventHistory,
42
42
  buildContextMessagesFromMessages,
@@ -111,4 +111,4 @@ export {
111
111
  isStoredEvent,
112
112
  isTurnEvent
113
113
  };
114
- //# sourceMappingURL=events-OZKDX6XE.js.map
114
+ //# sourceMappingURL=events-EILPWKYE.js.map
@@ -3,7 +3,7 @@ import {
3
3
  runBuilderTurn,
4
4
  runChatTurn,
5
5
  runVerifierTurn
6
- } from "./chunk-S73ATBSR.js";
6
+ } from "./chunk-7H3O5YYX.js";
7
7
  import {
8
8
  TurnMetrics,
9
9
  createChatDoneEvent,
@@ -11,18 +11,18 @@ import {
11
11
  createMessageStartEvent,
12
12
  createToolCallEvent,
13
13
  createToolResultEvent
14
- } from "./chunk-GBBTJ6ND.js";
14
+ } from "./chunk-JAFNVZWY.js";
15
15
  import "./chunk-NBU6KIOD.js";
16
16
  import "./chunk-574HZVLE.js";
17
17
  import "./chunk-XFXOSPYH.js";
18
- import "./chunk-CIXMZ73F.js";
18
+ import "./chunk-ZRDRYL6W.js";
19
19
  import "./chunk-WQ4W5H6A.js";
20
- import "./chunk-EBOKO2PW.js";
20
+ import "./chunk-4DPU247N.js";
21
21
  import "./chunk-22CTURMH.js";
22
22
  import "./chunk-7IOZFJBW.js";
23
23
  import "./chunk-XKFPU2FA.js";
24
24
  import "./chunk-3EHGGBWE.js";
25
- import "./chunk-XQQ2BRJA.js";
25
+ import "./chunk-Y6HBEACI.js";
26
26
  import "./chunk-R4HADRYO.js";
27
27
  import "./chunk-TVQOONDR.js";
28
28
  import "./chunk-PNBH3RAX.js";
@@ -38,4 +38,4 @@ export {
38
38
  runChatTurn,
39
39
  runVerifierTurn
40
40
  };
41
- //# sourceMappingURL=orchestrator-IEYZSNVH.js.map
41
+ //# sourceMappingURL=orchestrator-IEMRFHNX.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "1.6.4",
3
+ "version": "1.6.6",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  getEventStore,
7
7
  updateSessionMetadata
8
- } from "./chunk-CIXMZ73F.js";
8
+ } from "./chunk-ZRDRYL6W.js";
9
9
  import {
10
10
  buildMessagesFromStoredEvents,
11
11
  foldPendingConfirmations
@@ -15,9 +15,9 @@ import {
15
15
  createContextStateMessage,
16
16
  createSessionRunningMessage,
17
17
  createSessionStateMessage
18
- } from "./chunk-EBOKO2PW.js";
18
+ } from "./chunk-4DPU247N.js";
19
19
  import "./chunk-3EHGGBWE.js";
20
- import "./chunk-XQQ2BRJA.js";
20
+ import "./chunk-Y6HBEACI.js";
21
21
  import "./chunk-TVQOONDR.js";
22
22
  import {
23
23
  logger
@@ -188,7 +188,7 @@ var QueueProcessor = class {
188
188
  backend: provider?.backend ?? llmClient.getBackend(),
189
189
  model: llmClient.getModel()
190
190
  };
191
- const { runChatTurn } = await import("./orchestrator-IEYZSNVH.js");
191
+ const { runChatTurn } = await import("./orchestrator-IEMRFHNX.js");
192
192
  runChatTurn({
193
193
  sessionManager,
194
194
  sessionId,
@@ -233,4 +233,4 @@ var QueueProcessor = class {
233
233
  export {
234
234
  QueueProcessor
235
235
  };
236
- //# sourceMappingURL=processor-I4BGYK3T.js.map
236
+ //# sourceMappingURL=processor-MSHA2CGY.js.map
@@ -40,8 +40,8 @@ import {
40
40
  parseClientMessage,
41
41
  serializeServerMessage,
42
42
  storedEventToServerMessage
43
- } from "./chunk-EBOKO2PW.js";
44
- import "./chunk-XQQ2BRJA.js";
43
+ } from "./chunk-4DPU247N.js";
44
+ import "./chunk-Y6HBEACI.js";
45
45
  export {
46
46
  createChatAskUserMessage,
47
47
  createChatDeltaMessage,
@@ -85,4 +85,4 @@ export {
85
85
  serializeServerMessage,
86
86
  storedEventToServerMessage
87
87
  };
88
- //# sourceMappingURL=protocol-ODKD7QJO.js.map
88
+ //# sourceMappingURL=protocol-EX726YIK.js.map
@@ -610,6 +610,7 @@ interface ChatMessageUpdatedPayload {
610
610
  interface ChatDonePayload {
611
611
  messageId: string;
612
612
  reason: 'complete' | 'stopped' | 'error' | 'waiting_for_user';
613
+ agentType?: 'sub-agent';
613
614
  stats?: {
614
615
  model: string;
615
616
  mode: ToolMode;
@@ -674,6 +675,7 @@ interface CriteriaUpdatedPayload {
674
675
  }
675
676
  interface ContextStatePayload {
676
677
  context: ContextState;
678
+ subAgentId?: string;
677
679
  }
678
680
  interface ProviderChangedPayload {
679
681
  providerId: string;
@@ -6,24 +6,24 @@ import {
6
6
  import {
7
7
  VERSION,
8
8
  createServer
9
- } from "./chunk-4HSEOMJV.js";
9
+ } from "./chunk-3XEAHQIB.js";
10
10
  import "./chunk-QDEKU5RL.js";
11
- import "./chunk-S73ATBSR.js";
12
- import "./chunk-GBBTJ6ND.js";
11
+ import "./chunk-7H3O5YYX.js";
12
+ import "./chunk-JAFNVZWY.js";
13
13
  import "./chunk-NBU6KIOD.js";
14
14
  import "./chunk-574HZVLE.js";
15
15
  import "./chunk-AE5GO5GZ.js";
16
16
  import "./chunk-XCJPBJCE.js";
17
17
  import "./chunk-XFXOSPYH.js";
18
- import "./chunk-CIXMZ73F.js";
18
+ import "./chunk-ZRDRYL6W.js";
19
19
  import "./chunk-WQ4W5H6A.js";
20
- import "./chunk-EBOKO2PW.js";
20
+ import "./chunk-4DPU247N.js";
21
21
  import "./chunk-22CTURMH.js";
22
22
  import "./chunk-7IOZFJBW.js";
23
23
  import "./chunk-XKFPU2FA.js";
24
24
  import "./chunk-3EHGGBWE.js";
25
25
  import "./chunk-QY7BMXWT.js";
26
- import "./chunk-XQQ2BRJA.js";
26
+ import "./chunk-Y6HBEACI.js";
27
27
  import {
28
28
  ensureDataDirExists,
29
29
  getDatabasePath,
@@ -188,4 +188,4 @@ async function runServe(options) {
188
188
  export {
189
189
  runServe
190
190
  };
191
- //# sourceMappingURL=serve-OKXWQVUY.js.map
191
+ //# sourceMappingURL=serve-PLWVGFNJ.js.map
@@ -1,4 +1,4 @@
1
- import { aT as ToolCall, c as Attachment, V as Diagnostic, ap as Provider, aa as ModelConfig, aF as Session, aO as SessionSummary, ah as Project, aJ as SessionMode, aL as SessionPhase, M as Message, N as Criterion, P as CriterionStatus, aB as QueuedMessage, H as ContextState, R as DangerLevel$1, aD as ServerMessage, aQ as StatsIdentity, aW as ToolResult, F as Config } from '../protocol-vX_YbJXE.js';
1
+ import { aT as ToolCall, c as Attachment, V as Diagnostic, ap as Provider, aa as ModelConfig, aF as Session, aO as SessionSummary, ah as Project, aJ as SessionMode, aL as SessionPhase, M as Message, N as Criterion, P as CriterionStatus, aB as QueuedMessage, H as ContextState, R as DangerLevel$1, aD as ServerMessage, aQ as StatsIdentity, aW as ToolResult, F as Config } from '../protocol-I7rn7Msg.js';
2
2
  import { Server } from 'node:http';
3
3
 
4
4
  interface LLMMessage {
@@ -359,7 +359,7 @@ declare class SessionManager {
359
359
  * Emits a context.state event with the real promptTokens from the LLM.
360
360
  * maxTokens comes from providerManager.getCurrentModelContext() - the currently selected model's limit.
361
361
  */
362
- setCurrentContextSize(sessionId: string, promptTokens: number): void;
362
+ setCurrentContextSize(sessionId: string, promptTokens: number, subAgentId?: string): void;
363
363
  /**
364
364
  * Set criteria. Delegates to EventStore.
365
365
  */