openfox 2.0.93 → 2.0.95
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 +25 -0
- package/dist/CHANGELOG.md +25 -0
- package/dist/{chat-handler-MSQFJH7S.js → chat-handler-5FV3TGQD.js} +22 -22
- package/dist/{chunk-IAAHDCJN.js → chunk-27SDWNKL.js} +8 -5
- package/dist/{chunk-TQATAKVV.js → chunk-4R7G5JB6.js} +1 -1
- package/dist/{chunk-3NGD6IVM.js → chunk-5N5JXT7R.js} +3 -3
- package/dist/{chunk-NV63HYNR.js → chunk-5UFTFBNW.js} +8 -8
- package/dist/{chunk-BJHPUMRX.js → chunk-62X2MPO6.js} +2 -2
- package/dist/{chunk-FK6R2YTQ.js → chunk-6RHMIMID.js} +17 -17
- package/dist/{chunk-PYJ2SRVC.js → chunk-7P7OKBYQ.js} +20 -4
- package/dist/{chunk-GAIAJDPH.js → chunk-D6T3X22W.js} +149 -52
- package/dist/{chunk-6OAJNCRY.js → chunk-GLF65XDS.js} +22 -1
- package/dist/{chunk-U7D72C4O.js → chunk-HAFRPV7I.js} +13 -3
- package/dist/{chunk-AA4PXMSI.js → chunk-KG2PJVOE.js} +253 -95
- package/dist/{chunk-NW2KP7PE.js → chunk-MB7STVMR.js} +6 -6
- package/dist/{chunk-SXHGRPCI.js → chunk-MC3MCMAF.js} +4 -4
- package/dist/{chunk-U2RSFH6A.js → chunk-MRWR3SIT.js} +2 -2
- package/dist/{chunk-WWC3R3YL.js → chunk-NLN5LPQ4.js} +2 -2
- package/dist/{chunk-NGN3Q26A.js → chunk-OHBY2673.js} +2 -2
- package/dist/{chunk-RJQDC2OO.js → chunk-OZD247P4.js} +10 -10
- package/dist/{chunk-3QQKKZMF.js → chunk-P637C6X3.js} +2 -2
- package/dist/{chunk-C56Z4OVW.js → chunk-SJJVNSA6.js} +2 -2
- package/dist/{chunk-7YBGCZSI.js → chunk-TDHDLDGQ.js} +10 -20
- package/dist/{chunk-6J5IZ2NL.js → chunk-TSHJW7OC.js} +37 -6
- package/dist/{chunk-54Q4TGG6.js → chunk-UEOEA6BB.js} +2 -2
- package/dist/chunk-VKU7YBLH.js +7 -0
- package/dist/{chunk-ESJNJ5B6.js → chunk-W7P5P54O.js} +3 -3
- package/dist/{chunk-ST4NYXLH.js → chunk-WWFH5GAR.js} +2 -2
- package/dist/{chunk-YM267G4F.js → chunk-YCPUV7AR.js} +4 -4
- package/dist/{chunk-GH5PL3JW.js → chunk-YPBV47DH.js} +6 -9
- package/dist/{chunk-DH32AHTL.js → chunk-ZASSAZ73.js} +2 -2
- package/dist/{chunk-AQ4KCGXL.js → chunk-ZMSHE564.js} +3 -3
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-RBXMHFX3.js → client-RENSCJPZ.js} +5 -5
- package/dist/{compactor-R7GGPBPR.js → compactor-3RXIAIPR.js} +10 -10
- package/dist/{dynamic-context-4UPNVL3N.js → dynamic-context-CJFDFUJF.js} +9 -9
- package/dist/{events-D5AFN2CW.js → events-QHZDLHEB.js} +9 -7
- package/dist/{folding-BO6Z6HMP.js → folding-O4OYOTPS.js} +5 -5
- package/dist/http-client-U6DVFL7F.js +11 -0
- package/dist/{inspect-proxy-NZ3VSMSC.js → inspect-proxy-GF6OI7MR.js} +4 -4
- package/dist/{manager-ZPQ6VSM5.js → manager-53J5P4EZ.js} +5 -5
- package/dist/{orchestrator-YQI2D4LW.js → orchestrator-LDVMBC23.js} +21 -21
- package/dist/package.json +1 -1
- package/dist/{path-security-DP75YZK5.js → path-security-72KGHGSV.js} +10 -10
- package/dist/{platform-UKZ2QC34.js → platform-7KXP3VVA.js} +4 -4
- package/dist/{processor-LVQWRG6M.js → processor-32QUVPV6.js} +21 -21
- package/dist/{project-creator-2WMZYQME.js → project-creator-SMWFMIU5.js} +3 -3
- package/dist/{projects-N6KVZGMS.js → projects-M5XKC7O6.js} +3 -3
- package/dist/{protocol-8BzyapcK.d.ts → protocol-C5ROb3nH.d.ts} +5 -4
- package/dist/{protocol-4ZDERZNC.js → protocol-YDNGGADL.js} +3 -3
- package/dist/provider/index.d.ts +4 -4
- package/dist/{provider-SYYZI2KX.js → provider-A74GHQUO.js} +6 -6
- package/dist/{provider-manager-P3ZSA5QS.js → provider-manager-PBOF77RQ.js} +6 -6
- package/dist/{registry-ERUV33AP.js → registry-XBEHPY7C.js} +4 -4
- package/dist/{serve-HEHWSYMX.js → serve-GL5WUPRP.js} +29 -29
- package/dist/server/index.d.ts +39 -3
- package/dist/server/index.js +28 -28
- package/dist/server-OYVGQU7O.js +46 -0
- package/dist/{session-overrides-NPVYNHTM.js → session-overrides-QWD4V5KW.js} +6 -6
- package/dist/{sessions-7KCM5QH4.js → sessions-BT4PION7.js} +15 -7
- package/dist/{settings-2OVKFWR5.js → settings-2WVGUPYV.js} +3 -3
- package/dist/shared/index.d.ts +3 -3
- package/dist/shared/index.js +1 -1
- package/dist/{tools-HDD7RHEG.js → tools-UTA3TV7P.js} +19 -19
- package/dist/{types-_OEK96iM.d.ts → types-D-dEQIrh.d.ts} +1 -1
- package/dist/{types-Ci7Tdpq3.d.ts → types-DHxO1nqw.d.ts} +17 -1
- package/dist/{update-JARYMNGH.js → update-VUTN743C.js} +2 -2
- package/dist/web/assets/{index-DxTIqntH.js → index-BUiw9fSe.js} +22 -22
- package/dist/web/assets/{index-B3lfsL1_.css → index-BlV1FebL.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/{workspace-YLTMP3OX.js → workspace-IIRKILYL.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-LVZ6VQ3K.js +0 -7
- package/dist/http-client-E3CV6E5D.js +0 -11
- package/dist/server-AAIYC4BH.js +0 -46
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentTurn,
|
|
3
3
|
runChatTurn
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OZD247P4.js";
|
|
5
5
|
import {
|
|
6
6
|
generateSessionNameForSession,
|
|
7
7
|
getSessionMessageCount,
|
|
8
8
|
needsNameGeneration
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5UFTFBNW.js";
|
|
10
10
|
import {
|
|
11
11
|
devServerManager,
|
|
12
12
|
executeSubAgent,
|
|
13
13
|
getToolRegistryForAgent
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6RHMIMID.js";
|
|
15
15
|
import {
|
|
16
16
|
checkAborted,
|
|
17
17
|
onProcessEvent,
|
|
18
18
|
spawnShellProcess
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-HAFRPV7I.js";
|
|
20
20
|
import {
|
|
21
21
|
killProcessTree,
|
|
22
22
|
terminateProcessTree
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
applyDynamicContext,
|
|
29
29
|
computeSessionHash,
|
|
30
30
|
computeUnifiedDiff
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MB7STVMR.js";
|
|
32
32
|
import {
|
|
33
33
|
createChatErrorMessage,
|
|
34
34
|
createChatMessageMessage,
|
|
@@ -43,14 +43,14 @@ import {
|
|
|
43
43
|
parseClientMessage,
|
|
44
44
|
serializeServerMessage,
|
|
45
45
|
storedEventToServerMessage
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-27SDWNKL.js";
|
|
47
47
|
import {
|
|
48
48
|
getPendingQuestionsForSession,
|
|
49
49
|
provideAnswer
|
|
50
50
|
} from "./chunk-EU3WWTFH.js";
|
|
51
51
|
import {
|
|
52
52
|
appendCompactionPrompt
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-W7P5P54O.js";
|
|
54
54
|
import {
|
|
55
55
|
TurnMetrics,
|
|
56
56
|
createMessageStartEvent
|
|
@@ -59,15 +59,14 @@ import {
|
|
|
59
59
|
combineEventsWithSnapshot,
|
|
60
60
|
getCurrentContextWindowId,
|
|
61
61
|
getEventStore
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-7P7OKBYQ.js";
|
|
63
63
|
import {
|
|
64
64
|
getPlatformShell
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-NLN5LPQ4.js";
|
|
66
66
|
import {
|
|
67
67
|
buildMessagesFromStoredEvents,
|
|
68
|
-
foldPendingConfirmations
|
|
69
|
-
|
|
70
|
-
} from "./chunk-3QQKKZMF.js";
|
|
68
|
+
foldPendingConfirmations
|
|
69
|
+
} from "./chunk-P637C6X3.js";
|
|
71
70
|
import {
|
|
72
71
|
deleteItemFromDir,
|
|
73
72
|
findAgentById,
|
|
@@ -76,10 +75,10 @@ import {
|
|
|
76
75
|
loadAllAgentsDefault,
|
|
77
76
|
resolveDefaultAgentId,
|
|
78
77
|
saveItemToDir
|
|
79
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-OHBY2673.js";
|
|
80
79
|
import {
|
|
81
80
|
getMaxVisibleItems
|
|
82
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-UEOEA6BB.js";
|
|
83
82
|
import {
|
|
84
83
|
logger
|
|
85
84
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -88,7 +87,7 @@ import {
|
|
|
88
87
|
} from "./chunk-VUQCQXXJ.js";
|
|
89
88
|
import {
|
|
90
89
|
createServerMessage
|
|
91
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-4R7G5JB6.js";
|
|
92
91
|
import {
|
|
93
92
|
getGlobalConfigDir
|
|
94
93
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -768,17 +767,6 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
768
767
|
totalTime: (performance.now() - startTime) / 1e3
|
|
769
768
|
};
|
|
770
769
|
}
|
|
771
|
-
if (targetStep.type !== "user") {
|
|
772
|
-
return {
|
|
773
|
-
finalAction: {
|
|
774
|
-
type: "BLOCKED",
|
|
775
|
-
reason: `Cannot resume from step "${resumeFromStep}" (type: ${targetStep.type}): only user steps support resume`,
|
|
776
|
-
blockedCriteria: []
|
|
777
|
-
},
|
|
778
|
-
iterations: 0,
|
|
779
|
-
totalTime: (performance.now() - startTime) / 1e3
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
770
|
}
|
|
783
771
|
logger.debug("Workflow executor starting", { sessionId, workflow: workflow.metadata.id });
|
|
784
772
|
if (workflow.startCondition && workflow.startCondition.type !== "always") {
|
|
@@ -801,6 +789,7 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
801
789
|
};
|
|
802
790
|
}
|
|
803
791
|
}
|
|
792
|
+
let executionId;
|
|
804
793
|
if (!isResume) {
|
|
805
794
|
const startMsgId = crypto.randomUUID();
|
|
806
795
|
const startWindowOpts = getCurrentWindowMessageOptions(sessionId);
|
|
@@ -818,17 +807,31 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
818
807
|
)
|
|
819
808
|
);
|
|
820
809
|
eventStore.append(sessionId, { type: "message.done", data: { messageId: startMsgId } });
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
810
|
+
executionId = crypto.randomUUID();
|
|
811
|
+
sessionManager.startWorkflow(
|
|
812
|
+
sessionId,
|
|
813
|
+
executionId,
|
|
814
|
+
workflow.metadata.id,
|
|
815
|
+
workflow.metadata.name,
|
|
816
|
+
workflow.metadata.color,
|
|
817
|
+
options.params ?? {}
|
|
818
|
+
);
|
|
819
|
+
} else {
|
|
820
|
+
const activeExec = sessionManager.getActiveWorkflowExecution(sessionId);
|
|
821
|
+
if (activeExec) {
|
|
822
|
+
executionId = activeExec.id;
|
|
827
823
|
}
|
|
828
824
|
}
|
|
825
|
+
if (options.userMessage) {
|
|
826
|
+
sessionManager.addMessage(sessionId, {
|
|
827
|
+
role: "user",
|
|
828
|
+
content: options.userMessage.content,
|
|
829
|
+
...options.userMessage.attachments ? { attachments: options.userMessage.attachments } : {}
|
|
830
|
+
});
|
|
831
|
+
}
|
|
829
832
|
while (iterations < workflow.settings.maxIterations) {
|
|
830
833
|
if (signal?.aborted) {
|
|
831
|
-
logger.debug("Workflow executor aborted", { sessionId, iterations });
|
|
834
|
+
logger.debug("Workflow executor aborted \u2014 preserving execution", { sessionId, iterations });
|
|
832
835
|
return {
|
|
833
836
|
finalAction: { type: "RUN_BUILDER", reason: "Aborted" },
|
|
834
837
|
iterations,
|
|
@@ -861,6 +864,17 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
861
864
|
params: options.params ?? {}
|
|
862
865
|
};
|
|
863
866
|
sessionManager.setPhase(sessionId, step.phase);
|
|
867
|
+
if (executionId) {
|
|
868
|
+
sessionManager.updateWorkflowStep(
|
|
869
|
+
sessionId,
|
|
870
|
+
executionId,
|
|
871
|
+
step.id,
|
|
872
|
+
step.name,
|
|
873
|
+
workflow.metadata.id,
|
|
874
|
+
workflow.metadata.name,
|
|
875
|
+
workflow.metadata.color
|
|
876
|
+
);
|
|
877
|
+
}
|
|
864
878
|
if (step.type === "agent") {
|
|
865
879
|
const agentStep = step;
|
|
866
880
|
sessionManager.setMode(sessionId, agentStep.agentId ?? resolveDefaultAgentId());
|
|
@@ -874,7 +888,8 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
874
888
|
const STEP_DONE_NUDGE = "You haven't called step_done(). If you haven't finished the task, continue and when you're finished call step_done()";
|
|
875
889
|
let promptContent;
|
|
876
890
|
let nudgeContent;
|
|
877
|
-
|
|
891
|
+
const isResumingCurrentStep = isResume && step.id === resumeFromStep;
|
|
892
|
+
if (!firstEntryForStep.has(step.id) && agentStep.prompt && !isResumingCurrentStep) {
|
|
878
893
|
const resolvedPrompt = resolveTemplate(agentStep.prompt, templateCtx);
|
|
879
894
|
promptContent = resolvedPrompt + STEP_DONE_PROMPT;
|
|
880
895
|
const promptMsgId = crypto.randomUUID();
|
|
@@ -902,7 +917,7 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
902
917
|
})
|
|
903
918
|
);
|
|
904
919
|
}
|
|
905
|
-
} else if (firstEntryForStep.has(step.id)) {
|
|
920
|
+
} else if (firstEntryForStep.has(step.id) && !isResumingCurrentStep) {
|
|
906
921
|
const parts = [];
|
|
907
922
|
if (agentStep.nudgePrompt) {
|
|
908
923
|
const resolvedNudge = resolveTemplate(agentStep.nudgePrompt, templateCtx);
|
|
@@ -929,7 +944,7 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
929
944
|
agentStep.agentId ?? resolveDefaultAgentId(),
|
|
930
945
|
append,
|
|
931
946
|
{
|
|
932
|
-
...!firstEntryForStep.has(step.id) && !agentStep.prompt ? { injectKickoff: () => injectGenericKickoff(sessionId) } : {},
|
|
947
|
+
...!firstEntryForStep.has(step.id) && !agentStep.prompt && !isResumingCurrentStep ? { injectKickoff: () => injectGenericKickoff(sessionId) } : {},
|
|
933
948
|
onToolExecuted: (toolCall, toolResult) => {
|
|
934
949
|
if (toolCall.name === "step_done" && toolResult.success) {
|
|
935
950
|
stepDoneCalled = true;
|
|
@@ -1065,17 +1080,18 @@ ${output.slice(0, 1e4)}
|
|
|
1065
1080
|
stepOutcome = { result: "continue", output: lastStepOutput };
|
|
1066
1081
|
break;
|
|
1067
1082
|
}
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1083
|
+
if (executionId) {
|
|
1084
|
+
sessionManager.waitAtStep(
|
|
1085
|
+
sessionId,
|
|
1086
|
+
executionId,
|
|
1087
|
+
step.id,
|
|
1088
|
+
step.name,
|
|
1089
|
+
lastStepOutput,
|
|
1090
|
+
workflow.metadata.id,
|
|
1091
|
+
workflow.metadata.name,
|
|
1092
|
+
workflow.metadata.color
|
|
1093
|
+
);
|
|
1094
|
+
}
|
|
1079
1095
|
logger.debug("Workflow paused at user step", { sessionId, stepId: step.id, stepName: step.name });
|
|
1080
1096
|
return {
|
|
1081
1097
|
finalAction: {
|
|
@@ -1096,6 +1112,15 @@ ${output.slice(0, 1e4)}
|
|
|
1096
1112
|
const nextStepId = subGroup && rawNextStepId !== TERMINAL_DONE && rawNextStepId !== TERMINAL_BLOCKED && !activeStepIds.has(rawNextStepId) ? TERMINAL_DONE : rawNextStepId;
|
|
1097
1113
|
if (nextStepId === TERMINAL_DONE) {
|
|
1098
1114
|
sessionManager.setPhase(sessionId, "done");
|
|
1115
|
+
if (executionId) {
|
|
1116
|
+
sessionManager.completeWorkflow(
|
|
1117
|
+
sessionId,
|
|
1118
|
+
executionId,
|
|
1119
|
+
workflow.metadata.id,
|
|
1120
|
+
workflow.metadata.name,
|
|
1121
|
+
workflow.metadata.color
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1099
1124
|
const totalTimeSeconds = Math.round((performance.now() - startTime) / 100) / 10;
|
|
1100
1125
|
const completedSession = sessionManager.requireSession(sessionId);
|
|
1101
1126
|
const workflowMessages = completedSession.messages.slice(messagesBeforeWorkflow);
|
|
@@ -1136,6 +1161,15 @@ ${output.slice(0, 1e4)}
|
|
|
1136
1161
|
}
|
|
1137
1162
|
if (nextStepId === TERMINAL_BLOCKED) {
|
|
1138
1163
|
sessionManager.setPhase(sessionId, "blocked");
|
|
1164
|
+
if (executionId) {
|
|
1165
|
+
sessionManager.blockWorkflow(
|
|
1166
|
+
sessionId,
|
|
1167
|
+
executionId,
|
|
1168
|
+
workflow.metadata.id,
|
|
1169
|
+
workflow.metadata.name,
|
|
1170
|
+
workflow.metadata.color
|
|
1171
|
+
);
|
|
1172
|
+
}
|
|
1139
1173
|
const reason = "No matching transition";
|
|
1140
1174
|
emitWorkflowMessage(eventStore, sessionId, `Runner blocked: ${reason}`, currentWindowMessageOptions, onMessage);
|
|
1141
1175
|
logger.warn("Workflow executor blocked", { sessionId, iterations, reason });
|
|
@@ -1742,7 +1776,7 @@ function createWebSocketServer(httpServer, _config, getLLMClient, getActiveProvi
|
|
|
1742
1776
|
const { messages, hiddenCount } = buildMessagesFromStoredEvents(events, maxVisible || void 0);
|
|
1743
1777
|
const pendingConfirmations = foldPendingConfirmations(events);
|
|
1744
1778
|
const pendingQuestions = getPendingQuestionsForSession(updatedSession.id);
|
|
1745
|
-
const
|
|
1779
|
+
const activeWorkflowExecution = sessionManager.getActiveWorkflowExecution(updatedSession.id);
|
|
1746
1780
|
const effectiveWorkdir = updatedSession.workspace ?? updatedSession.workdir;
|
|
1747
1781
|
for (const [, client] of clients) {
|
|
1748
1782
|
if (client.activeSessionId === updatedSession.id && client.activeWorkdir !== effectiveWorkdir) {
|
|
@@ -1767,7 +1801,7 @@ function createWebSocketServer(httpServer, _config, getLLMClient, getActiveProvi
|
|
|
1767
1801
|
void 0,
|
|
1768
1802
|
void 0,
|
|
1769
1803
|
hiddenCount,
|
|
1770
|
-
|
|
1804
|
+
activeWorkflowExecution ?? void 0
|
|
1771
1805
|
)
|
|
1772
1806
|
);
|
|
1773
1807
|
if (effectiveWorkdir) {
|
|
@@ -2127,8 +2161,8 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
|
|
|
2127
2161
|
const sessionId = client.activeSessionId;
|
|
2128
2162
|
const session = sessionManager.requireSession(sessionId);
|
|
2129
2163
|
try {
|
|
2130
|
-
const { buildCachedPrompt } = await import("./dynamic-context-
|
|
2131
|
-
const allAgents = await import("./registry-
|
|
2164
|
+
const { buildCachedPrompt } = await import("./dynamic-context-CJFDFUJF.js");
|
|
2165
|
+
const allAgents = await import("./registry-XBEHPY7C.js");
|
|
2132
2166
|
const agentDef = allAgents.findAgentById(session.mode, await allAgents.loadAllAgentsDefault()) ?? allAgents.findAgentById("planner", await allAgents.loadAllAgentsDefault());
|
|
2133
2167
|
const { systemPrompt: newPrompt, hash: newHash } = await buildCachedPrompt(sessionManager, sessionId, agentDef);
|
|
2134
2168
|
const oldCached = sessionManager.getCachedPrompt(sessionId);
|
|
@@ -2281,6 +2315,32 @@ ${content}` : workflowInfo;
|
|
|
2281
2315
|
...isResume && launchPayload?.resumeFrom ? { resumeFromStep: launchPayload.resumeFrom } : {},
|
|
2282
2316
|
...isResume && launchPayload?.stepOutput ? { initialStepOutput: launchPayload.stepOutput } : {},
|
|
2283
2317
|
...launchPayload?.params ? { params: launchPayload.params } : {},
|
|
2318
|
+
// On resume, prefer params/stepOutput from the persisted workflow execution
|
|
2319
|
+
...isResume ? (() => {
|
|
2320
|
+
const exec = sessionManager.getActiveWorkflowExecution(sessionId);
|
|
2321
|
+
if (!exec) return {};
|
|
2322
|
+
if (exec.status === "waiting") {
|
|
2323
|
+
const resumed = sessionManager.resumeWorkflow(
|
|
2324
|
+
sessionId,
|
|
2325
|
+
exec.id,
|
|
2326
|
+
exec.workflowId,
|
|
2327
|
+
exec.workflowName,
|
|
2328
|
+
exec.workflowColor
|
|
2329
|
+
);
|
|
2330
|
+
if (resumed) {
|
|
2331
|
+
return {
|
|
2332
|
+
params: resumed.params,
|
|
2333
|
+
initialStepOutput: resumed.stepOutput,
|
|
2334
|
+
...exec.currentStepId ? { resumeFromStep: exec.currentStepId } : {}
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
return {
|
|
2339
|
+
...Object.keys(exec.params).length > 0 ? { params: exec.params } : {},
|
|
2340
|
+
...Object.keys(exec.stepOutput).length > 0 ? { initialStepOutput: exec.stepOutput } : {},
|
|
2341
|
+
...exec.currentStepId ? { resumeFromStep: exec.currentStepId } : {}
|
|
2342
|
+
};
|
|
2343
|
+
})() : {},
|
|
2284
2344
|
...hasUserMessage ? {
|
|
2285
2345
|
userMessage: {
|
|
2286
2346
|
content: hasUserContent ? launchPayload.content : "",
|
|
@@ -2349,6 +2409,43 @@ ${content}` : workflowInfo;
|
|
|
2349
2409
|
send({ type: "ack", payload: {}, id: message.id });
|
|
2350
2410
|
break;
|
|
2351
2411
|
}
|
|
2412
|
+
// =========================================================================
|
|
2413
|
+
// Workflow
|
|
2414
|
+
// =========================================================================
|
|
2415
|
+
case "workflow.exit": {
|
|
2416
|
+
if (!client.activeSessionId) {
|
|
2417
|
+
send(createErrorMessage("NO_SESSION", "No active session", message.id));
|
|
2418
|
+
return;
|
|
2419
|
+
}
|
|
2420
|
+
const exitSessionId = client.activeSessionId;
|
|
2421
|
+
const exitSession = sessionManager.getSession(exitSessionId);
|
|
2422
|
+
if (!exitSession) {
|
|
2423
|
+
send(createErrorMessage("NOT_FOUND", "Session not found", message.id));
|
|
2424
|
+
return;
|
|
2425
|
+
}
|
|
2426
|
+
const activeExec = sessionManager.getActiveWorkflowExecution(exitSessionId);
|
|
2427
|
+
if (activeExec) {
|
|
2428
|
+
sessionManager.cancelWorkflow(
|
|
2429
|
+
exitSessionId,
|
|
2430
|
+
activeExec.id,
|
|
2431
|
+
activeExec.workflowId,
|
|
2432
|
+
activeExec.workflowName,
|
|
2433
|
+
activeExec.workflowColor
|
|
2434
|
+
);
|
|
2435
|
+
} else {
|
|
2436
|
+
sessionManager.setPhase(exitSessionId, "build");
|
|
2437
|
+
}
|
|
2438
|
+
const controller = activeAgents.get(exitSessionId);
|
|
2439
|
+
if (controller) {
|
|
2440
|
+
activeAgents.delete(exitSessionId);
|
|
2441
|
+
controller.abort();
|
|
2442
|
+
}
|
|
2443
|
+
if (exitSession.isRunning) {
|
|
2444
|
+
sessionManager.setRunning(exitSessionId, false);
|
|
2445
|
+
}
|
|
2446
|
+
send({ type: "ack", payload: {}, id: message.id });
|
|
2447
|
+
break;
|
|
2448
|
+
}
|
|
2352
2449
|
default: {
|
|
2353
2450
|
send(createErrorMessage("UNKNOWN_MESSAGE", `Unknown message type: ${message.type}`, message.id));
|
|
2354
2451
|
}
|
|
@@ -2380,4 +2477,4 @@ export {
|
|
|
2380
2477
|
signalMcpReady,
|
|
2381
2478
|
createWebSocketServer
|
|
2382
2479
|
};
|
|
2383
|
-
//# sourceMappingURL=chunk-
|
|
2480
|
+
//# sourceMappingURL=chunk-D6T3X22W.js.map
|
|
@@ -197,6 +197,27 @@ function runMigrations(db2) {
|
|
|
197
197
|
logger.info("Migrating sessions table: adding branch column");
|
|
198
198
|
db2.exec(`ALTER TABLE sessions ADD COLUMN branch TEXT`);
|
|
199
199
|
}
|
|
200
|
+
db2.exec(`
|
|
201
|
+
CREATE TABLE IF NOT EXISTS workflow_executions (
|
|
202
|
+
id TEXT PRIMARY KEY,
|
|
203
|
+
session_id TEXT NOT NULL,
|
|
204
|
+
workflow_id TEXT NOT NULL,
|
|
205
|
+
workflow_name TEXT NOT NULL,
|
|
206
|
+
workflow_color TEXT,
|
|
207
|
+
status TEXT NOT NULL DEFAULT 'running',
|
|
208
|
+
current_step_id TEXT,
|
|
209
|
+
current_step_name TEXT,
|
|
210
|
+
step_output TEXT,
|
|
211
|
+
params TEXT,
|
|
212
|
+
created_at INTEGER NOT NULL,
|
|
213
|
+
updated_at INTEGER NOT NULL,
|
|
214
|
+
FOREIGN KEY (session_id) REFERENCES sessions(id) ON DELETE CASCADE
|
|
215
|
+
)
|
|
216
|
+
`);
|
|
217
|
+
db2.exec(`
|
|
218
|
+
CREATE INDEX IF NOT EXISTS idx_workflow_executions_session
|
|
219
|
+
ON workflow_executions(session_id)
|
|
220
|
+
`);
|
|
200
221
|
logger.info("Database migrations completed");
|
|
201
222
|
}
|
|
202
223
|
|
|
@@ -204,4 +225,4 @@ export {
|
|
|
204
225
|
initDatabase,
|
|
205
226
|
getDatabase
|
|
206
227
|
};
|
|
207
|
-
//# sourceMappingURL=chunk-
|
|
228
|
+
//# sourceMappingURL=chunk-GLF65XDS.js.map
|
|
@@ -11,7 +11,11 @@ import {
|
|
|
11
11
|
} from "./chunk-I72ACQ6R.js";
|
|
12
12
|
import {
|
|
13
13
|
getPlatformShell
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NLN5LPQ4.js";
|
|
15
|
+
import {
|
|
16
|
+
SETTINGS_KEYS,
|
|
17
|
+
getSetting
|
|
18
|
+
} from "./chunk-UEOEA6BB.js";
|
|
15
19
|
|
|
16
20
|
// src/server/utils/shell.ts
|
|
17
21
|
import { spawn } from "child_process";
|
|
@@ -22,10 +26,16 @@ function spawnShell(command, options) {
|
|
|
22
26
|
const shell = getPlatformShell();
|
|
23
27
|
const isCmd = shell.command === "cmd.exe";
|
|
24
28
|
const args = isCmd ? ["/d", "/s", "/c", `"${command}"`] : [...shell.args, command];
|
|
29
|
+
const proxyUrl = getSetting(SETTINGS_KEYS.PROXY_URL);
|
|
30
|
+
const proxyEnv = {};
|
|
31
|
+
if (proxyUrl) {
|
|
32
|
+
proxyEnv["HTTP_PROXY"] = proxyUrl;
|
|
33
|
+
proxyEnv["HTTPS_PROXY"] = proxyUrl;
|
|
34
|
+
}
|
|
25
35
|
return spawn(shell.command, args, {
|
|
26
36
|
...isCmd ? { windowsVerbatimArguments: true } : {},
|
|
27
37
|
cwd: options.cwd,
|
|
28
|
-
env: { ...process.env },
|
|
38
|
+
env: { ...process.env, ...proxyEnv },
|
|
29
39
|
stdio: options.stdio ?? ["ignore", "pipe", "pipe"],
|
|
30
40
|
windowsHide: true,
|
|
31
41
|
// detached is only useful for Unix process-group semantics; on win32 it
|
|
@@ -153,4 +163,4 @@ export {
|
|
|
153
163
|
getSessionProcesses2 as getSessionProcesses,
|
|
154
164
|
getProcessLogs
|
|
155
165
|
};
|
|
156
|
-
//# sourceMappingURL=chunk-
|
|
166
|
+
//# sourceMappingURL=chunk-HAFRPV7I.js.map
|