openfox 2.0.112 → 2.0.113

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 (85) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +1 -0
  3. package/dist/CHANGELOG.md +27 -0
  4. package/dist/{chat-handler-BYXZIIV3.js → chat-handler-PEK5JDHO.js} +24 -24
  5. package/dist/{chunk-3UILDGOO.js → chunk-3R43CMLS.js} +8 -8
  6. package/dist/{chunk-ERYUSG5C.js → chunk-43M7QZMX.js} +2 -2
  7. package/dist/{chunk-SYJMUIRC.js → chunk-4NMGX5F2.js} +2 -2
  8. package/dist/{chunk-RAKPI4OE.js → chunk-5VYSKVZT.js} +28 -25
  9. package/dist/{chunk-FFPCVN5M.js → chunk-6UPBZ2ZR.js} +4 -4
  10. package/dist/{chunk-C5NQF2K4.js → chunk-AZFZE36I.js} +15 -6
  11. package/dist/chunk-B2PHPBFU.js +7 -0
  12. package/dist/{chunk-P45RJGOT.js → chunk-BKCW3JLL.js} +1 -1
  13. package/dist/{chunk-N4RTAGFY.js → chunk-BNFGDTEU.js} +2 -2
  14. package/dist/{chunk-JNHKKUGJ.js → chunk-BYSUSSSC.js} +2 -2
  15. package/dist/{chunk-NB2D6I64.js → chunk-CP44U7BT.js} +5 -5
  16. package/dist/{chunk-SVJFMZ2Q.js → chunk-EC5T5A6O.js} +11 -4
  17. package/dist/{chunk-RKMP74BB.js → chunk-EMI3YYLP.js} +3 -3
  18. package/dist/{chunk-BOSKQI62.js → chunk-FF2EKUQO.js} +4 -4
  19. package/dist/{chunk-XCK5IBO4.js → chunk-HGOTZWON.js} +41 -19
  20. package/dist/{chunk-XWNCKIPO.js → chunk-HKD4IMOE.js} +2 -2
  21. package/dist/{chunk-C372UH7N.js → chunk-KSXCOHHW.js} +18 -20
  22. package/dist/{chunk-Z56SEG4Z.js → chunk-O2YSYW2F.js} +6 -6
  23. package/dist/{chunk-UAF2FOI5.js → chunk-ONONXV3N.js} +7 -7
  24. package/dist/{chunk-LCQ5AN6Y.js → chunk-PWXBIUEY.js} +5 -1
  25. package/dist/{chunk-33Q7LCVD.js → chunk-R2MTWC7C.js} +2 -2
  26. package/dist/{chunk-JDT63SSP.js → chunk-SNLLOXCM.js} +3 -3
  27. package/dist/{chunk-FSYRANYR.js → chunk-TCGWZBTS.js} +3 -4
  28. package/dist/{chunk-IYTDCPEQ.js → chunk-TEQEDOWI.js} +206 -143
  29. package/dist/{chunk-PCC4DBPF.js → chunk-V4664YKR.js} +2 -2
  30. package/dist/{chunk-FR5LUTLQ.js → chunk-VGRVPYZ5.js} +10 -6
  31. package/dist/{chunk-RT2A2RRL.js → chunk-WWTYWLDM.js} +2 -2
  32. package/dist/{chunk-6FPGJR7O.js → chunk-XQR76MQ5.js} +2 -2
  33. package/dist/{chunk-RISQXU32.js → chunk-Y64PEWKP.js} +2 -2
  34. package/dist/{chunk-QGXLZZBS.js → chunk-YB6WYVNY.js} +2 -2
  35. package/dist/{chunk-SDGNV45R.js → chunk-YGPPFVLJ.js} +10 -10
  36. package/dist/cli/dev.js +1 -1
  37. package/dist/cli/index.js +1 -1
  38. package/dist/{client-QNQTX5EA.js → client-3LJGD6KY.js} +5 -5
  39. package/dist/{compactor-X2KZ3XFU.js → compactor-ZBNKANHV.js} +10 -10
  40. package/dist/{config-TW5FHQEM.js → config-EAB3V4QK.js} +2 -2
  41. package/dist/{dynamic-context-ZRQO2FJN.js → dynamic-context-F2XTQJR5.js} +9 -9
  42. package/dist/{events-Y6XXQYFG.js → events-224IO5NJ.js} +7 -7
  43. package/dist/{folding-Z4GNWRC3.js → folding-YTTTVS56.js} +5 -5
  44. package/dist/http-client-YC3UA5OZ.js +11 -0
  45. package/dist/{inspect-proxy-N42Z5TOG.js → inspect-proxy-B7LGGTM7.js} +4 -4
  46. package/dist/{manager-HCMDFEQH.js → manager-4QGXI6WZ.js} +5 -5
  47. package/dist/{model-overrides-O3ZYKFP7.js → model-overrides-OY2YKUNV.js} +4 -4
  48. package/dist/{orchestrator-P5EUMC7E.js → orchestrator-JKBY7B3P.js} +23 -23
  49. package/dist/package.json +5 -4
  50. package/dist/{path-security-525YLND3.js → path-security-PFMZY7IA.js} +11 -11
  51. package/dist/{platform-MEQUWG6U.js → platform-QNGCKX4L.js} +4 -4
  52. package/dist/{processor-UN4H4V7F.js → processor-NYPJ5PFA.js} +23 -23
  53. package/dist/{project-creator-BVA55HY6.js → project-creator-AWP2JUFS.js} +3 -3
  54. package/dist/{projects-PQXME5S4.js → projects-C4353IQK.js} +3 -3
  55. package/dist/{protocol-D6MISQyz.d.ts → protocol-CBT1d98i.d.ts} +3 -1
  56. package/dist/{protocol-FTHAR2YL.js → protocol-LZZ7C4VQ.js} +3 -3
  57. package/dist/provider/index.d.ts +4 -4
  58. package/dist/{provider-3R4X62LW.js → provider-PIRPN2CC.js} +8 -8
  59. package/dist/{provider-manager-W5N4XRE5.js → provider-manager-GNEPR6UN.js} +6 -6
  60. package/dist/{registry-74KPZ5NV.js → registry-VCKDSVKA.js} +4 -4
  61. package/dist/{serve-WHFUNQ6Z.js → serve-6DRHQLCG.js} +31 -31
  62. package/dist/server/index.d.ts +7 -4
  63. package/dist/server/index.js +30 -30
  64. package/dist/server-HUHFJW7U.js +48 -0
  65. package/dist/{session-overrides-XH6I3COP.js → session-overrides-RNKV35MU.js} +6 -6
  66. package/dist/{sessions-D772YTWL.js → sessions-D5CEPQGU.js} +7 -5
  67. package/dist/{settings-KO6DSJLD.js → settings-BNRNX6IW.js} +3 -3
  68. package/dist/shared/index.d.ts +3 -3
  69. package/dist/shared/index.js +1 -1
  70. package/dist/skill-defaults/workflows/SKILL.md +499 -0
  71. package/dist/{tools-HTUTYMKI.js → tools-2B363F7L.js} +21 -21
  72. package/dist/{types-BMEOlLT0.d.ts → types-BAxh20ZL.d.ts} +8 -1
  73. package/dist/{types-D0TgGL3t.d.ts → types-cVfqOj6M.d.ts} +1 -1
  74. package/dist/{update-BRUFGGTW.js → update-IQMRYN7J.js} +2 -2
  75. package/dist/web/assets/{index-nS1p0g8O.css → index-CjWC6EQ4.css} +1 -1
  76. package/dist/web/assets/index-DBUtUSHK.js +323 -0
  77. package/dist/web/index.html +2 -2
  78. package/dist/web/sw.js +1 -1
  79. package/dist/workflow-defaults/default.workflow.json +41 -3
  80. package/dist/{workspace-YDUQZ3HC.js → workspace-YUNHV4WS.js} +4 -4
  81. package/package.json +5 -4
  82. package/dist/chunk-P5AA7OYJ.js +0 -7
  83. package/dist/http-client-2GDKHZIG.js +0 -11
  84. package/dist/server-7MOOJR2N.js +0 -48
  85. package/dist/web/assets/index-Dukvfqm-.js +0 -323
@@ -22,6 +22,7 @@ import {
22
22
  loadProjectWorkflows,
23
23
  loadServerAuthConfig,
24
24
  loadUserWorkflows,
25
+ normalizeWorkflowScope,
25
26
  requiresAuth,
26
27
  saveWorkflow,
27
28
  saveWorkflowToProject,
@@ -29,7 +30,7 @@ import {
29
30
  tokenFromPassword,
30
31
  verifyPassword,
31
32
  workflowExists
32
- } from "./chunk-XCK5IBO4.js";
33
+ } from "./chunk-HGOTZWON.js";
33
34
  import {
34
35
  openFolder
35
36
  } from "./chunk-WLJJRX22.js";
