openfox 2.0.105 → 2.0.107
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.
- package/CHANGELOG.md +30 -0
- package/dist/CHANGELOG.md +30 -0
- package/dist/agent-defaults/planner.agent.md +2 -1
- package/dist/{chat-handler-CQIDZUR7.js → chat-handler-A22X22VZ.js} +22 -22
- package/dist/{chunk-FGYOSQUR.js → chunk-26DEYDYV.js} +3 -3
- package/dist/{chunk-6SIX7P6O.js → chunk-2GM6SUIQ.js} +2 -2
- package/dist/{chunk-ZASSAZ73.js → chunk-33Q7LCVD.js} +2 -2
- package/dist/{chunk-S5HDT5RQ.js → chunk-3C73IUUL.js} +2 -2
- package/dist/{chunk-PP3WNUA6.js → chunk-46KNPXY6.js} +2 -2
- package/dist/{chunk-LG57PZYL.js → chunk-5LR4AMQH.js} +7 -7
- package/dist/{chunk-WWFH5GAR.js → chunk-6FPGJR7O.js} +2 -2
- package/dist/{chunk-AKUTOOSV.js → chunk-6M44ZHQA.js} +24 -24
- package/dist/{chunk-TFQSCHVU.js → chunk-6VNB4L4V.js} +3 -3
- package/dist/{chunk-KDJZGHSZ.js → chunk-AYUUGKZU.js} +13 -15
- package/dist/{chunk-B56G5OEF.js → chunk-D6ODGTSZ.js} +5 -3
- package/dist/{chunk-DMI2BXHA.js → chunk-GXW4CRR5.js} +7 -6
- package/dist/{chunk-EIJFYENT.js → chunk-HU22EVEM.js} +7 -7
- package/dist/{chunk-OUMHR7LR.js → chunk-IA4Y3CKA.js} +7 -6
- package/dist/{chunk-SPA7PQPJ.js → chunk-KIAKWUZ3.js} +2 -2
- package/dist/{chunk-GLF65XDS.js → chunk-LCQ5AN6Y.js} +8 -1
- package/dist/{chunk-B76OP3OE.js → chunk-LOHVZGCM.js} +4 -4
- package/dist/{chunk-UADZ2LZJ.js → chunk-OEPRHAIO.js} +3 -3
- package/dist/{chunk-SGGFVTMP.js → chunk-P4APMCTX.js} +84 -24
- package/dist/{chunk-D3SXT3BL.js → chunk-RRTKVJMF.js} +5 -10
- package/dist/{chunk-J27BLIPY.js → chunk-SGJ3LSVA.js} +3 -2
- package/dist/{chunk-6XDKVVYS.js → chunk-SLFCV72V.js} +255 -163
- package/dist/{chunk-6IXRISXA.js → chunk-SUTJJWUK.js} +7 -7
- package/dist/chunk-T5OFUWKZ.js +7 -0
- package/dist/{chunk-ERKPMNC7.js → chunk-TB7TTPYQ.js} +2 -2
- package/dist/{chunk-UUMJ5PAW.js → chunk-UCIZV76E.js} +2 -2
- package/dist/{chunk-EF7KGWF6.js → chunk-UXQN7FGB.js} +2 -2
- package/dist/{chunk-5VKT34HE.js → chunk-V6Y6OLB4.js} +2 -2
- package/dist/{chunk-62QCBNPE.js → chunk-WLJJRX22.js} +10 -3
- package/dist/{chunk-ERTTKKCE.js → chunk-X3USQHHK.js} +2 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-XT4VHS7E.js → client-MP3FSNN7.js} +5 -5
- package/dist/{compactor-JMO7FHYA.js → compactor-KK2BVJK5.js} +10 -10
- package/dist/{config-3FKJV3KI.js → config-HX7FDKGJ.js} +2 -2
- package/dist/{dynamic-context-UJE6F7XT.js → dynamic-context-ZUXI5UTW.js} +9 -9
- package/dist/{events-BGVLDGLK.js → events-OJ2R6OEM.js} +7 -7
- package/dist/{folding-AJMZBHNR.js → folding-DUZSKCZF.js} +5 -5
- package/dist/http-client-KJXFSK7A.js +11 -0
- package/dist/{inspect-proxy-GF6OI7MR.js → inspect-proxy-N42Z5TOG.js} +4 -4
- package/dist/{manager-GGIIENDX.js → manager-N27WNW5B.js} +5 -5
- package/dist/{model-overrides-BLEFI7FQ.js → model-overrides-36SQR3JR.js} +4 -4
- package/dist/{openFolder-Z27FEM5M.js → openFolder-HX7X356L.js} +2 -2
- package/dist/{orchestrator-Y2MBWVOB.js → orchestrator-VZORJ7KF.js} +21 -21
- package/dist/package.json +4 -2
- package/dist/{path-security-JCDBLFIE.js → path-security-QCIA6YFV.js} +8 -8
- package/dist/{permissions-CGEK3DGZ.js → permissions-K6YEA2ZZ.js} +12 -1
- package/dist/{platform-GZ2WIDS5.js → platform-Q6T3AUHA.js} +4 -4
- package/dist/{processor-3IURFW2N.js → processor-QYVHKRIV.js} +21 -21
- package/dist/{project-creator-SMWFMIU5.js → project-creator-BVA55HY6.js} +4 -4
- package/dist/{projects-M5XKC7O6.js → projects-PQXME5S4.js} +3 -3
- package/dist/{protocol-rfiBDoXm.d.ts → protocol-zRSsysOe.d.ts} +1 -1
- package/dist/provider/index.d.ts +4 -4
- package/dist/{provider-ZXYITGFU.js → provider-RQQ5JN34.js} +8 -8
- package/dist/{provider-manager-QH5IIGHB.js → provider-manager-RUC5QQ75.js} +6 -6
- package/dist/{registry-M2QVGRNK.js → registry-BDSTPV65.js} +4 -4
- package/dist/{serve-OYLEY3HD.js → serve-4F7O6FL3.js} +30 -30
- package/dist/server/index.d.ts +33 -4
- package/dist/server/index.js +29 -29
- package/dist/server-CYE6XY7J.js +47 -0
- package/dist/{session-overrides-HA5IQYLI.js → session-overrides-SFWPS5CT.js} +6 -6
- package/dist/{sessions-ZV2WRC6K.js → sessions-TZNUQJ2I.js} +5 -5
- package/dist/{settings-TGCITCVA.js → settings-5LG7IB3K.js} +3 -3
- package/dist/shared/index.d.ts +3 -3
- package/dist/{tools-BG44DIYU.js → tools-Y4F4HJPO.js} +19 -19
- package/dist/{types-o0v5xVxu.d.ts → types-CTl70hba.d.ts} +12 -1
- package/dist/{types-o-YQ3Bfq.d.ts → types-_uF_PRaD.d.ts} +1 -1
- package/dist/{update-SOCIS7KO.js → update-PG2YJEVU.js} +2 -2
- package/dist/web/assets/index-BxI3Y9C7.js +323 -0
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/dist/workflow-defaults/default.workflow.json +3 -3
- package/dist/{workspace-2NDXTCVR.js → workspace-2OG5VQG6.js} +4 -4
- package/package.json +4 -2
- package/dist/chunk-UBF62JJI.js +0 -7
- package/dist/http-client-A7A4XWNK.js +0 -11
- package/dist/server-L6YS6A6J.js +0 -47
- package/dist/web/assets/index-BHIT-lGU.js +0 -323
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
foldContextState,
|
|
6
6
|
foldSessionState,
|
|
7
7
|
spreadOptionalMessageFields
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3C73IUUL.js";
|
|
9
9
|
import {
|
|
10
10
|
updateSessionMessageCount
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IA4Y3CKA.js";
|
|
12
12
|
import {
|
|
13
13
|
getRuntimeConfig
|
|
14
|
-
} from "./chunk-
|
|
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-
|
|
1179
|
+
//# sourceMappingURL=chunk-GXW4CRR5.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAllInstructions,
|
|
3
3
|
getEnabledSkillMetadata
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LOHVZGCM.js";
|
|
5
5
|
import {
|
|
6
6
|
buildTopLevelSystemPrompt
|
|
7
|
-
} from "./chunk-
|
|
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-
|
|
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,
|
|
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-
|
|
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-
|
|
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-
|
|
151
|
+
//# sourceMappingURL=chunk-HU22EVEM.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultAgentId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2GM6SUIQ.js";
|
|
4
4
|
import {
|
|
5
5
|
getDatabase
|
|
6
|
-
} from "./chunk-
|
|
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-
|
|
371
|
+
//# sourceMappingURL=chunk-IA4Y3CKA.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDatabase
|
|
3
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
235
|
+
//# sourceMappingURL=chunk-LCQ5AN6Y.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getProject
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6FPGJR7O.js";
|
|
4
4
|
import {
|
|
5
5
|
deleteItemFromDir,
|
|
6
6
|
loadItemsFromDir,
|
|
7
7
|
pathExists
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2GM6SUIQ.js";
|
|
9
9
|
import {
|
|
10
10
|
SETTINGS_KEYS,
|
|
11
11
|
deleteSetting,
|
|
12
12
|
getSetting,
|
|
13
13
|
setSetting
|
|
14
|
-
} from "./chunk-
|
|
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-
|
|
443
|
+
//# sourceMappingURL=chunk-LOHVZGCM.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateSessionMcpDisabledServers
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IA4Y3CKA.js";
|
|
4
4
|
import {
|
|
5
5
|
getDatabase
|
|
6
|
-
} from "./chunk-
|
|
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-
|
|
65
|
+
//# sourceMappingURL=chunk-OEPRHAIO.js.map
|
|
@@ -2,24 +2,24 @@ import {
|
|
|
2
2
|
generateSessionNameForSession,
|
|
3
3
|
getSessionMessageCount,
|
|
4
4
|
needsNameGeneration
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-SUTJJWUK.js";
|
|
6
6
|
import {
|
|
7
7
|
runAgentTurn,
|
|
8
8
|
runChatTurn
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AYUUGKZU.js";
|
|
10
10
|
import {
|
|
11
11
|
applyDynamicContext,
|
|
12
12
|
computeSessionHash,
|
|
13
13
|
computeUnifiedDiff
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HU22EVEM.js";
|
|
15
15
|
import {
|
|
16
16
|
appendCompactionPrompt
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-26DEYDYV.js";
|
|
18
18
|
import {
|
|
19
19
|
devServerManager,
|
|
20
20
|
executeSubAgent,
|
|
21
21
|
getToolRegistryForAgent
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-6M44ZHQA.js";
|
|
23
23
|
import {
|
|
24
24
|
TurnMetrics,
|
|
25
25
|
createMessageStartEvent
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
checkAborted,
|
|
29
29
|
onProcessEvent,
|
|
30
30
|
spawnShellProcess
|
|
31
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
65
|
+
} from "./chunk-UXQN7FGB.js";
|
|
66
66
|
import {
|
|
67
67
|
buildMessagesFromStoredEvents,
|
|
68
68
|
foldPendingConfirmations
|
|
69
|
-
} from "./chunk-
|
|
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-
|
|
78
|
+
} from "./chunk-2GM6SUIQ.js";
|
|
79
79
|
import {
|
|
80
80
|
getMaxVisibleItems
|
|
81
|
-
} from "./chunk-
|
|
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
|
-
|
|
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
|
|
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-
|
|
2170
|
-
const allAgents = await import("./registry-
|
|
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-
|
|
2552
|
+
//# sourceMappingURL=chunk-P4APMCTX.js.map
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getProjectByWorkdir,
|
|
6
6
|
updateProject
|
|
7
|
-
} from "./chunk-
|
|
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
|
|
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
|
-
|
|
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-
|
|
322
|
+
//# sourceMappingURL=chunk-RRTKVJMF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPlatformShell
|
|
3
|
-
} from "./chunk-
|
|
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-
|
|
249
|
+
//# sourceMappingURL=chunk-SGJ3LSVA.js.map
|