openfox 1.6.99 → 1.6.101

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 (39) hide show
  1. package/dist/{auto-compaction-ZYKJQPGM.js → auto-compaction-JSXVY2CJ.js} +9 -9
  2. package/dist/{chat-handler-N3FYFHYQ.js → chat-handler-45TB6QWI.js} +12 -12
  3. package/dist/{chunk-KR7N2ONG.js → chunk-5LYWA56Z.js} +92 -32
  4. package/dist/{chunk-T67WWSM7.js → chunk-C5U6NRAY.js} +10 -10
  5. package/dist/{chunk-XVWVAWSG.js → chunk-DCYDTDWO.js} +7 -9
  6. package/dist/{chunk-5GVCNVKV.js → chunk-FBGWG4N6.js} +1 -5
  7. package/dist/{chunk-6UBQ4BNN.js → chunk-L6LTCUCO.js} +3 -3
  8. package/dist/{chunk-7Y3HFCTD.js → chunk-MBLZSLPH.js} +12 -28
  9. package/dist/{chunk-K7F73QLL.js → chunk-NASF624P.js} +4 -4
  10. package/dist/{chunk-NVVKBL4S.js → chunk-SBQ36AOQ.js} +4 -4
  11. package/dist/{chunk-QAMG73V3.js → chunk-SCAFZ75C.js} +47 -66
  12. package/dist/{chunk-ROWFVGB6.js → chunk-TYIHIHJF.js} +2 -2
  13. package/dist/{chunk-ERFRUQQR.js → chunk-UTBDR6KM.js} +1 -1
  14. package/dist/{chunk-RGRBWDZP.js → chunk-VUQCQXXJ.js} +5 -2
  15. package/dist/{chunk-ZHBL5G5X.js → chunk-XAMAYRDA.js} +2 -2
  16. package/dist/cli/dev.js +1 -1
  17. package/dist/cli/index.js +1 -1
  18. package/dist/{events-Z2SXIOUX.js → events-JP746DV3.js} +4 -4
  19. package/dist/{folding-4VHGQE6Y.js → folding-EQPDQKQS.js} +2 -2
  20. package/dist/{orchestrator-2A6RG6ZR.js → orchestrator-RRO2XLYZ.js} +10 -10
  21. package/dist/package.json +1 -1
  22. package/dist/{processor-V34TTHI2.js → processor-C4KLV5SV.js} +8 -8
  23. package/dist/{project-creator-25F7KUPX.js → project-creator-6DU7E75S.js} +3 -3
  24. package/dist/{projects-55F45PH3.js → projects-2HYIZC4Y.js} +3 -3
  25. package/dist/{protocol-BFKDuZ7J.d.ts → protocol-BkFgSJVU.d.ts} +3 -6
  26. package/dist/{protocol-FZUIA4BS.js → protocol-SVQYBN2X.js} +3 -5
  27. package/dist/{serve-65V7N6ZV.js → serve-5B36ZPK3.js} +12 -12
  28. package/dist/server/index.d.ts +1 -5
  29. package/dist/server/index.js +11 -11
  30. package/dist/{settings-TTYCUHWU.js → settings-4334IX63.js} +3 -3
  31. package/dist/shared/index.d.ts +2 -2
  32. package/dist/shared/index.js +2 -2
  33. package/dist/{tools-ASM4FNUG.js → tools-AGVKG553.js} +9 -9
  34. package/dist/web/assets/index-Du9Uz0qZ.js +299 -0
  35. package/dist/web/assets/{index-D3nUB0zb.css → index-aAebFDVk.css} +1 -1
  36. package/dist/web/index.html +2 -2
  37. package/dist/web/sw.js +1 -1
  38. package/package.json +1 -1
  39. package/dist/web/assets/index-BEkw-EHs.js +0 -299
@@ -2,19 +2,19 @@ import {
2
2
  maybeAutoCompactContext,
3
3
  performManualContextCompaction,
4
4
  resolveCompactionStatsIdentity
5
- } from "./chunk-KR7N2ONG.js";
6
- import "./chunk-ROWFVGB6.js";
7
- import "./chunk-ZHBL5G5X.js";
5
+ } from "./chunk-5LYWA56Z.js";
6
+ import "./chunk-TYIHIHJF.js";
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-7Y3HFCTD.js";
13
- import "./chunk-5GVCNVKV.js";
14
- import "./chunk-XVWVAWSG.js";
15
- import "./chunk-T67WWSM7.js";
12
+ import "./chunk-MBLZSLPH.js";
13
+ import "./chunk-FBGWG4N6.js";
14
+ import "./chunk-DCYDTDWO.js";
15
+ import "./chunk-C5U6NRAY.js";
16
16
  import "./chunk-BJYPTN5S.js";