@@ -42,7 +43,7 @@ import {
42
43
  setMcpManagerForTools,
43
44
  setMcpTools,
44
45
  setNotifyMcpServersChanged
45
- } from "./chunk-RAKPI4OE.js";
46
+ } from "./chunk-5VYSKVZT.js";
46
47
  import {
47
48
  deleteOwnedSkill,
48
49
  deleteProjectSkill,
@@ -61,12 +62,12 @@ import {
61
62
  setSkillEnabled,
62
63
  skillExists,
63
64
  updateOwnedSkill
64
- } from "./chunk-BOSKQI62.js";
65
+ } from "./chunk-FF2EKUQO.js";
65
66
  import {
66
67
  ALWAYS_ALLOWED,
67
68
  ALWAYS_ALLOWED_FOR_SUBAGENTS,
68
69
  TOP_LEVEL_ONLY_TOOLS
69
- } from "./chunk-XWNCKIPO.js";
70
+ } from "./chunk-HKD4IMOE.js";
70
71
  import {
71
72
  createMcpTools
72
73
  } from "./chunk-JE7LW7Y6.js";
@@ -85,11 +86,11 @@ import {
85
86
  validateRef,
86
87
  validateWorkspaceName,
87
88
  workspaceExists
88
- } from "./chunk-FR5LUTLQ.js";
89
+ } from "./chunk-VGRVPYZ5.js";
89
90
  import {
90
91
  getSessionDisabledServers,
91
92
  setSessionDisabledServers
92
- } from "./chunk-JDT63SSP.js";
93
+ } from "./chunk-SNLLOXCM.js";
93
94
  import {
94
95
  emitAssistantMessageStart,
95
96
  emitContextState,
@@ -106,15 +107,15 @@ import {
106
107
  getEventStore,
107
108
  getSessionState,
108
109
  initEventStore
109
- } from "./chunk-NB2D6I64.js";
110
+ } from "./chunk-CP44U7BT.js";
110
111
  import {
111
112
  createContextStateMessage,
112
113
  toClientSession
113
- } from "./chunk-SYJMUIRC.js";
114
+ } from "./chunk-4NMGX5F2.js";
114
115
  import {
115
116
  getPathSeparator,
116
117
  isAbsolutePath
117
- } from "./chunk-N4RTAGFY.js";
118
+ } from "./chunk-BNFGDTEU.js";
118
119
  import {
119
120
  EventEmitter
120
121
  } from "./chunk-JURM3RPZ.js";
@@ -123,15 +124,15 @@ import {
123
124
  getAgentModelOverrides,
124
125
  resolveLLMClientForAgent,
125
126
  setAgentModelOverride
126
- } from "./chunk-RISQXU32.js";
127
+ } from "./chunk-Y64PEWKP.js";
127
128
  import {
128
129
  getProject,
129
130
  getProjectByWorkdir,
130
131
  updateProject
131
- } from "./chunk-6FPGJR7O.js";
132
+ } from "./chunk-XQR76MQ5.js";
132
133
  import {
133
134
  VERSION
134
- } from "./chunk-P5AA7OYJ.js";
135
+ } from "./chunk-B2PHPBFU.js";
135
136
  import {
136
137
  clearWorkflowExecution,
137
138
  createSession,
@@ -144,6 +145,7 @@ import {
144
145
  listSessions,
145
146
  listSessionsByProject,
146
147
  listSessionsLimited,
148
+ toggleFavorite,
147
149
  updateSessionBranch,
148
150
  updateSessionCachedPrompt,
149
151
  updateSessionDangerLevel,
@@ -153,7 +155,7 @@ import {
153
155
  updateSessionRunning,
154
156
  updateSessionWorkdir,
155
157
  updateWorkflowExecutionStatus
156
- } from "./chunk-C5NQF2K4.js";
158
+ } from "./chunk-AZFZE36I.js";
157
159
  import {
158
160
  agentExists,
159
161
  deleteAgent,
@@ -176,13 +178,13 @@ import {
176
178
  saveAgentToProject,
177
179
  saveItemToDir,
178
180
  setRuntimeConfig
179
- } from "./chunk-JNHKKUGJ.js";
181
+ } from "./chunk-BYSUSSSC.js";
180
182
  import {
181
183
  createProviderManager,
182
184
  detectModel,
183
185
  getLlmStatus,
184
186
  parseDefaultModelSelection
185
- } from "./chunk-FSYRANYR.js";
187
+ } from "./chunk-TCGWZBTS.js";
186
188
  import {
187
189
  getModelProfile
188
190
  } from "./chunk-V4IE7HJY.js";
@@ -195,22 +197,22 @@ import {
195
197
  import {
196
198
  SessionNotFoundError,
197
199
  WorkspaceInUseError
198
- } from "./chunk-PCC4DBPF.js";
200
+ } from "./chunk-V4664YKR.js";
199
201
  import {
200
202
  deleteSetting,
201
203
  getSetting,
202
204
  setSetting
203
- } from "./chunk-RT2A2RRL.js";
205
+ } from "./chunk-WWTYWLDM.js";
204
206
  import {
205
207
  initDatabase
206
- } from "./chunk-LCQ5AN6Y.js";
208
+ } from "./chunk-PWXBIUEY.js";
207
209
  import {
208
210
  logger,
209
211
  setLogLevel
210
212
  } from "./chunk-K44MW7JJ.js";
211
213
  import {
212
214
  createServerMessage
213
- } from "./chunk-P45RJGOT.js";
215
+ } from "./chunk-BKCW3JLL.js";
214
216
  import {
215
217
  getGlobalConfigDir
216
218
  } from "./chunk-CQGTEGKL.js";
