openfox 2.0.2 → 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-MWHH6UZB.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-72GTKFVG.js → chunk-ZHK4XSLM.js} +59 -147
- 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-DMWEPTU5.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-C7IF2YAa.js → index-Di3909TT.js} +68 -68
- 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,15 +6310,15 @@ 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");
|
|
6354
6315
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
6355
6316
|
sessionManager.clearMessageQueue(sessionId);
|
|
6356
6317
|
stopSessionExecution(sessionId, sessionManager);
|
|
6357
6318
|
abortSession(sessionId);
|
|
6358
6319
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
6359
6320
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
6360
|
-
const eventStore = (await import("./events-
|
|
6321
|
+
const eventStore = (await import("./events-4T6IO56V.js")).getEventStore();
|
|
6361
6322
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
6362
6323
|
res.json({ success: true, queuedMessages });
|
|
6363
6324
|
});
|
|
@@ -6371,7 +6332,7 @@ async function createServerHandle(config4) {
|
|
|
6371
6332
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
6372
6333
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
6373
6334
|
}
|
|
6374
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6335
|
+
const { truncateSessionMessages } = await import("./events-4T6IO56V.js");
|
|
6375
6336
|
truncateSessionMessages(sessionId, messageIndex);
|
|
6376
6337
|
res.json({ success: true });
|
|
6377
6338
|
});
|
|
@@ -6389,7 +6350,7 @@ async function createServerHandle(config4) {
|
|
|
6389
6350
|
if (!msg) {
|
|
6390
6351
|
return res.status(400).json({ error: "Message not found at this index" });
|
|
6391
6352
|
}
|
|
6392
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6353
|
+
const { truncateSessionMessages } = await import("./events-4T6IO56V.js");
|
|
6393
6354
|
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
6394
6355
|
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
6395
6356
|
res.json({ success: true });
|
|
@@ -6513,6 +6474,25 @@ async function createServerHandle(config4) {
|
|
|
6513
6474
|
backend: llmClient.getBackend()
|
|
6514
6475
|
});
|
|
6515
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
|
+
}
|
|
6516
6496
|
app.post("/api/providers/test", async (req, res) => {
|
|
6517
6497
|
const { url, backend: reqBackend } = req.body;
|
|
6518
6498
|
if (!url) {
|
|
@@ -6537,7 +6517,7 @@ async function createServerHandle(config4) {
|
|
|
6537
6517
|
const url = req.query["url"];
|
|
6538
6518
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6539
6519
|
try {
|
|
6540
|
-
const { fetchModelsWithContext } = await import("./provider-manager-
|
|
6520
|
+
const { fetchModelsWithContext } = await import("./provider-manager-YA2WALTF.js");
|
|
6541
6521
|
const models = await fetchModelsWithContext(url);
|
|
6542
6522
|
if (models.length === 0) {
|
|
6543
6523
|
return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
|
|
@@ -6561,17 +6541,19 @@ async function createServerHandle(config4) {
|
|
|
6561
6541
|
}
|
|
6562
6542
|
});
|
|
6563
6543
|
app.post("/api/providers/test-params", async (req, res) => {
|
|
6564
|
-
const { url, model, params, apiKey } = req.body;
|
|
6544
|
+
const { url, model, params, apiKey, queryParams } = req.body;
|
|
6565
6545
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6566
6546
|
if (!model) return res.status(400).json({ error: "model is required" });
|
|
6567
6547
|
try {
|
|
6568
6548
|
const headers = { "Content-Type": "application/json" };
|
|
6569
6549
|
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
|
6550
|
+
const hasQueryParams = queryParams && Object.keys(queryParams).length > 0;
|
|
6570
6551
|
const body = {
|
|
6571
6552
|
model,
|
|
6572
6553
|
messages: [{ role: "user", content: "say hi in one word" }],
|
|
6573
6554
|
max_tokens: 8e3,
|
|
6574
|
-
...params
|
|
6555
|
+
...hasQueryParams ? {} : params,
|
|
6556
|
+
...hasQueryParams ? queryParams : {}
|
|
6575
6557
|
};
|
|
6576
6558
|
const response = await fetch(`${ensureVersionPrefix(url)}/chat/completions`, {
|
|
6577
6559
|
method: "POST",
|
|
@@ -6581,7 +6563,7 @@ async function createServerHandle(config4) {
|
|
|
6581
6563
|
});
|
|
6582
6564
|
if (!response.ok) {
|
|
6583
6565
|
const errorBody = await response.text();
|
|
6584
|
-
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)}` });
|
|
6585
6567
|
}
|
|
6586
6568
|
const data = await response.json();
|
|
6587
6569
|
const message = data.choices?.[0]?.message ?? {};
|
|
@@ -6615,17 +6597,7 @@ async function createServerHandle(config4) {
|
|
|
6615
6597
|
apiKey,
|
|
6616
6598
|
...isLocal !== void 0 ? { isLocal } : {},
|
|
6617
6599
|
...thinkingField ? { thinkingField } : {},
|
|
6618
|
-
models: modelConfigs?.length ? modelConfigs
|
|
6619
|
-
id: m.id,
|
|
6620
|
-
contextWindow: m.contextWindow,
|
|
6621
|
-
source: "user",
|
|
6622
|
-
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6623
|
-
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6624
|
-
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6625
|
-
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {},
|
|
6626
|
-
...m.thinkingExtraKwargs ? { thinkingExtraKwargs: m.thinkingExtraKwargs } : {},
|
|
6627
|
-
...m.nonThinkingExtraKwargs ? { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs } : {}
|
|
6628
|
-
})) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [],
|
|
6600
|
+
models: modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [],
|
|
6629
6601
|
isActive: true
|
|
6630
6602
|
});
|
|
6631
6603
|
const finalConfig = setDefaultModelSelection(
|
|
@@ -6731,17 +6703,7 @@ async function createServerHandle(config4) {
|
|
|
6731
6703
|
if (isLocal !== void 0) updates["isLocal"] = isLocal;
|
|
6732
6704
|
if (thinkingField !== void 0) updates["thinkingField"] = thinkingField || void 0;
|
|
6733
6705
|
if (modelConfigs !== void 0) {
|
|
6734
|
-
updates["models"] = modelConfigs
|
|
6735
|
-
id: m.id,
|
|
6736
|
-
contextWindow: m.contextWindow,
|
|
6737
|
-
source: "user",
|
|
6738
|
-
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6739
|
-
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6740
|
-
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6741
|
-
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {},
|
|
6742
|
-
...m.thinkingExtraKwargs ? { thinkingExtraKwargs: m.thinkingExtraKwargs } : {},
|
|
6743
|
-
...m.nonThinkingExtraKwargs ? { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs } : {}
|
|
6744
|
-
}));
|
|
6706
|
+
updates["models"] = buildModelConfigs(modelConfigs);
|
|
6745
6707
|
}
|
|
6746
6708
|
const updatedConfig = updateProvider(globalConfig, id, updates);
|
|
6747
6709
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6775,56 +6737,6 @@ async function createServerHandle(config4) {
|
|
|
6775
6737
|
backend: llmClient.getBackend()
|
|
6776
6738
|
});
|
|
6777
6739
|
});
|
|
6778
|
-
app.post("/api/providers/:id/models/:modelId", async (req, res) => {
|
|
6779
|
-
const { id, modelId } = req.params;
|
|
6780
|
-
const body = req.body;
|
|
6781
|
-
logger.info("API: POST /api/providers/:id/models/:modelId", {
|
|
6782
|
-
providerId: id,
|
|
6783
|
-
modelId,
|
|
6784
|
-
body
|
|
6785
|
-
});
|
|
6786
|
-
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;
|
|
6787
|
-
let result;
|
|
6788
|
-
if (hasFullSettings) {
|
|
6789
|
-
result = await providerManager.updateModelSettings(id, modelId, body);
|
|
6790
|
-
} else if (body.contextWindow) {
|
|
6791
|
-
result = await providerManager.updateModelContext(id, modelId, body.contextWindow);
|
|
6792
|
-
} else {
|
|
6793
|
-
return res.status(400).json({ error: "contextWindow or full settings required" });
|
|
6794
|
-
}
|
|
6795
|
-
if (!result.success) {
|
|
6796
|
-
return res.status(400).json({ error: result.error });
|
|
6797
|
-
}
|
|
6798
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-BU66P4KX.js");
|
|
6799
|
-
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6800
|
-
const updatedProviders = providerManager.getProviders();
|
|
6801
|
-
const updatedConfig = {
|
|
6802
|
-
...globalConfig,
|
|
6803
|
-
providers: updatedProviders,
|
|
6804
|
-
activeProviderId: providerManager.getActiveProviderId(),
|
|
6805
|
-
defaultModelSelection: providerManager.getActiveProviderId() ? `${providerManager.getActiveProviderId()}/${providerManager.getCurrentModel()}` : void 0
|
|
6806
|
-
};
|
|
6807
|
-
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
6808
|
-
let contextState = null;
|
|
6809
|
-
const sessions = sessionManager.listSessions();
|
|
6810
|
-
if (sessions.length > 0) {
|
|
6811
|
-
for (const session of sessions) {
|
|
6812
|
-
const sessionProviderId = session.providerId || providerManager.getActiveProviderId();
|
|
6813
|
-
if (sessionProviderId === id) {
|
|
6814
|
-
contextState = sessionManager.getContextState(session.id);
|
|
6815
|
-
break;
|
|
6816
|
-
}
|
|
6817
|
-
}
|
|
6818
|
-
}
|
|
6819
|
-
res.json({
|
|
6820
|
-
success: true,
|
|
6821
|
-
providerId: id,
|
|
6822
|
-
modelId,
|
|
6823
|
-
contextWindow: body.contextWindow,
|
|
6824
|
-
model: result.model,
|
|
6825
|
-
contextState
|
|
6826
|
-
});
|
|
6827
|
-
});
|
|
6828
6740
|
app.post("/api/providers/:id/refresh", async (req, res) => {
|
|
6829
6741
|
const { id } = req.params;
|
|
6830
6742
|
const result = await providerManager.refreshProviderModels(id);
|
|
@@ -7009,7 +6921,7 @@ async function createServerHandle(config4) {
|
|
|
7009
6921
|
providerManager
|
|
7010
6922
|
);
|
|
7011
6923
|
const wss = wssExports.wss;
|
|
7012
|
-
const { QueueProcessor } = await import("./processor-
|
|
6924
|
+
const { QueueProcessor } = await import("./processor-YXAPERVZ.js");
|
|
7013
6925
|
const queueProcessor = new QueueProcessor({
|
|
7014
6926
|
sessionManager,
|
|
7015
6927
|
providerManager,
|
|
@@ -7083,4 +6995,4 @@ export {
|
|
|
7083
6995
|
createServerHandle,
|
|
7084
6996
|
createServer
|
|
7085
6997
|
};
|
|
7086
|
-
//# 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
|