openfox 2.0.120 → 2.0.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/CHANGELOG.md +31 -0
- package/dist/agent-defaults/code-reviewer.agent.md +3 -8
- package/dist/{chat-handler-TIR5CMWE.js → chat-handler-JQUVSZT3.js} +27 -28
- package/dist/{chunk-PI4X3Y6H.js → chunk-22D7ZR2X.js} +51 -46
- package/dist/{chunk-LNNBLB6G.js → chunk-2N7KFNMY.js} +3 -3
- package/dist/{chunk-XZGQZ42D.js → chunk-5A4YN6I7.js} +5 -5
- package/dist/{chunk-IQFPRQWM.js → chunk-62GUO2EG.js} +5 -3
- package/dist/{chunk-A5JAVQKG.js → chunk-6A2VIV36.js} +4 -4
- package/dist/{chunk-VUQCQXXJ.js → chunk-7OHXF5GW.js} +6 -3
- package/dist/{chunk-IW46BUOP.js → chunk-AIXVERRI.js} +6 -6
- package/dist/{chunk-3PG65AXG.js → chunk-DIALH34K.js} +2 -2
- package/dist/{chunk-AESOGRFK.js → chunk-EZ67GBEO.js} +2 -2
- package/dist/{chunk-HD6Y77RO.js → chunk-FGVMRFDW.js} +2 -2
- package/dist/{chunk-ZTOG6LJD.js → chunk-I22B6KWV.js} +3 -3
- package/dist/{chunk-JOCR4CF4.js → chunk-J3IJJ55E.js} +5 -5
- package/dist/{chunk-KFQKBXLO.js → chunk-J77SLE3M.js} +2 -2
- package/dist/{chunk-HWHWXLM5.js → chunk-KDC4QHE7.js} +17 -17
- package/dist/{chunk-2FCLCUVR.js → chunk-LSEHJ2WI.js} +3 -3
- package/dist/{chunk-3KBRMBTP.js → chunk-LWXLNE6M.js} +2 -2
- package/dist/{chunk-5PT4UMRR.js → chunk-NYQKSKDB.js} +9 -1
- package/dist/{chunk-M6X6AIEG.js → chunk-OXANSWVZ.js} +2 -2
- package/dist/{chunk-LTYL6ZGH.js → chunk-POTCPZJF.js} +2 -2
- package/dist/{chunk-O6DU226D.js → chunk-RMOKNQAS.js} +2 -2
- package/dist/{chunk-JDWJ2PJJ.js → chunk-SCP5KBNB.js} +122 -48
- package/dist/{chunk-KLQEL2DZ.js → chunk-SLW3KKPP.js} +26 -8
- package/dist/{chunk-AS7KAH66.js → chunk-STYGFTEB.js} +6 -5
- package/dist/{chunk-WN76RDRU.js → chunk-UJRWYZHM.js} +8 -2
- package/dist/{chunk-JDBIR2J7.js → chunk-UOEAKQBH.js} +16 -16
- package/dist/chunk-VC3YCHDO.js +7 -0
- package/dist/{chunk-54FTLSWS.js → chunk-WIZUASFY.js} +205 -184
- package/dist/{chunk-27NABDXB.js → chunk-Y7FGHKBW.js} +2 -2
- package/dist/{chunk-EQ5CGNOT.js → chunk-YBOU4ZFD.js} +3 -3
- package/dist/{chunk-USNG72WA.js → chunk-YDDBPKVP.js} +21 -16
- package/dist/{chunk-CYXAMXN5.js → chunk-ZT7YTM2U.js} +4 -4
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-GXRHODRQ.js → client-JKPDMJ7S.js} +5 -5
- package/dist/{compactor-TI352G7B.js → compactor-MKD3CAFM.js} +12 -12
- package/dist/{dynamic-context-C6HGUQTR.js → dynamic-context-IWFD7U3D.js} +9 -9
- package/dist/{events-KDFMBVP5.js → events-6P4TDTSD.js} +8 -8
- package/dist/{folding-RTGU63BW.js → folding-3LA2WX2B.js} +6 -6
- package/dist/http-client-IKOARXI7.js +11 -0
- package/dist/{inspect-proxy-WPEDMCG7.js → inspect-proxy-IDLUAQH5.js} +4 -4
- package/dist/launch-FOUIDMGW.js +52 -0
- package/dist/{manager-EMLSLMMT.js → manager-NFKTUR64.js} +5 -5
- package/dist/{orchestrator-SCH2T4JB.js → orchestrator-PEXLQK3T.js} +30 -31
- package/dist/package.json +1 -1
- package/dist/{path-security-L4AJJN2V.js → path-security-JUF56IB6.js} +10 -10
- package/dist/{platform-ECDDYMAR.js → platform-FM57ZJHA.js} +4 -4
- package/dist/{processor-GM4D26E6.js → processor-2GEVRLJP.js} +39 -40
- package/dist/{project-creator-PMQ65NKN.js → project-creator-J4ITWDZI.js} +3 -3
- package/dist/{projects-NDPNOV6D.js → projects-FHRTSV6N.js} +3 -3
- package/dist/{protocol-D5kJLGWy.d.ts → protocol-BLin669D.d.ts} +1 -1
- package/dist/provider/index.d.ts +4 -4
- package/dist/{provider-5V6RDVU2.js → provider-TAFJCWVP.js} +6 -6
- package/dist/{provider-manager-7QD5HAOL.js → provider-manager-EDJN6ARI.js} +6 -6
- package/dist/{registry-5QL3BOWN.js → registry-37GL3DAP.js} +5 -5
- package/dist/{serve-M7I3HWVQ.js → serve-3BPQGWYE.js} +31 -32
- package/dist/server/index.d.ts +31 -14
- package/dist/server/index.js +30 -31
- package/dist/server-HPIR55OH.js +55 -0
- package/dist/{service-A3YLLXW3.js → service-2IOCVEXQ.js} +8 -8
- package/dist/{session-overrides-CWBKPHMF.js → session-overrides-EOKSZO2X.js} +7 -7
- package/dist/{sessions-I7ELDIIP.js → sessions-XFNU4DZ6.js} +8 -6
- package/dist/{settings-FGXQHKUH.js → settings-SYYDPV43.js} +3 -3
- package/dist/shared/index.d.ts +6 -5
- package/dist/shared/index.js +1 -1
- package/dist/{tasks-X5U7DWZR.js → tasks-G7ACMQM2.js} +8 -8
- package/dist/{tools-GCBDO7TU.js → tools-IKMNLLAY.js} +22 -23
- package/dist/{types-B5CI_Ql3.d.ts → types-B5_9KtfJ.d.ts} +1 -1
- package/dist/{types-CZlj7ufS.d.ts → types-DeQIEC1U.d.ts} +2 -0
- package/dist/{update-TUGN3JJE.js → update-QX6IIUKB.js} +2 -2
- package/dist/web/assets/index-CJuw9bwD.js +324 -0
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/dist/workflow-defaults/default.workflow.json +3 -3
- package/dist/{workspace-IQLLHMYR.js → workspace-ZNZFEONU.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-JLAR2CMV.js +0 -72
- package/dist/chunk-PXEWE5YP.js +0 -7
- package/dist/http-client-IPUW2MSW.js +0 -11
- package/dist/launch-SRSMTDEM.js +0 -53
- package/dist/model-overrides-7F2EOA4U.js +0 -21
- package/dist/server-F72WN4KP.js +0 -56
- package/dist/web/assets/index-BlYcAqzD.js +0 -324
|
@@ -1,45 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildCachedPrompt,
|
|
3
|
+
computeDynamicContextHash,
|
|
4
|
+
getToolFingerprint
|
|
5
|
+
} from "./chunk-AIXVERRI.js";
|
|
1
6
|
import {
|
|
2
7
|
createAssemblyResult,
|
|
3
8
|
getConversationMessages,
|
|
4
9
|
getToolRegistryForAgent,
|
|
5
10
|
processEventsForConversation,
|
|
6
11
|
runTopLevelAgentLoop
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
buildCachedPrompt,
|
|
10
|
-
computeDynamicContextHash,
|
|
11
|
-
getToolFingerprint
|
|
12
|
-
} from "./chunk-IW46BUOP.js";
|
|
12
|
+
} from "./chunk-SCP5KBNB.js";
|
|
13
13
|
import {
|
|
14
14
|
getAllInstructions,
|
|
15
15
|
getEnabledSkillMetadata
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LSEHJ2WI.js";
|
|
17
|
+
import {
|
|
18
|
+
PathAccessDeniedError
|
|
19
|
+
} from "./chunk-5A4YN6I7.js";
|
|
17
20
|
import {
|
|
18
21
|
TurnMetrics,
|
|
19
22
|
createChatDoneEvent,
|
|
20
23
|
createMessageStartEvent
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-62GUO2EG.js";
|
|
22
25
|
import {
|
|
23
26
|
buildAgentReminder,
|
|
24
27
|
buildAgentSmallReminder
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import {
|
|
27
|
-
PathAccessDeniedError
|
|
28
|
-
} from "./chunk-XZGQZ42D.js";
|
|
28
|
+
} from "./chunk-Y7FGHKBW.js";
|
|
29
29
|
import {
|
|
30
30
|
getCurrentContextWindowId,
|
|
31
31
|
getCurrentWindowMessageOptions,
|
|
32
32
|
getEventStore
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-J3IJJ55E.js";
|
|
34
34
|
import {
|
|
35
35
|
buildSnapshotFromSessionState
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-LWXLNE6M.js";
|
|
37
37
|
import {
|
|
38
38
|
findAgentById,
|
|
39
39
|
getRuntimeConfig,
|
|
40
40
|
loadAllAgentsDefault,
|
|
41
41
|
resolveDefaultAgentId
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-2N7KFNMY.js";
|
|
43
43
|
import {
|
|
44
44
|
logger
|
|
45
45
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
|
|
50
50
|
// src/server/chat/orchestrator.ts
|
|
51
51
|
async function buildRetryPatterns() {
|
|
52
|
-
const { getSetting, SETTINGS_KEYS } = await import("./settings-
|
|
52
|
+
const { getSetting, SETTINGS_KEYS } = await import("./settings-SYYDPV43.js");
|
|
53
53
|
const raw = getSetting(SETTINGS_KEYS.RETRY_PATTERNS);
|
|
54
54
|
if (!raw) {
|
|
55
55
|
const oldXmlProtection = getSetting("llm.disableXmlProtection");
|
|
@@ -325,4 +325,4 @@ export {
|
|
|
325
325
|
runChatTurn,
|
|
326
326
|
runAgentTurn
|
|
327
327
|
};
|
|
328
|
-
//# sourceMappingURL=chunk-
|
|
328
|
+
//# sourceMappingURL=chunk-KDC4QHE7.js.map
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "./chunk-OSXPQSLW.js";
|
|
6
6
|
import {
|
|
7
7
|
getProject
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DIALH34K.js";
|
|
9
9
|
import {
|
|
10
10
|
SETTINGS_KEYS,
|
|
11
11
|
deleteSetting,
|
|
12
12
|
getSetting,
|
|
13
13
|
setSetting
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FGVMRFDW.js";
|
|
15
15
|
|
|
16
16
|
// src/server/context/instructions.ts
|
|
17
17
|
import { readFile, access } from "fs/promises";
|
|
@@ -440,4 +440,4 @@ export {
|
|
|
440
440
|
deleteSkill,
|
|
441
441
|
deleteProjectSkill
|
|
442
442
|
};
|
|
443
|
-
//# sourceMappingURL=chunk-
|
|
443
|
+
//# sourceMappingURL=chunk-LSEHJ2WI.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-LCLH6ZUL.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveDefaultAgentId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2N7KFNMY.js";
|
|
7
7
|
|
|
8
8
|
// src/server/events/apply-events.ts
|
|
9
9
|
function markComplete(msg, reason) {
|
|
@@ -965,4 +965,4 @@ export {
|
|
|
965
965
|
buildSnapshot,
|
|
966
966
|
buildSnapshotFromSessionState
|
|
967
967
|
};
|
|
968
|
-
//# sourceMappingURL=chunk-
|
|
968
|
+
//# sourceMappingURL=chunk-LWXLNE6M.js.map
|
|
@@ -156,6 +156,14 @@ function runMigrations(db2) {
|
|
|
156
156
|
logger.info("Migrating sessions table: adding provider_model column");
|
|
157
157
|
db2.exec(`ALTER TABLE sessions ADD COLUMN provider_model TEXT`);
|
|
158
158
|
}
|
|
159
|
+
if (!columnNames.includes("provider_manual")) {
|
|
160
|
+
logger.info("Migrating sessions table: adding provider_manual column");
|
|
161
|
+
db2.exec(`ALTER TABLE sessions ADD COLUMN provider_manual INTEGER NOT NULL DEFAULT 0`);
|
|
162
|
+
}
|
|
163
|
+
if (!columnNames.includes("provider_manual_active")) {
|
|
164
|
+
logger.info("Migrating sessions table: adding provider_manual_active column");
|
|
165
|
+
db2.exec(`ALTER TABLE sessions ADD COLUMN provider_manual_active INTEGER NOT NULL DEFAULT 1`);
|
|
166
|
+
}
|
|
159
167
|
if (!columnNames.includes("message_count")) {
|
|
160
168
|
logger.info("Migrating sessions table: adding message_count column");
|
|
161
169
|
db2.exec(`ALTER TABLE sessions ADD COLUMN message_count INTEGER NOT NULL DEFAULT 0`);
|
|
@@ -324,4 +332,4 @@ export {
|
|
|
324
332
|
initDatabase,
|
|
325
333
|
getDatabase
|
|
326
334
|
};
|
|
327
|
-
//# sourceMappingURL=chunk-
|
|
335
|
+
//# sourceMappingURL=chunk-NYQKSKDB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getProjectByWorkdir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DIALH34K.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
6
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -345,4 +345,4 @@ export {
|
|
|
345
345
|
startInspectProxy,
|
|
346
346
|
stopAllInspectProxies
|
|
347
347
|
};
|
|
348
|
-
//# sourceMappingURL=chunk-
|
|
348
|
+
//# sourceMappingURL=chunk-OXANSWVZ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETTINGS_KEYS,
|
|
3
3
|
getSetting
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FGVMRFDW.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
7
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -164,4 +164,4 @@ export {
|
|
|
164
164
|
WorkspaceInUseError,
|
|
165
165
|
OpenAIHttpClient
|
|
166
166
|
};
|
|
167
|
-
//# sourceMappingURL=chunk-
|
|
167
|
+
//# sourceMappingURL=chunk-POTCPZJF.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getProjectByWorkdir,
|
|
6
6
|
updateProject
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DIALH34K.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
10
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -333,4 +333,4 @@ export {
|
|
|
333
333
|
deleteWorkspace,
|
|
334
334
|
isGitRepository
|
|
335
335
|
};
|
|
336
|
-
//# sourceMappingURL=chunk-
|
|
336
|
+
//# sourceMappingURL=chunk-RMOKNQAS.js.map
|
|
@@ -4,29 +4,10 @@ import {
|
|
|
4
4
|
getEnabledSkillMetadata,
|
|
5
5
|
isSkillEnabled,
|
|
6
6
|
loadAllSkills
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
TurnMetrics,
|
|
10
|
-
clearLLMFailure,
|
|
11
|
-
consumeStreamGenerator,
|
|
12
|
-
createChatDoneEvent,
|
|
13
|
-
createMessageDoneEvent,
|
|
14
|
-
createMessageStartEvent,
|
|
15
|
-
createToolCallEvent,
|
|
16
|
-
createToolResultEvent,
|
|
17
|
-
evaluateLLMRetry,
|
|
18
|
-
recordLLMFailure,
|
|
19
|
-
sleepThroughRetryBackoff,
|
|
20
|
-
streamLLMPure
|
|
21
|
-
} from "./chunk-IQFPRQWM.js";
|
|
22
|
-
import {
|
|
23
|
-
COMPACTION_PROMPT,
|
|
24
|
-
buildBasePrompt,
|
|
25
|
-
computeEffectiveTools
|
|
26
|
-
} from "./chunk-27NABDXB.js";
|
|
7
|
+
} from "./chunk-LSEHJ2WI.js";
|
|
27
8
|
import {
|
|
28
9
|
startInspectProxy
|
|
29
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OXANSWVZ.js";
|
|
30
11
|
import {
|
|
31
12
|
checkAborted,
|
|
32
13
|
createProcess,
|
|
@@ -40,7 +21,7 @@ import {
|
|
|
40
21
|
spawnShellProcess,
|
|
41
22
|
startProcessCommand,
|
|
42
23
|
stopProcess
|
|
43
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-I22B6KWV.js";
|
|
44
25
|
import {
|
|
45
26
|
getMaxPerSession,
|
|
46
27
|
getSessionProcessCount,
|
|
@@ -56,27 +37,22 @@ import {
|
|
|
56
37
|
getGitBranch,
|
|
57
38
|
isGitRepository,
|
|
58
39
|
listWorkspaces
|
|
59
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-RMOKNQAS.js";
|
|
60
41
|
import {
|
|
61
42
|
getGateConfig,
|
|
62
43
|
isTaskConflictError,
|
|
63
44
|
isTaskGateError
|
|
64
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-STYGFTEB.js";
|
|
65
46
|
import {
|
|
66
47
|
getSessionDisabledServers
|
|
67
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-YBOU4ZFD.js";
|
|
68
49
|
import {
|
|
69
50
|
PathAccessDeniedError,
|
|
70
51
|
extractAbsolutePathsFromCommand,
|
|
71
52
|
extractSensitivePathsFromCommand,
|
|
72
53
|
registerPathConfirmation,
|
|
73
54
|
requestPathAccess
|
|
74
|
-
} from "./chunk-
|
|
75
|
-
import {
|
|
76
|
-
getCurrentContextWindowId,
|
|
77
|
-
getCurrentWindowMessageOptions,
|
|
78
|
-
getEventStore
|
|
79
|
-
} from "./chunk-JOCR4CF4.js";
|
|
55
|
+
} from "./chunk-5A4YN6I7.js";
|
|
80
56
|
import {
|
|
81
57
|
createChatDoneMessage,
|
|
82
58
|
createChatLLMRetryFailedMessage,
|
|
@@ -91,8 +67,29 @@ import {
|
|
|
91
67
|
askUserTool
|
|
92
68
|
} from "./chunk-JURM3RPZ.js";
|
|
93
69
|
import {
|
|
94
|
-
|
|
95
|
-
|
|
70
|
+
TurnMetrics,
|
|
71
|
+
clearLLMFailure,
|
|
72
|
+
consumeStreamGenerator,
|
|
73
|
+
createChatDoneEvent,
|
|
74
|
+
createMessageDoneEvent,
|
|
75
|
+
createMessageStartEvent,
|
|
76
|
+
createToolCallEvent,
|
|
77
|
+
createToolResultEvent,
|
|
78
|
+
evaluateLLMRetry,
|
|
79
|
+
recordLLMFailure,
|
|
80
|
+
sleepThroughRetryBackoff,
|
|
81
|
+
streamLLMPure
|
|
82
|
+
} from "./chunk-62GUO2EG.js";
|
|
83
|
+
import {
|
|
84
|
+
COMPACTION_PROMPT,
|
|
85
|
+
buildBasePrompt,
|
|
86
|
+
computeEffectiveTools
|
|
87
|
+
} from "./chunk-Y7FGHKBW.js";
|
|
88
|
+
import {
|
|
89
|
+
getCurrentContextWindowId,
|
|
90
|
+
getCurrentWindowMessageOptions,
|
|
91
|
+
getEventStore
|
|
92
|
+
} from "./chunk-J3IJJ55E.js";
|
|
96
93
|
import {
|
|
97
94
|
buildContextMessagesFromEventHistory,
|
|
98
95
|
foldContextState,
|
|
@@ -102,13 +99,13 @@ import {
|
|
|
102
99
|
handleToolResult,
|
|
103
100
|
reorderToolMessages,
|
|
104
101
|
stripOrphanedToolCalls
|
|
105
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-LWXLNE6M.js";
|
|
106
103
|
import {
|
|
107
104
|
findAgentById,
|
|
108
105
|
getRuntimeConfig,
|
|
109
106
|
getSubAgents,
|
|
110
107
|
loadAllAgentsDefault
|
|
111
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-2N7KFNMY.js";
|
|
112
109
|
import {
|
|
113
110
|
modelSupportsVision
|
|
114
111
|
} from "./chunk-GJL3QSMP.js";
|
|
@@ -125,8 +122,9 @@ import {
|
|
|
125
122
|
} from "./chunk-MIPQOHWS.js";
|
|
126
123
|
import {
|
|
127
124
|
SETTINGS_KEYS,
|
|
128
|
-
getSetting
|
|
129
|
-
|
|
125
|
+
getSetting,
|
|
126
|
+
setSetting
|
|
127
|
+
} from "./chunk-FGVMRFDW.js";
|
|
130
128
|
import {
|
|
131
129
|
logger
|
|
132
130
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -150,7 +148,7 @@ async function requestUserConfirmation(context, toolLabel, desc) {
|
|
|
150
148
|
if (context.dangerLevel === "dangerous") return Promise.resolve(true);
|
|
151
149
|
if (toolLabel === "workspace" || toolLabel === "command") {
|
|
152
150
|
try {
|
|
153
|
-
const { getSetting: getSetting2, SETTINGS_KEYS: SETTINGS_KEYS2 } = await import("./settings-
|
|
151
|
+
const { getSetting: getSetting2, SETTINGS_KEYS: SETTINGS_KEYS2 } = await import("./settings-SYYDPV43.js");
|
|
154
152
|
if (getSetting2(SETTINGS_KEYS2.CONFIRM_ON_WORKSPACE_ACTIONS) !== "true") {
|
|
155
153
|
return Promise.resolve(true);
|
|
156
154
|
}
|
|
@@ -1528,6 +1526,63 @@ ${Object.entries(schema.fields).map(([f, t]) => ` ${f}: ${t}`).join("\n")}`
|
|
|
1528
1526
|
import { readFile as readFile4, access as access2 } from "fs/promises";
|
|
1529
1527
|
import { join as join2, dirname as dirname2, isAbsolute as isAbsolute2 } from "path";
|
|
1530
1528
|
|
|
1529
|
+
// src/server/agents/model-overrides.ts
|
|
1530
|
+
import { z } from "zod";
|
|
1531
|
+
var AGENT_MODEL_OVERRIDES_KEY = SETTINGS_KEYS.AGENT_MODEL_OVERRIDES;
|
|
1532
|
+
var overrideSchema = z.object({
|
|
1533
|
+
providerId: z.string().min(1),
|
|
1534
|
+
model: z.string().min(1)
|
|
1535
|
+
});
|
|
1536
|
+
function parseAgentModelOverrides(raw) {
|
|
1537
|
+
if (!raw) return {};
|
|
1538
|
+
let parsed;
|
|
1539
|
+
try {
|
|
1540
|
+
parsed = JSON.parse(raw);
|
|
1541
|
+
} catch {
|
|
1542
|
+
return {};
|
|
1543
|
+
}
|
|
1544
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return {};
|
|
1545
|
+
const result = {};
|
|
1546
|
+
for (const [agentId, value] of Object.entries(parsed)) {
|
|
1547
|
+
const validated = overrideSchema.safeParse(value);
|
|
1548
|
+
if (validated.success) {
|
|
1549
|
+
result[agentId] = validated.data;
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
return result;
|
|
1553
|
+
}
|
|
1554
|
+
function getAgentModelOverrides() {
|
|
1555
|
+
return parseAgentModelOverrides(getSetting(AGENT_MODEL_OVERRIDES_KEY));
|
|
1556
|
+
}
|
|
1557
|
+
function getAgentModelOverride(agentId) {
|
|
1558
|
+
return getAgentModelOverrides()[agentId];
|
|
1559
|
+
}
|
|
1560
|
+
function setAgentModelOverride(agentId, override) {
|
|
1561
|
+
const overrides = getAgentModelOverrides();
|
|
1562
|
+
if (override === null) {
|
|
1563
|
+
delete overrides[agentId];
|
|
1564
|
+
} else {
|
|
1565
|
+
overrides[agentId] = override;
|
|
1566
|
+
}
|
|
1567
|
+
setSetting(AGENT_MODEL_OVERRIDES_KEY, JSON.stringify(overrides));
|
|
1568
|
+
}
|
|
1569
|
+
function resolveLLMClientForAgent(agentId, fallbackClient, providerManager) {
|
|
1570
|
+
const override = getAgentModelOverride(agentId);
|
|
1571
|
+
if (!override) {
|
|
1572
|
+
return { client: fallbackClient, usedOverride: false };
|
|
1573
|
+
}
|
|
1574
|
+
const client = providerManager.createClient(override.providerId, override.model);
|
|
1575
|
+
if (!client) {
|
|
1576
|
+
return {
|
|
1577
|
+
client: fallbackClient,
|
|
1578
|
+
usedOverride: false,
|
|
1579
|
+
override,
|
|
1580
|
+
warning: `Agent '${agentId}' is configured to use model '${override.model}' from provider '${override.providerId}', but it is no longer available. Falling back to the session model.`
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
return { client, usedOverride: true, override };
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1531
1586
|
// src/server/chat/tool-streaming.ts
|
|
1532
1587
|
function parseProgressMessage(message) {
|
|
1533
1588
|
const match = message.match(/^\[(stdout|stderr)\] (.*)$/s);
|
|
@@ -1839,7 +1894,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
|
|
|
1839
1894
|
...instructionContent2 ? { customInstructions: instructionContent2 } : {},
|
|
1840
1895
|
...skills.length > 0 ? { skills } : {}
|
|
1841
1896
|
});
|
|
1842
|
-
const modelSettings = sessionManager.getCurrentModelSettings(sessionId);
|
|
1897
|
+
const modelSettings = sessionManager.getCurrentModelSettings(sessionId, config.mode);
|
|
1843
1898
|
await resolveClient().complete({
|
|
1844
1899
|
messages: [{ role: "system", content: assembledRequest.systemPrompt }],
|
|
1845
1900
|
tools: assembledRequest.tools,
|
|
@@ -1916,9 +1971,9 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
1916
1971
|
};
|
|
1917
1972
|
const contextState = sessionManager.getContextState(sessionId);
|
|
1918
1973
|
previousContextTokens = contextState.currentTokens;
|
|
1919
|
-
const contextWindow = sessionManager.getCurrentModelContext(sessionId);
|
|
1974
|
+
const contextWindow = sessionManager.getCurrentModelContext(sessionId, config.mode);
|
|
1920
1975
|
const availableForOutput = Math.max(256, contextWindow - contextState.currentTokens - OUTPUT_RESERVE_TOKENS);
|
|
1921
|
-
let modelSettings = config.modelSettings ?? (currentMaxTokensOverride !== void 0 ? { ...sessionManager.getCurrentModelSettings(sessionId), maxTokens: currentMaxTokensOverride } : sessionManager.getCurrentModelSettings(sessionId));
|
|
1976
|
+
let modelSettings = config.modelSettings ?? (currentMaxTokensOverride !== void 0 ? { ...sessionManager.getCurrentModelSettings(sessionId, config.mode), maxTokens: currentMaxTokensOverride } : sessionManager.getCurrentModelSettings(sessionId, config.mode));
|
|
1922
1977
|
if (modelSettings) {
|
|
1923
1978
|
const requestedMaxTokens = modelSettings.maxTokens ?? 16384;
|
|
1924
1979
|
modelSettings = { ...modelSettings, maxTokens: Math.min(requestedMaxTokens, availableForOutput) };
|
|
@@ -2040,11 +2095,11 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
2040
2095
|
);
|
|
2041
2096
|
if (!compacting) {
|
|
2042
2097
|
const contextState = sessionManager.getContextState(sessionId);
|
|
2043
|
-
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-
|
|
2098
|
+
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-MKD3CAFM.js");
|
|
2044
2099
|
if (shouldCompact(
|
|
2045
2100
|
contextState.currentTokens,
|
|
2046
2101
|
contextState.maxTokens,
|
|
2047
|
-
sessionManager.getModelCompactionThreshold(sessionId) ?? runtimeConfig.context.compactionThreshold
|
|
2102
|
+
sessionManager.getModelCompactionThreshold(sessionId, config.mode) ?? runtimeConfig.context.compactionThreshold
|
|
2048
2103
|
)) {
|
|
2049
2104
|
appendCompactionPrompt(sessionId, append);
|
|
2050
2105
|
compacting = true;
|
|
@@ -2056,7 +2111,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
2056
2111
|
truncationRetryCount += 1;
|
|
2057
2112
|
const currentMaxTokens = result.modelParams?.maxTokens ?? 16384;
|
|
2058
2113
|
const promptTokens = result.usage.promptTokens;
|
|
2059
|
-
const contextWindow = sessionManager.getCurrentModelContext(sessionId);
|
|
2114
|
+
const contextWindow = sessionManager.getCurrentModelContext(sessionId, config.mode);
|
|
2060
2115
|
const newMaxTokens = Math.min(
|
|
2061
2116
|
Math.floor(currentMaxTokens * 1.5),
|
|
2062
2117
|
Math.max(256, contextWindow - promptTokens - OUTPUT_RESERVE_TOKENS)
|
|
@@ -2864,6 +2919,21 @@ async function executeSubAgent(options) {
|
|
|
2864
2919
|
})
|
|
2865
2920
|
);
|
|
2866
2921
|
}
|
|
2922
|
+
} else {
|
|
2923
|
+
const effective = sessionManager.resolveEffectiveProviderModel(sessionId, subAgentType);
|
|
2924
|
+
if (effective.providerId && effective.model) {
|
|
2925
|
+
const effectiveClient = providerManager.createClient(effective.providerId, effective.model);
|
|
2926
|
+
if (effectiveClient) {
|
|
2927
|
+
llmClient = effectiveClient;
|
|
2928
|
+
const provider = providerManager.getProviders().find((p) => p.id === effective.providerId);
|
|
2929
|
+
statsIdentity = {
|
|
2930
|
+
providerId: effective.providerId,
|
|
2931
|
+
providerName: provider?.name ?? effective.providerId,
|
|
2932
|
+
backend: provider?.backend ?? effectiveClient.getBackend(),
|
|
2933
|
+
model: effective.model
|
|
2934
|
+
};
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2867
2937
|
}
|
|
2868
2938
|
}
|
|
2869
2939
|
logger.debug("Sub-agent starting", { subAgentType, subAgentId, sessionId });
|
|
@@ -3033,7 +3103,7 @@ var callSubAgentTool = {
|
|
|
3033
3103
|
};
|
|
3034
3104
|
}
|
|
3035
3105
|
try {
|
|
3036
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3106
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-IKMNLLAY.js");
|
|
3037
3107
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3038
3108
|
const turnMetrics = new TurnMetrics();
|
|
3039
3109
|
const result = await executeSubAgent({
|
|
@@ -4055,7 +4125,7 @@ var mcpConfigTool = createTool(
|
|
|
4055
4125
|
mcpNotifyChanged?.(sessionId);
|
|
4056
4126
|
}
|
|
4057
4127
|
async function rebuildTools() {
|
|
4058
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4128
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-IKMNLLAY.js");
|
|
4059
4129
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
4060
4130
|
setMcpTools2(mcpTools);
|
|
4061
4131
|
}
|
|
@@ -4488,7 +4558,7 @@ var projectTasksTool = createTool(
|
|
|
4488
4558
|
type: "function",
|
|
4489
4559
|
function: {
|
|
4490
4560
|
name: "project_tasks",
|
|
4491
|
-
description: "Kanban task board for this project. Core loop: list \u2192 move \u2192 set_gate_value.\n\nRules:\n- Moving to in_progress binds the task to YOUR current session.\n- Moving to done is blocked by unmet gates: the error names the missing fields \u2014 fill them
|
|
4561
|
+
description: "Kanban task board for this project. Core loop: list \u2192 move \u2192 set_gate_value.\n\nRules:\n- Moving to in_progress binds the task to YOUR current session.\n- Do not move tasks or fill gate values without explicit user approval or a system instruction \u2014 complete the work, then let the user review before the task advances.\n- Moving to done is blocked by unmet gates: the error names the missing fields \u2014 fill them only with user approval, then retry the move.\n- Stale writes fail with CONFLICT \u2014 re-list and retry.\n\nActions:\n- list: tasks (status, gate values, queue position, bound session, audit trail); defaults to open tasks, filter via status (todo | in_progress | done | all)\n- create: add a task to To Do (prompt required)\n- edit: update prompt/attachments/agent/model (taskId + fields)\n- move: change column (to: todo | in_progress | done; optional reason)\n- set_gate_value: fill a gate field (taskId, gateId, value)\n- delete: remove a task (taskId)",
|
|
4492
4562
|
parameters: {
|
|
4493
4563
|
type: "object",
|
|
4494
4564
|
properties: {
|
|
@@ -4917,6 +4987,10 @@ function createToolRegistry() {
|
|
|
4917
4987
|
}
|
|
4918
4988
|
|
|
4919
4989
|
export {
|
|
4990
|
+
getAgentModelOverrides,
|
|
4991
|
+
getAgentModelOverride,
|
|
4992
|
+
setAgentModelOverride,
|
|
4993
|
+
resolveLLMClientForAgent,
|
|
4920
4994
|
runTopLevelAgentLoop,
|
|
4921
4995
|
createAssemblyResult,
|
|
4922
4996
|
getConversationMessages,
|
|
@@ -4939,4 +5013,4 @@ export {
|
|
|
4939
5013
|
getToolRegistryForAgent,
|
|
4940
5014
|
createToolRegistry
|
|
4941
5015
|
};
|
|
4942
|
-
//# sourceMappingURL=chunk-
|
|
5016
|
+
//# sourceMappingURL=chunk-SCP5KBNB.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultAgentId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2N7KFNMY.js";
|
|
4
4
|
import {
|
|
5
5
|
getDatabase
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NYQKSKDB.js";
|
|
7
7
|
|
|
8
8
|
// src/server/db/sessions.ts
|
|
9
9
|
function getProjectDangerLevel(projectId) {
|
|
@@ -51,6 +51,8 @@ function createSession(projectId, workdir, title, providerId, providerModel, wor
|
|
|
51
51
|
isRunning: false,
|
|
52
52
|
providerId: providerId ?? null,
|
|
53
53
|
providerModel: providerModel ?? null,
|
|
54
|
+
providerManual: false,
|
|
55
|
+
providerManualActive: true,
|
|
54
56
|
createdAt: now,
|
|
55
57
|
updatedAt: now,
|
|
56
58
|
messages: [],
|
|
@@ -94,14 +96,27 @@ function getSession(id) {
|
|
|
94
96
|
dangerLevel: row.danger_level ?? "normal"
|
|
95
97
|
};
|
|
96
98
|
}
|
|
97
|
-
function updateSessionProvider(id, providerId, providerModel) {
|
|
99
|
+
function updateSessionProvider(id, providerId, providerModel, providerManual) {
|
|
98
100
|
const db = getDatabase();
|
|
99
101
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
100
|
-
|
|
102
|
+
if (providerManual !== void 0) {
|
|
103
|
+
db.prepare(
|
|
104
|
+
`
|
|
105
|
+
UPDATE sessions SET provider_id = ?, provider_model = ?, provider_manual = ?, updated_at = ? WHERE id = ?
|
|
101
106
|
`
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
).run(providerId, providerModel, providerManual ? 1 : 0, now, id);
|
|
108
|
+
} else {
|
|
109
|
+
db.prepare(
|
|
110
|
+
`
|
|
111
|
+
UPDATE sessions SET provider_id = ?, provider_model = ?, updated_at = ? WHERE id = ?
|
|
112
|
+
`
|
|
113
|
+
).run(providerId, providerModel, now, id);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function updateSessionProviderActive(id, active) {
|
|
117
|
+
const db = getDatabase();
|
|
118
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
119
|
+
db.prepare("UPDATE sessions SET provider_manual_active = ?, updated_at = ? WHERE id = ?").run(active ? 1 : 0, now, id);
|
|
105
120
|
}
|
|
106
121
|
function updateSessionMode(id, mode) {
|
|
107
122
|
const db = getDatabase();
|
|
@@ -344,6 +359,8 @@ function mapSessionBase(row) {
|
|
|
344
359
|
isRunning: Boolean(row.is_running),
|
|
345
360
|
providerId: row.provider_id ?? null,
|
|
346
361
|
providerModel: row.provider_model ?? null,
|
|
362
|
+
providerManual: Boolean(row.provider_manual),
|
|
363
|
+
providerManualActive: Boolean(row.provider_manual_active),
|
|
347
364
|
createdAt: row.created_at,
|
|
348
365
|
updatedAt: row.updated_at
|
|
349
366
|
};
|
|
@@ -411,6 +428,7 @@ export {
|
|
|
411
428
|
createSession,
|
|
412
429
|
getSession,
|
|
413
430
|
updateSessionProvider,
|
|
431
|
+
updateSessionProviderActive,
|
|
414
432
|
updateSessionMode,
|
|
415
433
|
updateSessionDangerLevel,
|
|
416
434
|
updateSessionPhase,
|
|
@@ -435,4 +453,4 @@ export {
|
|
|
435
453
|
getLatestWorkflowExecution,
|
|
436
454
|
clearWorkflowExecution
|
|
437
455
|
};
|
|
438
|
-
//# sourceMappingURL=chunk-
|
|
456
|
+
//# sourceMappingURL=chunk-SLW3KKPP.js.map
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
} from "./chunk-OSXPQSLW.js";
|
|
9
9
|
import {
|
|
10
10
|
getProject
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DIALH34K.js";
|
|
12
12
|
import {
|
|
13
13
|
parseDefaultModelSelection
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UJRWYZHM.js";
|
|
15
15
|
import {
|
|
16
16
|
getDatabase
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NYQKSKDB.js";
|
|
18
18
|
import {
|
|
19
19
|
logger
|
|
20
20
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -1006,7 +1006,8 @@ ${content}
|
|
|
1006
1006
|
return [
|
|
1007
1007
|
`This session is now working on task "${promptLabel(task.prompt)}" from the project task board.`,
|
|
1008
1008
|
`Previous state: ${prettyStatus(from)} \u2192 In Progress. Session: ${sessionId.slice(0, 8)}.`,
|
|
1009
|
-
gateLine
|
|
1009
|
+
gateLine,
|
|
1010
|
+
"Do not move the task, fill gate values, or commit changes without explicit user approval or a system instruction."
|
|
1010
1011
|
].join("\n");
|
|
1011
1012
|
}
|
|
1012
1013
|
function reminderForDone(task) {
|
|
@@ -1098,4 +1099,4 @@ export {
|
|
|
1098
1099
|
isTaskGateError,
|
|
1099
1100
|
createTasksService
|
|
1100
1101
|
};
|
|
1101
|
-
//# sourceMappingURL=chunk-
|
|
1102
|
+
//# sourceMappingURL=chunk-STYGFTEB.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-K2QKX4ZJ.js";
|
|
4
4
|
import {
|
|
5
5
|
createLLMClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J77SLE3M.js";
|
|
7
7
|
import {
|
|
8
8
|
getModelProfile
|
|
9
9
|
} from "./chunk-GJL3QSMP.js";
|
|
@@ -366,6 +366,7 @@ function createProviderManager(config, options = {}) {
|
|
|
366
366
|
let providers = [...config.providers ?? []];
|
|
367
367
|
providers = providers.map((p) => ({ ...p, models: p.models.map((m) => enrichWithProfileDefaults(m)) }));
|
|
368
368
|
let defaultModelSelection = config.defaultModelSelection;
|
|
369
|
+
let configDefaultModelSelection = config.defaultModelSelection;
|
|
369
370
|
let llmClient = createLLMClient(config);
|
|
370
371
|
const providerStatus = /* @__PURE__ */ new Map();
|
|
371
372
|
logger.debug("ProviderManager created", {
|
|
@@ -470,6 +471,9 @@ function createProviderManager(config, options = {}) {
|
|
|
470
471
|
const { model } = parseDefaultModelSelection(defaultModelSelection);
|
|
471
472
|
return model;
|
|
472
473
|
},
|
|
474
|
+
getDefaultModelSelection() {
|
|
475
|
+
return configDefaultModelSelection;
|
|
476
|
+
},
|
|
473
477
|
getLLMClient() {
|
|
474
478
|
return llmClient;
|
|
475
479
|
},
|
|
@@ -583,6 +587,7 @@ function createProviderManager(config, options = {}) {
|
|
|
583
587
|
setProviders(newProviders, newDefaultModelSelection) {
|
|
584
588
|
providers = [...newProviders];
|
|
585
589
|
defaultModelSelection = newDefaultModelSelection;
|
|
590
|
+
configDefaultModelSelection = newDefaultModelSelection;
|
|
586
591
|
providerStatus.clear();
|
|
587
592
|
for (const p of providers) {
|
|
588
593
|
providerStatus.set(p.id, "unknown");
|
|
@@ -622,6 +627,7 @@ function createProviderManager(config, options = {}) {
|
|
|
622
627
|
logger.info("Setting default model selection", { providerId, model, providerName: provider.name });
|
|
623
628
|
llmClient = createClientForProvider(provider, model);
|
|
624
629
|
defaultModelSelection = `${providerId}/${model}`;
|
|
630
|
+
configDefaultModelSelection = `${providerId}/${model}`;
|
|
625
631
|
providers = providers.map((p) => ({ ...p, isActive: p.id === providerId }));
|
|
626
632
|
return { success: true };
|
|
627
633
|
},
|
|
@@ -799,4 +805,4 @@ export {
|
|
|
799
805
|
parseDefaultModelSelection,
|
|
800
806
|
createProviderManager
|
|
801
807
|
};
|
|
802
|
-
//# sourceMappingURL=chunk-
|
|
808
|
+
//# sourceMappingURL=chunk-UJRWYZHM.js.map
|