@@ -3377,20 +3379,24 @@ var SessionManager = class {
3377
3379
  /**
3378
3380
  * Set current context size (for token tracking).
3379
3381
  * Emits a context.state event with the real promptTokens from the LLM.
3382
+ * Stores promptTokens + completionTokens so the tracked size reflects the
3383
+ * true context occupancy — the last call's output is re-fed into the next
3384
+ * request as an assistant message, so it must count toward the budget.
3380
3385
  * maxTokens comes from providerManager.getCurrentModelContext() - the currently selected model's limit.
3381
3386
  */
3382
- setCurrentContextSize(sessionId, promptTokens, subAgentId) {
3387
+ setCurrentContextSize(sessionId, promptTokens, completionTokens = 0, subAgentId) {
3383
3388
  const state = getSessionState(sessionId, this.providerManager.getCurrentModelContext());
3384
3389
  const maxTokens = this.providerManager.getCurrentModelContext();
3390
+ const currentTokens = promptTokens + completionTokens;
3385
3391
  const compactionCount = state?.contextState.compactionCount ?? 0;
3386
3392
  const dynamicContextChanged = this.getDynamicContextChanged(sessionId);
3387
3393
  emitContextState(
3388
3394
  sessionId,
3389
- promptTokens,
3395
+ currentTokens,
3390
3396
  maxTokens,
3391
3397
  compactionCount,
3392
- isInDangerZone(promptTokens, maxTokens),
3393
- canCompact(promptTokens, maxTokens),
3398
+ isInDangerZone(currentTokens, maxTokens),
3399
+ canCompact(currentTokens, maxTokens),
3394
3400
  subAgentId,
3395
3401
  dynamicContextChanged
3396
3402
  );
@@ -4086,6 +4092,16 @@ function resolveProjectDir(req, fallback) {
4086
4092
  const trimmed = workdir.trim();
4087
4093
  return trimmed ? trimmed : fallback;
4088
4094
  }
4095
+ function resolveScope(req) {
4096
+ const scope = req.query["scope"];
4097
+ return normalizeWorkflowScope(typeof scope === "string" ? scope : void 0);
4098
+ }
4099
+ async function loadItemsForScope(config3, configDir, projectDir, scope) {
4100
+ if (scope === "builtin") return config3.loadDefaults();
4101
+ if (scope === "user") return config3.loadUser(configDir);
4102
+ if (scope === "project") return projectDir ? config3.loadProject(projectDir) : [];
4103
+ return config3.loadAll(configDir, projectDir);
4104
+ }
4089
4105
  var ID_REGEX = /^[a-z0-9-]+$/;
4090
4106
  function validateNameIdPrompt(body) {
4091
4107
  const meta = body["metadata"];
@@ -4115,10 +4131,12 @@ function createCrudRoutes(config3, configDir, projectDir) {
4115
4131
  const userOverrideIds = computeOverrideIds(defaults, userItems);
4116
4132
  const projectOverrideIds = computeOverrideIds(defaults, projectItems);
4117
4133
  const extra = config3.extraGetData ? await config3.extraGetData(effectiveProjectDir) : {};
4134
+ const annotate = (item, scope) => ({ ...item, scope });
4135
+ const mapWithScope = (items, scope) => config3.annotateScope ? items.map((i) => annotate(config3.mapToResponse(i), scope)) : items.map(config3.mapToResponse);
4118
4136
  res.json({
4119
- defaults: defaults.map(config3.mapToResponse),
4120
- userItems: userItems.map(config3.mapToResponse),
4121
- projectItems: projectItems.map(config3.mapToResponse),
4137
+ defaults: mapWithScope(defaults, "builtin"),
4138
+ userItems: mapWithScope(userItems, "user"),
4139
+ projectItems: mapWithScope(projectItems, "project"),
4122
4140
  overrideIds: [...userOverrideIds, ...projectOverrideIds],
4123
4141
  ...extra
4124
4142
  });
@@ -4139,7 +4157,8 @@ function createCrudRoutes(config3, configDir, projectDir) {
4139
4157
  router.get("/:id", async (req, res) => {
4140
4158
  const { id } = req.params;
4141
4159
  const effectiveProjectDir = resolveProjectDir(req, projectDir);
4142
- const items = await config3.loadAll(configDir, effectiveProjectDir);
4160
+ const scope = config3.annotateScope ? resolveScope(req) : "auto";
4161
+ const items = await loadItemsForScope(config3, configDir, effectiveProjectDir, scope);
4143
4162
  const item = config3.findById(id, items);
4144
4163
  if (!item) {
4145
4164
  return res.status(404).json({ error: "Not found" });
@@ -4185,7 +4204,8 @@ function createCrudRoutes(config3, configDir, projectDir) {
4185
4204
  ...body,
4186
4205
  metadata: { ...existing.metadata, ...meta, id }
4187
4206
  };
4188
- const isProject = await isProjectItem(effectiveProjectDir, config3.dirName, id, config3.ext);
4207
+ const scope = config3.annotateScope ? resolveScope(req) : "auto";
4208
+ const isProject = scope === "project" ? true : scope === "user" ? false : await isProjectItem(effectiveProjectDir, config3.dirName, id, config3.ext);
4189
4209
  if (isProject) {
4190
4210
  await config3.saveToProject(effectiveProjectDir, updated);
4191
4211
  } else {
@@ -4196,17 +4216,13 @@ function createCrudRoutes(config3, configDir, projectDir) {
4196
4216
  router.delete("/:id", async (req, res) => {
4197
4217
  const { id } = req.params;
4198
4218
  const effectiveProjectDir = resolveProjectDir(req, projectDir);
4199
- const isProject = await isProjectItem(effectiveProjectDir, config3.dirName, id, config3.ext);
4200
- if (isProject) {
4201
- const result2 = await config3.deleteProject(effectiveProjectDir, id);
4202
- if (!result2.success) {
4203
- return res.status(500).json({ error: "Failed to delete project item" });
4204
- }
4205
- return res.json({ success: true });
4206
- }
4207
- const result = await config3.delete(configDir, id);
4219
+ const scope = config3.annotateScope ? resolveScope(req) : "auto";
4220
+ const target = scope === "project" || scope === "user" ? scope : await isProjectItem(effectiveProjectDir, config3.dirName, id, config3.ext) ? "project" : "user";
4221
+ const result = target === "project" ? await config3.deleteProject(effectiveProjectDir, id) : await config3.delete(configDir, id);
4208
4222
  if (!result.success) {
4209
- return res.status(403).json({ error: result.reason ?? "Cannot delete this item" });
4223
+ return res.status(target === "project" ? 500 : 403).json({
4224
+ error: target === "project" ? "Failed to delete project item" : result.reason ?? "Cannot delete this item"
4225
+ });
4210
4226
  }
4211
4227
  res.json({ success: true });
4212
4228
  });
@@ -4626,6 +4642,7 @@ function createWorkflowRoutes(configDir, config3, projectDir) {
4626
4642
  exists: workflowExists,
4627
4643
  isDefault: isDefaultWorkflow,
4628
4644
  getDefaultIds: getDefaultWorkflowIds,
4645
+ annotateScope: true,
4629
4646
  validateCreate: (body) => {
4630
4647
  const steps = body["steps"];
4631
4648
  if (!Array.isArray(steps) || steps.length === 0) return "Missing required fields: metadata.id, steps";
@@ -4753,7 +4770,7 @@ function createDevServerRoutes() {
4753
4770
  import { Router as Router5 } from "express";
4754
4771
  import { stat as stat2, mkdir as mkdir4, readdir, access as access3 } from "fs/promises";
4755
4772
  import { constants as constants3 } from "fs";
4756
- import { resolve as resolve4, isAbsolute as isAbsolute3, join as join6 } from "path";
4773
+ import { resolve as resolve4, isAbsolute as isAbsolute3, join as join6, win32 } from "path";
4757
4774
 
4758
4775
  // src/shared/workspace.ts
4759
4776
  var BLOCKED_EXACT_PATHS = [
@@ -4774,15 +4791,26 @@ var BLOCKED_EXACT_PATHS = [
4774
4791
  "/media"
4775
4792
  ];
4776
4793
  var BLOCKED_VIRTUAL_FS_PREFIXES = ["/proc/", "/sys/", "/dev/", "/boot/", "/etc/", "/lost+found/"];
4794
+ var WINDOWS_DRIVE_ROOT = /^[a-zA-Z]:$/;
4777
4795
  function getRootDirBlockReason(path, exactPaths = BLOCKED_EXACT_PATHS, virtualFsPrefixes = BLOCKED_VIRTUAL_FS_PREFIXES) {
4778
4796
  if (!path) return null;
4779
- const normalized = path.replace(/\/+$/, "") || "/";
4797
+ const normalized = path.replace(/[\\/]+$/, "") || "/";
4798
+ if (WINDOWS_DRIVE_ROOT.test(normalized)) return "exact";
4780
4799
  if (exactPaths.includes(normalized)) return "exact";
4781
4800
  for (const prefix of virtualFsPrefixes) {
4782
4801
  if (normalized.startsWith(prefix)) return "virtual_fs";
4783
4802
  }
4784
4803
  return null;
4785
4804
  }
4805
+ function formatRootDir(path) {
4806
+ const trimmed = path.replace(/[\\/]+$/, "");
4807
+ if (!trimmed) return "/";
4808
+ return WINDOWS_DRIVE_ROOT.test(trimmed) ? `${trimmed}\\` : trimmed;
4809
+ }
4810
+ function suggestRootDirChild(path, child) {
4811
+ const base = formatRootDir(path);
4812
+ return /[\\/]$/.test(base) ? `${base}${child}` : `${base}/${child}`;
4813
+ }
4786
4814
 
4787
4815
  // src/server/routes/workspace-config.ts
4788
4816
  async function isWritable(path) {
@@ -4796,6 +4824,11 @@ async function isWritable(path) {
4796
4824
  function resolveRootDir(rootDir, workdir) {
4797
4825
  return isAbsolute3(rootDir) ? rootDir : resolve4(workdir, rootDir);
4798
4826
  }
4827
+ function isSameDir(a, b) {
4828
+ if (process.platform !== "win32") return a.replace(/\/+$/, "") === b.replace(/\/+$/, "");
4829
+ const normalize = (p) => win32.normalize(p).replace(/\\+$/, "").toLowerCase();
4830
+ return normalize(a) === normalize(b);
4831
+ }
4799
4832
  async function checkDirExists(path) {
4800
4833
  try {
4801
4834
  const st = await stat2(path);
@@ -4865,7 +4898,7 @@ function createWorkspaceConfigRoutes(sessionManager) {
4865
4898
  const trimmed = rootDir.trim();
4866
4899
  if (trimmed) {
4867
4900
  const resolvedPath = resolveRootDir(trimmed, workdir);
4868
- const displayPath = resolvedPath.replace(/\/+$/, "") || "/";
4901
+ const displayPath = formatRootDir(resolvedPath);
4869
4902
  const blockReason = getRootDirBlockReason(resolvedPath);
4870
4903
  if (blockReason === "exact") {
4871
4904
  return res.status(400).json({ error: `Cannot use "${displayPath}" directly as workspace root. Use a subdirectory instead.` });
@@ -4921,10 +4954,10 @@ function createWorkspaceConfigRoutes(sessionManager) {
4921
4954
  return res.status(400).json({ error: "workdir is required" });
4922
4955
  }
4923
4956
  const resolvedPath = resolveRootDir(rootDir, workdir);
4924
- const displayPath = resolvedPath.replace(/\/+$/, "") || "/";
4957
+ const displayPath = formatRootDir(resolvedPath);
4925
4958
  const blockReason = getRootDirBlockReason(resolvedPath);
4926
4959
  if (blockReason === "exact") {
4927
- const suggestion = typeof projectName === "string" ? `${displayPath}/${projectName}` : void 0;
4960
+ const suggestion = typeof projectName === "string" ? suggestRootDirChild(resolvedPath, projectName) : void 0;
4928
4961
  return res.status(400).json({
4929
4962
  error: suggestion ? `Cannot use "${displayPath}" directly as workspace root. Use a subdirectory like "${suggestion}" instead.` : `Cannot use "${displayPath}" directly as workspace root. Use a subdirectory instead.`
4930
4963
  });
@@ -4947,12 +4980,12 @@ function createWorkspaceConfigRoutes(sessionManager) {
4947
4980
  try {
4948
4981
  const project = getProjectByWorkdir(workdir);
4949
4982
  const previousRootDir = project?.workspaceRootDir ? resolveRootDir(project.workspaceRootDir, workdir) : null;
4950
- if (previousRootDir && previousRootDir !== resolvedPath) {
4983
+ if (previousRootDir && !isSameDir(previousRootDir, resolvedPath)) {
4951
4984
  const orphans = await findOrphanedWorkspaces(previousRootDir);
4952
4985
  workspaces.push(...orphans);
4953
4986
  } else if (!previousRootDir && projectName && typeof projectName === "string") {
4954
4987
  const defaultDir = join6(getGlobalDataDir(), "workspaces", projectName);
4955
- if (defaultDir !== resolvedPath) {
4988
+ if (!isSameDir(defaultDir, resolvedPath)) {
4956
4989
  const orphans = await findOrphanedWorkspaces(defaultDir);
4957
4990
  workspaces.push(...orphans);
4958
4991
  }
@@ -5384,7 +5417,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
5384
5417
  try {
5385
5418
  const { challenge, completion } = await adapter.beginLogin({ providerId: provider.id });
5386
5419
  void completion.then(async ({ credentialRef }) => {
5387
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-TW5FHQEM.js");
5420
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-EAB3V4QK.js");
5388
5421
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
5389
5422
  const updatedConfig = updateProvider(globalConfig, provider.id, { credentialRef, authAdapter: adapter.id });
5390
5423
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
@@ -5421,7 +5454,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
5421
5454
  const ref = provider.credentialRef ?? provider.id;
5422
5455
  await adapter.logout(ref);
5423
5456
  }
5424
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TW5FHQEM.js");
5457
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EAB3V4QK.js");
5425
5458
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
5426
5459
  const updatedConfig = {
5427
5460
  ...globalConfig,
@@ -5784,6 +5817,24 @@ function createPluginRoutes(options) {
5784
5817
  return router;
5785
5818
  }
5786
5819
 
5820
+ // src/server/routes/session-favorite.ts
5821
+ import "express";
5822
+ function registerSessionFavoriteRoute(router, sessionManager) {
5823
+ router.put("/sessions/:id/favorite", (req, res) => {
5824
+ const id = req.params["id"];
5825
+ const { isFavorite } = req.body;
5826
+ if (typeof isFavorite !== "boolean") {
5827
+ return res.status(400).json({ error: "isFavorite is required and must be a boolean" });
5828
+ }
5829
+ const session = sessionManager.getSession(id);
5830
+ if (!session) {
5831
+ return res.status(404).json({ error: "Session not found" });
5832
+ }
5833
+ toggleFavorite(id, isFavorite);
5834
+ res.json({ success: true });
5835
+ });
5836
+ }
5837
+
5787
5838
  // src/server/utils/wsl.ts
5788
5839
  import { readFileSync as readFileSync3 } from "fs";
5789
5840
  var cached = null;
@@ -5899,7 +5950,7 @@ async function createServerHandle(config3) {
5899
5950
  const mcpManager = new McpManager({
5900
5951
  onToolsDiscovered: async (name, tools) => {
5901
5952
  try {
5902
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TW5FHQEM.js");
5953
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EAB3V4QK.js");
5903
5954
  const mode = config3.mode ?? "production";
5904
5955
  const globalConfig = await loadGlobalConfig(mode, config3.globalConfigPath);
5905
5956
  const mcpServers2 = {
@@ -5933,7 +5984,7 @@ async function createServerHandle(config3) {
5933
5984
  toolRegistry = createToolRegistry();
5934
5985
  logger.info("MCP tools registered", { count: mcpTools.length });
5935
5986
  }
5936
- const { signalMcpReady } = await import("./server-7MOOJR2N.js");
5987
+ const { signalMcpReady } = await import("./server-HUHFJW7U.js");
5937
5988
  signalMcpReady();
5938
5989
  });
5939
5990
  const app = express();
@@ -6014,7 +6065,7 @@ async function createServerHandle(config3) {
6014
6065
  res.json({ tools });
6015
6066
  });
6016
6067
  app.get("/api/projects", async (_req, res) => {
6017
- const { listProjects: listProjects2 } = await import("./projects-PQXME5S4.js");
6068
+ const { listProjects: listProjects2 } = await import("./projects-C4353IQK.js");
6018
6069
  const projects = listProjects2();
6019
6070
  res.json({ projects });
6020
6071
  });
@@ -6023,7 +6074,7 @@ async function createServerHandle(config3) {
6023
6074
  if (!name || !workdir) {
6024
6075
  return res.status(400).json({ error: "name and workdir are required" });
6025
6076
  }
6026
- const { createDirectoryWithGit } = await import("./project-creator-BVA55HY6.js");
6077
+ const { createDirectoryWithGit } = await import("./project-creator-AWP2JUFS.js");
6027
6078
  try {
6028
6079
  const project = await createDirectoryWithGit(name, workdir);
6029
6080
  res.status(201).json({ project });
@@ -6068,7 +6119,7 @@ async function createServerHandle(config3) {
6068
6119
  }
6069
6120
  });
6070
6121
  app.get("/api/projects/:id", async (req, res) => {
6071
- const { getProject: getProject2 } = await import("./projects-PQXME5S4.js");
6122
+ const { getProject: getProject2 } = await import("./projects-C4353IQK.js");
6072
6123
  const project = getProject2(req.params.id);
6073
6124
  if (!project) {
6074
6125
  return res.status(404).json({ error: "Project not found" });
@@ -6076,7 +6127,7 @@ async function createServerHandle(config3) {
6076
6127
  res.json({ project });
6077
6128
  });
6078
6129
  app.get("/api/projects/:id/open-folder", async (req, res) => {
6079
- const { getProject: getProject2 } = await import("./projects-PQXME5S4.js");
6130
+ const { getProject: getProject2 } = await import("./projects-C4353IQK.js");
6080
6131
  const project = getProject2(req.params.id);
6081
6132
  if (!project) {
6082
6133
  return res.status(404).json({ error: "Project not found" });
@@ -6090,7 +6141,7 @@ async function createServerHandle(config3) {
6090
6141
  }
6091
6142
  });
6092
6143
  app.put("/api/projects/:id", async (req, res) => {
6093
- const { updateProject: updateProject2 } = await import("./projects-PQXME5S4.js");
6144
+ const { updateProject: updateProject2 } = await import("./projects-C4353IQK.js");
6094
6145
  const { name, customInstructions, dangerLevel } = req.body;
6095
6146
  const updates = {};
6096
6147
  if (name !== void 0) updates.name = name;
@@ -6103,7 +6154,7 @@ async function createServerHandle(config3) {
6103
6154
  res.json({ project: updated });
6104
6155
  });
6105
6156
  app.delete("/api/projects/:id", async (req, res) => {
6106
- const { getProject: getProject2, deleteProject } = await import("./projects-PQXME5S4.js");
6157
+ const { getProject: getProject2, deleteProject } = await import("./projects-C4353IQK.js");
6107
6158
  const project = getProject2(req.params.id);
6108
6159
  if (!project) {
6109
6160
  return res.status(404).json({ error: "Project not found" });
@@ -6112,7 +6163,7 @@ async function createServerHandle(config3) {
6112
6163
  res.json({ success: true });
6113
6164
  });
6114
6165
  app.put("/api/projects/:id/star", async (req, res) => {
6115
- const { toggleStar } = await import("./projects-PQXME5S4.js");
6166
+ const { toggleStar } = await import("./projects-C4353IQK.js");
6116
6167
  const { isStarred } = req.body;
6117
6168
  if (typeof isStarred !== "boolean") {
6118
6169
  return res.status(400).json({ error: "isStarred is required and must be a boolean" });
@@ -6123,27 +6174,30 @@ async function createServerHandle(config3) {
6123
6174
  }
6124
6175
  res.json({ project });
6125
6176
  });
6177
+ const sessionFavoriteRouter = express.Router();
6178
+ registerSessionFavoriteRoute(sessionFavoriteRouter, sessionManager);
6179
+ app.use("/api", sessionFavoriteRouter);
6126
6180
  app.get("/api/projects/:id/branches", async (req, res) => {
6127
- const { getProject: getProject2 } = await import("./projects-PQXME5S4.js");
6181
+ const { getProject: getProject2 } = await import("./projects-C4353IQK.js");
6128
6182
  const project = getProject2(req.params.id);
6129
6183
  if (!project) return res.status(404).json({ error: "Project not found" });
6130
- const { listBranches } = await import("./workspace-YDUQZ3HC.js");
6184
+ const { listBranches } = await import("./workspace-YUNHV4WS.js");
6131
6185
  const branches = await listBranches(project.workdir);
6132
6186
  res.json({ branches });
6133
6187
  });
6134
6188
  app.post("/api/projects/:id/checkout", async (req, res) => {
6135
- const { getProject: getProject2 } = await import("./projects-PQXME5S4.js");
6189
+ const { getProject: getProject2 } = await import("./projects-C4353IQK.js");
6136
6190
  const project = getProject2(req.params.id);
6137
6191
  if (!project) return res.status(404).json({ error: "Project not found" });
6138
6192
  const { branch } = req.body;
6139
6193
  if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
6140
- const { checkoutBranch, isGitRepository } = await import("./workspace-YDUQZ3HC.js");
6194
+ const { checkoutBranch, isGitRepository } = await import("./workspace-YUNHV4WS.js");
6141
6195
  if (!await isGitRepository(project.workdir)) {
6142
6196
  return res.status(400).json({ error: "Project is not a git repository" });
6143
6197
  }
6144
6198
  try {
6145
6199
  await checkoutBranch(project.workdir, branch);
6146
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-D772YTWL.js");
6200
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-D5CEPQGU.js");
6147
6201
  const allSessions = sessionManager.listSessions();
6148
6202
  for (const s of allSessions) {
6149
6203
  if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
@@ -6157,12 +6211,12 @@ async function createServerHandle(config3) {
6157
6211
  }
6158
6212
  });
6159
6213
  app.post("/api/projects/:id/checkout-new", async (req, res) => {
6160
- const { getProject: getProject2 } = await import("./projects-PQXME5S4.js");
6214
+ const { getProject: getProject2 } = await import("./projects-C4353IQK.js");
6161
6215
  const project = getProject2(req.params.id);
6162
6216
  if (!project) return res.status(404).json({ error: "Project not found" });
6163
6217
  const { name, sourceBranch } = req.body;
6164
6218
  if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
6165
- const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2, getDefaultBranch, isGitRepository } = await import("./workspace-YDUQZ3HC.js");
6219
+ const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2, getDefaultBranch, isGitRepository } = await import("./workspace-YUNHV4WS.js");
6166
6220
  if (!await isGitRepository(project.workdir)) {
6167
6221
  return res.status(400).json({ error: "Project is not a git repository" });
6168
6222
  }
@@ -6179,7 +6233,7 @@ async function createServerHandle(config3) {
6179
6233
  );
6180
6234
  }
6181
6235
  await createBranch(project.workdir, name, sb);
6182
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-D772YTWL.js");
6236
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-D5CEPQGU.js");
6183
6237
  const allSessions = sessionManager.listSessions();
6184
6238
  for (const s of allSessions) {
6185
6239
  if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
@@ -6196,7 +6250,7 @@ async function createServerHandle(config3) {
6196
6250
  const session = sessionManager.getSession(req.params.id);
6197
6251
  if (!session) return res.status(404).json({ error: "Session not found" });
6198
6252
  const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
6199
- const { listBranches, getDefaultBranch } = await import("./workspace-YDUQZ3HC.js");
6253
+ const { listBranches, getDefaultBranch } = await import("./workspace-YUNHV4WS.js");
6200
6254
  const [branches, defaultBranch] = await Promise.all([
6201
6255
  listBranches(effectiveWorkdir),
6202
6256
  getDefaultBranch(session.workdir)
@@ -6210,8 +6264,8 @@ async function createServerHandle(config3) {
6210
6264
  const { branch } = req.body;
6211
6265
  if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
6212
6266
  const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
6213
- const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-YDUQZ3HC.js");
6214
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-D772YTWL.js");
6267
+ const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-YUNHV4WS.js");
6268
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-D5CEPQGU.js");
6215
6269
  try {
6216
6270
  await validateRef2(effectiveWorkdir, branch);
6217
6271
  await checkoutBranch(effectiveWorkdir, branch);
@@ -6253,16 +6307,16 @@ All file and git operations should use this branch.
6253
6307
  const { name, sourceBranch } = req.body;
6254
6308
  if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
6255
6309
  const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
6256
- const { validateRef: validateRef2 } = await import("./workspace-YDUQZ3HC.js");
6257
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-D772YTWL.js");
6310
+ const { validateRef: validateRef2 } = await import("./workspace-YUNHV4WS.js");
6311
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-D5CEPQGU.js");
6258
6312
  try {
6259
6313
  await validateRef2(effectiveWorkdir, name);
6260
6314
  if (sourceBranch) {
6261
- const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-YDUQZ3HC.js");
6315
+ const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-YUNHV4WS.js");
6262
6316
  const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, sourceBranch, session.workdir);
6263
6317
  await createBranch(effectiveWorkdir, name, sb);
6264
6318
  } else {
6265
- const { createBranch, getDefaultBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2 } = await import("./workspace-YDUQZ3HC.js");
6319
+ const { createBranch, getDefaultBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2 } = await import("./workspace-YUNHV4WS.js");
6266
6320
  const defaultBranch = await getDefaultBranch(session.workdir);
6267
6321
  const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, defaultBranch, session.workdir);
6268
6322
  await createBranch(effectiveWorkdir, name, sb);
@@ -6300,17 +6354,17 @@ All file and git operations should use this branch.
6300
6354
  }
6301
6355
  });
6302
6356
  app.get("/api/projects/:id/workspaces", async (req, res) => {
6303
- const { getProject: getProject2 } = await import("./projects-PQXME5S4.js");
6357
+ const { getProject: getProject2 } = await import("./projects-C4353IQK.js");
6304
6358
  const project = getProject2(req.params.id);
6305
6359
  if (!project) return res.status(404).json({ error: "Project not found" });
6306
- const { listWorkspaces } = await import("./workspace-YDUQZ3HC.js");
6360
+ const { listWorkspaces } = await import("./workspace-YUNHV4WS.js");
6307
6361
  const all = await listWorkspaces(project.name, project.workdir);
6308
6362
  const workspacesList = all.filter((ws) => ws.path !== project.workdir);
6309
6363
  res.json({ workspaces: workspacesList });
6310
6364
  });
6311
6365
  app.get("/api/sessions", async (req, res) => {
6312
- const { getRecentUserPromptsForSession } = await import("./events-Y6XXQYFG.js");
6313
- const { getPendingConfirmationsBySession } = await import("./path-security-525YLND3.js");
6366
+ const { getRecentUserPromptsForSession } = await import("./events-224IO5NJ.js");
6367
+ const { getPendingConfirmationsBySession } = await import("./path-security-PFMZY7IA.js");
6314
6368
  const projectId = req.query["projectId"];
6315
6369
  const rawLimit = req.query["limit"];
6316
6370
  const offset = parseInt(req.query["offset"]) || 0;
@@ -6365,7 +6419,7 @@ All file and git operations should use this branch.
6365
6419
  disabledServers = mcpManager.getAllServers().filter((s) => s.config.disabled).map((s) => s.name);
6366
6420
  }
6367
6421
  if (disabledServers.length > 0) {
6368
- const { setSessionDisabledServers: setSessionDisabledServers2 } = await import("./session-overrides-XH6I3COP.js");
6422
+ const { setSessionDisabledServers: setSessionDisabledServers2 } = await import("./session-overrides-RNKV35MU.js");
6369
6423
  setSessionDisabledServers2(session.id, disabledServers);
6370
6424
  }
6371
6425
  } catch {
@@ -6402,7 +6456,7 @@ All file and git operations should use this branch.
6402
6456
  if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
6403
6457
  const project = sessionManager.getProject(session.projectId);
6404
6458
  if (!project) return res.status(404).json({ error: "Project not found" });
6405
- const { isGitRepository } = await import("./workspace-YDUQZ3HC.js");
6459
+ const { isGitRepository } = await import("./workspace-YUNHV4WS.js");
6406
6460
  if (!await isGitRepository(project.workdir)) {
6407
6461
  return res.status(400).json({ error: "Project is not a git repository" });
6408
6462
  }
@@ -6420,7 +6474,7 @@ All file and git operations should use this branch.
6420
6474
  if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
6421
6475
  const project = sessionManager.getProject(session.projectId);
6422
6476
  if (!project) return res.status(404).json({ error: "Project not found" });
6423
- const { isGitRepository } = await import("./workspace-YDUQZ3HC.js");
6477
+ const { isGitRepository } = await import("./workspace-YUNHV4WS.js");
6424
6478
  if (!await isGitRepository(project.workdir)) {
6425
6479
  return res.status(400).json({ error: "Project is not a git repository" });
6426
6480
  }
@@ -6438,12 +6492,12 @@ All file and git operations should use this branch.
6438
6492
  }
6439
6493
  });
6440
6494
  app.get("/api/sessions/:id", async (req, res) => {
6441
- const { getEventStore: getEventStore2, combineEventsWithSnapshot } = await import("./events-Y6XXQYFG.js");
6442
- const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-Z4GNWRC3.js");
6443
- const { getPendingQuestionsForSession } = await import("./tools-HTUTYMKI.js");
6444
- const { getMaxVisibleItems } = await import("./settings-KO6DSJLD.js");
6445
- const { getAgentModelOverride: getAgentModelOverride2 } = await import("./model-overrides-O3ZYKFP7.js");
6446
- const { updateSessionProvider: updateSessionProvider2 } = await import("./sessions-D772YTWL.js");
6495
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot } = await import("./events-224IO5NJ.js");
6496
+ const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-YTTTVS56.js");
6497
+ const { getPendingQuestionsForSession } = await import("./tools-2B363F7L.js");
6498
+ const { getMaxVisibleItems } = await import("./settings-BNRNX6IW.js");
6499
+ const { getAgentModelOverride: getAgentModelOverride2 } = await import("./model-overrides-OY2YKUNV.js");
6500
+ const { updateSessionProvider: updateSessionProvider2 } = await import("./sessions-D5CEPQGU.js");
6447
6501
  let session = sessionManager.getSession(req.params.id);
6448
6502
  if (!session) {
6449
6503
  return res.status(404).json({ error: "Session not found" });
@@ -6482,8 +6536,8 @@ All file and git operations should use this branch.
6482
6536
  if (!session) {
6483
6537
  return res.status(404).json({ error: "Session not found" });
6484
6538
  }
6485
- const { stopSessionExecution } = await import("./chat-handler-BYXZIIV3.js");
6486
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-HTUTYMKI.js");
6539
+ const { stopSessionExecution } = await import("./chat-handler-PEK5JDHO.js");
6540
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2B363F7L.js");
6487
6541
  sessionManager.clearMessageQueue(sessionId);
6488
6542
  stopSessionExecution(sessionId, sessionManager);
6489
6543
  abortSession(sessionId);
@@ -6512,9 +6566,9 @@ All file and git operations should use this branch.
6512
6566
  res.json({ success: true });
6513
6567
  });
6514
6568
  app.post("/api/sessions/:id/provider", async (req, res) => {
6515
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-Y6XXQYFG.js");
6516
- const { buildMessagesFromStoredEvents } = await import("./folding-Z4GNWRC3.js");
6517
- const { getMaxVisibleItems } = await import("./settings-KO6DSJLD.js");
6569
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-224IO5NJ.js");
6570
+ const { buildMessagesFromStoredEvents } = await import("./folding-YTTTVS56.js");
6571
+ const { getMaxVisibleItems } = await import("./settings-BNRNX6IW.js");
6518
6572
  const sessionId = req.params.id;
6519
6573
  const session = sessionManager.getSession(sessionId);
6520
6574
  if (!session) {
@@ -6549,7 +6603,7 @@ All file and git operations should use this branch.
6549
6603
  if (!result.success) {
6550
6604
  return res.status(500).json({ error: result.error ?? "Failed to set default model" });
6551
6605
  }
6552
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-TW5FHQEM.js");
6606
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-EAB3V4QK.js");
6553
6607
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6554
6608
  const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model);
6555
6609
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
@@ -6627,11 +6681,11 @@ All file and git operations should use this branch.
6627
6681
  res.json({ success: true });
6628
6682
  });
6629
6683
  app.put("/api/sessions/:id/mode", async (req, res) => {
6630
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-Y6XXQYFG.js");
6631
- const { buildMessagesFromStoredEvents } = await import("./folding-Z4GNWRC3.js");
6632
- const { getMaxVisibleItems } = await import("./settings-KO6DSJLD.js");
6633
- const { getAgentModelOverride: getAgentModelOverride2 } = await import("./model-overrides-O3ZYKFP7.js");
6634
- const { updateSessionProvider: updateSessionProvider2 } = await import("./sessions-D772YTWL.js");
6684
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-224IO5NJ.js");
6685
+ const { buildMessagesFromStoredEvents } = await import("./folding-YTTTVS56.js");
6686
+ const { getMaxVisibleItems } = await import("./settings-BNRNX6IW.js");
6687
+ const { getAgentModelOverride: getAgentModelOverride2 } = await import("./model-overrides-OY2YKUNV.js");
6688
+ const { updateSessionProvider: updateSessionProvider2 } = await import("./sessions-D5CEPQGU.js");
6635
6689
  const sessionId = req.params.id;
6636
6690
  const session = sessionManager.getSession(sessionId);
6637
6691
  if (!session) {
@@ -6733,7 +6787,7 @@ All file and git operations should use this branch.
6733
6787
  if (alwaysAllow !== void 0 && typeof alwaysAllow !== "boolean") {
6734
6788
  return res.status(400).json({ error: "alwaysAllow must be a boolean if provided" });
6735
6789
  }
6736
- const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-HTUTYMKI.js");
6790
+ const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-2B363F7L.js");
6737
6791
  const pendingSessionId = getConfirmationSessionId(callId);
6738
6792
  if (!pendingSessionId) {
6739
6793
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -6745,11 +6799,11 @@ All file and git operations should use this branch.
6745
6799
  if (!result.found) {
6746
6800
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
6747
6801
  }
6748
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-Y6XXQYFG.js");
6749
- const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-Z4GNWRC3.js");
6750
- const { createSessionStateMessage } = await import("./protocol-FTHAR2YL.js");
6751
- const { getPendingQuestionsForSession } = await import("./tools-HTUTYMKI.js");
6752
- const { getMaxVisibleItems } = await import("./settings-KO6DSJLD.js");
6802
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-224IO5NJ.js");
6803
+ const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-YTTTVS56.js");
6804
+ const { createSessionStateMessage } = await import("./protocol-LZZ7C4VQ.js");
6805
+ const { getPendingQuestionsForSession } = await import("./tools-2B363F7L.js");
6806
+ const { getMaxVisibleItems } = await import("./settings-BNRNX6IW.js");
6753
6807
  const eventStore = getEventStore2();
6754
6808
  const { snapshot, events: eventsSinceSnapshot } = eventStore.getEventsSinceSnapshot(sessionId);
6755
6809
  const events = combineEvents(sessionId, snapshot, eventsSinceSnapshot);
@@ -6785,7 +6839,7 @@ All file and git operations should use this branch.
6785
6839
  if (!skip && typeof answer !== "string") {
6786
6840
  return res.status(400).json({ error: "answer is required when not skipping" });
6787
6841
  }
6788
- const { provideAnswer } = await import("./tools-HTUTYMKI.js");
6842
+ const { provideAnswer } = await import("./tools-2B363F7L.js");
6789
6843
  const found = provideAnswer(callId, answer ?? "", skip ?? false);
6790
6844
  if (!found) {
6791
6845
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -6818,7 +6872,7 @@ All file and git operations should use this branch.
6818
6872
  if (!session) {
6819
6873
  return res.status(404).json({ error: "Session not found" });
6820
6874
  }
6821
- const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-KO6DSJLD.js");
6875
+ const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-BNRNX6IW.js");
6822
6876
  if (getSetting2(SETTINGS_KEYS.CACHE_WARMING) !== "true") {
6823
6877
  return res.json({ success: false, reason: "disabled" });
6824
6878
  }
@@ -6850,7 +6904,7 @@ All file and git operations should use this branch.
6850
6904
  backend: activeProvider?.backend ?? llmClient.getBackend(),
6851
6905
  model: llmClient.getModel()
6852
6906
  };
6853
- const { runAgentTurn, TurnMetrics } = await import("./orchestrator-P5EUMC7E.js");
6907
+ const { runAgentTurn, TurnMetrics } = await import("./orchestrator-JKBY7B3P.js");
6854
6908
  runAgentTurn(
6855
6909
  {
6856
6910
  sessionManager,
@@ -6888,15 +6942,15 @@ All file and git operations should use this branch.
6888
6942
  if (!session) {
6889
6943
  return res.status(404).json({ error: "Session not found" });
6890
6944
  }
6891
- const { stopSessionExecution } = await import("./chat-handler-BYXZIIV3.js");
6892
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-HTUTYMKI.js");
6945
+ const { stopSessionExecution } = await import("./chat-handler-PEK5JDHO.js");
6946
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2B363F7L.js");
6893
6947
  const queuedMessages = sessionManager.getQueueState(sessionId);
6894
6948
  sessionManager.clearMessageQueue(sessionId);
6895
6949
  stopSessionExecution(sessionId, sessionManager);
6896
6950
  abortSession(sessionId);
6897
6951
  cancelQuestionsForSession(sessionId, "Session stopped by user");
6898
6952
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
6899
- const eventStore = (await import("./events-Y6XXQYFG.js")).getEventStore();
6953
+ const eventStore = (await import("./events-224IO5NJ.js")).getEventStore();
6900
6954
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
6901
6955
  res.json({ success: true, queuedMessages });
6902
6956
  });
@@ -6910,7 +6964,7 @@ All file and git operations should use this branch.
6910
6964
  if (typeof messageIndex !== "number" || messageIndex < 0) {
6911
6965
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
6912
6966
  }
6913
- const { truncateSessionMessages } = await import("./events-Y6XXQYFG.js");
6967
+ const { truncateSessionMessages } = await import("./events-224IO5NJ.js");
6914
6968
  truncateSessionMessages(sessionId, messageIndex);
6915
6969
  res.json({ success: true });
6916
6970
  });
@@ -6920,15 +6974,18 @@ All file and git operations should use this branch.
6920
6974
  if (!session) {
6921
6975
  return res.status(404).json({ error: "Session not found" });
6922
6976
  }
6923
- const { messageId, content } = req.body;
6977
+ const { messageId, content, attachments } = req.body;
6924
6978
  if (typeof messageId !== "string" || !messageId) {
6925
6979
  return res.status(400).json({ error: "messageId is required" });
6926
6980
  }
6927
6981
  if (content !== void 0 && (typeof content !== "string" || !content.trim())) {
6928
6982
  return res.status(400).json({ error: "content must be a non-empty string if provided" });
6929
6983
  }
6930
- const { getEventStore: getEventStore2 } = await import("./events-Y6XXQYFG.js");
6931
- const { buildMessagesFromStoredEvents } = await import("./folding-Z4GNWRC3.js");
6984
+ if (attachments !== void 0 && !Array.isArray(attachments)) {
6985
+ return res.status(400).json({ error: "attachments must be an array if provided" });
6986
+ }
6987
+ const { getEventStore: getEventStore2 } = await import("./events-224IO5NJ.js");
6988
+ const { buildMessagesFromStoredEvents } = await import("./folding-YTTTVS56.js");
6932
6989
  const eventStore = getEventStore2();
6933
6990
  const events = eventStore.getEvents(sessionId);
6934
6991
  const { messages } = buildMessagesFromStoredEvents(events);
@@ -6940,9 +6997,15 @@ All file and git operations should use this branch.
6940
6997
  if (msg.role !== "user" || msg.isSystemGenerated) {
6941
6998
  return res.status(400).json({ error: "Can only replay user messages" });
6942
6999
  }
6943
- const { truncateSessionMessages } = await import("./events-Y6XXQYFG.js");
7000
+ const { truncateSessionMessages } = await import("./events-224IO5NJ.js");
6944
7001
  truncateSessionMessages(sessionId, msgIndex - 1);
6945
- sessionManager.queueMessage(sessionId, "asap", content ?? msg.content, msg.attachments, msg.messageKind);
7002
+ sessionManager.queueMessage(
7003
+ sessionId,
7004
+ "asap",
7005
+ content ?? msg.content,
7006
+ attachments ?? msg.attachments,
7007
+ msg.messageKind
7008
+ );
6946
7009
  res.json({ success: true });
6947
7010
  });
6948
7011
  app.post("/api/sessions/:id/fork", async (req, res) => {
@@ -6996,7 +7059,7 @@ All file and git operations should use this branch.
6996
7059
  res.json({ accepted: true });
6997
7060
  });
6998
7061
  app.get("/api/settings", async (req, res) => {
6999
- const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-KO6DSJLD.js");
7062
+ const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-BNRNX6IW.js");
7000
7063
  const keysParam = req.query["keys"];
7001
7064
  if (!keysParam) {
7002
7065
  return res.status(400).json({ error: "keys query parameter is required" });
@@ -7009,19 +7072,19 @@ All file and git operations should use this branch.
7009
7072
  res.json(result);
7010
7073
  });
7011
7074
  app.get("/api/settings/:key", async (req, res) => {
7012
- const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-KO6DSJLD.js");
7075
+ const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-BNRNX6IW.js");
7013
7076
  const key = req.params.key;
7014
7077
  const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
7015
7078
  res.json({ key, value });
7016
7079
  });
7017
7080
  app.get("/api/settings/:key", async (req, res) => {
7018
- const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-KO6DSJLD.js");
7081
+ const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-BNRNX6IW.js");
7019
7082
  const key = req.params.key;
7020
7083
  const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
7021
7084
  res.json({ key, value });
7022
7085
  });
7023
7086
  app.put("/api/settings/:key", async (req, res) => {
7024
- const { setSetting: setSetting2 } = await import("./settings-KO6DSJLD.js");
7087
+ const { setSetting: setSetting2 } = await import("./settings-BNRNX6IW.js");
7025
7088
  const key = req.params.key;
7026
7089
  const { value } = req.body;
7027
7090
  if (value === void 0) {
@@ -7048,7 +7111,7 @@ All file and git operations should use this branch.
7048
7111
  }
7049
7112
  });
7050
7113
  app.get("/api/tools/shells", async (_req, res) => {
7051
- const { listAvailableShells } = await import("./platform-MEQUWG6U.js");
7114
+ const { listAvailableShells } = await import("./platform-QNGCKX4L.js");
7052
7115
  res.json({ shells: listAvailableShells() });
7053
7116
  });
7054
7117
  app.get("/api/config", async (_req, res) => {
@@ -7057,7 +7120,7 @@ All file and git operations should use this branch.
7057
7120
  let visionFallback;
7058
7121
  let globalWorkdir;
7059
7122
  try {
7060
- const { loadGlobalConfig, getVisionFallback } = await import("./config-TW5FHQEM.js");
7123
+ const { loadGlobalConfig, getVisionFallback } = await import("./config-EAB3V4QK.js");
7061
7124
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7062
7125
  const fallback = getVisionFallback(globalConfig);
7063
7126
  if (fallback) {
@@ -7138,7 +7201,7 @@ All file and git operations should use this branch.
7138
7201
  }));
7139
7202
  }
7140
7203
  app.post("/api/proxy/test", async (_req, res) => {
7141
- const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-KO6DSJLD.js");
7204
+ const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-BNRNX6IW.js");
7142
7205
  const proxyUrl = getSetting2(SETTINGS_KEYS.PROXY_URL);
7143
7206
  if (!proxyUrl) {
7144
7207
  return res.status(400).json({ success: false, error: "No proxy URL configured" });
@@ -7230,7 +7293,7 @@ All file and git operations should use this branch.
7230
7293
  }
7231
7294
  });
7232
7295
  app.post("/api/proxy/test", async (_req, res) => {
7233
- const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-KO6DSJLD.js");
7296
+ const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-BNRNX6IW.js");
7234
7297
  const proxyUrl = getSetting2(SETTINGS_KEYS.PROXY_URL);
7235
7298
  if (!proxyUrl) {
7236
7299
  return res.status(400).json({ success: false, error: "No proxy URL configured" });
@@ -7257,7 +7320,7 @@ All file and git operations should use this branch.
7257
7320
  const backend = req.query["backend"];
7258
7321
  if (!url) return res.status(400).json({ error: "url is required" });
7259
7322
  try {
7260
- const { fetchModelsWithContext } = await import("./provider-manager-W5N4XRE5.js");
7323
+ const { fetchModelsWithContext } = await import("./provider-manager-GNEPR6UN.js");
7261
7324
  const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
7262
7325
  const models = await fetchModelsWithContext(
7263
7326
  url,
@@ -7328,7 +7391,7 @@ All file and git operations should use this branch.
7328
7391
  const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
7329
7392
  const { getBackendCapabilities } = await import("./backend-P3GHHLHJ.js");
7330
7393
  const { buildNonStreamingCreateParams } = await import("./client-pure-VFZIIK4S.js");
7331
- const { OpenAIHttpClient } = await import("./http-client-2GDKHZIG.js");
7394
+ const { OpenAIHttpClient } = await import("./http-client-YC3UA5OZ.js");
7332
7395
  const { ensureVersionPrefix } = await import("./url-utils-SAJP7AEX.js");
7333
7396
  const profile = getModelProfile2(model);
7334
7397
  const capabilities = getBackendCapabilities(backend || "unknown");
@@ -7398,7 +7461,7 @@ All file and git operations should use this branch.
7398
7461
  return res.status(400).json({ error: "name, url, and backend are required" });
7399
7462
  }
7400
7463
  try {
7401
- const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-TW5FHQEM.js");
7464
+ const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-EAB3V4QK.js");
7402
7465
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7403
7466
  const providerBackend = backend;
7404
7467
  const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
@@ -7439,7 +7502,7 @@ All file and git operations should use this branch.
7439
7502
  app.post("/api/init/config", async (req, res) => {
7440
7503
  const { workdir, visionFallback } = req.body;
7441
7504
  try {
7442
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TW5FHQEM.js");
7505
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EAB3V4QK.js");
7443
7506
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7444
7507
  const updatedVf = visionFallback ? { ...globalConfig.visionFallback, ...visionFallback } : globalConfig.visionFallback;
7445
7508
  const updatedConfig = {
@@ -7474,7 +7537,7 @@ All file and git operations should use this branch.
7474
7537
  }
7475
7538
  const updates = parsed.data;
7476
7539
  try {
7477
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TW5FHQEM.js");
7540
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EAB3V4QK.js");
7478
7541
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7479
7542
  const filteredUpdates = Object.fromEntries(Object.entries(updates).filter(([, v]) => v !== void 0));
7480
7543
  const updatedConfig = {
@@ -7516,8 +7579,8 @@ All file and git operations should use this branch.
7516
7579
  }
7517
7580
  const testConfig = parsed.data;
7518
7581
  try {
7519
- const { resolveVisionFallback } = await import("./config-TW5FHQEM.js");
7520
- const { loadGlobalConfig } = await import("./config-TW5FHQEM.js");
7582
+ const { resolveVisionFallback } = await import("./config-EAB3V4QK.js");
7583
+ const { loadGlobalConfig } = await import("./config-EAB3V4QK.js");
7521
7584
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7522
7585
  const filteredTestConfig = Object.fromEntries(Object.entries(testConfig).filter(([, v]) => v !== void 0));
7523
7586
  const testVisionFallback = {
@@ -7568,7 +7631,7 @@ All file and git operations should use this branch.
7568
7631
  });
7569
7632
  app.delete("/api/providers/:id", async (req, res) => {
7570
7633
  const { id } = req.params;
7571
- const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-TW5FHQEM.js");
7634
+ const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-EAB3V4QK.js");
7572
7635
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7573
7636
  const updatedConfig = removeProvider(globalConfig, id);
7574
7637
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
@@ -7580,7 +7643,7 @@ All file and git operations should use this branch.
7580
7643
  const { id } = req.params;
7581
7644
  const { isLocal } = req.body;
7582
7645
  try {
7583
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-TW5FHQEM.js");
7646
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-EAB3V4QK.js");
7584
7647
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7585
7648
  const provider = globalConfig.providers.find((p) => p.id === id);
7586
7649
  if (!provider) {
@@ -7612,7 +7675,7 @@ All file and git operations should use this branch.
7612
7675
  transportAdapter
7613
7676
  } = req.body;
7614
7677
  try {
7615
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-TW5FHQEM.js");
7678
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-EAB3V4QK.js");
7616
7679
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7617
7680
  const provider = globalConfig.providers.find((p) => p.id === id);
7618
7681
  if (!provider) {
@@ -7653,7 +7716,7 @@ All file and git operations should use this branch.
7653
7716
  return res.status(400).json({ error: result.error });
7654
7717
  }
7655
7718
  const llmClient = getLLMClient();
7656
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-TW5FHQEM.js");
7719
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-EAB3V4QK.js");
7657
7720
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7658
7721
  const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
7659
7722
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
@@ -7680,7 +7743,7 @@ All file and git operations should use this branch.
7680
7743
  });
7681
7744
  async function rebuildMcpTools() {
7682
7745
  const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-FEAHWU5C.js");
7683
- const { setMcpTools: setMcpTools2 } = await import("./tools-HTUTYMKI.js");
7746
+ const { setMcpTools: setMcpTools2 } = await import("./tools-2B363F7L.js");
7684
7747
  const mcpTools = createMcpTools2(mcpManager);
7685
7748
  setMcpTools2(mcpTools);
7686
7749
  toolRegistry = createToolRegistry();
@@ -7755,7 +7818,7 @@ All file and git operations should use this branch.
7755
7818
  };
7756
7819
  await mcpManager.addServer(name, serverCfg);
7757
7820
  const server = mcpManager.getServer(name);
7758
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TW5FHQEM.js");
7821
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EAB3V4QK.js");
7759
7822
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7760
7823
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
7761
7824
  await saveGlobalConfig(
@@ -7816,7 +7879,7 @@ All file and git operations should use this branch.
7816
7879
  return res.status(400).json({ error: "oauth must be a boolean" });
7817
7880
  }
7818
7881
  try {
7819
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TW5FHQEM.js");
7882
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EAB3V4QK.js");
7820
7883
  const { applyMcpServerUpdate } = await import("./update-server-LOOXIXDW.js");
7821
7884
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7822
7885
  const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
@@ -7865,7 +7928,7 @@ All file and git operations should use this branch.
7865
7928
  mcpManager.removeServer(name);
7866
7929
  const { clearMcpOAuthEntry } = await import("./oauth-store-XCFXV2VM.js");
7867
7930
  await clearMcpOAuthEntry(name);
7868
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TW5FHQEM.js");
7931
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EAB3V4QK.js");
7869
7932
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7870
7933
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
7871
7934
  delete updatedMcpServers[name];
@@ -8032,7 +8095,7 @@ All file and git operations should use this branch.
8032
8095
  await mcpManager.setToolEnabled(name, toolName, enabled);
8033
8096
  const server = mcpManager.getServer(name);
8034
8097
  if (server) {
8035
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-TW5FHQEM.js");
8098
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EAB3V4QK.js");
8036
8099
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
8037
8100
  const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
8038
8101
  const serverCfg = mcpServers2[name];
@@ -8061,7 +8124,7 @@ All file and git operations should use this branch.
8061
8124
  res.status(400).json({ error: error instanceof Error ? error.message : String(error) });
8062
8125
  }
8063
8126
  });
8064
- const { listProjects } = await import("./projects-PQXME5S4.js");
8127
+ const { listProjects } = await import("./projects-C4353IQK.js");
8065
8128
  const allProjects = listProjects();
8066
8129
  const projectDir = allProjects.find(
8067
8130
  (p) => p.workdir === config3.workdir || config3.workdir && p.workdir.startsWith(config3.workdir + "/")
@@ -8088,13 +8151,13 @@ All file and git operations should use this branch.
8088
8151
  })
8089
8152
  );
8090
8153
  app.get("/api/sessions/:id/background-processes", async (req, res) => {
8091
- const { getSessionProcesses } = await import("./manager-HCMDFEQH.js");
8154
+ const { getSessionProcesses } = await import("./manager-4QGXI6WZ.js");
8092
8155
  const sessionId = req.params.id;
8093
8156
  const processes = getSessionProcesses(sessionId);
8094
8157
  res.json({ processes });
8095
8158
  });
8096
8159
  app.post("/api/sessions/:id/background-process/:processId/stop", async (req, res) => {
8097
- const { stopProcess } = await import("./manager-HCMDFEQH.js");
8160
+ const { stopProcess } = await import("./manager-4QGXI6WZ.js");
8098
8161
  const sessionId = req.params.id;
8099
8162
  const processId = req.params.processId;
8100
8163
  const session = sessionManager.getSession(sessionId);
@@ -8239,7 +8302,7 @@ All file and git operations should use this branch.
8239
8302
  const state = sessionManager.getContextState(sessionId);
8240
8303
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
8241
8304
  });
8242
- const { QueueProcessor } = await import("./processor-UN4H4V7F.js");
8305
+ const { QueueProcessor } = await import("./processor-NYPJ5PFA.js");
8243
8306
  const queueProcessor = new QueueProcessor({
8244
8307
  sessionManager,
8245
8308
  providerManager,
@@ -8282,7 +8345,7 @@ All file and git operations should use this branch.
8282
8345
  void (async () => {
8283
8346
  await devServerManager.stopAll();
8284
8347
  await mcpManager.disconnectAll();
8285
- const { stopAllInspectProxies } = await import("./inspect-proxy-N42Z5TOG.js");
8348
+ const { stopAllInspectProxies } = await import("./inspect-proxy-B7LGGTM7.js");
8286
8349
  stopAllInspectProxies();
8287
8350
  const { cleanupAllProcesses } = await import("./store-SARB6V2N.js");
8288
8351
  cleanupAllProcesses();
@@ -8324,4 +8387,4 @@ export {
8324
8387
  createServerHandle,
8325
8388
  createServer
8326
8389
  };
8327
- //# sourceMappingURL=chunk-IYTDCPEQ.js.map
8390
+ //# sourceMappingURL=chunk-TEQEDOWI.js.map