nolo-cli 0.172.0-alpha.3 → 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-P7OE5QLM.js → _executeModel-557MGBNC.js} +20 -19
- package/{agentDeleteCommand-3CCYENZM.js → agentDeleteCommand-HG5EDCO6.js} +25 -24
- package/{agentEmailCommands-VH6GRZ4S.js → agentEmailCommands-7YX27N6M.js} +27 -26
- package/{agentListCommands-FCSA7YV3.js → agentListCommands-AT5IGY5W.js} +16 -15
- package/{agentMachineCommands-VEBNXOLD.js → agentMachineCommands-WR3IFBB6.js} +14 -13
- package/{agentProviderCommands-TWVILNAN.js → agentProviderCommands-FXEMNSZ2.js} +2 -2
- package/{agentRecordCommands-MGCNHOJ3.js → agentRecordCommands-T6PXLK4B.js} +25 -24
- package/{agentRunCommand-UMVA6KSF.js → agentRunCommand-RB3TFF6O.js} +26 -25
- package/{agentRuntimeLocal-2JOFHEXA.js → agentRuntimeLocal-72TUBESS.js} +12 -11
- package/{agentSlice-AXI53QZB.js → agentSlice-YQHUKPIF.js} +1 -1
- package/{appDeleteCommands-BNQKVEIA.js → appDeleteCommands-THIHX7BV.js} +15 -14
- package/{appDeployCommands-V5WQ2ZBR.js → appDeployCommands-5JA5DDMR.js} +15 -14
- package/{appDeployStatusCommands-QA5GFIUU.js → appDeployStatusCommands-EHFPCQHM.js} +15 -14
- package/{appGetCommands-U3SDB4TE.js → appGetCommands-4HSRXSYD.js} +15 -14
- package/{appListCommands-DMHPABYC.js → appListCommands-TD7BQFWQ.js} +15 -14
- package/{authCommand-BSOLJFPV.js → authCommand-CVKPVPHN.js} +8 -4
- package/{chunk-6KS4TTCI.js → chunk-24VDDKCB.js} +10 -10
- package/{chunk-4TTEZGP3.js → chunk-2OWYKHKI.js} +65 -30
- package/{chunk-3RF4DIQW.js → chunk-4NYYWHM7.js} +7 -7
- package/{chunk-I33CJERI.js → chunk-7QQOOHDG.js} +2 -2
- package/{chunk-BKCR2JHG.js → chunk-7ZGMQZ5D.js} +0 -45
- package/chunk-A6B3LSDB.js +151 -0
- package/{chunk-XWEAIAO2.js → chunk-BAXCQF6H.js} +1 -1
- package/{chunk-AJ52EA72.js → chunk-D2J22QSE.js} +1 -1
- package/{chunk-XWX5ZGWR.js → chunk-DWFRZ3UI.js} +89 -24
- package/{chunk-CDDFEVZ5.js → chunk-EGT6ORP5.js} +10 -10
- package/{chunk-2FOT26E6.js → chunk-ENIQIEAF.js} +1 -1
- package/{chunk-55HS2GQD.js → chunk-EVW2U6RH.js} +3 -3
- package/{chunk-CRQGEMKZ.js → chunk-EY3QEZZR.js} +13 -13
- package/{chunk-U4C2R3PV.js → chunk-FDPODXE3.js} +3 -3
- package/{chunk-EW6GOYKQ.js → chunk-HHEM4TV3.js} +2 -2
- package/{chunk-QPUKYKMH.js → chunk-ISIFZP3N.js} +4 -101
- package/{chunk-7YN3HYWC.js → chunk-IVPXG433.js} +30 -15
- package/{chunk-RU4KURIK.js → chunk-J63HVOSX.js} +2 -2
- package/{chunk-OQ3DOBYB.js → chunk-JOUFPRE4.js} +178 -2
- package/{chunk-CK4GWPSD.js → chunk-KPSNHLFI.js} +3 -5
- package/{chunk-SIZPFDPU.js → chunk-KXIJYPVC.js} +2 -2
- package/{chunk-3SF6NB4R.js → chunk-L7ZCLG72.js} +2 -2
- package/{chunk-KSCX7GME.js → chunk-LCCULKPJ.js} +3 -3
- package/{chunk-XKL2RXV6.js → chunk-LTWBOZE6.js} +13 -11
- package/{chunk-ZQ545VNM.js → chunk-ONQ2APOE.js} +4 -4
- package/{chunk-UVP7VL6F.js → chunk-P34IX26T.js} +1 -1
- package/{chunk-U5UZ7IPM.js → chunk-QFAISMV5.js} +3 -3
- package/{chunk-TZ6CCFRL.js → chunk-QWNMFO5E.js} +3 -3
- package/{chunk-TOLFIE2I.js → chunk-RABMW33C.js} +3 -3
- package/{chunk-TY7GIRX6.js → chunk-RUKAOMXD.js} +1 -1
- package/{chunk-S4SA4INB.js → chunk-RYBZM4A2.js} +2 -2
- package/{chunk-7TBARDLF.js → chunk-T7HBI3WZ.js} +1 -1
- package/{chunk-ZCXK773F.js → chunk-TMAQFKHS.js} +2 -2
- package/chunk-UKZX3NHN.js +48 -0
- package/{chunk-EEFX46WP.js → chunk-VJ52BYBK.js} +1 -1
- package/{chunk-XBJIESNS.js → chunk-XAFCJN32.js} +2 -2
- package/{chunk-VVMACDVS.js → chunk-Y3BUTWUJ.js} +1 -1
- package/{chunk-KNDA4K34.js → chunk-YBTP3PUM.js} +1 -1
- package/{chunk-BIF4B4ON.js → chunk-Z4HDFBYK.js} +1 -1
- package/{commandRegistry-FDWLTWIQ.js → commandRegistry-PJ3EQ6U7.js} +49 -49
- package/{contentThunks-AAGKCQCZ.js → contentThunks-NVX3NBHZ.js} +6 -5
- package/{createAgentAutomationAction-2K7M6ACJ.js → createAgentAutomationAction-EONFRZYA.js} +6 -5
- package/{createDialogAction-RFQJMLEO.js → createDialogAction-ZVY45CNY.js} +7 -6
- package/{createPageAction-MBDADKFQ.js → createPageAction-N5XSWPN2.js} +6 -5
- package/{dialogCommands-E5I4ORXJ.js → dialogCommands-CPK6MUIJ.js} +15 -14
- package/{dialogSlice-MHZCAC4E.js → dialogSlice-ST2FXOF3.js} +5 -4
- package/{docCreateCommands-SMX7DXUS.js → docCreateCommands-GLR2HLYH.js} +14 -13
- package/{docDeleteCommands-MFPBAHFH.js → docDeleteCommands-MPE53Z5W.js} +15 -14
- package/{docReadCommands-ZOWLKFAF.js → docReadCommands-MFKWAFDI.js} +14 -13
- package/{docStore-IUFAMRVZ.js → docStore-PPUT7MQV.js} +1 -1
- package/{docUpdateCommands-4THL5VLI.js → docUpdateCommands-3QBT2XTK.js} +14 -13
- package/{handleSendMessageAction-OS6NNC3U.js → handleSendMessageAction-74EKQW4M.js} +13 -13
- package/index.js +4 -4
- package/{localRuntimeAdapter-XQ4PAAIT.js → localRuntimeAdapter-KQHAGAXR.js} +23 -22
- package/{machineCommands-UHGFVPD2.js → machineCommands-DMPHPCQS.js} +24 -23
- package/{machineWsRunDispatch-BAFZOC6Z.js → machineWsRunDispatch-736CCGUF.js} +24 -23
- package/package.json +1 -1
- package/{providerPresetApply-5K4PBX4J.js → providerPresetApply-MBMGCNKZ.js} +1 -2
- package/{providerRegistry-K5MSZ3Y5.js → providerRegistry-P4KYS6SE.js} +1 -2
- package/{readlineWorkspace-ISBZZPR2.js → readlineWorkspace-K4WNNW2D.js} +29 -28
- package/{runAgentClientLoop-H4KCCJOV.js → runAgentClientLoop-Z6STKR3Z.js} +18 -17
- package/{spaceCommands-PVEPGFHX.js → spaceCommands-U4UYF6IB.js} +14 -13
- package/{streamAgentChatTurn-4PX74Z36.js → streamAgentChatTurn-2ON7E6LT.js} +24 -22
- package/{tools-546KDFWP.js → tools-ZB2YBHSS.js} +12 -12
- package/{tuiSummaryLlmCaller-LA7NUKUJ.js → tuiSummaryLlmCaller-I2MRY6T5.js} +8 -7
- package/{updateDialogTitleAction-LIS3EPHP.js → updateDialogTitleAction-YMQAOVJ2.js} +6 -5
- package/chunk-TSCI6X6C.js +0 -185
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assembleAgentDiscoveryResult,
|
|
3
3
|
resolveDiscoveryScope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KPSNHLFI.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchWithTransientRetry
|
|
7
7
|
} from "./chunk-KFHREHUQ.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();
|
|
@@ -14056,7 +14056,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14056
14056
|
const wakeEnabled = opts?.wakeEnabled === true;
|
|
14057
14057
|
return {
|
|
14058
14058
|
name: "startAgentRun",
|
|
14059
|
-
description: "\u542F\u52A8\u4E00\u4E2A Agent \u6267\u884C\u5B50\u4EFB\u52A1\u3002\u9ED8\u8BA4\u5F02\u6B65\uFF08fork+exec\uFF09\uFF1A\u7ACB\u5373\u8FD4\u56DE runId \u4E0D\u963B\u585E\u5BF9\u8BDD\
|
|
14059
|
+
description: "\u542F\u52A8\u4E00\u4E2A Agent \u6267\u884C\u5B50\u4EFB\u52A1\u3002\u9ED8\u8BA4\u5F02\u6B65\uFF08fork+exec\uFF09\uFF1A\u7ACB\u5373\u8FD4\u56DE runId \u4E0D\u963B\u585E\u5BF9\u8BDD\uFF1B\u6D3E\u53D1\u540E\u5148\u63A8\u8FDB\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\u901A\u77E5\uFF0C\u7981\u6B62\u8F6E\u8BE2\uFF1BcontrolAgentRun \u7528\u4E8E\u63A7\u5236\uFF08\u53EB\u505C/\u8FFD\u52A0\u6307\u4EE4\uFF09\u4E0E\u5F02\u5E38\u8BCA\u65AD\u3002\u3010\u6D3E\u53D1\u7EAA\u5F8B\u3011\u540C\u4E00\u8F6E\u5E94\u5E76\u53D1\u6D3E\u53D1\u65E0\u771F\u5B9E\u4F9D\u8D56\u7684\u591A\u4E2A run\uFF1B\u7B49\u5F85\u67D0\u4E2A run \u7684\u7ED3\u679C\u4E0D\u5F97\u963B\u585E\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\u7684\u63A8\u8FDB\u3002\u5F02\u6B65\u6D3E\u53D1\u540E\uFF0C\u5148\u7EE7\u7EED\u63A8\u8FDB\u672C\u8F6E\u53EF\u6267\u884C\u7684\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\uFF1B\u7B26\u5408\u4E0B\u8FF0\u540C\u6B65\u7B49\u5F85\u6761\u4EF6\u65F6\u4ECD\u53EF\u4F7F\u7528 wait:true\u3002\u53EA\u6709\u771F\u5B9E\u6587\u4EF6\u51B2\u7A81/\u63A5\u53E3\u5951\u7EA6\u4F9D\u8D56/\u51ED\u8BC1\u6216\u914D\u989D\u51C6\u5165\u51B2\u7A81/\u4E0A\u6E38\u4EA7\u7269\u4F9D\u8D56\u624D\u53EF\u4E32\u884C\uFF08\u4E0E\u7CFB\u7EDF\u63D0\u793A\u300C\u5E76\u884C\u662F\u9ED8\u8BA4\u300D\u4E00\u81F4\uFF09\u3002\u901A\u9053\u53EF\u7528\u6027\u4EC5\u5BF9\u5F53\u6B21\u6D3E\u53D1\u6709\u6548\uFF0C\u6D3E\u53D1\u524D\u52A1\u5FC5\u91CD\u65B0\u8BFB\u53D6\u53EF\u7528\u6027\uFF0C\u5207\u52FF\u590D\u7528\u6B64\u524D\u5931\u8D25\u7ED3\u8BBA\uFF1B\u9047\u5230 config_unresolved \u7C7B\u9519\u8BEF\u964D\u7EA7\u524D\u91CD\u8BD5\u4E00\u6B21\uFF1B\u540C\u4E00\u51ED\u8BC1\u9ED8\u8BA4\u5141\u8BB8\u5E76\u53D1\uFF08\u53D7\u670D\u52A1\u7AEF\u51C6\u5165\u9884\u7B97\u7EA6\u675F\uFF1B\u6CE8\u610F\u4E0A\u6E38 429 \u9650\u6D41\uFF0C\u5FC5\u8981\u65F6\u964D\u4F4E\u5E76\u53D1\u6216\u6362\u901A\u9053\uFF09\uFF0C\u672A\u77E5\u51ED\u8BC1\u9700\u4E32\u884C\u6216\u663E\u5F0F\u786E\u8BA4\u98CE\u9669\uFF1B\u6700\u5F3A\u79C1\u6709\u901A\u9053\u7559\u7ED9\u5BA1\u67E5\uFF0C\u6267\u884C\u4F18\u5148\u4F7F\u7528\u4F4E\u6210\u672C\u901A\u9053\u3002" + (supportsWait ? "\u8981\u540C\u6B65\u7ED3\u679C\u4F20 wait:true\uFF08\u4F1A\u51BB\u7ED3\u5BF9\u8BDD\uFF0C\u4EC5\u9650 \u2460 \u9884\u8BA1 <100s \u4E14\u9A6C\u4E0A\u8981\u7528\u7ED3\u679C \u2461 \u7528\u6237\u660E\u786E\u8981\u6C42\u540C\u6B65\u7B49\u5F85\u6216\u6B63\u5728\u4E0E\u8BE5\u5B50\u4EFB\u52A1\u5BF9\u8BDD \u2462 \u73AF\u5883\u4E0D\u652F\u6301\u7EC8\u6001\u5524\u9192\u4E14\u65E0\u5E76\u884C\u5DE5\u4F5C\uFF1B\u8BE6\u89C1 wait \u53C2\u6570\uFF09\u3002wait:true \u65F6\u53EF\u7528 resultMode \u63A7\u5236\u8FD4\u56DE\u5185\u5BB9\uFF1Afull=\u5B8C\u6574\u8F93\u51FA\uFF1Bsummary=\u53EA\u56DE\u5934\u5C3E\u603B\u7ED3\uFF08\u9632\u957F\u8F93\u51FA\u6491\u7206\u4E0A\u4E0B\u6587\uFF09\u3002" : wakeEnabled ? "\u53EA\u652F\u6301\u5F02\u6B65\u6D3E\u53D1\uFF1Brun \u5230\u7EC8\u6001\u4F1A\u81EA\u52A8\u901A\u8FC7 terminal wake \u628A\u7236\u5BF9\u8BDD\u63A5\u56DE\u6765\uFF1B\u6D3E\u53D1\u540E\u5148\u63A8\u8FDB\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u5524\u9192\uFF0C\u4E0D\u8981\u8F6E\u8BE2" : "\u53EA\u652F\u6301\u5F02\u6B65\u6D3E\u53D1\uFF0CstartAgentRun \u4E0D\u63D0\u4F9B\u540C\u6B65\u7B49\u5F85\uFF1B\u9700\u8981\u7B49\u7EC8\u6001\u65F6\u53EF\u7528 controlAgentRun(wait)\uFF08\u82E5\u8BE5 action \u53EF\u7528\uFF09\uFF1B\u4E0D\u8981\u5047\u8BBE\u4F1A\u81EA\u52A8 terminal wake"),
|
|
14060
14060
|
parameters: {
|
|
14061
14061
|
type: "object",
|
|
14062
14062
|
properties: {
|
|
@@ -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,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
refreshOpenAiCodexToken,
|
|
6
6
|
resolveServerSyncConfig,
|
|
7
7
|
xaiRefresh
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-D2J22QSE.js";
|
|
9
9
|
import {
|
|
10
10
|
clearCredentialAvailability,
|
|
11
11
|
markCredentialUnavailable,
|
|
@@ -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,18 +86,18 @@ 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
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-KPSNHLFI.js";
|
|
94
94
|
import {
|
|
95
95
|
fetchWithTransientRetry,
|
|
96
96
|
isTransientFetchError
|
|
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,30 +193,36 @@ 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";
|
|
207
207
|
import {
|
|
208
208
|
resolveAgentImageInputSupport
|
|
209
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-7QQOOHDG.js";
|
|
210
210
|
import {
|
|
211
|
-
EMPTY_TOOL_RESULT_TEXT,
|
|
212
211
|
collectStablePromptPrefix,
|
|
213
212
|
convertMessagesToResponsesInput,
|
|
214
213
|
findAgentStatePairingIssues,
|
|
215
|
-
hadToolImages,
|
|
216
214
|
stablePromptCacheKey,
|
|
217
|
-
toResponsesTools
|
|
215
|
+
toResponsesTools
|
|
216
|
+
} from "./chunk-ISIFZP3N.js";
|
|
217
|
+
import {
|
|
218
|
+
EMPTY_TOOL_RESULT_TEXT,
|
|
219
|
+
createToolImageBudget,
|
|
220
|
+
hadToolImages,
|
|
221
|
+
toolImageNotices,
|
|
222
|
+
toolImageOmission,
|
|
223
|
+
toolImageSource,
|
|
218
224
|
toolImages
|
|
219
|
-
} from "./chunk-
|
|
225
|
+
} from "./chunk-A6B3LSDB.js";
|
|
220
226
|
import {
|
|
221
227
|
buildNoloWorkspaceOpenAiTools,
|
|
222
228
|
filterClientNoloWorkspaceToolNames,
|
|
@@ -237,18 +243,20 @@ import {
|
|
|
237
243
|
} from "./chunk-2MBTWINN.js";
|
|
238
244
|
import {
|
|
239
245
|
normalizeUsage
|
|
240
|
-
} from "./chunk-
|
|
246
|
+
} from "./chunk-T7HBI3WZ.js";
|
|
241
247
|
import {
|
|
242
248
|
isDevinOAuthAgent
|
|
243
249
|
} from "./chunk-5ZUL4CUO.js";
|
|
244
250
|
import {
|
|
245
251
|
createProviderCallTimingTracker,
|
|
246
252
|
finalizeProviderCallTiming,
|
|
247
|
-
isOAuthApiKeyRef,
|
|
248
253
|
observeMeaningfulProviderResponse,
|
|
249
254
|
observeMeaningfulProviderResponseAt,
|
|
250
255
|
withProviderCallTimingFields
|
|
251
|
-
} from "./chunk-
|
|
256
|
+
} from "./chunk-7ZGMQZ5D.js";
|
|
257
|
+
import {
|
|
258
|
+
isOAuthApiKeyRef
|
|
259
|
+
} from "./chunk-UKZX3NHN.js";
|
|
252
260
|
import {
|
|
253
261
|
clipCompactText
|
|
254
262
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -353,7 +361,7 @@ import {
|
|
|
353
361
|
} from "./chunk-LCBAMY2M.js";
|
|
354
362
|
import {
|
|
355
363
|
isAntigravityOAuthAgent
|
|
356
|
-
} from "./chunk-
|
|
364
|
+
} from "./chunk-JOUFPRE4.js";
|
|
357
365
|
import {
|
|
358
366
|
buildProviderSessionHeaders,
|
|
359
367
|
resolvePlatformAuthToken
|
|
@@ -788,6 +796,7 @@ function buildAnthropicMessagesBody(args) {
|
|
|
788
796
|
system.push({ type: "text", text: args.agentConfig.prompt.trim() });
|
|
789
797
|
}
|
|
790
798
|
const messages = [];
|
|
799
|
+
const imageBudget = createToolImageBudget();
|
|
791
800
|
for (const raw of rawMessages) {
|
|
792
801
|
if (!raw || typeof raw !== "object") continue;
|
|
793
802
|
const message = raw;
|
|
@@ -815,17 +824,30 @@ function buildAnthropicMessagesBody(args) {
|
|
|
815
824
|
const images = toolImages(message);
|
|
816
825
|
if (!hadToolImages(message)) return text;
|
|
817
826
|
const effective = text.trim() ? text : EMPTY_TOOL_RESULT_TEXT;
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
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
|
+
}
|
|
821
846
|
}
|
|
822
847
|
return [
|
|
823
848
|
{ type: "text", text: effective },
|
|
824
|
-
...
|
|
825
|
-
|
|
826
|
-
media_type: image.mimeType,
|
|
827
|
-
data: image.dataBase64
|
|
828
|
-
} }))
|
|
849
|
+
...notices.text.map((text2) => ({ type: "text", text: text2 })),
|
|
850
|
+
...imageBlocks
|
|
829
851
|
];
|
|
830
852
|
})()
|
|
831
853
|
}]);
|
|
@@ -2971,7 +2993,13 @@ function buildGeminiCustomNativeProvider(p) {
|
|
|
2971
2993
|
return { ok: true, mimeType: image.headers.get("content-type") ?? "application/octet-stream", bytes: new Uint8Array(await image.arrayBuffer()) };
|
|
2972
2994
|
}
|
|
2973
2995
|
});
|
|
2974
|
-
const
|
|
2996
|
+
const supportsToolImages = resolveAgentImageInputSupport({
|
|
2997
|
+
...agentConfig,
|
|
2998
|
+
provider: agentConfig.provider ?? "google",
|
|
2999
|
+
model,
|
|
3000
|
+
hasVision: agentConfig.hasVision ?? false
|
|
3001
|
+
});
|
|
3002
|
+
const body = buildGeminiGenerateContentRequest({ messages: inlineResult.messages, tools, maxTokens: typeof agentConfig.max_tokens === "number" ? agentConfig.max_tokens : void 0, temperature: typeof agentConfig.temperature === "number" ? agentConfig.temperature : void 0, attachSkipThoughtSignature: resolveGeminiModelQuirks(model).allowsThoughtSignatureSentinel, supportsToolImages });
|
|
2975
3003
|
log("provider.request.start", { agentKey: agentConfig.key, transport, requestUrl: nativeEndpoint, model, messageCount: messages.length, toolCount: tools.length, requestedToolNames });
|
|
2976
3004
|
const response = await fetchImpl(nativeEndpoint, { method: "POST", headers: { "Content-Type": "application/json", ...customNativeAuthHeaders("gemini", apiKey, apiKeyHeader), ...buildProviderSessionHeaders({ endpoint, sessionId: options?.dialogId ?? fallbackSessionId }) }, body: JSON.stringify(body), signal: options?.signal ? AbortSignal.any([options.signal, AbortSignal.timeout(options.timeoutMs ?? 12e4)]) : AbortSignal.timeout(options?.timeoutMs ?? 12e4) });
|
|
2977
3005
|
if (!response.ok) {
|
|
@@ -3514,12 +3542,19 @@ var resolveGeminiNativeToolTransport = async (ctx) => {
|
|
|
3514
3542
|
model: providerConfig.model,
|
|
3515
3543
|
complete: async (messages, options) => {
|
|
3516
3544
|
const model = providerConfig.model;
|
|
3545
|
+
const supportsToolImages = resolveAgentImageInputSupport({
|
|
3546
|
+
provider: providerConfig.usageProvider ?? providerConfig.provider,
|
|
3547
|
+
model: providerConfig.model,
|
|
3548
|
+
customProviderUrl: providerConfig.endpoint,
|
|
3549
|
+
hasVision: agentConfig.hasVision ?? false
|
|
3550
|
+
});
|
|
3517
3551
|
const requestBody = buildGeminiGenerateContentRequest({
|
|
3518
3552
|
messages,
|
|
3519
3553
|
tools,
|
|
3520
3554
|
maxTokens: typeof agentConfig.max_tokens === "number" ? agentConfig.max_tokens : void 0,
|
|
3521
3555
|
temperature: typeof agentConfig.temperature === "number" ? agentConfig.temperature : void 0,
|
|
3522
|
-
attachSkipThoughtSignature: resolveGeminiModelQuirks(model).allowsThoughtSignatureSentinel
|
|
3556
|
+
attachSkipThoughtSignature: resolveGeminiModelQuirks(model).allowsThoughtSignatureSentinel,
|
|
3557
|
+
supportsToolImages
|
|
3523
3558
|
});
|
|
3524
3559
|
const url = `https://generativelanguage.googleapis.com/v1beta/models/${model}:streamGenerateContent?alt=sse`;
|
|
3525
3560
|
logLocalRuntimeDiagnostic("provider.request.start", {
|
|
@@ -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
|
|
@@ -76,11 +76,11 @@ import {
|
|
|
76
76
|
} from "./chunk-WJZOQR2J.js";
|
|
77
77
|
import {
|
|
78
78
|
extractReferenceKeysFromMessage
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-T7HBI3WZ.js";
|
|
80
80
|
import {
|
|
81
81
|
getModelContextWindow,
|
|
82
82
|
planContextUsage
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-7ZGMQZ5D.js";
|
|
84
84
|
import {
|
|
85
85
|
asRecordOrEmpty
|
|
86
86
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -10,49 +10,6 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
isPlatformManagedProvider
|
|
12
12
|
} from "./chunk-5KTQVMCX.js";
|
|
13
|
-
import {
|
|
14
|
-
asTrimmedLowercaseString
|
|
15
|
-
} from "./chunk-QSJ3HFEF.js";
|
|
16
|
-
|
|
17
|
-
// packages/agent-runtime/serverProxyPolicy.ts
|
|
18
|
-
var OAUTH_APIKEY_REFS = /* @__PURE__ */ new Set([
|
|
19
|
-
"antigravity",
|
|
20
|
-
"xai",
|
|
21
|
-
"chatgpt",
|
|
22
|
-
"claude",
|
|
23
|
-
"cursor"
|
|
24
|
-
]);
|
|
25
|
-
function isGoogleFamilyProvider(provider) {
|
|
26
|
-
const normalized = asTrimmedLowercaseString(provider);
|
|
27
|
-
return normalized === "google" || normalized.startsWith("google-");
|
|
28
|
-
}
|
|
29
|
-
function isOAuthApiKeyRef(value) {
|
|
30
|
-
const ref = asTrimmedLowercaseString(value);
|
|
31
|
-
return ref.length > 0 && OAUTH_APIKEY_REFS.has(ref);
|
|
32
|
-
}
|
|
33
|
-
function shouldUseServerProxy(agentConfig, requestProvider) {
|
|
34
|
-
const effectiveProvider = (requestProvider || agentConfig.provider || "").toLowerCase();
|
|
35
|
-
if (isGoogleFamilyProvider(effectiveProvider)) {
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
if (isOAuthApiKeyRef(agentConfig.apiKeyRef)) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
if (agentConfig.apiSource === "custom" && isRemoteCustomEndpoint(agentConfig.customProviderUrl)) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
return !!agentConfig.useServerProxy;
|
|
45
|
-
}
|
|
46
|
-
var LOCAL_HOSTS = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "::1", "0.0.0.0"]);
|
|
47
|
-
function isRemoteCustomEndpoint(url) {
|
|
48
|
-
if (typeof url !== "string") return false;
|
|
49
|
-
try {
|
|
50
|
-
const host = new URL(url).hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
51
|
-
return !LOCAL_HOSTS.has(host);
|
|
52
|
-
} catch {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
13
|
|
|
57
14
|
// packages/core/chat/messageContentSerialize.ts
|
|
58
15
|
var serializeMessageContent = (content, imagePlaceholder = "[\u56FE\u7247]") => {
|
|
@@ -1062,8 +1019,6 @@ export {
|
|
|
1062
1019
|
findModelContextWindow,
|
|
1063
1020
|
getModelContextWindow,
|
|
1064
1021
|
getModelInfo,
|
|
1065
|
-
isOAuthApiKeyRef,
|
|
1066
|
-
shouldUseServerProxy,
|
|
1067
1022
|
sha256Hex,
|
|
1068
1023
|
serializeMessageContent,
|
|
1069
1024
|
resolveCompressionTriggerRatio,
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// packages/agent-runtime/toolImages.ts
|
|
2
|
+
var EMPTY_TOOL_RESULT_TEXT = "[Tool completed without output]";
|
|
3
|
+
var TOOL_HAD_IMAGES = "toolHadImages";
|
|
4
|
+
function hadToolImages(message) {
|
|
5
|
+
return message.tool_result_metadata?.[TOOL_HAD_IMAGES] === true || toolImages(message).length > 0;
|
|
6
|
+
}
|
|
7
|
+
var TOOL_IMAGES = Symbol("runtime-only-tool-images");
|
|
8
|
+
function toolImages(message) {
|
|
9
|
+
return message[TOOL_IMAGES] ?? [];
|
|
10
|
+
}
|
|
11
|
+
function withoutToolImages(message) {
|
|
12
|
+
if (!(TOOL_IMAGES in message)) return message;
|
|
13
|
+
const { [TOOL_IMAGES]: _images, ...textOnly } = message;
|
|
14
|
+
return _images?.length ? {
|
|
15
|
+
...textOnly,
|
|
16
|
+
tool_result_metadata: {
|
|
17
|
+
...message.tool_result_metadata,
|
|
18
|
+
[TOOL_HAD_IMAGES]: true
|
|
19
|
+
}
|
|
20
|
+
} : textOnly;
|
|
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
|
+
}
|
|
64
|
+
function createToolImageLedger() {
|
|
65
|
+
const committed = /* @__PURE__ */ new Set();
|
|
66
|
+
const impossible = /* @__PURE__ */ new Set();
|
|
67
|
+
let pending = /* @__PURE__ */ new Set();
|
|
68
|
+
const keyOf = (image) => `${image.mimeType}\0${image.dataBase64}`;
|
|
69
|
+
const candidates = (images) => (images ?? []).filter((image) => {
|
|
70
|
+
const key = keyOf(image);
|
|
71
|
+
if (committed.has(key) || impossible.has(key) || pending.has(key)) return false;
|
|
72
|
+
pending.add(key);
|
|
73
|
+
return true;
|
|
74
|
+
});
|
|
75
|
+
return Object.assign(candidates, {
|
|
76
|
+
/** Only after the provider call succeeded: failed sends must stay replayable. */
|
|
77
|
+
commit(images, retained = []) {
|
|
78
|
+
for (const image of images) committed.add(keyOf(image));
|
|
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));
|
|
84
|
+
},
|
|
85
|
+
/** 当前生命周期不依赖 reset,仅供未来中途放弃批次时使用。 */
|
|
86
|
+
reset() {
|
|
87
|
+
pending = /* @__PURE__ */ new Set();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function stripToolImages(message) {
|
|
92
|
+
if (!toolImages(message).length) return message;
|
|
93
|
+
return withoutToolImages(message);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// packages/agent-runtime/openAiToolImages.ts
|
|
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.";
|
|
98
|
+
function projectOpenAiToolImages(messages, supportsImages) {
|
|
99
|
+
const parts = [];
|
|
100
|
+
const omitted = [];
|
|
101
|
+
const budget = createToolImageBudget();
|
|
102
|
+
let accepted = 0;
|
|
103
|
+
let lastTool = -1;
|
|
104
|
+
messages.forEach((message, index) => {
|
|
105
|
+
if (message.role === "tool") lastTool = index;
|
|
106
|
+
if (!supportsImages) return;
|
|
107
|
+
for (const image of toolImages(message)) {
|
|
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"));
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
accepted += 1;
|
|
116
|
+
parts.push({
|
|
117
|
+
type: "text",
|
|
118
|
+
text: `Image ${accepted} \u2014 from tool result ${source}`
|
|
119
|
+
});
|
|
120
|
+
parts.push({ type: "image_url", image_url: { url: `data:${image.mimeType};base64,${image.dataBase64}` } });
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
if (lastTool < 0) return messages;
|
|
124
|
+
if (!parts.length && !omitted.length) return messages;
|
|
125
|
+
const note = omitted.length ? ` Note: ${omitted.length} image(s) omitted. ${omitted.join(" ")}` : "";
|
|
126
|
+
const attachment = {
|
|
127
|
+
role: "user",
|
|
128
|
+
content: [{ type: "text", text: `${INTRO}${note}` }, ...parts]
|
|
129
|
+
};
|
|
130
|
+
return [...messages.slice(0, lastTool + 1), attachment, ...messages.slice(lastTool + 1)];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export {
|
|
134
|
+
EMPTY_TOOL_RESULT_TEXT,
|
|
135
|
+
TOOL_HAD_IMAGES,
|
|
136
|
+
hadToolImages,
|
|
137
|
+
TOOL_IMAGES,
|
|
138
|
+
toolImages,
|
|
139
|
+
withoutToolImages,
|
|
140
|
+
TOOL_IMAGE_NOTICES,
|
|
141
|
+
createToolImageNotices,
|
|
142
|
+
toolImageNotices,
|
|
143
|
+
resetToolImageDelivery,
|
|
144
|
+
toolImageDelivery,
|
|
145
|
+
createToolImageBudget,
|
|
146
|
+
toolImageSource,
|
|
147
|
+
toolImageOmission,
|
|
148
|
+
createToolImageLedger,
|
|
149
|
+
stripToolImages,
|
|
150
|
+
projectOpenAiToolImages
|
|
151
|
+
};
|