openfox 2.0.134 → 2.0.136
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 +45 -0
- package/dist/CHANGELOG.md +45 -0
- package/dist/agent-defaults/builder.agent.md +1 -0
- package/dist/agent-defaults/planner.agent.md +1 -0
- package/dist/{ask-UBIRH3SO.js → ask-46J5WYRL.js} +2 -2
- package/dist/{auto-config-5VSNLVNI.js → auto-config-2A7Y2WOK.js} +25 -6
- package/dist/{backend-NDBY3DAQ.js → backend-24FTDSHF.js} +4 -2
- package/dist/{chat-handler-YCZE2XEJ.js → chat-handler-SYU4HJMI.js} +30 -26
- package/dist/{chunk-CSYOWFPU.js → chunk-342BKOTE.js} +29 -5
- package/dist/{chunk-7QMWYNVF.js → chunk-4LLGI372.js} +2 -2
- package/dist/chunk-4SBVW4UH.js +24 -0
- package/dist/{chunk-FAQDLL2X.js → chunk-5YPHN5NC.js} +8 -8
- package/dist/{chunk-ZMK4VX7V.js → chunk-64YDOCQR.js} +53 -21
- package/dist/{chunk-UV6IH6HK.js → chunk-AKWJMMEJ.js} +15 -1
- package/dist/{chunk-ORCQ3EXQ.js → chunk-BHVR2YS5.js} +2 -2
- package/dist/{chunk-7HGBJFIJ.js → chunk-CPVEONNS.js} +12 -10
- package/dist/{chunk-QDARWVQ2.js → chunk-DG2YSWMC.js} +40 -6
- package/dist/{chunk-J5HOUEPE.js → chunk-EXLCFEML.js} +86 -1010
- package/dist/chunk-FSSUPWYO.js +336 -0
- package/dist/{chunk-5UQ4CKOA.js → chunk-G5GUQKLS.js} +27 -6
- package/dist/{chunk-M4J2L4VH.js → chunk-GP5BYQMF.js} +23 -23
- package/dist/{chunk-7ET46SNE.js → chunk-HEYU7FAY.js} +3 -3
- package/dist/{chunk-MRE4OYKI.js → chunk-MILEZY2J.js} +4 -4
- package/dist/{chunk-O3RCSKUH.js → chunk-MOYWDP73.js} +2 -2
- package/dist/{chunk-J3NMNYGM.js → chunk-N5JKVNLH.js} +2 -2
- package/dist/{chunk-YLVOU7T7.js → chunk-PQKLOLGC.js} +162 -6
- package/dist/{chunk-DWA4IE65.js → chunk-Q33DL67W.js} +2 -2
- package/dist/{chunk-OZWHRBDY.js → chunk-QBWJCO5K.js} +12 -29
- package/dist/{chunk-EUOWCVU6.js → chunk-QMU3ZY2C.js} +37 -341
- package/dist/{chunk-5IXCCMFU.js → chunk-QQQBNL7A.js} +350 -157
- package/dist/{chunk-CTWZPN7G.js → chunk-QUAEH3MP.js} +29 -1
- package/dist/{chunk-5UMXFLET.js → chunk-SAGDTQXD.js} +3 -3
- package/dist/chunk-U6FHHT2B.js +1155 -0
- package/dist/{chunk-YOPXAI2W.js → chunk-UL7776XB.js} +21 -21
- package/dist/{chunk-JURM3RPZ.js → chunk-V5AC2TV7.js} +8 -13
- package/dist/{chunk-BZND27IB.js → chunk-VA2TYWQR.js} +4 -4
- package/dist/{chunk-JE7LW7Y6.js → chunk-VIJVLLPT.js} +12 -3
- package/dist/{chunk-2AI7VYPN.js → chunk-VKMPR25F.js} +9 -3
- package/dist/chunk-VWBPQZLO.js +7 -0
- package/dist/{chunk-ZTBKMVV6.js → chunk-X4PVR6AW.js} +15 -2
- package/dist/chunk-XG3AUMPI.js +72 -0
- package/dist/{chunk-MEEUXRFL.js → chunk-XGG4XCKP.js} +2 -2
- package/dist/{chunk-QICVOQNX.js → chunk-YDPC4FLR.js} +17 -11
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/client-MVI3J7SN.js +18 -0
- package/dist/{client-pure-FLKP6PTI.js → client-pure-YZ4IGCU4.js} +4 -2
- package/dist/{compactor-PD6DQ4NY.js → compactor-LBK53WAK.js} +14 -12
- package/dist/describe-image-4XDLSKAB.js +30 -0
- package/dist/{dynamic-context-WKEXQCTK.js → dynamic-context-RDBNQPPA.js} +12 -10
- package/dist/{events-3WSNI7XC.js → events-YTYYT3PR.js} +6 -6
- package/dist/export-import-GHRCOQHF.js +137 -0
- package/dist/{folding-H7JTX6KI.js → folding-3MMOPS4W.js} +4 -4
- package/dist/{http-client-A445WYZU.js → http-client-C6UYWVWZ.js} +3 -3
- package/dist/launch-YZ46OEFP.js +58 -0
- package/dist/{manager-ZACEUL5P.js → manager-FSPRJCYT.js} +4 -4
- package/dist/{model-catalog-2PCKTYGW.js → model-catalog-Y5MA5OZP.js} +2 -2
- package/dist/{orchestrator-OT66EDXO.js → orchestrator-6QGQ55NT.js} +29 -25
- package/dist/package.json +1 -1
- package/dist/{path-security-5CFMMULR.js → path-security-EC4Z2ZZG.js} +8 -8
- package/dist/{platform-XPMZKAUB.js → platform-KPKYBU54.js} +3 -3
- package/dist/{processor-CHMHMMIE.js → processor-B2RV7MVC.js} +29 -25
- package/dist/{provider-JWUNG2TD.js → provider-SOC6Z25R.js} +10 -8
- package/dist/{provider-manager-2KKZ37XJ.js → provider-manager-Y53SVVQ3.js} +10 -8
- package/dist/{registry-BEIR7Y5G.js → registry-FMDMGIUB.js} +3 -3
- package/dist/{serve-HSDVY37K.js → serve-EWA5HXC7.js} +41 -32
- package/dist/server/index.d.ts +16 -0
- package/dist/server/index.js +34 -30
- package/dist/server-ZAPAB3FS.js +61 -0
- package/dist/{service-XIUNS5XV.js → service-NKLQH647.js} +12 -9
- package/dist/{session-overrides-Y5B4XQPU.js → session-overrides-ANQBKV74.js} +11 -7
- package/dist/{sessions-IGINPPBP.js → sessions-GLYACE5R.js} +6 -4
- package/dist/{settings-ZJPM6PQV.js → settings-WH6BVQCP.js} +4 -2
- package/dist/{tasks-3JJWJJ3X.js → tasks-GPM3JAE6.js} +14 -10
- package/dist/tool-adapter-ZY4FC4C4.js +9 -0
- package/dist/{tools-WWIWD3O7.js → tools-EJOABHVO.js} +27 -23
- package/dist/{update-Q6SH7UP2.js → update-IPHJMRQZ.js} +2 -2
- package/dist/web/assets/index-CfFwerN2.js +313 -0
- package/dist/web/assets/{index-Y300llHY.css → index-ChJjYovg.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-QTLYD2FF.js +0 -7
- package/dist/client-VVYOWXRR.js +0 -16
- package/dist/launch-FJ65HRV4.js +0 -54
- package/dist/server-3UVLECD5.js +0 -57
- package/dist/tool-adapter-FJAFLDZA.js +0 -8
- package/dist/web/assets/index-C48qmBAI.js +0 -313
|
@@ -1,51 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildCachedPrompt,
|
|
3
|
+
checkToolChangesAndInject,
|
|
4
|
+
computeDynamicContextHash,
|
|
5
|
+
getToolFingerprint
|
|
6
|
+
} from "./chunk-YDPC4FLR.js";
|
|
1
7
|
import {
|
|
2
8
|
createAssemblyResult,
|
|
3
9
|
getConversationMessages,
|
|
4
10
|
getToolRegistryForAgent,
|
|
5
11
|
processEventsForConversation,
|
|
6
12
|
runTopLevelAgentLoop
|
|
7
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EXLCFEML.js";
|
|
14
|
+
import {
|
|
15
|
+
getAllInstructions,
|
|
16
|
+
getEnabledSkillMetadata
|
|
17
|
+
} from "./chunk-Q33DL67W.js";
|
|
8
18
|
import {
|
|
9
19
|
serverT
|
|
10
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4SBVW4UH.js";
|
|
11
21
|
import {
|
|
12
22
|
TurnMetrics,
|
|
13
23
|
createChatDoneEvent,
|
|
14
24
|
createMessageStartEvent
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
buildCachedPrompt,
|
|
18
|
-
checkToolChangesAndInject,
|
|
19
|
-
computeDynamicContextHash,
|
|
20
|
-
getToolFingerprint
|
|
21
|
-
} from "./chunk-QICVOQNX.js";
|
|
22
|
-
import {
|
|
23
|
-
getAllInstructions,
|
|
24
|
-
getEnabledSkillMetadata
|
|
25
|
-
} from "./chunk-DWA4IE65.js";
|
|
25
|
+
} from "./chunk-HEYU7FAY.js";
|
|
26
26
|
import {
|
|
27
27
|
buildAgentReminder,
|
|
28
28
|
buildAgentSmallReminder,
|
|
29
29
|
buildTopLevelSystemPrompt
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4LLGI372.js";
|
|
31
31
|
import {
|
|
32
32
|
PathAccessDeniedError
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-PQKLOLGC.js";
|
|
34
34
|
import {
|
|
35
35
|
getCurrentContextWindowId,
|
|
36
36
|
getCurrentWindowMessageOptions,
|
|
37
37
|
getEventStore
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-342BKOTE.js";
|
|
39
39
|
import {
|
|
40
40
|
buildSnapshotFromSessionState
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XGG4XCKP.js";
|
|
42
42
|
import {
|
|
43
43
|
findAgentById,
|
|
44
44
|
getRuntimeConfig,
|
|
45
45
|
getSubAgents,
|
|
46
46
|
loadAllAgentsDefault,
|
|
47
47
|
resolveDefaultAgentId
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-BHVR2YS5.js";
|
|
49
49
|
import {
|
|
50
50
|
logger
|
|
51
51
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
|
|
56
56
|
// src/server/chat/orchestrator.ts
|
|
57
57
|
async function buildRetryPatterns() {
|
|
58
|
-
const { getSetting, SETTINGS_KEYS } = await import("./settings-
|
|
58
|
+
const { getSetting, SETTINGS_KEYS } = await import("./settings-WH6BVQCP.js");
|
|
59
59
|
const raw = getSetting(SETTINGS_KEYS.RETRY_PATTERNS);
|
|
60
60
|
if (!raw) {
|
|
61
61
|
const oldXmlProtection = getSetting("llm.disableXmlProtection");
|
|
@@ -355,7 +355,7 @@ async function runAgentTurn(options, turnMetrics, agentId, append, callbacks) {
|
|
|
355
355
|
getConversationMessages: buildGetConversationMessages(options.sessionId, resolveAgentClient, append),
|
|
356
356
|
injectAgentReminder: () => injectAgentReminder(options.sessionId, agentDef),
|
|
357
357
|
rebuildCachedContext: async () => {
|
|
358
|
-
const { applyDynamicContext } = await import("./dynamic-context-
|
|
358
|
+
const { applyDynamicContext } = await import("./dynamic-context-RDBNQPPA.js");
|
|
359
359
|
await applyDynamicContext(options.sessionManager, options.sessionId, agentLlmClient.getModel());
|
|
360
360
|
},
|
|
361
361
|
...options.initialCompacting ? { initialCompacting: true } : {},
|
|
@@ -385,4 +385,4 @@ export {
|
|
|
385
385
|
runChatTurn,
|
|
386
386
|
runAgentTurn
|
|
387
387
|
};
|
|
388
|
-
//# sourceMappingURL=chunk-
|
|
388
|
+
//# sourceMappingURL=chunk-UL7776XB.js.map
|
|
@@ -62,18 +62,13 @@ var askUserTool = {
|
|
|
62
62
|
type: "array",
|
|
63
63
|
description: "Options for choice-type questions. Each entry may be a plain string or an object {value, label, description?} (or legacy {label, description?}). The server normalizes everything to {value, label, description?}.",
|
|
64
64
|
items: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
description: { type: "string" }
|
|
73
|
-
},
|
|
74
|
-
required: ["label"]
|
|
75
|
-
}
|
|
76
|
-
]
|
|
65
|
+
type: "object",
|
|
66
|
+
properties: {
|
|
67
|
+
value: { type: "string" },
|
|
68
|
+
label: { type: "string" },
|
|
69
|
+
description: { type: "string" }
|
|
70
|
+
},
|
|
71
|
+
required: ["label"]
|
|
77
72
|
}
|
|
78
73
|
}
|
|
79
74
|
},
|
|
@@ -173,4 +168,4 @@ export {
|
|
|
173
168
|
awaitAnswer,
|
|
174
169
|
getPendingQuestionsForSession
|
|
175
170
|
};
|
|
176
|
-
//# sourceMappingURL=chunk-
|
|
171
|
+
//# sourceMappingURL=chunk-V5AC2TV7.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createMessageStartEvent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HEYU7FAY.js";
|
|
4
4
|
import {
|
|
5
5
|
COMPACTION_PROMPT
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4LLGI372.js";
|
|
7
7
|
import {
|
|
8
8
|
getCurrentWindowMessageOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-342BKOTE.js";
|
|
10
10
|
|
|
11
11
|
// src/server/context/compactor.ts
|
|
12
12
|
function appendCompactionPrompt(sessionId, append) {
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
COMPACTION_MAX_RATIO,
|
|
37
37
|
shouldCompact
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-VA2TYWQR.js.map
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sanitizeToolSchema
|
|
3
|
+
} from "./chunk-XG3AUMPI.js";
|
|
4
|
+
|
|
1
5
|
// src/server/mcp/tool-adapter.ts
|
|
2
6
|
function createMcpTools(mcpManager) {
|
|
3
7
|
const tools = [];
|
|
@@ -10,7 +14,7 @@ function createMcpTools(mcpManager) {
|
|
|
10
14
|
function: {
|
|
11
15
|
name: prefixedName,
|
|
12
16
|
description: mcpTool.description ?? "",
|
|
13
|
-
parameters: mcpTool.inputSchema
|
|
17
|
+
parameters: sanitizeToolSchema(mcpTool.inputSchema)
|
|
14
18
|
}
|
|
15
19
|
};
|
|
16
20
|
tools.push({
|
|
@@ -19,7 +23,12 @@ function createMcpTools(mcpManager) {
|
|
|
19
23
|
mcpServer: server.name,
|
|
20
24
|
execute: async (args, _context) => {
|
|
21
25
|
const start = Date.now();
|
|
22
|
-
const
|
|
26
|
+
const normalizedArgs = { ...args };
|
|
27
|
+
if ("props" in normalizedArgs && !("properties" in normalizedArgs)) {
|
|
28
|
+
normalizedArgs["properties"] = normalizedArgs["props"];
|
|
29
|
+
delete normalizedArgs["props"];
|
|
30
|
+
}
|
|
31
|
+
const result = await mcpManager.callTool(server.name, mcpTool.name, normalizedArgs);
|
|
23
32
|
return {
|
|
24
33
|
success: result.success,
|
|
25
34
|
...result.output ? { output: result.output } : {},
|
|
@@ -37,4 +46,4 @@ function createMcpTools(mcpManager) {
|
|
|
37
46
|
export {
|
|
38
47
|
createMcpTools
|
|
39
48
|
};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-VIJVLLPT.js.map
|
|
@@ -3,6 +3,13 @@ var REASONING_EFFORT_VALUES = ["none", "minimal", "low", "medium", "high", "xhig
|
|
|
3
3
|
function isReasoningEffortValue(value) {
|
|
4
4
|
return REASONING_EFFORT_VALUES.includes(value);
|
|
5
5
|
}
|
|
6
|
+
function isReasoningEffortValidForModel(effort, model) {
|
|
7
|
+
if (!effort) return false;
|
|
8
|
+
if (isReasoningEffortValue(effort)) return true;
|
|
9
|
+
if (model?.modes?.some((m) => m.level === effort)) return true;
|
|
10
|
+
if (model?.reasoningEfforts?.includes(effort)) return true;
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
6
13
|
function resolveEffortForModel({
|
|
7
14
|
reasoningEfforts,
|
|
8
15
|
candidate,
|
|
@@ -22,8 +29,6 @@ function resolveEffortForModel({
|
|
|
22
29
|
if (override) return override;
|
|
23
30
|
return defaultEffort && reasoningEfforts.includes(defaultEffort) ? defaultEffort : void 0;
|
|
24
31
|
}
|
|
25
|
-
var MODE_SUFFIXES = ["low", "medium", "high", "xhigh", "max"];
|
|
26
|
-
var MODE_SUFFIX_REGEX = new RegExp(`-(${MODE_SUFFIXES.join("|")})$`);
|
|
27
32
|
function resolveModeModelId(modes, effort, fallbackApiModelId, modelId) {
|
|
28
33
|
const modeEntry = modes?.find((mode) => mode.level === effort);
|
|
29
34
|
if (modeEntry) {
|
|
@@ -91,9 +96,10 @@ function getCatalogDefaultEffort(modelId) {
|
|
|
91
96
|
export {
|
|
92
97
|
REASONING_EFFORT_VALUES,
|
|
93
98
|
isReasoningEffortValue,
|
|
99
|
+
isReasoningEffortValidForModel,
|
|
94
100
|
resolveEffortForModel,
|
|
95
101
|
resolveModeModelId,
|
|
96
102
|
getCatalogEntry,
|
|
97
103
|
getCatalogDefaultEffort
|
|
98
104
|
};
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-VKMPR25F.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultAgentId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BHVR2YS5.js";
|
|
4
4
|
import {
|
|
5
5
|
getDatabase
|
|
6
6
|
} from "./chunk-JU757HVI.js";
|
|
@@ -240,6 +240,18 @@ function updateSessionMessageCount(id, delta) {
|
|
|
240
240
|
} catch {
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
+
function setSessionMessageCount(id, count) {
|
|
244
|
+
try {
|
|
245
|
+
const db = getDatabase();
|
|
246
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
247
|
+
db.prepare(
|
|
248
|
+
`
|
|
249
|
+
UPDATE sessions SET message_count = ?, updated_at = ? WHERE id = ?
|
|
250
|
+
`
|
|
251
|
+
).run(count, now, id);
|
|
252
|
+
} catch {
|
|
253
|
+
}
|
|
254
|
+
}
|
|
243
255
|
function getSessionMessageCount(id) {
|
|
244
256
|
try {
|
|
245
257
|
const db = getDatabase();
|
|
@@ -456,6 +468,7 @@ export {
|
|
|
456
468
|
updateSessionCachedPrompt,
|
|
457
469
|
getSessionCachedPrompt,
|
|
458
470
|
updateSessionMessageCount,
|
|
471
|
+
setSessionMessageCount,
|
|
459
472
|
getSessionMessageCount,
|
|
460
473
|
listSessions,
|
|
461
474
|
listSessionsByProject,
|
|
@@ -471,4 +484,4 @@ export {
|
|
|
471
484
|
getLatestWorkflowExecution,
|
|
472
485
|
clearWorkflowExecution
|
|
473
486
|
};
|
|
474
|
-
//# sourceMappingURL=chunk-
|
|
487
|
+
//# sourceMappingURL=chunk-X4PVR6AW.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// src/server/llm/schema-sanitizer.ts
|
|
2
|
+
function sanitizeToolSchema(schema) {
|
|
3
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
|
|
4
|
+
return { type: "object", properties: {} };
|
|
5
|
+
}
|
|
6
|
+
return cleanSchemaNode(schema);
|
|
7
|
+
}
|
|
8
|
+
function cleanSchemaNode(node) {
|
|
9
|
+
const result = {};
|
|
10
|
+
for (const [key, val] of Object.entries(node)) {
|
|
11
|
+
if (val === null || val === void 0) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (key === "$schema" || key === "$id" || key === "$vocabulary" || key === "$anchor" || key === "dependentRequired" || key === "dependentSchemas" || key === "unevaluatedProperties" || key === "unevaluatedItems" || key === "patternProperties" || key === "additionalProperties") {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (key === "required" && Array.isArray(val)) {
|
|
18
|
+
result["required"] = val.map((item) => item === "properties" ? "props" : item);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (key === "const") {
|
|
22
|
+
result["enum"] = [val];
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (key === "properties" && val && typeof val === "object" && !Array.isArray(val)) {
|
|
26
|
+
const sanitizedProps = {};
|
|
27
|
+
for (const [propKey, propVal] of Object.entries(val)) {
|
|
28
|
+
const targetKey = propKey === "properties" ? "props" : propKey;
|
|
29
|
+
if (typeof propVal === "string") {
|
|
30
|
+
sanitizedProps[targetKey] = propVal === "object" ? { type: "object", properties: {} } : { type: propVal };
|
|
31
|
+
} else if (propVal && typeof propVal === "object" && !Array.isArray(propVal)) {
|
|
32
|
+
sanitizedProps[targetKey] = cleanSchemaNode(propVal);
|
|
33
|
+
} else {
|
|
34
|
+
sanitizedProps[targetKey] = propVal;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
result["properties"] = sanitizedProps;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (key === "items") {
|
|
41
|
+
if (!val || typeof val !== "object" || Object.keys(val).length === 0) {
|
|
42
|
+
result["items"] = { type: "string" };
|
|
43
|
+
} else if (Array.isArray(val)) {
|
|
44
|
+
result["items"] = val.map(
|
|
45
|
+
(item) => item && typeof item === "object" ? cleanSchemaNode(item) : item
|
|
46
|
+
);
|
|
47
|
+
} else {
|
|
48
|
+
result["items"] = cleanSchemaNode(val);
|
|
49
|
+
}
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if ((key === "anyOf" || key === "oneOf" || key === "allOf") && Array.isArray(val)) {
|
|
53
|
+
result[key] = val.map(
|
|
54
|
+
(item) => item && typeof item === "object" ? cleanSchemaNode(item) : item
|
|
55
|
+
);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
result[key] = val;
|
|
59
|
+
}
|
|
60
|
+
if (result["type"] === "object" && !result["properties"]) {
|
|
61
|
+
result["properties"] = {};
|
|
62
|
+
}
|
|
63
|
+
if (result["type"] === "array" && (!result["items"] || typeof result["items"] === "object" && Object.keys(result["items"]).length === 0)) {
|
|
64
|
+
result["items"] = { type: "string" };
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
sanitizeToolSchema
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=chunk-XG3AUMPI.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultAgentId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BHVR2YS5.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeAskOptions
|
|
6
6
|
} from "./chunk-LCLH6ZUL.js";
|
|
@@ -965,4 +965,4 @@ export {
|
|
|
965
965
|
buildSnapshot,
|
|
966
966
|
buildSnapshotFromSessionState
|
|
967
967
|
};
|
|
968
|
-
//# sourceMappingURL=chunk-
|
|
968
|
+
//# sourceMappingURL=chunk-XGG4XCKP.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAllInstructions,
|
|
3
3
|
getEnabledSkillMetadata
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q33DL67W.js";
|
|
5
5
|
import {
|
|
6
6
|
buildTopLevelSystemPrompt
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4LLGI372.js";
|
|
8
8
|
import {
|
|
9
9
|
getCurrentContextWindowId,
|
|
10
10
|
getEventStore
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-342BKOTE.js";
|
|
12
12
|
import {
|
|
13
13
|
findAgentById,
|
|
14
14
|
getRuntimeConfig,
|
|
15
15
|
getSubAgents,
|
|
16
16
|
loadAllAgentsDefault,
|
|
17
17
|
resolveDefaultAgentId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-BHVR2YS5.js";
|
|
19
19
|
import {
|
|
20
20
|
logger
|
|
21
21
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -223,8 +223,7 @@ async function injectDriftReminders(sessionManager, sessionId, agentDef, options
|
|
|
223
223
|
if (!cached) {
|
|
224
224
|
return { injectedToolReminder: false, injectedPromptReminder: false };
|
|
225
225
|
}
|
|
226
|
-
const
|
|
227
|
-
const liveTools = getToolRegistryForAgent(agentDef, sessionId).definitions;
|
|
226
|
+
const liveTools = await getEffectiveToolDefinitions(agentDef, sessionId, options.modelName);
|
|
228
227
|
let injectedToolReminder = false;
|
|
229
228
|
let injectedPromptReminder = false;
|
|
230
229
|
const liveToolFingerprint = getToolSetFingerprint(liveTools);
|
|
@@ -327,10 +326,17 @@ function resolveAgentDef(sessionManager, sessionId) {
|
|
|
327
326
|
return findAgentById(session.mode, allAgents) ?? findAgentById(resolveDefaultAgentId(), allAgents);
|
|
328
327
|
});
|
|
329
328
|
}
|
|
329
|
+
async function getEffectiveToolDefinitions(agentDef, sessionId, modelName) {
|
|
330
|
+
const { getToolRegistryForAgent } = await import("./tools-EJOABHVO.js");
|
|
331
|
+
const { isDescribeImageEligible } = await import("./describe-image-4XDLSKAB.js");
|
|
332
|
+
const all = getToolRegistryForAgent(agentDef, sessionId).definitions;
|
|
333
|
+
const eligible = await isDescribeImageEligible(modelName);
|
|
334
|
+
if (eligible) return all;
|
|
335
|
+
return all.filter((d) => d.function.name !== "describe_image");
|
|
336
|
+
}
|
|
330
337
|
async function buildCachedPrompt(sessionManager, sessionId, agentDef, modelName) {
|
|
331
338
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
332
|
-
const
|
|
333
|
-
const tools = getToolRegistryForAgent(agentDef, sessionId).definitions;
|
|
339
|
+
const tools = await getEffectiveToolDefinitions(agentDef, sessionId, modelName);
|
|
334
340
|
const toolFingerprint = getToolFingerprint(tools);
|
|
335
341
|
const allAgents = await loadAllAgentsDefault(sessionManager.getProjectWorkdir(sessionId));
|
|
336
342
|
const subAgentDefs = getSubAgents(allAgents);
|
|
@@ -349,8 +355,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef, modelName)
|
|
|
349
355
|
async function computeSessionHash(sessionManager, sessionId, modelName) {
|
|
350
356
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
351
357
|
const agentDef = await resolveAgentDef(sessionManager, sessionId);
|
|
352
|
-
const
|
|
353
|
-
const tools = getToolRegistryForAgent(agentDef, sessionId).definitions;
|
|
358
|
+
const tools = await getEffectiveToolDefinitions(agentDef, sessionId, modelName);
|
|
354
359
|
const toolFingerprint = getToolFingerprint(tools);
|
|
355
360
|
return computeDynamicContextHash(instructionContent, skills, toolFingerprint, modelName);
|
|
356
361
|
}
|
|
@@ -386,8 +391,9 @@ export {
|
|
|
386
391
|
checkToolChangesAndInject,
|
|
387
392
|
injectContextDriftReminders,
|
|
388
393
|
injectContextDriftRemindersForSessions,
|
|
394
|
+
getEffectiveToolDefinitions,
|
|
389
395
|
buildCachedPrompt,
|
|
390
396
|
computeSessionHash,
|
|
391
397
|
applyDynamicContext
|
|
392
398
|
};
|
|
393
|
-
//# sourceMappingURL=chunk-
|
|
399
|
+
//# sourceMappingURL=chunk-YDPC4FLR.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createLLMClient
|
|
3
|
+
} from "./chunk-64YDOCQR.js";
|
|
4
|
+
import "./chunk-TS5WKTFB.js";
|
|
5
|
+
import "./chunk-AKWJMMEJ.js";
|
|
6
|
+
import "./chunk-HNCM3D7Y.js";
|
|
7
|
+
import "./chunk-QMU3ZY2C.js";
|
|
8
|
+
import "./chunk-FSSUPWYO.js";
|
|
9
|
+
import "./chunk-XG3AUMPI.js";
|
|
10
|
+
import "./chunk-N5JKVNLH.js";
|
|
11
|
+
import "./chunk-QUAEH3MP.js";
|
|
12
|
+
import "./chunk-JU757HVI.js";
|
|
13
|
+
import "./chunk-K44MW7JJ.js";
|
|
14
|
+
import "./chunk-YLJ4XMA6.js";
|
|
15
|
+
export {
|
|
16
|
+
createLLMClient
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=client-MVI3J7SN.js.map
|
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
mapFinishReason,
|
|
9
9
|
parseToolArguments,
|
|
10
10
|
resolveAttachmentsInMessages
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QMU3ZY2C.js";
|
|
12
|
+
import "./chunk-FSSUPWYO.js";
|
|
13
|
+
import "./chunk-XG3AUMPI.js";
|
|
12
14
|
import "./chunk-YLJ4XMA6.js";
|
|
13
15
|
export {
|
|
14
16
|
buildModelParams,
|
|
@@ -21,4 +23,4 @@ export {
|
|
|
21
23
|
parseToolArguments,
|
|
22
24
|
resolveAttachmentsInMessages
|
|
23
25
|
};
|
|
24
|
-
//# sourceMappingURL=client-pure-
|
|
26
|
+
//# sourceMappingURL=client-pure-YZ4IGCU4.js.map
|
|
@@ -3,22 +3,24 @@ import {
|
|
|
3
3
|
COMPACTION_MAX_RATIO,
|
|
4
4
|
appendCompactionPrompt,
|
|
5
5
|
shouldCompact
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-VA2TYWQR.js";
|
|
7
|
+
import "./chunk-HEYU7FAY.js";
|
|
8
|
+
import "./chunk-4LLGI372.js";
|
|
9
|
+
import "./chunk-342BKOTE.js";
|
|
10
|
+
import "./chunk-XGG4XCKP.js";
|
|
11
|
+
import "./chunk-X4PVR6AW.js";
|
|
12
|
+
import "./chunk-BHVR2YS5.js";
|
|
13
13
|
import "./chunk-OSXPQSLW.js";
|
|
14
14
|
import "./chunk-LCLH6ZUL.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-MOYWDP73.js";
|
|
16
16
|
import "./chunk-J2GP3J3X.js";
|
|
17
17
|
import "./chunk-DPFET73G.js";
|
|
18
18
|
import "./chunk-TS5WKTFB.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-AKWJMMEJ.js";
|
|
20
|
+
import "./chunk-QMU3ZY2C.js";
|
|
21
|
+
import "./chunk-FSSUPWYO.js";
|
|
22
|
+
import "./chunk-XG3AUMPI.js";
|
|
23
|
+
import "./chunk-QUAEH3MP.js";
|
|
22
24
|
import "./chunk-JU757HVI.js";
|
|
23
25
|
import "./chunk-K44MW7JJ.js";
|
|
24
26
|
import "./chunk-CQGTEGKL.js";
|
|
@@ -29,4 +31,4 @@ export {
|
|
|
29
31
|
appendCompactionPrompt,
|
|
30
32
|
shouldCompact
|
|
31
33
|
};
|
|
32
|
-
//# sourceMappingURL=compactor-
|
|
34
|
+
//# sourceMappingURL=compactor-LBK53WAK.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
describeImageTool,
|
|
3
|
+
isDescribeImageEligible
|
|
4
|
+
} from "./chunk-U6FHHT2B.js";
|
|
5
|
+
import "./chunk-4SBVW4UH.js";
|
|
6
|
+
import "./chunk-V5AC2TV7.js";
|
|
7
|
+
import "./chunk-PQKLOLGC.js";
|
|
8
|
+
import "./chunk-342BKOTE.js";
|
|
9
|
+
import "./chunk-XGG4XCKP.js";
|
|
10
|
+
import "./chunk-X4PVR6AW.js";
|
|
11
|
+
import "./chunk-BHVR2YS5.js";
|
|
12
|
+
import "./chunk-OSXPQSLW.js";
|
|
13
|
+
import "./chunk-AATMPL7S.js";
|
|
14
|
+
import "./chunk-LCLH6ZUL.js";
|
|
15
|
+
import "./chunk-MOYWDP73.js";
|
|
16
|
+
import "./chunk-DPFET73G.js";
|
|
17
|
+
import "./chunk-TS5WKTFB.js";
|
|
18
|
+
import "./chunk-FSSUPWYO.js";
|
|
19
|
+
import "./chunk-QUAEH3MP.js";
|
|
20
|
+
import "./chunk-JU757HVI.js";
|
|
21
|
+
import "./chunk-K44MW7JJ.js";
|
|
22
|
+
import "./chunk-HF3NDXB4.js";
|
|
23
|
+
import "./chunk-24YKXKCG.js";
|
|
24
|
+
import "./chunk-CQGTEGKL.js";
|
|
25
|
+
import "./chunk-YLJ4XMA6.js";
|
|
26
|
+
export {
|
|
27
|
+
describeImageTool,
|
|
28
|
+
isDescribeImageEligible
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=describe-image-4XDLSKAB.js.map
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
computeToolDiff,
|
|
9
9
|
computeUnifiedDiff,
|
|
10
10
|
detectToolChanges,
|
|
11
|
+
getEffectiveToolDefinitions,
|
|
11
12
|
getToolFingerprint,
|
|
12
13
|
getToolSetFingerprint,
|
|
13
14
|
getToolSignature,
|
|
@@ -15,18 +16,18 @@ import {
|
|
|
15
16
|
injectContextDriftRemindersForSessions,
|
|
16
17
|
renderSystemPromptDiff,
|
|
17
18
|
renderToolChangeReminder
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-YDPC4FLR.js";
|
|
20
|
+
import "./chunk-Q33DL67W.js";
|
|
21
|
+
import "./chunk-4LLGI372.js";
|
|
22
|
+
import "./chunk-342BKOTE.js";
|
|
23
|
+
import "./chunk-XGG4XCKP.js";
|
|
24
|
+
import "./chunk-X4PVR6AW.js";
|
|
25
|
+
import "./chunk-BHVR2YS5.js";
|
|
25
26
|
import "./chunk-OSXPQSLW.js";
|
|
26
27
|
import "./chunk-LCLH6ZUL.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-MOYWDP73.js";
|
|
28
29
|
import "./chunk-DPFET73G.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-QUAEH3MP.js";
|
|
30
31
|
import "./chunk-JU757HVI.js";
|
|
31
32
|
import "./chunk-K44MW7JJ.js";
|
|
32
33
|
import "./chunk-CQGTEGKL.js";
|
|
@@ -41,6 +42,7 @@ export {
|
|
|
41
42
|
computeToolDiff,
|
|
42
43
|
computeUnifiedDiff,
|
|
43
44
|
detectToolChanges,
|
|
45
|
+
getEffectiveToolDefinitions,
|
|
44
46
|
getToolFingerprint,
|
|
45
47
|
getToolSetFingerprint,
|
|
46
48
|
getToolSignature,
|
|
@@ -49,4 +51,4 @@ export {
|
|
|
49
51
|
renderSystemPromptDiff,
|
|
50
52
|
renderToolChangeReminder
|
|
51
53
|
};
|
|
52
|
-
//# sourceMappingURL=dynamic-context-
|
|
54
|
+
//# sourceMappingURL=dynamic-context-RDBNQPPA.js.map
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
isStoredEvent,
|
|
41
41
|
isTurnEvent,
|
|
42
42
|
truncateSessionMessages
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-342BKOTE.js";
|
|
44
44
|
import {
|
|
45
45
|
buildContextMessagesFromEventHistory,
|
|
46
46
|
buildContextMessagesFromMessages,
|
|
@@ -57,13 +57,13 @@ import {
|
|
|
57
57
|
foldTodos,
|
|
58
58
|
foldTurnEventsToSnapshotMessages,
|
|
59
59
|
getMessagesForWindow
|
|
60
|
-
} from "./chunk-
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
60
|
+
} from "./chunk-XGG4XCKP.js";
|
|
61
|
+
import "./chunk-X4PVR6AW.js";
|
|
62
|
+
import "./chunk-BHVR2YS5.js";
|
|
63
63
|
import "./chunk-OSXPQSLW.js";
|
|
64
64
|
import "./chunk-LCLH6ZUL.js";
|
|
65
65
|
import "./chunk-DPFET73G.js";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-QUAEH3MP.js";
|
|
67
67
|
import "./chunk-JU757HVI.js";
|
|
68
68
|
import "./chunk-K44MW7JJ.js";
|
|
69
69
|
import "./chunk-CQGTEGKL.js";
|
|
@@ -126,4 +126,4 @@ export {
|
|
|
126
126
|
isTurnEvent,
|
|
127
127
|
truncateSessionMessages
|
|
128
128
|
};
|
|
129
|
-
//# sourceMappingURL=events-
|
|
129
|
+
//# sourceMappingURL=events-YTYYT3PR.js.map
|