openfox 2.0.1 → 2.0.3
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-LJMW4OK3.js → chat-handler-HXCAXFEV.js} +6 -6
- package/dist/{chunk-MFUPS6UE.js → chunk-3YK3INGL.js} +3 -3
- package/dist/{chunk-7ZMMDZU7.js → chunk-A52FXWJX.js} +8 -4
- package/dist/{chunk-32GQUDLN.js → chunk-FCFCBOWR.js} +5 -7
- package/dist/{chunk-LEDG5WAN.js → chunk-MSUES6A3.js} +3 -3
- package/dist/{chunk-RI6GAMNP.js → chunk-NZCKCJH5.js} +1 -1
- package/dist/{chunk-XEK3KII6.js → chunk-OP22QEB3.js} +1 -28
- package/dist/{chunk-CK6LGE7G.js → chunk-PK7CBACL.js} +2 -2
- package/dist/{chunk-FFEAEPJB.js → chunk-Z4SWOUWC.js} +8 -3
- package/dist/{chunk-ZDY4WMZJ.js → chunk-ZHK4XSLM.js} +65 -150
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{compactor-TDNRM3A7.js → compactor-5VQNEYQX.js} +2 -2
- package/dist/{events-ZKWAKWI7.js → events-4T6IO56V.js} +2 -4
- package/dist/{orchestrator-LX6FKB6L.js → orchestrator-KQROHCQ7.js} +5 -5
- package/dist/package.json +1 -1
- package/dist/{processor-NMYSEBC7.js → processor-YXAPERVZ.js} +4 -4
- package/dist/{protocol-D59sCy9L.d.ts → protocol-49SJtN_P.d.ts} +2 -0
- package/dist/{provider-DTNQYCMV.js → provider-QPECLUZ7.js} +3 -3
- package/dist/{provider-manager-LMHAHLIF.js → provider-manager-YA2WALTF.js} +3 -3
- package/dist/{serve-SGNL43UL.js → serve-WHN52MAF.js} +8 -8
- package/dist/server/index.d.ts +4 -9
- package/dist/server/index.js +7 -7
- package/dist/shared/index.d.ts +2 -2
- package/dist/{tools-BOE5T3KC.js → tools-ESHH53EB.js} +4 -4
- package/dist/web/assets/{index-Bego8SwT.js → index-Di3909TT.js} +68 -67
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
injectWorkflowKickoffIfNeeded,
|
|
4
4
|
runAgentTurn,
|
|
5
5
|
runChatTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MSUES6A3.js";
|
|
7
7
|
import {
|
|
8
8
|
COMPACTION_PROMPT,
|
|
9
9
|
TurnMetrics,
|
|
@@ -48,9 +48,8 @@ import {
|
|
|
48
48
|
loadProjectSkills,
|
|
49
49
|
loadUserAgents,
|
|
50
50
|
loadUserSkills,
|
|
51
|
-
loadVisionModelFromGlobalConfig,
|
|
52
51
|
pathExists,
|
|
53
|
-
|
|
52
|
+
processEventsForConversation,
|
|
54
53
|
saveAgent,
|
|
55
54
|
saveAgentToProject,
|
|
56
55
|
saveItemToDir,
|
|
@@ -59,7 +58,7 @@ import {
|
|
|
59
58
|
skillExists,
|
|
60
59
|
spawnShellProcess,
|
|
61
60
|
streamLLMPure
|
|
62
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-FCFCBOWR.js";
|
|
63
62
|
import {
|
|
64
63
|
getPathSeparator,
|
|
65
64
|
getPlatformShell,
|
|
@@ -73,7 +72,6 @@ import {
|
|
|
73
72
|
createSession,
|
|
74
73
|
deleteSession,
|
|
75
74
|
emitAssistantMessageStart,
|
|
76
|
-
emitContextCompacted,
|
|
77
75
|
emitContextState,
|
|
78
76
|
emitCriteriaSet,
|
|
79
77
|
emitCriterionUpdated,
|
|
@@ -97,7 +95,7 @@ import {
|
|
|
97
95
|
updateSessionMetadata,
|
|
98
96
|
updateSessionProvider,
|
|
99
97
|
updateSessionRunning
|
|
100
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-OP22QEB3.js";
|
|
101
99
|
import {
|
|
102
100
|
buildMessagesFromStoredEvents,
|
|
103
101
|
foldPendingConfirmations
|
|
@@ -142,12 +140,11 @@ import {
|
|
|
142
140
|
ensureVersionPrefix,
|
|
143
141
|
getLlmStatus,
|
|
144
142
|
parseDefaultModelSelection
|
|
145
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-A52FXWJX.js";
|
|
146
144
|
import {
|
|
147
145
|
getBackendDisplayName,
|
|
148
|
-
getModelProfile
|
|
149
|
-
|
|
150
|
-
} from "./chunk-FFEAEPJB.js";
|
|
146
|
+
getModelProfile
|
|
147
|
+
} from "./chunk-Z4SWOUWC.js";
|
|
151
148
|
import {
|
|
152
149
|
logger,
|
|
153
150
|
setLogLevel
|
|
@@ -2449,18 +2446,19 @@ async function compactContext(options) {
|
|
|
2449
2446
|
})
|
|
2450
2447
|
);
|
|
2451
2448
|
eventStore.append(sessionId, { type: "message.done", data: { messageId: compactPromptMsgId } });
|
|
2452
|
-
const
|
|
2453
|
-
|
|
2454
|
-
const runtimeConfig = getRuntimeConfig();
|
|
2455
|
-
const visionModel = runtimeConfig.llm.visionModel ? { baseUrl: runtimeConfig.llm.baseUrl, model: runtimeConfig.llm.visionModel, timeout: runtimeConfig.llm.timeout } : await loadVisionModelFromGlobalConfig();
|
|
2456
|
-
const { events: processedEvents } = await processContextImages(rawEvents, {
|
|
2457
|
-
modelSupportsVision: modelVision,
|
|
2458
|
-
...visionModel ? { visionModel } : {},
|
|
2459
|
-
onEvent: (event) => eventStore.append(sessionId, event)
|
|
2449
|
+
const processedEvents = await processEventsForConversation(sessionId, llmClient, (event) => {
|
|
2450
|
+
eventStore.append(sessionId, event);
|
|
2460
2451
|
});
|
|
2461
2452
|
const messages = getConversationMessages({ type: "toplevel", sessionId }, { events: processedEvents });
|
|
2462
|
-
const
|
|
2453
|
+
const cached = sessionManager.getCachedPrompt(sessionId);
|
|
2454
|
+
const systemPrompt = cached?.systemPrompt ?? buildBasePrompt(session.workdir);
|
|
2463
2455
|
const assistantMsgId = crypto.randomUUID();
|
|
2456
|
+
eventStore.append(
|
|
2457
|
+
sessionId,
|
|
2458
|
+
createMessageStartEvent(assistantMsgId, "assistant", void 0, {
|
|
2459
|
+
...getCurrentWindowMessageOptions(sessionId) ?? {}
|
|
2460
|
+
})
|
|
2461
|
+
);
|
|
2464
2462
|
const streamGen = streamLLMPure({
|
|
2465
2463
|
messageId: assistantMsgId,
|
|
2466
2464
|
systemPrompt,
|
|
@@ -4846,26 +4844,6 @@ var SessionManager = class {
|
|
|
4846
4844
|
return msg;
|
|
4847
4845
|
});
|
|
4848
4846
|
}
|
|
4849
|
-
/**
|
|
4850
|
-
* Compact context. Delegates to EventStore.
|
|
4851
|
-
*/
|
|
4852
|
-
compactContext(sessionId, summary, tokenCountAtClose) {
|
|
4853
|
-
const state = getSessionState(sessionId);
|
|
4854
|
-
if (!state) {
|
|
4855
|
-
throw new Error("Session not found");
|
|
4856
|
-
}
|
|
4857
|
-
const closedWindowId = state.currentContextWindowId;
|
|
4858
|
-
const newWindowId = crypto.randomUUID();
|
|
4859
|
-
emitContextCompacted(sessionId, closedWindowId, newWindowId, tokenCountAtClose, 0, summary);
|
|
4860
|
-
emitUserMessage(sessionId, `Previous context summary:
|
|
4861
|
-
${summary}`, {
|
|
4862
|
-
contextWindowId: newWindowId,
|
|
4863
|
-
isSystemGenerated: true,
|
|
4864
|
-
messageKind: "auto-prompt",
|
|
4865
|
-
isCompactionSummary: true,
|
|
4866
|
-
metadata: { type: "compaction", name: "Compaction", color: "#64748b" }
|
|
4867
|
-
});
|
|
4868
|
-
}
|
|
4869
4847
|
/**
|
|
4870
4848
|
* Set current context size (for token tracking).
|
|
4871
4849
|
* Emits a context.state event with the real promptTokens from the LLM.
|
|
@@ -5117,23 +5095,6 @@ ${summary}`, {
|
|
|
5117
5095
|
getDynamicContextChanged(sessionId) {
|
|
5118
5096
|
return this.dynamicContextChangedStore.get(sessionId) ?? false;
|
|
5119
5097
|
}
|
|
5120
|
-
/**
|
|
5121
|
-
* @deprecated Use addMessage + compactContext instead
|
|
5122
|
-
*/
|
|
5123
|
-
compactMessages(sessionId, _messageIds, summary) {
|
|
5124
|
-
const messageId = emitUserMessage(sessionId, `[COMPACTED HISTORY]
|
|
5125
|
-
${summary}`, {
|
|
5126
|
-
isSystemGenerated: true
|
|
5127
|
-
});
|
|
5128
|
-
return {
|
|
5129
|
-
id: messageId,
|
|
5130
|
-
role: "system",
|
|
5131
|
-
content: `[COMPACTED HISTORY]
|
|
5132
|
-
${summary}`,
|
|
5133
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5134
|
-
isCompacted: true
|
|
5135
|
-
};
|
|
5136
|
-
}
|
|
5137
5098
|
/**
|
|
5138
5099
|
* @deprecated Use addTokensUsed instead
|
|
5139
5100
|
*/
|
|
@@ -5832,7 +5793,7 @@ import { Router as Router6 } from "express";
|
|
|
5832
5793
|
import { spawn as spawn5 } from "child_process";
|
|
5833
5794
|
|
|
5834
5795
|
// src/constants.ts
|
|
5835
|
-
var VERSION = "2.0.
|
|
5796
|
+
var VERSION = "2.0.3";
|
|
5836
5797
|
|
|
5837
5798
|
// src/server/routes/auto-update.ts
|
|
5838
5799
|
var updateInProgress = false;
|
|
@@ -6125,7 +6086,7 @@ async function createServerHandle(config4) {
|
|
|
6125
6086
|
res.json({ project });
|
|
6126
6087
|
});
|
|
6127
6088
|
app.get("/api/sessions", async (req, res) => {
|
|
6128
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
6089
|
+
const { getRecentUserPromptsForSession } = await import("./events-4T6IO56V.js");
|
|
6129
6090
|
const projectId = req.query["projectId"];
|
|
6130
6091
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
6131
6092
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -6158,7 +6119,7 @@ async function createServerHandle(config4) {
|
|
|
6158
6119
|
res.status(201).json({ session });
|
|
6159
6120
|
});
|
|
6160
6121
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
6161
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6122
|
+
const { getEventStore: getEventStore2 } = await import("./events-4T6IO56V.js");
|
|
6162
6123
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6163
6124
|
const session = sessionManager.getSession(req.params.id);
|
|
6164
6125
|
if (!session) {
|
|
@@ -6189,7 +6150,7 @@ async function createServerHandle(config4) {
|
|
|
6189
6150
|
res.json({ success: true });
|
|
6190
6151
|
});
|
|
6191
6152
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
6192
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6153
|
+
const { getEventStore: getEventStore2 } = await import("./events-4T6IO56V.js");
|
|
6193
6154
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6194
6155
|
const sessionId = req.params.id;
|
|
6195
6156
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -6232,7 +6193,7 @@ async function createServerHandle(config4) {
|
|
|
6232
6193
|
res.json({ success: true });
|
|
6233
6194
|
});
|
|
6234
6195
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
6235
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6196
|
+
const { getEventStore: getEventStore2 } = await import("./events-4T6IO56V.js");
|
|
6236
6197
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6237
6198
|
const sessionId = req.params.id;
|
|
6238
6199
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -6289,12 +6250,12 @@ async function createServerHandle(config4) {
|
|
|
6289
6250
|
if (!callId || approved === void 0) {
|
|
6290
6251
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
6291
6252
|
}
|
|
6292
|
-
const { providePathConfirmation } = await import("./tools-
|
|
6253
|
+
const { providePathConfirmation } = await import("./tools-ESHH53EB.js");
|
|
6293
6254
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
6294
6255
|
if (!result.found) {
|
|
6295
6256
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
6296
6257
|
}
|
|
6297
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6258
|
+
const { getEventStore: getEventStore2 } = await import("./events-4T6IO56V.js");
|
|
6298
6259
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-YOCGTZYH.js");
|
|
6299
6260
|
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-CN24IKQN.js");
|
|
6300
6261
|
const eventStore = getEventStore2();
|
|
@@ -6313,7 +6274,7 @@ async function createServerHandle(config4) {
|
|
|
6313
6274
|
if (!callId || !answer) {
|
|
6314
6275
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
6315
6276
|
}
|
|
6316
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
6277
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-ESHH53EB.js");
|
|
6317
6278
|
const found = provideAnswer2(callId, answer);
|
|
6318
6279
|
if (!found) {
|
|
6319
6280
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -6349,16 +6310,17 @@ async function createServerHandle(config4) {
|
|
|
6349
6310
|
if (!session) {
|
|
6350
6311
|
return res.status(404).json({ error: "Session not found" });
|
|
6351
6312
|
}
|
|
6352
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6353
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6313
|
+
const { stopSessionExecution } = await import("./chat-handler-HXCAXFEV.js");
|
|
6314
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-ESHH53EB.js");
|
|
6315
|
+
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
6316
|
+
sessionManager.clearMessageQueue(sessionId);
|
|
6354
6317
|
stopSessionExecution(sessionId, sessionManager);
|
|
6355
6318
|
abortSession(sessionId);
|
|
6356
6319
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
6357
6320
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
6358
|
-
|
|
6359
|
-
const eventStore = (await import("./events-ZKWAKWI7.js")).getEventStore();
|
|
6321
|
+
const eventStore = (await import("./events-4T6IO56V.js")).getEventStore();
|
|
6360
6322
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
6361
|
-
res.json({ success: true });
|
|
6323
|
+
res.json({ success: true, queuedMessages });
|
|
6362
6324
|
});
|
|
6363
6325
|
app.post("/api/sessions/:id/truncate", async (req, res) => {
|
|
6364
6326
|
const sessionId = req.params.id;
|
|
@@ -6370,7 +6332,7 @@ async function createServerHandle(config4) {
|
|
|
6370
6332
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
6371
6333
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
6372
6334
|
}
|
|
6373
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6335
|
+
const { truncateSessionMessages } = await import("./events-4T6IO56V.js");
|
|
6374
6336
|
truncateSessionMessages(sessionId, messageIndex);
|
|
6375
6337
|
res.json({ success: true });
|
|
6376
6338
|
});
|
|
@@ -6388,7 +6350,7 @@ async function createServerHandle(config4) {
|
|
|
6388
6350
|
if (!msg) {
|
|
6389
6351
|
return res.status(400).json({ error: "Message not found at this index" });
|
|
6390
6352
|
}
|
|
6391
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6353
|
+
const { truncateSessionMessages } = await import("./events-4T6IO56V.js");
|
|
6392
6354
|
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
6393
6355
|
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
6394
6356
|
res.json({ success: true });
|
|
@@ -6512,6 +6474,25 @@ async function createServerHandle(config4) {
|
|
|
6512
6474
|
backend: llmClient.getBackend()
|
|
6513
6475
|
});
|
|
6514
6476
|
});
|
|
6477
|
+
function buildModelConfigs(models) {
|
|
6478
|
+
return models.map((m) => ({
|
|
6479
|
+
id: m.id,
|
|
6480
|
+
contextWindow: m.contextWindow ?? 2e5,
|
|
6481
|
+
source: "user",
|
|
6482
|
+
...m.supportsVision !== void 0 && { supportsVision: m.supportsVision },
|
|
6483
|
+
...m.thinkingEnabled !== void 0 && { thinkingEnabled: m.thinkingEnabled },
|
|
6484
|
+
...m.thinkingLevel !== void 0 && { thinkingLevel: m.thinkingLevel },
|
|
6485
|
+
...m.nonThinkingEnabled !== void 0 && { nonThinkingEnabled: m.nonThinkingEnabled },
|
|
6486
|
+
...m.thinkingExtraKwargs !== void 0 && { thinkingExtraKwargs: m.thinkingExtraKwargs },
|
|
6487
|
+
...m.nonThinkingExtraKwargs !== void 0 && { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs },
|
|
6488
|
+
...m.thinkingQueryParams !== void 0 && { thinkingQueryParams: m.thinkingQueryParams },
|
|
6489
|
+
...m.nonThinkingQueryParams !== void 0 && { nonThinkingQueryParams: m.nonThinkingQueryParams },
|
|
6490
|
+
...m.temperature !== void 0 && { temperature: m.temperature },
|
|
6491
|
+
...m.topP !== void 0 && { topP: m.topP },
|
|
6492
|
+
...m.topK !== void 0 && { topK: m.topK },
|
|
6493
|
+
...m.maxTokens !== void 0 && { maxTokens: m.maxTokens }
|
|
6494
|
+
}));
|
|
6495
|
+
}
|
|
6515
6496
|
app.post("/api/providers/test", async (req, res) => {
|
|
6516
6497
|
const { url, backend: reqBackend } = req.body;
|
|
6517
6498
|
if (!url) {
|
|
@@ -6536,7 +6517,7 @@ async function createServerHandle(config4) {
|
|
|
6536
6517
|
const url = req.query["url"];
|
|
6537
6518
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6538
6519
|
try {
|
|
6539
|
-
const { fetchModelsWithContext } = await import("./provider-manager-
|
|
6520
|
+
const { fetchModelsWithContext } = await import("./provider-manager-YA2WALTF.js");
|
|
6540
6521
|
const models = await fetchModelsWithContext(url);
|
|
6541
6522
|
if (models.length === 0) {
|
|
6542
6523
|
return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
|
|
@@ -6560,17 +6541,19 @@ async function createServerHandle(config4) {
|
|
|
6560
6541
|
}
|
|
6561
6542
|
});
|
|
6562
6543
|
app.post("/api/providers/test-params", async (req, res) => {
|
|
6563
|
-
const { url, model, params, apiKey } = req.body;
|
|
6544
|
+
const { url, model, params, apiKey, queryParams } = req.body;
|
|
6564
6545
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6565
6546
|
if (!model) return res.status(400).json({ error: "model is required" });
|
|
6566
6547
|
try {
|
|
6567
6548
|
const headers = { "Content-Type": "application/json" };
|
|
6568
6549
|
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
|
6550
|
+
const hasQueryParams = queryParams && Object.keys(queryParams).length > 0;
|
|
6569
6551
|
const body = {
|
|
6570
6552
|
model,
|
|
6571
6553
|
messages: [{ role: "user", content: "say hi in one word" }],
|
|
6572
6554
|
max_tokens: 8e3,
|
|
6573
|
-
...params
|
|
6555
|
+
...hasQueryParams ? {} : params,
|
|
6556
|
+
...hasQueryParams ? queryParams : {}
|
|
6574
6557
|
};
|
|
6575
6558
|
const response = await fetch(`${ensureVersionPrefix(url)}/chat/completions`, {
|
|
6576
6559
|
method: "POST",
|
|
@@ -6580,7 +6563,7 @@ async function createServerHandle(config4) {
|
|
|
6580
6563
|
});
|
|
6581
6564
|
if (!response.ok) {
|
|
6582
6565
|
const errorBody = await response.text();
|
|
6583
|
-
return res.status(400).json({ error: `API error (${response.status}): ${errorBody.slice(0,
|
|
6566
|
+
return res.status(400).json({ error: `API error (${response.status}): ${errorBody.slice(0, 2e3)}` });
|
|
6584
6567
|
}
|
|
6585
6568
|
const data = await response.json();
|
|
6586
6569
|
const message = data.choices?.[0]?.message ?? {};
|
|
@@ -6614,17 +6597,7 @@ async function createServerHandle(config4) {
|
|
|
6614
6597
|
apiKey,
|
|
6615
6598
|
...isLocal !== void 0 ? { isLocal } : {},
|
|
6616
6599
|
...thinkingField ? { thinkingField } : {},
|
|
6617
|
-
models: modelConfigs?.length ? modelConfigs
|
|
6618
|
-
id: m.id,
|
|
6619
|
-
contextWindow: m.contextWindow,
|
|
6620
|
-
source: "user",
|
|
6621
|
-
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6622
|
-
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6623
|
-
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6624
|
-
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {},
|
|
6625
|
-
...m.thinkingExtraKwargs ? { thinkingExtraKwargs: m.thinkingExtraKwargs } : {},
|
|
6626
|
-
...m.nonThinkingExtraKwargs ? { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs } : {}
|
|
6627
|
-
})) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [],
|
|
6600
|
+
models: modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [],
|
|
6628
6601
|
isActive: true
|
|
6629
6602
|
});
|
|
6630
6603
|
const finalConfig = setDefaultModelSelection(
|
|
@@ -6730,17 +6703,7 @@ async function createServerHandle(config4) {
|
|
|
6730
6703
|
if (isLocal !== void 0) updates["isLocal"] = isLocal;
|
|
6731
6704
|
if (thinkingField !== void 0) updates["thinkingField"] = thinkingField || void 0;
|
|
6732
6705
|
if (modelConfigs !== void 0) {
|
|
6733
|
-
updates["models"] = modelConfigs
|
|
6734
|
-
id: m.id,
|
|
6735
|
-
contextWindow: m.contextWindow,
|
|
6736
|
-
source: "user",
|
|
6737
|
-
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6738
|
-
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6739
|
-
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6740
|
-
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {},
|
|
6741
|
-
...m.thinkingExtraKwargs ? { thinkingExtraKwargs: m.thinkingExtraKwargs } : {},
|
|
6742
|
-
...m.nonThinkingExtraKwargs ? { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs } : {}
|
|
6743
|
-
}));
|
|
6706
|
+
updates["models"] = buildModelConfigs(modelConfigs);
|
|
6744
6707
|
}
|
|
6745
6708
|
const updatedConfig = updateProvider(globalConfig, id, updates);
|
|
6746
6709
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6774,56 +6737,6 @@ async function createServerHandle(config4) {
|
|
|
6774
6737
|
backend: llmClient.getBackend()
|
|
6775
6738
|
});
|
|
6776
6739
|
});
|
|
6777
|
-
app.post("/api/providers/:id/models/:modelId", async (req, res) => {
|
|
6778
|
-
const { id, modelId } = req.params;
|
|
6779
|
-
const body = req.body;
|
|
6780
|
-
logger.info("API: POST /api/providers/:id/models/:modelId", {
|
|
6781
|
-
providerId: id,
|
|
6782
|
-
modelId,
|
|
6783
|
-
body
|
|
6784
|
-
});
|
|
6785
|
-
const hasFullSettings = body.temperature !== void 0 || body.topP !== void 0 || body.topK !== void 0 || body.maxTokens !== void 0 || body.thinkingEnabled !== void 0 || body.thinkingLevel !== void 0 || body.nonThinkingEnabled !== void 0 || body.thinkingExtraKwargs !== void 0 || body.nonThinkingExtraKwargs !== void 0;
|
|
6786
|
-
let result;
|
|
6787
|
-
if (hasFullSettings) {
|
|
6788
|
-
result = await providerManager.updateModelSettings(id, modelId, body);
|
|
6789
|
-
} else if (body.contextWindow) {
|
|
6790
|
-
result = await providerManager.updateModelContext(id, modelId, body.contextWindow);
|
|
6791
|
-
} else {
|
|
6792
|
-
return res.status(400).json({ error: "contextWindow or full settings required" });
|
|
6793
|
-
}
|
|
6794
|
-
if (!result.success) {
|
|
6795
|
-
return res.status(400).json({ error: result.error });
|
|
6796
|
-
}
|
|
6797
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-BU66P4KX.js");
|
|
6798
|
-
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6799
|
-
const updatedProviders = providerManager.getProviders();
|
|
6800
|
-
const updatedConfig = {
|
|
6801
|
-
...globalConfig,
|
|
6802
|
-
providers: updatedProviders,
|
|
6803
|
-
activeProviderId: providerManager.getActiveProviderId(),
|
|
6804
|
-
defaultModelSelection: providerManager.getActiveProviderId() ? `${providerManager.getActiveProviderId()}/${providerManager.getCurrentModel()}` : void 0
|
|
6805
|
-
};
|
|
6806
|
-
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
6807
|
-
let contextState = null;
|
|
6808
|
-
const sessions = sessionManager.listSessions();
|
|
6809
|
-
if (sessions.length > 0) {
|
|
6810
|
-
for (const session of sessions) {
|
|
6811
|
-
const sessionProviderId = session.providerId || providerManager.getActiveProviderId();
|
|
6812
|
-
if (sessionProviderId === id) {
|
|
6813
|
-
contextState = sessionManager.getContextState(session.id);
|
|
6814
|
-
break;
|
|
6815
|
-
}
|
|
6816
|
-
}
|
|
6817
|
-
}
|
|
6818
|
-
res.json({
|
|
6819
|
-
success: true,
|
|
6820
|
-
providerId: id,
|
|
6821
|
-
modelId,
|
|
6822
|
-
contextWindow: body.contextWindow,
|
|
6823
|
-
model: result.model,
|
|
6824
|
-
contextState
|
|
6825
|
-
});
|
|
6826
|
-
});
|
|
6827
6740
|
app.post("/api/providers/:id/refresh", async (req, res) => {
|
|
6828
6741
|
const { id } = req.params;
|
|
6829
6742
|
const result = await providerManager.refreshProviderModels(id);
|
|
@@ -7008,7 +6921,7 @@ async function createServerHandle(config4) {
|
|
|
7008
6921
|
providerManager
|
|
7009
6922
|
);
|
|
7010
6923
|
const wss = wssExports.wss;
|
|
7011
|
-
const { QueueProcessor } = await import("./processor-
|
|
6924
|
+
const { QueueProcessor } = await import("./processor-YXAPERVZ.js");
|
|
7012
6925
|
const queueProcessor = new QueueProcessor({
|
|
7013
6926
|
sessionManager,
|
|
7014
6927
|
providerManager,
|
|
@@ -7018,7 +6931,9 @@ async function createServerHandle(config4) {
|
|
|
7018
6931
|
});
|
|
7019
6932
|
queueProcessor.start();
|
|
7020
6933
|
const abortSession = (sessionId) => {
|
|
7021
|
-
const
|
|
6934
|
+
const wsAborted = wssExports.abortSession(sessionId);
|
|
6935
|
+
const qpAborted = queueProcessor.abortSession(sessionId);
|
|
6936
|
+
const aborted = wsAborted || qpAborted;
|
|
7022
6937
|
if (aborted) {
|
|
7023
6938
|
sessionManager.setRunning(sessionId, false);
|
|
7024
6939
|
wssExports.broadcastForSession(sessionId, { type: "session.running", payload: { isRunning: false } });
|
|
@@ -7080,4 +6995,4 @@ export {
|
|
|
7080
6995
|
createServerHandle,
|
|
7081
6996
|
createServer
|
|
7082
6997
|
};
|
|
7083
|
-
//# sourceMappingURL=chunk-
|
|
6998
|
+
//# sourceMappingURL=chunk-ZHK4XSLM.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCompactionTarget,
|
|
3
3
|
shouldCompact
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NZCKCJH5.js";
|
|
5
5
|
export {
|
|
6
6
|
getCompactionTarget,
|
|
7
7
|
shouldCompact
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=compactor-
|
|
9
|
+
//# sourceMappingURL=compactor-5VQNEYQX.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EventStore,
|
|
3
|
-
compactContext,
|
|
4
3
|
createEvent,
|
|
5
4
|
emitAssistantMessageStart,
|
|
6
5
|
emitChatDone,
|
|
@@ -39,7 +38,7 @@ import {
|
|
|
39
38
|
isStoredEvent,
|
|
40
39
|
isTurnEvent,
|
|
41
40
|
truncateSessionMessages
|
|
42
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-OP22QEB3.js";
|
|
43
42
|
import {
|
|
44
43
|
buildContextMessagesFromEventHistory,
|
|
45
44
|
buildContextMessagesFromMessages,
|
|
@@ -67,7 +66,6 @@ export {
|
|
|
67
66
|
buildMessagesFromStoredEvents,
|
|
68
67
|
buildSnapshot,
|
|
69
68
|
buildSnapshotFromSessionState,
|
|
70
|
-
compactContext,
|
|
71
69
|
createEvent,
|
|
72
70
|
emitAssistantMessageStart,
|
|
73
71
|
emitChatDone,
|
|
@@ -116,4 +114,4 @@ export {
|
|
|
116
114
|
isTurnEvent,
|
|
117
115
|
truncateSessionMessages
|
|
118
116
|
};
|
|
119
|
-
//# sourceMappingURL=events-
|
|
117
|
+
//# sourceMappingURL=events-4T6IO56V.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
injectWorkflowKickoffIfNeeded,
|
|
3
3
|
runAgentTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MSUES6A3.js";
|
|
6
6
|
import {
|
|
7
7
|
TurnMetrics,
|
|
8
8
|
createChatDoneEvent,
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
createMessageStartEvent,
|
|
11
11
|
createToolCallEvent,
|
|
12
12
|
createToolResultEvent
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FCFCBOWR.js";
|
|
14
14
|
import "./chunk-DL6ZILAF.js";
|
|
15
15
|
import "./chunk-PBGOZMVY.js";
|
|
16
16
|
import "./chunk-VRGRAQDG.js";
|
|
17
17
|
import "./chunk-XAMAYRDA.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-OP22QEB3.js";
|
|
19
19
|
import "./chunk-ITWVFGFV.js";
|
|
20
20
|
import "./chunk-7TTEGAO6.js";
|
|
21
21
|
import "./chunk-BJYPTN5S.js";
|
|
@@ -23,7 +23,7 @@ import "./chunk-RFNEDBVO.js";
|
|
|
23
23
|
import "./chunk-FBGWG4N6.js";
|
|
24
24
|
import "./chunk-BVHFMAVN.js";
|
|
25
25
|
import "./chunk-CQGTEGKL.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-Z4SWOUWC.js";
|
|
27
27
|
import "./chunk-K44MW7JJ.js";
|
|
28
28
|
export {
|
|
29
29
|
TurnMetrics,
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
runAgentTurn,
|
|
37
37
|
runChatTurn
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=orchestrator-
|
|
39
|
+
//# sourceMappingURL=orchestrator-KQROHCQ7.js.map
|
package/dist/package.json
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
generateSessionName,
|
|
6
6
|
getSessionMessageCount,
|
|
7
7
|
needsNameGenerationCheck
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PK7CBACL.js";
|
|
9
9
|
import {
|
|
10
10
|
getEventStore
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OP22QEB3.js";
|
|
12
12
|
import "./chunk-ITWVFGFV.js";
|
|
13
13
|
import {
|
|
14
14
|
createChatMessageMessage,
|
|
@@ -181,7 +181,7 @@ var QueueProcessor = class {
|
|
|
181
181
|
backend: provider?.backend ?? llmClient.getBackend(),
|
|
182
182
|
model: llmClient.getModel()
|
|
183
183
|
};
|
|
184
|
-
const { runChatTurn } = await import("./orchestrator-
|
|
184
|
+
const { runChatTurn } = await import("./orchestrator-KQROHCQ7.js");
|
|
185
185
|
const runChatTurnParams = buildRunChatTurnParams({
|
|
186
186
|
sessionManager,
|
|
187
187
|
sessionId,
|
|
@@ -225,4 +225,4 @@ var QueueProcessor = class {
|
|
|
225
225
|
export {
|
|
226
226
|
QueueProcessor
|
|
227
227
|
};
|
|
228
|
-
//# sourceMappingURL=processor-
|
|
228
|
+
//# sourceMappingURL=processor-YXAPERVZ.js.map
|
|
@@ -406,6 +406,8 @@ interface ModelConfig {
|
|
|
406
406
|
nonThinkingEnabled?: boolean;
|
|
407
407
|
thinkingExtraKwargs?: string;
|
|
408
408
|
nonThinkingExtraKwargs?: string;
|
|
409
|
+
thinkingQueryParams?: string;
|
|
410
|
+
nonThinkingQueryParams?: string;
|
|
409
411
|
defaultTemperature?: number;
|
|
410
412
|
defaultTopP?: number;
|
|
411
413
|
defaultTopK?: number;
|
|
@@ -10,8 +10,8 @@ import "./chunk-CQGTEGKL.js";
|
|
|
10
10
|
import {
|
|
11
11
|
detectModel,
|
|
12
12
|
fetchAvailableModelsFromBackend
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-A52FXWJX.js";
|
|
14
|
+
import "./chunk-Z4SWOUWC.js";
|
|
15
15
|
import "./chunk-K44MW7JJ.js";
|
|
16
16
|
|
|
17
17
|
// src/cli/provider.ts
|
|
@@ -380,4 +380,4 @@ export {
|
|
|
380
380
|
runProviderRemove,
|
|
381
381
|
runProviderUse
|
|
382
382
|
};
|
|
383
|
-
//# sourceMappingURL=provider-
|
|
383
|
+
//# sourceMappingURL=provider-QPECLUZ7.js.map
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
fetchAvailableModelsFromBackend,
|
|
4
4
|
fetchModelsWithContext,
|
|
5
5
|
parseDefaultModelSelection
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-A52FXWJX.js";
|
|
7
|
+
import "./chunk-Z4SWOUWC.js";
|
|
8
8
|
import "./chunk-K44MW7JJ.js";
|
|
9
9
|
export {
|
|
10
10
|
createProviderManager,
|
|
@@ -12,4 +12,4 @@ export {
|
|
|
12
12
|
fetchModelsWithContext,
|
|
13
13
|
parseDefaultModelSelection
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=provider-manager-
|
|
15
|
+
//# sourceMappingURL=provider-manager-YA2WALTF.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VERSION,
|
|
3
3
|
createServer
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ZHK4XSLM.js";
|
|
5
|
+
import "./chunk-NZCKCJH5.js";
|
|
6
|
+
import "./chunk-MSUES6A3.js";
|
|
7
|
+
import "./chunk-FCFCBOWR.js";
|
|
8
8
|
import "./chunk-DL6ZILAF.js";
|
|
9
9
|
import "./chunk-PBGOZMVY.js";
|
|
10
10
|
import "./chunk-VRGRAQDG.js";
|
|
11
11
|
import "./chunk-XAMAYRDA.js";
|
|
12
12
|
import {
|
|
13
13
|
loadConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OP22QEB3.js";
|
|
15
15
|
import "./chunk-ITWVFGFV.js";
|
|
16
16
|
import "./chunk-7TTEGAO6.js";
|
|
17
17
|
import "./chunk-BJYPTN5S.js";
|
|
@@ -29,8 +29,8 @@ import {
|
|
|
29
29
|
getDatabasePath,
|
|
30
30
|
getGlobalConfigPath
|
|
31
31
|
} from "./chunk-CQGTEGKL.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-A52FXWJX.js";
|
|
33
|
+
import "./chunk-Z4SWOUWC.js";
|
|
34
34
|
import {
|
|
35
35
|
logger
|
|
36
36
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -188,4 +188,4 @@ async function runServe(options) {
|
|
|
188
188
|
export {
|
|
189
189
|
runServe
|
|
190
190
|
};
|
|
191
|
-
//# sourceMappingURL=serve-
|
|
191
|
+
//# sourceMappingURL=serve-WHN52MAF.js.map
|