openfox 2.0.91 → 2.0.93
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 +28 -0
- package/dist/CHANGELOG.md +28 -0
- package/dist/{chat-handler-PC5BUJGA.js → chat-handler-MSQFJH7S.js} +13 -13
- package/dist/{chunk-AXFPEGJI.js → chunk-3QQKKZMF.js} +23 -3
- package/dist/{chunk-JJY5O2WH.js → chunk-AA4PXMSI.js} +63 -38
- package/dist/{chunk-WPACSSBS.js → chunk-AQ4KCGXL.js} +3 -3
- package/dist/{chunk-VJEVCZZA.js → chunk-ESJNJ5B6.js} +3 -3
- package/dist/{chunk-DVVRKNFS.js → chunk-FK6R2YTQ.js} +24 -9
- package/dist/{chunk-NO65CC2R.js → chunk-GAIAJDPH.js} +152 -44
- package/dist/{chunk-CND2YWIJ.js → chunk-IAAHDCJN.js} +9 -4
- package/dist/chunk-LVZ6VQ3K.js +7 -0
- package/dist/{chunk-4IBFA5IF.js → chunk-NV63HYNR.js} +6 -4
- package/dist/{chunk-FSLCOA4R.js → chunk-NW2KP7PE.js} +4 -4
- package/dist/{chunk-LT4MPTGU.js → chunk-PYJ2SRVC.js} +2 -2
- package/dist/{chunk-Q7CN4JOO.js → chunk-RJQDC2OO.js} +7 -7
- package/dist/{chunk-CFK34T26.js → chunk-TQATAKVV.js} +1 -1
- package/dist/{chunk-NLJXZZTB.js → chunk-U2RSFH6A.js} +3 -1
- package/dist/{chunk-JX6WL56A.js → chunk-YM267G4F.js} +3 -3
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{compactor-HW6GBRAG.js → compactor-R7GGPBPR.js} +5 -5
- package/dist/{dynamic-context-TDD3Q43F.js → dynamic-context-4UPNVL3N.js} +3 -3
- package/dist/{events-ICX5KVET.js → events-D5AFN2CW.js} +3 -3
- package/dist/{folding-L2L4OHX6.js → folding-BO6Z6HMP.js} +4 -2
- package/dist/{orchestrator-56LSHPPK.js → orchestrator-YQI2D4LW.js} +10 -10
- package/dist/package.json +1 -1
- package/dist/{path-security-XENIR7SX.js → path-security-DP75YZK5.js} +6 -6
- package/dist/{processor-H6NFFRI2.js → processor-LVQWRG6M.js} +10 -10
- package/dist/{protocol-3GNSIGP4.js → protocol-4ZDERZNC.js} +3 -3
- package/dist/{protocol-CaSHnORC.d.ts → protocol-8BzyapcK.d.ts} +11 -3
- package/dist/provider/index.d.ts +4 -4
- package/dist/{serve-KNVANLAK.js → serve-HEHWSYMX.js} +15 -14
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +14 -13
- package/dist/{server-H3525HD6.js → server-AAIYC4BH.js} +13 -12
- package/dist/shared/index.d.ts +3 -3
- package/dist/shared/index.js +1 -1
- package/dist/{tools-DXBIHSMY.js → tools-HDD7RHEG.js} +8 -8
- package/dist/{types-CHCZiJvw.d.ts → types-Ci7Tdpq3.d.ts} +9 -2
- package/dist/{types-Cw7L4Bze.d.ts → types-_OEK96iM.d.ts} +1 -1
- package/dist/{update-4BGMFSEG.js → update-JARYMNGH.js} +2 -2
- package/dist/web/assets/{index-mS37wyUs.css → index-B3lfsL1_.css} +1 -1
- package/dist/web/assets/index-DxTIqntH.js +317 -0
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GPODFKPQ.js +0 -7
- package/dist/web/assets/index-Chu9JX0M.js +0 -316
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentTurn,
|
|
3
3
|
runChatTurn
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RJQDC2OO.js";
|
|
5
|
+
import {
|
|
6
|
+
generateSessionNameForSession,
|
|
7
|
+
getSessionMessageCount,
|
|
8
|
+
needsNameGeneration
|
|
9
|
+
} from "./chunk-NV63HYNR.js";
|
|
5
10
|
import {
|
|
6
11
|
devServerManager,
|
|
7
12
|
executeSubAgent,
|
|
8
13
|
getToolRegistryForAgent
|
|
9
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FK6R2YTQ.js";
|
|
10
15
|
import {
|
|
11
16
|
checkAborted,
|
|
12
17
|
onProcessEvent,
|
|
@@ -23,7 +28,7 @@ import {
|
|
|
23
28
|
applyDynamicContext,
|
|
24
29
|
computeSessionHash,
|
|
25
30
|
computeUnifiedDiff
|
|
26
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NW2KP7PE.js";
|
|
27
32
|
import {
|
|
28
33
|
createChatErrorMessage,
|
|
29
34
|
createChatMessageMessage,
|
|
@@ -38,14 +43,14 @@ import {
|
|
|
38
43
|
parseClientMessage,
|
|
39
44
|
serializeServerMessage,
|
|
40
45
|
storedEventToServerMessage
|
|
41
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-IAAHDCJN.js";
|
|
42
47
|
import {
|
|
43
48
|
getPendingQuestionsForSession,
|
|
44
49
|
provideAnswer
|
|
45
50
|
} from "./chunk-EU3WWTFH.js";
|
|
46
51
|
import {
|
|
47
52
|
appendCompactionPrompt
|
|
48
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-ESJNJ5B6.js";
|
|
49
54
|
import {
|
|
50
55
|
TurnMetrics,
|
|
51
56
|
createMessageStartEvent
|
|
@@ -54,14 +59,15 @@ import {
|
|
|
54
59
|
combineEventsWithSnapshot,
|
|
55
60
|
getCurrentContextWindowId,
|
|
56
61
|
getEventStore
|
|
57
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-PYJ2SRVC.js";
|
|
58
63
|
import {
|
|
59
64
|
getPlatformShell
|
|
60
65
|
} from "./chunk-WWC3R3YL.js";
|
|
61
66
|
import {
|
|
62
67
|
buildMessagesFromStoredEvents,
|
|
63
|
-
foldPendingConfirmations
|
|
64
|
-
|
|
68
|
+
foldPendingConfirmations,
|
|
69
|
+
foldWaitingWorkflow
|
|
70
|
+
} from "./chunk-3QQKKZMF.js";
|
|
65
71
|
import {
|
|
66
72
|
deleteItemFromDir,
|
|
67
73
|
findAgentById,
|
|
@@ -82,7 +88,7 @@ import {
|
|
|
82
88
|
} from "./chunk-VUQCQXXJ.js";
|
|
83
89
|
import {
|
|
84
90
|
createServerMessage
|
|
85
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-TQATAKVV.js";
|
|
86
92
|
import {
|
|
87
93
|
getGlobalConfigDir
|
|
88
94
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -647,6 +653,9 @@ function resolveTemplate(template, ctx) {
|
|
|
647
653
|
result = result.replace(/\{\{stepOutput\.(\w+)\}\}/g, (_, key) => ctx.stepOutput[key] ?? "");
|
|
648
654
|
result = result.replace(/\{\{verifierFindings\}\}/g, ctx.stepOutput["content"] ?? "");
|
|
649
655
|
result = result.replace(/\{\{previousStepOutput\}\}/g, ctx.stepOutput["stdout"] ?? "");
|
|
656
|
+
for (const [key, value] of Object.entries(ctx.params)) {
|
|
657
|
+
result = result.replaceAll(`{{${key}}}`, value);
|
|
658
|
+
}
|
|
650
659
|
return result;
|
|
651
660
|
}
|
|
652
661
|
function evaluateCondition(condition, stepOutcome, metadataEntries) {
|
|
@@ -735,8 +744,10 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
735
744
|
const startTime = performance.now();
|
|
736
745
|
let iterations = 0;
|
|
737
746
|
const activeSteps = subGroup ? workflow.steps.filter((s) => s.subGroup === subGroup) : workflow.steps;
|
|
738
|
-
|
|
739
|
-
|
|
747
|
+
const resumeFromStep = options.resumeFromStep;
|
|
748
|
+
const isResume = !!resumeFromStep;
|
|
749
|
+
let currentStepId = isResume ? resumeFromStep : subGroup ? activeSteps[0]?.id ?? workflow.entryStep : workflow.entryStep;
|
|
750
|
+
let lastStepOutput = options.initialStepOutput ?? {};
|
|
740
751
|
const firstEntryForStep = /* @__PURE__ */ new Set();
|
|
741
752
|
const messagesBeforeWorkflow = sessionManager.requireSession(sessionId).messages.length;
|
|
742
753
|
const activeStepIds = new Set(activeSteps.map((s) => s.id));
|
|
@@ -744,6 +755,31 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
744
755
|
for (const step of activeSteps) {
|
|
745
756
|
stepsById.set(step.id, step);
|
|
746
757
|
}
|
|
758
|
+
if (resumeFromStep) {
|
|
759
|
+
const targetStep = stepsById.get(resumeFromStep);
|
|
760
|
+
if (!targetStep) {
|
|
761
|
+
return {
|
|
762
|
+
finalAction: {
|
|
763
|
+
type: "BLOCKED",
|
|
764
|
+
reason: `Resume target step "${resumeFromStep}" not found in workflow "${workflow.metadata.id}"`,
|
|
765
|
+
blockedCriteria: []
|
|
766
|
+
},
|
|
767
|
+
iterations: 0,
|
|
768
|
+
totalTime: (performance.now() - startTime) / 1e3
|
|
769
|
+
};
|
|
770
|
+
}
|
|
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
|
+
}
|
|
747
783
|
logger.debug("Workflow executor starting", { sessionId, workflow: workflow.metadata.id });
|
|
748
784
|
if (workflow.startCondition && workflow.startCondition.type !== "always") {
|
|
749
785
|
const session = sessionManager.requireSession(sessionId);
|
|
@@ -765,28 +801,30 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
765
801
|
};
|
|
766
802
|
}
|
|
767
803
|
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
804
|
+
if (!isResume) {
|
|
805
|
+
const startMsgId = crypto.randomUUID();
|
|
806
|
+
const startWindowOpts = getCurrentWindowMessageOptions(sessionId);
|
|
807
|
+
eventStore.append(
|
|
808
|
+
sessionId,
|
|
809
|
+
createMessageStartEvent(
|
|
810
|
+
startMsgId,
|
|
811
|
+
"user",
|
|
812
|
+
JSON.stringify({
|
|
813
|
+
workflowName: workflow.metadata.name,
|
|
814
|
+
workflowId: workflow.metadata.id,
|
|
815
|
+
workflowColor: workflow.metadata.color
|
|
816
|
+
}),
|
|
817
|
+
{ ...startWindowOpts ?? {}, isSystemGenerated: true, messageKind: "workflow-started" }
|
|
818
|
+
)
|
|
819
|
+
);
|
|
820
|
+
eventStore.append(sessionId, { type: "message.done", data: { messageId: startMsgId } });
|
|
821
|
+
if (options.userMessage) {
|
|
822
|
+
sessionManager.addMessage(sessionId, {
|
|
823
|
+
role: "user",
|
|
824
|
+
content: options.userMessage.content,
|
|
825
|
+
...options.userMessage.attachments ? { attachments: options.userMessage.attachments } : {}
|
|
826
|
+
});
|
|
827
|
+
}
|
|
790
828
|
}
|
|
791
829
|
while (iterations < workflow.settings.maxIterations) {
|
|
792
830
|
if (signal?.aborted) {
|
|
@@ -819,7 +857,8 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
819
857
|
pendingCount: criteriaEntries.filter((e) => e.status !== "passed").length,
|
|
820
858
|
criteriaList: formatCriteriaList(criteriaEntries),
|
|
821
859
|
modifiedFiles: await formatModifiedFiles(sessionManager.getEffectiveWorkdir(sessionId)),
|
|
822
|
-
stepOutput: lastStepOutput
|
|
860
|
+
stepOutput: lastStepOutput,
|
|
861
|
+
params: options.params ?? {}
|
|
823
862
|
};
|
|
824
863
|
sessionManager.setPhase(sessionId, step.phase);
|
|
825
864
|
if (step.type === "agent") {
|
|
@@ -1021,6 +1060,35 @@ ${output.slice(0, 1e4)}
|
|
|
1021
1060
|
stepOutcome = { result: successCodes.includes(result.exitCode) ? "success" : "failure", output: lastStepOutput };
|
|
1022
1061
|
break;
|
|
1023
1062
|
}
|
|
1063
|
+
case "user": {
|
|
1064
|
+
if (resumeFromStep === step.id) {
|
|
1065
|
+
stepOutcome = { result: "continue", output: lastStepOutput };
|
|
1066
|
+
break;
|
|
1067
|
+
}
|
|
1068
|
+
eventStore.append(sessionId, {
|
|
1069
|
+
type: "workflow.waiting",
|
|
1070
|
+
data: {
|
|
1071
|
+
workflowId: workflow.metadata.id,
|
|
1072
|
+
workflowName: workflow.metadata.name,
|
|
1073
|
+
stepId: step.id,
|
|
1074
|
+
stepName: step.name,
|
|
1075
|
+
stepOutput: lastStepOutput
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
sessionManager.setPhase(sessionId, "waiting");
|
|
1079
|
+
logger.debug("Workflow paused at user step", { sessionId, stepId: step.id, stepName: step.name });
|
|
1080
|
+
return {
|
|
1081
|
+
finalAction: {
|
|
1082
|
+
type: "WAITING",
|
|
1083
|
+
reason: `Paused at user step: ${step.name}`,
|
|
1084
|
+
workflowId: workflow.metadata.id,
|
|
1085
|
+
stepId: step.id,
|
|
1086
|
+
stepOutput: lastStepOutput
|
|
1087
|
+
},
|
|
1088
|
+
iterations,
|
|
1089
|
+
totalTime: (performance.now() - startTime) / 1e3
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1024
1092
|
}
|
|
1025
1093
|
const refreshedSession = sessionManager.requireSession(sessionId);
|
|
1026
1094
|
const effectiveTransitions = subGroup ? step.transitions.filter((t) => !t.subGroup || t.subGroup === subGroup) : step.transitions;
|
|
@@ -1097,11 +1165,20 @@ async function runOrchestrator(options) {
|
|
|
1097
1165
|
const runtimeConfig = getRuntimeConfig();
|
|
1098
1166
|
const workflowId = options.workflowId ?? runtimeConfig.activeWorkflowId ?? "default";
|
|
1099
1167
|
const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
|
|
1100
|
-
const
|
|
1168
|
+
const session = options.sessionManager.requireSession(options.sessionId);
|
|
1169
|
+
const projectDir = session.workdir;
|
|
1170
|
+
const workflows = await loadAllWorkflows(configDir, projectDir);
|
|
1101
1171
|
const workflow = findWorkflowById(workflowId, workflows);
|
|
1102
1172
|
if (!workflow) {
|
|
1103
1173
|
throw new Error(`Workflow "${workflowId}" not found`);
|
|
1104
1174
|
}
|
|
1175
|
+
const requiredParams = (workflow.metadata.parameters ?? []).filter((p) => p.required);
|
|
1176
|
+
const suppliedParams = options.params ?? {};
|
|
1177
|
+
const missing = requiredParams.filter((p) => !(p.id in suppliedParams));
|
|
1178
|
+
if (missing.length > 0) {
|
|
1179
|
+
const names = missing.map((p) => p.label || p.id).join(", ");
|
|
1180
|
+
throw new Error(`Missing required parameter${missing.length > 1 ? "s" : ""}: ${names}`);
|
|
1181
|
+
}
|
|
1105
1182
|
logger.debug("Using workflow executor", {
|
|
1106
1183
|
sessionId: options.sessionId,
|
|
1107
1184
|
workflow: workflow.metadata.id,
|
|
@@ -1665,6 +1742,7 @@ function createWebSocketServer(httpServer, _config, getLLMClient, getActiveProvi
|
|
|
1665
1742
|
const { messages, hiddenCount } = buildMessagesFromStoredEvents(events, maxVisible || void 0);
|
|
1666
1743
|
const pendingConfirmations = foldPendingConfirmations(events);
|
|
1667
1744
|
const pendingQuestions = getPendingQuestionsForSession(updatedSession.id);
|
|
1745
|
+
const waitingWorkflow = foldWaitingWorkflow(events);
|
|
1668
1746
|
const effectiveWorkdir = updatedSession.workspace ?? updatedSession.workdir;
|
|
1669
1747
|
for (const [, client] of clients) {
|
|
1670
1748
|
if (client.activeSessionId === updatedSession.id && client.activeWorkdir !== effectiveWorkdir) {
|
|
@@ -1688,7 +1766,8 @@ function createWebSocketServer(httpServer, _config, getLLMClient, getActiveProvi
|
|
|
1688
1766
|
pendingQuestions,
|
|
1689
1767
|
void 0,
|
|
1690
1768
|
void 0,
|
|
1691
|
-
hiddenCount
|
|
1769
|
+
hiddenCount,
|
|
1770
|
+
waitingWorkflow
|
|
1692
1771
|
)
|
|
1693
1772
|
);
|
|
1694
1773
|
if (effectiveWorkdir) {
|
|
@@ -2048,7 +2127,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
|
|
|
2048
2127
|
const sessionId = client.activeSessionId;
|
|
2049
2128
|
const session = sessionManager.requireSession(sessionId);
|
|
2050
2129
|
try {
|
|
2051
|
-
const { buildCachedPrompt } = await import("./dynamic-context-
|
|
2130
|
+
const { buildCachedPrompt } = await import("./dynamic-context-4UPNVL3N.js");
|
|
2052
2131
|
const allAgents = await import("./registry-ERUV33AP.js");
|
|
2053
2132
|
const agentDef = allAgents.findAgentById(session.mode, await allAgents.loadAllAgentsDefault()) ?? allAgents.findAgentById("planner", await allAgents.loadAllAgentsDefault());
|
|
2054
2133
|
const { systemPrompt: newPrompt, hash: newHash } = await buildCachedPrompt(sessionManager, sessionId, agentDef);
|
|
@@ -2144,10 +2223,12 @@ ${content}` : workflowInfo;
|
|
|
2144
2223
|
return;
|
|
2145
2224
|
}
|
|
2146
2225
|
const launchPayloadEarly = message.payload;
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2226
|
+
if (!launchPayloadEarly?.resumeFrom) {
|
|
2227
|
+
const pendingCriteria = session.criteria.filter((c) => c.status.type !== "passed");
|
|
2228
|
+
if (!launchPayloadEarly?.workflowId && pendingCriteria.length === 0) {
|
|
2229
|
+
send(createErrorMessage("NO_WORK", "No pending criteria to work on", message.id));
|
|
2230
|
+
return;
|
|
2231
|
+
}
|
|
2151
2232
|
}
|
|
2152
2233
|
const sessionId = client.activeSessionId;
|
|
2153
2234
|
if (session.phase === "blocked") {
|
|
@@ -2159,6 +2240,7 @@ ${content}` : workflowInfo;
|
|
|
2159
2240
|
const hasUserContent = launchPayload?.content && typeof launchPayload.content === "string" && launchPayload.content.trim();
|
|
2160
2241
|
const hasUserAttachments = launchAttachments && launchAttachments.length > 0;
|
|
2161
2242
|
const hasUserMessage = hasUserContent || hasUserAttachments;
|
|
2243
|
+
const isResume = !!launchPayload?.resumeFrom;
|
|
2162
2244
|
sessionManager.setRunning(sessionId, true);
|
|
2163
2245
|
sendForSession(sessionId, createSessionRunningMessage(true));
|
|
2164
2246
|
const controller = new AbortController();
|
|
@@ -2170,7 +2252,25 @@ ${content}` : workflowInfo;
|
|
|
2170
2252
|
activeAgents.set(sessionId, controller);
|
|
2171
2253
|
send({ type: "ack", payload: {}, id: message.id });
|
|
2172
2254
|
ensureEventStoreSubscription(sessionId);
|
|
2173
|
-
logger.info("Runner launching", { sessionId,
|
|
2255
|
+
logger.info("Runner launching", { sessionId, isResume });
|
|
2256
|
+
if (!isResume && launchPayload?.workflowId && _providerManager) {
|
|
2257
|
+
const session2 = sessionManager.getSession(sessionId);
|
|
2258
|
+
const messageCount = getSessionMessageCount(sessionId);
|
|
2259
|
+
if (session2 && needsNameGeneration(session2.metadata?.title, messageCount)) {
|
|
2260
|
+
const nameHint = launchPayload.workflowId + (launchPayload?.params && Object.keys(launchPayload.params).length > 0 ? ": " + Object.entries(launchPayload.params).map(([k, v]) => `${k}=${v}`).join(", ") : "");
|
|
2261
|
+
generateSessionNameForSession(
|
|
2262
|
+
sessionId,
|
|
2263
|
+
nameHint,
|
|
2264
|
+
{
|
|
2265
|
+
sessionManager,
|
|
2266
|
+
providerManager: _providerManager,
|
|
2267
|
+
broadcastForSession: _broadcastForSession,
|
|
2268
|
+
eventStore: getEventStore()
|
|
2269
|
+
},
|
|
2270
|
+
controller.signal
|
|
2271
|
+
);
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2174
2274
|
runOrchestrator({
|
|
2175
2275
|
sessionManager,
|
|
2176
2276
|
sessionId,
|
|
@@ -2178,6 +2278,9 @@ ${content}` : workflowInfo;
|
|
|
2178
2278
|
statsIdentity: statsForSession(sessionId),
|
|
2179
2279
|
...launchPayload?.workflowId ? { workflowId: launchPayload.workflowId } : {},
|
|
2180
2280
|
...launchPayload?.subGroup ? { subGroup: launchPayload.subGroup } : {},
|
|
2281
|
+
...isResume && launchPayload?.resumeFrom ? { resumeFromStep: launchPayload.resumeFrom } : {},
|
|
2282
|
+
...isResume && launchPayload?.stepOutput ? { initialStepOutput: launchPayload.stepOutput } : {},
|
|
2283
|
+
...launchPayload?.params ? { params: launchPayload.params } : {},
|
|
2181
2284
|
...hasUserMessage ? {
|
|
2182
2285
|
userMessage: {
|
|
2183
2286
|
content: hasUserContent ? launchPayload.content : "",
|
|
@@ -2191,7 +2294,12 @@ ${content}` : workflowInfo;
|
|
|
2191
2294
|
if (error instanceof Error && error.message === "Aborted") {
|
|
2192
2295
|
return;
|
|
2193
2296
|
}
|
|
2194
|
-
|
|
2297
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
2298
|
+
logger.error("Runner error", { error: errorMessage, sessionId });
|
|
2299
|
+
_broadcastForSession(
|
|
2300
|
+
sessionId,
|
|
2301
|
+
createServerMessage("chat.error", { error: errorMessage, recoverable: false })
|
|
2302
|
+
);
|
|
2195
2303
|
}).finally(() => {
|
|
2196
2304
|
try {
|
|
2197
2305
|
sessionManager.setRunning(sessionId, false);
|
|
@@ -2272,4 +2380,4 @@ export {
|
|
|
2272
2380
|
signalMcpReady,
|
|
2273
2381
|
createWebSocketServer
|
|
2274
2382
|
};
|
|
2275
|
-
//# sourceMappingURL=chunk-
|
|
2383
|
+
//# sourceMappingURL=chunk-GAIAJDPH.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServerMessage,
|
|
3
3
|
isClientMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TQATAKVV.js";
|
|
5
5
|
|
|
6
6
|
// src/server/ws/protocol.ts
|
|
7
7
|
function enrichMessagesWithToolResults(messages) {
|
|
@@ -43,7 +43,7 @@ function serializeServerMessage(message) {
|
|
|
43
43
|
function createErrorMessage(code, message, correlationId) {
|
|
44
44
|
return createServerMessage("error", { code, message }, correlationId);
|
|
45
45
|
}
|
|
46
|
-
function createSessionStateMessage(session, messages, pendingConfirmations = [], pendingQuestions, gitStatus, correlationId, hiddenCount) {
|
|
46
|
+
function createSessionStateMessage(session, messages, pendingConfirmations = [], pendingQuestions, gitStatus, correlationId, hiddenCount, waitingWorkflow) {
|
|
47
47
|
const enrichedMessages = enrichMessagesWithToolResults(messages);
|
|
48
48
|
return createServerMessage(
|
|
49
49
|
"session.state",
|
|
@@ -53,7 +53,8 @@ function createSessionStateMessage(session, messages, pendingConfirmations = [],
|
|
|
53
53
|
pendingConfirmations,
|
|
54
54
|
...pendingQuestions ? { pendingQuestions } : {},
|
|
55
55
|
...gitStatus ? { gitStatus } : {},
|
|
56
|
-
...hiddenCount !== void 0 ? { hiddenCount } : {}
|
|
56
|
+
...hiddenCount !== void 0 ? { hiddenCount } : {},
|
|
57
|
+
...waitingWorkflow !== void 0 ? { waitingWorkflow } : {}
|
|
57
58
|
},
|
|
58
59
|
correlationId
|
|
59
60
|
);
|
|
@@ -240,6 +241,10 @@ function storedEventToServerMessage(event) {
|
|
|
240
241
|
const data = event.data;
|
|
241
242
|
return createServerMessage("task.completed", data);
|
|
242
243
|
}
|
|
244
|
+
case "workflow.waiting": {
|
|
245
|
+
const data = event.data;
|
|
246
|
+
return createServerMessage("workflow.waiting", data);
|
|
247
|
+
}
|
|
243
248
|
case "session.initialized": {
|
|
244
249
|
return null;
|
|
245
250
|
}
|
|
@@ -344,4 +349,4 @@ export {
|
|
|
344
349
|
createQueueStateMessage,
|
|
345
350
|
storedEventToServerMessage
|
|
346
351
|
};
|
|
347
|
-
//# sourceMappingURL=chunk-
|
|
352
|
+
//# sourceMappingURL=chunk-IAAHDCJN.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createContextStateMessage,
|
|
3
3
|
createSessionStateMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IAAHDCJN.js";
|
|
5
5
|
import {
|
|
6
6
|
getPendingQuestionsForSession
|
|
7
7
|
} from "./chunk-EU3WWTFH.js";
|
|
8
8
|
import {
|
|
9
9
|
combineEventsWithSnapshot,
|
|
10
10
|
getEventStore
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PYJ2SRVC.js";
|
|
12
12
|
import {
|
|
13
13
|
buildMessagesFromStoredEvents,
|
|
14
14
|
foldPendingConfirmations
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3QQKKZMF.js";
|
|
16
16
|
import {
|
|
17
17
|
updateSessionMetadata
|
|
18
18
|
} from "./chunk-6J5IZ2NL.js";
|
|
@@ -198,8 +198,10 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
export {
|
|
201
|
+
getSessionMessageCount,
|
|
201
202
|
finalizeTurnCompletion,
|
|
202
203
|
buildRunChatTurnParams,
|
|
204
|
+
needsNameGeneration,
|
|
203
205
|
generateSessionNameForSession
|
|
204
206
|
};
|
|
205
|
-
//# sourceMappingURL=chunk-
|
|
207
|
+
//# sourceMappingURL=chunk-NV63HYNR.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-SXHGRPCI.js";
|
|
5
5
|
import {
|
|
6
6
|
buildTopLevelSystemPrompt
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-U2RSFH6A.js";
|
|
8
8
|
import {
|
|
9
9
|
findAgentById,
|
|
10
10
|
getRuntimeConfig,
|
|
@@ -104,7 +104,7 @@ function resolveAgentDef(sessionManager, sessionId) {
|
|
|
104
104
|
}
|
|
105
105
|
async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
106
106
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
107
|
-
const { getToolRegistryForAgent } = await import("./tools-
|
|
107
|
+
const { getToolRegistryForAgent } = await import("./tools-HDD7RHEG.js");
|
|
108
108
|
const tools = getToolRegistryForAgent(agentDef, sessionId).definitions;
|
|
109
109
|
const toolFingerprint = getToolFingerprint(tools);
|
|
110
110
|
const allAgents = await loadAllAgentsDefault();
|
|
@@ -117,7 +117,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
|
117
117
|
async function computeSessionHash(sessionManager, sessionId) {
|
|
118
118
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
119
119
|
const agentDef = await resolveAgentDef(sessionManager, sessionId);
|
|
120
|
-
const { getToolRegistryForAgent } = await import("./tools-
|
|
120
|
+
const { getToolRegistryForAgent } = await import("./tools-HDD7RHEG.js");
|
|
121
121
|
const tools = getToolRegistryForAgent(agentDef, sessionId).definitions;
|
|
122
122
|
const toolFingerprint = getToolFingerprint(tools);
|
|
123
123
|
return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
|
|
@@ -141,4 +141,4 @@ export {
|
|
|
141
141
|
computeSessionHash,
|
|
142
142
|
applyDynamicContext
|
|
143
143
|
};
|
|
144
|
-
//# sourceMappingURL=chunk-
|
|
144
|
+
//# sourceMappingURL=chunk-NW2KP7PE.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
foldContextState,
|
|
6
6
|
foldSessionState,
|
|
7
7
|
spreadOptionalMessageFields
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3QQKKZMF.js";
|
|
9
9
|
import {
|
|
10
10
|
updateSessionMessageCount
|
|
11
11
|
} from "./chunk-6J5IZ2NL.js";
|
|
@@ -1159,4 +1159,4 @@ export {
|
|
|
1159
1159
|
truncateSessionMessages,
|
|
1160
1160
|
getRecentUserPromptsForSession
|
|
1161
1161
|
};
|
|
1162
|
-
//# sourceMappingURL=chunk-
|
|
1162
|
+
//# sourceMappingURL=chunk-PYJ2SRVC.js.map
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
getToolRegistryForAgent,
|
|
5
5
|
processEventsForConversation,
|
|
6
6
|
runTopLevelAgentLoop
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FK6R2YTQ.js";
|
|
8
8
|
import {
|
|
9
9
|
buildCachedPrompt,
|
|
10
10
|
computeDynamicContextHash,
|
|
11
11
|
getToolFingerprint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NW2KP7PE.js";
|
|
13
13
|
import {
|
|
14
14
|
getAllInstructions,
|
|
15
15
|
getEnabledSkillMetadata
|
|
16
16
|
} from "./chunk-SXHGRPCI.js";
|
|
17
17
|
import {
|
|
18
18
|
PathAccessDeniedError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-AQ4KCGXL.js";
|
|
20
20
|
import {
|
|
21
21
|
TurnMetrics,
|
|
22
22
|
createChatDoneEvent,
|
|
@@ -25,15 +25,15 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
buildAgentReminder,
|
|
27
27
|
buildAgentSmallReminder
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-U2RSFH6A.js";
|
|
29
29
|
import {
|
|
30
30
|
getCurrentContextWindowId,
|
|
31
31
|
getCurrentWindowMessageOptions,
|
|
32
32
|
getEventStore
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-PYJ2SRVC.js";
|
|
34
34
|
import {
|
|
35
35
|
buildSnapshotFromSessionState
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-3QQKKZMF.js";
|
|
37
37
|
import {
|
|
38
38
|
findAgentById,
|
|
39
39
|
getRuntimeConfig,
|
|
@@ -309,4 +309,4 @@ export {
|
|
|
309
309
|
runChatTurn,
|
|
310
310
|
runAgentTurn
|
|
311
311
|
};
|
|
312
|
-
//# sourceMappingURL=chunk-
|
|
312
|
+
//# sourceMappingURL=chunk-RJQDC2OO.js.map
|
|
@@ -123,6 +123,8 @@ NEVER commit changes unless user explicitly asks you to. VERY IMPORTANT only com
|
|
|
123
123
|
When doing file search, prefer to use the call_sub_agent tool with the "explorer" in order to reduce context usage, except if this would take less than 3 calls to get the information.
|
|
124
124
|
You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance.
|
|
125
125
|
|
|
126
|
+
If working on OpenFox itself, repo: https://github.com/co-l/openfox
|
|
127
|
+
|
|
126
128
|
${instructionsSection}
|
|
127
129
|
${buildSkillsSection(skills)}
|
|
128
130
|
`;
|
|
@@ -243,4 +245,4 @@ export {
|
|
|
243
245
|
buildAgentSmallReminder,
|
|
244
246
|
COMPACTION_PROMPT
|
|
245
247
|
};
|
|
246
|
-
//# sourceMappingURL=chunk-
|
|
248
|
+
//# sourceMappingURL=chunk-U2RSFH6A.js.map
|
|
@@ -200,7 +200,7 @@ async function runCli(options) {
|
|
|
200
200
|
break;
|
|
201
201
|
}
|
|
202
202
|
case "update": {
|
|
203
|
-
const { runUpdate } = await import("./update-
|
|
203
|
+
const { runUpdate } = await import("./update-JARYMNGH.js");
|
|
204
204
|
const code = await runUpdate();
|
|
205
205
|
if (code !== 0) {
|
|
206
206
|
process.exit(code);
|
|
@@ -213,7 +213,7 @@ async function runCli(options) {
|
|
|
213
213
|
if (!configExists) {
|
|
214
214
|
await runNetworkSetup(mode);
|
|
215
215
|
}
|
|
216
|
-
const { runServe } = await import("./serve-
|
|
216
|
+
const { runServe } = await import("./serve-HEHWSYMX.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-
|
|
228
|
+
//# sourceMappingURL=chunk-YM267G4F.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
COMPACTION_MAX_RATIO,
|
|
4
4
|
appendCompactionPrompt,
|
|
5
5
|
shouldCompact
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ESJNJ5B6.js";
|
|
7
7
|
import "./chunk-K2O7JTCX.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-U2RSFH6A.js";
|
|
9
|
+
import "./chunk-PYJ2SRVC.js";
|
|
10
10
|
import "./chunk-WWC3R3YL.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-3QQKKZMF.js";
|
|
12
12
|
import "./chunk-6J5IZ2NL.js";
|
|
13
13
|
import "./chunk-NGN3Q26A.js";
|
|
14
14
|
import "./chunk-J2GP3J3X.js";
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
appendCompactionPrompt,
|
|
27
27
|
shouldCompact
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=compactor-
|
|
29
|
+
//# sourceMappingURL=compactor-R7GGPBPR.js.map
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
computeSessionHash,
|
|
6
6
|
computeUnifiedDiff,
|
|
7
7
|
getToolFingerprint
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NW2KP7PE.js";
|
|
9
9
|
import "./chunk-SXHGRPCI.js";
|
|
10
10
|
import "./chunk-ST4NYXLH.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-U2RSFH6A.js";
|
|
12
12
|
import "./chunk-WWC3R3YL.js";
|
|
13
13
|
import "./chunk-NGN3Q26A.js";
|
|
14
14
|
import "./chunk-54Q4TGG6.js";
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
computeUnifiedDiff,
|
|
25
25
|
getToolFingerprint
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=dynamic-context-
|
|
27
|
+
//# sourceMappingURL=dynamic-context-4UPNVL3N.js.map
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
isStoredEvent,
|
|
40
40
|
isTurnEvent,
|
|
41
41
|
truncateSessionMessages
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-PYJ2SRVC.js";
|
|
43
43
|
import {
|
|
44
44
|
buildContextMessagesFromEventHistory,
|
|
45
45
|
buildContextMessagesFromMessages,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
foldTodos,
|
|
57
57
|
foldTurnEventsToSnapshotMessages,
|
|
58
58
|
getMessagesForWindow
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-3QQKKZMF.js";
|
|
60
60
|
import "./chunk-6J5IZ2NL.js";
|
|
61
61
|
import "./chunk-NGN3Q26A.js";
|
|
62
62
|
import "./chunk-54Q4TGG6.js";
|
|
@@ -121,4 +121,4 @@ export {
|
|
|
121
121
|
isTurnEvent,
|
|
122
122
|
truncateSessionMessages
|
|
123
123
|
};
|
|
124
|
-
//# sourceMappingURL=events-
|
|
124
|
+
//# sourceMappingURL=events-D5AFN2CW.js.map
|