openfox 2.0.0-beta.3 → 2.0.0-beta.5

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 (33) hide show
  1. package/dist/{auto-compaction-UIWTO3H5.js → auto-compaction-2ZAYDXGF.js} +6 -6
  2. package/dist/{chat-handler-IVIWOR3D.js → chat-handler-BM6EBFKS.js} +9 -9
  3. package/dist/{chunk-YUIMJBSE.js → chunk-CLGRPDZT.js} +26 -28
  4. package/dist/{chunk-ALH4KM2Y.js → chunk-DFWGWULB.js} +23 -135
  5. package/dist/{chunk-UK6XF2OX.js → chunk-I67T2E5K.js} +2 -2
  6. package/dist/{chunk-QFSSKIQ3.js → chunk-OBD6D5ZO.js} +4 -4
  7. package/dist/{chunk-FQLK5GL5.js → chunk-T4HV6GS5.js} +1 -1
  8. package/dist/{chunk-XKR3HCAL.js → chunk-UH27FDT7.js} +6 -24
  9. package/dist/{chunk-CEZNMLOO.js → chunk-V6DYJV5R.js} +2 -5
  10. package/dist/{chunk-UFY4I643.js → chunk-X36JIWSF.js} +4 -4
  11. package/dist/{chunk-NONI4CRP.js → chunk-XL7SW5B4.js} +1 -29
  12. package/dist/cli/dev.js +1 -1
  13. package/dist/cli/index.js +1 -1
  14. package/dist/{events-OHJWCI3S.js → events-T37KTNCX.js} +3 -3
  15. package/dist/{folding-U6UHQAS5.js → folding-IIKWAGG2.js} +2 -2
  16. package/dist/{orchestrator-7ZXM4J22.js → orchestrator-JTUHXF7C.js} +7 -7
  17. package/dist/package.json +1 -1
  18. package/dist/{processor-TKBJLQ2N.js → processor-66YBBQ6B.js} +7 -7
  19. package/dist/{protocol-K62EPEGS.js → protocol-ALBHLBBF.js} +3 -3
  20. package/dist/{protocol-BQ12Aw5J.d.ts → protocol-CiYlonA5.d.ts} +2 -38
  21. package/dist/{serve-7CUQCZC7.js → serve-EUEQ6ERI.js} +8 -8
  22. package/dist/server/index.d.ts +1 -1
  23. package/dist/server/index.js +7 -7
  24. package/dist/shared/index.d.ts +2 -2
  25. package/dist/shared/index.js +1 -1
  26. package/dist/{tools-Z7X4HXZN.js → tools-56LACLKH.js} +6 -6
  27. package/dist/web/assets/{index-BY8EbT5Z.css → index-C5gaXnFj.css} +2 -2
  28. package/dist/web/assets/index-DQ2Vv-Yl.js +317 -0
  29. package/dist/web/index.html +2 -2
  30. package/dist/web/sw.js +1 -1
  31. package/package.json +1 -1
  32. package/dist/web/assets/index-CrYTogyB.js +0 -299
  33. /package/dist/web/{workbox-8c29f6e4.js → workbox-7fc22fbe.js} +0 -0
@@ -2,19 +2,19 @@ import {
2
2
  maybeAutoCompactContext,
3
3
  performManualContextCompaction,
4
4
  resolveCompactionStatsIdentity
5
- } from "./chunk-ALH4KM2Y.js";
5
+ } from "./chunk-DFWGWULB.js";
6
6
  import "./chunk-PSJIT5LZ.js";
7
7
  import "./chunk-XAMAYRDA.js";
8
8
  import "./chunk-DL6ZILAF.js";
9
9
  import "./chunk-PBGOZMVY.js";
10
10
  import "./chunk-VRGRAQDG.js";
11
11
  import "./chunk-HGAMIPFO.js";
12
- import "./chunk-XKR3HCAL.js";
12
+ import "./chunk-UH27FDT7.js";
13
13
  import "./chunk-FBGWG4N6.js";
14
- import "./chunk-NONI4CRP.js";
15
- import "./chunk-CEZNMLOO.js";
14
+ import "./chunk-XL7SW5B4.js";
15
+ import "./chunk-V6DYJV5R.js";
16
16
  import "./chunk-BJYPTN5S.js";
17
- import "./chunk-FQLK5GL5.js";
17
+ import "./chunk-T4HV6GS5.js";
18
18
  import "./chunk-CQGTEGKL.js";
