openfox 2.0.104 → 2.0.106

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 (86) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/CHANGELOG.md +41 -0
  3. package/dist/agent-defaults/planner.agent.md +2 -1
  4. package/dist/{chat-handler-G2ZJNAVB.js → chat-handler-A22X22VZ.js} +24 -24
  5. package/dist/{chunk-YXIDKMBJ.js → chunk-26DEYDYV.js} +4 -4
  6. package/dist/{chunk-6SIX7P6O.js → chunk-2GM6SUIQ.js} +2 -2
  7. package/dist/{chunk-ZASSAZ73.js → chunk-33Q7LCVD.js} +2 -2
  8. package/dist/{chunk-S5HDT5RQ.js → chunk-3C73IUUL.js} +2 -2
  9. package/dist/{chunk-F766OIDT.js → chunk-46KNPXY6.js} +3 -3
  10. package/dist/{chunk-5ZJYEINJ.js → chunk-5M45NHQ2.js} +2 -2
  11. package/dist/{chunk-WWFH5GAR.js → chunk-6FPGJR7O.js} +2 -2
  12. package/dist/{chunk-PKLWSTDB.js → chunk-6M44ZHQA.js} +32 -32
  13. package/dist/{chunk-TFQSCHVU.js → chunk-6VNB4L4V.js} +3 -3
  14. package/dist/{chunk-3NVISPE7.js → chunk-AYUUGKZU.js} +14 -16
  15. package/dist/chunk-C5YV3EA4.js +7 -0
  16. package/dist/{chunk-B56G5OEF.js → chunk-D6ODGTSZ.js} +5 -3
  17. package/dist/{chunk-XWW7LOU4.js → chunk-G2VLGZ3Y.js} +256 -164
  18. package/dist/{chunk-DMI2BXHA.js → chunk-GXW4CRR5.js} +7 -6
  19. package/dist/{chunk-W2KZ7H55.js → chunk-HU22EVEM.js} +7 -7
  20. package/dist/{chunk-OUMHR7LR.js → chunk-IA4Y3CKA.js} +7 -6
  21. package/dist/{chunk-SPA7PQPJ.js → chunk-KIAKWUZ3.js} +2 -2
  22. package/dist/{chunk-GLF65XDS.js → chunk-LCQ5AN6Y.js} +8 -1
  23. package/dist/{chunk-B76OP3OE.js → chunk-LOHVZGCM.js} +4 -4
  24. package/dist/{chunk-UADZ2LZJ.js → chunk-OEPRHAIO.js} +3 -3
  25. package/dist/{chunk-HZXWVD5A.js → chunk-P4APMCTX.js} +85 -25
  26. package/dist/{chunk-EFIC3TUX.js → chunk-QBKAW5H4.js} +7 -7
  27. package/dist/{chunk-D3SXT3BL.js → chunk-RRTKVJMF.js} +5 -10
  28. package/dist/{chunk-J27BLIPY.js → chunk-SGJ3LSVA.js} +3 -2
  29. package/dist/{chunk-WHJ67MO2.js → chunk-SUTJJWUK.js} +7 -7
  30. package/dist/{chunk-ERKPMNC7.js → chunk-TB7TTPYQ.js} +2 -2
  31. package/dist/{chunk-2COWPTSJ.js → chunk-UCIZV76E.js} +4 -8
  32. package/dist/{chunk-EF7KGWF6.js → chunk-UXQN7FGB.js} +2 -2
  33. package/dist/{chunk-5VKT34HE.js → chunk-V6Y6OLB4.js} +2 -2
  34. package/dist/{chunk-KCED2X4H.js → chunk-WDJOSRIB.js} +12 -5
  35. package/dist/{chunk-62QCBNPE.js → chunk-WLJJRX22.js} +10 -3
  36. package/dist/{chunk-ERTTKKCE.js → chunk-X3USQHHK.js} +2 -2
  37. package/dist/cli/dev.js +1 -1
  38. package/dist/cli/index.js +1 -1
  39. package/dist/{client-2EAJAGPC.js → client-MP3FSNN7.js} +6 -6
  40. package/dist/{client-pure-ONSVWEG5.js → client-pure-USVHN4WG.js} +2 -2
  41. package/dist/{compactor-IEYTUHYX.js → compactor-KK2BVJK5.js} +12 -12
  42. package/dist/{config-3FKJV3KI.js → config-HX7FDKGJ.js} +2 -2
  43. package/dist/{dynamic-context-Z5BU2RVP.js → dynamic-context-ZUXI5UTW.js} +9 -9
  44. package/dist/{events-BGVLDGLK.js → events-OJ2R6OEM.js} +7 -7
  45. package/dist/{folding-AJMZBHNR.js → folding-DUZSKCZF.js} +5 -5
  46. package/dist/http-client-KJXFSK7A.js +11 -0
  47. package/dist/{inspect-proxy-GF6OI7MR.js → inspect-proxy-N42Z5TOG.js} +4 -4
  48. package/dist/{manager-GGIIENDX.js → manager-N27WNW5B.js} +5 -5
  49. package/dist/{model-overrides-BLEFI7FQ.js → model-overrides-36SQR3JR.js} +4 -4
  50. package/dist/{openFolder-Z27FEM5M.js → openFolder-HX7X356L.js} +2 -2
  51. package/dist/{orchestrator-SYAYO6NS.js → orchestrator-VZORJ7KF.js} +23 -23
  52. package/dist/package.json +4 -2
  53. package/dist/{path-security-JCDBLFIE.js → path-security-QCIA6YFV.js} +8 -8
  54. package/dist/{permissions-CGEK3DGZ.js → permissions-K6YEA2ZZ.js} +12 -1
  55. package/dist/{platform-GZ2WIDS5.js → platform-Q6T3AUHA.js} +4 -4
  56. package/dist/{processor-CBGV2K4E.js → processor-QYVHKRIV.js} +23 -23
  57. package/dist/{project-creator-SMWFMIU5.js → project-creator-BVA55HY6.js} +4 -4
  58. package/dist/{projects-M5XKC7O6.js → projects-PQXME5S4.js} +3 -3
  59. package/dist/{protocol-rfiBDoXm.d.ts → protocol-zRSsysOe.d.ts} +1 -1
  60. package/dist/provider/index.d.ts +4 -4
  61. package/dist/{provider-XCVHKXPS.js → provider-RQQ5JN34.js} +9 -9
  62. package/dist/{provider-manager-AUYP3QAM.js → provider-manager-RUC5QQ75.js} +7 -7
  63. package/dist/{registry-M2QVGRNK.js → registry-BDSTPV65.js} +4 -4
  64. package/dist/{serve-NPS4GJWH.js → serve-2O7G2WZF.js} +32 -32
  65. package/dist/server/index.d.ts +33 -4
  66. package/dist/server/index.js +31 -31
  67. package/dist/server-CYE6XY7J.js +47 -0
  68. package/dist/{session-overrides-HA5IQYLI.js → session-overrides-SFWPS5CT.js} +6 -6
  69. package/dist/{sessions-ZV2WRC6K.js → sessions-TZNUQJ2I.js} +5 -5
  70. package/dist/{settings-TGCITCVA.js → settings-5LG7IB3K.js} +3 -3
  71. package/dist/shared/index.d.ts +3 -3
  72. package/dist/skill-defaults/browser/SKILL.md +36 -22
  73. package/dist/{tools-KKALZLKX.js → tools-Y4F4HJPO.js} +21 -21
  74. package/dist/{types-o0v5xVxu.d.ts → types-CTl70hba.d.ts} +12 -1
  75. package/dist/{types-o-YQ3Bfq.d.ts → types-_uF_PRaD.d.ts} +1 -1
  76. package/dist/{update-7BEZMI4R.js → update-QEZIUJHR.js} +2 -2
  77. package/dist/web/assets/index-BxI3Y9C7.js +323 -0
  78. package/dist/web/index.html +1 -1
  79. package/dist/web/sw.js +1 -1
  80. package/dist/workflow-defaults/default.workflow.json +3 -3
  81. package/dist/{workspace-2NDXTCVR.js → workspace-2OG5VQG6.js} +4 -4
  82. package/package.json +4 -2
  83. package/dist/chunk-MLOCSFIW.js +0 -7
  84. package/dist/http-client-A7A4XWNK.js +0 -11
  85. package/dist/server-FKM4FQKD.js +0 -47
  86. package/dist/web/assets/index-BoWCT9PC.js +0 -323
