openfox 2.0.0-beta.4 → 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 (34) hide show
  1. package/dist/{auto-compaction-A3PIMGLF.js → auto-compaction-2ZAYDXGF.js} +7 -8
  2. package/dist/{chat-handler-IUWEBZG7.js → chat-handler-BM6EBFKS.js} +10 -11
  3. package/dist/{chunk-WBYS7AQN.js → chunk-CLGRPDZT.js} +30 -35
  4. package/dist/{chunk-KEF4O3UM.js → chunk-DFWGWULB.js} +27 -139
  5. package/dist/{chunk-EYCCASW3.js → chunk-I67T2E5K.js} +2 -2
  6. package/dist/{chunk-HW3U4XSZ.js → chunk-OBD6D5ZO.js} +4 -4
  7. package/dist/{chunk-FQLK5GL5.js → chunk-T4HV6GS5.js} +1 -1
  8. package/dist/{chunk-HLZV4S2I.js → chunk-UH27FDT7.js} +5 -25
  9. package/dist/{chunk-CEZNMLOO.js → chunk-V6DYJV5R.js} +2 -5
  10. package/dist/{chunk-7IKUIYFZ.js → chunk-X36JIWSF.js} +4 -4
  11. package/dist/{chunk-26DZZZDC.js → chunk-XL7SW5B4.js} +1 -8
  12. package/dist/cli/dev.js +1 -1
  13. package/dist/cli/index.js +1 -1
  14. package/dist/{events-YO52472Q.js → events-T37KTNCX.js} +3 -4
  15. package/dist/{folding-K5L6M4WK.js → folding-IIKWAGG2.js} +2 -3
  16. package/dist/{orchestrator-F75DNQKQ.js → orchestrator-JTUHXF7C.js} +8 -9
  17. package/dist/package.json +1 -1
  18. package/dist/{processor-FTEASNGS.js → processor-66YBBQ6B.js} +7 -8
  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-CEQ2QMM5.js → serve-EUEQ6ERI.js} +9 -10
  22. package/dist/server/index.d.ts +1 -1
  23. package/dist/server/index.js +8 -9
  24. package/dist/shared/index.d.ts +2 -2
  25. package/dist/shared/index.js +1 -1
  26. package/dist/{tools-OPEU2E5M.js → tools-56LACLKH.js} +11 -12
  27. package/dist/web/assets/{index-bDyDeCAz.css → index-C5gaXnFj.css} +1 -1
  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/chunk-MCPID4EJ.js +0 -28
  33. package/dist/optimize-storage-2N6BY5KZ.js +0 -7
  34. package/dist/web/assets/index-ZTEHxmVW.js +0 -317
@@ -2,20 +2,19 @@ import {
2
2
  maybeAutoCompactContext,
3
3
  performManualContextCompaction,
4
4
  resolveCompactionStatsIdentity
5
- } from "./chunk-KEF4O3UM.js";
6
- import "./chunk-BJYPTN5S.js";
5
+ } from "./chunk-DFWGWULB.js";
7
6
  import "./chunk-PSJIT5LZ.js";
8
7
  import "./chunk-XAMAYRDA.js";
9
8
  import "./chunk-DL6ZILAF.js";
10
9
  import "./chunk-PBGOZMVY.js";
11
10
  import "./chunk-VRGRAQDG.js";
12
11
  import "./chunk-HGAMIPFO.js";
13
- import "./chunk-HLZV4S2I.js";
12
+ import "./chunk-UH27FDT7.js";
14
13
  import "./chunk-FBGWG4N6.js";
15
- import "./chunk-26DZZZDC.js";
16
- import "./chunk-MCPID4EJ.js";
17
- import "./chunk-CEZNMLOO.js";
18
- import "./chunk-FQLK5GL5.js";
14
+ import "./chunk-XL7SW5B4.js";
15
+ import "./chunk-V6DYJV5R.js";
16
+ import "./chunk-BJYPTN5S.js";
17
+ import "./chunk-T4HV6GS5.js";
19
18
  import "./chunk-CQGTEGKL.js";
20
19
  import "./chunk-CGZHLM3K.js";
21
20
  import "./chunk-SZKEGZIB.js";
@@ -25,4 +24,4 @@ export {
25
24
  performManualContextCompaction,
26
25
  resolveCompactionStatsIdentity
27
26
  };
