nolo-cli 0.12.0-alpha.7 → 0.12.0-alpha.8
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-Q4IYLZS4.js → _executeModel-PKRZBH3J.js} +15 -14
- package/{agentDeleteCommand-7KI5P63D.js → agentDeleteCommand-OKQ5CSX2.js} +10 -9
- package/{agentEmailCommands-DEMUYI4P.js → agentEmailCommands-7DORWXQH.js} +18 -17
- package/{agentListCommands-UOKKEHD5.js → agentListCommands-VTR33V4B.js} +11 -10
- package/{agentMachineCommands-P6O6QHTM.js → agentMachineCommands-XHFM4UQB.js} +10 -9
- package/{agentRecordCommands-YTDXSM7M.js → agentRecordCommands-XB7XBNJ7.js} +18 -17
- package/{agentRunCommand-THSCEIK2.js → agentRunCommand-XACEWDVO.js} +18 -17
- package/{agentRuntimeLocal-URCNA6VW.js → agentRuntimeLocal-NYFVPD5P.js} +7 -6
- package/{agentSlice-X6ULYPOA.js → agentSlice-NGZWIMZX.js} +1 -1
- package/{chunk-6TISG7CK.js → chunk-3GOA33JO.js} +69 -12
- package/{chunk-F4RTTHOQ.js → chunk-4LNEIK4O.js} +3 -3
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-ZPPBDWKK.js → chunk-6KTC3MPK.js} +1 -1
- package/{chunk-BLX7A3UL.js → chunk-7CQLSRAC.js} +2 -2
- package/{chunk-Z2BX5TKZ.js → chunk-7F5C7ILS.js} +2 -2
- package/{chunk-REH2ABIG.js → chunk-A22NOC7Y.js} +15 -13
- package/{chunk-3ERGZN5Y.js → chunk-CGAYFFIB.js} +1 -1
- package/{chunk-Y3BLUPNS.js → chunk-H5Y2H2N6.js} +1 -1
- package/{chunk-WWIMZXTC.js → chunk-HO7RHQIN.js} +1 -1
- package/{chunk-C6C43FKQ.js → chunk-HYJNPPQ6.js} +3 -3
- package/{chunk-NAEAB62H.js → chunk-JFANOO7I.js} +0 -12
- package/{chunk-R64KFNTS.js → chunk-LBWFOYJJ.js} +2 -2
- package/{chunk-D5UOJGZU.js → chunk-LKVDZQGM.js} +1 -1
- package/{chunk-7HV5OHEM.js → chunk-LUKQQJFL.js} +38 -1
- package/{chunk-DWXS7QEV.js → chunk-NS3DRNUZ.js} +38 -11
- package/{chunk-72PCQ5XQ.js → chunk-P3J54V3I.js} +1 -1
- package/{chunk-5KXZEOB6.js → chunk-QYZ46ZC3.js} +1 -1
- package/{chunk-EGPNTKU2.js → chunk-REQCG2PB.js} +10 -97
- package/{chunk-PKDL3HPF.js → chunk-SDYIF6SV.js} +94 -1
- package/{chunk-QTNKHFAK.js → chunk-SKURMCJF.js} +9 -9
- package/{chunk-YCXS3OPT.js → chunk-TA7VKOHU.js} +10 -5
- package/{chunk-WO24IT3V.js → chunk-TYPHUVK5.js} +12 -0
- package/{chunk-2XFDQEXO.js → chunk-UNEZBV37.js} +27 -13
- package/{chunk-GEJ3NVPG.js → chunk-UP6JMU6C.js} +1 -1
- package/{chunk-YRWNTL6W.js → chunk-UWTMBOPF.js} +13 -8
- package/{chunk-UIYF67QX.js → chunk-XNV42PMD.js} +9 -9
- package/{createAgentAutomationAction-2RY5SO76.js → createAgentAutomationAction-AHSBJKGX.js} +4 -3
- package/{createDialogAction-ZBASPHZU.js → createDialogAction-RSNVGR5E.js} +5 -4
- package/{createPageAction-F5IAHELK.js → createPageAction-47G4D5WU.js} +4 -3
- package/{dialogCommands-3THDF2JT.js → dialogCommands-MPUFCOBR.js} +11 -10
- package/{dialogSlice-K2USDPWM.js → dialogSlice-YNEFYFSU.js} +4 -3
- package/{docCreateCommands-ZBB5YVX6.js → docCreateCommands-LV6KUDP3.js} +10 -9
- package/{docDeleteCommands-6K7UJDRZ.js → docDeleteCommands-Y7FOYWMY.js} +11 -10
- package/{docReadCommands-W3G6RMEK.js → docReadCommands-UCCHERCP.js} +10 -9
- package/{docStore-UPTODHEV.js → docStore-OBBYKQVD.js} +5 -4
- package/{docUpdateCommands-B3BNRXSH.js → docUpdateCommands-FBKQBFWG.js} +10 -9
- package/{handleSendMessageAction-VZNBYBOR.js → handleSendMessageAction-U5AX6CGB.js} +4 -3
- package/index.js +36 -36
- package/{machineCommands-DEIHAXA4.js → machineCommands-EXVWHGWU.js} +17 -16
- package/{machineWsRunDispatch-EOCGXTWR.js → machineWsRunDispatch-QZXCW3SI.js} +17 -16
- package/package.json +1 -1
- package/{readlineWorkspace-5EUY7IQZ.js → readlineWorkspace-QKMGLM33.js} +128 -28
- package/{runAgentClientLoop-BG7MN7X7.js → runAgentClientLoop-5DIJHAPN.js} +12 -11
- package/{spaceCommands-K5BQGCFE.js → spaceCommands-KDZYXP5N.js} +10 -9
- package/{spaceSlice-5VGNKIE4.js → spaceSlice-EO6JQRMP.js} +4 -3
- package/{streamAgentChatTurn-Y4AAGJJG.js → streamAgentChatTurn-PLKJ3MZ6.js} +14 -13
- package/{tools-HG53NEI2.js → tools-5QNY6YKE.js} +7 -6
- package/{tuiSummaryLlmCaller-YEHSPGXZ.js → tuiSummaryLlmCaller-TQ34DAM5.js} +4 -2
- package/{updateDialogTitleAction-3F5SATT4.js → updateDialogTitleAction-V5AD52MZ.js} +4 -3
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
i18n_default,
|
|
3
3
|
toolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SKURMCJF.js";
|
|
5
5
|
import {
|
|
6
6
|
canonicalizeToolNames
|
|
7
7
|
} from "./chunk-B4KT7RN2.js";
|
|
8
|
+
import {
|
|
9
|
+
isNoloHostedProvider
|
|
10
|
+
} from "./chunk-524BDL33.js";
|
|
8
11
|
import {
|
|
9
12
|
asTrimmedLowercaseString
|
|
10
13
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -12,6 +15,94 @@ import {
|
|
|
12
15
|
isRecord
|
|
13
16
|
} from "./chunk-KUG52IAP.js";
|
|
14
17
|
|
|
18
|
+
// packages/ai/chat/inlineImageUrlsForCustomProvider.ts
|
|
19
|
+
var FILE_CONTENT_PATH = "/api/v1/db/file/content/";
|
|
20
|
+
var shouldInlineImageUrlsForAgent = (agentConfig) => {
|
|
21
|
+
const apiSource = agentConfig?.apiSource?.toLowerCase();
|
|
22
|
+
const provider = agentConfig?.provider?.toLowerCase();
|
|
23
|
+
const model = agentConfig?.model?.toLowerCase();
|
|
24
|
+
if (apiSource === "custom" || provider === "custom") return true;
|
|
25
|
+
if (isNoloHostedProvider(provider)) return true;
|
|
26
|
+
return provider === "openrouter" && model === "minimax/minimax-m3";
|
|
27
|
+
};
|
|
28
|
+
var isInlineCandidate = (url) => /^https?:\/\//i.test(url) && url.includes(FILE_CONTENT_PATH);
|
|
29
|
+
var bytesToBase64 = (bytes) => {
|
|
30
|
+
let binary = "";
|
|
31
|
+
for (const byte of bytes) {
|
|
32
|
+
binary += String.fromCharCode(byte);
|
|
33
|
+
}
|
|
34
|
+
return btoa(binary);
|
|
35
|
+
};
|
|
36
|
+
var defaultFetchImage = async (url) => {
|
|
37
|
+
const response = await fetch(url);
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
return {
|
|
40
|
+
ok: false,
|
|
41
|
+
error: `HTTP ${response.status}`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
45
|
+
return {
|
|
46
|
+
ok: true,
|
|
47
|
+
mimeType: response.headers.get("content-type") ?? "application/octet-stream",
|
|
48
|
+
bytes
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
var cloneImagePartWithDataUrl = async (part, fetchImage, isAllowedImageUrl) => {
|
|
52
|
+
const url = part?.image_url?.url;
|
|
53
|
+
if (typeof url !== "string" || !isInlineCandidate(url) || isAllowedImageUrl && !isAllowedImageUrl(url)) {
|
|
54
|
+
return part;
|
|
55
|
+
}
|
|
56
|
+
const result = await fetchImage(url);
|
|
57
|
+
if (!result.ok || !result.bytes) return part;
|
|
58
|
+
const mimeType = result.mimeType || "application/octet-stream";
|
|
59
|
+
return {
|
|
60
|
+
...part,
|
|
61
|
+
image_url: {
|
|
62
|
+
...part.image_url,
|
|
63
|
+
url: `data:${mimeType};base64,${bytesToBase64(result.bytes)}`
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
var inlineImageUrlsForCustomProvider = async (bodyData, options) => {
|
|
68
|
+
if (!options.shouldInline) return bodyData;
|
|
69
|
+
const body = bodyData;
|
|
70
|
+
if (!Array.isArray(body?.messages)) return bodyData;
|
|
71
|
+
const fetchImage = options.fetchImage ?? defaultFetchImage;
|
|
72
|
+
let changed = false;
|
|
73
|
+
const messages = [];
|
|
74
|
+
for (const message of body.messages) {
|
|
75
|
+
if (!Array.isArray(message?.content)) {
|
|
76
|
+
messages.push(message);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const content = await Promise.all(
|
|
80
|
+
message.content.map(async (part) => {
|
|
81
|
+
if (part?.type !== "image_url") return part;
|
|
82
|
+
return cloneImagePartWithDataUrl(
|
|
83
|
+
part,
|
|
84
|
+
fetchImage,
|
|
85
|
+
options.isAllowedImageUrl
|
|
86
|
+
);
|
|
87
|
+
})
|
|
88
|
+
);
|
|
89
|
+
let messageChanged = false;
|
|
90
|
+
for (let i = 0; i < content.length; i++) {
|
|
91
|
+
if (content[i] !== message.content[i]) {
|
|
92
|
+
changed = true;
|
|
93
|
+
messageChanged = true;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
messages.push(messageChanged ? { ...message, content } : message);
|
|
98
|
+
}
|
|
99
|
+
if (!changed) return bodyData;
|
|
100
|
+
return {
|
|
101
|
+
...body,
|
|
102
|
+
messages
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
|
|
15
106
|
// packages/ai/tools/toolSchemaCompatibility.ts
|
|
16
107
|
var COMPOSITION_KEYS = ["anyOf", "oneOf", "allOf"];
|
|
17
108
|
var LIMITED_JSON_SCHEMA_PROVIDERS = /* @__PURE__ */ new Set([
|
|
@@ -167,5 +258,7 @@ var prepareTools = (toolNames, options) => {
|
|
|
167
258
|
};
|
|
168
259
|
|
|
169
260
|
export {
|
|
261
|
+
shouldInlineImageUrlsForAgent,
|
|
262
|
+
inlineImageUrlsForCustomProvider,
|
|
170
263
|
prepareTools
|
|
171
264
|
};
|
|
@@ -34,10 +34,10 @@ import {
|
|
|
34
34
|
} from "./chunk-VF4K2QE6.js";
|
|
35
35
|
import {
|
|
36
36
|
createDocState
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-7F5C7ILS.js";
|
|
38
38
|
import {
|
|
39
39
|
createDialogAction
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-LKVDZQGM.js";
|
|
41
41
|
import {
|
|
42
42
|
buildSkillDocMarkdown,
|
|
43
43
|
normalizeSkillBudgetTier,
|
|
@@ -76,13 +76,13 @@ import {
|
|
|
76
76
|
updateContentCategory,
|
|
77
77
|
updateContentTitle,
|
|
78
78
|
updateStep
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-XNV42PMD.js";
|
|
80
80
|
import {
|
|
81
81
|
createAgent,
|
|
82
82
|
runLlm,
|
|
83
83
|
streamAgentChatTurn,
|
|
84
84
|
updateAgent
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-HYJNPPQ6.js";
|
|
86
86
|
import {
|
|
87
87
|
NOLO_WORKSPACE_TOOL_NAMES,
|
|
88
88
|
buildNoloSubjectRefQueryTarget,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
} from "./chunk-B4KT7RN2.js";
|
|
102
102
|
import {
|
|
103
103
|
buildDatabaseFileContentUrl
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-JFANOO7I.js";
|
|
105
105
|
import {
|
|
106
106
|
DEFAULT_MODEL
|
|
107
107
|
} from "./chunk-OGGHETUE.js";
|
|
@@ -14104,7 +14104,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
14104
14104
|
const deletedDialogIds = [];
|
|
14105
14105
|
const deletedDialogKeys = [];
|
|
14106
14106
|
const failures = [];
|
|
14107
|
-
const { deleteDialog } = await import("./dialogSlice-
|
|
14107
|
+
const { deleteDialog } = await import("./dialogSlice-YNEFYFSU.js");
|
|
14108
14108
|
for (const target of targets) {
|
|
14109
14109
|
try {
|
|
14110
14110
|
await thunkApi.dispatch(deleteDialog(target.dbKey)).unwrap();
|
|
@@ -23241,7 +23241,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
23241
23241
|
if (!executionInput) {
|
|
23242
23242
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
23243
23243
|
}
|
|
23244
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
23244
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-5QNY6YKE.js");
|
|
23245
23245
|
const { executor } = findToolExecutor2(run.toolName);
|
|
23246
23246
|
toolRunStarted({
|
|
23247
23247
|
id: run.id,
|
|
@@ -23265,7 +23265,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
23265
23265
|
const latestState = thunkApi.getState();
|
|
23266
23266
|
const userId = latestState.auth?.currentUser?.userId;
|
|
23267
23267
|
if (userId) {
|
|
23268
|
-
const { fetchUserSpaceMemberships } = await import("./spaceSlice-
|
|
23268
|
+
const { fetchUserSpaceMemberships } = await import("./spaceSlice-EO6JQRMP.js");
|
|
23269
23269
|
await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
|
|
23270
23270
|
}
|
|
23271
23271
|
}
|
|
@@ -25668,7 +25668,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
25668
25668
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
25669
25669
|
};
|
|
25670
25670
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
25671
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
25671
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-OBBYKQVD.js");
|
|
25672
25672
|
if (getDocState().pageKey === id) {
|
|
25673
25673
|
applyExternalDocUpdate({
|
|
25674
25674
|
slateData: finalSlateData,
|
|
@@ -2,18 +2,20 @@ import {
|
|
|
2
2
|
buildCurrentTimeBlock,
|
|
3
3
|
buildIdentityBlock,
|
|
4
4
|
buildRuntimeGuidanceBlocks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LUKQQJFL.js";
|
|
6
6
|
import {
|
|
7
7
|
canonicalizeToolNames
|
|
8
8
|
} from "./chunk-B4KT7RN2.js";
|
|
9
9
|
import {
|
|
10
|
-
clipCompactText,
|
|
11
10
|
estimateTokenCount,
|
|
12
11
|
getModelContextWindow,
|
|
13
12
|
planCompression,
|
|
14
13
|
planContextUsage,
|
|
15
14
|
serializeMessageContent
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JFANOO7I.js";
|
|
16
|
+
import {
|
|
17
|
+
clipCompactText
|
|
18
|
+
} from "./chunk-5MMAK75Q.js";
|
|
17
19
|
import {
|
|
18
20
|
findModelConfig,
|
|
19
21
|
getProviderByModelName
|
|
@@ -531,7 +533,9 @@ function resolveEmptyAssistantOutcome(args) {
|
|
|
531
533
|
if (args.hasToolCalls || args.hasVisibleOutput) return { kind: "ok" };
|
|
532
534
|
if (args.finishReason === "length") return { kind: "fallback", reason: "length_truncated" };
|
|
533
535
|
if (!args.repairUsed) return { kind: "repair" };
|
|
534
|
-
if (!args.finishReason)
|
|
536
|
+
if (!args.finishReason && !args.streamComplete) {
|
|
537
|
+
return { kind: "fallback", reason: "stream_truncated" };
|
|
538
|
+
}
|
|
535
539
|
return { kind: "fallback", reason: "empty_completion" };
|
|
536
540
|
}
|
|
537
541
|
function resolveEmptyAssistantFallbackMessage(reason) {
|
|
@@ -1297,7 +1301,8 @@ async function runLocalAgentTurn(input) {
|
|
|
1297
1301
|
hasToolCalls: rawToolCallsCount > 0,
|
|
1298
1302
|
hasVisibleOutput: hasAssistantVisibleOutput(result.content),
|
|
1299
1303
|
repairUsed: emptyAssistantRepairUsed,
|
|
1300
|
-
finishReason: result.finish_reason
|
|
1304
|
+
finishReason: result.finish_reason,
|
|
1305
|
+
streamComplete: result.stream_complete
|
|
1301
1306
|
});
|
|
1302
1307
|
if (outcome.kind === "repair") {
|
|
1303
1308
|
emptyAssistantRepairPending = true;
|
|
@@ -563,8 +563,20 @@ var extractToolCallsFromResponseOutput = (response) => {
|
|
|
563
563
|
return calls;
|
|
564
564
|
};
|
|
565
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
|
+
|
|
566
576
|
export {
|
|
567
577
|
pickAgentRuntimeInferenceOptions,
|
|
578
|
+
isImageUrlPart,
|
|
579
|
+
hasImageParts,
|
|
568
580
|
preserveAgentStateFields,
|
|
569
581
|
toOpenAiCompatibleMessages,
|
|
570
582
|
isOpenAiResponsesModel,
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyChatCompletionDelta,
|
|
3
|
+
createToolCallAccumulator,
|
|
3
4
|
finalizeAccumulatedToolCalls,
|
|
4
5
|
flushChatCompletionStream,
|
|
6
|
+
providerHttpFailure,
|
|
5
7
|
readSseFrames,
|
|
6
8
|
throwIfChatCompletionStreamFailed
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3GOA33JO.js";
|
|
8
10
|
import {
|
|
9
11
|
parseToolArgumentsJson
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TA7VKOHU.js";
|
|
11
13
|
import {
|
|
12
14
|
createThinkParserState,
|
|
13
15
|
extractThinkContent
|
|
14
16
|
} from "./chunk-OPZYGHUC.js";
|
|
17
|
+
import {
|
|
18
|
+
requiresBareImageUrl,
|
|
19
|
+
toBareImageUrlMessages
|
|
20
|
+
} from "./chunk-LUKQQJFL.js";
|
|
15
21
|
import {
|
|
16
22
|
buildProviderAuthHeaders,
|
|
17
23
|
buildProviderExecutionPlan,
|
|
18
24
|
toOpenAiCompatibleMessages
|
|
19
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-TYPHUVK5.js";
|
|
20
26
|
import {
|
|
21
27
|
canonicalizeToolName,
|
|
22
28
|
createGlob,
|
|
@@ -81,9 +87,14 @@ function parseSseDataLineJson(line) {
|
|
|
81
87
|
|
|
82
88
|
// packages/agent-runtime/openAiCompatibleProvider.ts
|
|
83
89
|
function buildOpenAiCompatibleChatCompletionRequest(args) {
|
|
90
|
+
const messages = toOpenAiCompatibleMessages(args.messages);
|
|
84
91
|
const body = {
|
|
85
92
|
model: args.providerConfig.model,
|
|
86
|
-
messages:
|
|
93
|
+
messages: requiresBareImageUrl({
|
|
94
|
+
endpoint: args.providerConfig.endpoint,
|
|
95
|
+
provider: args.providerConfig.provider,
|
|
96
|
+
model: args.providerConfig.model
|
|
97
|
+
}) ? toBareImageUrlMessages(messages) : messages,
|
|
87
98
|
stream: args.stream ?? false,
|
|
88
99
|
...args.providerConfig.requestOptions,
|
|
89
100
|
...args.tools && args.tools.length > 0 ? { tools: args.tools } : {},
|
|
@@ -121,6 +132,9 @@ function parseOpenAiCompatibleChatCompletionResponse(args) {
|
|
|
121
132
|
...reasoning ? { reasoning_content: reasoning } : {},
|
|
122
133
|
...typeof choiceMessage?.reasoning_content === "string" && choiceMessage.reasoning_content ? { reasoning_content: choiceMessage.reasoning_content } : {},
|
|
123
134
|
...typeof rawFinishReason === "string" && rawFinishReason.length > 0 ? { finish_reason: rawFinishReason } : {},
|
|
135
|
+
// 非流式:拿到完整的 200 JSON body 本身就证明这次调用走完了,
|
|
136
|
+
// 不必等 finish_reason(有从不发它的上游,见 AgentRuntimeResult)。
|
|
137
|
+
stream_complete: true,
|
|
124
138
|
usage: args.data?.usage,
|
|
125
139
|
trace: args.trace
|
|
126
140
|
};
|
|
@@ -137,7 +151,7 @@ async function readOpenAiCompatibleSseCompletion(args) {
|
|
|
137
151
|
content: "",
|
|
138
152
|
reasoning: "",
|
|
139
153
|
usage: void 0,
|
|
140
|
-
accumulatedToolCalls:
|
|
154
|
+
accumulatedToolCalls: createToolCallAccumulator(),
|
|
141
155
|
thinkState: createThinkParserState(),
|
|
142
156
|
onTextDelta: args.onTextDelta,
|
|
143
157
|
onReasoningDelta: args.onReasoningDelta
|
|
@@ -152,7 +166,7 @@ async function readOpenAiCompatibleSseCompletion(args) {
|
|
|
152
166
|
content: state.content,
|
|
153
167
|
...state.reasoning ? { reasoning_content: state.reasoning } : {},
|
|
154
168
|
...tool_calls.length > 0 ? { tool_calls } : {},
|
|
155
|
-
...state.usage ? { usage: state.usage } : {},
|
|
169
|
+
...state.usage ? { usage: state.usage, stream_complete: true } : {},
|
|
156
170
|
...state.finishReason ? { finish_reason: state.finishReason } : {}
|
|
157
171
|
};
|
|
158
172
|
}
|
|
@@ -183,13 +197,12 @@ async function executeOpenAiCompatibleChatCompletion(args) {
|
|
|
183
197
|
}
|
|
184
198
|
}
|
|
185
199
|
if (!res.ok) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
throw new Error(`local provider failed: HTTP ${res.status} ${JSON.stringify(data2)}`);
|
|
200
|
+
throw providerHttpFailure({
|
|
201
|
+
label: "local provider",
|
|
202
|
+
status: res.status,
|
|
203
|
+
raw: await res.text().catch(() => ""),
|
|
204
|
+
messages: args.messages
|
|
205
|
+
});
|
|
193
206
|
}
|
|
194
207
|
const contentType = res.headers.get("content-type") ?? "";
|
|
195
208
|
const isEventStream = contentType.includes("text/event-stream");
|
|
@@ -206,6 +219,7 @@ async function executeOpenAiCompatibleChatCompletion(args) {
|
|
|
206
219
|
...streamed.tool_calls ? { tool_calls: streamed.tool_calls } : {},
|
|
207
220
|
...streamed.reasoning_content ? { reasoning_content: streamed.reasoning_content } : {},
|
|
208
221
|
...streamed.usage ? { usage: streamed.usage } : {},
|
|
222
|
+
...streamed.stream_complete ? { stream_complete: true } : {},
|
|
209
223
|
...streamed.finish_reason ? { finish_reason: streamed.finish_reason } : {},
|
|
210
224
|
trace: args.messages
|
|
211
225
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
3
3
|
isAntigravityOAuthAgent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-H5Y2H2N6.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText,
|
|
7
7
|
fetchAndSerializeTable,
|
|
8
8
|
waitForAbortableDelay
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SKURMCJF.js";
|
|
10
10
|
import {
|
|
11
11
|
createDrainExhaustedResponse,
|
|
12
12
|
isCoreDrainingBody,
|
|
@@ -26,15 +26,17 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
fetchAndCacheMessages,
|
|
28
28
|
shouldUseServerProxy
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-XNV42PMD.js";
|
|
30
30
|
import {
|
|
31
31
|
fetchServerSyncedCredential
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-HYJNPPQ6.js";
|
|
33
33
|
import {
|
|
34
34
|
buildCurrentTimeBlock,
|
|
35
35
|
buildIdentityBlock,
|
|
36
|
-
buildRuntimeGuidanceBlocks
|
|
37
|
-
|
|
36
|
+
buildRuntimeGuidanceBlocks,
|
|
37
|
+
requiresBareImageUrl,
|
|
38
|
+
toBareImageUrlMessages
|
|
39
|
+
} from "./chunk-LUKQQJFL.js";
|
|
38
40
|
import {
|
|
39
41
|
buildProviderAuthHeaders,
|
|
40
42
|
convertMessagesToResponsesInput,
|
|
@@ -42,13 +44,13 @@ import {
|
|
|
42
44
|
preserveAgentStateFields,
|
|
43
45
|
resolvePlatformChatCompletionsEndpoint,
|
|
44
46
|
resolvePlatformResponsesEndpoint
|
|
45
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-TYPHUVK5.js";
|
|
46
48
|
import {
|
|
47
49
|
canonicalizeToolNames
|
|
48
50
|
} from "./chunk-B4KT7RN2.js";
|
|
49
51
|
import {
|
|
50
52
|
estimateTokenCount
|
|
51
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-JFANOO7I.js";
|
|
52
54
|
import {
|
|
53
55
|
clampReasoningEffort,
|
|
54
56
|
getModelConfig,
|
|
@@ -1124,6 +1126,9 @@ var normalizeChatCompletionsBodyForProvider = ({
|
|
|
1124
1126
|
delete nextBody.max_tokens;
|
|
1125
1127
|
}
|
|
1126
1128
|
}
|
|
1129
|
+
if (Array.isArray(nextBody.messages) && requiresBareImageUrl({ provider, model })) {
|
|
1130
|
+
nextBody.messages = toBareImageUrlMessages(nextBody.messages);
|
|
1131
|
+
}
|
|
1127
1132
|
return nextBody;
|
|
1128
1133
|
};
|
|
1129
1134
|
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
deleteServerSyncedCredential,
|
|
17
17
|
runLlm
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HYJNPPQ6.js";
|
|
19
19
|
import {
|
|
20
20
|
cleanupCliSessionForDialog
|
|
21
21
|
} from "./chunk-RWO5DGXI.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
normalizeAssistantContentBuffer,
|
|
34
34
|
planCompression,
|
|
35
35
|
serializeMessageContent
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JFANOO7I.js";
|
|
37
37
|
import {
|
|
38
38
|
findModelConfig,
|
|
39
39
|
getModelConfig
|
|
@@ -10484,7 +10484,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
10484
10484
|
runtimeOptions: args.runtimeOptions
|
|
10485
10485
|
});
|
|
10486
10486
|
if (agentKeyToUse) {
|
|
10487
|
-
const { streamAgentChatTurn } = await import("./agentSlice-
|
|
10487
|
+
const { streamAgentChatTurn } = await import("./agentSlice-NGZWIMZX.js");
|
|
10488
10488
|
await dispatch(
|
|
10489
10489
|
streamAgentChatTurn({
|
|
10490
10490
|
agentKey: agentKeyToUse,
|
|
@@ -13195,7 +13195,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
13195
13195
|
}
|
|
13196
13196
|
if (isCurrentDialog) {
|
|
13197
13197
|
await thunkApi.dispatch(resetMsgs());
|
|
13198
|
-
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-
|
|
13198
|
+
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-YNEFYFSU.js");
|
|
13199
13199
|
dispatch(clearPendingAttachments2());
|
|
13200
13200
|
clearWorkflow();
|
|
13201
13201
|
}
|
|
@@ -13204,15 +13204,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
13204
13204
|
|
|
13205
13205
|
// packages/chat/dialog/dialogSlice.ts
|
|
13206
13206
|
var runCreateDialogAction = async (args, thunkApi) => {
|
|
13207
|
-
const { createDialogAction } = await import("./createDialogAction-
|
|
13207
|
+
const { createDialogAction } = await import("./createDialogAction-RSNVGR5E.js");
|
|
13208
13208
|
return createDialogAction(args, thunkApi);
|
|
13209
13209
|
};
|
|
13210
13210
|
var runCreateAgentAutomationAction = async (args, thunkApi) => {
|
|
13211
|
-
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-
|
|
13211
|
+
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-AHSBJKGX.js");
|
|
13212
13212
|
return createAgentAutomationAction(args, thunkApi);
|
|
13213
13213
|
};
|
|
13214
13214
|
var runUpdateDialogTitleAction = async (args, thunkApi) => {
|
|
13215
|
-
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-
|
|
13215
|
+
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-V5AD52MZ.js");
|
|
13216
13216
|
return updateDialogTitleAction(args, thunkApi);
|
|
13217
13217
|
};
|
|
13218
13218
|
var runAddDialogAgentAction = async (args, thunkApi) => {
|
|
@@ -13232,7 +13232,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
|
|
|
13232
13232
|
return setDialogExtraReferencesAction(args, thunkApi);
|
|
13233
13233
|
};
|
|
13234
13234
|
var runHandleSendMessageAction = async (args, thunkApi) => {
|
|
13235
|
-
const { handleSendMessageAction } = await import("./handleSendMessageAction-
|
|
13235
|
+
const { handleSendMessageAction } = await import("./handleSendMessageAction-U5AX6CGB.js");
|
|
13236
13236
|
return handleSendMessageAction(args, thunkApi);
|
|
13237
13237
|
};
|
|
13238
13238
|
function clearDialogState() {
|
|
@@ -13245,7 +13245,7 @@ var createPageAndAddReference = createAsyncThunk(
|
|
|
13245
13245
|
async (payload, { dispatch, getState, rejectWithValue }) => {
|
|
13246
13246
|
const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
|
|
13247
13247
|
try {
|
|
13248
|
-
const { createDocState } = await import("./docStore-
|
|
13248
|
+
const { createDocState } = await import("./docStore-OBBYKQVD.js");
|
|
13249
13249
|
const pageKey = await createDocState(
|
|
13250
13250
|
{ slateData, title },
|
|
13251
13251
|
{ dispatch, getState }
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XNV42PMD.js";
|
|
4
4
|
import "./chunk-V2J635L5.js";
|
|
5
5
|
import "./chunk-MRC4Q34M.js";
|
|
6
6
|
import "./chunk-MTU75CZ2.js";
|
|
7
7
|
import "./chunk-CWMSB67P.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-HYJNPPQ6.js";
|
|
9
9
|
import "./chunk-RWO5DGXI.js";
|
|
10
10
|
import "./chunk-Z4NR32XR.js";
|
|
11
11
|
import "./chunk-M76ECQRD.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-JFANOO7I.js";
|
|
13
|
+
import "./chunk-5MMAK75Q.js";
|
|
13
14
|
import "./chunk-OGGHETUE.js";
|
|
14
15
|
import "./chunk-PDL2AV3E.js";
|
|
15
16
|
import "./chunk-JZPBVBIY.js";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDialogAction,
|
|
3
3
|
isLocalOwnerDialogAgents
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LKVDZQGM.js";
|
|
5
5
|
import "./chunk-VC6OZXO5.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-XNV42PMD.js";
|
|
7
7
|
import "./chunk-V2J635L5.js";
|
|
8
8
|
import "./chunk-MRC4Q34M.js";
|
|
9
9
|
import "./chunk-MTU75CZ2.js";
|
|
10
10
|
import "./chunk-CWMSB67P.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-HYJNPPQ6.js";
|
|
12
12
|
import "./chunk-RWO5DGXI.js";
|
|
13
13
|
import "./chunk-Z4NR32XR.js";
|
|
14
14
|
import "./chunk-M76ECQRD.js";
|
|
15
15
|
import "./chunk-WZSRQNQG.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-JFANOO7I.js";
|
|
17
|
+
import "./chunk-5MMAK75Q.js";
|
|
17
18
|
import "./chunk-OGGHETUE.js";
|
|
18
19
|
import "./chunk-PDL2AV3E.js";
|
|
19
20
|
import "./chunk-JZPBVBIY.js";
|
|
@@ -18,17 +18,18 @@ import {
|
|
|
18
18
|
addContentToSpace,
|
|
19
19
|
client_default,
|
|
20
20
|
selectCurrentSpaceId
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XNV42PMD.js";
|
|
22
22
|
import "./chunk-V2J635L5.js";
|
|
23
23
|
import "./chunk-MRC4Q34M.js";
|
|
24
24
|
import "./chunk-MTU75CZ2.js";
|
|
25
25
|
import "./chunk-CWMSB67P.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-HYJNPPQ6.js";
|
|
27
27
|
import "./chunk-RWO5DGXI.js";
|
|
28
28
|
import "./chunk-Z4NR32XR.js";
|
|
29
29
|
import "./chunk-M76ECQRD.js";
|
|
30
30
|
import "./chunk-WZSRQNQG.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-JFANOO7I.js";
|
|
32
|
+
import "./chunk-5MMAK75Q.js";
|
|
32
33
|
import "./chunk-OGGHETUE.js";
|
|
33
34
|
import "./chunk-PDL2AV3E.js";
|
|
34
35
|
import "./chunk-JZPBVBIY.js";
|
|
@@ -8,24 +8,25 @@ import {
|
|
|
8
8
|
runDialogReadCommand,
|
|
9
9
|
runDialogStatusCommand,
|
|
10
10
|
sortDialogs
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UP6JMU6C.js";
|
|
12
12
|
import "./chunk-ID4G2MAR.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-P3J54V3I.js";
|
|
14
|
+
import "./chunk-CGAYFFIB.js";
|
|
15
|
+
import "./chunk-QYZ46ZC3.js";
|
|
16
16
|
import "./chunk-VHBWHNVT.js";
|
|
17
17
|
import "./chunk-KQHGZWSV.js";
|
|
18
18
|
import "./chunk-MTU75CZ2.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-UNEZBV37.js";
|
|
20
20
|
import "./chunk-ZNFJWEN4.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-3GOA33JO.js";
|
|
22
22
|
import "./chunk-NCGFB7NN.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-TA7VKOHU.js";
|
|
24
24
|
import "./chunk-OPZYGHUC.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-LUKQQJFL.js";
|
|
26
|
+
import "./chunk-TYPHUVK5.js";
|
|
27
27
|
import "./chunk-B4KT7RN2.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-JFANOO7I.js";
|
|
29
|
+
import "./chunk-5MMAK75Q.js";
|
|
29
30
|
import "./chunk-OGGHETUE.js";
|
|
30
31
|
import "./chunk-PDL2AV3E.js";
|
|
31
32
|
import "./chunk-JZPBVBIY.js";
|
|
@@ -19,16 +19,17 @@ import {
|
|
|
19
19
|
setPrimaryDialogAgent,
|
|
20
20
|
updateDialogTitle,
|
|
21
21
|
updateTokens
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-XNV42PMD.js";
|
|
23
23
|
import "./chunk-V2J635L5.js";
|
|
24
24
|
import "./chunk-MRC4Q34M.js";
|
|
25
25
|
import "./chunk-MTU75CZ2.js";
|
|
26
26
|
import "./chunk-CWMSB67P.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-HYJNPPQ6.js";
|
|
28
28
|
import "./chunk-RWO5DGXI.js";
|
|
29
29
|
import "./chunk-Z4NR32XR.js";
|
|
30
30
|
import "./chunk-M76ECQRD.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-JFANOO7I.js";
|
|
32
|
+
import "./chunk-5MMAK75Q.js";
|
|
32
33
|
import "./chunk-OGGHETUE.js";
|
|
33
34
|
import "./chunk-PDL2AV3E.js";
|
|
34
35
|
import "./chunk-JZPBVBIY.js";
|
|
@@ -19,23 +19,24 @@ import {
|
|
|
19
19
|
resolveDocKind,
|
|
20
20
|
resolveWriteTargets,
|
|
21
21
|
writePageRecord
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-HO7RHQIN.js";
|
|
23
|
+
import "./chunk-CGAYFFIB.js";
|
|
24
|
+
import "./chunk-QYZ46ZC3.js";
|
|
25
25
|
import "./chunk-VHBWHNVT.js";
|
|
26
26
|
import "./chunk-VF4K2QE6.js";
|
|
27
27
|
import "./chunk-VC6OZXO5.js";
|
|
28
28
|
import "./chunk-WZSRQNQG.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-UNEZBV37.js";
|
|
30
30
|
import "./chunk-ZNFJWEN4.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-3GOA33JO.js";
|
|
32
32
|
import "./chunk-NCGFB7NN.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-TA7VKOHU.js";
|
|
34
34
|
import "./chunk-OPZYGHUC.js";
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-LUKQQJFL.js";
|
|
36
|
+
import "./chunk-TYPHUVK5.js";
|
|
37
37
|
import "./chunk-B4KT7RN2.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-JFANOO7I.js";
|
|
39
|
+
import "./chunk-5MMAK75Q.js";
|
|
39
40
|
import "./chunk-OGGHETUE.js";
|
|
40
41
|
import "./chunk-PDL2AV3E.js";
|
|
41
42
|
import "./chunk-JZPBVBIY.js";
|