@@ -5,13 +5,13 @@ import {
5
5
  foldContextState,
6
6
  foldSessionState,
7
7
  spreadOptionalMessageFields
8
- } from "./chunk-S5HDT5RQ.js";
8
+ } from "./chunk-3C73IUUL.js";
9
9
  import {
10
10
  updateSessionMessageCount
11
- } from "./chunk-OUMHR7LR.js";
11
+ } from "./chunk-IA4Y3CKA.js";
12
12
  import {
13
13
  getRuntimeConfig
14
- } from "./chunk-6SIX7P6O.js";
14
+ } from "./chunk-2GM6SUIQ.js";
15
15
  import {
16
16
  logger
17
17
  } from "./chunk-K44MW7JJ.js";
@@ -948,7 +948,7 @@ function emitRunningChanged(sessionId, isRunning) {
948
948
  data: { isRunning }
949
949
  });
950
950
  }
951
- function emitWorkflowExecutionChanged(sessionId, executionId, workflowId, workflowName, workflowColor, status, currentStepId, currentStepName) {
951
+ function emitWorkflowExecutionChanged(sessionId, executionId, workflowId, workflowName, workflowColor, status, currentStepId, currentStepName, pendingChoices) {
952
952
  const eventStore = getEventStore();
953
953
  eventStore.append(sessionId, {
954
954
  type: "workflow.execution_changed",
@@ -959,7 +959,8 @@ function emitWorkflowExecutionChanged(sessionId, executionId, workflowId, workfl
959
959
  ...workflowColor ? { workflowColor } : {},
960
960
  status,
961
961
  ...currentStepId ? { currentStepId } : {},
962
- ...currentStepName ? { currentStepName } : {}
962
+ ...currentStepName ? { currentStepName } : {},
963
+ ...pendingChoices !== void 0 ? { pendingChoices } : {}
963
964
  }
964
965
  });
965
966
  }
@@ -1175,4 +1176,4 @@ export {
1175
1176
  truncateSessionMessages,
1176
1177
  getRecentUserPromptsForSession
1177
1178
  };
1178
- //# sourceMappingURL=chunk-DMI2BXHA.js.map
1179
+ //# sourceMappingURL=chunk-GXW4CRR5.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  getAllInstructions,
3
3
  getEnabledSkillMetadata
4
- } from "./chunk-B76OP3OE.js";
4
+ } from "./chunk-LOHVZGCM.js";
5
5
  import {
6
6
  buildTopLevelSystemPrompt
7
- } from "./chunk-J27BLIPY.js";
7
+ } from "./chunk-SGJ3LSVA.js";
8
8
  import {
9
9
  findAgentById,
10
10
  getRuntimeConfig,
11
11
  getSubAgents,
12
12
  loadAllAgentsDefault,
13
13
  resolveDefaultAgentId
14
- } from "./chunk-6SIX7P6O.js";
14
+ } from "./chunk-2GM6SUIQ.js";
15
15
  import {
16
16
  logger
17
17
  } from "./chunk-K44MW7JJ.js";