28
- //# sourceMappingURL=auto-compaction-A3PIMGLF.js.map
27
+ //# sourceMappingURL=auto-compaction-2ZAYDXGF.js.map
@@ -5,12 +5,11 @@ import {
5
5
  generateSessionName,
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
- } from "./chunk-HW3U4XSZ.js";
8
+ } from "./chunk-OBD6D5ZO.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-7IKUIYFZ.js";
12
- import "./chunk-KEF4O3UM.js";
13
- import "./chunk-BJYPTN5S.js";
11
+ } from "./chunk-X36JIWSF.js";
12
+ import "./chunk-DFWGWULB.js";
14
13
  import "./chunk-PSJIT5LZ.js";
15
14
  import "./chunk-XAMAYRDA.js";
16
15
  import "./chunk-DL6ZILAF.js";
@@ -19,16 +18,16 @@ import "./chunk-VRGRAQDG.js";
19
18
  import "./chunk-HGAMIPFO.js";
20
19
  import {
21
20
  getEventStore
22
- } from "./chunk-HLZV4S2I.js";
21
+ } from "./chunk-UH27FDT7.js";
23
22
  import "./chunk-FBGWG4N6.js";
24
- import "./chunk-26DZZZDC.js";
25
- import "./chunk-MCPID4EJ.js";
23
+ import "./chunk-XL7SW5B4.js";
26
24
  import {
27
25
  createChatMessageMessage,
28
26
  createPhaseChangedMessage,
29
27
  createSessionRunningMessage
30
- } from "./chunk-CEZNMLOO.js";
31
- import "./chunk-FQLK5GL5.js";
28
+ } from "./chunk-V6DYJV5R.js";
29
+ import "./chunk-BJYPTN5S.js";
30
+ import "./chunk-T4HV6GS5.js";
32
31
  import "./chunk-CQGTEGKL.js";
33
32
  import "./chunk-CGZHLM3K.js";
34
33
  import "./chunk-SZKEGZIB.js";