17
- import "./chunk-ERFRUQQR.js";
17
+ import "./chunk-UTBDR6KM.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-ZYKJQPGM.js.map
27
+ //# sourceMappingURL=auto-compaction-JSXVY2CJ.js.map
@@ -5,29 +5,29 @@ import {
5
5
  generateSessionName,
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
- } from "./chunk-NVVKBL4S.js";
8
+ } from "./chunk-SBQ36AOQ.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-K7F73QLL.js";
12
- import "./chunk-KR7N2ONG.js";
13
- import "./chunk-ROWFVGB6.js";
14
- import "./chunk-ZHBL5G5X.js";
11
+ } from "./chunk-NASF624P.js";
12
+ import "./chunk-5LYWA56Z.js";
13
+ import "./chunk-TYIHIHJF.js";
14
+ import "./chunk-XAMAYRDA.js";
15
15
  import "./chunk-DL6ZILAF.js";
16
16
  import "./chunk-PBGOZMVY.js";
17
17
  import "./chunk-VRGRAQDG.js";
18
18
  import "./chunk-HGAMIPFO.js";
19
19
  import {
20
20
  getEventStore
21
- } from "./chunk-7Y3HFCTD.js";
22
- import "./chunk-5GVCNVKV.js";
23
- import "./chunk-XVWVAWSG.js";
21
+ } from "./chunk-MBLZSLPH.js";
22
+ import "./chunk-FBGWG4N6.js";
23
+ import "./chunk-DCYDTDWO.js";
24
24
  import {
25
25
  createChatMessageMessage,
26
26
  createPhaseChangedMessage,
27
27
  createSessionRunningMessage
28
- } from "./chunk-T67WWSM7.js";
28
+ } from "./chunk-C5U6NRAY.js";
29
29
  import "./chunk-BJYPTN5S.js";
30
- import "./chunk-ERFRUQQR.js";
30
+ import "./chunk-UTBDR6KM.js";
31
31
  import "./chunk-CQGTEGKL.js";
32
32
  import "./chunk-CGZHLM3K.js";
33
33
  import "./chunk-SZKEGZIB.js";
@@ -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-ZYKJQPGM.js");
64
+ const { maybeAutoCompactContext } = await import("./auto-compaction-JSXVY2CJ.js");
65
65
  await maybeAutoCompactContext({
66
66
  sessionManager,
67
67
  sessionId,
@@ -175,4 +175,4 @@ export {
175
175
  startChatSession,
176
176
  stopSessionExecution
177
177
  };
178
- //# sourceMappingURL=chat-handler-N3FYFHYQ.js.map
178
+ //# sourceMappingURL=chat-handler-45TB6QWI.js.map
@@ -2,10 +2,10 @@ import {
2
2
  SETTINGS_KEYS,
3
3
  deleteSetting,
4
4
  getSetting
5
- } from "./chunk-ROWFVGB6.js";
5
+ } from "./chunk-TYIHIHJF.js";
6
6
  import {
7
7
  getProject
8
- } from "./chunk-ZHBL5G5X.js";
8
+ } from "./chunk-XAMAYRDA.js";
9
9
  import {
10
10
  startInspectProxy
11
11
  } from "./chunk-DL6ZILAF.js";
@@ -31,7 +31,7 @@ import {
31
31
  import {
32
32
  getCurrentContextWindowId,
33
33
  getEventStore
34
- } from "./chunk-7Y3HFCTD.js";
34
+ } from "./chunk-MBLZSLPH.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-XVWVAWSG.js";
43
+ } from "./chunk-DCYDTDWO.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-T67WWSM7.js";
51
+ } from "./chunk-C5U6NRAY.js";
52
52
  import {
53
53
  AskUserInterrupt,
54
54
  askUserTool
@@ -889,13 +889,14 @@ function createToolResultEvent(messageId, toolCallId, result) {
889
889
  data: { messageId, toolCallId, result }
890
890
  };
891
891
  }