@@ -94,7 +94,7 @@ async function loadSessionContext(sessionManager, sessionId) {
94
94
  const { content: instructionContent } = await getAllInstructions(session.workdir, session.projectId);
95
95
  const runtimeConfig = getRuntimeConfig();
96
96
  const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
97
- const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
97
+ const skills = await getEnabledSkillMetadata(configDir, sessionManager.getEffectiveWorkdir(sessionId));
98
98
  return { instructionContent: instructionContent ?? "", skills };
99
99
  }
100
100
  function resolveAgentDef(sessionManager, sessionId) {
@@ -105,7 +105,7 @@ function resolveAgentDef(sessionManager, sessionId) {
105
105
  }
106
106
  async function buildCachedPrompt(sessionManager, sessionId, agentDef, modelName) {
107
107
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
108
- const { getToolRegistryForAgent } = await import("./tools-KKALZLKX.js");
108
+ const { getToolRegistryForAgent } = await import("./tools-Y4F4HJPO.js");
109
109
  const tools = getToolRegistryForAgent(agentDef, sessionId).definitions;
110
110
  const toolFingerprint = getToolFingerprint(tools);
111
111
  const allAgents = await loadAllAgentsDefault();
@@ -124,7 +124,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef, modelName)
124
124
  async function computeSessionHash(sessionManager, sessionId, modelName) {
125
125
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
126
126
  const agentDef = await resolveAgentDef(sessionManager, sessionId);
127
- const { getToolRegistryForAgent } = await import("./tools-KKALZLKX.js");
127
+ const { getToolRegistryForAgent } = await import("./tools-Y4F4HJPO.js");
128
128
  const tools = getToolRegistryForAgent(agentDef, sessionId).definitions;
129
129
  const toolFingerprint = getToolFingerprint(tools);
130
130
  return computeDynamicContextHash(instructionContent, skills, toolFingerprint, modelName);
@@ -148,4 +148,4 @@ export {
148
148
  computeSessionHash,
149
149
  applyDynamicContext
150
150
  };
151
- //# sourceMappingURL=chunk-W2KZ7H55.js.map
151
+ //# sourceMappingURL=chunk-HU22EVEM.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveDefaultAgentId
3
- } from "./chunk-6SIX7P6O.js";
3
+ } from "./chunk-2GM6SUIQ.js";
4
4
  import {
5
5
  getDatabase
6
- } from "./chunk-GLF65XDS.js";
6
+ } from "./chunk-LCQ5AN6Y.js";
7
7
 
8
8
  // src/server/db/sessions.ts
