openfox 2.0.83 → 2.0.85

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 (60) hide show
  1. package/dist/{chat-handler-6KBOE4YA.js → chat-handler-3CWMOIOR.js} +15 -14
  2. package/dist/{chunk-3D3N2PXI.js → chunk-2KKFOVK7.js} +2 -2
  3. package/dist/{chunk-JKZPMRH2.js → chunk-3JYPDZT2.js} +2 -2
  4. package/dist/{chunk-JXTHW3YX.js → chunk-7PZBCATU.js} +18 -4
  5. package/dist/chunk-7WAOMWR3.js +7 -0
  6. package/dist/{chunk-IIRXKSB5.js → chunk-ACL4YUJH.js} +10 -2
  7. package/dist/{chunk-7ROIY3QN.js → chunk-DLJYYWM2.js} +169 -111
  8. package/dist/{chunk-D324ULDG.js → chunk-FTJ7U3VN.js} +20 -17
  9. package/dist/chunk-FYYPQ27K.js +399 -0
  10. package/dist/{chunk-KMGVUOLT.js → chunk-GLRTJJOB.js} +23 -20
  11. package/dist/{chunk-FVY2JOTO.js → chunk-H765CIHN.js} +2 -2
  12. package/dist/{chunk-AANVMTYU.js → chunk-L4S5N3WV.js} +8 -3
  13. package/dist/{chunk-VB23QPW3.js → chunk-M6X72DYZ.js} +3 -3
  14. package/dist/{chunk-SBSQD7MG.js → chunk-MTZ3PC6K.js} +2 -2
  15. package/dist/{chunk-NH2PVB6R.js → chunk-N54PQSCH.js} +33 -24
  16. package/dist/{chunk-A2IZ4PWQ.js → chunk-OHKBGMLO.js} +15 -4
  17. package/dist/{chunk-OBQN5ATP.js → chunk-RSO2HKNH.js} +98 -365
  18. package/dist/{chunk-WL6AOKRD.js → chunk-SGFQWQCE.js} +10 -8
  19. package/dist/{chunk-CNJ63FXJ.js → chunk-STFIEU5F.js} +3 -2
  20. package/dist/{chunk-BUXIESO5.js → chunk-V5LOH363.js} +6 -74
  21. package/dist/{chunk-5ZHVQOI3.js → chunk-W23S3TU5.js} +2 -2
  22. package/dist/{chunk-DQP5HSDS.js → chunk-WVMOGE7U.js} +3 -3
  23. package/dist/{chunk-HLZUN7OR.js → chunk-XXII6DS3.js} +7 -7
  24. package/dist/cli/dev.js +1 -1
  25. package/dist/cli/index.js +1 -1
  26. package/dist/{client-TA2VD4LR.js → client-C2P67MA4.js} +4 -4
  27. package/dist/{compactor-YKESKGHL.js → compactor-2YT66FDZ.js} +10 -8
  28. package/dist/{config-EN3WEH4A.js → config-JN6MW5SL.js} +2 -2
  29. package/dist/{events-GF2WNELM.js → events-OEDAFNEI.js} +7 -4
  30. package/dist/{folding-UACKBHUZ.js → folding-FGTCP73N.js} +7 -2
  31. package/dist/{http-client-QZY7W36Q.js → http-client-I52X7GQB.js} +3 -3
  32. package/dist/{manager-WOUOQVLV.js → manager-TD2UT62O.js} +4 -4
  33. package/dist/{orchestrator-BO62JYFM.js → orchestrator-6RYJYR3T.js} +14 -13
  34. package/dist/package.json +1 -1
  35. package/dist/{path-security-AWDNKRZ4.js → path-security-7ZNIG3ZE.js} +8 -5
  36. package/dist/{platform-7AK5MB4K.js → platform-OYKGQ7Z3.js} +3 -3
  37. package/dist/{processor-BLGEVOPK.js → processor-IGRFA3KA.js} +15 -14
  38. package/dist/{protocol-9WP7lLec.d.ts → protocol-5NJx1N4c.d.ts} +1 -1
  39. package/dist/provider/index.d.ts +4 -4
  40. package/dist/{provider-QVVJ6XNZ.js → provider-YNYYAR6C.js} +7 -7
  41. package/dist/{provider-manager-7246YSJT.js → provider-manager-3DW3A2VC.js} +5 -5
  42. package/dist/{serve-HXV2RX3Q.js → serve-LFC7D5B7.js} +21 -20
  43. package/dist/server/index.d.ts +4 -4
  44. package/dist/server/index.js +20 -19
  45. package/dist/{server-V4VA4A2E.js → server-E5IA4SK7.js} +16 -15
  46. package/dist/{sessions-SFG42M4W.js → sessions-V3BF2OTU.js} +5 -2
  47. package/dist/{settings-6TJIHDVX.js → settings-AGNYWEIE.js} +2 -2
  48. package/dist/shared/index.d.ts +3 -3
  49. package/dist/{tools-X4YLRR2Y.js → tools-ZUTPBREL.js} +13 -12
  50. package/dist/{types-ulRvCqQX.d.ts → types-B4wa_vGm.d.ts} +2 -0
  51. package/dist/{types-BtY5XChg.d.ts → types-CrLD4iRS.d.ts} +1 -1
  52. package/dist/{update-MFOCAROI.js → update-KDMUVXXI.js} +2 -2
  53. package/dist/web/assets/{index-DfmXvFVe.css → index-CsWZt1m8.css} +1 -1
  54. package/dist/web/assets/index-mJ_RQ-yF.js +305 -0
  55. package/dist/web/index.html +2 -2
  56. package/dist/web/sw.js +1 -1
  57. package/dist/{workspace-N2PIBOJV.js → workspace-MMV6V5P4.js} +4 -2
  58. package/package.json +1 -1
  59. package/dist/chunk-2X3V4SQC.js +0 -7
  60. package/dist/web/assets/index-C9jXZWzN.js +0 -305
