openfox 2.0.94 → 2.0.96
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-Z7OCNJWO.js → chat-handler-5OJMACXB.js} +17 -17
- package/dist/{chunk-LSDJCJWA.js → chunk-3DAZIZ7E.js} +7 -7
- package/dist/{chunk-OHBY2673.js → chunk-3LRYZ7R3.js} +46 -3
- package/dist/{chunk-3WKAKOU4.js → chunk-3W6STALV.js} +2 -2
- package/dist/chunk-62QCBNPE.js +15 -0
- package/dist/chunk-7B3XSBRL.js +7 -0
- package/dist/{chunk-ZYDPYFRH.js → chunk-BG4EVBLJ.js} +6 -6
- package/dist/{chunk-MUNVSHL5.js → chunk-C3XL7X4E.js} +8 -8
- package/dist/{chunk-62X2MPO6.js → chunk-D3SXT3BL.js} +4 -4
- package/dist/{chunk-VYN37NXW.js → chunk-G5JFKTSR.js} +2 -2
- package/dist/{chunk-YJ5P33SE.js → chunk-HAFRPV7I.js} +12 -2
- package/dist/{chunk-FVV7TZC2.js → chunk-KNYPBXPW.js} +6 -5
- package/dist/{chunk-MC3MCMAF.js → chunk-KQPDU65K.js} +2 -2
- package/dist/{chunk-V4QTGYXL.js → chunk-LZW5LSVH.js} +5 -5
- package/dist/{chunk-OQXG4MS4.js → chunk-ML5ZU6VS.js} +236 -89
- package/dist/{chunk-P637C6X3.js → chunk-O2PLNJIU.js} +2 -2
- package/dist/{chunk-DLCMSSG3.js → chunk-O5YWFX7H.js} +22 -26
- package/dist/{chunk-KU3YUGAN.js → chunk-SJJVNSA6.js} +2 -2
- package/dist/{chunk-XNB3JWAR.js → chunk-TDHDLDGQ.js} +9 -19
- package/dist/{chunk-OQTLFO4R.js → chunk-URQQOUCS.js} +46 -3
- package/dist/{chunk-KNRE3DG4.js → chunk-WS7EY4CU.js} +34 -48
- package/dist/{chunk-5N5JXT7R.js → chunk-XLI6PDJG.js} +2 -2
- package/dist/{chunk-2BCQDYNA.js → chunk-YPBV47DH.js} +6 -9
- package/dist/{chunk-TSHJW7OC.js → chunk-ZIMGU5ZH.js} +2 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-OBMJSTFN.js → client-RENSCJPZ.js} +3 -3
- package/dist/{compactor-RSEV7VYH.js → compactor-U7EUKEUE.js} +6 -6
- package/dist/{config-XIYAPMX3.js → config-M7RDIFC5.js} +4 -2
- package/dist/{dynamic-context-C3BWQ5GK.js → dynamic-context-TDB4G5CH.js} +4 -4
- package/dist/{events-SY5B4VED.js → events-4THEZWVL.js} +5 -5
- package/dist/{folding-O4OYOTPS.js → folding-OYBO2NTH.js} +3 -3
- package/dist/{http-client-3MOFAPO6.js → http-client-U6DVFL7F.js} +2 -2
- package/dist/{manager-UP3XMLKX.js → manager-53J5P4EZ.js} +2 -2
- package/dist/openFolder-Z27FEM5M.js +8 -0
- package/dist/{orchestrator-VSUL2C7G.js → orchestrator-MTCF2EPU.js} +14 -14
- package/dist/package.json +1 -1
- package/dist/{path-security-E55IEQHD.js → path-security-6GYETPWN.js} +6 -6
- package/dist/{processor-WP34IB3C.js → processor-HX4FXDDT.js} +14 -14
- package/dist/{provider-E5IP7RF7.js → provider-LZ3XMDX6.js} +6 -6
- package/dist/{provider-manager-FVIFMUTO.js → provider-manager-PBOF77RQ.js} +4 -4
- package/dist/{registry-XBEHPY7C.js → registry-QEOTM3IG.js} +2 -2
- package/dist/{serve-NZZVFNMA.js → serve-VGATDJX5.js} +23 -22
- package/dist/server/index.js +22 -21
- package/dist/{server-DYJTLAZS.js → server-4BHDA6PA.js} +17 -17
- package/dist/{session-overrides-QWD4V5KW.js → session-overrides-BQSE3V3F.js} +4 -4
- package/dist/{sessions-BT4PION7.js → sessions-AUDWMF55.js} +3 -3
- package/dist/{tools-YXOCUUKE.js → tools-I3BAXRVD.js} +12 -12
- package/dist/{update-5HWU675H.js → update-2Z6TXHFH.js} +2 -2
- package/dist/web/assets/{index-BlV1FebL.css → index-BG5sD2ez.css} +1 -1
- package/dist/web/assets/{index-DxAR7yc9.js → index-CsC_DrIa.js} +80 -73
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/{workspace-IIRKILYL.js → workspace-2NDXTCVR.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-O4NHL6IN.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultAgentId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3LRYZ7R3.js";
|
|
4
4
|
|
|
5
5
|
// src/server/events/apply-events.ts
|
|
6
6
|
function markComplete(msg, reason) {
|
|
@@ -929,4 +929,4 @@ export {
|
|
|
929
929
|
buildSnapshot,
|
|
930
930
|
buildSnapshotFromSessionState
|
|
931
931
|
};
|
|
932
|
-
//# sourceMappingURL=chunk-
|
|
932
|
+
//# sourceMappingURL=chunk-O2PLNJIU.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
spawnShellProcess,
|
|
12
12
|
startProcessCommand,
|
|
13
13
|
stopProcess
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HAFRPV7I.js";
|
|
15
15
|
import {
|
|
16
16
|
getMaxPerSession,
|
|
17
17
|
getSessionProcessCount,
|
|
@@ -27,24 +27,24 @@ import {
|
|
|
27
27
|
getGitBranch,
|
|
28
28
|
isGitRepository,
|
|
29
29
|
listWorkspaces
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-D3SXT3BL.js";
|
|
31
31
|
import {
|
|
32
32
|
findSkillById,
|
|
33
33
|
getAllInstructions,
|
|
34
34
|
getEnabledSkillMetadata,
|
|
35
35
|
isSkillEnabled,
|
|
36
36
|
loadAllSkills
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-KQPDU65K.js";
|
|
38
38
|
import {
|
|
39
39
|
getSessionDisabledServers
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-XLI6PDJG.js";
|
|
41
41
|
import {
|
|
42
42
|
PathAccessDeniedError,
|
|
43
43
|
extractAbsolutePathsFromCommand,
|
|
44
44
|
extractSensitivePathsFromCommand,
|
|
45
45
|
registerPathConfirmation,
|
|
46
46
|
requestPathAccess
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-G5JFKTSR.js";
|
|
48
48
|
import {
|
|
49
49
|
createChatDoneMessage,
|
|
50
50
|
createChatMessageMessage,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
getCurrentContextWindowId,
|
|
76
76
|
getCurrentWindowMessageOptions,
|
|
77
77
|
getEventStore
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-KNYPBXPW.js";
|
|
79
79
|
import {
|
|
80
80
|
buildContextMessagesFromEventHistory,
|
|
81
81
|
foldContextState,
|
|
@@ -85,13 +85,13 @@ import {
|
|
|
85
85
|
handleToolResult,
|
|
86
86
|
reorderToolMessages,
|
|
87
87
|
stripOrphanedToolCalls
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-O2PLNJIU.js";
|
|
89
89
|
import {
|
|
90
90
|
findAgentById,
|
|
91
91
|
getRuntimeConfig,
|
|
92
92
|
getSubAgents,
|
|
93
93
|
loadAllAgentsDefault
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-3LRYZ7R3.js";
|
|
95
95
|
import {
|
|
96
96
|
modelSupportsVision
|
|
97
97
|
} from "./chunk-V4IE7HJY.js";
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
import {
|
|
117
117
|
loadGlobalConfig,
|
|
118
118
|
saveGlobalConfig
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-URQQOUCS.js";
|
|
120
120
|
import {
|
|
121
121
|
getGlobalConfigDir
|
|
122
122
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -1913,7 +1913,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
1913
1913
|
sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens, config.subAgentMetadata?.subAgentId);
|
|
1914
1914
|
if (!compacting) {
|
|
1915
1915
|
const contextState2 = sessionManager.getContextState(sessionId);
|
|
1916
|
-
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-
|
|
1916
|
+
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-U7EUKEUE.js");
|
|
1917
1917
|
if (shouldCompact(
|
|
1918
1918
|
contextState2.currentTokens,
|
|
1919
1919
|
contextState2.maxTokens,
|
|
@@ -2235,11 +2235,15 @@ async function describeImage(base64Data, visionModel, options) {
|
|
|
2235
2235
|
const timeoutController = new AbortController();
|
|
2236
2236
|
const timeoutId = setTimeout(() => timeoutController.abort(), timeout);
|
|
2237
2237
|
const signal = options?.signal ? AbortSignal.any([timeoutController.signal, options.signal]) : timeoutController.signal;
|
|
2238
|
+
const headers = {
|
|
2239
|
+
"Content-Type": "application/json"
|
|
2240
|
+
};
|
|
2241
|
+
if (isOpenAI && visionModel.apiKey) {
|
|
2242
|
+
headers["Authorization"] = `Bearer ${visionModel.apiKey}`;
|
|
2243
|
+
}
|
|
2238
2244
|
const response = await fetch(url, {
|
|
2239
2245
|
method: "POST",
|
|
2240
|
-
headers
|
|
2241
|
-
"Content-Type": "application/json"
|
|
2242
|
-
},
|
|
2246
|
+
headers,
|
|
2243
2247
|
body: JSON.stringify(requestBody),
|
|
2244
2248
|
signal
|
|
2245
2249
|
});
|
|
@@ -2276,19 +2280,11 @@ async function describeImageFromDataUrl(dataUrl, visionModel, options) {
|
|
|
2276
2280
|
// src/server/context/image-processor.ts
|
|
2277
2281
|
async function loadVisionModelFromGlobalConfig() {
|
|
2278
2282
|
try {
|
|
2279
|
-
const { loadGlobalConfig: loadGlobalConfig2,
|
|
2283
|
+
const { loadGlobalConfig: loadGlobalConfig2, resolveVisionFallback } = await import("./config-M7RDIFC5.js");
|
|
2280
2284
|
const runtimeConfig = getRuntimeConfig();
|
|
2281
2285
|
const mode = runtimeConfig.mode ?? "production";
|
|
2282
2286
|
const globalConfig = await loadGlobalConfig2(mode);
|
|
2283
|
-
|
|
2284
|
-
if (fallback?.enabled && fallback.model) {
|
|
2285
|
-
return {
|
|
2286
|
-
baseUrl: fallback.url,
|
|
2287
|
-
model: fallback.model,
|
|
2288
|
-
timeout: fallback.timeout * 1e3,
|
|
2289
|
-
backend: fallback.backend ?? "ollama"
|
|
2290
|
-
};
|
|
2291
|
-
}
|
|
2287
|
+
return resolveVisionFallback(globalConfig);
|
|
2292
2288
|
} catch {
|
|
2293
2289
|
}
|
|
2294
2290
|
return void 0;
|
|
@@ -2852,7 +2848,7 @@ var callSubAgentTool = {
|
|
|
2852
2848
|
};
|
|
2853
2849
|
}
|
|
2854
2850
|
try {
|
|
2855
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
2851
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-I3BAXRVD.js");
|
|
2856
2852
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
2857
2853
|
const turnMetrics = new TurnMetrics();
|
|
2858
2854
|
const result = await executeSubAgent({
|
|
@@ -3873,7 +3869,7 @@ var mcpConfigTool = createTool(
|
|
|
3873
3869
|
mcpNotifyChanged?.(sessionId);
|
|
3874
3870
|
}
|
|
3875
3871
|
async function rebuildTools() {
|
|
3876
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
3872
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-I3BAXRVD.js");
|
|
3877
3873
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
3878
3874
|
setMcpTools2(mcpTools);
|
|
3879
3875
|
}
|
|
@@ -4519,4 +4515,4 @@ export {
|
|
|
4519
4515
|
getToolRegistryForAgent,
|
|
4520
4516
|
createToolRegistry
|
|
4521
4517
|
};
|
|
4522
|
-
//# sourceMappingURL=chunk-
|
|
4518
|
+
//# sourceMappingURL=chunk-O5YWFX7H.js.map
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
LLMError,
|
|
19
19
|
OpenAIHttpClient
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TDHDLDGQ.js";
|
|
21
21
|
import {
|
|
22
22
|
logger
|
|
23
23
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -268,4 +268,4 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
268
268
|
export {
|
|
269
269
|
createLLMClient
|
|
270
270
|
};
|
|
271
|
-
//# sourceMappingURL=chunk-
|
|
271
|
+
//# sourceMappingURL=chunk-SJJVNSA6.js.map
|
|
@@ -58,28 +58,19 @@ function getProxyAgent() {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
_cachedProxyUrl = proxyUrl;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
uri: proxyUrl,
|
|
64
|
-
requestTls: { rejectUnauthorized: true }
|
|
65
|
-
});
|
|
66
|
-
logger.info("[proxy] Proxy agent created", { proxyUrl });
|
|
67
|
-
} catch (err) {
|
|
68
|
-
logger.error("[proxy] Failed to create proxy agent", { proxyUrl, error: err });
|
|
69
|
-
_cachedAgent = void 0;
|
|
70
|
-
_cachedProxyUrl = void 0;
|
|
71
|
-
return void 0;
|
|
72
|
-
}
|
|
61
|
+
_cachedAgent = new ProxyAgent({ uri: proxyUrl, requestTls: { rejectUnauthorized: false } });
|
|
62
|
+
logger.info("[proxy] Proxy agent created");
|
|
73
63
|
}
|
|
74
64
|
return _cachedAgent;
|
|
75
65
|
}
|
|
76
|
-
|
|
66
|
+
var _originalFetch = globalThis.fetch;
|
|
67
|
+
globalThis.fetch = function(input, init) {
|
|
77
68
|
const agent = getProxyAgent();
|
|
78
69
|
if (agent) {
|
|
79
|
-
return undiciFetch(
|
|
70
|
+
return undiciFetch(input, { ...init, dispatcher: agent });
|
|
80
71
|
}
|
|
81
|
-
return
|
|
82
|
-
}
|
|
72
|
+
return _originalFetch(input, init);
|
|
73
|
+
};
|
|
83
74
|
|
|
84
75
|
// src/server/llm/http-client.ts
|
|
85
76
|
var OpenAIHttpClient = class {
|
|
@@ -97,7 +88,7 @@ var OpenAIHttpClient = class {
|
|
|
97
88
|
};
|
|
98
89
|
const bodyStr = JSON.stringify(params);
|
|
99
90
|
logger.debug("HTTP request to LLM", { url, bodyKeys: Object.keys(params) });
|
|
100
|
-
const response = await
|
|
91
|
+
const response = await fetch(url, {
|
|
101
92
|
method: "POST",
|
|
102
93
|
headers,
|
|
103
94
|
body: bodyStr,
|
|
@@ -168,7 +159,6 @@ export {
|
|
|
168
159
|
SessionNotFoundError,
|
|
169
160
|
LLMError,
|
|
170
161
|
WorkspaceInUseError,
|
|
171
|
-
proxyFetch,
|
|
172
162
|
OpenAIHttpClient
|
|
173
163
|
};
|
|
174
|
-
//# sourceMappingURL=chunk-
|
|
164
|
+
//# sourceMappingURL=chunk-TDHDLDGQ.js.map
|
|
@@ -89,7 +89,8 @@ var visionFallbackSchema = z.object({
|
|
|
89
89
|
url: z.string().default("http://localhost:11434"),
|
|
90
90
|
model: z.string().default("qwen3.5:0.8b"),
|
|
91
91
|
timeout: z.number().default(120),
|
|
92
|
-
backend: z.enum(["ollama", "openai"]).default("ollama")
|
|
92
|
+
backend: z.enum(["ollama", "openai"]).default("ollama"),
|
|
93
|
+
providerModelRef: z.string().optional()
|
|
93
94
|
});
|
|
94
95
|
var cachedToolSchema = z.object({
|
|
95
96
|
name: z.string(),
|
|
@@ -163,7 +164,48 @@ async function loadGlobalConfig(mode, configPathOverride) {
|
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
166
|
function getDefaultVisionFallback() {
|
|
166
|
-
return {
|
|
167
|
+
return {
|
|
168
|
+
enabled: false,
|
|
169
|
+
url: "http://localhost:11434",
|
|
170
|
+
model: "qwen3.5:0.8b",
|
|
171
|
+
timeout: 120,
|
|
172
|
+
backend: "ollama"
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function resolveVisionFallback(config) {
|
|
176
|
+
const fallback = config.visionFallback;
|
|
177
|
+
if (!fallback?.enabled) return void 0;
|
|
178
|
+
if (fallback.providerModelRef) {
|
|
179
|
+
const slashIndex = fallback.providerModelRef.indexOf("/");
|
|
180
|
+
if (slashIndex !== -1) {
|
|
181
|
+
const providerId = fallback.providerModelRef.substring(0, slashIndex);
|
|
182
|
+
const modelId = fallback.providerModelRef.substring(slashIndex + 1);
|
|
183
|
+
const provider = config.providers?.find((p) => p.id === providerId);
|
|
184
|
+
if (provider) {
|
|
185
|
+
const exactModel = provider.models?.find((m) => m.id === modelId);
|
|
186
|
+
const model = exactModel?.supportsVision ? exactModel : provider.models?.find((m) => m.supportsVision);
|
|
187
|
+
if (model?.supportsVision) {
|
|
188
|
+
const backend = provider.backend === "ollama" ? "ollama" : "openai";
|
|
189
|
+
return {
|
|
190
|
+
baseUrl: provider.url || fallback.url || "http://localhost:11434",
|
|
191
|
+
model: model.id,
|
|
192
|
+
timeout: (fallback.timeout ?? 120) * 1e3,
|
|
193
|
+
backend,
|
|
194
|
+
...provider.apiKey ? { apiKey: provider.apiKey } : {}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (fallback.url && fallback.model) {
|
|
201
|
+
return {
|
|
202
|
+
baseUrl: fallback.url,
|
|
203
|
+
model: fallback.model,
|
|
204
|
+
timeout: (fallback.timeout ?? 120) * 1e3,
|
|
205
|
+
backend: fallback.backend ?? "ollama"
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
return void 0;
|
|
167
209
|
}
|
|
168
210
|
async function saveGlobalConfig(mode, config, configPathOverride) {
|
|
169
211
|
const configPath = configPathOverride ?? getGlobalConfigPath(mode);
|
|
@@ -314,6 +356,7 @@ export {
|
|
|
314
356
|
getVisionFallback,
|
|
315
357
|
loadGlobalConfig,
|
|
316
358
|
getDefaultVisionFallback,
|
|
359
|
+
resolveVisionFallback,
|
|
317
360
|
saveGlobalConfig,
|
|
318
361
|
getActiveProvider,
|
|
319
362
|
getDefaultModel,
|
|
@@ -323,4 +366,4 @@ export {
|
|
|
323
366
|
removeProvider,
|
|
324
367
|
activateProvider
|
|
325
368
|
};
|
|
326
|
-
//# sourceMappingURL=chunk-
|
|
369
|
+
//# sourceMappingURL=chunk-URQQOUCS.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runAgentTurn,
|
|
3
|
-
runChatTurn
|
|
4
|
-
} from "./chunk-MUNVSHL5.js";
|
|
5
1
|
import {
|
|
6
2
|
generateSessionNameForSession,
|
|
7
3
|
getSessionMessageCount,
|
|
8
4
|
needsNameGeneration
|
|
9
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BG4EVBLJ.js";
|
|
6
|
+
import {
|
|
7
|
+
runAgentTurn,
|
|
8
|
+
runChatTurn
|
|
9
|
+
} from "./chunk-C3XL7X4E.js";
|
|
10
10
|
import {
|
|
11
11
|
devServerManager,
|
|
12
12
|
executeSubAgent,
|
|
13
13
|
getToolRegistryForAgent
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-O5YWFX7H.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-LZW5LSVH.js";
|
|
32
32
|
import {
|
|
33
33
|
createChatErrorMessage,
|
|
34
34
|
createChatMessageMessage,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
} from "./chunk-EU3WWTFH.js";
|
|
51
51
|
import {
|
|
52
52
|
appendCompactionPrompt
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-3W6STALV.js";
|
|
54
54
|
import {
|
|
55
55
|
TurnMetrics,
|
|
56
56
|
createMessageStartEvent
|
|
@@ -59,14 +59,14 @@ import {
|
|
|
59
59
|
combineEventsWithSnapshot,
|
|
60
60
|
getCurrentContextWindowId,
|
|
61
61
|
getEventStore
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-KNYPBXPW.js";
|
|
63
63
|
import {
|
|
64
64
|
getPlatformShell
|
|
65
65
|
} from "./chunk-NLN5LPQ4.js";
|
|
66
66
|
import {
|
|
67
67
|
buildMessagesFromStoredEvents,
|
|
68
68
|
foldPendingConfirmations
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-O2PLNJIU.js";
|
|
70
70
|
import {
|
|
71
71
|
deleteItemFromDir,
|
|
72
72
|
findAgentById,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
loadAllAgentsDefault,
|
|
76
76
|
resolveDefaultAgentId,
|
|
77
77
|
saveItemToDir
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-3LRYZ7R3.js";
|
|
79
79
|
import {
|
|
80
80
|
getMaxVisibleItems
|
|
81
81
|
} from "./chunk-UEOEA6BB.js";
|
|
@@ -767,17 +767,6 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
767
767
|
totalTime: (performance.now() - startTime) / 1e3
|
|
768
768
|
};
|
|
769
769
|
}
|
|
770
|
-
if (targetStep.type !== "user") {
|
|
771
|
-
return {
|
|
772
|
-
finalAction: {
|
|
773
|
-
type: "BLOCKED",
|
|
774
|
-
reason: `Cannot resume from step "${resumeFromStep}" (type: ${targetStep.type}): only user steps support resume`,
|
|
775
|
-
blockedCriteria: []
|
|
776
|
-
},
|
|
777
|
-
iterations: 0,
|
|
778
|
-
totalTime: (performance.now() - startTime) / 1e3
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
770
|
}
|
|
782
771
|
logger.debug("Workflow executor starting", { sessionId, workflow: workflow.metadata.id });
|
|
783
772
|
if (workflow.startCondition && workflow.startCondition.type !== "always") {
|
|
@@ -827,31 +816,22 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
827
816
|
workflow.metadata.color,
|
|
828
817
|
options.params ?? {}
|
|
829
818
|
);
|
|
830
|
-
if (options.userMessage) {
|
|
831
|
-
sessionManager.addMessage(sessionId, {
|
|
832
|
-
role: "user",
|
|
833
|
-
content: options.userMessage.content,
|
|
834
|
-
...options.userMessage.attachments ? { attachments: options.userMessage.attachments } : {}
|
|
835
|
-
});
|
|
836
|
-
}
|
|
837
819
|
} else {
|
|
838
820
|
const activeExec = sessionManager.getActiveWorkflowExecution(sessionId);
|
|
839
821
|
if (activeExec) {
|
|
840
822
|
executionId = activeExec.id;
|
|
841
823
|
}
|
|
842
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
|
+
}
|
|
843
832
|
while (iterations < workflow.settings.maxIterations) {
|
|
844
833
|
if (signal?.aborted) {
|
|
845
|
-
logger.debug("Workflow executor aborted", { sessionId, iterations });
|
|
846
|
-
if (executionId) {
|
|
847
|
-
sessionManager.cancelWorkflow(
|
|
848
|
-
sessionId,
|
|
849
|
-
executionId,
|
|
850
|
-
workflow.metadata.id,
|
|
851
|
-
workflow.metadata.name,
|
|
852
|
-
workflow.metadata.color
|
|
853
|
-
);
|
|
854
|
-
}
|
|
834
|
+
logger.debug("Workflow executor aborted \u2014 preserving execution", { sessionId, iterations });
|
|
855
835
|
return {
|
|
856
836
|
finalAction: { type: "RUN_BUILDER", reason: "Aborted" },
|
|
857
837
|
iterations,
|
|
@@ -908,7 +888,8 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
908
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()";
|
|
909
889
|
let promptContent;
|
|
910
890
|
let nudgeContent;
|
|
911
|
-
|
|
891
|
+
const isResumingCurrentStep = isResume && step.id === resumeFromStep;
|
|
892
|
+
if (!firstEntryForStep.has(step.id) && agentStep.prompt && !isResumingCurrentStep) {
|
|
912
893
|
const resolvedPrompt = resolveTemplate(agentStep.prompt, templateCtx);
|
|
913
894
|
promptContent = resolvedPrompt + STEP_DONE_PROMPT;
|
|
914
895
|
const promptMsgId = crypto.randomUUID();
|
|
@@ -936,7 +917,7 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
936
917
|
})
|
|
937
918
|
);
|
|
938
919
|
}
|
|
939
|
-
} else if (firstEntryForStep.has(step.id)) {
|
|
920
|
+
} else if (firstEntryForStep.has(step.id) && !isResumingCurrentStep) {
|
|
940
921
|
const parts = [];
|
|
941
922
|
if (agentStep.nudgePrompt) {
|
|
942
923
|
const resolvedNudge = resolveTemplate(agentStep.nudgePrompt, templateCtx);
|
|
@@ -963,7 +944,7 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
963
944
|
agentStep.agentId ?? resolveDefaultAgentId(),
|
|
964
945
|
append,
|
|
965
946
|
{
|
|
966
|
-
...!firstEntryForStep.has(step.id) && !agentStep.prompt ? { injectKickoff: () => injectGenericKickoff(sessionId) } : {},
|
|
947
|
+
...!firstEntryForStep.has(step.id) && !agentStep.prompt && !isResumingCurrentStep ? { injectKickoff: () => injectGenericKickoff(sessionId) } : {},
|
|
967
948
|
onToolExecuted: (toolCall, toolResult) => {
|
|
968
949
|
if (toolCall.name === "step_done" && toolResult.success) {
|
|
969
950
|
stepDoneCalled = true;
|
|
@@ -2180,8 +2161,8 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
|
|
|
2180
2161
|
const sessionId = client.activeSessionId;
|
|
2181
2162
|
const session = sessionManager.requireSession(sessionId);
|
|
2182
2163
|
try {
|
|
2183
|
-
const { buildCachedPrompt } = await import("./dynamic-context-
|
|
2184
|
-
const allAgents = await import("./registry-
|
|
2164
|
+
const { buildCachedPrompt } = await import("./dynamic-context-TDB4G5CH.js");
|
|
2165
|
+
const allAgents = await import("./registry-QEOTM3IG.js");
|
|
2185
2166
|
const agentDef = allAgents.findAgentById(session.mode, await allAgents.loadAllAgentsDefault()) ?? allAgents.findAgentById("planner", await allAgents.loadAllAgentsDefault());
|
|
2186
2167
|
const { systemPrompt: newPrompt, hash: newHash } = await buildCachedPrompt(sessionManager, sessionId, agentDef);
|
|
2187
2168
|
const oldCached = sessionManager.getCachedPrompt(sessionId);
|
|
@@ -2337,7 +2318,8 @@ ${content}` : workflowInfo;
|
|
|
2337
2318
|
// On resume, prefer params/stepOutput from the persisted workflow execution
|
|
2338
2319
|
...isResume ? (() => {
|
|
2339
2320
|
const exec = sessionManager.getActiveWorkflowExecution(sessionId);
|
|
2340
|
-
if (exec
|
|
2321
|
+
if (!exec) return {};
|
|
2322
|
+
if (exec.status === "waiting") {
|
|
2341
2323
|
const resumed = sessionManager.resumeWorkflow(
|
|
2342
2324
|
sessionId,
|
|
2343
2325
|
exec.id,
|
|
@@ -2353,7 +2335,11 @@ ${content}` : workflowInfo;
|
|
|
2353
2335
|
};
|
|
2354
2336
|
}
|
|
2355
2337
|
}
|
|
2356
|
-
return {
|
|
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
|
+
};
|
|
2357
2343
|
})() : {},
|
|
2358
2344
|
...hasUserMessage ? {
|
|
2359
2345
|
userMessage: {
|
|
@@ -2491,4 +2477,4 @@ export {
|
|
|
2491
2477
|
signalMcpReady,
|
|
2492
2478
|
createWebSocketServer
|
|
2493
2479
|
};
|
|
2494
|
-
//# sourceMappingURL=chunk-
|
|
2480
|
+
//# sourceMappingURL=chunk-WS7EY4CU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateSessionMcpDisabledServers
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZIMGU5ZH.js";
|
|
4
4
|
import {
|
|
5
5
|
getDatabase
|
|
6
6
|
} from "./chunk-GLF65XDS.js";
|
|
@@ -62,4 +62,4 @@ export {
|
|
|
62
62
|
clearSessionOverrides,
|
|
63
63
|
getAllSessionOverrides
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-XLI6PDJG.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLLMClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SJJVNSA6.js";
|
|
4
4
|
import {
|
|
5
5
|
getModelProfile
|
|
6
6
|
} from "./chunk-V4IE7HJY.js";
|
|
@@ -15,9 +15,6 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
resolveAttachmentsInMessages
|
|
17
17
|
} from "./chunk-RMXPVQP4.js";
|
|
18
|
-
import {
|
|
19
|
-
proxyFetch
|
|
20
|
-
} from "./chunk-XNB3JWAR.js";
|
|
21
18
|
import {
|
|
22
19
|
logger
|
|
23
20
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -184,7 +181,7 @@ async function fetchModelsFromBackend(url, apiKey) {
|
|
|
184
181
|
headers["Authorization"] = `Bearer ${apiKey}`;
|
|
185
182
|
}
|
|
186
183
|
try {
|
|
187
|
-
const response = await
|
|
184
|
+
const response = await fetch(url, { method: "GET", headers, signal: AbortSignal.timeout(1e4) });
|
|
188
185
|
if (!response.ok) {
|
|
189
186
|
logger.debug("Failed to fetch models", { url, status: response.status });
|
|
190
187
|
return [];
|
|
@@ -263,7 +260,7 @@ async function fetchModelsWithContext(baseUrl, apiKey, backend) {
|
|
|
263
260
|
async function fetchOllamaModelsWithContext(baseUrl, _apiKey) {
|
|
264
261
|
const tagsUrl = `${baseUrl}/api/tags`;
|
|
265
262
|
try {
|
|
266
|
-
const tagsResponse = await
|
|
263
|
+
const tagsResponse = await fetch(tagsUrl, {
|
|
267
264
|
signal: AbortSignal.timeout(1e4)
|
|
268
265
|
});
|
|
269
266
|
if (!tagsResponse.ok) {
|
|
@@ -278,7 +275,7 @@ async function fetchOllamaModelsWithContext(baseUrl, _apiKey) {
|
|
|
278
275
|
for (const model of tagsData.models) {
|
|
279
276
|
try {
|
|
280
277
|
const showUrl = `${baseUrl}/api/show`;
|
|
281
|
-
const showResponse = await
|
|
278
|
+
const showResponse = await fetch(showUrl, {
|
|
282
279
|
method: "POST",
|
|
283
280
|
headers: { "Content-Type": "application/json" },
|
|
284
281
|
body: JSON.stringify({ name: model.name, verbose: true }),
|
|
@@ -325,7 +322,7 @@ async function fetchLmStudioModelsWithContext(baseUrl, _apiKey) {
|
|
|
325
322
|
const nativeUrl = `${base.replace(/\/v\d+\/?$/, "")}/api/v1/models`;
|
|
326
323
|
try {
|
|
327
324
|
logger.info("Fetching LM Studio native models", { url: nativeUrl });
|
|
328
|
-
const response = await
|
|
325
|
+
const response = await fetch(nativeUrl, {
|
|
329
326
|
signal: AbortSignal.timeout(1e4)
|
|
330
327
|
});
|
|
331
328
|
if (!response.ok) {
|
|
@@ -810,4 +807,4 @@ export {
|
|
|
810
807
|
parseDefaultModelSelection,
|
|
811
808
|
createProviderManager
|
|
812
809
|
};
|
|
813
|
-
//# sourceMappingURL=chunk-
|
|
810
|
+
//# sourceMappingURL=chunk-YPBV47DH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultAgentId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3LRYZ7R3.js";
|
|
4
4
|
import {
|
|
5
5
|
getDatabase
|
|
6
6
|
} from "./chunk-GLF65XDS.js";
|
|
@@ -367,4 +367,4 @@ export {
|
|
|
367
367
|
getActiveWorkflowExecution,
|
|
368
368
|
clearWorkflowExecution
|
|
369
369
|
};
|
|
370
|
-
//# sourceMappingURL=chunk-
|
|
370
|
+
//# sourceMappingURL=chunk-ZIMGU5ZH.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLLMClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SJJVNSA6.js";
|
|
4
4
|
import "./chunk-V4IE7HJY.js";
|
|
5
5
|
import "./chunk-YHEQTVFV.js";
|
|
6
6
|
import "./chunk-HNCM3D7Y.js";
|
|
7
7
|
import "./chunk-RMXPVQP4.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-TDHDLDGQ.js";
|
|
9
9
|
import "./chunk-UEOEA6BB.js";
|
|
10
10
|
import "./chunk-GLF65XDS.js";
|
|
11
11
|
import "./chunk-K44MW7JJ.js";
|
|
@@ -13,4 +13,4 @@ import "./chunk-5WRI5ZAA.js";
|
|
|
13
13
|
export {
|
|
14
14
|
createLLMClient
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=client-
|
|
16
|
+
//# sourceMappingURL=client-RENSCJPZ.js.map
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
COMPACTION_MAX_RATIO,
|
|
4
4
|
appendCompactionPrompt,
|
|
5
5
|
shouldCompact
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3W6STALV.js";
|
|
7
7
|
import "./chunk-K2O7JTCX.js";
|
|
8
8
|
import "./chunk-MRWR3SIT.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-KNYPBXPW.js";
|
|
10
10
|
import "./chunk-NLN5LPQ4.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-O2PLNJIU.js";
|
|
12
|
+
import "./chunk-ZIMGU5ZH.js";
|
|
13
|
+
import "./chunk-3LRYZ7R3.js";
|
|
14
14
|
import "./chunk-J2GP3J3X.js";
|
|
15
15
|
import "./chunk-V4IE7HJY.js";
|
|
16
16
|
import "./chunk-YHEQTVFV.js";
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
appendCompactionPrompt,
|
|
27
27
|
shouldCompact
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=compactor-
|
|
29
|
+
//# sourceMappingURL=compactor-U7EUKEUE.js.map
|
|
@@ -8,10 +8,11 @@ import {
|
|
|
8
8
|
getVisionFallback,
|
|
9
9
|
loadGlobalConfig,
|
|
10
10
|
removeProvider,
|
|
11
|
+
resolveVisionFallback,
|
|
11
12
|
saveGlobalConfig,
|
|
12
13
|
setDefaultModelSelection,
|
|
13
14
|
updateProvider
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-URQQOUCS.js";
|
|
15
16
|
import "./chunk-CQGTEGKL.js";
|
|
16
17
|
import "./chunk-5WRI5ZAA.js";
|
|
17
18
|
export {
|
|
@@ -24,8 +25,9 @@ export {
|
|
|
24
25
|
getVisionFallback,
|
|
25
26
|
loadGlobalConfig,
|
|
26
27
|
removeProvider,
|
|
28
|
+
resolveVisionFallback,
|
|
27
29
|
saveGlobalConfig,
|
|
28
30
|
setDefaultModelSelection,
|
|
29
31
|
updateProvider
|
|
30
32
|
};
|
|
31
|
-
//# sourceMappingURL=config-
|
|
33
|
+
//# sourceMappingURL=config-M7RDIFC5.js.map
|