9
9
  function getProjectDangerLevel(projectId) {
@@ -322,13 +322,14 @@ function createWorkflowExecution(id, sessionId, workflowId, workflowName, workfl
322
322
  VALUES (?, ?, ?, ?, ?, 'running', '{}', ?, ?, ?)`
323
323
  ).run(id, sessionId, workflowId, workflowName, workflowColor ?? null, JSON.stringify(params), now, now);
324
324
  }
325
- function updateWorkflowExecutionStatus(executionId, status, stepId, stepName, stepOutput) {
325
+ function updateWorkflowExecutionStatus(executionId, status, stepId, stepName, stepOutput, pendingChoices) {
326
326
  const db = getDatabase();
327
327
  const now = Date.now();
328
328
  const stepOutputJson = stepOutput ? JSON.stringify(stepOutput) : void 0;
329
+ const pendingChoicesJson = pendingChoices ? JSON.stringify(pendingChoices) : void 0;
329
330
  db.prepare(
330
- `UPDATE workflow_executions SET status = ?, current_step_id = COALESCE(?, current_step_id), current_step_name = COALESCE(?, current_step_name), step_output = COALESCE(?, step_output), updated_at = ? WHERE id = ?`
331
- ).run(status, stepId ?? null, stepName ?? null, stepOutputJson ?? null, now, executionId);
331
+ `UPDATE workflow_executions SET status = ?, current_step_id = COALESCE(?, current_step_id), current_step_name = COALESCE(?, current_step_name), step_output = COALESCE(?, step_output), pending_choices = COALESCE(?, pending_choices), updated_at = ? WHERE id = ?`
332
+ ).run(status, stepId ?? null, stepName ?? null, stepOutputJson ?? null, pendingChoicesJson ?? null, now, executionId);
332
333
  }
333
334
  function getActiveWorkflowExecution(sessionId) {
334
335
  const db = getDatabase();
@@ -367,4 +368,4 @@ export {
367
368
  getActiveWorkflowExecution,
368
369
  clearWorkflowExecution
369
370
  };
370
- //# sourceMappingURL=chunk-OUMHR7LR.js.map
371
+ //# sourceMappingURL=chunk-IA4Y3CKA.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDatabase
3
- } from "./chunk-GLF65XDS.js";
3
+ } from "./chunk-LCQ5AN6Y.js";
4
4
 
5
5
  // src/server/db/settings.ts
6
6
  var SETTINGS_KEYS = {
@@ -119,4 +119,4 @@ export {
119
119
  getAllSettings,
120
120
  getMaxVisibleItems
121
121
  };
122
- //# sourceMappingURL=chunk-SPA7PQPJ.js.map
122
+ //# sourceMappingURL=chunk-KIAKWUZ3.js.map
@@ -209,6 +209,7 @@ function runMigrations(db2) {
209
209
  current_step_name TEXT,
210
210
  step_output TEXT,
211
211
  params TEXT,
212
+ pending_choices TEXT,
212
213
  created_at INTEGER NOT NULL,
213
214
  updated_at INTEGER NOT NULL,
214
215
  FOREIGN KEY (session_id) REFERENCES sessions(id) ON DELETE CASCADE
@@ -218,6 +219,12 @@ function runMigrations(db2) {
218
219
  CREATE INDEX IF NOT EXISTS idx_workflow_executions_session
219
220
  ON workflow_executions(session_id)
220
221
  `);
222
+ const workflowExecColumns = db2.prepare(`PRAGMA table_info(workflow_executions)`).all();
223
+ const workflowExecColumnNames = workflowExecColumns.map((c) => c.name);
224
+ if (!workflowExecColumnNames.includes("pending_choices")) {
225
+ logger.info("Migrating workflow_executions table: adding pending_choices column");
226
+ db2.exec(`ALTER TABLE workflow_executions ADD COLUMN pending_choices TEXT`);
227
+ }
221
228
  logger.info("Database migrations completed");
222
229
  }
223
230
 
@@ -225,4 +232,4 @@ export {
225
232
  initDatabase,
226
233
  getDatabase
227
234
  };
228
- //# sourceMappingURL=chunk-GLF65XDS.js.map
235
+ //# sourceMappingURL=chunk-LCQ5AN6Y.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  getProject
3
- } from "./chunk-WWFH5GAR.js";
3
+ } from "./chunk-6FPGJR7O.js";
4
4
  import {
5
5
  deleteItemFromDir,
6
6
  loadItemsFromDir,
7
7
  pathExists
8
- } from "./chunk-6SIX7P6O.js";
8
+ } from "./chunk-2GM6SUIQ.js";
9
9
  import {
10
10
  SETTINGS_KEYS,
11
11
  deleteSetting,
12
12
  getSetting,
13
13
  setSetting
14
- } from "./chunk-SPA7PQPJ.js";
14
+ } from "./chunk-KIAKWUZ3.js";
15
15
 
16
16
  // src/server/context/instructions.ts
17
17
  import { readFile, access } from "fs/promises";
@@ -440,4 +440,4 @@ export {
440
440
  deleteSkill,
441
441
  deleteProjectSkill
442
442
  };
443
- //# sourceMappingURL=chunk-B76OP3OE.js.map
443
+ //# sourceMappingURL=chunk-LOHVZGCM.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  updateSessionMcpDisabledServers
3
- } from "./chunk-OUMHR7LR.js";
3
+ } from "./chunk-IA4Y3CKA.js";
4
4
  import {
5
5
  getDatabase
6
- } from "./chunk-GLF65XDS.js";
6
+ } from "./chunk-LCQ5AN6Y.js";
7
7
 
8
8
  // src/server/mcp/session-overrides.ts
9
9
  var sessionOverrides = /* @__PURE__ */ new Map();
@@ -62,4 +62,4 @@ export {
62
62
  clearSessionOverrides,
63
63
  getAllSessionOverrides
64
64
  };