@@ -21,41 +21,22 @@ import {
21
21
  tokenFromPassword,
22
22
  verifyPassword,
23
23
  workflowExists
24
- } from "./chunk-KMGVUOLT.js";
24
+ } from "./chunk-GLRTJJOB.js";
25
25
  import {
26
- agentExists,
27
26
  createToolRegistry,
28
- deleteAgent,
29
- deleteItemFromDir,
30
27
  deleteOwnedSkill,
31
- deleteProjectAgent,
32
28
  deleteProjectSkill,
33
29
  deleteSkill,
34
30
  devServerManager,
35
- findAgentById,
36
31
  findSkillById,
37
- getDefaultAgentIds,
38
- getDefaultIds,
39
32
  getDefaultSkillIds,
40
- getTopLevelAgents,
41
- isDefaultAgent,
42
33
  isDefaultSkill,
43
34
  isSkillEnabled,
44
- loadAllAgents,
45
- loadAllAgentsDefault,
46
35
  loadAllSkills,
47
36
  loadAllSkillsWithDiagnostics,
48
- loadDefaultAgents,
49
37
  loadDefaultSkills,
50
- loadItemsFromDir,
51
- loadProjectAgents,
52
38
  loadProjectSkills,
53
- loadUserAgents,
54
39
  loadUserSkills,
55
- pathExists,
56
- saveAgent,
57
- saveAgentToProject,
58
- saveItemToDir,
59
40
  saveSkill,
60
41
  saveSkillToProject,
61
42
  setMcpConfigMode,
@@ -66,7 +47,7 @@ import {
66
47
  setSkillEnabled,
67
48
  skillExists,
68
49
  updateOwnedSkill
69
- } from "./chunk-OBQN5ATP.js";
50
+ } from "./chunk-RSO2HKNH.js";
70
51
  import {
71
52
  createMcpTools
72
53
  } from "./chunk-NWO6GRYE.js";
@@ -85,7 +66,7 @@ import {
85
66
  validateRef,
86
67
  validateWorkspaceName,
87
68
  workspaceExists
88
- } from "./chunk-JXTHW3YX.js";
69
+ } from "./chunk-7PZBCATU.js";
89
70
  import {
90
71
  createContextStateMessage
91
72
  } from "./chunk-SJTG56CH.js";
@@ -96,17 +77,17 @@ import {
96
77
  ALWAYS_ALLOWED,
97
78
  ALWAYS_ALLOWED_FOR_SUBAGENTS,
98
79
  TOP_LEVEL_ONLY_TOOLS
99
- } from "./chunk-FVY2JOTO.js";
80
+ } from "./chunk-H765CIHN.js";
100
81
  import {
101
82
  getPathSeparator,
102
83
  isAbsolutePath
103
- } from "./chunk-5ZHVQOI3.js";
84
+ } from "./chunk-W23S3TU5.js";
104
85
  import {
105
86
  getProject
106
87
  } from "./chunk-6AE3JPDJ.js";
107
88
  import {
108
89
  VERSION
109
- } from "./chunk-2X3V4SQC.js";
90
+ } from "./chunk-7WAOMWR3.js";
110
91
  import {
111
92
  emitAssistantMessageStart,
112
93
  emitContextState,
@@ -120,9 +101,8 @@ import {
120
101
  emitUserMessage,
121
102
  getEventStore,
122
103
  getSessionState,
123
- initEventStore,
124
- setRuntimeConfig
125
- } from "./chunk-BUXIESO5.js";
104
+ initEventStore
105
+ } from "./chunk-V5LOH363.js";
126
106
  import {
127
107
  createSession,
128
108
  deleteSession,
@@ -137,13 +117,35 @@ import {
137
117
  updateSessionProvider,
138
118
  updateSessionRunning,
139
119
  updateSessionWorkdir
140
- } from "./chunk-AANVMTYU.js";
120
+ } from "./chunk-L4S5N3WV.js";
121
+ import {
122
+ agentExists,
123
+ deleteAgent,
124
+ deleteItemFromDir,
125
+ deleteProjectAgent,
126
+ findAgentById,
127
+ getDefaultAgentIds,
128
+ getDefaultIds,
129
+ getTopLevelAgents,
130
+ isDefaultAgent,
131
+ loadAllAgents,
132
+ loadAllAgentsDefault,
133
+ loadDefaultAgents,
134
+ loadItemsFromDir,
135
+ loadProjectAgents,
136
+ loadUserAgents,
137
+ pathExists,
138
+ saveAgent,
139
+ saveAgentToProject,
140
+ saveItemToDir,
141
+ setRuntimeConfig
142
+ } from "./chunk-FYYPQ27K.js";
141
143
  import {
142
144
  createProviderManager,
143
145
  detectModel,
144
146
  getLlmStatus,
145
147
  parseDefaultModelSelection
146
- } from "./chunk-VB23QPW3.js";
148
+ } from "./chunk-M6X72DYZ.js";
147
149
  import {
148
150
  getModelProfile
149
151
  } from "./chunk-V4IE7HJY.js";
@@ -155,13 +157,14 @@ import {
155
157
  } from "./chunk-HNCM3D7Y.js";
156
158
  import {
157
159
  SessionNotFoundError,
160
+ WorkspaceInUseError,
158
161
  proxyFetch
159
- } from "./chunk-IIRXKSB5.js";
162
+ } from "./chunk-ACL4YUJH.js";
160
163
  import {
161
164
  deleteSetting,
162
165
  getSetting,
163
166
  setSetting
164
- } from "./chunk-CNJ63FXJ.js";
167
+ } from "./chunk-STFIEU5F.js";
165
168
  import {
166
169
  initDatabase
167
170
  } from "./chunk-RGUUZD5B.js";
@@ -3457,7 +3460,7 @@ All file and git operations should use this directory.
3457
3460
  * switches to original first. Throws if target is "original".
