openfox 2.0.36 → 2.0.38
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/dist/{chat-handler-GZOH45BG.js → chat-handler-TPKAEATB.js} +9 -9
- package/dist/{chunk-OSMUHB5F.js → chunk-55RWNJBT.js} +6 -2
- package/dist/{chunk-GIR5N4A3.js → chunk-7W2WATAO.js} +6 -6
- package/dist/{chunk-Z3RKDS6H.js → chunk-ATBNY4CL.js} +169 -47
- package/dist/{chunk-6PLAWCHQ.js → chunk-EHYFYQXY.js} +4 -2
- package/dist/{chunk-PWY6EBZ6.js → chunk-EZ3BPIUV.js} +9 -2
- package/dist/{chunk-U4ZRBCSO.js → chunk-FFQCZ2MI.js} +5 -5
- package/dist/{chunk-ZXELI3WY.js → chunk-GZZW4XSI.js} +7 -7
- package/dist/{chunk-QCVPT2LZ.js → chunk-HJ7KRYWX.js} +81 -31
- package/dist/{chunk-BGCDJYNU.js → chunk-JGNAYJJZ.js} +6 -5
- package/dist/{chunk-WTDCC4IP.js → chunk-NF6WHQAT.js} +9 -2
- package/dist/{chunk-DHOOJDHX.js → chunk-SM2PK6TV.js} +4 -4
- package/dist/{chunk-ZMONCXGW.js → chunk-WXAOEWJS.js} +3 -3
- package/dist/{chunk-ZJ4FP6RS.js → chunk-Z6W4YHJB.js} +7 -1
- package/dist/{chunk-QYP6MOB5.js → chunk-ZBLT7MNL.js} +2 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-X6BVH4Q4.js → client-XTPAYYRH.js} +3 -3
- package/dist/{client-pure-5NOTSIRK.js → client-pure-N2MOIDQ6.js} +2 -2
- package/dist/{compactor-SHEOFZDB.js → compactor-RZA5VSRT.js} +6 -6
- package/dist/{config-QI3KOU42.js → config-XOXIIBUY.js} +2 -2
- package/dist/{events-YLICLPBY.js → events-KZZPCW2Q.js} +3 -3
- package/dist/{folding-PI67HWBR.js → folding-ENYH4LMG.js} +2 -2
- package/dist/{orchestrator-3WHRUJSV.js → orchestrator-ZFBVVQBO.js} +8 -8
- package/dist/package.json +1 -1
- package/dist/{processor-3C6MIX7N.js → processor-NG4NH2SS.js} +9 -9
- package/dist/{protocol-BC1QSQ-Y.d.ts → protocol-COpRaEpx.d.ts} +1 -0
- package/dist/{provider-SHGBQRFO.js → provider-JLLIB72V.js} +6 -6
- package/dist/{provider-manager-5742XBEI.js → provider-manager-GTWFGTCV.js} +4 -4
- package/dist/{serve-3SIVWL3C.js → serve-VIWHYE6X.js} +13 -13
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +12 -12
- package/dist/{server-A5IUSVLK.js → server-MEJPUI4S.js} +11 -11
- package/dist/shared/index.d.ts +2 -2
- package/dist/{tools-FJ63BHW2.js → tools-ATO5MSWX.js} +7 -7
- package/dist/web/assets/{index-DIvNnXne.css → index-GFd2V-Ja.css} +1 -1
- package/dist/web/assets/{index-tTqXCWKx.js → index-I3ZLVKAn.js} +57 -56
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
loadAllAgentsDefault,
|
|
13
13
|
processEventsForConversation,
|
|
14
14
|
runTopLevelAgentLoop
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HJ7KRYWX.js";
|
|
16
16
|
import {
|
|
17
17
|
TurnMetrics,
|
|
18
18
|
WORKFLOW_KICKOFF_PROMPT,
|
|
@@ -20,16 +20,16 @@ import {
|
|
|
20
20
|
buildAgentSmallReminder,
|
|
21
21
|
createChatDoneEvent,
|
|
22
22
|
createMessageStartEvent
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-55RWNJBT.js";
|
|
24
24
|
import {
|
|
25
25
|
getCurrentContextWindowId,
|
|
26
26
|
getCurrentWindowMessageOptions,
|
|
27
27
|
getEventStore,
|
|
28
28
|
getRuntimeConfig
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-NF6WHQAT.js";
|
|
30
30
|
import {
|
|
31
31
|
buildSnapshotFromSessionState
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-EHYFYQXY.js";
|
|
33
33
|
import {
|
|
34
34
|
logger
|
|
35
35
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -310,4 +310,4 @@ export {
|
|
|
310
310
|
runAgentTurn,
|
|
311
311
|
injectWorkflowKickoffIfNeeded
|
|
312
312
|
};
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
313
|
+
//# sourceMappingURL=chunk-FFQCZ2MI.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
injectWorkflowKickoffIfNeeded,
|
|
3
3
|
runAgentTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FFQCZ2MI.js";
|
|
6
6
|
import {
|
|
7
7
|
applyDynamicContext,
|
|
8
8
|
checkAborted,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
loadAllAgentsDefault,
|
|
17
17
|
saveItemToDir,
|
|
18
18
|
spawnShellProcess
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-HJ7KRYWX.js";
|
|
20
20
|
import {
|
|
21
21
|
getPlatformShell,
|
|
22
22
|
onProcessEvent
|
|
@@ -40,19 +40,19 @@ import {
|
|
|
40
40
|
} from "./chunk-EU3WWTFH.js";
|
|
41
41
|
import {
|
|
42
42
|
appendCompactionPrompt
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-WXAOEWJS.js";
|
|
44
44
|
import {
|
|
45
45
|
TurnMetrics,
|
|
46
46
|
createMessageStartEvent
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-55RWNJBT.js";
|
|
48
48
|
import {
|
|
49
49
|
getCurrentContextWindowId,
|
|
50
50
|
getEventStore,
|
|
51
51
|
getRuntimeConfig
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-NF6WHQAT.js";
|
|
53
53
|
import {
|
|
54
54
|
createLLMClient
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-ZBLT7MNL.js";
|
|
56
56
|
import {
|
|
57
57
|
ensureVersionPrefix
|
|
58
58
|
} from "./chunk-HNCM3D7Y.js";
|
|
@@ -2056,4 +2056,4 @@ export {
|
|
|
2056
2056
|
signalMcpReady,
|
|
2057
2057
|
createWebSocketServer
|
|
2058
2058
|
};
|
|
2059
|
-
//# sourceMappingURL=chunk-
|
|
2059
|
+
//# sourceMappingURL=chunk-GZZW4XSI.js.map
|
|
@@ -49,13 +49,13 @@ import {
|
|
|
49
49
|
createToolCallEvent,
|
|
50
50
|
createToolResultEvent,
|
|
51
51
|
streamLLMPure
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-55RWNJBT.js";
|
|
53
53
|
import {
|
|
54
54
|
getCurrentContextWindowId,
|
|
55
55
|
getCurrentWindowMessageOptions,
|
|
56
56
|
getEventStore,
|
|
57
57
|
getRuntimeConfig
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-NF6WHQAT.js";
|
|
59
59
|
import {
|
|
60
60
|
buildContextMessagesFromEventHistory,
|
|
61
61
|
foldContextState,
|
|
@@ -64,14 +64,14 @@ import {
|
|
|
64
64
|
handleToolCall,
|
|
65
65
|
handleToolResult,
|
|
66
66
|
stripOrphanedToolCalls
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-EHYFYQXY.js";
|
|
68
68
|
import {
|
|
69
69
|
logger
|
|
70
70
|
} from "./chunk-K44MW7JJ.js";
|
|
71
71
|
import {
|
|
72
72
|
loadGlobalConfig,
|
|
73
73
|
saveGlobalConfig
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-EZ3BPIUV.js";
|
|
75
75
|
import {
|
|
76
76
|
getGlobalConfigDir
|
|
77
77
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -2581,7 +2581,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
2581
2581
|
sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens);
|
|
2582
2582
|
if (!compacting) {
|
|
2583
2583
|
const contextState2 = sessionManager.getContextState(sessionId);
|
|
2584
|
-
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-
|
|
2584
|
+
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-RZA5VSRT.js");
|
|
2585
2585
|
if (shouldCompact(contextState2.currentTokens, contextState2.maxTokens, runtimeConfig.context.compactionThreshold)) {
|
|
2586
2586
|
appendCompactionPrompt(sessionId, append);
|
|
2587
2587
|
compacting = true;
|
|
@@ -2938,7 +2938,7 @@ async function describeImageFromDataUrl(dataUrl, visionModel, options) {
|
|
|
2938
2938
|
import { createHash as createHash2 } from "crypto";
|
|
2939
2939
|
async function loadVisionModelFromGlobalConfig() {
|
|
2940
2940
|
try {
|
|
2941
|
-
const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-
|
|
2941
|
+
const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-XOXIIBUY.js");
|
|
2942
2942
|
const runtimeConfig = getRuntimeConfig();
|
|
2943
2943
|
const mode = runtimeConfig.mode ?? "production";
|
|
2944
2944
|
const globalConfig = await loadGlobalConfig2(mode);
|
|
@@ -2969,12 +2969,6 @@ function hasImageMetadata(result) {
|
|
|
2969
2969
|
const mimeType = meta["mimeType"];
|
|
2970
2970
|
return typeof dataUrl === "string" && typeof mimeType === "string" && mimeType.startsWith("image/");
|
|
2971
2971
|
}
|
|
2972
|
-
function buildImageDescription(filename, description) {
|
|
2973
|
-
return `[Image: ${filename || "image"} - description: ${description}]`;
|
|
2974
|
-
}
|
|
2975
|
-
function buildImagePlaceholder(filename) {
|
|
2976
|
-
return `[Image: ${filename || "image"}]`;
|
|
2977
|
-
}
|
|
2978
2972
|
async function describeAttachment(att, messageId, options, descriptions) {
|
|
2979
2973
|
const cacheKey = contentHash(att.data);
|
|
2980
2974
|
if (descriptionCache.has(cacheKey)) {
|
|
@@ -3000,7 +2994,7 @@ async function describeAttachment(att, messageId, options, descriptions) {
|
|
|
3000
2994
|
options.onEvent?.({ type: "vision_fallback.done", data: { messageId, attachmentId: att.id, description } });
|
|
3001
2995
|
return description;
|
|
3002
2996
|
}
|
|
3003
|
-
const placeholder =
|
|
2997
|
+
const placeholder = `[Image: ${att.filename || "image"}]`;
|
|
3004
2998
|
descriptions.set(att.id, placeholder);
|
|
3005
2999
|
return placeholder;
|
|
3006
3000
|
}
|
|
@@ -3032,7 +3026,7 @@ async function describeToolResultImage(dataUrl, filename, toolCallId, messageId,
|
|
|
3032
3026
|
});
|
|
3033
3027
|
return description;
|
|
3034
3028
|
}
|
|
3035
|
-
const placeholder =
|
|
3029
|
+
const placeholder = `[Image: ${filename || "image"}]`;
|
|
3036
3030
|
descriptions.set(toolCallId, placeholder);
|
|
3037
3031
|
return placeholder;
|
|
3038
3032
|
}
|
|
@@ -3048,20 +3042,28 @@ async function processContextImages(events, options) {
|
|
|
3048
3042
|
if (!data.attachments || data.attachments.length === 0) continue;
|
|
3049
3043
|
const imageAtts = data.attachments.filter(isImageAttachment);
|
|
3050
3044
|
if (imageAtts.length === 0) continue;
|
|
3051
|
-
let
|
|
3045
|
+
let enriched = false;
|
|
3052
3046
|
for (const att of imageAtts) {
|
|
3047
|
+
if (att.description) {
|
|
3048
|
+
descriptions.set(att.id, att.description);
|
|
3049
|
+
continue;
|
|
3050
|
+
}
|
|
3053
3051
|
const description = await describeAttachment(att, data.messageId, options, descriptions);
|
|
3054
|
-
|
|
3055
|
-
|
|
3052
|
+
att.description = description;
|
|
3053
|
+
enriched = true;
|
|
3054
|
+
}
|
|
3055
|
+
if (enriched && options.persistEvent) {
|
|
3056
|
+
options.persistEvent(event.sessionId, event.seq, data);
|
|
3056
3057
|
}
|
|
3057
|
-
;
|
|
3058
|
-
data.content = content;
|
|
3059
|
-
delete data.attachments;
|
|
3060
3058
|
}
|
|
3061
3059
|
if (event.type === "tool.result") {
|
|
3062
3060
|
const data = event.data;
|
|
3063
3061
|
if (!data.result.metadata || !hasImageMetadata(data.result)) continue;
|
|
3064
3062
|
const meta = data.result.metadata;
|
|
3063
|
+
if (meta["description"]) {
|
|
3064
|
+
descriptions.set(data.toolCallId, meta["description"]);
|
|
3065
|
+
continue;
|
|
3066
|
+
}
|
|
3065
3067
|
const dataUrl = meta["dataUrl"];
|
|
3066
3068
|
const path = meta["path"];
|
|
3067
3069
|
const description = await describeToolResultImage(
|
|
@@ -3072,8 +3074,54 @@ ${buildImageDescription(att.filename, description)}`;
|
|
|
3072
3074
|
options,
|
|
3073
3075
|
descriptions
|
|
3074
3076
|
);
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
+
meta["description"] = description;
|
|
3078
|
+
if (options.persistEvent) {
|
|
3079
|
+
options.persistEvent(event.sessionId, event.seq, data);
|
|
3080
|
+
}
|
|
3081
|
+
}
|
|
3082
|
+
if (event.type === "turn.snapshot") {
|
|
3083
|
+
const snapshot = event.data;
|
|
3084
|
+
let enriched = false;
|
|
3085
|
+
for (const message of snapshot.messages) {
|
|
3086
|
+
if (message.role === "user" && message.attachments && message.attachments.length > 0) {
|
|
3087
|
+
const imageAtts = message.attachments.filter(isImageAttachment);
|
|
3088
|
+
if (imageAtts.length === 0) continue;
|
|
3089
|
+
for (const att of imageAtts) {
|
|
3090
|
+
if (att.description) {
|
|
3091
|
+
descriptions.set(att.id, att.description);
|
|
3092
|
+
continue;
|
|
3093
|
+
}
|
|
3094
|
+
const description = await describeAttachment(att, message.id, options, descriptions);
|
|
3095
|
+
att.description = description;
|
|
3096
|
+
enriched = true;
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3099
|
+
if (message.role === "assistant" && message.toolCalls) {
|
|
3100
|
+
for (const toolCall of message.toolCalls) {
|
|
3101
|
+
if (!toolCall.result || !toolCall.result.metadata || !hasImageMetadata(toolCall.result)) continue;
|
|
3102
|
+
const meta = toolCall.result.metadata;
|
|
3103
|
+
if (meta["description"]) {
|
|
3104
|
+
descriptions.set(toolCall.id, meta["description"]);
|
|
3105
|
+
continue;
|
|
3106
|
+
}
|
|
3107
|
+
const dataUrl = meta["dataUrl"];
|
|
3108
|
+
const path = meta["path"];
|
|
3109
|
+
const description = await describeToolResultImage(
|
|
3110
|
+
dataUrl,
|
|
3111
|
+
path,
|
|
3112
|
+
toolCall.id,
|
|
3113
|
+
message.id,
|
|
3114
|
+
options,
|
|
3115
|
+
descriptions
|
|
3116
|
+
);
|
|
3117
|
+
meta["description"] = description;
|
|
3118
|
+
enriched = true;
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
if (enriched && options.persistEvent) {
|
|
3123
|
+
options.persistEvent(event.sessionId, event.seq, snapshot);
|
|
3124
|
+
}
|
|
3077
3125
|
}
|
|
3078
3126
|
}
|
|
3079
3127
|
return { events: modifiedEvents, descriptions };
|
|
@@ -3195,7 +3243,8 @@ async function processEventsForConversation(sessionId, llmClient, onEvent) {
|
|
|
3195
3243
|
const { events: processedEvents } = await processContextImages(rawEvents, {
|
|
3196
3244
|
modelSupportsVision: modelVision,
|
|
3197
3245
|
...visionModel ? { visionModel } : {},
|
|
3198
|
-
onEvent
|
|
3246
|
+
onEvent,
|
|
3247
|
+
persistEvent: (sid, seq, data) => eventStore.updateEventPayload(sid, seq, data)
|
|
3199
3248
|
});
|
|
3200
3249
|
return processedEvents;
|
|
3201
3250
|
}
|
|
@@ -3403,7 +3452,7 @@ var callSubAgentTool = {
|
|
|
3403
3452
|
};
|
|
3404
3453
|
}
|
|
3405
3454
|
try {
|
|
3406
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3455
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-ATO5MSWX.js");
|
|
3407
3456
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3408
3457
|
const turnMetrics = new TurnMetrics();
|
|
3409
3458
|
const result = await executeSubAgent({
|
|
@@ -4219,7 +4268,7 @@ function resolveAgentDef2(sessionManager, sessionId) {
|
|
|
4219
4268
|
}
|
|
4220
4269
|
async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
4221
4270
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
4222
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
4271
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-ATO5MSWX.js");
|
|
4223
4272
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
4224
4273
|
const toolFingerprint = getToolFingerprint(tools);
|
|
4225
4274
|
const allAgents = await loadAllAgentsDefault();
|
|
@@ -4232,7 +4281,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
|
4232
4281
|
async function computeSessionHash(sessionManager, sessionId) {
|
|
4233
4282
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
4234
4283
|
const agentDef = await resolveAgentDef2(sessionManager, sessionId);
|
|
4235
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
4284
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-ATO5MSWX.js");
|
|
4236
4285
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
4237
4286
|
const toolFingerprint = getToolFingerprint(tools);
|
|
4238
4287
|
return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
|
|
@@ -4339,7 +4388,7 @@ var mcpConfigTool = createTool(
|
|
|
4339
4388
|
await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated });
|
|
4340
4389
|
}
|
|
4341
4390
|
async function rebuildTools() {
|
|
4342
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4391
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-ATO5MSWX.js");
|
|
4343
4392
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
4344
4393
|
setMcpTools2(mcpTools);
|
|
4345
4394
|
}
|
|
@@ -4352,9 +4401,10 @@ var mcpConfigTool = createTool(
|
|
|
4352
4401
|
for (const server of servers) {
|
|
4353
4402
|
const connStr = server.status === "connected" ? "\u25CF" : server.status === "error" ? "\u2717" : "\u25CB";
|
|
4354
4403
|
const cmdStr = server.config.command ? `${server.config.command} ${(server.config.args ?? []).join(" ")}` : server.config.url ?? "";
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4404
|
+
const hasCachedTools = server.tools.length > 0;
|
|
4405
|
+
const sourceLabel = server.status === "connected" ? " (live)" : hasCachedTools ? " (from cache)" : "";
|
|
4406
|
+
const statusLine = server.error ? `${server.status}${sourceLabel}: ${server.error}` : `${server.status}${sourceLabel}`;
|
|
4407
|
+
lines.push(`${connStr} ${server.name} (${server.config.transport}) \u2014 ${statusLine}`);
|
|
4358
4408
|
lines.push(` ${cmdStr}`);
|
|
4359
4409
|
lines.push(` ${server.tools.length} tools, ~${server.estimatedTokens} tokens`);
|
|
4360
4410
|
const enabledTools = server.tools.filter((t) => t.enabled);
|
|
@@ -4743,4 +4793,4 @@ export {
|
|
|
4743
4793
|
getToolRegistryForAgent,
|
|
4744
4794
|
createToolRegistry
|
|
4745
4795
|
};
|
|
4746
|
-
//# sourceMappingURL=chunk-
|
|
4796
|
+
//# sourceMappingURL=chunk-HJ7KRYWX.js.map
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
getEventStore,
|
|
10
10
|
updateSessionMetadata
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NF6WHQAT.js";
|
|
12
12
|
import {
|
|
13
13
|
buildMessagesFromStoredEvents,
|
|
14
14
|
foldPendingConfirmations
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EHYFYQXY.js";
|
|
16
16
|
import {
|
|
17
17
|
logger
|
|
18
18
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -105,6 +105,7 @@ function resolveSessionProvider(session, providerManager) {
|
|
|
105
105
|
const provider = session.providerId ? providers.find((p) => p.id === session.providerId) : providers.find((p) => p.isActive);
|
|
106
106
|
if (!provider) return void 0;
|
|
107
107
|
return {
|
|
108
|
+
providerId: provider.id,
|
|
108
109
|
baseUrl: provider.url,
|
|
109
110
|
...provider.apiKey ? { apiKey: provider.apiKey } : {},
|
|
110
111
|
model: effectiveModel
|
|
@@ -117,7 +118,7 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
|
|
|
117
118
|
const messageCount = getSessionMessageCount(sessionId);
|
|
118
119
|
if (!needsNameGenerationCheck(sessionId, session.metadata.title, messageCount)) return;
|
|
119
120
|
const providerConfig = resolveSessionProvider(session, providerManager);
|
|
120
|
-
const modelSettings = providerConfig ? providerManager.getModelSettings(providerConfig.model, "non-thinking") : void 0;
|
|
121
|
+
const modelSettings = providerConfig ? providerManager.getModelSettings(providerConfig.providerId, providerConfig.model, "non-thinking") : void 0;
|
|
121
122
|
const prompt = SESSION_NAME_PROMPT.replace("{message}", userMessage);
|
|
122
123
|
try {
|
|
123
124
|
let client;
|
|
@@ -125,7 +126,7 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
|
|
|
125
126
|
client = deps.getLLMClient();
|
|
126
127
|
client.setModel(providerConfig.model);
|
|
127
128
|
} else if (providerConfig) {
|
|
128
|
-
const { createLLMClient } = await import("./client-
|
|
129
|
+
const { createLLMClient } = await import("./client-XTPAYYRH.js");
|
|
129
130
|
client = createLLMClient({
|
|
130
131
|
llm: {
|
|
131
132
|
baseUrl: providerConfig.baseUrl,
|
|
@@ -174,4 +175,4 @@ export {
|
|
|
174
175
|
buildRunChatTurnParams,
|
|
175
176
|
generateSessionNameForSession
|
|
176
177
|
};
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
178
|
+
//# sourceMappingURL=chunk-JGNAYJJZ.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
foldContextState,
|
|
6
6
|
foldSessionState,
|
|
7
7
|
spreadOptionalMessageFields
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EHYFYQXY.js";
|
|
9
9
|
import {
|
|
10
10
|
getDatabase
|
|
11
11
|
} from "./chunk-ZPIZLTWU.js";
|
|
@@ -226,6 +226,13 @@ var EventStore = class {
|
|
|
226
226
|
transaction();
|
|
227
227
|
return count;
|
|
228
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Update the payload of an existing event in-place.
|
|
231
|
+
* Used to persist enriched data (e.g., vision fallback descriptions) back to the store.
|
|
232
|
+
*/
|
|
233
|
+
updateEventPayload(sessionId, seq, data) {
|
|
234
|
+
this.db.prepare(`UPDATE events SET payload = ? WHERE session_id = ? AND seq = ?`).run(JSON.stringify(data), sessionId, seq);
|
|
235
|
+
}
|
|
229
236
|
/**
|
|
230
237
|
* Get the latest sequence number for a session
|
|
231
238
|
*/
|
|
@@ -1425,4 +1432,4 @@ export {
|
|
|
1425
1432
|
truncateSessionMessages,
|
|
1426
1433
|
getRecentUserPromptsForSession
|
|
1427
1434
|
};
|
|
1428
|
-
//# sourceMappingURL=chunk-
|
|
1435
|
+
//# sourceMappingURL=chunk-NF6WHQAT.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-M3RB4IF6.js";
|
|
4
4
|
import {
|
|
5
5
|
createLLMClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZBLT7MNL.js";
|
|
7
7
|
import {
|
|
8
8
|
buildModelsUrl,
|
|
9
9
|
ensureVersionPrefix,
|
|
@@ -469,8 +469,8 @@ function createProviderManager(config) {
|
|
|
469
469
|
logger.info("Model settings updated", { providerId, modelId, final: updatedModel });
|
|
470
470
|
return { success: true, model: updatedModel };
|
|
471
471
|
},
|
|
472
|
-
getModelSettings(modelId, mode = "thinking") {
|
|
473
|
-
const provider = providers.find((p) => p.
|
|
472
|
+
getModelSettings(providerId, modelId, mode = "thinking") {
|
|
473
|
+
const provider = providers.find((p) => p.id === providerId);
|
|
474
474
|
const model = provider?.models.find((m) => m.id === modelId);
|
|
475
475
|
if (!model) return void 0;
|
|
476
476
|
const baseSettings = {};
|
|
@@ -551,4 +551,4 @@ export {
|
|
|
551
551
|
parseDefaultModelSelection,
|
|
552
552
|
createProviderManager
|
|
553
553
|
};
|
|
554
|
-
//# sourceMappingURL=chunk-
|
|
554
|
+
//# sourceMappingURL=chunk-SM2PK6TV.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPACTION_PROMPT,
|
|
3
3
|
createMessageStartEvent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-55RWNJBT.js";
|
|
5
5
|
import {
|
|
6
6
|
getCurrentWindowMessageOptions
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NF6WHQAT.js";
|
|
8
8
|
|
|
9
9
|
// src/server/context/compactor.ts
|
|
10
10
|
function appendCompactionPrompt(sessionId, append) {
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
shouldCompact,
|
|
32
32
|
getCompactionTarget
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-WXAOEWJS.js.map
|
|
@@ -54,6 +54,12 @@ function convertAttachmentSync(attachment, modelSupportsVision) {
|
|
|
54
54
|
image_url: { url: attachment.data }
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
if (attachment.description) {
|
|
58
|
+
return {
|
|
59
|
+
type: "text",
|
|
60
|
+
text: `[Image: ${attachment.filename || "image"} - description: ${attachment.description}]`
|
|
61
|
+
};
|
|
62
|
+
}
|
|
57
63
|
return {
|
|
58
64
|
type: "text",
|
|
59
65
|
text: `[Image: ${attachment.filename || "image"}] (vision not supported, cannot describe)`
|
|
@@ -197,4 +203,4 @@ export {
|
|
|
197
203
|
buildStreamingCreateParams,
|
|
198
204
|
mapFinishReason
|
|
199
205
|
};
|
|
200
|
-
//# sourceMappingURL=chunk-
|
|
206
|
+
//# sourceMappingURL=chunk-Z6W4YHJB.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
buildStreamingCreateParams,
|
|
10
10
|
getThinking,
|
|
11
11
|
mapFinishReason
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Z6W4YHJB.js";
|
|
13
13
|
import {
|
|
14
14
|
LLMError,
|
|
15
15
|
OpenAIHttpClient
|
|
@@ -259,4 +259,4 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
259
259
|
export {
|
|
260
260
|
createLLMClient
|
|
261
261
|
};
|
|
262
|
-
//# sourceMappingURL=chunk-
|
|
262
|
+
//# sourceMappingURL=chunk-ZBLT7MNL.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLLMClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZBLT7MNL.js";
|
|
4
4
|
import "./chunk-Z4FMBCJO.js";
|
|
5
5
|
import "./chunk-HNCM3D7Y.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-Z6W4YHJB.js";
|
|
7
7
|
import "./chunk-IEDE6VK4.js";
|
|
8
8
|
import "./chunk-K44MW7JJ.js";
|
|
9
9
|
import "./chunk-V4IE7HJY.js";
|
|
10
10
|
export {
|
|
11
11
|
createLLMClient
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=client-
|
|
13
|
+
//# sourceMappingURL=client-XTPAYYRH.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
convertTools,
|
|
7
7
|
getThinking,
|
|
8
8
|
mapFinishReason
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Z6W4YHJB.js";
|
|
10
10
|
export {
|
|
11
11
|
buildModelParams,
|
|
12
12
|
buildNonStreamingCreateParams,
|
|
@@ -16,4 +16,4 @@ export {
|
|
|
16
16
|
getThinking,
|
|
17
17
|
mapFinishReason
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=client-pure-
|
|
19
|
+
//# sourceMappingURL=client-pure-N2MOIDQ6.js.map
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
appendCompactionPrompt,
|
|
3
3
|
getCompactionTarget,
|
|
4
4
|
shouldCompact
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-WXAOEWJS.js";
|
|
6
|
+
import "./chunk-55RWNJBT.js";
|
|
7
|
+
import "./chunk-NF6WHQAT.js";
|
|
8
|
+
import "./chunk-EHYFYQXY.js";
|
|
9
9
|
import "./chunk-ZPIZLTWU.js";
|
|
10
10
|
import "./chunk-J2GP3J3X.js";
|
|
11
11
|
import "./chunk-Z4FMBCJO.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-Z6W4YHJB.js";
|
|
13
13
|
import "./chunk-K44MW7JJ.js";
|
|
14
14
|
import "./chunk-V4IE7HJY.js";
|
|
15
15
|
export {
|
|
@@ -17,4 +17,4 @@ export {
|
|
|
17
17
|
getCompactionTarget,
|
|
18
18
|
shouldCompact
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=compactor-
|
|
20
|
+
//# sourceMappingURL=compactor-RZA5VSRT.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
saveGlobalConfig,
|
|
14
14
|
setDefaultModelSelection,
|
|
15
15
|
updateProvider
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EZ3BPIUV.js";
|
|
17
17
|
import "./chunk-CQGTEGKL.js";
|
|
18
18
|
export {
|
|
19
19
|
activateProvider,
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
setDefaultModelSelection,
|
|
32
32
|
updateProvider
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=config-
|
|
34
|
+
//# sourceMappingURL=config-XOXIIBUY.js.map
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
isStoredEvent,
|
|
39
39
|
isTurnEvent,
|
|
40
40
|
truncateSessionMessages
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-NF6WHQAT.js";
|
|
42
42
|
import {
|
|
43
43
|
buildContextMessagesFromEventHistory,
|
|
44
44
|
buildContextMessagesFromMessages,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
foldTodos,
|
|
56
56
|
foldTurnEventsToSnapshotMessages,
|
|
57
57
|
getMessagesForWindow
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-EHYFYQXY.js";
|
|
59
59
|
import "./chunk-ZPIZLTWU.js";
|
|
60
60
|
import "./chunk-K44MW7JJ.js";
|
|
61
61
|
export {
|
|
@@ -114,4 +114,4 @@ export {
|
|
|
114
114
|
isTurnEvent,
|
|
115
115
|
truncateSessionMessages
|
|
116
116
|
};
|
|
117
|
-
//# sourceMappingURL=events-
|
|
117
|
+
//# sourceMappingURL=events-KZZPCW2Q.js.map
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
handleToolResult,
|
|
24
24
|
spreadOptionalMessageFields,
|
|
25
25
|
stripOrphanedToolCalls
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EHYFYQXY.js";
|
|
27
27
|
export {
|
|
28
28
|
buildContextMessagesFromEventHistory,
|
|
29
29
|
buildContextMessagesFromMessages,
|
|
@@ -50,4 +50,4 @@ export {
|
|
|
50
50
|
spreadOptionalMessageFields,
|
|
51
51
|
stripOrphanedToolCalls
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=folding-
|
|
53
|
+
//# sourceMappingURL=folding-ENYH4LMG.js.map
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
injectWorkflowKickoffIfNeeded,
|
|
3
3
|
runAgentTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-FFQCZ2MI.js";
|
|
6
|
+
import "./chunk-HJ7KRYWX.js";
|
|
7
7
|
import "./chunk-DL6ZILAF.js";
|
|
8
8
|
import "./chunk-PBGOZMVY.js";
|
|
9
9
|
import "./chunk-VRGRAQDG.js";
|
|
@@ -19,16 +19,16 @@ import {
|
|
|
19
19
|
createMessageStartEvent,
|
|
20
20
|
createToolCallEvent,
|
|
21
21
|
createToolResultEvent
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-55RWNJBT.js";
|
|
23
|
+
import "./chunk-NF6WHQAT.js";
|
|
24
|
+
import "./chunk-EHYFYQXY.js";
|
|
25
25
|
import "./chunk-ZPIZLTWU.js";
|
|
26
26
|
import "./chunk-J2GP3J3X.js";
|
|
27
27
|
import "./chunk-Z4FMBCJO.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-Z6W4YHJB.js";
|
|
29
29
|
import "./chunk-K44MW7JJ.js";
|
|
30
30
|
import "./chunk-YD6NDTKF.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-EZ3BPIUV.js";
|
|
32
32
|
import "./chunk-CQGTEGKL.js";
|
|
33
33
|
import "./chunk-V4IE7HJY.js";
|
|
34
34
|
export {
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
runAgentTurn,
|
|
43
43
|
runChatTurn
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=orchestrator-
|
|
45
|
+
//# sourceMappingURL=orchestrator-ZFBVVQBO.js.map
|