65
- //# sourceMappingURL=chunk-UADZ2LZJ.js.map
65
+ //# sourceMappingURL=chunk-OEPRHAIO.js.map
@@ -2,33 +2,33 @@ import {
2
2
  generateSessionNameForSession,
3
3
  getSessionMessageCount,
4
4
  needsNameGeneration
5
- } from "./chunk-WHJ67MO2.js";
5
+ } from "./chunk-SUTJJWUK.js";
6
6
  import {
7
7
  runAgentTurn,
8
8
  runChatTurn
9
- } from "./chunk-3NVISPE7.js";
9
+ } from "./chunk-AYUUGKZU.js";
10
10
  import {
11
11
  applyDynamicContext,
12
12
  computeSessionHash,
13
13
  computeUnifiedDiff
14
- } from "./chunk-W2KZ7H55.js";
14
+ } from "./chunk-HU22EVEM.js";
15
15
  import {
16
16
  appendCompactionPrompt
17
- } from "./chunk-YXIDKMBJ.js";
17
+ } from "./chunk-26DEYDYV.js";
18
18
  import {
19
19
  devServerManager,
20
20
  executeSubAgent,
21
21
  getToolRegistryForAgent
22
- } from "./chunk-PKLWSTDB.js";
22
+ } from "./chunk-6M44ZHQA.js";
23
23
  import {
24
24
  TurnMetrics,
25
25
  createMessageStartEvent
26
- } from "./chunk-5ZJYEINJ.js";
26
+ } from "./chunk-5M45NHQ2.js";
27
27
  import {
28
28
  checkAborted,
29
29
  onProcessEvent,
30
30
  spawnShellProcess
31
- } from "./chunk-TFQSCHVU.js";
31
+ } from "./chunk-6VNB4L4V.js";
32
32
  import {
33
33
  killProcessTree,
34
34
  terminateProcessTree
@@ -40,7 +40,7 @@ import {
40
40
  combineEventsWithSnapshot,
41
41
  getCurrentContextWindowId,
42
42
  getEventStore
43
- } from "./chunk-DMI2BXHA.js";
43
+ } from "./chunk-GXW4CRR5.js";
44
44
  import {
45
45
  createChatErrorMessage,
46
46
  createChatMessageMessage,
@@ -62,11 +62,11 @@ import {
62
62
  } from "./chunk-JAX5OEMM.js";
63
63
  import {
64
64
  getPlatformShell
65
- } from "./chunk-EF7KGWF6.js";
65
+ } from "./chunk-UXQN7FGB.js";
66
66
  import {
67
67
  buildMessagesFromStoredEvents,
68
68
  foldPendingConfirmations
69
- } from "./chunk-S5HDT5RQ.js";
69
+ } from "./chunk-3C73IUUL.js";
70
70
  import {
71
71
  deleteItemFromDir,
72
72
  findAgentById,
@@ -75,10 +75,10 @@ import {
75
75
  loadAllAgentsDefault,
76
76
  resolveDefaultAgentId,
77
77
  saveItemToDir
78
- } from "./chunk-6SIX7P6O.js";
78
+ } from "./chunk-2GM6SUIQ.js";
79
79
  import {
80
80
  getMaxVisibleItems
81
- } from "./chunk-SPA7PQPJ.js";
81
+ } from "./chunk-KIAKWUZ3.js";
82
82
  import {
83
83
  logger
84
84
  } from "./chunk-K44MW7JJ.js";
@@ -686,6 +686,25 @@ function evaluateTransitions(transitions, stepOutcome, metadataEntries) {
686
686
  }
687
687
  return TERMINAL_BLOCKED;
688
688
  }