3458
3461
  * Refuses deletion if other sessions reference this workspace.
3459
3462
  */
3460
- async deleteWorkspace(sessionId, target) {
3463
+ async deleteWorkspace(sessionId, target, force = false) {
3461
3464
  if (target === "original") throw new Error("Cannot delete the original workspace");
3462
3465
  validateWorkspaceName(target);
3463
3466
  const session = this.requireSession(sessionId);
@@ -3467,10 +3470,23 @@ All file and git operations should use this directory.
3467
3470
  (s) => s.id !== sessionId && s.workspace?.split("/").pop() === target
3468
3471
  );
3469
3472
  if (otherSessionsUsingIt.length > 0) {
3470
- const otherIds = otherSessionsUsingIt.map((s) => s.id).join(", ");
3471
- throw new Error(
3472
- `Workspace "${target}" is in use by other session(s): ${otherIds}. Switch them to original first.`
3473
- );
3473
+ if (force) {
3474
+ for (const other of otherSessionsUsingIt) {
3475
+ try {
3476
+ await this.switchWorkspace(other.id, "original");
3477
+ } catch (err) {
3478
+ throw new Error(
3479
+ `Failed to switch session ${other.id} to original: ${err instanceof Error ? err.message : String(err)}`
3480
+ );
3481
+ }
3482
+ }
3483
+ } else {
3484
+ const conflictingSessionIds = otherSessionsUsingIt.map((s) => s.id);
3485
+ throw new WorkspaceInUseError(
3486
+ `Workspace "${target}" is in use by other session(s): ${conflictingSessionIds.join(", ")}. Switch them to original first, or retry with force=true.`,
3487
+ conflictingSessionIds
3488
+ );
3489
+ }
3474
3490
  }
3475
3491
  const currentWsName = session.workspace?.split("/").pop();
3476
3492
  if (currentWsName === target) {
@@ -4102,6 +4118,12 @@ function createCommandRoutes(configDir, projectDir) {
4102
4118
  }
4103
4119
 
4104
4120
  // src/server/routes/agents.ts
4121
+ var defaultAgentIds = [];
4122
+ getDefaultAgentIds().then((ids) => {
4123
+ defaultAgentIds = ids;
4124
+ }).catch((err) => {
4125
+ logger.debug("Failed to pre-load default agent IDs", { error: err instanceof Error ? err.message : String(err) });
4126
+ });
4105
4127
  var config2 = {
4106
4128
  dirName: "agents",
4107
4129
  ext: ".agent.md",
@@ -4120,6 +4142,10 @@ var config2 = {
4120
4142
  validateCreate: (body) => {
4121
4143
  const meta = body["metadata"];
4122
4144
  if (!meta?.["id"] || !body["prompt"]) return "Missing required fields: metadata.id, prompt";
4145
+ const id = String(meta["id"]);
4146
+ if (defaultAgentIds.includes(id)) {
4147
+ return `ID "${id}" conflicts with a built-in agent. Use a different ID.`;
4148
+ }
4123
4149
  return null;
4124
4150
  },
4125
4151
  mapToResponse: (a) => a.metadata
@@ -4851,7 +4877,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
4851
4877
  try {
4852
4878
  const { challenge, completion } = await adapter.beginLogin({ providerId: provider.id });
4853
4879
  void completion.then(async ({ credentialRef }) => {
4854
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-EN3WEH4A.js");
4880
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-JN6MW5SL.js");
4855
4881
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
4856
4882
  const updatedConfig = updateProvider(globalConfig, provider.id, { credentialRef, authAdapter: adapter.id });
4857
4883
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
@@ -4885,7 +4911,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
4885
4911
  if (!context) return;
4886
4912
  const { provider, adapter } = context;
4887
4913
  if (provider.credentialRef && adapter) await adapter.logout(provider.credentialRef);
4888
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EN3WEH4A.js");
4914
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-JN6MW5SL.js");
4889
4915
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
4890
4916
  const updatedConfig = {
4891
4917
  ...globalConfig,
@@ -5365,7 +5391,7 @@ async function createServerHandle(config3) {
5365
5391
  const mcpManager = new McpManager({
5366
5392
  onToolsDiscovered: async (name, tools) => {
5367
5393
  try {
5368
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EN3WEH4A.js");
5394
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-JN6MW5SL.js");
5369
5395
  const mode = config3.mode ?? "production";
5370
5396
  const globalConfig = await loadGlobalConfig(mode, config3.globalConfigPath);
5371
5397
  const mcpServers2 = {
@@ -5396,7 +5422,7 @@ async function createServerHandle(config3) {
5396
5422
  setMcpTools(mcpTools);
5397
5423
  logger.info("MCP tools registered", { count: mcpTools.length });
5398
5424
  }
5399
- const { signalMcpReady } = await import("./server-V4VA4A2E.js");
5425
+ const { signalMcpReady } = await import("./server-E5IA4SK7.js");
5400
5426
  signalMcpReady();
5401
5427
  });
5402
5428
  const app = express();
@@ -5557,7 +5583,7 @@ async function createServerHandle(config3) {
5557
5583
  const { getProject: getProject2 } = await import("./projects-ZGJGICGT.js");
5558
5584
  const project = getProject2(req.params.id);
5559
5585
  if (!project) return res.status(404).json({ error: "Project not found" });
5560
- const { listBranches } = await import("./workspace-N2PIBOJV.js");
5586
+ const { listBranches } = await import("./workspace-MMV6V5P4.js");
5561
5587
  const branches = await listBranches(project.workdir);
5562
5588
  res.json({ branches });
5563
5589
  });
@@ -5567,10 +5593,13 @@ async function createServerHandle(config3) {
5567
5593
  if (!project) return res.status(404).json({ error: "Project not found" });
5568
5594
  const { branch } = req.body;
5569
5595
  if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
5570
- const { checkoutBranch } = await import("./workspace-N2PIBOJV.js");
5596
+ const { checkoutBranch, isGitRepository } = await import("./workspace-MMV6V5P4.js");
5597
+ if (!await isGitRepository(project.workdir)) {
5598
+ return res.status(400).json({ error: "Project is not a git repository" });
5599
+ }
5571
5600
  try {
5572
5601
  await checkoutBranch(project.workdir, branch);
5573
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-SFG42M4W.js");
5602
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-V3BF2OTU.js");
5574
5603
  const allSessions = sessionManager.listSessions();
5575
5604
  for (const s of allSessions) {
5576
5605
  if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
@@ -5589,15 +5618,24 @@ async function createServerHandle(config3) {
5589
5618
  if (!project) return res.status(404).json({ error: "Project not found" });
5590
5619
  const { name, sourceBranch } = req.body;
5591
5620
  if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
5592
- const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2 } = await import("./workspace-N2PIBOJV.js");
5621
+ const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2, getDefaultBranch: getDefaultBranch2, isGitRepository } = await import("./workspace-MMV6V5P4.js");
5622
+ if (!await isGitRepository(project.workdir)) {
5623
+ return res.status(400).json({ error: "Project is not a git repository" });
5624
+ }
5593
5625
  try {
5594
5626
  await validateRef2(project.workdir, name);
5595
5627
  let sb;
5596
5628
  if (sourceBranch) {
5597
5629
  sb = await resolveAndValidateSourceBranch2(project.workdir, sourceBranch, project.workdir);
5630
+ } else {
5631
+ sb = await resolveAndValidateSourceBranch2(
5632
+ project.workdir,
5633
+ await getDefaultBranch2(project.workdir),
5634
+ project.workdir
5635
+ );
5598
5636
  }
5599
5637
  await createBranch(project.workdir, name, sb);
5600
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-SFG42M4W.js");
5638
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-V3BF2OTU.js");
5601
5639
  const allSessions = sessionManager.listSessions();
5602
5640
  for (const s of allSessions) {
5603
5641
  if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
@@ -5614,7 +5652,7 @@ async function createServerHandle(config3) {
5614
5652
  const session = sessionManager.getSession(req.params.id);
5615
5653
  if (!session) return res.status(404).json({ error: "Session not found" });
5616
5654
  const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
5617
- const { listBranches, getDefaultBranch: getDefaultBranch2 } = await import("./workspace-N2PIBOJV.js");
5655
+ const { listBranches, getDefaultBranch: getDefaultBranch2 } = await import("./workspace-MMV6V5P4.js");
5618
5656
  const [branches, defaultBranch] = await Promise.all([
5619
5657
  listBranches(effectiveWorkdir),
5620
5658
  getDefaultBranch2(session.workdir)
@@ -5628,8 +5666,8 @@ async function createServerHandle(config3) {
5628
5666
  const { branch } = req.body;
5629
5667
  if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
5630
5668
  const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
5631
- const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-N2PIBOJV.js");
5632
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-SFG42M4W.js");
5669
+ const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-MMV6V5P4.js");
5670
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-V3BF2OTU.js");
5633
5671
  try {
5634
5672
  await validateRef2(effectiveWorkdir, branch);
5635
5673
  await checkoutBranch(effectiveWorkdir, branch);
@@ -5671,17 +5709,19 @@ All file and git operations should use this branch.
5671
5709
  const { name, sourceBranch } = req.body;
5672
5710
  if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
5673
5711
  const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
5674
- const { validateRef: validateRef2 } = await import("./workspace-N2PIBOJV.js");
5675
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-SFG42M4W.js");
5712
+ const { validateRef: validateRef2 } = await import("./workspace-MMV6V5P4.js");
5713
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-V3BF2OTU.js");
5676
5714
  try {
5677
5715
  await validateRef2(effectiveWorkdir, name);
5678
5716
  if (sourceBranch) {
5679
- const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-N2PIBOJV.js");
5717
+ const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-MMV6V5P4.js");
5680
5718
  const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, sourceBranch, session.workdir);
5681
5719
  await createBranch(effectiveWorkdir, name, sb);
5682
5720
  } else {
5683
- const { createBranch } = await import("./workspace-N2PIBOJV.js");
5684
- await createBranch(effectiveWorkdir, name);
5721
+ const { createBranch, getDefaultBranch: getDefaultBranch2, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2 } = await import("./workspace-MMV6V5P4.js");
5722
+ const defaultBranch = await getDefaultBranch2(session.workdir);
5723
+ const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, defaultBranch, session.workdir);
5724
+ await createBranch(effectiveWorkdir, name, sb);
5685
5725
  }
5686
5726
  updateSessionBranch2(req.params.id, name);
5687
5727
  if (session.workspace) {
@@ -5719,14 +5759,14 @@ All file and git operations should use this branch.
5719
5759
  const { getProject: getProject2 } = await import("./projects-ZGJGICGT.js");
5720
5760
  const project = getProject2(req.params.id);
5721
5761
  if (!project) return res.status(404).json({ error: "Project not found" });
5722
- const { listWorkspaces } = await import("./workspace-N2PIBOJV.js");
5762
+ const { listWorkspaces } = await import("./workspace-MMV6V5P4.js");
5723
5763
  const all = await listWorkspaces(project.name, project.workdir);
5724
5764
  const workspacesList = all.filter((ws) => ws.path !== project.workdir);
5725
5765
  res.json({ workspaces: workspacesList });
5726
5766
  });
5727
5767
  app.get("/api/sessions", async (req, res) => {
5728
- const { getRecentUserPromptsForSession } = await import("./events-GF2WNELM.js");
5729
- const { getPendingConfirmationsBySession } = await import("./path-security-AWDNKRZ4.js");
5768
+ const { getRecentUserPromptsForSession } = await import("./events-OEDAFNEI.js");
5769
+ const { getPendingConfirmationsBySession } = await import("./path-security-7ZNIG3ZE.js");
5730
5770
  const projectId = req.query["projectId"];
5731
5771
  const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
5732
5772
  const offset = parseInt(req.query["offset"]) || 0;
@@ -5794,6 +5834,12 @@ All file and git operations should use this branch.
5794
5834
  if (!session) return res.status(404).json({ error: "Session not found" });
5795
5835
  const { target, branch, sourceBranch } = req.body;
5796
5836
  if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
5837
+ const project = sessionManager.getProject(session.projectId);
5838
+ if (!project) return res.status(404).json({ error: "Project not found" });
5839
+ const { isGitRepository } = await import("./workspace-MMV6V5P4.js");
5840
+ if (!await isGitRepository(project.workdir)) {
5841
+ return res.status(400).json({ error: "Project is not a git repository" });
5842
+ }
5797
5843
  try {
5798
5844
  const updated = await sessionManager.switchWorkspace(req.params.id, target, branch, sourceBranch);
5799
5845
  res.json({ session: updated });
@@ -5804,20 +5850,32 @@ All file and git operations should use this branch.
5804
5850
  app.post("/api/sessions/:id/delete-workspace", async (req, res) => {
5805
5851
  const session = sessionManager.getSession(req.params.id);
5806
5852
  if (!session) return res.status(404).json({ error: "Session not found" });
5807
- const { target } = req.body;
5853
+ const { target, force } = req.body;
5808
5854
  if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
5855
+ const project = sessionManager.getProject(session.projectId);
5856
+ if (!project) return res.status(404).json({ error: "Project not found" });
5857
+ const { isGitRepository } = await import("./workspace-MMV6V5P4.js");
5858
+ if (!await isGitRepository(project.workdir)) {
5859
+ return res.status(400).json({ error: "Project is not a git repository" });
5860
+ }
5809
5861
  try {
5810
- const updated = await sessionManager.deleteWorkspace(req.params.id, target);
5862
+ const updated = await sessionManager.deleteWorkspace(req.params.id, target, force === true);
5811
5863
  res.json({ session: updated });
5812
5864
  } catch (err) {
5865
+ if (err instanceof WorkspaceInUseError) {
5866
+ return res.status(409).json({
5867
+ error: err.message,
5868
+ conflictingSessionIds: err.conflictingSessionIds
5869
+ });
5870
+ }
5813
5871
  res.status(400).json({ error: err instanceof Error ? err.message : "Failed to delete workspace" });
5814
5872
  }
5815
5873
  });
5816
5874
  app.get("/api/sessions/:id", async (req, res) => {
5817
- const { getEventStore: getEventStore2, combineEventsWithSnapshot } = await import("./events-GF2WNELM.js");
5818
- const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-UACKBHUZ.js");
5819
- const { getPendingQuestionsForSession } = await import("./tools-X4YLRR2Y.js");
5820
- const { getMaxVisibleItems } = await import("./settings-6TJIHDVX.js");
5875
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot } = await import("./events-OEDAFNEI.js");
5876
+ const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-FGTCP73N.js");
5877
+ const { getPendingQuestionsForSession } = await import("./tools-ZUTPBREL.js");
5878
+ const { getMaxVisibleItems } = await import("./settings-AGNYWEIE.js");
5821
5879
  const session = sessionManager.getSession(req.params.id);
5822
5880
  if (!session) {
5823
5881
  return res.status(404).json({ error: "Session not found" });
@@ -5847,8 +5905,8 @@ All file and git operations should use this branch.
5847
5905
  if (!session) {
5848
5906
  return res.status(404).json({ error: "Session not found" });
5849
5907
  }
5850
- const { stopSessionExecution } = await import("./chat-handler-6KBOE4YA.js");
5851
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-X4YLRR2Y.js");
5908
+ const { stopSessionExecution } = await import("./chat-handler-3CWMOIOR.js");
5909
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-ZUTPBREL.js");
5852
5910
  sessionManager.clearMessageQueue(sessionId);
5853
5911
  stopSessionExecution(sessionId, sessionManager);
5854
5912
  abortSession(sessionId);
@@ -5877,9 +5935,9 @@ All file and git operations should use this branch.
5877
5935
  res.json({ success: true });
5878
5936
  });
5879
5937
  app.post("/api/sessions/:id/provider", async (req, res) => {
5880
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-GF2WNELM.js");
5881
- const { buildMessagesFromStoredEvents } = await import("./folding-UACKBHUZ.js");
5882
- const { getMaxVisibleItems } = await import("./settings-6TJIHDVX.js");
5938
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-OEDAFNEI.js");
5939
+ const { buildMessagesFromStoredEvents } = await import("./folding-FGTCP73N.js");
5940
+ const { getMaxVisibleItems } = await import("./settings-AGNYWEIE.js");
5883
5941
  const sessionId = req.params.id;
5884
5942
  const session = sessionManager.getSession(sessionId);
5885
5943
  if (!session) {
@@ -5914,7 +5972,7 @@ All file and git operations should use this branch.
5914
5972
  if (!result.success) {
5915
5973
  return res.status(500).json({ error: result.error ?? "Failed to set default model" });
5916
5974
  }
5917
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-EN3WEH4A.js");
5975
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-JN6MW5SL.js");
5918
5976
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
5919
5977
  const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model);
5920
5978
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
@@ -5992,9 +6050,9 @@ All file and git operations should use this branch.
5992
6050
  res.json({ success: true });
5993
6051
  });
5994
6052
  app.put("/api/sessions/:id/mode", async (req, res) => {
5995
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-GF2WNELM.js");
5996
- const { buildMessagesFromStoredEvents } = await import("./folding-UACKBHUZ.js");
5997
- const { getMaxVisibleItems } = await import("./settings-6TJIHDVX.js");
6053
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-OEDAFNEI.js");
6054
+ const { buildMessagesFromStoredEvents } = await import("./folding-FGTCP73N.js");
6055
+ const { getMaxVisibleItems } = await import("./settings-AGNYWEIE.js");
5998
6056
  const sessionId = req.params.id;
5999
6057
  const session = sessionManager.getSession(sessionId);
6000
6058
  if (!session) {
@@ -6055,7 +6113,7 @@ All file and git operations should use this branch.
6055
6113
  if (alwaysAllow !== void 0 && typeof alwaysAllow !== "boolean") {
6056
6114
  return res.status(400).json({ error: "alwaysAllow must be a boolean if provided" });
6057
6115
  }
6058
- const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-X4YLRR2Y.js");
6116
+ const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-ZUTPBREL.js");
6059
6117
  const pendingSessionId = getConfirmationSessionId(callId);
6060
6118
  if (!pendingSessionId) {
6061
6119
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -6067,11 +6125,11 @@ All file and git operations should use this branch.
6067
6125
  if (!result.found) {
6068
6126
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
6069
6127
  }
6070
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-GF2WNELM.js");
6071
- const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-UACKBHUZ.js");
6128
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-OEDAFNEI.js");
6129
+ const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-FGTCP73N.js");
6072
6130
  const { createSessionStateMessage } = await import("./protocol-Q7X4NEME.js");
6073
- const { getPendingQuestionsForSession } = await import("./tools-X4YLRR2Y.js");
6074
- const { getMaxVisibleItems } = await import("./settings-6TJIHDVX.js");
6131
+ const { getPendingQuestionsForSession } = await import("./tools-ZUTPBREL.js");
6132
+ const { getMaxVisibleItems } = await import("./settings-AGNYWEIE.js");
6075
6133
  const eventStore = getEventStore2();
6076
6134
  const { snapshot, events: eventsSinceSnapshot } = eventStore.getEventsSinceSnapshot(sessionId);
6077
6135
  const events = combineEvents(sessionId, snapshot, eventsSinceSnapshot);
@@ -6107,7 +6165,7 @@ All file and git operations should use this branch.
6107
6165
  if (!skip && typeof answer !== "string") {
6108
6166
  return res.status(400).json({ error: "answer is required when not skipping" });
6109
6167
  }
6110
- const { provideAnswer } = await import("./tools-X4YLRR2Y.js");
6168
+ const { provideAnswer } = await import("./tools-ZUTPBREL.js");
6111
6169
  const found = provideAnswer(callId, answer ?? "", skip ?? false);
6112
6170
  if (!found) {
6113
6171
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -6135,7 +6193,7 @@ All file and git operations should use this branch.
6135
6193
  if (!session) {
6136
6194
  return res.status(404).json({ error: "Session not found" });
6137
6195
  }
6138
- const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-6TJIHDVX.js");
6196
+ const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-AGNYWEIE.js");
6139
6197
  if (getSetting2(SETTINGS_KEYS.CACHE_WARMING) !== "true") {
6140
6198
  return res.json({ success: false, reason: "disabled" });
6141
6199
  }
@@ -6167,7 +6225,7 @@ All file and git operations should use this branch.
6167
6225
  backend: activeProvider?.backend ?? llmClient.getBackend(),
6168
6226
  model: llmClient.getModel()
6169
6227
  };
6170
- const { runAgentTurn, TurnMetrics } = await import("./orchestrator-BO62JYFM.js");
6228
+ const { runAgentTurn, TurnMetrics } = await import("./orchestrator-6RYJYR3T.js");
6171
6229
  runAgentTurn(
6172
6230
  {
6173
6231
  sessionManager,
@@ -6205,15 +6263,15 @@ All file and git operations should use this branch.
6205
6263
  if (!session) {
6206
6264
  return res.status(404).json({ error: "Session not found" });
6207
6265
  }
6208
- const { stopSessionExecution } = await import("./chat-handler-6KBOE4YA.js");
6209
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-X4YLRR2Y.js");
6266
+ const { stopSessionExecution } = await import("./chat-handler-3CWMOIOR.js");
6267
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-ZUTPBREL.js");
6210
6268
  const queuedMessages = sessionManager.getQueueState(sessionId);
6211
6269
  sessionManager.clearMessageQueue(sessionId);
6212
6270
  stopSessionExecution(sessionId, sessionManager);
6213
6271
  abortSession(sessionId);
6214
6272
  cancelQuestionsForSession(sessionId, "Session stopped by user");
6215
6273
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
6216
- const eventStore = (await import("./events-GF2WNELM.js")).getEventStore();
6274
+ const eventStore = (await import("./events-OEDAFNEI.js")).getEventStore();
6217
6275
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
6218
6276
  res.json({ success: true, queuedMessages });
6219
6277
  });
@@ -6227,7 +6285,7 @@ All file and git operations should use this branch.
6227
6285
  if (typeof messageIndex !== "number" || messageIndex < 0) {
6228
6286
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
6229
6287
  }
6230
- const { truncateSessionMessages } = await import("./events-GF2WNELM.js");
6288
+ const { truncateSessionMessages } = await import("./events-OEDAFNEI.js");
6231
6289
  truncateSessionMessages(sessionId, messageIndex);
6232
6290
  res.json({ success: true });
6233
6291
  });
@@ -6244,8 +6302,8 @@ All file and git operations should use this branch.
6244
6302
  if (content !== void 0 && (typeof content !== "string" || !content.trim())) {
6245
6303
  return res.status(400).json({ error: "content must be a non-empty string if provided" });
6246
6304
  }
6247
- const { getEventStore: getEventStore2 } = await import("./events-GF2WNELM.js");
6248
- const { buildMessagesFromStoredEvents } = await import("./folding-UACKBHUZ.js");
6305
+ const { getEventStore: getEventStore2 } = await import("./events-OEDAFNEI.js");
6306
+ const { buildMessagesFromStoredEvents } = await import("./folding-FGTCP73N.js");
6249
6307
  const eventStore = getEventStore2();
6250
6308
  const events = eventStore.getEvents(sessionId);
6251
6309
  const { messages } = buildMessagesFromStoredEvents(events);
@@ -6257,7 +6315,7 @@ All file and git operations should use this branch.
6257
6315
  if (msg.role !== "user" || msg.isSystemGenerated) {
6258
6316
  return res.status(400).json({ error: "Can only replay user messages" });
6259
6317
  }
6260
- const { truncateSessionMessages } = await import("./events-GF2WNELM.js");
6318
+ const { truncateSessionMessages } = await import("./events-OEDAFNEI.js");
6261
6319
  truncateSessionMessages(sessionId, msgIndex - 1);
6262
6320
  sessionManager.queueMessage(sessionId, "asap", content ?? msg.content, msg.attachments, msg.messageKind);
6263
6321
  res.json({ success: true });
@@ -6289,7 +6347,7 @@ All file and git operations should use this branch.
6289
6347
  res.json({ accepted: true });
6290
6348
  });
6291
6349
  app.get("/api/settings", async (req, res) => {
6292
- const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-6TJIHDVX.js");
6350
+ const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-AGNYWEIE.js");
6293
6351
  const keysParam = req.query["keys"];
6294
6352
  if (!keysParam) {
6295
6353
  return res.status(400).json({ error: "keys query parameter is required" });
@@ -6302,19 +6360,19 @@ All file and git operations should use this branch.
6302
6360
  res.json(result);
6303
6361
  });
6304
6362
  app.get("/api/settings/:key", async (req, res) => {
6305
- const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-6TJIHDVX.js");
6363
+ const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-AGNYWEIE.js");
6306
6364
  const key = req.params.key;
6307
6365
  const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
6308
6366
  res.json({ key, value });
6309
6367
  });
6310
6368
  app.get("/api/settings/:key", async (req, res) => {
6311
- const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-6TJIHDVX.js");
6369
+ const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-AGNYWEIE.js");
6312
6370
  const key = req.params.key;
6313
6371
  const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
6314
6372
  res.json({ key, value });
6315
6373
  });
6316
6374
  app.put("/api/settings/:key", async (req, res) => {
6317
- const { setSetting: setSetting2 } = await import("./settings-6TJIHDVX.js");
6375
+ const { setSetting: setSetting2 } = await import("./settings-AGNYWEIE.js");
6318
6376
  const key = req.params.key;
6319
6377
  const { value } = req.body;
6320
6378
  if (value === void 0) {
@@ -6341,7 +6399,7 @@ All file and git operations should use this branch.
6341
6399
  }
6342
6400
  });
6343
6401
  app.get("/api/tools/shells", async (_req, res) => {
6344
- const { listAvailableShells } = await import("./platform-7AK5MB4K.js");
6402
+ const { listAvailableShells } = await import("./platform-OYKGQ7Z3.js");
6345
6403
  res.json({ shells: listAvailableShells() });
6346
6404
  });
6347
6405
  app.get("/api/config", async (_req, res) => {
@@ -6350,7 +6408,7 @@ All file and git operations should use this branch.
6350
6408
  let visionFallback;
6351
6409
  let globalWorkdir;
6352
6410
  try {
6353
- const { loadGlobalConfig, getVisionFallback } = await import("./config-EN3WEH4A.js");
6411
+ const { loadGlobalConfig, getVisionFallback } = await import("./config-JN6MW5SL.js");
6354
6412
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6355
6413
  const fallback = getVisionFallback(globalConfig);
6356
6414
  if (fallback) {
@@ -6500,7 +6558,7 @@ All file and git operations should use this branch.
6500
6558
  }
6501
6559
  });
6502
6560
  app.post("/api/proxy/test", async (_req, res) => {
6503
- const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-6TJIHDVX.js");
6561
+ const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-AGNYWEIE.js");
6504
6562
  const proxyUrl = getSetting2(SETTINGS_KEYS.PROXY_URL);
6505
6563
  if (!proxyUrl) {
6506
6564
  return res.status(400).json({ success: false, error: "No proxy URL configured" });
@@ -6527,7 +6585,7 @@ All file and git operations should use this branch.
6527
6585
  const backend = req.query["backend"];
6528
6586
  if (!url) return res.status(400).json({ error: "url is required" });
6529
6587
  try {
6530
- const { fetchModelsWithContext } = await import("./provider-manager-7246YSJT.js");
6588
+ const { fetchModelsWithContext } = await import("./provider-manager-3DW3A2VC.js");
6531
6589
  const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
6532
6590
  const models = await fetchModelsWithContext(
6533
6591
  url,
@@ -6598,7 +6656,7 @@ All file and git operations should use this branch.
6598
6656
  const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
6599
6657
  const { getBackendCapabilities } = await import("./backend-P3GHHLHJ.js");
6600
6658
  const { buildNonStreamingCreateParams } = await import("./client-pure-5YE5WFJP.js");
6601
- const { OpenAIHttpClient } = await import("./http-client-QZY7W36Q.js");
6659
+ const { OpenAIHttpClient } = await import("./http-client-I52X7GQB.js");
6602
6660
  const { ensureVersionPrefix } = await import("./url-utils-SAJP7AEX.js");
6603
6661
  const profile = getModelProfile2(model);
6604
6662
  const capabilities = getBackendCapabilities(backend || "unknown");
@@ -6667,7 +6725,7 @@ All file and git operations should use this branch.
6667
6725
  return res.status(400).json({ error: "name, url, and backend are required" });
6668
6726
  }
6669
6727
  try {
6670
- const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-EN3WEH4A.js");
6728
+ const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-JN6MW5SL.js");
6671
6729
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6672
6730
  const providerBackend = backend;
6673
6731
  const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
@@ -6707,7 +6765,7 @@ All file and git operations should use this branch.
6707
6765
  app.post("/api/init/config", async (req, res) => {
6708
6766
  const { workdir, visionFallback } = req.body;
6709
6767
  try {
6710
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EN3WEH4A.js");
6768
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-JN6MW5SL.js");
6711
6769
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6712
6770
  const updatedConfig = {
6713
6771
  ...globalConfig,
@@ -6746,7 +6804,7 @@ All file and git operations should use this branch.
6746
6804
  });
6747
6805
  app.delete("/api/providers/:id", async (req, res) => {
6748
6806
  const { id } = req.params;
6749
- const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-EN3WEH4A.js");
6807
+ const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-JN6MW5SL.js");
6750
6808
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6751
6809
  const updatedConfig = removeProvider(globalConfig, id);
6752
6810
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
@@ -6758,7 +6816,7 @@ All file and git operations should use this branch.
6758
6816
  const { id } = req.params;
6759
6817
  const { isLocal } = req.body;
6760
6818
  try {
6761
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-EN3WEH4A.js");
6819
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-JN6MW5SL.js");
6762
6820
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6763
6821
  const provider = globalConfig.providers.find((p) => p.id === id);
6764
6822
  if (!provider) {
@@ -6789,7 +6847,7 @@ All file and git operations should use this branch.
6789
6847
  transportAdapter
6790
6848
  } = req.body;
6791
6849
  try {
6792
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-EN3WEH4A.js");
6850
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-JN6MW5SL.js");
6793
6851
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6794
6852
  const provider = globalConfig.providers.find((p) => p.id === id);
6795
6853
  if (!provider) {
@@ -6829,7 +6887,7 @@ All file and git operations should use this branch.
6829
6887
  return res.status(400).json({ error: result.error });
6830
6888
  }
6831
6889
  const llmClient = getLLMClient();
6832
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-EN3WEH4A.js");
6890
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-JN6MW5SL.js");
6833
6891
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6834
6892
  const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
6835
6893
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
@@ -6856,7 +6914,7 @@ All file and git operations should use this branch.
6856
6914
  });
6857
6915
  async function rebuildMcpTools() {
6858
6916
  const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
6859
- const { setMcpTools: setMcpTools2 } = await import("./tools-X4YLRR2Y.js");
6917
+ const { setMcpTools: setMcpTools2 } = await import("./tools-ZUTPBREL.js");
6860
6918
  const mcpTools = createMcpTools2(mcpManager);
6861
6919
  setMcpTools2(mcpTools);
6862
6920
  }
@@ -6926,7 +6984,7 @@ All file and git operations should use this branch.
6926
6984
  };
6927
6985
  await mcpManager.addServer(name, serverCfg);
6928
6986
  const server = mcpManager.getServer(name);
6929
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EN3WEH4A.js");
6987
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-JN6MW5SL.js");
6930
6988
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6931
6989
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
6932
6990
  await saveGlobalConfig(
@@ -6979,7 +7037,7 @@ All file and git operations should use this branch.
6979
7037
  return res.status(400).json({ error: "timeout must be a positive number" });
6980
7038
  }
6981
7039
  try {
6982
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EN3WEH4A.js");
7040
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-JN6MW5SL.js");
6983
7041
  const { applyMcpServerUpdate } = await import("./update-server-V6GJ43WH.js");
6984
7042
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
6985
7043
  const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
@@ -7023,7 +7081,7 @@ All file and git operations should use this branch.
7023
7081
  return res.status(404).json({ error: `MCP server '${name}' not found` });
7024
7082
  }
7025
7083
  mcpManager.removeServer(name);
7026
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EN3WEH4A.js");
7084
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-JN6MW5SL.js");
7027
7085
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7028
7086
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
7029
7087
  delete updatedMcpServers[name];
@@ -7052,7 +7110,7 @@ All file and git operations should use this branch.
7052
7110
  await mcpManager.setToolEnabled(name, toolName, enabled);
7053
7111
  const server = mcpManager.getServer(name);
7054
7112
  if (server) {
7055
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EN3WEH4A.js");
7113
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-JN6MW5SL.js");
7056
7114
  const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
7057
7115
  const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
7058
7116
  const serverCfg = mcpServers2[name];
@@ -7103,13 +7161,13 @@ All file and git operations should use this branch.
7103
7161
  })
7104
7162
  );
7105
7163
  app.get("/api/sessions/:id/background-processes", async (req, res) => {
7106
- const { getSessionProcesses } = await import("./manager-WOUOQVLV.js");
7164
+ const { getSessionProcesses } = await import("./manager-TD2UT62O.js");
7107
7165
  const sessionId = req.params.id;
7108
7166
  const processes = getSessionProcesses(sessionId);
7109
7167
  res.json({ processes });
7110
7168
  });
7111
7169
  app.post("/api/sessions/:id/background-process/:processId/stop", async (req, res) => {
7112
- const { stopProcess } = await import("./manager-WOUOQVLV.js");
7170
+ const { stopProcess } = await import("./manager-TD2UT62O.js");
7113
7171
  const sessionId = req.params.id;
7114
7172
  const processId = req.params.processId;
7115
7173
  const session = sessionManager.getSession(sessionId);
@@ -7252,7 +7310,7 @@ All file and git operations should use this branch.
7252
7310
  const state = sessionManager.getContextState(sessionId);
7253
7311
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
7254
7312
  });
7255
- const { QueueProcessor } = await import("./processor-BLGEVOPK.js");
7313
+ const { QueueProcessor } = await import("./processor-IGRFA3KA.js");
7256
7314
  const queueProcessor = new QueueProcessor({
7257
7315
  sessionManager,
7258
7316
  providerManager,
@@ -7332,4 +7390,4 @@ export {
7332
7390
  createServerHandle,
7333
7391
  createServer
7334
7392
  };
7335
- //# sourceMappingURL=chunk-7ROIY3QN.js.map
7393
+ //# sourceMappingURL=chunk-DLJYYWM2.js.map