nolo-cli 0.173.0-alpha.1 → 0.173.0-alpha.2
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-KT7NUYZC.js → _executeModel-557MGBNC.js} +14 -14
- package/{agentDeleteCommand-SVGYPFU5.js → agentDeleteCommand-HG5EDCO6.js} +15 -15
- package/{agentEmailCommands-TBZJC37X.js → agentEmailCommands-7YX27N6M.js} +17 -17
- package/{agentListCommands-CD7CLGH4.js → agentListCommands-AT5IGY5W.js} +6 -6
- package/{agentMachineCommands-DQBUP3I5.js → agentMachineCommands-WR3IFBB6.js} +7 -7
- package/{agentRecordCommands-4PY33TAJ.js → agentRecordCommands-T6PXLK4B.js} +16 -16
- package/{agentRunCommand-P7BC5M3Z.js → agentRunCommand-RB3TFF6O.js} +17 -17
- package/{agentRuntimeLocal-XGBQ7JK2.js → agentRuntimeLocal-72TUBESS.js} +6 -6
- package/{agentSlice-NL7LRTLO.js → agentSlice-YQHUKPIF.js} +1 -1
- package/{appDeleteCommands-VBH3YLIO.js → appDeleteCommands-THIHX7BV.js} +6 -6
- package/{appDeployCommands-3MZXLEKN.js → appDeployCommands-5JA5DDMR.js} +6 -6
- package/{appDeployStatusCommands-FAWWEEOT.js → appDeployStatusCommands-EHFPCQHM.js} +6 -6
- package/{appGetCommands-VMMCATHU.js → appGetCommands-4HSRXSYD.js} +6 -6
- package/{appListCommands-NHM6PAIX.js → appListCommands-TD7BQFWQ.js} +6 -6
- package/{authCommand-KQ7GWCXK.js → authCommand-CVKPVPHN.js} +2 -2
- package/{chunk-TLBTPKDD.js → chunk-24VDDKCB.js} +8 -8
- package/{chunk-3TAVX6CD.js → chunk-2OWYKHKI.js} +37 -19
- package/{chunk-AFFHPBEU.js → chunk-4NYYWHM7.js} +5 -5
- package/{chunk-FX33MFLW.js → chunk-A6B3LSDB.js} +66 -18
- package/{chunk-O3OJRN5Z.js → chunk-DWFRZ3UI.js} +1 -1
- package/{chunk-73NYJAJS.js → chunk-EGT6ORP5.js} +8 -8
- package/{chunk-KBGWPSY6.js → chunk-EVW2U6RH.js} +3 -3
- package/{chunk-AV67EUU4.js → chunk-EY3QEZZR.js} +9 -9
- package/{chunk-CLY56QIC.js → chunk-FDPODXE3.js} +1 -1
- package/{chunk-J33JIJK7.js → chunk-HHEM4TV3.js} +1 -1
- package/{chunk-BGQZLBMJ.js → chunk-ISIFZP3N.js} +1 -1
- package/{chunk-BYNWE72R.js → chunk-IVPXG433.js} +20 -7
- package/{chunk-FJ76E5ZM.js → chunk-J63HVOSX.js} +2 -2
- package/{chunk-GXFAZGZ6.js → chunk-KXIJYPVC.js} +2 -2
- package/{chunk-N2N63HTQ.js → chunk-L7ZCLG72.js} +2 -2
- package/{chunk-O2LB346J.js → chunk-LCCULKPJ.js} +1 -1
- package/{chunk-VETQRONK.js → chunk-LTWBOZE6.js} +8 -8
- package/{chunk-JDWJ64VG.js → chunk-ONQ2APOE.js} +3 -3
- package/{chunk-25A6K2YP.js → chunk-QFAISMV5.js} +3 -3
- package/{chunk-W7S5CUGI.js → chunk-RABMW33C.js} +3 -3
- package/{chunk-WBA4HAFS.js → chunk-RYBZM4A2.js} +2 -2
- package/{chunk-4RYUMDOM.js → chunk-TMAQFKHS.js} +2 -2
- package/{chunk-ASGIXFB6.js → chunk-VJ52BYBK.js} +1 -1
- package/{chunk-64MLOS7B.js → chunk-Z4HDFBYK.js} +1 -1
- package/{commandRegistry-UVXIFHUI.js → commandRegistry-PJ3EQ6U7.js} +47 -47
- package/{contentThunks-I4HNLTQY.js → contentThunks-NVX3NBHZ.js} +3 -3
- package/{createAgentAutomationAction-GS5LQ52L.js → createAgentAutomationAction-EONFRZYA.js} +3 -3
- package/{createDialogAction-5WNACKWC.js → createDialogAction-ZVY45CNY.js} +4 -4
- package/{createPageAction-S7MGYSMU.js → createPageAction-N5XSWPN2.js} +3 -3
- package/{dialogCommands-OK3L6SAI.js → dialogCommands-CPK6MUIJ.js} +6 -6
- package/{dialogSlice-R62QV2OE.js → dialogSlice-ST2FXOF3.js} +2 -2
- package/{docCreateCommands-NMCMJPQX.js → docCreateCommands-GLR2HLYH.js} +6 -6
- package/{docDeleteCommands-46FMFRZU.js → docDeleteCommands-MPE53Z5W.js} +6 -6
- package/{docReadCommands-6NPY5P67.js → docReadCommands-MFKWAFDI.js} +6 -6
- package/{docStore-X5P4UGTZ.js → docStore-PPUT7MQV.js} +1 -1
- package/{docUpdateCommands-UDT4QLPL.js → docUpdateCommands-3QBT2XTK.js} +6 -6
- package/{handleSendMessageAction-IVQMBROO.js → handleSendMessageAction-74EKQW4M.js} +7 -7
- package/index.js +4 -4
- package/{localRuntimeAdapter-LY5MOJN4.js → localRuntimeAdapter-KQHAGAXR.js} +15 -15
- package/{machineCommands-KYTNSAIN.js → machineCommands-DMPHPCQS.js} +16 -16
- package/{machineWsRunDispatch-ZR3GCQMH.js → machineWsRunDispatch-736CCGUF.js} +16 -16
- package/package.json +1 -1
- package/{readlineWorkspace-SNA6I5UK.js → readlineWorkspace-K4WNNW2D.js} +17 -17
- package/{runAgentClientLoop-6G7JORHJ.js → runAgentClientLoop-Z6STKR3Z.js} +12 -12
- package/{spaceCommands-SEWFBY53.js → spaceCommands-U4UYF6IB.js} +6 -6
- package/{streamAgentChatTurn-EJDRXKAQ.js → streamAgentChatTurn-2ON7E6LT.js} +15 -15
- package/{tools-K3IZ7U5G.js → tools-ZB2YBHSS.js} +7 -7
- package/{tuiSummaryLlmCaller-2MC6SXZT.js → tuiSummaryLlmCaller-I2MRY6T5.js} +3 -3
- package/{updateDialogTitleAction-YO67K72J.js → updateDialogTitleAction-YMQAOVJ2.js} +3 -3
|
@@ -18,23 +18,23 @@ import "./chunk-RPZNVBA5.js";
|
|
|
18
18
|
import "./chunk-NBTY7YJF.js";
|
|
19
19
|
import "./chunk-VF4K2QE6.js";
|
|
20
20
|
import "./chunk-UAD2WT54.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-IVPXG433.js";
|
|
22
|
+
import "./chunk-DWFRZ3UI.js";
|
|
23
23
|
import "./chunk-ZNFJWEN4.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-LCCULKPJ.js";
|
|
25
25
|
import "./chunk-HNUWUO75.js";
|
|
26
26
|
import "./chunk-CHOZJMJS.js";
|
|
27
27
|
import "./chunk-PWTNI4N7.js";
|
|
28
28
|
import "./chunk-SRZ6BQIP.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-HHEM4TV3.js";
|
|
30
30
|
import "./chunk-2WZXXAQD.js";
|
|
31
31
|
import "./chunk-7QQOOHDG.js";
|
|
32
32
|
import "./chunk-G6OOUQWJ.js";
|
|
33
33
|
import "./chunk-56GBUMO5.js";
|
|
34
34
|
import "./chunk-WJZOQR2J.js";
|
|
35
35
|
import "./chunk-ZEOR6XPJ.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-ISIFZP3N.js";
|
|
37
|
+
import "./chunk-A6B3LSDB.js";
|
|
38
38
|
import "./chunk-2GRXE3YJ.js";
|
|
39
39
|
import "./chunk-JLR5NWP2.js";
|
|
40
40
|
import "./chunk-XAFCJN32.js";
|
|
@@ -65,10 +65,10 @@ import {
|
|
|
65
65
|
detectLocalDevinCredentials,
|
|
66
66
|
extractDevinToken,
|
|
67
67
|
fetchAntigravityCloudCodeCompletion
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-DWFRZ3UI.js";
|
|
69
69
|
import "./chunk-HNUWUO75.js";
|
|
70
70
|
import "./chunk-7QQOOHDG.js";
|
|
71
|
-
import "./chunk-
|
|
71
|
+
import "./chunk-A6B3LSDB.js";
|
|
72
72
|
import "./chunk-XAFCJN32.js";
|
|
73
73
|
import "./chunk-5ZUL4CUO.js";
|
|
74
74
|
import "./chunk-UKZX3NHN.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
toolRunUpdated,
|
|
21
21
|
uiCardFallback,
|
|
22
22
|
waitForAbortableDelay
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-KXIJYPVC.js";
|
|
24
24
|
import {
|
|
25
25
|
isGatewayHttpStatus
|
|
26
26
|
} from "./chunk-NF64D32W.js";
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
} from "./chunk-VF4K2QE6.js";
|
|
65
65
|
import {
|
|
66
66
|
createDocState
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-L7ZCLG72.js";
|
|
68
68
|
import {
|
|
69
69
|
addMemberSpace,
|
|
70
70
|
fetchAuthoritativeRemoteSpace,
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
} from "./chunk-BAWAKW7X.js";
|
|
80
80
|
import {
|
|
81
81
|
createDialogAction
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-RYBZM4A2.js";
|
|
83
83
|
import {
|
|
84
84
|
setDialogExtraReferencesAction
|
|
85
85
|
} from "./chunk-IF7V3CBU.js";
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
updateContentCategory,
|
|
103
103
|
updateContentTitle,
|
|
104
104
|
writeStoredCollapsedCategories
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-Z4HDFBYK.js";
|
|
106
106
|
import {
|
|
107
107
|
buildDatabaseFileContentUrl,
|
|
108
108
|
deleteDialog,
|
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
selectMsgById,
|
|
116
116
|
uiAskChoiceFunc,
|
|
117
117
|
uiAskChoiceFunctionSchema
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-LTWBOZE6.js";
|
|
119
119
|
import {
|
|
120
120
|
buildMediaToolConfirmation,
|
|
121
121
|
normalizeMediaConfirmExecutionRevision
|
|
@@ -126,7 +126,7 @@ import {
|
|
|
126
126
|
runLlm,
|
|
127
127
|
streamAgentChatTurn,
|
|
128
128
|
updateAgent
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-RABMW33C.js";
|
|
130
130
|
import {
|
|
131
131
|
getCurrentSpaceId,
|
|
132
132
|
getCurrentSpaceIdRaw,
|
|
@@ -3882,7 +3882,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
3882
3882
|
const deletedDialogIds = [];
|
|
3883
3883
|
const deletedDialogKeys = [];
|
|
3884
3884
|
const failures = [];
|
|
3885
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
3885
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-ST2FXOF3.js");
|
|
3886
3886
|
for (const target of targets) {
|
|
3887
3887
|
try {
|
|
3888
3888
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -18563,7 +18563,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18563
18563
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
18564
18564
|
};
|
|
18565
18565
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
18566
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
18566
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-PPUT7MQV.js");
|
|
18567
18567
|
if (getDocState().pageKey === id) {
|
|
18568
18568
|
applyExternalDocUpdate({
|
|
18569
18569
|
slateData: finalSlateData,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
import {
|
|
65
65
|
inlineImageUrlsForCustomProvider,
|
|
66
66
|
prepareTools
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-TMAQFKHS.js";
|
|
68
68
|
import {
|
|
69
69
|
getServerProviderSecret
|
|
70
70
|
} from "./chunk-HS7MLR74.js";
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
resolveCliLocalRuntimeKeyCapability,
|
|
87
87
|
resolveCliLocalSpawnDispatch,
|
|
88
88
|
resolveStartAgentRunCwd
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-24VDDKCB.js";
|
|
90
90
|
import {
|
|
91
91
|
deriveCredentialGroup,
|
|
92
92
|
deriveCustomProviderCredentialGroup
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
} from "./chunk-KFHREHUQ.js";
|
|
98
98
|
import {
|
|
99
99
|
resolveAgentRequiredPackIds
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-KXIJYPVC.js";
|
|
101
101
|
import {
|
|
102
102
|
applyBuiltinAgentRuntimeOverride,
|
|
103
103
|
applyTokenUsageToDayStats,
|
|
@@ -106,14 +106,14 @@ import {
|
|
|
106
106
|
resolveBuiltinPlatformAgentConfig,
|
|
107
107
|
runKeyed,
|
|
108
108
|
validateAskChoiceInput
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-LTWBOZE6.js";
|
|
110
110
|
import {
|
|
111
111
|
BUILTIN_DIALOG_LLM_CHAT_FALLBACK_MODEL,
|
|
112
112
|
BUILTIN_TITLE_LLM_CONFIG
|
|
113
113
|
} from "./chunk-523DITKR.js";
|
|
114
114
|
import {
|
|
115
115
|
fetchServerSyncedCredential
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-RABMW33C.js";
|
|
117
117
|
import {
|
|
118
118
|
isTombstoneRecord
|
|
119
119
|
} from "./chunk-D2MDMY2M.js";
|
|
@@ -170,7 +170,7 @@ import {
|
|
|
170
170
|
runExecShellGates,
|
|
171
171
|
validateConfiguredRootExecutionLease,
|
|
172
172
|
verifyOwnerRouteAck
|
|
173
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-IVPXG433.js";
|
|
174
174
|
import {
|
|
175
175
|
accumulateGeminiChunks,
|
|
176
176
|
buildGeminiGenerateContentRequest,
|
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
resolveAntigravityFinishReason,
|
|
183
183
|
resolveGeminiModelQuirks,
|
|
184
184
|
shouldUseGeminiNativeToolRoute
|
|
185
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-DWFRZ3UI.js";
|
|
186
186
|
import {
|
|
187
187
|
PlatformStreamInterruptedError,
|
|
188
188
|
buildPlatformChatCompletionRequest,
|
|
@@ -193,14 +193,14 @@ import {
|
|
|
193
193
|
readPlatformChatSseCompletion,
|
|
194
194
|
resolvePlatformChatProviderConfig,
|
|
195
195
|
shouldUsePlatformChatProvider
|
|
196
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-LCCULKPJ.js";
|
|
197
197
|
import {
|
|
198
198
|
readSseDataValues,
|
|
199
199
|
readSseFrames
|
|
200
200
|
} from "./chunk-HNUWUO75.js";
|
|
201
201
|
import {
|
|
202
202
|
resolveAgentRuntimeConfigFromRecord
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-HHEM4TV3.js";
|
|
204
204
|
import {
|
|
205
205
|
resolveHistoricalToolContentCap
|
|
206
206
|
} from "./chunk-2WZXXAQD.js";
|
|
@@ -213,12 +213,16 @@ import {
|
|
|
213
213
|
findAgentStatePairingIssues,
|
|
214
214
|
stablePromptCacheKey,
|
|
215
215
|
toResponsesTools
|
|
216
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-ISIFZP3N.js";
|
|
217
217
|
import {
|
|
218
218
|
EMPTY_TOOL_RESULT_TEXT,
|
|
219
|
+
createToolImageBudget,
|
|
219
220
|
hadToolImages,
|
|
221
|
+
toolImageNotices,
|
|
222
|
+
toolImageOmission,
|
|
223
|
+
toolImageSource,
|
|
220
224
|
toolImages
|
|
221
|
-
} from "./chunk-
|
|
225
|
+
} from "./chunk-A6B3LSDB.js";
|
|
222
226
|
import {
|
|
223
227
|
buildNoloWorkspaceOpenAiTools,
|
|
224
228
|
filterClientNoloWorkspaceToolNames,
|
|
@@ -792,6 +796,7 @@ function buildAnthropicMessagesBody(args) {
|
|
|
792
796
|
system.push({ type: "text", text: args.agentConfig.prompt.trim() });
|
|
793
797
|
}
|
|
794
798
|
const messages = [];
|
|
799
|
+
const imageBudget = createToolImageBudget();
|
|
795
800
|
for (const raw of rawMessages) {
|
|
796
801
|
if (!raw || typeof raw !== "object") continue;
|
|
797
802
|
const message = raw;
|
|
@@ -819,17 +824,30 @@ function buildAnthropicMessagesBody(args) {
|
|
|
819
824
|
const images = toolImages(message);
|
|
820
825
|
if (!hadToolImages(message)) return text;
|
|
821
826
|
const effective = text.trim() ? text : EMPTY_TOOL_RESULT_TEXT;
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
827
|
+
const notices = toolImageNotices(message);
|
|
828
|
+
const imageBlocks = [];
|
|
829
|
+
if (resolveAgentImageInputSupport(args.agentConfig)) {
|
|
830
|
+
for (const image of images) {
|
|
831
|
+
const decision = imageBudget(image);
|
|
832
|
+
if (decision === "duplicate") continue;
|
|
833
|
+
if (decision !== "delivered") {
|
|
834
|
+
if (!notices.seen.has(image)) {
|
|
835
|
+
notices.seen.add(image);
|
|
836
|
+
notices.text.push(toolImageOmission(toolImageSource(message), decision === "impossible"));
|
|
837
|
+
}
|
|
838
|
+
} else {
|
|
839
|
+
imageBlocks.push({ type: "image", source: {
|
|
840
|
+
type: "base64",
|
|
841
|
+
media_type: image.mimeType,
|
|
842
|
+
data: image.dataBase64
|
|
843
|
+
} });
|
|
844
|
+
}
|
|
845
|
+
}
|
|
825
846
|
}
|
|
826
847
|
return [
|
|
827
848
|
{ type: "text", text: effective },
|
|
828
|
-
...
|
|
829
|
-
|
|
830
|
-
media_type: image.mimeType,
|
|
831
|
-
data: image.dataBase64
|
|
832
|
-
} }))
|
|
849
|
+
...notices.text.map((text2) => ({ type: "text", text: text2 })),
|
|
850
|
+
...imageBlocks
|
|
833
851
|
];
|
|
834
852
|
})()
|
|
835
853
|
}]);
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
mergeReferences,
|
|
8
8
|
resolveReferenceAssets,
|
|
9
9
|
resolveToolsFromKeys
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-J63HVOSX.js";
|
|
11
11
|
import {
|
|
12
12
|
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
13
13
|
getAllToolRuns,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
selectSpaceContextLevel,
|
|
21
21
|
selectUserTonePreset,
|
|
22
22
|
uiCardFallback
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-KXIJYPVC.js";
|
|
24
24
|
import {
|
|
25
25
|
resolveToolBaseUrl
|
|
26
26
|
} from "./chunk-MYOH447Z.js";
|
|
@@ -32,15 +32,15 @@ import {
|
|
|
32
32
|
} from "./chunk-TDNAAXUQ.js";
|
|
33
33
|
import {
|
|
34
34
|
getDocState
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-L7ZCLG72.js";
|
|
36
36
|
import {
|
|
37
37
|
getTableState
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-Z4HDFBYK.js";
|
|
39
39
|
import {
|
|
40
40
|
PERSONALIZATION_DIALOG_CATEGORY,
|
|
41
41
|
buildPersonalizationDialogPolicyContext,
|
|
42
42
|
selectAllMsgs
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-LTWBOZE6.js";
|
|
44
44
|
import {
|
|
45
45
|
getCurrentSpaceIdRaw,
|
|
46
46
|
getViewMode
|
|
@@ -19,21 +19,68 @@ function withoutToolImages(message) {
|
|
|
19
19
|
}
|
|
20
20
|
} : textOnly;
|
|
21
21
|
}
|
|
22
|
+
var TOOL_IMAGE_NOTICES = Symbol("runtime-only-tool-image-notices");
|
|
23
|
+
function createToolImageNotices() {
|
|
24
|
+
return { text: [], seen: /* @__PURE__ */ new WeakSet() };
|
|
25
|
+
}
|
|
26
|
+
function toolImageNotices(message) {
|
|
27
|
+
const holder = message;
|
|
28
|
+
return holder[TOOL_IMAGE_NOTICES] ??= createToolImageNotices();
|
|
29
|
+
}
|
|
30
|
+
var delivery = /* @__PURE__ */ new WeakMap();
|
|
31
|
+
function resetToolImageDelivery(images) {
|
|
32
|
+
for (const image of images) delivery.delete(image);
|
|
33
|
+
}
|
|
34
|
+
function toolImageDelivery(image) {
|
|
35
|
+
return delivery.get(image);
|
|
36
|
+
}
|
|
37
|
+
function createToolImageBudget() {
|
|
38
|
+
let count = 0;
|
|
39
|
+
let bytes = 0;
|
|
40
|
+
const seen = /* @__PURE__ */ new Set();
|
|
41
|
+
return (image) => {
|
|
42
|
+
const key = `${image.mimeType}\0${image.dataBase64}`;
|
|
43
|
+
if (seen.has(key)) return "duplicate";
|
|
44
|
+
seen.add(key);
|
|
45
|
+
const size = Buffer.byteLength(image.dataBase64, "utf8");
|
|
46
|
+
if (size > 8 * 1024 * 1024) {
|
|
47
|
+
delivery.set(image, "impossible");
|
|
48
|
+
return "impossible";
|
|
49
|
+
}
|
|
50
|
+
if (count >= 4 || bytes + size > 8 * 1024 * 1024) return "pending";
|
|
51
|
+
count += 1;
|
|
52
|
+
bytes += size;
|
|
53
|
+
delivery.set(image, "delivered");
|
|
54
|
+
return "delivered";
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function toolImageSource(message) {
|
|
58
|
+
const path = typeof message.content === "string" ? message.content.match(/→ ([^\s\x00-\x1f\x7f]+)/u)?.[1]?.replace(/\]$/, "") : void 0;
|
|
59
|
+
return `${(message.tool_call_id ?? "unknown").replace(/[\x00-\x1f\x7f]/g, "")}${path ? ` (${path})` : ""}`;
|
|
60
|
+
}
|
|
61
|
+
function toolImageOmission(source, impossible) {
|
|
62
|
+
return impossible ? `Tool image permanently downgraded to text: ${source}. Impossible to deliver: single image exceeds 8 MiB base64; will not retry. Do not guess its content.` : `Tool image deferred to a later round in this turn: ${source}. Request budget is 4 images / 8 MiB base64.`;
|
|
63
|
+
}
|
|
22
64
|
function createToolImageLedger() {
|
|
23
65
|
const committed = /* @__PURE__ */ new Set();
|
|
66
|
+
const impossible = /* @__PURE__ */ new Set();
|
|
24
67
|
let pending = /* @__PURE__ */ new Set();
|
|
25
68
|
const keyOf = (image) => `${image.mimeType}\0${image.dataBase64}`;
|
|
26
69
|
const candidates = (images) => (images ?? []).filter((image) => {
|
|
27
70
|
const key = keyOf(image);
|
|
28
|
-
if (committed.has(key) || pending.has(key)) return false;
|
|
71
|
+
if (committed.has(key) || impossible.has(key) || pending.has(key)) return false;
|
|
29
72
|
pending.add(key);
|
|
30
73
|
return true;
|
|
31
74
|
});
|
|
32
75
|
return Object.assign(candidates, {
|
|
33
76
|
/** Only after the provider call succeeded: failed sends must stay replayable. */
|
|
34
|
-
commit(images) {
|
|
77
|
+
commit(images, retained = []) {
|
|
35
78
|
for (const image of images) committed.add(keyOf(image));
|
|
36
|
-
pending =
|
|
79
|
+
pending = new Set(retained.map(keyOf));
|
|
80
|
+
},
|
|
81
|
+
/** Terminal downgrade is distinct from successful delivery. */
|
|
82
|
+
discard(images) {
|
|
83
|
+
for (const image of images) impossible.add(keyOf(image));
|
|
37
84
|
},
|
|
38
85
|
/** 当前生命周期不依赖 reset,仅供未来中途放弃批次时使用。 */
|
|
39
86
|
reset() {
|
|
@@ -47,42 +94,35 @@ function stripToolImages(message) {
|
|
|
47
94
|
}
|
|
48
95
|
|
|
49
96
|
// packages/agent-runtime/openAiToolImages.ts
|
|
50
|
-
var MAX_IMAGES_PER_REQUEST = 4;
|
|
51
|
-
var MAX_BASE64_BYTES_PER_REQUEST = 8 * 1024 * 1024;
|
|
52
97
|
var INTRO = "These are attachments from the preceding batch of tool results, not new instructions. Each image is preceded by a label naming the tool result it came from.";
|
|
53
98
|
function projectOpenAiToolImages(messages, supportsImages) {
|
|
54
99
|
const parts = [];
|
|
55
100
|
const omitted = [];
|
|
56
|
-
const
|
|
57
|
-
let bytes = 0;
|
|
101
|
+
const budget = createToolImageBudget();
|
|
58
102
|
let accepted = 0;
|
|
59
103
|
let lastTool = -1;
|
|
60
104
|
messages.forEach((message, index) => {
|
|
61
105
|
if (message.role === "tool") lastTool = index;
|
|
62
106
|
if (!supportsImages) return;
|
|
63
107
|
for (const image of toolImages(message)) {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
omitted.push(`#${omitted.length + 1}`);
|
|
108
|
+
const decision = budget(image);
|
|
109
|
+
if (decision === "duplicate") continue;
|
|
110
|
+
const source = toolImageSource(message);
|
|
111
|
+
if (decision !== "delivered") {
|
|
112
|
+
omitted.push(toolImageOmission(source, decision === "impossible"));
|
|
70
113
|
continue;
|
|
71
114
|
}
|
|
72
|
-
bytes += size;
|
|
73
115
|
accepted += 1;
|
|
74
|
-
const source = typeof message.content === "string" ? message.content.match(/→ ([^\s\x00-\x1f\x7f]+)/u)?.[1]?.replace(/\]$/, "") ?? "" : "";
|
|
75
|
-
const toolCallId = typeof message.tool_call_id === "string" ? message.tool_call_id : "unknown";
|
|
76
116
|
parts.push({
|
|
77
117
|
type: "text",
|
|
78
|
-
text: `Image ${accepted} \u2014 from tool result ${
|
|
118
|
+
text: `Image ${accepted} \u2014 from tool result ${source}`
|
|
79
119
|
});
|
|
80
120
|
parts.push({ type: "image_url", image_url: { url: `data:${image.mimeType};base64,${image.dataBase64}` } });
|
|
81
121
|
}
|
|
82
122
|
});
|
|
83
123
|
if (lastTool < 0) return messages;
|
|
84
124
|
if (!parts.length && !omitted.length) return messages;
|
|
85
|
-
const note = omitted.length ? ` Note: ${omitted.length} image(s) omitted
|
|
125
|
+
const note = omitted.length ? ` Note: ${omitted.length} image(s) omitted. ${omitted.join(" ")}` : "";
|
|
86
126
|
const attachment = {
|
|
87
127
|
role: "user",
|
|
88
128
|
content: [{ type: "text", text: `${INTRO}${note}` }, ...parts]
|
|
@@ -97,6 +137,14 @@ export {
|
|
|
97
137
|
TOOL_IMAGES,
|
|
98
138
|
toolImages,
|
|
99
139
|
withoutToolImages,
|
|
140
|
+
TOOL_IMAGE_NOTICES,
|
|
141
|
+
createToolImageNotices,
|
|
142
|
+
toolImageNotices,
|
|
143
|
+
resetToolImageDelivery,
|
|
144
|
+
toolImageDelivery,
|
|
145
|
+
createToolImageBudget,
|
|
146
|
+
toolImageSource,
|
|
147
|
+
toolImageOmission,
|
|
100
148
|
createToolImageLedger,
|
|
101
149
|
stripToolImages,
|
|
102
150
|
projectOpenAiToolImages
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TMAQFKHS.js";
|
|
9
9
|
import {
|
|
10
10
|
CONFIRMATION_INPUT_KEYS,
|
|
11
11
|
INVALID_TOOL_ARGS_REPLACEMENT,
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
performFetchRequest,
|
|
15
15
|
sanitizeOutboundMessages,
|
|
16
16
|
stripModelToolArgs
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ONQ2APOE.js";
|
|
18
18
|
import {
|
|
19
19
|
findToolExecutor,
|
|
20
20
|
toolDefinitionsByName
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-24VDDKCB.js";
|
|
22
22
|
import {
|
|
23
23
|
classifyApiError,
|
|
24
24
|
classifyGenerationError,
|
|
25
25
|
extractErrorDiagnostics
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-J63HVOSX.js";
|
|
27
27
|
import {
|
|
28
28
|
createSSEParser,
|
|
29
29
|
createToolRunId,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
toolRunSetPending,
|
|
33
33
|
toolRunStarted,
|
|
34
34
|
toolRunSucceeded
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-KXIJYPVC.js";
|
|
36
36
|
import {
|
|
37
37
|
getPublicImageAgentMode
|
|
38
38
|
} from "./chunk-VIDPVFP3.js";
|
|
@@ -42,10 +42,10 @@ import {
|
|
|
42
42
|
messageStreaming,
|
|
43
43
|
toolResultNeedsUserConfirmation,
|
|
44
44
|
updateToolMessage
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-LTWBOZE6.js";
|
|
46
46
|
import {
|
|
47
47
|
streamAgentChatTurn
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-RABMW33C.js";
|
|
49
49
|
import {
|
|
50
50
|
getCurrentSpaceId
|
|
51
51
|
} from "./chunk-ZJ7UHBJS.js";
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
} from "./chunk-56GBUMO5.js";
|
|
86
86
|
import {
|
|
87
87
|
normalizeChatCompletionsBodyForProvider
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-ISIFZP3N.js";
|
|
89
89
|
import {
|
|
90
90
|
EMPTY_ASSISTANT_REPAIR_PROMPT
|
|
91
91
|
} from "./chunk-T7HBI3WZ.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2OWYKHKI.js";
|
|
5
5
|
import {
|
|
6
6
|
t
|
|
7
7
|
} from "./chunk-TDX2L4W2.js";
|
|
8
8
|
import {
|
|
9
9
|
clipMultilineText
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KXIJYPVC.js";
|
|
11
11
|
import {
|
|
12
12
|
runLocalAgentTurn
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IVPXG433.js";
|
|
14
14
|
import {
|
|
15
15
|
applyToolSurfaceConstraints
|
|
16
16
|
} from "./chunk-2GRXE3YJ.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveRawAgentInput,
|
|
10
10
|
resolveServerUrl,
|
|
11
11
|
writeUsage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VJ52BYBK.js";
|
|
13
13
|
import {
|
|
14
14
|
getReadableCliDb
|
|
15
15
|
} from "./chunk-62TBKWTV.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
resolveFileWriteGateEnabled,
|
|
32
32
|
resolveLocalUserId,
|
|
33
33
|
validateInstaboxWorkspaceSelection
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-2OWYKHKI.js";
|
|
35
35
|
import {
|
|
36
36
|
clearCredentialAvailability,
|
|
37
37
|
readEffectiveCredentialEntry,
|
|
@@ -79,14 +79,14 @@ import {
|
|
|
79
79
|
} from "./chunk-BMQ2MJUK.js";
|
|
80
80
|
import {
|
|
81
81
|
resolveCliLocalRuntimeKeyCapability
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-24VDDKCB.js";
|
|
83
83
|
import {
|
|
84
84
|
isTransientFetchError
|
|
85
85
|
} from "./chunk-KFHREHUQ.js";
|
|
86
86
|
import {
|
|
87
87
|
parseUiCard,
|
|
88
88
|
uiCardFallback
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-KXIJYPVC.js";
|
|
90
90
|
import {
|
|
91
91
|
isGatewayHttpStatus
|
|
92
92
|
} from "./chunk-NF64D32W.js";
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
chooseMemoryOwners,
|
|
96
96
|
loadMemoryCandidatesFromDb,
|
|
97
97
|
resolveAgentMemoryPolicy
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-RYBZM4A2.js";
|
|
99
99
|
import {
|
|
100
100
|
API_REPORTED_COST_MULTIPLIER,
|
|
101
101
|
estimateMessagesTokens,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
resolveAgentContextWindow,
|
|
104
104
|
resolveOccupancy,
|
|
105
105
|
resolveOccupancyWindow
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-LTWBOZE6.js";
|
|
107
107
|
import {
|
|
108
108
|
buildSkillDiscoveryContextLayer
|
|
109
109
|
} from "./chunk-AU7AXHUL.js";
|
|
@@ -115,10 +115,10 @@ import {
|
|
|
115
115
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
116
116
|
LOCAL_TURN_ABORTED_CODE,
|
|
117
117
|
readActionGate
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-IVPXG433.js";
|
|
119
119
|
import {
|
|
120
120
|
resolveAgentRuntimeConfigFromRecord
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-HHEM4TV3.js";
|
|
122
122
|
import {
|
|
123
123
|
createThinkParserState,
|
|
124
124
|
flushThinkParser,
|
|
@@ -11376,7 +11376,7 @@ function isBalanceExhaustedError(error) {
|
|
|
11376
11376
|
|
|
11377
11377
|
// packages/cli/client/agentRun.ts
|
|
11378
11378
|
async function loadRunLocalAgentTurn() {
|
|
11379
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
11379
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-72TUBESS.js");
|
|
11380
11380
|
return runLocalAgentTurn;
|
|
11381
11381
|
}
|
|
11382
11382
|
var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
|