689
+ var DEFAULT_USER_RESULT = "continue";
690
+ var CONTINUE_CHOICE_ID = "continue";
691
+ function userStepChoices(step) {
692
+ const seen = /* @__PURE__ */ new Set();
693
+ const choices = [];
694
+ for (const t of step.transitions) {
695
+ if (t.when.type === "step_result") {
696
+ const id = t.when.result;
697
+ if (seen.has(id)) continue;
698
+ seen.add(id);
699
+ choices.push({ id, label: id, goto: t.goto });
700
+ } else if (t.when.type === "always") {
701
+ if (seen.has(CONTINUE_CHOICE_ID)) continue;
702
+ seen.add(CONTINUE_CHOICE_ID);
703
+ choices.push({ id: CONTINUE_CHOICE_ID, label: "Continue", goto: t.goto });
704
+ }
705
+ }
706
+ return choices;
707
+ }
689
708
  function emitWorkflowMessage(eventStore, sessionId, content, windowOptions, onMessage) {
690
709
  const msgId = crypto.randomUUID();
691
710
  eventStore.append(
@@ -770,6 +789,49 @@ async function executeWorkflow(workflow, options, subGroup) {
770
789
  }
771
790
  }
772
791
  logger.debug("Workflow executor starting", { sessionId, workflow: workflow.metadata.id });
792
+ let executionId;
793
+ if (isResume) {
794
+ const activeExec = sessionManager.getActiveWorkflowExecution(sessionId);
795
+ if (activeExec) {
796
+ executionId = activeExec.id;
797
+ }
798
+ }
799
+ const ctxCheck = await sessionManager.assertExecutionGitContext(sessionId);
800
+ if (!ctxCheck.ok) {
801
+ logger.warn("Workflow blocked: git context drift detected", {
802
+ sessionId,
803
+ workflow: workflow.metadata.id,
804
+ workdir: ctxCheck.workdir,
805
+ expectedBranch: ctxCheck.expectedBranch,
806
+ actualBranch: ctxCheck.actualBranch
807
+ });
808
+ emitWorkflowMessage(
809
+ eventStore,
810
+ sessionId,
811
+ `Runner blocked: ${ctxCheck.reason}`,
812
+ getCurrentWindowMessageOptions(sessionId),
813
+ onMessage
814
+ );
815
+ if (executionId) {
816
+ sessionManager.blockWorkflow(
817
+ sessionId,
818
+ executionId,
819
+ workflow.metadata.id,
820
+ workflow.metadata.name,
821
+ workflow.metadata.color
822
+ );
823
+ }
824
+ sessionManager.setPhase(sessionId, "blocked");
825
+ return {
826
+ finalAction: {
827
+ type: "BLOCKED",
828
+ reason: ctxCheck.reason,
829
+ blockedCriteria: []
830
+ },
831
+ iterations: 0,
832
+ totalTime: (performance.now() - startTime) / 1e3
833
+ };
834
+ }
773
835
  if (workflow.startCondition && workflow.startCondition.type !== "always") {
774
836
  const session = sessionManager.requireSession(sessionId);
775
837
  const conditionMet = evaluateCondition(
@@ -790,7 +852,6 @@ async function executeWorkflow(workflow, options, subGroup) {
790
852
  };
791
853
  }
792
854
  }
793
- let executionId;
794
855
  if (!isResume) {
795
856
  const startMsgId = crypto.randomUUID();
796
857
  const startWindowOpts = getCurrentWindowMessageOptions(sessionId);
@@ -817,11 +878,6 @@ async function executeWorkflow(workflow, options, subGroup) {
817
878
  workflow.metadata.color,
818
879
  options.params ?? {}
819
880
  );
820
- } else {
821
- const activeExec = sessionManager.getActiveWorkflowExecution(sessionId);
822
- if (activeExec) {
823
- executionId = activeExec.id;
824
- }
825
881
  }
826
882
  if (options.userMessage) {
827
883
  sessionManager.addMessage(sessionId, {
@@ -1079,7 +1135,9 @@ ${output.slice(0, 1e4)}
1079
1135
  }
1080
1136
  case "user": {
1081
1137
  if (resumeFromStep === step.id) {
1082
- stepOutcome = { result: "continue", output: lastStepOutput };
1138
+ const choice = options.userChoice;
1139
+ const result = choice === void 0 || choice === CONTINUE_CHOICE_ID ? DEFAULT_USER_RESULT : choice;
1140
+ stepOutcome = { result, output: lastStepOutput };
1083
1141
  break;
1084
1142
  }
1085
1143
  if (executionId) {
@@ -1091,7 +1149,8 @@ ${output.slice(0, 1e4)}
1091
1149
  lastStepOutput,
1092
1150
  workflow.metadata.id,
1093
1151
  workflow.metadata.name,
1094
- workflow.metadata.color
1152
+ workflow.metadata.color,
1153
+ userStepChoices(step)
1095
1154
  );
1096
1155
  }
1097
1156
  logger.debug("Workflow paused at user step", { sessionId, stepId: step.id, stepName: step.name });
@@ -1225,14 +1284,14 @@ async function runOrchestrator(options) {
1225
1284
 
1226
1285
  // src/server/auth.ts
1227
1286
  import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
1228
- import { join as join2, dirname as dirname2 } from "path";
1287
+ import { join as join2, dirname as dirname2, basename } from "path";
1229
1288
  import { createHash, privateDecrypt, createPublicKey } from "crypto";
1230
1289
  function getAuthConfigPath() {
1231
1290
  const configDir = getRuntimeConfig();
1232
1291
  const mode = configDir.mode === "development" ? "development" : configDir.mode === "test" ? "test" : "production";
1233
1292
  if (mode === "test") {
1234
1293
  const cwd = process.cwd();
1235
- const base = cwd.endsWith("/e2e") ? cwd : join2(cwd, "e2e");
1294
+ const base = basename(cwd) === "e2e" ? cwd : join2(cwd, "e2e");
1236
1295
  const testAuthPath = join2(base, ".openfox-test", "auth.json");
1237
1296
  return testAuthPath;
1238
1297
  }
@@ -2166,8 +2225,8 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
2166
2225
  const sessionId = client.activeSessionId;
2167
2226
  const session = sessionManager.requireSession(sessionId);
2168
2227
  try {
2169
- const { buildCachedPrompt } = await import("./dynamic-context-Z5BU2RVP.js");
2170
- const allAgents = await import("./registry-M2QVGRNK.js");
2228
+ const { buildCachedPrompt } = await import("./dynamic-context-ZUXI5UTW.js");
2229
+ const allAgents = await import("./registry-BDSTPV65.js");
2171
2230
  const agentDef = allAgents.findAgentById(session.mode, await allAgents.loadAllAgentsDefault()) ?? allAgents.findAgentById("planner", await allAgents.loadAllAgentsDefault());
2172
2231
  const modelName = session.providerModel ?? _providerManager?.getCurrentModel();
2173
2232
  const { systemPrompt: newPrompt, hash: newHash } = await buildCachedPrompt(
@@ -2326,6 +2385,7 @@ ${content}` : workflowInfo;
2326
2385
  ...launchPayload?.subGroup ? { subGroup: launchPayload.subGroup } : {},
2327
2386
  ...isResume && launchPayload?.resumeFrom ? { resumeFromStep: launchPayload.resumeFrom } : {},
2328
2387
  ...isResume && launchPayload?.stepOutput ? { initialStepOutput: launchPayload.stepOutput } : {},
2388
+ ...isResume && launchPayload?.userChoice ? { userChoice: launchPayload.userChoice } : {},
2329
2389
  ...launchPayload?.params ? { params: launchPayload.params } : {},
2330
2390
  // On resume, prefer params/stepOutput from the persisted workflow execution
2331
2391
  ...isResume ? (() => {
@@ -2489,4 +2549,4 @@ export {
2489
2549
  signalMcpReady,
2490
2550
  createWebSocketServer
2491
2551
  };
2492
- //# sourceMappingURL=chunk-HZXWVD5A.js.map
2552
+ //# sourceMappingURL=chunk-P4APMCTX.js.map
@@ -37,7 +37,7 @@ Options:
37
37
  }
38
38
  async function runNetworkSetup(mode) {
39
39
  const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-YY5PJYSC.js");
40
- const { saveGlobalConfig } = await import("./config-3FKJV3KI.js");
40
+ const { saveGlobalConfig } = await import("./config-HX7FDKGJ.js");
41
41
  const { getAuthKeyPath } = await import("./paths-F27V3S4I.js");
42
42
  const existingAuth = await loadAuthConfig(mode);
43
43
  if (existingAuth) {
@@ -104,7 +104,7 @@ async function runNetworkSetup(mode) {
104
104
  console.log("\u2713 Configuration saved!\n");
105
105
  }
106
106
  async function runConfig(mode) {
107
- const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-3FKJV3KI.js");
107
+ const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-HX7FDKGJ.js");
108
108
  const { getGlobalConfigPath } = await import("./paths-F27V3S4I.js");
109
109
  const config = await loadGlobalConfig(mode);
110
110
  const configPath = getGlobalConfigPath(mode);
@@ -163,7 +163,7 @@ async function runCli(options) {
163
163
  break;
164
164
  }
165
165
  case "provider": {
166
- const { runProviderCommand } = await import("./provider-XCVHKXPS.js");
166
+ const { runProviderCommand } = await import("./provider-RQQ5JN34.js");
167
167
  const [, subcommand] = positionals;
168
168
  await runProviderCommand(mode, subcommand);
169
169
  break;
@@ -200,7 +200,7 @@ async function runCli(options) {
200
200
  break;
201
201
  }
202
202
  case "update": {
203
- const { runUpdate } = await import("./update-7BEZMI4R.js");
203
+ const { runUpdate } = await import("./update-QEZIUJHR.js");
204
204
  const code = await runUpdate();
205
205
  if (code !== 0) {
206
206
  process.exit(code);
@@ -208,12 +208,12 @@ async function runCli(options) {
208
208
  break;
209
209
  }
210
210
  default: {
211
- const { configFileExists } = await import("./config-3FKJV3KI.js");
211
+ const { configFileExists } = await import("./config-HX7FDKGJ.js");
212
212
  const configExists = await configFileExists(mode);
213
213
  if (!configExists) {
214
214
  await runNetworkSetup(mode);
215
215
  }
216
- const { runServe } = await import("./serve-NPS4GJWH.js");
216
+ const { runServe } = await import("./serve-2O7G2WZF.js");
217
217
  const serveOptions = { mode };
218
218
  if (values.port) serveOptions.port = parseInt(values.port);
219
219
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -225,4 +225,4 @@ async function runCli(options) {
225
225
  export {
226
226
  runCli
227
227
  };
228
- //# sourceMappingURL=chunk-EFIC3TUX.js.map
228
+ //# sourceMappingURL=chunk-QBKAW5H4.js.map
@@ -4,14 +4,14 @@ import {
4
4
  import {
5
5
  getProjectByWorkdir,
6
6
  updateProject
7
- } from "./chunk-WWFH5GAR.js";
7
+ } from "./chunk-6FPGJR7O.js";
8
8
  import {
9
9
  logger
10
10
  } from "./chunk-K44MW7JJ.js";
11
11
 
12
12
  // src/server/git/workspace.ts
13
- import { spawn, execSync, execFileSync } from "child_process";
14
- import { mkdir as mkdir2 } from "fs/promises";
13
+ import { spawn, execSync } from "child_process";
14
+ import { mkdir as mkdir2, rm } from "fs/promises";
15
15
  import { resolve as resolve2, join as join2, isAbsolute } from "path";
16
16
  import { homedir, platform } from "os";
17
17
 
@@ -273,12 +273,7 @@ async function deleteWorkspace(projectName, name, projectDir) {
273
273
  if (!st?.isDirectory()) {
274
274
  throw new Error(`Workspace "${name}" does not exist`);
275
275
  }
276
- try {
277
- execFileSync("rm", ["-rf", wsPath], { stdio: "ignore" });
278
- } catch {
279
- const { rm } = await import("fs/promises");
280
- await rm(wsPath, { recursive: true, force: true });
281
- }
276
+ await rm(wsPath, { recursive: true, force: true, maxRetries: 3 });
282
277
  logger.info("Deleted workspace", { projectName, name, path: wsPath });
283
278
  }
284
279
  async function isGitRepository(cwd) {
@@ -324,4 +319,4 @@ export {
324
319
  deleteWorkspace,
325
320
  isGitRepository
326
321
  };
327
- //# sourceMappingURL=chunk-D3SXT3BL.js.map
322
+ //# sourceMappingURL=chunk-RRTKVJMF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getPlatformShell
3
- } from "./chunk-EF7KGWF6.js";
3
+ } from "./chunk-UXQN7FGB.js";
4
4
 
5
5
  // src/server/tools/tool-policy.ts
6
6
  var ALWAYS_ALLOWED = /* @__PURE__ */ new Set(["step_done"]);
@@ -36,6 +36,7 @@ Today's date is ${(/* @__PURE__ */ new Date()).toISOString().split("T")[0].repla
36
36
 
37
37
  ## ENVIRONMENT
38
38
  Working directory: ${workdir}
39
+ The working directory may change during a session; if a later <system-reminder> names a workspace, trust that value over this one.
39
40
  Platform: ${process.platform} (${process.arch})
40
41
  Shell (run_command): ${basename(getPlatformShell().command)}${modelLine}
41
42
 
@@ -245,4 +246,4 @@ export {
245
246
  buildAgentSmallReminder,
246
247
  COMPACTION_PROMPT
247
248
  };
248
- //# sourceMappingURL=chunk-J27BLIPY.js.map
249
+ //# sourceMappingURL=chunk-SGJ3LSVA.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  combineEventsWithSnapshot,
3
3
  getEventStore
4
- } from "./chunk-DMI2BXHA.js";
4
+ } from "./chunk-GXW4CRR5.js";
5
5
  import {
6
6
  createContextStateMessage,
7
7
  createSessionStateMessage
@@ -12,16 +12,16 @@ import {
12
12
  import {
13
13
  buildMessagesFromStoredEvents,
14
14
  foldPendingConfirmations
15
- } from "./chunk-S5HDT5RQ.js";
15
+ } from "./chunk-3C73IUUL.js";
16
16
  import {
17
17
  updateSessionMetadata
18
- } from "./chunk-OUMHR7LR.js";
18
+ } from "./chunk-IA4Y3CKA.js";
19
19
  import {
20
20
  getRuntimeConfig
21
- } from "./chunk-6SIX7P6O.js";
21
+ } from "./chunk-2GM6SUIQ.js";
22
22
  import {
23
23
  getMaxVisibleItems
24
- } from "./chunk-SPA7PQPJ.js";
24
+ } from "./chunk-KIAKWUZ3.js";
25
25
  import {
26
26
  logger
27
27
  } from "./chunk-K44MW7JJ.js";
@@ -153,7 +153,7 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
153
153
  client = deps.getLLMClient();
154
154
  client.setModel(providerConfig.model);
155
155
  } else if (providerConfig) {
156
- const { createLLMClient } = await import("./client-2EAJAGPC.js");
156
+ const { createLLMClient } = await import("./client-MP3FSNN7.js");
157
157
  client = createLLMClient({
158
158
  llm: {
159
159
  baseUrl: providerConfig.baseUrl,
@@ -204,4 +204,4 @@ export {
204
204
  needsNameGeneration,
205
205
  generateSessionNameForSession
206
206
  };
207
- //# sourceMappingURL=chunk-WHJ67MO2.js.map
207
+ //# sourceMappingURL=chunk-SUTJJWUK.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SETTINGS_KEYS,
3
3
  getSetting
4
- } from "./chunk-SPA7PQPJ.js";
4
+ } from "./chunk-KIAKWUZ3.js";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-K44MW7JJ.js";
@@ -164,4 +164,4 @@ export {
164
164
  WorkspaceInUseError,
165
165
  OpenAIHttpClient
166
166
  };
167
- //# sourceMappingURL=chunk-ERKPMNC7.js.map
167
+ //# sourceMappingURL=chunk-TB7TTPYQ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createLLMClient
3
- } from "./chunk-F766OIDT.js";
3
+ } from "./chunk-46KNPXY6.js";
4
4
  import {
5
5
  getModelProfile
6
6
  } from "./chunk-V4IE7HJY.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-HNCM3D7Y.js";
15
15
  import {
16
16
  resolveAttachmentsInMessages
17
- } from "./chunk-KCED2X4H.js";
17
+ } from "./chunk-WDJOSRIB.js";
18
18
  import {
19
19
  logger
20
20
  } from "./chunk-K44MW7JJ.js";
@@ -629,13 +629,9 @@ function createProviderManager(config, options = {}) {
629
629
  return { success: false, error: "Provider not found" };
630
630
  }
631
631
  logger.info("Setting default model selection", { providerId, model, providerName: provider.name });
632
+ llmClient = createClientForProvider(provider, model);
632
633
  defaultModelSelection = `${providerId}/${model}`;
633
634
  providers = providers.map((p) => ({ ...p, isActive: p.id === providerId }));
634
- const currentProviderId = parseDefaultModelSelection(defaultModelSelection).providerId;
635
- if (currentProviderId === providerId) {
636
- llmClient.setModel(model);
637
- logger.info("Model updated", { providerId, model });
638
- }
639
635
  return { success: true };
640
636
  },
641
637
  getCurrentModelContext() {
@@ -808,4 +804,4 @@ export {
808
804
  parseDefaultModelSelection,
809
805
  createProviderManager
810
806
  };
811
- //# sourceMappingURL=chunk-2COWPTSJ.js.map
807
+ //# sourceMappingURL=chunk-UCIZV76E.js.map