@@ -61,7 +60,7 @@ async function startChatSession(sessionId, content, deps, options) {
61
60
  sessionManager.setRunning(sessionId, true);
62
61
  broadcastForSession(sessionId, createSessionRunningMessage(true));
63
62
  try {
64
- const { maybeAutoCompactContext } = await import("./auto-compaction-A3PIMGLF.js");
63
+ const { maybeAutoCompactContext } = await import("./auto-compaction-2ZAYDXGF.js");
65
64
  await maybeAutoCompactContext({
66
65
  sessionManager,
67
66
  sessionId,
@@ -175,4 +174,4 @@ export {
175
174
  startChatSession,
176
175
  stopSessionExecution
177
176
  };
178
- //# sourceMappingURL=chat-handler-IUWEBZG7.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-7IKUIYFZ.js";
5
+ } from "./chunk-X36JIWSF.js";
6
6
  import {
7
7
  TurnMetrics,
8
8
  agentExists,
@@ -51,11 +51,7 @@ import {
51
51
  saveSkillToProject,
52
52
  skillExists,
53
53
  spawnShellProcess
54
- } from "./chunk-KEF4O3UM.js";
55
- import {
56
- EventEmitter,
57
- provideAnswer
58
- } from "./chunk-BJYPTN5S.js";
54
+ } from "./chunk-DFWGWULB.js";
59
55
  import {
60
56
  getProject
61
57
  } from "./chunk-XAMAYRDA.js";
@@ -105,14 +101,14 @@ import {
105
101
  updateSessionMetadata,
106
102
  updateSessionProvider,
107
103
  updateSessionRunning
108
- } from "./chunk-HLZV4S2I.js";
104
+ } from "./chunk-UH27FDT7.js";
109
105
  import {
110
106
  initDatabase
111
107
  } from "./chunk-FBGWG4N6.js";
112
108
  import {
113
109
  buildMessagesFromStoredEvents,
114
110
  foldPendingConfirmations
115
- } from "./chunk-26DZZZDC.js";
111
+ } from "./chunk-XL7SW5B4.js";
116
112
  import {
117
113
  createChatErrorMessage,
118
114
  createChatMessageMessage,
@@ -127,13 +123,17 @@ import {
127
123
  parseClientMessage,
128
124
  serializeServerMessage,
129
125
  storedEventToServerMessage
130
- } from "./chunk-CEZNMLOO.js";
126
+ } from "./chunk-V6DYJV5R.js";
127
+ import {
128
+ EventEmitter,
129
+ provideAnswer
130
+ } from "./chunk-BJYPTN5S.js";
131
131
  import {
132
132
  computeSessionStats
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.4";
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-YO52472Q.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,9 +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-YO52472Q.js");
6088
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-K5L6M4WK.js");
6089
- const { stripPromptContextMessages } = await import("./optimize-storage-2N6BY5KZ.js");
6085
+ const { getEventStore: getEventStore2 } = await import("./events-T37KTNCX.js");
6086
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-IIKWAGG2.js");
6090
6087
  const session = sessionManager.getSession(req.params.id);
6091
6088
  if (!session) {
6092
6089
  return res.status(404).json({ error: "Session not found" });
@@ -6096,8 +6093,6 @@ async function createServerHandle(config4) {
6096
6093
  const messages = buildMessagesFromStoredEvents2(events);
6097
6094
  const contextState = sessionManager.getContextState(req.params.id);
6098
6095
  const queueState = sessionManager.getQueueState(req.params.id);
6099
- stripPromptContextMessages(session.messages);
6100
- stripPromptContextMessages(messages);
6101
6096
  res.json({ session, messages, contextState, queueState });
6102
6097
  });
6103
6098
  app.delete("/api/sessions/:id", (req, res) => {
@@ -6118,8 +6113,8 @@ async function createServerHandle(config4) {
6118
6113
  res.json({ success: true });
6119
6114
  });
6120
6115
  app.post("/api/sessions/:id/provider", async (req, res) => {
6121
- const { getEventStore: getEventStore2 } = await import("./events-YO52472Q.js");
6122
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-K5L6M4WK.js");
6116
+ const { getEventStore: getEventStore2 } = await import("./events-T37KTNCX.js");
6117
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-IIKWAGG2.js");
6123
6118
  const sessionId = req.params.id;
6124
6119
  const session = sessionManager.getSession(sessionId);
6125
6120
  if (!session) {
@@ -6161,8 +6156,8 @@ async function createServerHandle(config4) {
6161
6156
  res.json({ success: true });
6162
6157
  });
6163
6158
  app.put("/api/sessions/:id/mode", async (req, res) => {
6164
- const { getEventStore: getEventStore2 } = await import("./events-YO52472Q.js");
6165
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-K5L6M4WK.js");
6159
+ const { getEventStore: getEventStore2 } = await import("./events-T37KTNCX.js");
6160
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-IIKWAGG2.js");
6166
6161
  const sessionId = req.params.id;
6167
6162
  const session = sessionManager.getSession(sessionId);
6168
6163
  if (!session) {
@@ -6218,14 +6213,14 @@ async function createServerHandle(config4) {
6218
6213
  if (!callId || approved === void 0) {
6219
6214
  return res.status(400).json({ error: "callId and approved are required" });
6220
6215
  }
6221
- const { providePathConfirmation } = await import("./tools-OPEU2E5M.js");
6216
+ const { providePathConfirmation } = await import("./tools-56LACLKH.js");
6222
6217
  const result = providePathConfirmation(callId, approved, alwaysAllow);
6223
6218
  if (!result.found) {
6224
6219
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
6225
6220
  }
6226
- const { getEventStore: getEventStore2 } = await import("./events-YO52472Q.js");
6227
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-K5L6M4WK.js");
6228
- 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");
6229
6224
  const eventStore = getEventStore2();
6230
6225
  const events = eventStore.getEvents(sessionId);
6231
6226
  const messages = buildMessagesFromStoredEvents2(events);
@@ -6242,7 +6237,7 @@ async function createServerHandle(config4) {
6242
6237
  if (!callId || !answer) {
6243
6238
  return res.status(400).json({ error: "callId and answer are required" });
6244
6239
  }
6245
- const { provideAnswer: provideAnswer2 } = await import("./tools-OPEU2E5M.js");
6240
+ const { provideAnswer: provideAnswer2 } = await import("./tools-56LACLKH.js");
6246
6241
  const found = provideAnswer2(callId, answer);
6247
6242
  if (!found) {
6248
6243
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -6278,14 +6273,14 @@ async function createServerHandle(config4) {
6278
6273
  if (!session) {
6279
6274
  return res.status(404).json({ error: "Session not found" });
6280
6275
  }
6281
- const { stopSessionExecution } = await import("./chat-handler-IUWEBZG7.js");
6282
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-OPEU2E5M.js");
6276
+ const { stopSessionExecution } = await import("./chat-handler-BM6EBFKS.js");
6277
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-56LACLKH.js");
6283
6278
  stopSessionExecution(sessionId, sessionManager);
6284
6279
  abortSession(sessionId);
6285
6280
  cancelQuestionsForSession(sessionId, "Session stopped by user");
6286
6281
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
6287
6282
  sessionManager.clearMessageQueue(sessionId);
6288
- const eventStore = (await import("./events-YO52472Q.js")).getEventStore();
6283
+ const eventStore = (await import("./events-T37KTNCX.js")).getEventStore();
6289
6284
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
6290
6285
  res.json({ success: true });
6291
6286
  });
@@ -6299,7 +6294,7 @@ async function createServerHandle(config4) {
6299
6294
  if (typeof messageIndex !== "number" || messageIndex < 0) {
6300
6295
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
6301
6296
  }
6302
- const { truncateSessionMessages } = await import("./events-YO52472Q.js");
6297
+ const { truncateSessionMessages } = await import("./events-T37KTNCX.js");
6303
6298
  truncateSessionMessages(sessionId, messageIndex);
6304
6299
  res.json({ success: true });
6305
6300
  });
@@ -6317,7 +6312,7 @@ async function createServerHandle(config4) {
6317
6312
  if (!msg) {
6318
6313
  return res.status(400).json({ error: "Message not found at this index" });
6319
6314
  }
6320
- const { truncateSessionMessages } = await import("./events-YO52472Q.js");
6315
+ const { truncateSessionMessages } = await import("./events-T37KTNCX.js");
6321
6316
  truncateSessionMessages(sessionId, messageIndex - 1);
6322
6317
  sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
6323
6318
  res.json({ success: true });
@@ -6794,7 +6789,7 @@ async function createServerHandle(config4) {
6794
6789
  providerManager
6795
6790
  );
6796
6791
  const wss = wssExports.wss;
6797
- const { QueueProcessor } = await import("./processor-FTEASNGS.js");
6792
+ const { QueueProcessor } = await import("./processor-66YBBQ6B.js");
6798
6793
  const queueProcessor = new QueueProcessor({
6799
6794
  sessionManager,
6800
6795
  providerManager,
@@ -6866,4 +6861,4 @@ export {
6866
6861
  createServerHandle,
6867
6862
  createServer
6868
6863
  };
6869
- //# sourceMappingURL=chunk-WBYS7AQN.js.map
6864
+ //# sourceMappingURL=chunk-CLGRPDZT.js.map
@@ -1,7 +1,3 @@
1
- import {
2
- AskUserInterrupt,
3
- askUserTool
4
- } from "./chunk-BJYPTN5S.js";
5
1
  import {
6
2
  SETTINGS_KEYS,
7
3
  deleteSetting,
@@ -35,7 +31,7 @@ import {
35
31
  import {
36
32
  getCurrentContextWindowId,
37
33
  getEventStore
38
- } from "./chunk-HLZV4S2I.js";
34
+ } from "./chunk-UH27FDT7.js";
39
35
  import {
40
36
  buildContextMessagesFromEventHistory,
41
37
  foldContextState,
@@ -44,7 +40,7 @@ import {
44
40
  handleToolCall,
45
41
  handleToolResult,
46
42
  stripOrphanedToolCalls
47
- } from "./chunk-26DZZZDC.js";
43
+ } from "./chunk-XL7SW5B4.js";
48
44
  import {
49
45
  createChatDoneMessage,
50
46
  createChatMessageMessage,
@@ -52,7 +48,11 @@ import {
52
48
  createChatPathConfirmationMessage,
53
49
  createChatVisionFallbackMessage,
54
50
  createQueueStateMessage
55
- } from "./chunk-CEZNMLOO.js";
51
+ } from "./chunk-V6DYJV5R.js";
52
+ import {
53
+ AskUserInterrupt,
54
+ askUserTool
55
+ } from "./chunk-BJYPTN5S.js";
56
56
  import {
57
57
  getGlobalConfigDir
58
58
  } from "./chunk-CQGTEGKL.js";
@@ -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-OPEU2E5M.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-KEF4O3UM.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-CEQ2QMM5.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-EYCCASW3.js.map
208
+ //# sourceMappingURL=chunk-I67T2E5K.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getEventStore,
3
3
  updateSessionMetadata
4
- } from "./chunk-HLZV4S2I.js";
4
+ } from "./chunk-UH27FDT7.js";
5
5
  import {
6
6
  buildMessagesFromStoredEvents,
7
7
  foldPendingConfirmations
8
- } from "./chunk-26DZZZDC.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-HW3U4XSZ.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