openfox 2.0.114 → 2.0.115
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 +21 -0
- package/dist/CHANGELOG.md +21 -0
- package/dist/{chat-handler-KWXRSWXZ.js → chat-handler-5SP265CR.js} +27 -27
- package/dist/{chunk-2XD65L7M.js → chunk-27NABDXB.js} +2 -2
- package/dist/{chunk-YGJIK3CG.js → chunk-2FCLCUVR.js} +5 -5
- package/dist/{chunk-HV6IALXF.js → chunk-37QLXLML.js} +4 -4
- package/dist/{chunk-UTIQ7OO5.js → chunk-3KBRMBTP.js} +2 -2
- package/dist/{chunk-FW4NDUBL.js → chunk-3NPLERPQ.js} +13 -13
- package/dist/{chunk-SFZGMB2G.js → chunk-3PG65AXG.js} +18 -3
- package/dist/{chunk-W77NBJAZ.js → chunk-3QQAIUZI.js} +9 -9
- package/dist/{chunk-PBW3YC3G.js → chunk-5PT4UMRR.js} +5 -1
- package/dist/chunk-5V3BF67X.js +7 -0
- package/dist/{chunk-BZVW77PI.js → chunk-6KPJLELC.js} +3 -3
- package/dist/{chunk-OTYAEEX3.js → chunk-6RGACY4E.js} +7 -7
- package/dist/{chunk-SA34STZ6.js → chunk-AESOGRFK.js} +2 -2
- package/dist/{chunk-MUSPWEBB.js → chunk-BVVCRIVM.js} +3 -3
- package/dist/{chunk-VPVLO436.js → chunk-BWVO5WFK.js} +4 -4
- package/dist/{chunk-JXLRL5JR.js → chunk-ERNWAKUB.js} +7 -7
- package/dist/{chunk-HP5CIB66.js → chunk-HD6Y77RO.js} +2 -2
- package/dist/{chunk-K733B5T2.js → chunk-JFK4GKQD.js} +87 -54
- package/dist/{chunk-LXYPMFTH.js → chunk-JGWHRYWG.js} +3 -3
- package/dist/{chunk-JP7NM545.js → chunk-JLAR2CMV.js} +2 -2
- package/dist/{chunk-UPBWEHIL.js → chunk-LNNBLB6G.js} +20 -5
- package/dist/{chunk-OXSTNSCF.js → chunk-LTYL6ZGH.js} +2 -2
- package/dist/{chunk-P5UANBBX.js → chunk-M6X6AIEG.js} +2 -2
- package/dist/{chunk-SBSUDHL4.js → chunk-O6DU226D.js} +2 -2
- package/dist/{chunk-QD7MRMCH.js → chunk-OCBBAEMT.js} +144 -128
- package/dist/{chunk-L63Q4JQJ.js → chunk-OCSTEGK7.js} +3 -3
- package/dist/{chunk-7GWARYQC.js → chunk-OKVHMKE2.js} +15 -15
- package/dist/{chunk-GUHHUDNL.js → chunk-TFF5T3K3.js} +10 -10
- package/dist/{chunk-NWJLWLKF.js → chunk-TGLVWAFC.js} +10 -10
- package/dist/{chunk-L737Y63F.js → chunk-TOKQ2UVG.js} +2 -2
- package/dist/{chunk-3O77NT4T.js → chunk-VWEATA7R.js} +4 -4
- package/dist/{chunk-NLO64UE3.js → chunk-YX3OQBNX.js} +2 -2
- package/dist/{chunk-TKKP56QK.js → chunk-ZTOG6LJD.js} +3 -3
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-EM7ISGUP.js → client-KE7EDI2D.js} +6 -6
- package/dist/{client-pure-VFZIIK4S.js → client-pure-66Z6FWS6.js} +2 -2
- package/dist/command-defaults/mark-done.command.md +14 -0
- package/dist/{compactor-V3LR7APW.js → compactor-SKVC2VNL.js} +13 -12
- package/dist/{dynamic-context-MVGOF5V2.js → dynamic-context-QNB4ELLP.js} +9 -9
- package/dist/{events-PI7IMPHT.js → events-5PLO4QJU.js} +8 -7
- package/dist/{folding-FO57K4JM.js → folding-CJWYFUKD.js} +6 -5
- package/dist/http-client-KLODRQC2.js +11 -0
- package/dist/{inspect-proxy-NHKQQ2CD.js → inspect-proxy-K6QKEYDT.js} +4 -4
- package/dist/launch-EOXVWLOP.js +52 -0
- package/dist/{manager-66YAEO7K.js → manager-LZ3JQ443.js} +5 -5
- package/dist/{model-overrides-L53PZNZA.js → model-overrides-5UVW3KTE.js} +4 -4
- package/dist/{orchestrator-XK5K3RPL.js → orchestrator-ED3KFPXO.js} +26 -26
- package/dist/package.json +1 -1
- package/dist/{path-security-RSEI3YKB.js → path-security-B6EZC63L.js} +10 -9
- package/dist/{platform-WA4GK5BO.js → platform-6RPPBHKH.js} +4 -4
- package/dist/{processor-WDZSFBVO.js → processor-226ZOTRI.js} +26 -26
- package/dist/{project-creator-676WQXVI.js → project-creator-VBFE35NI.js} +3 -3
- package/dist/{projects-SSBWIYL4.js → projects-AXHZOBR2.js} +5 -3
- package/dist/{protocol-BzHs024-.d.ts → protocol-JdxRpPxM.d.ts} +1 -1
- package/dist/provider/index.d.ts +4 -4
- package/dist/{provider-PLIWRBCF.js → provider-DL4ZWQY7.js} +7 -7
- package/dist/{provider-manager-2QSJTPWS.js → provider-manager-6CLRMGDE.js} +7 -7
- package/dist/{registry-ZP4TN2IN.js → registry-5XI5NDBF.js} +5 -4
- package/dist/{serve-MZ3BCCWC.js → serve-DARV4NJG.js} +32 -32
- package/dist/server/index.d.ts +12 -5
- package/dist/server/index.js +31 -31
- package/dist/server-LQJ7MBDS.js +55 -0
- package/dist/{service-54PGIPDQ.js → service-4JKTGPRG.js} +9 -9
- package/dist/{session-overrides-LXN6W7SA.js → session-overrides-AZKV6BRD.js} +7 -6
- package/dist/{sessions-CHPVUG6H.js → sessions-752IZIIK.js} +6 -5
- package/dist/{settings-NEBM3GQX.js → settings-2AHDKCD7.js} +3 -3
- package/dist/shared/index.d.ts +3 -3
- package/dist/{tasks-TJXG2V3U.js → tasks-XJXHU623.js} +10 -10
- package/dist/{tools-CIM26IFB.js → tools-QYYNFMGU.js} +24 -24
- package/dist/{types-CbggXFvR.d.ts → types-CIVhQMvD.d.ts} +1 -1
- package/dist/{types-CMtHpDWT.d.ts → types-Df7NM9b5.d.ts} +2 -0
- package/dist/{update-UZBBO42X.js → update-2REP2WB6.js} +2 -2
- package/dist/web/assets/index-M7ToECa4.js +324 -0
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/dist/{workspace-2XODU4YJ.js → workspace-RMZVTFJD.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-NCZRWCJN.js +0 -7
- package/dist/http-client-33EZ3BLR.js +0 -11
- package/dist/launch-L5ROVNI3.js +0 -52
- package/dist/server-EPXODFMB.js +0 -55
- package/dist/web/assets/index-rZHXkfMq.js +0 -324
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getEnabledSkillMetadata,
|
|
5
5
|
isSkillEnabled,
|
|
6
6
|
loadAllSkills
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2FCLCUVR.js";
|
|
8
8
|
import {
|
|
9
9
|
TurnMetrics,
|
|
10
10
|
consumeStreamGenerator,
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
createToolCallEvent,
|
|
15
15
|
createToolResultEvent,
|
|
16
16
|
streamLLMPure
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YX3OQBNX.js";
|
|
18
18
|
import {
|
|
19
19
|
COMPACTION_PROMPT,
|
|
20
20
|
buildBasePrompt,
|
|
21
21
|
computeEffectiveTools
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-27NABDXB.js";
|
|
23
23
|
import {
|
|
24
24
|
startInspectProxy
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-M6X6AIEG.js";
|
|
26
26
|
import {
|
|
27
27
|
checkAborted,
|
|
28
28
|
createProcess,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
spawnShellProcess,
|
|
37
37
|
startProcessCommand,
|
|
38
38
|
stopProcess
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-ZTOG6LJD.js";
|
|
40
40
|
import {
|
|
41
41
|
getMaxPerSession,
|
|
42
42
|
getSessionProcessCount,
|
|
@@ -52,27 +52,27 @@ import {
|
|
|
52
52
|
getGitBranch,
|
|
53
53
|
isGitRepository,
|
|
54
54
|
listWorkspaces
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-O6DU226D.js";
|
|
56
56
|
import {
|
|
57
57
|
getGateConfig,
|
|
58
58
|
isTaskConflictError,
|
|
59
59
|
isTaskGateError
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-6RGACY4E.js";
|
|
61
61
|
import {
|
|
62
62
|
getSessionDisabledServers
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-OCSTEGK7.js";
|
|
64
64
|
import {
|
|
65
65
|
PathAccessDeniedError,
|
|
66
66
|
extractAbsolutePathsFromCommand,
|
|
67
67
|
extractSensitivePathsFromCommand,
|
|
68
68
|
registerPathConfirmation,
|
|
69
69
|
requestPathAccess
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-6KPJLELC.js";
|
|
71
71
|
import {
|
|
72
72
|
getCurrentContextWindowId,
|
|
73
73
|
getCurrentWindowMessageOptions,
|
|
74
74
|
getEventStore
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-ERNWAKUB.js";
|
|
76
76
|
import {
|
|
77
77
|
createChatDoneMessage,
|
|
78
78
|
createChatMessageMessage,
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
} from "./chunk-JURM3RPZ.js";
|
|
87
87
|
import {
|
|
88
88
|
resolveLLMClientForAgent
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-JLAR2CMV.js";
|
|
90
90
|
import {
|
|
91
91
|
buildContextMessagesFromEventHistory,
|
|
92
92
|
foldContextState,
|
|
@@ -96,13 +96,13 @@ import {
|
|
|
96
96
|
handleToolResult,
|
|
97
97
|
reorderToolMessages,
|
|
98
98
|
stripOrphanedToolCalls
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-3KBRMBTP.js";
|
|
100
100
|
import {
|
|
101
101
|
findAgentById,
|
|
102
102
|
getRuntimeConfig,
|
|
103
103
|
getSubAgents,
|
|
104
104
|
loadAllAgentsDefault
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-LNNBLB6G.js";
|
|
106
106
|
import {
|
|
107
107
|
modelSupportsVision
|
|
108
108
|
} from "./chunk-V4IE7HJY.js";
|
|
@@ -116,11 +116,11 @@ import {
|
|
|
116
116
|
formatPdfErrorMessage,
|
|
117
117
|
isPdfBuffer,
|
|
118
118
|
processPdfContent
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-TOKQ2UVG.js";
|
|
120
120
|
import {
|
|
121
121
|
SETTINGS_KEYS,
|
|
122
122
|
getSetting
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-HD6Y77RO.js";
|
|
124
124
|
import {
|
|
125
125
|
logger
|
|
126
126
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
|
|
135
135
|
// src/server/tools/read.ts
|
|
136
136
|
import { readFile as readFile2, stat, readdir } from "fs/promises";
|
|
137
|
-
import { extname, join } from "path";
|
|
137
|
+
import { extname, join, relative as relative2 } from "path";
|
|
138
138
|
|
|
139
139
|
// src/server/tools/tool-helpers.ts
|
|
140
140
|
import { randomUUID } from "crypto";
|
|
@@ -144,7 +144,7 @@ async function requestUserConfirmation(context, toolLabel, desc) {
|
|
|
144
144
|
if (context.dangerLevel === "dangerous") return Promise.resolve(true);
|
|
145
145
|
if (toolLabel === "workspace" || toolLabel === "command") {
|
|
146
146
|
try {
|
|
147
|
-
const { getSetting: getSetting2, SETTINGS_KEYS: SETTINGS_KEYS2 } = await import("./settings-
|
|
147
|
+
const { getSetting: getSetting2, SETTINGS_KEYS: SETTINGS_KEYS2 } = await import("./settings-2AHDKCD7.js");
|
|
148
148
|
if (getSetting2(SETTINGS_KEYS2.CONFIRM_ON_WORKSPACE_ACTIONS) !== "true") {
|
|
149
149
|
return Promise.resolve(true);
|
|
150
150
|
}
|
|
@@ -273,7 +273,7 @@ function createTool(name, definition, handler2) {
|
|
|
273
273
|
// src/server/tools/file-tracker.ts
|
|
274
274
|
import { createHash } from "crypto";
|
|
275
275
|
import { readFile } from "fs/promises";
|
|
276
|
-
import { resolve as resolve2 } from "path";
|
|
276
|
+
import { relative, resolve as resolve2 } from "path";
|
|
277
277
|
var FileNotReadError = class extends Error {
|
|
278
278
|
constructor(path) {
|
|
279
279
|
super(`File "${path}" must be read before writing. Use read_file first.`);
|
|
@@ -301,26 +301,35 @@ async function computeFileHash(filePath) {
|
|
|
301
301
|
throw error;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
async function validateFileForWrite(filePath, readFiles) {
|
|
304
|
+
async function validateFileForWrite(filePath, readFiles, baseDir) {
|
|
305
305
|
const normalizedPath = resolve2(filePath);
|
|
306
306
|
const currentHash = await computeFileHash(normalizedPath);
|
|
307
307
|
if (currentHash === null) {
|
|
308
308
|
return { valid: true };
|
|
309
309
|
}
|
|
310
310
|
const readEntry = readFiles[normalizedPath];
|
|
311
|
-
if (
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
311
|
+
if (readEntry) {
|
|
312
|
+
if (readEntry.hash !== currentHash) {
|
|
313
|
+
return {
|
|
314
|
+
valid: false,
|
|
315
|
+
error: new FileChangedExternallyError(filePath)
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
return { valid: true };
|
|
316
319
|
}
|
|
317
|
-
if (
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
if (baseDir) {
|
|
321
|
+
const relPath = relative(baseDir, normalizedPath);
|
|
322
|
+
if (!relPath.startsWith("..")) {
|
|
323
|
+
const relMatches = Object.values(readFiles).filter((entry) => entry.relPath === relPath);
|
|
324
|
+
if (relMatches.some((entry) => entry.hash === currentHash)) {
|
|
325
|
+
return { valid: true };
|
|
326
|
+
}
|
|
327
|
+
}
|
|
322
328
|
}
|
|
323
|
-
return {
|
|
329
|
+
return {
|
|
330
|
+
valid: false,
|
|
331
|
+
error: new FileNotReadError(filePath)
|
|
332
|
+
};
|
|
324
333
|
}
|
|
325
334
|
function isNodeError(error) {
|
|
326
335
|
return error instanceof Error && "code" in error;
|
|
@@ -609,7 +618,12 @@ var readFileTool = createTool(
|
|
|
609
618
|
const dataUrl = `data:${mimeType};base64,${base64Data}`;
|
|
610
619
|
const contentHash3 = await computeFileHash(fullPath);
|
|
611
620
|
if (contentHash3) {
|
|
612
|
-
context.sessionManager.recordFileRead(
|
|
621
|
+
context.sessionManager.recordFileRead(
|
|
622
|
+
context.sessionId,
|
|
623
|
+
fullPath,
|
|
624
|
+
contentHash3,
|
|
625
|
+
relative2(context.workdir, fullPath)
|
|
626
|
+
);
|
|
613
627
|
}
|
|
614
628
|
return helpers.success(`[Image: ${args.path} (${mimeType}, ${rawBuffer.length} bytes)]`, false, {
|
|
615
629
|
metadata: {
|
|
@@ -627,7 +641,12 @@ var readFileTool = createTool(
|
|
|
627
641
|
const { output: output2, truncated: truncated2, isScanned } = processPdfContent(text, OUTPUT_LIMITS.read_file.maxBytes);
|
|
628
642
|
const contentHash3 = await computeFileHash(fullPath);
|
|
629
643
|
if (contentHash3) {
|
|
630
|
-
context.sessionManager.recordFileRead(
|
|
644
|
+
context.sessionManager.recordFileRead(
|
|
645
|
+
context.sessionId,
|
|
646
|
+
fullPath,
|
|
647
|
+
contentHash3,
|
|
648
|
+
relative2(context.workdir, fullPath)
|
|
649
|
+
);
|
|
631
650
|
}
|
|
632
651
|
if (isScanned) {
|
|
633
652
|
return helpers.success(
|
|
@@ -678,7 +697,12 @@ var readFileTool = createTool(
|
|
|
678
697
|
}
|
|
679
698
|
const contentHash2 = await computeFileHash(fullPath);
|
|
680
699
|
if (contentHash2) {
|
|
681
|
-
context.sessionManager.recordFileRead(
|
|
700
|
+
context.sessionManager.recordFileRead(
|
|
701
|
+
context.sessionId,
|
|
702
|
+
fullPath,
|
|
703
|
+
contentHash2,
|
|
704
|
+
relative2(context.workdir, fullPath)
|
|
705
|
+
);
|
|
682
706
|
}
|
|
683
707
|
return helpers.success(output, truncated, {
|
|
684
708
|
metadata: {
|
|
@@ -695,7 +719,7 @@ var readFileTool = createTool(
|
|
|
695
719
|
|
|
696
720
|
// src/server/tools/write.ts
|
|
697
721
|
import { writeFile, mkdir } from "fs/promises";
|
|
698
|
-
import { dirname } from "path";
|
|
722
|
+
import { dirname, relative as relative3 } from "path";
|
|
699
723
|
|
|
700
724
|
// src/server/tools/diagnostics.ts
|
|
701
725
|
function formatDiagnosticsForLLM(diagnostics) {
|
|
@@ -762,7 +786,7 @@ var writeFileTool = createTool(
|
|
|
762
786
|
const fullPath = helpers.resolvePath(args.path);
|
|
763
787
|
await helpers.checkPathAccess([fullPath]);
|
|
764
788
|
const readFiles = context.sessionManager.getReadFiles(context.sessionId);
|
|
765
|
-
const validation = await validateFileForWrite(fullPath, readFiles);
|
|
789
|
+
const validation = await validateFileForWrite(fullPath, readFiles, context.workdir);
|
|
766
790
|
if (!validation.valid) {
|
|
767
791
|
return helpers.error(validation.error?.message ?? "File validation failed");
|
|
768
792
|
}
|
|
@@ -782,7 +806,7 @@ var writeFileTool = createTool(
|
|
|
782
806
|
}
|
|
783
807
|
const newHash = await computeFileHash(fullPath);
|
|
784
808
|
if (newHash) {
|
|
785
|
-
context.sessionManager.updateFileHash(context.sessionId, fullPath, newHash);
|
|
809
|
+
context.sessionManager.updateFileHash(context.sessionId, fullPath, newHash, relative3(context.workdir, fullPath));
|
|
786
810
|
}
|
|
787
811
|
return helpers.success(output, false, {
|
|
788
812
|
...diagnostics.length > 0 && { diagnostics },
|
|
@@ -793,6 +817,7 @@ var writeFileTool = createTool(
|
|
|
793
817
|
|
|
794
818
|
// src/server/tools/edit.ts
|
|
795
819
|
import { readFile as readFile3, writeFile as writeFile2 } from "fs/promises";
|
|
820
|
+
import { relative as relative4 } from "path";
|
|
796
821
|
|
|
797
822
|
// src/server/tools/edit-context.ts
|
|
798
823
|
var CONTEXT_LINES = 4;
|
|
@@ -958,7 +983,7 @@ var editFileTool = createTool(
|
|
|
958
983
|
return withFileLock(fullPath, async () => {
|
|
959
984
|
const replaceAll = args.replace_all ?? false;
|
|
960
985
|
const readFiles = context.sessionManager.getReadFiles(context.sessionId);
|
|
961
|
-
const validation = await validateFileForWrite(fullPath, readFiles);
|
|
986
|
+
const validation = await validateFileForWrite(fullPath, readFiles, context.workdir);
|
|
962
987
|
if (!validation.valid) {
|
|
963
988
|
return helpers.error(validation.error?.message ?? "File validation failed");
|
|
964
989
|
}
|
|
@@ -1042,7 +1067,7 @@ Make sure whitespace and indentation match exactly.`
|
|
|
1042
1067
|
}
|
|
1043
1068
|
const newHash = await computeFileHash(fullPath);
|
|
1044
1069
|
if (newHash) {
|
|
1045
|
-
context.sessionManager.updateFileHash(context.sessionId, fullPath, newHash);
|
|
1070
|
+
context.sessionManager.updateFileHash(context.sessionId, fullPath, newHash, relative4(context.workdir, fullPath));
|
|
1046
1071
|
}
|
|
1047
1072
|
return helpers.success(output, false, {
|
|
1048
1073
|
...diagnostics.length > 0 && { diagnostics },
|
|
@@ -1522,10 +1547,10 @@ var INTERRUPTED_ERROR = "Tool execution was interrupted by user";
|
|
|
1522
1547
|
function extractSubAgentPrompt(args) {
|
|
1523
1548
|
return args["prompt"] || args["query"] || args["task"] || "";
|
|
1524
1549
|
}
|
|
1525
|
-
async function transformSubAgentAliases(toolCalls, toolRegistry) {
|
|
1550
|
+
async function transformSubAgentAliases(toolCalls, toolRegistry, projectDir) {
|
|
1526
1551
|
const hasCallSubAgent = toolRegistry.tools.some((t) => t.name === "call_sub_agent");
|
|
1527
1552
|
if (!hasCallSubAgent) return;
|
|
1528
|
-
const agents = await loadAllAgentsDefault();
|
|
1553
|
+
const agents = await loadAllAgentsDefault(projectDir);
|
|
1529
1554
|
for (const tc of toolCalls) {
|
|
1530
1555
|
const agentDef = findAgentById(tc.name, agents);
|
|
1531
1556
|
if (!agentDef?.metadata.subagent) continue;
|
|
@@ -1550,7 +1575,7 @@ async function executeTools(assistantMsgId, toolCalls, ctx, append) {
|
|
|
1550
1575
|
if (ctx.signal?.aborted) {
|
|
1551
1576
|
throw new Error("Aborted");
|
|
1552
1577
|
}
|
|
1553
|
-
await transformSubAgentAliases(toolCalls, ctx.toolRegistry);
|
|
1578
|
+
await transformSubAgentAliases(toolCalls, ctx.toolRegistry, ctx.sessionManager.getProjectWorkdir(ctx.sessionId));
|
|
1554
1579
|
for (const toolCall of toolCalls) {
|
|
1555
1580
|
append(createToolCallEvent(assistantMsgId, toolCall));
|
|
1556
1581
|
}
|
|
@@ -1784,7 +1809,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
|
|
|
1784
1809
|
const session2 = sessionManager.requireSession(sessionId);
|
|
1785
1810
|
const runtimeConfig2 = getRuntimeConfig();
|
|
1786
1811
|
const configDir2 = getGlobalConfigDir(runtimeConfig2.mode ?? "production");
|
|
1787
|
-
const skills2 = await getEnabledSkillMetadata(configDir2, sessionManager.
|
|
1812
|
+
const skills2 = await getEnabledSkillMetadata(configDir2, sessionManager.getProjectWorkdir(sessionId));
|
|
1788
1813
|
const { content: instructionContent2 } = await getAllInstructions(session2.workdir, session2.projectId);
|
|
1789
1814
|
const toolRegistry2 = config.getToolRegistry();
|
|
1790
1815
|
const assembledRequest2 = await config.assembleRequest({
|
|
@@ -1839,7 +1864,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
1839
1864
|
}
|
|
1840
1865
|
const runtimeConfig = getRuntimeConfig();
|
|
1841
1866
|
const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
|
|
1842
|
-
const skills = await getEnabledSkillMetadata(configDir, sessionManager.
|
|
1867
|
+
const skills = await getEnabledSkillMetadata(configDir, sessionManager.getProjectWorkdir(sessionId));
|
|
1843
1868
|
if (signal?.aborted) throw new Error("Aborted");
|
|
1844
1869
|
const assembledRequest = await config.assembleRequest({
|
|
1845
1870
|
workdir: session.workdir,
|
|
@@ -1866,7 +1891,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
1866
1891
|
const requestedMaxTokens = modelSettings.maxTokens ?? 16384;
|
|
1867
1892
|
modelSettings = { ...modelSettings, maxTokens: Math.min(requestedMaxTokens, availableForOutput) };
|
|
1868
1893
|
}
|
|
1869
|
-
const allAgents = await loadAllAgentsDefault();
|
|
1894
|
+
const allAgents = await loadAllAgentsDefault(sessionManager.getProjectWorkdir(sessionId));
|
|
1870
1895
|
const subAgentAliases = new Set(getSubAgents(allAgents).map((a) => a.metadata.id));
|
|
1871
1896
|
const streamGen = streamLLMPure({
|
|
1872
1897
|
messageId: assistantMsgId,
|
|
@@ -1940,7 +1965,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
1940
1965
|
);
|
|
1941
1966
|
if (!compacting) {
|
|
1942
1967
|
const contextState2 = sessionManager.getContextState(sessionId);
|
|
1943
|
-
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-
|
|
1968
|
+
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-SKVC2VNL.js");
|
|
1944
1969
|
if (shouldCompact(
|
|
1945
1970
|
contextState2.currentTokens,
|
|
1946
1971
|
contextState2.maxTokens,
|
|
@@ -2658,8 +2683,8 @@ function buildSubAgentResult(returnValueContent, returnValueResult) {
|
|
|
2658
2683
|
...returnValueResult !== null && returnValueResult !== void 0 ? { result: returnValueResult } : {}
|
|
2659
2684
|
};
|
|
2660
2685
|
}
|
|
2661
|
-
async function resolveAgentDef(agentId) {
|
|
2662
|
-
const allAgents = await loadAllAgentsDefault();
|
|
2686
|
+
async function resolveAgentDef(agentId, projectDir) {
|
|
2687
|
+
const allAgents = await loadAllAgentsDefault(projectDir);
|
|
2663
2688
|
const def = findAgentById(agentId, allAgents);
|
|
2664
2689
|
if (!def) throw new Error(`Unknown sub-agent type: ${agentId}`);
|
|
2665
2690
|
if (!def.metadata.subagent) throw new Error(`Agent '${agentId}' is not a sub-agent`);
|
|
@@ -2710,7 +2735,7 @@ async function executeSubAgent(options) {
|
|
|
2710
2735
|
signal,
|
|
2711
2736
|
onMessage
|
|
2712
2737
|
} = options;
|
|
2713
|
-
const agentDef = await resolveAgentDef(subAgentType);
|
|
2738
|
+
const agentDef = await resolveAgentDef(subAgentType, sessionManager.getProjectWorkdir(sessionId));
|
|
2714
2739
|
const eventStore = getEventStore();
|
|
2715
2740
|
const subAgentId = crypto.randomUUID();
|
|
2716
2741
|
const session = sessionManager.requireSession(sessionId);
|
|
@@ -2814,7 +2839,7 @@ async function executeSubAgent(options) {
|
|
|
2814
2839
|
const { content: instructionContent } = await getAllInstructions(effectiveWorkdir, session.projectId);
|
|
2815
2840
|
const config = getRuntimeConfig();
|
|
2816
2841
|
const configDir = getGlobalConfigDir(config.mode ?? "production");
|
|
2817
|
-
const skills = await getEnabledSkillMetadata(configDir,
|
|
2842
|
+
const skills = await getEnabledSkillMetadata(configDir, session.workdir);
|
|
2818
2843
|
const hasRunCommand = agentDef.metadata.allowedTools?.includes("run_command") ?? false;
|
|
2819
2844
|
const gitignoreSection = hasRunCommand ? await loadGitIgnoreRules(effectiveWorkdir) : "";
|
|
2820
2845
|
const systemPrompt = buildBasePrompt(effectiveWorkdir, void 0, skills.length > 0 ? skills : void 0, llmClient.getModel()) + "\n\n" + agentDef.prompt + (gitignoreSection ? "\n\n" + gitignoreSection : "") + RETURN_VALUE_INSTRUCTION;
|
|
@@ -2928,7 +2953,7 @@ var callSubAgentTool = {
|
|
|
2928
2953
|
};
|
|
2929
2954
|
}
|
|
2930
2955
|
try {
|
|
2931
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
2956
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-QYYNFMGU.js");
|
|
2932
2957
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
2933
2958
|
const turnMetrics = new TurnMetrics();
|
|
2934
2959
|
const result = await executeSubAgent({
|
|
@@ -2984,7 +3009,7 @@ var handler = async (args, context, helpers) => {
|
|
|
2984
3009
|
}
|
|
2985
3010
|
const config = getRuntimeConfig();
|
|
2986
3011
|
const configDir = getGlobalConfigDir(config.mode ?? "production");
|
|
2987
|
-
const allSkills = await loadAllSkills(configDir, context.
|
|
3012
|
+
const allSkills = await loadAllSkills(configDir, context.sessionManager.getProjectWorkdir(context.sessionId));
|
|
2988
3013
|
const skill = findSkillById(skillId, allSkills);
|
|
2989
3014
|
if (!skill) {
|
|
2990
3015
|
const available = allSkills.map((s) => s.metadata.id).join(", ");
|
|
@@ -3950,7 +3975,7 @@ var mcpConfigTool = createTool(
|
|
|
3950
3975
|
mcpNotifyChanged?.(sessionId);
|
|
3951
3976
|
}
|
|
3952
3977
|
async function rebuildTools() {
|
|
3953
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
3978
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-QYYNFMGU.js");
|
|
3954
3979
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
3955
3980
|
setMcpTools2(mcpTools);
|
|
3956
3981
|
}
|
|
@@ -4522,8 +4547,16 @@ var projectTasksTool = createTool(
|
|
|
4522
4547
|
}
|
|
4523
4548
|
case "delete": {
|
|
4524
4549
|
if (!args.taskId) return helpers.error('Parameter "taskId" is required for action=delete');
|
|
4550
|
+
const task = svc.get(projectId, args.taskId);
|
|
4551
|
+
if (!task) return helpers.error(`Task not found: ${args.taskId}`);
|
|
4525
4552
|
await svc.remove(projectId, args.taskId, actor);
|
|
4526
|
-
return helpers.success(
|
|
4553
|
+
return helpers.success(
|
|
4554
|
+
JSON.stringify(
|
|
4555
|
+
{ message: `Deleted: ${task.prompt.split("\n")[0]}`, taskId: task.id, prompt: task.prompt },
|
|
4556
|
+
null,
|
|
4557
|
+
2
|
|
4558
|
+
)
|
|
4559
|
+
);
|
|
4527
4560
|
}
|
|
4528
4561
|
case "reorder": {
|
|
4529
4562
|
if (!args.taskId) return helpers.error('Parameter "taskId" is required for action=reorder');
|
|
@@ -4872,4 +4905,4 @@ export {
|
|
|
4872
4905
|
getToolRegistryForAgent,
|
|
4873
4906
|
createToolRegistry
|
|
4874
4907
|
};
|
|
4875
|
-
//# sourceMappingURL=chunk-
|
|
4908
|
+
//# sourceMappingURL=chunk-JFK4GKQD.js.map
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
getThinking,
|
|
14
14
|
mapFinishReason,
|
|
15
15
|
parseToolArguments
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TOKQ2UVG.js";
|
|
17
17
|
import {
|
|
18
18
|
LLMError,
|
|
19
19
|
OpenAIHttpClient
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LTYL6ZGH.js";
|
|
21
21
|
import {
|
|
22
22
|
logger
|
|
23
23
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -310,4 +310,4 @@ function createLLMClient(config, initialBackend = "unknown") {
|
|
|
310
310
|
export {
|
|
311
311
|
createLLMClient
|
|
312
312
|
};
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
313
|
+
//# sourceMappingURL=chunk-JGWHRYWG.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
SETTINGS_KEYS,
|
|
3
3
|
getSetting,
|
|
4
4
|
setSetting
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HD6Y77RO.js";
|
|
6
6
|
|
|
7
7
|
// src/server/agents/model-overrides.ts
|
|
8
8
|
import { z } from "zod";
|
|
@@ -69,4 +69,4 @@ export {
|
|
|
69
69
|
setAgentModelOverride,
|
|
70
70
|
resolveLLMClientForAgent
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
72
|
+
//# sourceMappingURL=chunk-JLAR2CMV.js.map
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
saveItemToDir
|
|
3
3
|
} from "./chunk-OSXPQSLW.js";
|
|
4
|
+
import {
|
|
5
|
+
getProjectDefaultAgent
|
|
6
|
+
} from "./chunk-3PG65AXG.js";
|
|
4
7
|
import {
|
|
5
8
|
SETTINGS_KEYS,
|
|
6
9
|
getSetting
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HD6Y77RO.js";
|
|
8
11
|
import {
|
|
9
12
|
logger
|
|
10
13
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -199,11 +202,11 @@ async function deleteProjectAgent(projectDir, agentId) {
|
|
|
199
202
|
}
|
|
200
203
|
return { success: false };
|
|
201
204
|
}
|
|
202
|
-
async function loadAllAgentsDefault() {
|
|
205
|
+
async function loadAllAgentsDefault(projectDir) {
|
|
203
206
|
try {
|
|
204
207
|
const config = getRuntimeConfig();
|
|
205
208
|
const configDir = getGlobalConfigDir(config.mode ?? "production");
|
|
206
|
-
return await loadAllAgents(configDir, config.workdir);
|
|
209
|
+
return await loadAllAgents(configDir, projectDir ?? config.workdir);
|
|
207
210
|
} catch {
|
|
208
211
|
return loadDefaultAgents();
|
|
209
212
|
}
|
|
@@ -293,7 +296,19 @@ async function getOverrideAgentIds(configDir, projectDir) {
|
|
|
293
296
|
const projectOverrides = projectAgents.map((agent) => agent.metadata.id).filter((id) => defaultIds.includes(id));
|
|
294
297
|
return [...userOverrides, ...projectOverrides];
|
|
295
298
|
}
|
|
296
|
-
function resolveDefaultAgentId() {
|
|
299
|
+
function resolveDefaultAgentId(projectId) {
|
|
300
|
+
if (projectId) {
|
|
301
|
+
try {
|
|
302
|
+
const projectDefault = getProjectDefaultAgent(projectId);
|
|
303
|
+
if (projectDefault && projectDefault.trim().length > 0) {
|
|
304
|
+
return projectDefault.trim();
|
|
305
|
+
}
|
|
306
|
+
} catch (err) {
|
|
307
|
+
logger.debug("Failed to read project defaultAgent from DB", {
|
|
308
|
+
error: err instanceof Error ? err.message : String(err)
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}
|
|
297
312
|
try {
|
|
298
313
|
const dbSetting = getSetting(SETTINGS_KEYS.DEFAULT_AGENT);
|
|
299
314
|
if (dbSetting && dbSetting.trim().length > 0) {
|
|
@@ -337,4 +352,4 @@ export {
|
|
|
337
352
|
getOverrideAgentIds,
|
|
338
353
|
resolveDefaultAgentId
|
|
339
354
|
};
|
|
340
|
-
//# sourceMappingURL=chunk-
|
|
355
|
+
//# sourceMappingURL=chunk-LNNBLB6G.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETTINGS_KEYS,
|
|
3
3
|
getSetting
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HD6Y77RO.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-LTYL6ZGH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getProjectByWorkdir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3PG65AXG.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-M6X6AIEG.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getProjectByWorkdir,
|
|
6
6
|
updateProject
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3PG65AXG.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-O6DU226D.js.map
|