19
19
  import "./chunk-CGZHLM3K.js";
20
20
  import "./chunk-SZKEGZIB.js";
@@ -24,4 +24,4 @@ export {
24
24
  performManualContextCompaction,
25
25
  resolveCompactionStatsIdentity
26
26
  };
27
- //# sourceMappingURL=auto-compaction-UIWTO3H5.js.map
27
+ //# sourceMappingURL=auto-compaction-2ZAYDXGF.js.map
@@ -5,11 +5,11 @@ import {
5
5
  generateSessionName,
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
- } from "./chunk-QFSSKIQ3.js";
8
+ } from "./chunk-OBD6D5ZO.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-UFY4I643.js";
12
- import "./chunk-ALH4KM2Y.js";
11
+ } from "./chunk-X36JIWSF.js";
12
+ import "./chunk-DFWGWULB.js";
13
13
  import "./chunk-PSJIT5LZ.js";
14
14
  import "./chunk-XAMAYRDA.js";
15
15
  import "./chunk-DL6ZILAF.js";
@@ -18,16 +18,16 @@ import "./chunk-VRGRAQDG.js";
18
18
  import "./chunk-HGAMIPFO.js";
19
19
  import {
20
20
  getEventStore
21
- } from "./chunk-XKR3HCAL.js";
21
+ } from "./chunk-UH27FDT7.js";
22
22
  import "./chunk-FBGWG4N6.js";
23
- import "./chunk-NONI4CRP.js";
23
+ import "./chunk-XL7SW5B4.js";
24
24
  import {
25
25
  createChatMessageMessage,
26
26
  createPhaseChangedMessage,
27
27
  createSessionRunningMessage
28
- } from "./chunk-CEZNMLOO.js";
28
+ } from "./chunk-V6DYJV5R.js";
29
29
  import "./chunk-BJYPTN5S.js";
30
- import "./chunk-FQLK5GL5.js";
30
+ import "./chunk-T4HV6GS5.js";
31
31
  import "./chunk-CQGTEGKL.js";
32
32
  import "./chunk-CGZHLM3K.js";
33
33
  import "./chunk-SZKEGZIB.js";
@@ -60,7 +60,7 @@ async function startChatSession(sessionId, content, deps, options) {
60
60
  sessionManager.setRunning(sessionId, true);
61
61
  broadcastForSession(sessionId, createSessionRunningMessage(true));
62
62
  try {
63
- const { maybeAutoCompactContext } = await import("./auto-compaction-UIWTO3H5.js");
63
+ const { maybeAutoCompactContext } = await import("./auto-compaction-2ZAYDXGF.js");
64
64
  await maybeAutoCompactContext({
65
65
  sessionManager,
66
66
  sessionId,
@@ -174,4 +174,4 @@ export {
174
174
  startChatSession,
175
175
  stopSessionExecution
176
176
  };
177
- //# sourceMappingURL=chat-handler-IVIWOR3D.js.map
177
+ //# sourceMappingURL=chat-handler-BM6EBFKS.js.map
@@ -2,7 +2,7 @@ import {
2
2
  createVerifierNudgeConfig,
3
3
  runBuilderTurn,
4
4
  runChatTurn
5
- } from "./chunk-UFY4I643.js";
5
+ } from "./chunk-X36JIWSF.js";
6
6
  import {
7
7
  TurnMetrics,
8
8
  agentExists,
@@ -51,7 +51,7 @@ import {
51
51
  saveSkillToProject,
52
52
  skillExists,
53
53
  spawnShellProcess
54
- } from "./chunk-ALH4KM2Y.js";
54
+ } from "./chunk-DFWGWULB.js";
55
55
  import {
56
56
  getProject
57
57
  } from "./chunk-XAMAYRDA.js";
@@ -101,14 +101,14 @@ import {
101
101
  updateSessionMetadata,
102
102
  updateSessionProvider,
103
103
  updateSessionRunning
104
- } from "./chunk-XKR3HCAL.js";
104
+ } from "./chunk-UH27FDT7.js";
105
105
  import {
106
106
  initDatabase
107
107
  } from "./chunk-FBGWG4N6.js";
108
108
  import {
109
109
  buildMessagesFromStoredEvents,
110
110
  foldPendingConfirmations
111
- } from "./chunk-NONI4CRP.js";
111
+ } from "./chunk-XL7SW5B4.js";
112
112
  import {
113
113
  createChatErrorMessage,
114
114
  createChatMessageMessage,
@@ -123,7 +123,7 @@ import {
123
123
  parseClientMessage,
124
124
  serializeServerMessage,
125
125
  storedEventToServerMessage
126
- } from "./chunk-CEZNMLOO.js";
126
+ } from "./chunk-V6DYJV5R.js";
127
127
  import {
128
128
  EventEmitter,
129
129
  provideAnswer
@@ -133,7 +133,7 @@ import {
133
133
  } from "./chunk-VUQCQXXJ.js";
134
134
  import {
135
135
  createServerMessage
136
- } from "./chunk-FQLK5GL5.js";
136
+ } from "./chunk-T4HV6GS5.js";
137
137
  import {
138
138
  getGlobalConfigDir
139
139
  } from "./chunk-CQGTEGKL.js";
@@ -4756,7 +4756,6 @@ var SessionManager = class {
4756
4756
  if (m.isSystemGenerated !== void 0) msg.isSystemGenerated = m.isSystemGenerated;
4757
4757
  if (m.messageKind !== void 0) msg.messageKind = m.messageKind;
4758
4758
  if (m.isCompactionSummary !== void 0) msg.isCompactionSummary = m.isCompactionSummary;
4759
- if (m.promptContext !== void 0) msg.promptContext = m.promptContext;
4760
4759
  return msg;
4761
4760
  });
