nolo-cli 0.15.0 → 0.16.0-alpha.10
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/{_executeModel-QAUS6B7J.js → _executeModel-6BR65FSI.js} +29 -28
- package/{action-GUOZYYGN.js → action-F5JACQBG.js} +4 -4
- package/{addContentAction-QDGHGUBH.js → addContentAction-AQXEYRBE.js} +3 -3
- package/{addDialogAgentAction-Z4YCYZIV.js → addDialogAgentAction-EJHHJZWW.js} +2 -2
- package/{agentDeleteCommand-QDO62EZA.js → agentDeleteCommand-PBIUC4FT.js} +18 -17
- package/{agentEmailCommands-UZ5BKX3P.js → agentEmailCommands-KNZY4HXV.js} +35 -34
- package/{agentListCommands-ZC33UDWT.js → agentListCommands-N64PHBXM.js} +20 -19
- package/{agentMachineCommands-RZGZEZRL.js → agentMachineCommands-2AIPJKFM.js} +18 -17
- package/{agentRecordCommands-DGDXE2VH.js → agentRecordCommands-TB4N7YSB.js} +34 -33
- package/{agentRunCommand-SRZWFOPH.js → agentRunCommand-UVW2ZLKT.js} +34 -33
- package/{agentRuntimeLocal-4YCF6IRF.js → agentRuntimeLocal-T6YECTNF.js} +15 -16
- package/{agentSlice-IVE735EV.js → agentSlice-533PEM4O.js} +3 -3
- package/{appDeleteCommands-7I26L64I.js → appDeleteCommands-D6B6Z4ZQ.js} +19 -18
- package/{appDeployCommands-TZLZNTJN.js → appDeployCommands-YMO5FK4T.js} +19 -18
- package/{appDeployStatusCommands-OPPTLHRW.js → appDeployStatusCommands-EO5DWWPQ.js} +19 -18
- package/{appGetCommands-N2S4HYKY.js → appGetCommands-6SMZ3URQ.js} +19 -18
- package/{appListCommands-OBTPPKUM.js → appListCommands-RZXSWR2G.js} +19 -18
- package/{authCommand-YFTR3347.js → authCommand-MSSBXCQ6.js} +8 -2
- package/{chunk-OQMPU2ML.js → chunk-2OUI4TLC.js} +4 -4
- package/{chunk-SFXYKGK2.js → chunk-3S2VOMIF.js} +3 -3
- package/{chunk-JBKVPAYK.js → chunk-6KBBMW4D.js} +2 -2
- package/{chunk-U7LEGLEB.js → chunk-6N4KODMN.js} +1 -1
- package/{chunk-IZ2QRVEU.js → chunk-A7O4KKLZ.js} +3 -3
- package/{chunk-WA6KZL5V.js → chunk-AAODAAUQ.js} +23 -20
- package/{chunk-K53477EY.js → chunk-C4MMO7W4.js} +1 -1
- package/{chunk-YNHQIXX5.js → chunk-CXM4IIUF.js} +21 -21
- package/{chunk-JKWWVF2I.js → chunk-D3HVJJIA.js} +1 -1
- package/{chunk-XGQZFBO5.js → chunk-DBLHEQH7.js} +148 -175
- package/{chunk-TTGAVETO.js → chunk-EABWT43X.js} +2 -2
- package/{chunk-OKSYPTDZ.js → chunk-F3UOACU4.js} +1 -1
- package/{chunk-VE6XMVKG.js → chunk-G2IQGDQZ.js} +163 -53
- package/{chunk-RKM3K52F.js → chunk-GPELDE6I.js} +2 -2
- package/{chunk-OGGHETUE.js → chunk-HQPG2PIV.js} +62 -19
- package/{chunk-XVP3C2KY.js → chunk-IWLUTMYX.js} +1 -1
- package/{chunk-B4KT7RN2.js → chunk-JTMNCCWF.js} +2 -2
- package/chunk-KFEVY3ST.js +255 -0
- package/{chunk-WNLPAOIT.js → chunk-KFHN5NGJ.js} +1 -1
- package/{chunk-P4MJQWWF.js → chunk-KPD4CEQD.js} +2 -2
- package/{chunk-G2MKOQCB.js → chunk-KPJWHHG4.js} +1 -1
- package/{chunk-ISYE6GZB.js → chunk-L6NVTGI7.js} +1 -1
- package/{chunk-O53CP2QR.js → chunk-LCMAJFAD.js} +3 -3
- package/{chunk-UXKQQ2MR.js → chunk-LO6JNGCT.js} +3 -3
- package/{chunk-472E5RMQ.js → chunk-MSA4JAOZ.js} +1 -1
- package/{chunk-HRQCKQA5.js → chunk-MUCU6ATG.js} +8 -257
- package/{chunk-524BDL33.js → chunk-O6W2O2DA.js} +1 -15
- package/{chunk-4QQFLN5C.js → chunk-OVBVEXZ7.js} +4 -4
- package/{chunk-IOQ7IBPU.js → chunk-PU4LXVAC.js} +1 -1
- package/{chunk-Z24FGIU2.js → chunk-R4L524UB.js} +3 -3
- package/{chunk-4IJYA27C.js → chunk-RG2U2MTJ.js} +1 -1
- package/{chunk-6MHDWKOT.js → chunk-RIF3XLXK.js} +9 -5
- package/{chunk-IKXL2HZ3.js → chunk-RK5NYQEL.js} +1 -1
- package/{chunk-JS33TCQ3.js → chunk-RPDGJO4D.js} +2 -2
- package/{chunk-BFRVXJJJ.js → chunk-SI73WO7P.js} +10 -10
- package/{chunk-WRN5EQT7.js → chunk-T26DWCH5.js} +3 -3
- package/{chunk-EHLHSX7R.js → chunk-UB4RYYNQ.js} +9 -2
- package/{chunk-5VMYGIIL.js → chunk-VHXXRWNL.js} +23 -9
- package/{chunk-OOIN7HSO.js → chunk-XJITGCTM.js} +10 -1
- package/{chunk-AWDOJBHW.js → chunk-XJYXSTBK.js} +883 -174
- package/{chunk-V2J635L5.js → chunk-XOIF2TNF.js} +2 -2
- package/{chunk-VPTJB4HM.js → chunk-XPC5C7BK.js} +0 -3
- package/{chunk-NTC6I2FN.js → chunk-XRSPI6CP.js} +1 -1
- package/{chunk-N5424GSW.js → chunk-YJKXGHJ6.js} +1 -1
- package/chunk-ZHXJ6M7T.js +27 -0
- package/{chunk-6565R2TI.js → chunk-ZOQNJXMS.js} +23 -18
- package/{createAgentAutomationAction-TS6NNZ4X.js → createAgentAutomationAction-OARFMDWU.js} +13 -13
- package/{createDialogAction-5HVQ33EX.js → createDialogAction-4E6ALCDK.js} +14 -14
- package/{createPageAction-4F3ZGQJD.js → createPageAction-RS65DDRX.js} +13 -13
- package/{dbSlice-OP6UPXKA.js → dbSlice-7KQH6GOU.js} +2 -2
- package/{dialogCommands-3GEPXHFB.js → dialogCommands-DFY5HJ6M.js} +19 -18
- package/{dialogSlice-FAWUQDJW.js → dialogSlice-MS7OYWHW.js} +13 -13
- package/{docCreateCommands-ZE3S6BCP.js → docCreateCommands-5L76YTI2.js} +18 -17
- package/{docDeleteCommands-TW6PGTRT.js → docDeleteCommands-3GASP3VR.js} +19 -18
- package/{docReadCommands-LDXL3B6J.js → docReadCommands-ALA77AZM.js} +18 -17
- package/{docStore-2UHVWLTV.js → docStore-KYTKNGMU.js} +14 -14
- package/{docUpdateCommands-GYD6XI5O.js → docUpdateCommands-6AZGXE5M.js} +18 -17
- package/{getPricing-UGDJHI7M.js → getPricing-RYY6OBA4.js} +4 -4
- package/{handleSendMessageAction-LJPUYNOH.js → handleSendMessageAction-LHTGYRMN.js} +201 -15
- package/index.js +47 -47
- package/{machineCommands-OKNDYS3M.js → machineCommands-RDQQBA72.js} +33 -32
- package/{machineWsRunDispatch-ZX5AJ6FJ.js → machineWsRunDispatch-27RCTQQF.js} +33 -32
- package/{models-LSCRJJ6P.js → models-5K5G2CZI.js} +2 -2
- package/package.json +1 -1
- package/{read-HXHAZBKH.js → read-CN3TNXIP.js} +1 -1
- package/{readDocTool-VPBDTO4G.js → readDocTool-WF3675ED.js} +1 -1
- package/{readlineWorkspace-MB3ANKHM.js → readlineWorkspace-BTONC7NW.js} +177 -76
- package/{removeDialogAgentAction-HUFVN35S.js → removeDialogAgentAction-YDHBFEGI.js} +5 -5
- package/{runAgentClientLoop-A75BUU6D.js → runAgentClientLoop-Q4CL22BP.js} +26 -25
- package/{setDialogExtraReferencesAction-2VLGWQKG.js → setDialogExtraReferencesAction-LR6MSIXO.js} +2 -2
- package/{setPrimaryDialogAgentAction-VB4UV2CC.js → setPrimaryDialogAgentAction-IIVDCY5C.js} +5 -5
- package/{settingSlice-7JYPQNAC.js → settingSlice-O23YDK2O.js} +3 -3
- package/{spaceCommands-O3KJNCON.js → spaceCommands-AB2D7A2R.js} +18 -17
- package/{spaceSlice-444MFUP6.js → spaceSlice-XLJ4DRG6.js} +13 -13
- package/{streamAgentChatTurn-DJAE7USZ.js → streamAgentChatTurn-YYAAGLZL.js} +30 -32
- package/{tools-YB6LXSVN.js → tools-5UKY65R3.js} +20 -20
- package/{tuiSummaryLlmCaller-QQL3JA5I.js → tuiSummaryLlmCaller-VUNVBRX3.js} +7 -6
- package/{updateDialogTitleAction-6HGFBM64.js → updateDialogTitleAction-VNSUVPUZ.js} +13 -13
- package/chunk-BYXBJQAS.js +0 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isRecord
|
|
3
|
+
} from "./chunk-KUG52IAP.js";
|
|
4
|
+
import {
|
|
5
|
+
asOptionalTrimmedString
|
|
6
|
+
} from "./chunk-G3SUCT4W.js";
|
|
7
|
+
|
|
8
|
+
// packages/agent-runtime/openAiCompatibleMessages.ts
|
|
9
|
+
function preserveAgentStateFields(source, target, options) {
|
|
10
|
+
const mutableTarget = target;
|
|
11
|
+
if (source.role === "assistant") {
|
|
12
|
+
if (!options?.stripReasoningContent && typeof source.reasoning_content === "string") {
|
|
13
|
+
mutableTarget.reasoning_content = source.reasoning_content;
|
|
14
|
+
}
|
|
15
|
+
if (Array.isArray(source.tool_calls)) {
|
|
16
|
+
mutableTarget.tool_calls = source.tool_calls;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (source.role === "tool") {
|
|
20
|
+
const toolCallId = typeof source.tool_call_id === "string" ? source.tool_call_id.trim() : typeof source.toolCallId === "string" ? source.toolCallId.trim() : "";
|
|
21
|
+
if (toolCallId) mutableTarget.tool_call_id = toolCallId;
|
|
22
|
+
}
|
|
23
|
+
return target;
|
|
24
|
+
}
|
|
25
|
+
function toOpenAiCompatibleMessages(messages, options) {
|
|
26
|
+
return messages.map(
|
|
27
|
+
(message) => preserveAgentStateFields(message, {
|
|
28
|
+
role: message.role,
|
|
29
|
+
content: message.content ?? ""
|
|
30
|
+
}, options)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function shouldStripReasoningContentForOutbound(provider, model) {
|
|
34
|
+
const p = provider?.trim().toLowerCase();
|
|
35
|
+
const m = model?.trim().toLowerCase();
|
|
36
|
+
if (!p || !m) return false;
|
|
37
|
+
if (p === "deepseek" || p === "nolo") return m === "deepseek-v4-flash";
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// packages/integrations/openai/responsesHelpers.ts
|
|
42
|
+
var RESPONSES_TOP_LEVEL_SCHEMA_KEYS = ["anyOf", "oneOf", "allOf", "enum", "not"];
|
|
43
|
+
var sanitizeResponsesParameters = (parameters) => {
|
|
44
|
+
if (!isRecord(parameters)) {
|
|
45
|
+
return parameters;
|
|
46
|
+
}
|
|
47
|
+
const next = { ...parameters };
|
|
48
|
+
for (const key of RESPONSES_TOP_LEVEL_SCHEMA_KEYS) {
|
|
49
|
+
delete next[key];
|
|
50
|
+
}
|
|
51
|
+
return next;
|
|
52
|
+
};
|
|
53
|
+
var appendTextPart = (parts, text, role) => {
|
|
54
|
+
if (!text) return;
|
|
55
|
+
const last = parts.at(-1);
|
|
56
|
+
const textType = role === "assistant" ? "output_text" : "input_text";
|
|
57
|
+
if (last?.type === textType) {
|
|
58
|
+
last.text += text;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
parts.push({ type: textType, text });
|
|
62
|
+
};
|
|
63
|
+
var normalizeMessageParts = (content, role) => {
|
|
64
|
+
if (typeof content === "string") {
|
|
65
|
+
if (!content) return [];
|
|
66
|
+
return [
|
|
67
|
+
{
|
|
68
|
+
type: role === "assistant" ? "output_text" : "input_text",
|
|
69
|
+
text: content
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
const parts = [];
|
|
74
|
+
for (const part of content ?? []) {
|
|
75
|
+
const typedPart = part;
|
|
76
|
+
if (typedPart?.type === "text" && typeof typedPart.text === "string") {
|
|
77
|
+
appendTextPart(parts, typedPart.text, role);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (typedPart?.type === "image_url" && typeof typedPart.image_url?.url === "string" && typedPart.image_url.url) {
|
|
81
|
+
if (role === "assistant") continue;
|
|
82
|
+
parts.push({
|
|
83
|
+
type: "input_image",
|
|
84
|
+
image_url: typedPart.image_url.url,
|
|
85
|
+
detail: typedPart.image_url.detail
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return parts;
|
|
90
|
+
};
|
|
91
|
+
var normalizeToolOutput = (content) => {
|
|
92
|
+
if (typeof content === "string") return content;
|
|
93
|
+
return JSON.stringify(content ?? "");
|
|
94
|
+
};
|
|
95
|
+
var toResponsesTools = (tools) => {
|
|
96
|
+
if (!Array.isArray(tools) || tools.length === 0) return void 0;
|
|
97
|
+
return tools.map((tool) => {
|
|
98
|
+
const fn = tool?.function;
|
|
99
|
+
if (!fn?.name) return null;
|
|
100
|
+
return {
|
|
101
|
+
type: "function",
|
|
102
|
+
name: fn.name,
|
|
103
|
+
description: fn.description,
|
|
104
|
+
parameters: sanitizeResponsesParameters(fn.parameters),
|
|
105
|
+
strict: fn.strict
|
|
106
|
+
};
|
|
107
|
+
}).filter(Boolean);
|
|
108
|
+
};
|
|
109
|
+
var convertMessagesToResponsesInput = (messages, options) => {
|
|
110
|
+
const input = [];
|
|
111
|
+
for (const message of messages) {
|
|
112
|
+
if (!message?.role) continue;
|
|
113
|
+
if (message.role === "tool") {
|
|
114
|
+
if (!message.tool_call_id) continue;
|
|
115
|
+
input.push({
|
|
116
|
+
type: "function_call_output",
|
|
117
|
+
call_id: message.tool_call_id,
|
|
118
|
+
output: normalizeToolOutput(message.content)
|
|
119
|
+
});
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const role = message.role;
|
|
123
|
+
if (role === "assistant" && !options?.stripReasoningContent && typeof message.reasoning_content === "string" && message.reasoning_content) {
|
|
124
|
+
input.push({ type: "reasoning", content: message.reasoning_content });
|
|
125
|
+
}
|
|
126
|
+
const contentParts = normalizeMessageParts(message.content, role);
|
|
127
|
+
if (contentParts.length > 0) {
|
|
128
|
+
input.push({
|
|
129
|
+
type: "message",
|
|
130
|
+
role,
|
|
131
|
+
content: contentParts
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
if (role === "assistant" && Array.isArray(message.content)) {
|
|
135
|
+
const replayImages = message.content.map((part) => part).filter(
|
|
136
|
+
(part) => part?.type === "image_url" && typeof part.image_url?.url === "string" && Boolean(part.image_url.url)
|
|
137
|
+
).map((part) => ({
|
|
138
|
+
type: "input_image",
|
|
139
|
+
image_url: part.image_url.url,
|
|
140
|
+
detail: part.image_url.detail
|
|
141
|
+
}));
|
|
142
|
+
if (replayImages.length > 0) {
|
|
143
|
+
input.push({
|
|
144
|
+
type: "message",
|
|
145
|
+
role: "user",
|
|
146
|
+
content: replayImages
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (role === "assistant" && Array.isArray(message.tool_calls)) {
|
|
151
|
+
for (const toolCall of message.tool_calls) {
|
|
152
|
+
if (!toolCall?.id || !toolCall.function?.name) continue;
|
|
153
|
+
input.push({
|
|
154
|
+
type: "function_call",
|
|
155
|
+
call_id: toolCall.id,
|
|
156
|
+
name: toolCall.function.name,
|
|
157
|
+
arguments: typeof toolCall.function.arguments === "string" ? toolCall.function.arguments : JSON.stringify(toolCall.function.arguments ?? {})
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return input;
|
|
163
|
+
};
|
|
164
|
+
var extractTextFromResponseOutput = (response) => {
|
|
165
|
+
const parts = [];
|
|
166
|
+
for (const item of response?.output ?? []) {
|
|
167
|
+
if (item?.type !== "message") continue;
|
|
168
|
+
for (const content of item.content ?? []) {
|
|
169
|
+
if (content?.type === "output_text" && typeof content.text === "string") {
|
|
170
|
+
parts.push(content.text);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return parts.join("");
|
|
175
|
+
};
|
|
176
|
+
var toDataUrl = (base64Data, mimeType) => {
|
|
177
|
+
const normalizedMimeType = asOptionalTrimmedString(mimeType) ?? "image/png";
|
|
178
|
+
return `data:${normalizedMimeType};base64,${base64Data}`;
|
|
179
|
+
};
|
|
180
|
+
var extractImagePartsFromResponseOutput = (response) => {
|
|
181
|
+
const images = [];
|
|
182
|
+
for (const item of response?.output ?? []) {
|
|
183
|
+
if (item?.type === "image_generation_call") {
|
|
184
|
+
const result = asOptionalTrimmedString(item.result);
|
|
185
|
+
if (result) {
|
|
186
|
+
const outputFormat = asOptionalTrimmedString(item.output_format);
|
|
187
|
+
images.push({
|
|
188
|
+
type: "image_url",
|
|
189
|
+
image_url: {
|
|
190
|
+
url: toDataUrl(
|
|
191
|
+
result,
|
|
192
|
+
outputFormat ? `image/${outputFormat}` : void 0
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (item?.type !== "message") continue;
|
|
200
|
+
for (const content of item.content ?? []) {
|
|
201
|
+
const result = asOptionalTrimmedString(content?.result);
|
|
202
|
+
if (content?.type === "output_image" && result) {
|
|
203
|
+
images.push({
|
|
204
|
+
type: "image_url",
|
|
205
|
+
image_url: {
|
|
206
|
+
url: toDataUrl(
|
|
207
|
+
result,
|
|
208
|
+
content.mime_type ?? content.mimeType ?? null
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return images;
|
|
216
|
+
};
|
|
217
|
+
var extractToolCallsFromResponseOutput = (response) => {
|
|
218
|
+
const calls = [];
|
|
219
|
+
for (const item of response?.output ?? []) {
|
|
220
|
+
if (item?.type !== "function_call") continue;
|
|
221
|
+
if (!item.call_id || !item.name) continue;
|
|
222
|
+
calls.push({
|
|
223
|
+
id: item.call_id,
|
|
224
|
+
type: "function",
|
|
225
|
+
function: {
|
|
226
|
+
name: item.name,
|
|
227
|
+
arguments: typeof item.arguments === "string" ? item.arguments : JSON.stringify(item.arguments ?? {})
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return calls;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
// packages/core/chat/imageParts.ts
|
|
235
|
+
function isImageUrlPart(part) {
|
|
236
|
+
return isRecord(part) && part.type === "image_url";
|
|
237
|
+
}
|
|
238
|
+
function hasImageParts(messages) {
|
|
239
|
+
return messages.some(
|
|
240
|
+
(message) => Array.isArray(message.content) && message.content.some(isImageUrlPart)
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export {
|
|
245
|
+
isImageUrlPart,
|
|
246
|
+
hasImageParts,
|
|
247
|
+
preserveAgentStateFields,
|
|
248
|
+
toOpenAiCompatibleMessages,
|
|
249
|
+
shouldStripReasoningContentForOutbound,
|
|
250
|
+
toResponsesTools,
|
|
251
|
+
convertMessagesToResponsesInput,
|
|
252
|
+
extractTextFromResponseOutput,
|
|
253
|
+
extractImagePartsFromResponseOutput,
|
|
254
|
+
extractToolCallsFromResponseOutput
|
|
255
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearCliLocalRuntimePreparedAgentCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XJYXSTBK.js";
|
|
4
4
|
import {
|
|
5
5
|
getReadableCliDb
|
|
6
6
|
} from "./chunk-W4NVOSFF.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resolveAgentRecordFromHybridStore,
|
|
13
13
|
sanitizeAgentRecordForCliOutput,
|
|
14
14
|
writeAgentRecord
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-C4MMO7W4.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveCliAgentKeyInput
|
|
18
18
|
} from "./chunk-VHBWHNVT.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CXM4IIUF.js";
|
|
4
4
|
import {
|
|
5
5
|
require_date_fns
|
|
6
6
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
patch,
|
|
15
15
|
readAndWait
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3S2VOMIF.js";
|
|
17
17
|
import {
|
|
18
18
|
asOptionalTrimmedString
|
|
19
19
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
async function createDocState(args, thunkApi) {
|
|
370
|
-
const { createPageAction } = await import("./createPageAction-
|
|
370
|
+
const { createPageAction } = await import("./createPageAction-RS65DDRX.js");
|
|
371
371
|
return createPageAction(args, thunkApi);
|
|
372
372
|
}
|
|
373
373
|
function subscribe(listener) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XJYXSTBK.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-G2IQGDQZ.js";
|
|
8
8
|
import {
|
|
9
9
|
runLocalAgentTurn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RIF3XLXK.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveLocalRuntimeEnvFromPolicy
|
|
13
13
|
} from "./chunk-5CS33IBL.js";
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getModelConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HQPG2PIV.js";
|
|
4
4
|
import {
|
|
5
5
|
asTrimmedLowercaseString
|
|
6
6
|
} from "./chunk-QSJ3HFEF.js";
|
|
7
7
|
import {
|
|
8
8
|
asTrimmedString
|
|
9
9
|
} from "./chunk-3EUW3WEO.js";
|
|
10
|
-
import {
|
|
11
|
-
isRecord
|
|
12
|
-
} from "./chunk-KUG52IAP.js";
|
|
13
10
|
import {
|
|
14
11
|
normalizeServerOrigin
|
|
15
12
|
} from "./chunk-CF7PE763.js";
|
|
@@ -31,10 +28,11 @@ function pickAgentRuntimeInferenceOptions(agentConfig) {
|
|
|
31
28
|
|
|
32
29
|
// packages/agent-runtime/platformProviderEndpoints.ts
|
|
33
30
|
var OPENAI_RESPONSES_ENDPOINT = "https://api.openai.com/v1/responses";
|
|
34
|
-
var DEEPSEEK_RESPONSES_ENDPOINT = "https://api.deepseek.com/v1/responses";
|
|
35
31
|
var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
|
|
36
32
|
deepinfra: "https://api.deepinfra.com/v1/openai/chat/completions",
|
|
37
|
-
|
|
33
|
+
// DeepSeek official API endpoint removed — all DeepSeek models now route
|
|
34
|
+
// through the nolo provider (Ollama Cloud). See providerRegistry.ts.
|
|
35
|
+
// deepseek: "https://api.deepseek.com/chat/completions",
|
|
38
36
|
fireworks: "https://api.fireworks.ai/inference/v1/chat/completions",
|
|
39
37
|
google: "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions",
|
|
40
38
|
openai: "https://api.openai.com/v1/chat/completions",
|
|
@@ -49,9 +47,6 @@ var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
|
|
|
49
47
|
};
|
|
50
48
|
function isOpenAiResponsesModel(args) {
|
|
51
49
|
const provider = asTrimmedLowercaseString(args.provider);
|
|
52
|
-
if (provider === "deepseek") {
|
|
53
|
-
return asTrimmedLowercaseString(args.model) === "deepseek-v4-flash";
|
|
54
|
-
}
|
|
55
50
|
if (provider !== "openai") return false;
|
|
56
51
|
if (args.endpointKey === "responses") return true;
|
|
57
52
|
if (!args.model) return false;
|
|
@@ -62,17 +57,11 @@ function isOpenAiResponsesModel(args) {
|
|
|
62
57
|
}
|
|
63
58
|
}
|
|
64
59
|
function resolvePlatformResponsesEndpoint(provider) {
|
|
65
|
-
|
|
66
|
-
case "openai":
|
|
67
|
-
return OPENAI_RESPONSES_ENDPOINT;
|
|
68
|
-
case "deepseek":
|
|
69
|
-
return DEEPSEEK_RESPONSES_ENDPOINT;
|
|
70
|
-
default:
|
|
71
|
-
return void 0;
|
|
72
|
-
}
|
|
60
|
+
return asTrimmedLowercaseString(provider) === "openai" ? OPENAI_RESPONSES_ENDPOINT : void 0;
|
|
73
61
|
}
|
|
74
62
|
var PLATFORM_PROVIDER_ENDPOINT_ALIASES = {
|
|
75
|
-
"ollama-cloud": "nolo"
|
|
63
|
+
"ollama-cloud": "nolo",
|
|
64
|
+
deepseek: "nolo"
|
|
76
65
|
};
|
|
77
66
|
function resolvePlatformChatCompletionsEndpoint(provider) {
|
|
78
67
|
const key = asTrimmedLowercaseString(provider);
|
|
@@ -344,235 +333,6 @@ async function buildProviderExecutionPlan(args) {
|
|
|
344
333
|
};
|
|
345
334
|
}
|
|
346
335
|
|
|
347
|
-
// packages/agent-runtime/openAiCompatibleMessages.ts
|
|
348
|
-
function preserveAgentStateFields(source, target, options) {
|
|
349
|
-
const mutableTarget = target;
|
|
350
|
-
if (source.role === "assistant") {
|
|
351
|
-
if (!options?.stripReasoningContent && typeof source.reasoning_content === "string") {
|
|
352
|
-
mutableTarget.reasoning_content = source.reasoning_content;
|
|
353
|
-
}
|
|
354
|
-
if (Array.isArray(source.tool_calls)) {
|
|
355
|
-
mutableTarget.tool_calls = source.tool_calls;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
if (source.role === "tool") {
|
|
359
|
-
const toolCallId = typeof source.tool_call_id === "string" ? source.tool_call_id.trim() : typeof source.toolCallId === "string" ? source.toolCallId.trim() : "";
|
|
360
|
-
if (toolCallId) mutableTarget.tool_call_id = toolCallId;
|
|
361
|
-
}
|
|
362
|
-
return target;
|
|
363
|
-
}
|
|
364
|
-
function toOpenAiCompatibleMessages(messages, options) {
|
|
365
|
-
return messages.map(
|
|
366
|
-
(message) => preserveAgentStateFields(message, {
|
|
367
|
-
role: message.role,
|
|
368
|
-
content: message.content ?? ""
|
|
369
|
-
}, options)
|
|
370
|
-
);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
// packages/integrations/openai/responsesHelpers.ts
|
|
374
|
-
var RESPONSES_TOP_LEVEL_SCHEMA_KEYS = ["anyOf", "oneOf", "allOf", "enum", "not"];
|
|
375
|
-
var sanitizeResponsesParameters = (parameters) => {
|
|
376
|
-
if (!isRecord(parameters)) {
|
|
377
|
-
return parameters;
|
|
378
|
-
}
|
|
379
|
-
const next = { ...parameters };
|
|
380
|
-
for (const key of RESPONSES_TOP_LEVEL_SCHEMA_KEYS) {
|
|
381
|
-
delete next[key];
|
|
382
|
-
}
|
|
383
|
-
return next;
|
|
384
|
-
};
|
|
385
|
-
var appendTextPart = (parts, text, role) => {
|
|
386
|
-
if (!text) return;
|
|
387
|
-
const last = parts.at(-1);
|
|
388
|
-
const textType = role === "assistant" ? "output_text" : "input_text";
|
|
389
|
-
if (last?.type === textType) {
|
|
390
|
-
last.text += text;
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
parts.push({ type: textType, text });
|
|
394
|
-
};
|
|
395
|
-
var normalizeMessageParts = (content, role) => {
|
|
396
|
-
if (typeof content === "string") {
|
|
397
|
-
if (!content) return [];
|
|
398
|
-
return [
|
|
399
|
-
{
|
|
400
|
-
type: role === "assistant" ? "output_text" : "input_text",
|
|
401
|
-
text: content
|
|
402
|
-
}
|
|
403
|
-
];
|
|
404
|
-
}
|
|
405
|
-
const parts = [];
|
|
406
|
-
for (const part of content ?? []) {
|
|
407
|
-
const typedPart = part;
|
|
408
|
-
if (typedPart?.type === "text" && typeof typedPart.text === "string") {
|
|
409
|
-
appendTextPart(parts, typedPart.text, role);
|
|
410
|
-
continue;
|
|
411
|
-
}
|
|
412
|
-
if (typedPart?.type === "image_url" && typeof typedPart.image_url?.url === "string" && typedPart.image_url.url) {
|
|
413
|
-
if (role === "assistant") continue;
|
|
414
|
-
parts.push({
|
|
415
|
-
type: "input_image",
|
|
416
|
-
image_url: typedPart.image_url.url,
|
|
417
|
-
detail: typedPart.image_url.detail
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
return parts;
|
|
422
|
-
};
|
|
423
|
-
var normalizeToolOutput = (content) => {
|
|
424
|
-
if (typeof content === "string") return content;
|
|
425
|
-
return JSON.stringify(content ?? "");
|
|
426
|
-
};
|
|
427
|
-
var toResponsesTools = (tools) => {
|
|
428
|
-
if (!Array.isArray(tools) || tools.length === 0) return void 0;
|
|
429
|
-
return tools.map((tool) => {
|
|
430
|
-
const fn = tool?.function;
|
|
431
|
-
if (!fn?.name) return null;
|
|
432
|
-
return {
|
|
433
|
-
type: "function",
|
|
434
|
-
name: fn.name,
|
|
435
|
-
description: fn.description,
|
|
436
|
-
parameters: sanitizeResponsesParameters(fn.parameters),
|
|
437
|
-
strict: fn.strict
|
|
438
|
-
};
|
|
439
|
-
}).filter(Boolean);
|
|
440
|
-
};
|
|
441
|
-
var convertMessagesToResponsesInput = (messages) => {
|
|
442
|
-
const input = [];
|
|
443
|
-
for (const message of messages) {
|
|
444
|
-
if (!message?.role) continue;
|
|
445
|
-
if (message.role === "tool") {
|
|
446
|
-
if (!message.tool_call_id) continue;
|
|
447
|
-
input.push({
|
|
448
|
-
type: "function_call_output",
|
|
449
|
-
call_id: message.tool_call_id,
|
|
450
|
-
output: normalizeToolOutput(message.content)
|
|
451
|
-
});
|
|
452
|
-
continue;
|
|
453
|
-
}
|
|
454
|
-
const role = message.role;
|
|
455
|
-
if (role === "assistant" && typeof message.reasoning_content === "string" && message.reasoning_content) {
|
|
456
|
-
input.push({ type: "reasoning", content: message.reasoning_content });
|
|
457
|
-
}
|
|
458
|
-
const contentParts = normalizeMessageParts(message.content, role);
|
|
459
|
-
if (contentParts.length > 0) {
|
|
460
|
-
input.push({
|
|
461
|
-
type: "message",
|
|
462
|
-
role,
|
|
463
|
-
content: contentParts
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
if (role === "assistant" && Array.isArray(message.content)) {
|
|
467
|
-
const replayImages = message.content.map((part) => part).filter(
|
|
468
|
-
(part) => part?.type === "image_url" && typeof part.image_url?.url === "string" && Boolean(part.image_url.url)
|
|
469
|
-
).map((part) => ({
|
|
470
|
-
type: "input_image",
|
|
471
|
-
image_url: part.image_url.url,
|
|
472
|
-
detail: part.image_url.detail
|
|
473
|
-
}));
|
|
474
|
-
if (replayImages.length > 0) {
|
|
475
|
-
input.push({
|
|
476
|
-
type: "message",
|
|
477
|
-
role: "user",
|
|
478
|
-
content: replayImages
|
|
479
|
-
});
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
if (role === "assistant" && Array.isArray(message.tool_calls)) {
|
|
483
|
-
for (const toolCall of message.tool_calls) {
|
|
484
|
-
if (!toolCall?.id || !toolCall.function?.name) continue;
|
|
485
|
-
input.push({
|
|
486
|
-
type: "function_call",
|
|
487
|
-
call_id: toolCall.id,
|
|
488
|
-
name: toolCall.function.name,
|
|
489
|
-
arguments: typeof toolCall.function.arguments === "string" ? toolCall.function.arguments : JSON.stringify(toolCall.function.arguments ?? {})
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
return input;
|
|
495
|
-
};
|
|
496
|
-
var extractTextFromResponseOutput = (response) => {
|
|
497
|
-
const parts = [];
|
|
498
|
-
for (const item of response?.output ?? []) {
|
|
499
|
-
if (item?.type !== "message") continue;
|
|
500
|
-
for (const content of item.content ?? []) {
|
|
501
|
-
if (content?.type === "output_text" && typeof content.text === "string") {
|
|
502
|
-
parts.push(content.text);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
return parts.join("");
|
|
507
|
-
};
|
|
508
|
-
var toDataUrl = (base64Data, mimeType) => {
|
|
509
|
-
const normalizedMimeType = asOptionalTrimmedString(mimeType) ?? "image/png";
|
|
510
|
-
return `data:${normalizedMimeType};base64,${base64Data}`;
|
|
511
|
-
};
|
|
512
|
-
var extractImagePartsFromResponseOutput = (response) => {
|
|
513
|
-
const images = [];
|
|
514
|
-
for (const item of response?.output ?? []) {
|
|
515
|
-
if (item?.type === "image_generation_call") {
|
|
516
|
-
const result = asOptionalTrimmedString(item.result);
|
|
517
|
-
if (result) {
|
|
518
|
-
const outputFormat = asOptionalTrimmedString(item.output_format);
|
|
519
|
-
images.push({
|
|
520
|
-
type: "image_url",
|
|
521
|
-
image_url: {
|
|
522
|
-
url: toDataUrl(
|
|
523
|
-
result,
|
|
524
|
-
outputFormat ? `image/${outputFormat}` : void 0
|
|
525
|
-
)
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
continue;
|
|
530
|
-
}
|
|
531
|
-
if (item?.type !== "message") continue;
|
|
532
|
-
for (const content of item.content ?? []) {
|
|
533
|
-
const result = asOptionalTrimmedString(content?.result);
|
|
534
|
-
if (content?.type === "output_image" && result) {
|
|
535
|
-
images.push({
|
|
536
|
-
type: "image_url",
|
|
537
|
-
image_url: {
|
|
538
|
-
url: toDataUrl(
|
|
539
|
-
result,
|
|
540
|
-
content.mime_type ?? content.mimeType ?? null
|
|
541
|
-
)
|
|
542
|
-
}
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
return images;
|
|
548
|
-
};
|
|
549
|
-
var extractToolCallsFromResponseOutput = (response) => {
|
|
550
|
-
const calls = [];
|
|
551
|
-
for (const item of response?.output ?? []) {
|
|
552
|
-
if (item?.type !== "function_call") continue;
|
|
553
|
-
if (!item.call_id || !item.name) continue;
|
|
554
|
-
calls.push({
|
|
555
|
-
id: item.call_id,
|
|
556
|
-
type: "function",
|
|
557
|
-
function: {
|
|
558
|
-
name: item.name,
|
|
559
|
-
arguments: typeof item.arguments === "string" ? item.arguments : JSON.stringify(item.arguments ?? {})
|
|
560
|
-
}
|
|
561
|
-
});
|
|
562
|
-
}
|
|
563
|
-
return calls;
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
// packages/core/chat/imageParts.ts
|
|
567
|
-
function isImageUrlPart(part) {
|
|
568
|
-
return isRecord(part) && part.type === "image_url";
|
|
569
|
-
}
|
|
570
|
-
function hasImageParts(messages) {
|
|
571
|
-
return messages.some(
|
|
572
|
-
(message) => Array.isArray(message.content) && message.content.some(isImageUrlPart)
|
|
573
|
-
);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
336
|
export {
|
|
577
337
|
pickAgentRuntimeInferenceOptions,
|
|
578
338
|
isOpenAiResponsesModel,
|
|
@@ -586,14 +346,5 @@ export {
|
|
|
586
346
|
resolveAgentRuntimeLocation,
|
|
587
347
|
resolveProviderTransportDecision,
|
|
588
348
|
buildProviderAuthHeaders,
|
|
589
|
-
buildProviderExecutionPlan
|
|
590
|
-
isImageUrlPart,
|
|
591
|
-
hasImageParts,
|
|
592
|
-
preserveAgentStateFields,
|
|
593
|
-
toOpenAiCompatibleMessages,
|
|
594
|
-
toResponsesTools,
|
|
595
|
-
convertMessagesToResponsesInput,
|
|
596
|
-
extractTextFromResponseOutput,
|
|
597
|
-
extractImagePartsFromResponseOutput,
|
|
598
|
-
extractToolCallsFromResponseOutput
|
|
349
|
+
buildProviderExecutionPlan
|
|
599
350
|
};
|