892
- function createChatDoneEvent(messageId, reason, stats) {
892
+ function createChatDoneEvent(messageId, reason, stats, agentType) {
893
893
  return {
894
894
  type: "chat.done",
895
895
  data: {
896
896
  messageId,
897
897
  reason,
898
- ...stats && { stats }
898
+ ...stats && { stats },
899
+ ...agentType && { agentType }
899
900
  }
900
901
  };
901
902
  }
@@ -1327,8 +1328,8 @@ async function deleteAgent(configDir, agentId) {
1327
1328
  }
1328
1329
 
1329
1330
  // src/server/tools/read.ts
1330
- import { readFile as readFile5, stat } from "fs/promises";
1331
- import { extname } from "path";
1331
+ import { readFile as readFile5, stat, readdir as readdir3 } from "fs/promises";
1332
+ import { extname, join as join5 } from "path";
1332
1333
 
1333
1334
  // src/server/tools/types.ts
1334
1335
  var OUTPUT_LIMITS = {
@@ -1910,13 +1911,44 @@ function detectImageType(buffer, filePath) {
1910
1911
  }
1911
1912
  return null;
1912
1913
  }
1914
+ function formatSize(bytes) {
1915
+ if (bytes < 1024) return `${bytes} B`;
1916
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
1917
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
1918
+ }
1919
+ async function listDirectory(dirPath, relativePath) {
1920
+ const entries = await readdir3(dirPath, { withFileTypes: true });
1921
+ const sorted = [...entries].sort((a, b) => {
1922
+ if (a.isDirectory() !== b.isDirectory()) {
1923
+ return a.isDirectory() ? -1 : 1;
1924
+ }
1925
+ return a.name.localeCompare(b.name);
1926
+ });
1927
+ const lines = [`${relativePath}/`];
1928
+ for (let i = 0; i < sorted.length; i++) {
1929
+ const entry = sorted[i];
1930
+ const isLast = i === sorted.length - 1;
1931
+ const prefix = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
1932
+ const suffix = entry.isDirectory() ? "/" : "";
1933
+ let sizeStr = "";
1934
+ if (!entry.isDirectory()) {
1935
+ try {
1936
+ const entryStat = await stat(join5(dirPath, entry.name));
1937
+ sizeStr = ` ${formatSize(entryStat.size).padStart(7)}`;
1938
+ } catch {
1939
+ }
1940
+ }
1941
+ lines.push(`${prefix}${entry.name}${suffix}${sizeStr}`);
1942
+ }
1943
+ return lines.join("\n");
1944
+ }
1913
1945
  var readFileTool = createTool(
1914
1946
  "read_file",
1915
1947
  {
1916
1948
  type: "function",
1917
1949
  function: {
1918
1950
  name: "read_file",
1919
- description: "Read the contents of a file. For text files: returns line-numbered content. For images (PNG, JPEG, GIF, WebP, BMP, SVG): returns base64-encoded data with MIME type metadata.",
1951
+ description: "Read the contents of a file or list directory contents. For text files: returns line-numbered content. For images (PNG, JPEG, GIF, WebP, BMP, SVG): returns base64-encoded data with MIME type metadata. For directories: returns a tree-formatted listing of entries with file sizes.",
1920
1952
  parameters: {
1921
1953
  type: "object",
1922
1954
  properties: {
@@ -1945,7 +1977,8 @@ var readFileTool = createTool(
1945
1977
  try {
1946
1978
  const stats = await stat(fullPath);
1947
1979
  if (stats.isDirectory()) {
1948
- return helpers.error(`Path is a directory, not a file: ${args.path}`);
1980
+ const listing = await listDirectory(fullPath, args.path);
1981
+ return helpers.success(listing);
1949
1982
  }
1950
1983
  if (stats.size > OUTPUT_LIMITS.read_file.maxImageBytes) {
1951
1984
  return helpers.error(
@@ -2373,6 +2406,19 @@ async function terminateProcessTree(proc, options) {
2373
2406
  }
2374
2407
  }
2375
2408
 
2409
+ // src/server/tools/shell-tail.ts
2410
+ var TAIL_END_RE = /^(.*?)\s*\|\s*tail\s+(?:-n\s+)?-?(\d+)\s*$/;
2411
+ function stripTailPipe(command) {
2412
+ const trimmed = command.trim();
2413
+ if (!trimmed) return null;
2414
+ const match = trimmed.match(TAIL_END_RE);
2415
+ if (!match) return null;
2416
+ const beforeTail = match[1];
2417
+ const tailLines = Number.parseInt(match[2], 10);
2418
+ if (tailLines <= 0) return null;
2419
+ return { command: beforeTail.trim(), tailLines };
2420
+ }
2421
+
2376
2422
  // src/server/tools/shell.ts
2377
2423
  var runCommandTool = createTool(
2378
2424
  "run_command",
@@ -2416,7 +2462,9 @@ var runCommandTool = createTool(
2416
2462
  pathsToCheck.push(resolved);
2417
2463
  }
2418
2464
  await helpers.checkPathAccess(pathsToCheck, args.command);
2419
- const result = await executeCommand(args.command, workingDir, timeout, context.signal, context.onProgress);
2465
+ const tailInfo = stripTailPipe(args.command);
2466
+ const execCommand = tailInfo ? tailInfo.command : args.command;
2467
+ const result = await executeCommand(execCommand, workingDir, timeout, context.signal, context.onProgress);
2420
2468
  let output = "";
2421
2469
  if (result.stdout) {
2422
2470
  output += result.stdout;
@@ -2429,14 +2477,19 @@ ${result.stderr}`;
2429
2477
  output += `
2430
2478
 
2431
2479
  [Exit code: ${result.exitCode}]`;
2480
+ if (tailInfo) {
2481
+ const lines = output.split("\n");
2482
+ const tailed = lines.slice(-tailInfo.tailLines);
2483
+ output = tailed.join("\n");
2484
+ }
2432
2485
  let truncated = false;
2433
2486
  if (output.length > OUTPUT_LIMITS.run_command.maxBytes) {
2434
2487
  output = output.slice(0, OUTPUT_LIMITS.run_command.maxBytes);
2435
2488
  output += "\n\n[Output truncated due to size limit]";
2436
2489
  truncated = true;
2437
2490
  }
2438
- const lines = output.split("\n").length;
2439
- if (lines > OUTPUT_LIMITS.run_command.maxLines) {
2491
+ const linesCount = output.split("\n").length;
2492
+ if (linesCount > OUTPUT_LIMITS.run_command.maxLines) {
2440
2493
  const limitedLines = output.split("\n").slice(0, OUTPUT_LIMITS.run_command.maxLines);
2441
2494
  output = limitedLines.join("\n");
2442
2495
  output += "\n\n[Output truncated due to line limit]";
@@ -2801,19 +2854,19 @@ function createToolProgressHandler(eventStore, messageId, callId, sessionId) {
2801
2854
 
2802
2855
  // src/server/skills/registry.ts
2803
2856
  import { writeFile as writeFile5, mkdir as mkdir4, unlink as unlink3 } from "fs/promises";
2804
- import { join as join5, dirname as dirname4 } from "path";
2857
+ import { join as join6, dirname as dirname4 } from "path";
2805
2858
  import { fileURLToPath as fileURLToPath2 } from "url";
2806
2859
  import matter3 from "gray-matter";
2807
2860
  var __bundleDir2 = dirname4(fileURLToPath2(import.meta.url));
2808
- var DEFAULTS_DIR2 = join5(__bundleDir2, "defaults");
2809
- var DEFAULTS_DIR_ALT2 = join5(__bundleDir2, "skill-defaults");
2861
+ var DEFAULTS_DIR2 = join6(__bundleDir2, "defaults");
2862
+ var DEFAULTS_DIR_ALT2 = join6(__bundleDir2, "skill-defaults");
2810
2863
  var SKILL_EXTENSION = ".skill.md";
2811
2864
  var SKILL_SETTING_PREFIX = "skill.enabled.";
2812
2865
  function getSkillsDir(configDir) {
2813
- return join5(configDir, "skills");
2866
+ return join6(configDir, "skills");
2814
2867
  }
2815
2868
  function getProjectSkillsDir(projectDir) {
2816
- return join5(projectDir, ".openfox", "skills");
2869
+ return join6(projectDir, ".openfox", "skills");
2817
2870
  }
2818
2871
  async function loadDefaultSkills() {
2819
2872
  let defaults = await loadItemsFromDir(DEFAULTS_DIR2, {
@@ -2883,8 +2936,8 @@ function findSkillById(skillId, skills) {
2883
2936
  return skills.find((s) => s.metadata.id === skillId);
2884
2937
  }
2885
2938
  async function skillExists(configDir, skillId, projectDir) {
2886
- if (await pathExists(join5(getSkillsDir(configDir), `${skillId}${SKILL_EXTENSION}`))) return true;
2887
- if (projectDir && await pathExists(join5(getProjectSkillsDir(projectDir), `${skillId}${SKILL_EXTENSION}`)))
2939
+ if (await pathExists(join6(getSkillsDir(configDir), `${skillId}${SKILL_EXTENSION}`))) return true;
2940
+ if (projectDir && await pathExists(join6(getProjectSkillsDir(projectDir), `${skillId}${SKILL_EXTENSION}`)))
2888
2941
  return true;
2889
2942
  return false;
2890
2943
  }
@@ -2893,7 +2946,7 @@ async function saveSkill(configDir, skill) {
2893
2946
  if (!await pathExists(skillsDir)) {
2894
2947
  await mkdir4(skillsDir, { recursive: true });
2895
2948
  }
2896
- const filePath = join5(skillsDir, `${skill.metadata.id}${SKILL_EXTENSION}`);
2949
+ const filePath = join6(skillsDir, `${skill.metadata.id}${SKILL_EXTENSION}`);
2897
2950
  const content = matter3.stringify(skill.prompt, skill.metadata);
2898
2951
  await writeFile5(filePath, content, "utf-8");
2899
2952
  }
@@ -2910,7 +2963,7 @@ async function deleteSkill(configDir, skillId) {
2910
2963
  if (isDefault) {
2911
2964
  return { success: false, reason: "Cannot delete built-in defaults" };
2912
2965
  }
2913
- const filePath = join5(getSkillsDir(configDir), `${skillId}${SKILL_EXTENSION}`);
2966
+ const filePath = join6(getSkillsDir(configDir), `${skillId}${SKILL_EXTENSION}`);
2914
2967
  try {
2915
2968
  await unlink3(filePath);
2916
2969
  deleteSetting(`${SKILL_SETTING_PREFIX}${skillId}`);
@@ -3671,7 +3724,14 @@ async function executeSubAgent(options) {
3671
3724
  disableThinking: true
3672
3725
  });
3673
3726
  const result = await consumeStreamGenerator(streamGen, (event) => {
3674
- eventStore.append(sessionId, event);
3727
+ if (event.type === "message.delta") {
3728
+ eventStore.append(sessionId, {
3729
+ ...event,
3730
+ data: { ...event.data, subAgentType }
3731
+ });
3732
+ } else {
3733
+ eventStore.append(sessionId, event);
3734
+ }
3675
3735
  });
3676
3736
  if (result.aborted) {
3677
3737
  const stats = turnMetrics.buildStats(statsIdentity, "verifier");
@@ -3683,7 +3743,7 @@ async function executeSubAgent(options) {
3683
3743
  promptContext
3684
3744
  })
3685
3745
  );
3686
- eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "stopped", stats));
3746
+ eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "stopped", stats, "sub-agent"));
3687
3747
  throw new Error("Aborted");
3688
3748
  }
3689
3749
  turnMetrics.addLLMCall(
@@ -3753,7 +3813,7 @@ async function executeSubAgent(options) {
3753
3813
  promptContext
3754
3814
  })
3755
3815
  );
3756
- eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "complete", stats));
3816
+ eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "complete", stats, "sub-agent"));
3757
3817
  break;
3758
3818
  }
3759
3819
  eventStore.append(
@@ -3788,7 +3848,7 @@ async function executeSubAgent(options) {
3788
3848
  if (onMessage) {
3789
3849
  onMessage(createChatMessageUpdatedMessage(assistantMsgId, { isStreaming: false, stats, promptContext }));
3790
3850
  }
3791
- eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "complete", stats));
3851
+ eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "complete", stats, "sub-agent"));
3792
3852
  if (onMessage) {
3793
3853
  onMessage(createChatDoneMessage(assistantMsgId, "complete", stats, "sub-agent"));
3794
3854
  }
@@ -3880,7 +3940,7 @@ var callSubAgentTool = {
3880
3940
  };
3881
3941
  }
3882
3942
  try {
3883
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-ASM4FNUG.js");
3943
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-AGVKG553.js");
3884
3944
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3885
3945
  const turnMetrics = new TurnMetrics();
3886
3946
  const result = await executeSubAgent({
@@ -4132,12 +4192,12 @@ var webFetchTool = createTool(
4132
4192
  // src/server/dev-server/manager.ts
4133
4193
  import { spawn as spawn3 } from "child_process";
4134
4194
  import { readFile as readFile7, writeFile as writeFile6, mkdir as mkdir5 } from "fs/promises";
4135
- import { resolve as resolve5, join as join6 } from "path";
4195
+ import { resolve as resolve5, join as join7 } from "path";
4136
4196
  var MAX_LOG_LINES = 2e3;
4137
4197
  var MAX_LOG_BYTES = 1e5;
4138
4198
  var getDevServerConfigPath = (workdir) => {
4139
4199
  const mode = getRuntimeConfig().mode ?? "production";
4140
- return join6(resolve5(workdir), ".openfox", `${mode === "development" ? "dev-dev" : "dev"}.json`);
4200
+ return join7(resolve5(workdir), ".openfox", `${mode === "development" ? "dev-dev" : "dev"}.json`);
4141
4201
  };
4142
4202
  var ERROR_PATTERNS = [
4143
4203
  /EADDRINUSE/,
@@ -4213,7 +4273,7 @@ var DevServerManager = class {
4213
4273
  }
4214
4274
  async saveConfig(workdir, config) {
4215
4275
  const resolved = this.resolveWorkdir(workdir);
4216
- const dirPath = join6(resolved, ".openfox");
4276
+ const dirPath = join7(resolved, ".openfox");
4217
4277
  await mkdir5(dirPath, { recursive: true });
4218
4278
  const configPath = getDevServerConfigPath(workdir);
4219
4279
  await writeFile6(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
@@ -5078,4 +5138,4 @@ export {
5078
5138
  getToolRegistryForAgent,
5079
5139
  createToolRegistry
5080
5140
  };
5081
- //# sourceMappingURL=chunk-KR7N2ONG.js.map
5141
+ //# sourceMappingURL=chunk-5LYWA56Z.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createServerMessage,
3
3
  isClientMessage
4
- } from "./chunk-ERFRUQQR.js";
4
+ } from "./chunk-UTBDR6KM.js";
5
5
 
6
6
  // src/server/ws/protocol.ts
7
7
  function enrichMessagesWithToolResults(messages) {
@@ -66,8 +66,12 @@ function createProjectListMessage(projects, correlationId) {
66
66
  function createGitStatusMessage(branch, diffFiles, correlationId) {
67
67
  return createServerMessage("git.status", { branch, diff: { files: diffFiles } }, correlationId);
68
68
  }
69
- function createChatDeltaMessage(messageId, content) {
70
- return createServerMessage("chat.delta", { messageId, content });
69
+ function createChatDeltaMessage(messageId, content, subAgentType) {
70
+ return createServerMessage("chat.delta", {
71
+ messageId,
72
+ content,
73
+ ...subAgentType ? { subAgentType } : {}
74
+ });
71
75
  }
72
76
  function createChatThinkingMessage(messageId, content) {
73
77
  return createServerMessage("chat.thinking", { messageId, content });
@@ -87,9 +91,6 @@ function createChatToolOutputMessage(messageId, callId, output, stream) {
87
91
  function createChatTodoMessage(todos) {
88
92
  return createServerMessage("chat.todo", { todos });
89
93
  }
90
- function createChatSummaryMessage(summary) {
91
- return createServerMessage("chat.summary", { summary });
92
- }
93
94
  function createChatProgressMessage(message, phase) {
94
95
  return createServerMessage("chat.progress", { message, ...phase ? { phase } : {} });
95
96
  }
@@ -179,7 +180,7 @@ function storedEventToServerMessage(event) {
179
180
  }
180
181
  case "message.delta": {
181
182
  const data = event.data;
182
- return createChatDeltaMessage(data.messageId, data.content);
183
+ return createChatDeltaMessage(data.messageId, data.content, data.subAgentType);
183
184
  }
184
185
  case "message.thinking": {
185
186
  const data = event.data;
@@ -265,7 +266,7 @@ function storedEventToServerMessage(event) {
265
266
  }
266
267
  case "chat.done": {
267
268
  const data = event.data;
268
- return createChatDoneMessage(data.messageId, data.reason, data.stats);
269
+ return createChatDoneMessage(data.messageId, data.reason, data.stats, data.agentType);
269
270
  }
270
271
  case "chat.error": {
271
272
  const data = event.data;
@@ -304,7 +305,6 @@ export {
304
305
  createChatToolResultMessage,
305
306
  createChatToolOutputMessage,
306
307
  createChatTodoMessage,
307
- createChatSummaryMessage,
308
308
  createChatProgressMessage,
309
309
  createChatFormatRetryMessage,
310
310
  createChatMessageMessage,
@@ -326,4 +326,4 @@ export {
326
326
  createQueueStateMessage,
327
327
  storedEventToServerMessage
328
328
  };
329
- //# sourceMappingURL=chunk-T67WWSM7.js.map
329
+ //# sourceMappingURL=chunk-C5U6NRAY.js.map
@@ -1,4 +1,8 @@
1
1
  // src/server/events/apply-events.ts
2
+ function markComplete(msg, reason) {
3
+ msg.isComplete = true;
4
+ msg.completeReason = reason;
5
+ }
2
6
  function extractMessageOptionalFields(data) {
3
7
  return {
4
8
  ...data.tokenCount !== void 0 && { tokenCount: data.tokenCount },
@@ -144,20 +148,14 @@ function applyEvents(initialMessages, events, options) {
144
148
  const data = event.data;
145
149
  const msg = messages.get(data.messageId);
146
150
  if (msg) {
147
- ;
148
- msg.isComplete = true;
149
- msg.completeReason = data.reason;
151
+ markComplete(msg, data.reason);
150
152
  }
151
153
  break;
152
154
  }
153
155
  case "chat.error": {
154
- const data = event.data;
155
156
  for (const msg of messages.values()) {
156
157
  if (msg.role === "assistant" && !("isComplete" in msg)) {
157
- ;
158
- msg.isComplete = true;
159
- msg.completeReason = "error";
160
- msg.stats = { error: data.error };
158
+ markComplete(msg, "error");
161
159
  }
162
160
  }
163
161
  break;
@@ -880,4 +878,4 @@ export {
880
878
  getMessagesForWindow,
881
879
  buildContextMessagesFromMessages
882
880
  };
883
- //# sourceMappingURL=chunk-XVWVAWSG.js.map
881
+ //# sourceMappingURL=chunk-DCYDTDWO.js.map
@@ -81,10 +81,6 @@ function runMigrations(db2) {
81
81
  logger.info("Migrating sessions table: adding is_running column");
82
82
  db2.exec(`ALTER TABLE sessions ADD COLUMN is_running INTEGER NOT NULL DEFAULT 0`);
83
83
  }
84
- if (!columnNames.includes("summary")) {
85
- logger.info("Migrating sessions table: adding summary column");
86
- db2.exec(`ALTER TABLE sessions ADD COLUMN summary TEXT`);
87
- }
88
84
  if (!columnNames.includes("workflow_phase")) {
89
85
  logger.info("Migrating sessions table: adding workflow_phase column");
90
86
  db2.exec(`ALTER TABLE sessions ADD COLUMN workflow_phase TEXT NOT NULL DEFAULT 'plan'`);
@@ -172,4 +168,4 @@ export {
172
168
  initDatabase,
173
169
  getDatabase
174
170
  };
175
- //# sourceMappingURL=chunk-5GVCNVKV.js.map
171
+ //# sourceMappingURL=chunk-FBGWG4N6.js.map
@@ -178,7 +178,7 @@ async function runCli(options) {
178
178
  case "update": {
179
179
  const __filename = fileURLToPath(import.meta.url);
180
180
  const __dirname = dirname(__filename);
181
- const updateScriptPath = join(__dirname, "update.sh");
181
+ const updateScriptPath = join(__dirname, "cli", "update.sh");
182
182
  const result = spawnSync(updateScriptPath, [], { shell: true, stdio: "inherit" });
183
183
  if (result.status !== 0) {
184
184
  process.exit(result.status ?? 1);
@@ -191,7 +191,7 @@ async function runCli(options) {
191
191
  if (!configExists) {
192
192
  await runNetworkSetup(mode);
193
193
  }
194
- const { runServe } = await import("./serve-65V7N6ZV.js");
194
+ const { runServe } = await import("./serve-5B36ZPK3.js");
195
195
  const serveOptions = { mode };
196
196
  if (values.port) serveOptions.port = parseInt(values.port);
197
197
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -203,4 +203,4 @@ async function runCli(options) {
203
203
  export {
204
204
  runCli
205
205
  };
206
- //# sourceMappingURL=chunk-6UBQ4BNN.js.map
206
+ //# sourceMappingURL=chunk-L6LTCUCO.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDatabase
3
- } from "./chunk-5GVCNVKV.js";
3
+ } from "./chunk-FBGWG4N6.js";
4
4
  import {
5
5
  buildContextMessagesFromEventHistory,
6
6
  buildMessagesFromStoredEvents,
@@ -9,7 +9,7 @@ import {
9
9
  foldSessionState,
10
10
  spreadOptionalMessageFields,
11
11
  stripPromptContextMessages
12
- } from "./chunk-XVWVAWSG.js";
12
+ } from "./chunk-DCYDTDWO.js";
13
13
  import {
14
14
  getRuntimeConfig
15
15
  } from "./chunk-CGZHLM3K.js";
@@ -618,7 +618,6 @@ function createSession(projectId, workdir, title, providerId, providerModel) {
618
618
  mode: "planner",
619
619
  phase: "plan",
620
620
  isRunning: false,
621
- summary: null,
622
621
  providerId: providerId ?? null,
623
622
  providerModel: providerModel ?? null,
624
623
  createdAt: now,
@@ -647,17 +646,7 @@ function getSession(id) {
647
646
  return null;
648
647
  }
649
648
  return {
650
- id: row.id,
651
- projectId: row.project_id,
652
- workdir: row.workdir,
653
- mode: row.mode ?? "planner",
654
- phase: row.workflow_phase ?? "plan",
655
- isRunning: Boolean(row.is_running),
656
- summary: row.summary ?? null,
657
- providerId: row.provider_id ?? null,
658
- providerModel: row.provider_model ?? null,
659
- createdAt: row.created_at,
660
- updatedAt: row.updated_at,
649
+ ...mapSessionBase(row),
661
650
  messages: [],
662
651
  criteria: [],
663
652
  contextWindows: [],
@@ -698,15 +687,6 @@ function updateSessionRunning(id, isRunning) {
698
687
  `
699
688
  ).run(isRunning ? 1 : 0, now, id);
700
689
  }
701
- function updateSessionSummary(id, summary) {
702
- const db = getDatabase();
703
- const now = (/* @__PURE__ */ new Date()).toISOString();
704
- db.prepare(
705
- `
706
- UPDATE sessions SET summary = ?, updated_at = ? WHERE id = ?
707
- `
708
- ).run(summary, now, id);
709
- }
710
690
  function updateSessionMetadata(id, metadata) {
711
691
  const db = getDatabase();
712
692
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -801,11 +781,10 @@ function deleteSession(id) {
801
781
  const db = getDatabase();
802
782
  db.prepare("DELETE FROM sessions WHERE id = ?").run(id);
803
783
  }
804
- function mapSessionSummaryRow(row) {
784
+ function mapSessionBase(row) {
805
785
  return {
806
786
  id: row.id,
807
787
  projectId: row.project_id,
808
- ...row.title ? { title: row.title } : {},
809
788
  workdir: row.workdir,
810
789
  mode: row.mode ?? "planner",
811
790
  phase: row.workflow_phase ?? "plan",
@@ -813,7 +792,13 @@ function mapSessionSummaryRow(row) {
813
792
  providerId: row.provider_id ?? null,
814
793
  providerModel: row.provider_model ?? null,
815
794
  createdAt: row.created_at,
816
- updatedAt: row.updated_at,
795
+ updatedAt: row.updated_at
796
+ };
797
+ }
798
+ function mapSessionSummaryRow(row) {
799
+ return {
800
+ ...mapSessionBase(row),
801
+ ...row.title ? { title: row.title } : {},
817
802
  criteriaCount: 0,
818
803
  criteriaCompleted: 0,
819
804
  messageCount: row.message_count
@@ -1245,7 +1230,6 @@ export {
1245
1230
  updateSessionProvider,
1246
1231
  updateSessionDangerLevel,
1247
1232
  updateSessionRunning,
1248
- updateSessionSummary,
1249
1233
  updateSessionMetadata,
1250
1234
  listSessions,
1251
1235
  listSessionsByProject,
@@ -1283,4 +1267,4 @@ export {
1283
1267
  compactContext,
1284
1268
  getRecentUserPromptsForSession
1285
1269
  };
1286
- //# sourceMappingURL=chunk-7Y3HFCTD.js.map
1270
+ //# sourceMappingURL=chunk-MBLZSLPH.js.map
@@ -13,14 +13,14 @@ import {
13
13
  getToolRegistryForAgent,
14
14
  loadAllAgentsDefault,
15
15
  runTopLevelAgentLoop
16
- } from "./chunk-KR7N2ONG.js";
16
+ } from "./chunk-5LYWA56Z.js";
17
17
  import {
18
18
  getCurrentContextWindowId,
19
19
  getEventStore
20
- } from "./chunk-7Y3HFCTD.js";
20
+ } from "./chunk-MBLZSLPH.js";
21
21
  import {
22
22
  buildSnapshotFromSessionState
23
- } from "./chunk-XVWVAWSG.js";
23
+ } from "./chunk-DCYDTDWO.js";
24
24
  import {
25
25
  logger
26
26
  } from "./chunk-K44MW7JJ.js";
@@ -327,4 +327,4 @@ export {
327
327
  runBuilderTurn,
328
328
  runVerifierTurn
329
329
  };
330
- //# sourceMappingURL=chunk-K7F73QLL.js.map
330
+ //# sourceMappingURL=chunk-NASF624P.js.map