4762
4761
  }
@@ -5174,7 +5173,6 @@ ${summary}`,
5174
5173
  if (m.messageKind !== void 0) msg.messageKind = m.messageKind;
5175
5174
  if (m.contextWindowId !== void 0) msg.contextWindowId = m.contextWindowId;
5176
5175
  if (m.isCompactionSummary !== void 0) msg.isCompactionSummary = m.isCompactionSummary;
5177
- if (m.promptContext !== void 0) msg.promptContext = m.promptContext;
5178
5176
  return msg;
5179
5177
  });
5180
5178
  const isRunning = dbSession.isRunning;
@@ -5748,7 +5746,7 @@ import { Router as Router6 } from "express";
5748
5746
  import { spawn as spawn5 } from "child_process";
5749
5747
 
5750
5748
  // src/constants.ts
5751
- var VERSION = "2.0.0-beta.3";
5749
+ var VERSION = "2.0.0-beta.5";
5752
5750
 
5753
5751
  // src/server/routes/auto-update.ts
5754
5752
  var updateInProgress = false;
@@ -6051,7 +6049,7 @@ async function createServerHandle(config4) {
6051
6049
  res.json({ project });
6052
6050
  });
6053
6051
  app.get("/api/sessions", async (req, res) => {
6054
- const { getRecentUserPromptsForSession } = await import("./events-OHJWCI3S.js");
6052
+ const { getRecentUserPromptsForSession } = await import("./events-T37KTNCX.js");
6055
6053
  const projectId = req.query["projectId"];
6056
6054
  const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
6057
6055
  const offset = parseInt(req.query["offset"]) || 0;
@@ -6084,8 +6082,8 @@ async function createServerHandle(config4) {
6084
6082
  res.status(201).json({ session });
6085
6083
  });
6086
6084
  app.get("/api/sessions/:id", async (req, res) => {
6087
- const { getEventStore: getEventStore2 } = await import("./events-OHJWCI3S.js");
6088
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-U6UHQAS5.js");
6085
+ const { getEventStore: getEventStore2 } = await import("./events-T37KTNCX.js");
6086
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-IIKWAGG2.js");
6089
6087
  const session = sessionManager.getSession(req.params.id);
6090
6088
  if (!session) {
6091
6089
  return res.status(404).json({ error: "Session not found" });
@@ -6115,8 +6113,8 @@ async function createServerHandle(config4) {
6115
6113
  res.json({ success: true });
6116
6114
  });
6117
6115
  app.post("/api/sessions/:id/provider", async (req, res) => {
6118
- const { getEventStore: getEventStore2 } = await import("./events-OHJWCI3S.js");
6119
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-U6UHQAS5.js");
6116
+ const { getEventStore: getEventStore2 } = await import("./events-T37KTNCX.js");
6117
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-IIKWAGG2.js");
6120
6118
  const sessionId = req.params.id;
6121
6119
  const session = sessionManager.getSession(sessionId);
6122
6120
  if (!session) {
@@ -6158,8 +6156,8 @@ async function createServerHandle(config4) {
6158
6156
  res.json({ success: true });
6159
6157
  });
6160
6158
  app.put("/api/sessions/:id/mode", async (req, res) => {
6161
- const { getEventStore: getEventStore2 } = await import("./events-OHJWCI3S.js");
6162
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-U6UHQAS5.js");
6159
+ const { getEventStore: getEventStore2 } = await import("./events-T37KTNCX.js");
6160
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-IIKWAGG2.js");
6163
6161
  const sessionId = req.params.id;
6164
6162
  const session = sessionManager.getSession(sessionId);
6165
6163
  if (!session) {
@@ -6215,14 +6213,14 @@ async function createServerHandle(config4) {
6215
6213
  if (!callId || approved === void 0) {
6216
6214
  return res.status(400).json({ error: "callId and approved are required" });
6217
6215
  }
6218
- const { providePathConfirmation } = await import("./tools-Z7X4HXZN.js");
6216
+ const { providePathConfirmation } = await import("./tools-56LACLKH.js");
6219
6217
  const result = providePathConfirmation(callId, approved, alwaysAllow);
6220
6218
  if (!result.found) {
6221
6219
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
6222
6220
  }
6223
- const { getEventStore: getEventStore2 } = await import("./events-OHJWCI3S.js");
6224
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-U6UHQAS5.js");
6225
- const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-K62EPEGS.js");
6221
+ const { getEventStore: getEventStore2 } = await import("./events-T37KTNCX.js");
6222
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-IIKWAGG2.js");
6223
+ const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-ALBHLBBF.js");
6226
6224
  const eventStore = getEventStore2();
6227
6225
  const events = eventStore.getEvents(sessionId);
6228
6226
  const messages = buildMessagesFromStoredEvents2(events);
@@ -6239,7 +6237,7 @@ async function createServerHandle(config4) {
6239
6237
  if (!callId || !answer) {
6240
6238
  return res.status(400).json({ error: "callId and answer are required" });
6241
6239
  }
6242
- const { provideAnswer: provideAnswer2 } = await import("./tools-Z7X4HXZN.js");
6240
+ const { provideAnswer: provideAnswer2 } = await import("./tools-56LACLKH.js");
6243
6241
  const found = provideAnswer2(callId, answer);
6244
6242
  if (!found) {
6245
6243
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -6275,14 +6273,14 @@ async function createServerHandle(config4) {
6275
6273
  if (!session) {
6276
6274
  return res.status(404).json({ error: "Session not found" });
6277
6275
  }
6278
- const { stopSessionExecution } = await import("./chat-handler-IVIWOR3D.js");
6279
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-Z7X4HXZN.js");
6276
+ const { stopSessionExecution } = await import("./chat-handler-BM6EBFKS.js");
6277
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-56LACLKH.js");
6280
6278
  stopSessionExecution(sessionId, sessionManager);
6281
6279
  abortSession(sessionId);
6282
6280
  cancelQuestionsForSession(sessionId, "Session stopped by user");
6283
6281
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
6284
6282
  sessionManager.clearMessageQueue(sessionId);
6285
- const eventStore = (await import("./events-OHJWCI3S.js")).getEventStore();
6283
+ const eventStore = (await import("./events-T37KTNCX.js")).getEventStore();
6286
6284
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
6287
6285
  res.json({ success: true });
6288
6286
  });
@@ -6296,7 +6294,7 @@ async function createServerHandle(config4) {
6296
6294
  if (typeof messageIndex !== "number" || messageIndex < 0) {
6297
6295
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
6298
6296
  }
6299
- const { truncateSessionMessages } = await import("./events-OHJWCI3S.js");
6297
+ const { truncateSessionMessages } = await import("./events-T37KTNCX.js");
6300
6298
  truncateSessionMessages(sessionId, messageIndex);
6301
6299
  res.json({ success: true });
6302
6300
  });
@@ -6314,7 +6312,7 @@ async function createServerHandle(config4) {
6314
6312
  if (!msg) {
6315
6313
  return res.status(400).json({ error: "Message not found at this index" });
6316
6314
  }
6317
- const { truncateSessionMessages } = await import("./events-OHJWCI3S.js");
6315
+ const { truncateSessionMessages } = await import("./events-T37KTNCX.js");
6318
6316
  truncateSessionMessages(sessionId, messageIndex - 1);
6319
6317
  sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
6320
6318
  res.json({ success: true });
@@ -6791,7 +6789,7 @@ async function createServerHandle(config4) {
6791
6789
  providerManager
6792
6790
  );
6793
6791
  const wss = wssExports.wss;
6794
- const { QueueProcessor } = await import("./processor-TKBJLQ2N.js");
6792
+ const { QueueProcessor } = await import("./processor-66YBBQ6B.js");
6795
6793
  const queueProcessor = new QueueProcessor({
6796
6794
  sessionManager,
6797
6795
  providerManager,
@@ -6863,4 +6861,4 @@ export {
6863
6861
  createServerHandle,
6864
6862
  createServer
6865
6863
  };
6866
- //# sourceMappingURL=chunk-YUIMJBSE.js.map
6864
+ //# sourceMappingURL=chunk-CLGRPDZT.js.map
@@ -31,7 +31,7 @@ import {
31
31
  import {
32
32
  getCurrentContextWindowId,
33
33
  getEventStore
34
- } from "./chunk-XKR3HCAL.js";
34
+ } from "./chunk-UH27FDT7.js";
35
35
  import {
36
36
  buildContextMessagesFromEventHistory,
37
37
  foldContextState,
@@ -40,7 +40,7 @@ import {
40
40
  handleToolCall,
41
41
  handleToolResult,
42
42
  stripOrphanedToolCalls
43
- } from "./chunk-NONI4CRP.js";
43
+ } from "./chunk-XL7SW5B4.js";
44
44
  import {
45
45
  createChatDoneMessage,
46
46
  createChatMessageMessage,
@@ -48,7 +48,7 @@ import {
48
48
  createChatPathConfirmationMessage,
49
49
  createChatVisionFallbackMessage,
50
50
  createQueueStateMessage
51
- } from "./chunk-CEZNMLOO.js";
51
+ } from "./chunk-V6DYJV5R.js";
52
52
  import {
53
53
  AskUserInterrupt,
54
54
  askUserTool
@@ -428,51 +428,11 @@ function messageToMinimal(message) {
428
428
  ...spreadMessageProps(message)
429
429
  };
430
430
  }
431
- function getTriggerUserMessage(messages) {
432
- const stripRuntimeReminders = (content) => {
433
- return content.replace(/\n*<system-reminder>[\s\S]*<\/system-reminder>\s*/gi, "").trim();
434
- };
435
- for (let index = messages.length - 1; index >= 0; index -= 1) {
436
- const message = messages[index];
437
- if (message?.role === "user" && message.source === "history") {
438
- const stripped = stripRuntimeReminders(message.content);
439
- if (stripped) {
440
- return stripped;
441
- }
442
- }
443
- }
444
- return "";
445
- }
446
- function createPromptContext(input) {
447
- return {
448
- systemPrompt: input.systemPrompt,
449
- injectedFiles: input.injectedFiles,
450
- userMessage: input.userMessage ?? getTriggerUserMessage(input.messages),
451
- messages: input.messages.map((message) => ({
452
- ...messageToMinimal(message),
453
- source: message.source
454
- })),
455
- tools: input.requestTools.map((tool) => ({
456
- name: tool.function.name,
457
- description: tool.function.description,
458
- parameters: tool.function.parameters
459
- })),
460
- requestOptions: {
461
- toolChoice: input.toolChoice,
462
- disableThinking: input.disableThinking
463
- }
464
- };
465
- }
466
431
  function createAssemblyResult(input) {
467
- const triggerUserMessage = getTriggerUserMessage(input.messages);
468
432
  const messagesForLLM = input.messages.filter((m) => m.source !== "runtime");
469
433
  return {
470
434
  systemPrompt: input.systemPrompt,
471
- messages: messagesForLLM.map((message) => messageToMinimal(message)),
472
- promptContext: createPromptContext({
473
- ...input,
474
- userMessage: triggerUserMessage
475
- })
435
+ messages: messagesForLLM.map((message) => messageToMinimal(message))
476
436
  };
477
437
  }
478
438
  function buildAssemblyInput(systemPrompt, baseInput) {
@@ -872,8 +832,7 @@ function createMessageDoneEvent(messageId, options) {
872
832
  messageId,
873
833
  ...options?.stats && { stats: options.stats },
874
834
  ...options?.segments && { segments: options.segments },
875
- ...options?.partial && { partial: options.partial },
876
- ...options?.promptContext && { promptContext: options.promptContext }
835
+ ...options?.partial && { partial: options.partial }
877
836
  }
878
837
  };
879
838
  }
@@ -2978,14 +2937,13 @@ function getConversationMessages(scope) {
2978
2937
  }
2979
2938
 
2980
2939
  // src/server/chat/agent-loop.ts
2981
- function emitPartialDoneEvents(sessionId, assistantMsgId, statsIdentity, mode, turnMetrics, promptContext, eventStore) {
2940
+ function emitPartialDoneEvents(sessionId, assistantMsgId, statsIdentity, mode, turnMetrics, eventStore) {
2982
2941
  const stats = turnMetrics.buildStats(statsIdentity, mode);
2983
2942
  eventStore.append(
2984
2943
  sessionId,
2985
2944
  createMessageDoneEvent(assistantMsgId, {
2986
2945
  stats,
2987
- partial: true,
2988
- promptContext
2946
+ partial: true
2989
2947
  })
2990
2948
  );
2991
2949
  eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "stopped", stats));
@@ -3280,15 +3238,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
3280
3238
  }
3281
3239
  }
3282
3240
  if (result.aborted) {
3283
- emitPartialDoneEvents(
3284
- sessionId,
3285
- assistantMsgId,
3286
- statsIdentity,
3287
- mode,
3288
- turnMetrics,
3289
- assembledRequest.promptContext,
3290
- eventStore
3291
- );
3241
+ emitPartialDoneEvents(sessionId, assistantMsgId, statsIdentity, mode, turnMetrics, eventStore);
3292
3242
  throw new Error("Aborted");
3293
3243
  }
3294
3244
  turnMetrics.addLLMCall(
@@ -3312,8 +3262,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
3312
3262
  sessionId,
3313
3263
  createMessageDoneEvent(assistantMsgId, {
3314
3264
  segments: result.segments,
3315
- stats: interimStats,
3316
- promptContext: assembledRequest.promptContext
3265
+ stats: interimStats
3317
3266
  })
3318
3267
  );
3319
3268
  onMessage?.(createChatMessageUpdatedMessage(assistantMsgId, { isStreaming: false }));
@@ -3339,8 +3288,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
3339
3288
  createMessageDoneEvent(assistantMsgId, {
3340
3289
  segments: result.segments,
3341
3290
  stats: stats2,
3342
- partial: true,
3343
- promptContext: assembledRequest.promptContext
3291
+ partial: true
3344
3292
  })
3345
3293
  );
3346
3294
  eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "truncated", stats2));
@@ -3351,8 +3299,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
3351
3299
  eventStore.append(
3352
3300
  sessionId,
3353
3301
  createMessageDoneEvent(assistantMsgId, {
3354
- segments: result.segments,
3355
- promptContext: assembledRequest.promptContext
3302
+ segments: result.segments
3356
3303
  })
3357
3304
  );
3358
3305
  try {
@@ -3381,29 +3328,13 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
3381
3328
  }
3382
3329
  } catch (error) {
3383
3330
  if (error instanceof Error && error.message === "Aborted") {
3384
- emitPartialDoneEvents(
3385
- sessionId,
3386
- assistantMsgId,
3387
- statsIdentity,
3388
- mode,
3389
- turnMetrics,
3390
- assembledRequest.promptContext,
3391
- eventStore
3392
- );
3331
+ emitPartialDoneEvents(sessionId, assistantMsgId, statsIdentity, mode, turnMetrics, eventStore);
3393
3332
  throw error;
3394
3333
  }
3395
3334
  throw error;
3396
3335
  }
3397
3336
  if (signal?.aborted) {
3398
- emitPartialDoneEvents(
3399
- sessionId,
3400
- assistantMsgId,
3401
- statsIdentity,
3402
- mode,
3403
- turnMetrics,
3404
- assembledRequest.promptContext,
3405
- eventStore
3406
- );
3337
+ emitPartialDoneEvents(sessionId, assistantMsgId, statsIdentity, mode, turnMetrics, eventStore);
3407
3338
  throw new Error("Aborted");
3408
3339
  }
3409
3340
  const asapMessages = sessionManager.drainAsapMessages(sessionId);
@@ -3438,16 +3369,10 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
3438
3369
  sessionId,
3439
3370
  createMessageDoneEvent(assistantMsgId, {
3440
3371
  segments: result.segments,
3441
- stats,
3442
- promptContext: assembledRequest.promptContext
3372
+ stats
3443
3373
  })
3444
3374
  );
3445
3375
  eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "complete", stats));
3446
- const currentWindowMessages = sessionManager.getCurrentWindowMessages(sessionId);
3447
- const lastUserMessage = [...currentWindowMessages].reverse().find((m) => m.role === "user");
3448
- if (lastUserMessage) {
3449
- sessionManager.updateMessage(sessionId, lastUserMessage.id, { promptContext: assembledRequest.promptContext });
3450
- }
3451
3376
  break;
3452
3377
  }
3453
3378
  return {
@@ -3457,24 +3382,6 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
3457
3382
  }
3458
3383
 
3459
3384
  // src/server/context/nudge-helpers.ts
3460
- function buildPromptContextForNudge(systemPrompt, injectedFiles, userMessage, messages, tools) {
3461
- return {
3462
- systemPrompt,
3463
- injectedFiles,
3464
- userMessage,
3465
- messages: messages.map((m) => ({
3466
- role: m.role,
3467
- content: m.content,
3468
- source: m.source
3469
- })),
3470
- tools: tools.map((t) => ({
3471
- name: t.function.name,
3472
- description: t.function.description,
3473
- parameters: t.function.parameters
3474
- })),
3475
- requestOptions: { toolChoice: "auto", disableThinking: true }
3476
- };
3477
- }
3478
3385
  function appendNudgeMessage(eventStore, sessionId, content, currentWindowMessageOptions, options) {
3479
3386
  const msgId = crypto.randomUUID();
3480
3387
  eventStore.append(
@@ -3591,12 +3498,6 @@ async function executeSubAgent(options) {
3591
3498
  const config = getRuntimeConfig();
3592
3499
  const configDir = getGlobalConfigDir(config.mode ?? "production");
3593
3500
  const skills = await getEnabledSkillMetadata(configDir, config.workdir);
3594
- const systemPrompt = buildSubAgentSystemPrompt(
3595
- session.workdir,
3596
- agentDef,
3597
- skills.length > 0 ? skills : void 0,
3598
- llmClient.getModel()
3599
- );
3600
3501
  const subAgentScope = { type: "subagent", sessionId, subAgentId, subAgentType };
3601
3502
  let consecutiveEmptyStops = 0;
3602
3503
  let finalContent;
@@ -3617,13 +3518,6 @@ async function executeSubAgent(options) {
3617
3518
  subAgentType
3618
3519
  })
3619
3520
  );
3620
- const promptContext = buildPromptContextForNudge(
3621
- systemPrompt,
3622
- injectedFiles,
3623
- prompt,
3624
- requestMessages,
3625
- toolRegistry.definitions
3626
- );
3627
3521
  const assembledRequest = assembleAgentRequest({
3628
3522
  agentDef,
3629
3523
  subAgentDefs: [],
@@ -3666,8 +3560,7 @@ async function executeSubAgent(options) {
3666
3560
  sessionId,
3667
3561
  createMessageDoneEvent(assistantMsgId, {
3668
3562
  stats,
3669
- partial: true,
3670
- promptContext
3563
+ partial: true
3671
3564
  })
3672
3565
  );
3673
3566
  eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "stopped", stats, "sub-agent"));
@@ -3692,8 +3585,7 @@ async function executeSubAgent(options) {
3692
3585
  eventStore.append(
3693
3586
  sessionId,
3694
3587
  createMessageDoneEvent(assistantMsgId, {
3695
- segments: result.segments,
3696
- promptContext
3588
+ segments: result.segments
3697
3589
  })
3698
3590
  );
3699
3591
  appendNudgeMessage(eventStore, sessionId, nudgeContent, currentWindowMessageOptions, {
@@ -3721,8 +3613,7 @@ async function executeSubAgent(options) {
3721
3613
  eventStore.append(
3722
3614
  sessionId,
3723
3615
  createMessageDoneEvent(assistantMsgId, {
3724
- segments: result.segments,
3725
- promptContext
3616
+ segments: result.segments
3726
3617
  })
3727
3618
  );
3728
3619
  appendNudgeMessage(eventStore, sessionId, RETURN_VALUE_NUDGE, currentWindowMessageOptions, {
@@ -3736,8 +3627,7 @@ async function executeSubAgent(options) {
3736
3627
  sessionId,
3737
3628
  createMessageDoneEvent(assistantMsgId, {
3738
3629
  segments: result.segments,
3739
- stats,
3740
- promptContext
3630
+ stats
3741
3631
  })
3742
3632
  );
3743
3633
  eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "complete", stats, "sub-agent"));
@@ -3746,8 +3636,7 @@ async function executeSubAgent(options) {
3746
3636
  eventStore.append(
3747
3637
  sessionId,
3748
3638
  createMessageDoneEvent(assistantMsgId, {
3749
- segments: result.segments,
3750
- promptContext
3639
+ segments: result.segments
3751
3640
  })
3752
3641
  );
3753
3642
  const batchResult = await executeToolBatch(assistantMsgId, result.toolCalls, {
@@ -3768,12 +3657,11 @@ async function executeSubAgent(options) {
3768
3657
  sessionId,
3769
3658
  createMessageDoneEvent(assistantMsgId, {
3770
3659
  segments: result.segments,
3771
- stats,
3772
- promptContext
3660
+ stats
3773
3661
  })
3774
3662
  );
3775
3663
  if (onMessage) {
3776
- onMessage(createChatMessageUpdatedMessage(assistantMsgId, { isStreaming: false, stats, promptContext }));
3664
+ onMessage(createChatMessageUpdatedMessage(assistantMsgId, { isStreaming: false, stats }));
3777
3665
  }
3778
3666
  eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "complete", stats, "sub-agent"));
3779
3667
  if (onMessage) {
@@ -3867,7 +3755,7 @@ var callSubAgentTool = {
3867
3755
  };
3868
3756
  }
3869
3757
  try {
3870
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-Z7X4HXZN.js");
3758
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-56LACLKH.js");
3871
3759
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3872
3760
  const turnMetrics = new TurnMetrics();
3873
3761
  const result = await executeSubAgent({
@@ -5068,4 +4956,4 @@ export {
5068
4956
  getToolRegistryForAgent,
5069
4957
  createToolRegistry
5070
4958
  };
5071
- //# sourceMappingURL=chunk-ALH4KM2Y.js.map
4959
+ //# sourceMappingURL=chunk-DFWGWULB.js.map
@@ -193,7 +193,7 @@ async function runCli(options) {
193
193
  if (!configExists) {
194
194
  await runNetworkSetup(mode);
195
195
  }
196
- const { runServe } = await import("./serve-7CUQCZC7.js");
196
+ const { runServe } = await import("./serve-EUEQ6ERI.js");
197
197
  const serveOptions = { mode };
198
198
  if (values.port) serveOptions.port = parseInt(values.port);
199
199
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -205,4 +205,4 @@ async function runCli(options) {
205
205
  export {
206
206
  runCli
207
207
  };
208
- //# sourceMappingURL=chunk-UK6XF2OX.js.map
208
+ //# sourceMappingURL=chunk-I67T2E5K.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getEventStore,
3
3
  updateSessionMetadata
4
- } from "./chunk-XKR3HCAL.js";
4
+ } from "./chunk-UH27FDT7.js";
5
5
  import {
6
6
  buildMessagesFromStoredEvents,
7
7
  foldPendingConfirmations
8
- } from "./chunk-NONI4CRP.js";
8
+ } from "./chunk-XL7SW5B4.js";
9
9
  import {
10
10
  createContextStateMessage,
11
11
  createSessionStateMessage
12
- } from "./chunk-CEZNMLOO.js";
12
+ } from "./chunk-V6DYJV5R.js";
13
13
  import {
14
14
  logger
15
15
  } from "./chunk-K44MW7JJ.js";
@@ -143,4 +143,4 @@ export {
143
143
  needsNameGenerationCheck,
144
144
  applyGeneratedSessionName
145
145
  };
146
- //# sourceMappingURL=chunk-QFSSKIQ3.js.map
146
+ //# sourceMappingURL=chunk-OBD6D5ZO.js.map
@@ -26,4 +26,4 @@ export {
26
26
  isClientMessage,
27
27
  isServerMessage
28
28
  };
29
- //# sourceMappingURL=chunk-FQLK5GL5.js.map
29
+ //# sourceMappingURL=chunk-T4HV6GS5.js.map