nolo-cli 0.32.0 → 0.33.0-alpha.11
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/README.md +6 -12
- package/{_executeModel-LTMSIBS4.js → _executeModel-YXWAXPWQ.js} +77 -67
- package/{action-HI3VRQLP.js → action-OQWPNKAH.js} +17 -15
- package/{addContentAction-NCURJ6PK.js → addContentAction-YVINZQTF.js} +14 -13
- package/{addDialogAgentAction-RCY4ECF4.js → addDialogAgentAction-6IOCIEPI.js} +14 -13
- package/{agentDeleteCommand-D3MYZK6E.js → agentDeleteCommand-VGHWJN5T.js} +44 -60
- package/{agentEmailCommands-6BXS574I.js → agentEmailCommands-ZLRF35I3.js} +91 -81
- package/{agentGrantCommands-E7ZZFRHK.js → agentGrantCommands-2LEZDADN.js} +2 -2
- package/{agentListCommands-SF3HEUTT.js → agentListCommands-OHZJ7AFP.js} +75 -79
- package/{agentMachineCommands-YARVXRR6.js → agentMachineCommands-62PHPGTK.js} +43 -59
- package/{agentPullCommand-ARSIDNVC.js → agentPullCommand-TSWAJPS2.js} +5 -5
- package/agentRecordCommands-CW2JWERD.js +113 -0
- package/agentRunCommand-O4HV7YWA.js +131 -0
- package/{agentRuntimeLocal-ATGJY6WC.js → agentRuntimeLocal-4PSBNUOE.js} +37 -51
- package/{agentSlice-4XWW344Y.js → agentSlice-OUTQ5O72.js} +16 -14
- package/{appDeleteCommands-63JO7RXS.js → appDeleteCommands-VTDBVHYR.js} +40 -56
- package/{appDeployCommands-Y7EWYUGM.js → appDeployCommands-WOUP7MDA.js} +40 -56
- package/{appDeployStatusCommands-ZBEY3DWB.js → appDeployStatusCommands-N2NWZKEN.js} +40 -56
- package/{appGetCommands-QSSOSEYL.js → appGetCommands-GYKLWWCA.js} +40 -56
- package/{appListCommands-PH3XWNDX.js → appListCommands-RUWBSEJK.js} +40 -56
- package/{authCommand-BBDHMSO6.js → authCommand-YVXVH25I.js} +21 -20
- package/{authCommands-4UDEKRE6.js → authCommands-WTW6MEYS.js} +10 -10
- package/chatQueueReduxAdapter-2QJAD4KQ.js +181 -0
- package/{chunk-EEF23OOK.js → chunk-266VUBLK.js} +7 -7
- package/{chunk-TEYN42N3.js → chunk-2IVEXF7P.js} +11 -4
- package/{chunk-2HXKAPH7.js → chunk-2QLAVHVK.js} +6 -6
- package/{chunk-WTGCTVJG.js → chunk-2QTEYCR7.js} +3 -6
- package/{chunk-DOISARTV.js → chunk-2UECQ7RE.js} +1 -1
- package/{chunk-E3APEOIM.js → chunk-3GZXL6FM.js} +4 -19
- package/{chunk-KGEVMUMI.js → chunk-3RUW3ONU.js} +11 -11
- package/{chunk-RXVX5LFR.js → chunk-3UG2IIZ3.js} +1 -1
- package/{chunk-O5OMJPPF.js → chunk-3WXRAHCG.js} +6 -5
- package/{chunk-V54H24CQ.js → chunk-4F5M2MW5.js} +3 -3
- package/{chunk-2ZRP5RUG.js → chunk-4OV7DXFJ.js} +12 -11
- package/{chunk-W367V5CH.js → chunk-54BAYVCY.js} +404 -117
- package/{chunk-GAF5X6B7.js → chunk-5QW3O3ET.js} +284 -310
- package/{chunk-DLWCWUNW.js → chunk-64OVNZXE.js} +1197 -757
- package/{chunk-ODS2MVMU.js → chunk-66CWPJK2.js} +19 -303
- package/{chunk-PTHDLIRB.js → chunk-6KOS7ZBZ.js} +1 -1
- package/{chunk-MXFQHRSS.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-ATK5WJOA.js → chunk-6YXDOOSH.js} +4 -4
- package/{chunk-SWYMCHM7.js → chunk-75U775RZ.js} +69 -1
- package/{chunk-UDA3ZYLW.js → chunk-7YYHKBJP.js} +31 -72
- package/chunk-ADLYMQB6.js +642 -0
- package/{chunk-ZWJOGMKH.js → chunk-AETZ7AD6.js} +1 -1
- package/{chunk-43EPBPZ2.js → chunk-ASDXPOJH.js} +2 -2
- package/{chunk-44HACRCK.js → chunk-BANYWEYY.js} +4 -4
- package/chunk-BFPSVRCQ.js +1799 -0
- package/{chunk-TOW4E763.js → chunk-BJIRLHJR.js} +2 -0
- package/{chunk-ZJ2WITOO.js → chunk-BQXOGBFN.js} +2 -2
- package/{chunk-4PNU7W7K.js → chunk-C7H5GMXT.js} +107 -125
- package/chunk-CPYYM4RJ.js +98 -0
- package/{chunk-3GZT3L6F.js → chunk-DDVIBKIB.js} +326 -481
- package/{chunk-2K4NDPT5.js → chunk-DFUPZE6V.js} +20 -12
- package/{chunk-BGTUGS3T.js → chunk-DKMOY3QI.js} +4 -30
- package/chunk-EGRJC4ZN.js +91 -0
- package/{chunk-K6QEHQZ3.js → chunk-EKLRRZIN.js} +1 -1
- package/{chunk-6HYVJV7B.js → chunk-ESHYE7WU.js} +2 -1
- package/{chunk-XFG3BAKN.js → chunk-FMEVI5TG.js} +65 -0
- package/{chunk-U4TRT5V4.js → chunk-GEPHJJW4.js} +1 -1
- package/chunk-GJXRIOLS.js +241 -0
- package/{chunk-VP4WJWKW.js → chunk-GM6PU7B6.js} +431 -345
- package/chunk-HS7MLR74.js +38 -0
- package/{chunk-3AUWC6EM.js → chunk-HUCT7HID.js} +5 -84
- package/chunk-IDAU4UFS.js +437 -0
- package/{chunk-Q76I4SXI.js → chunk-IHEC7VBF.js} +1 -1
- package/{chunk-OWHNFZNW.js → chunk-IKWTTKWG.js} +4 -4
- package/{chunk-3LY4F7SV.js → chunk-INZZJSQF.js} +348 -331
- package/{chunk-ZJH3LKEW.js → chunk-IR6W62Q6.js} +102 -15
- package/{chunk-RH53LMEJ.js → chunk-J44TVX2O.js} +2 -4
- package/{chunk-CF2WZF4N.js → chunk-J6WH4PYZ.js} +0 -8
- package/chunk-KHCLMKZZ.js +3062 -0
- package/{chunk-WHLVPK32.js → chunk-KMSZPTM6.js} +27 -3
- package/{chunk-L3GCUVOH.js → chunk-KSRFVP36.js} +1 -1
- package/{chunk-XDHHF73Q.js → chunk-LUIHOUZC.js} +95 -95
- package/{chunk-UOJRKY5J.js → chunk-M2YMQOLC.js} +44 -53
- package/chunk-M3JEW6N6.js +193 -0
- package/{chunk-MITD7CON.js → chunk-MDIAECHA.js} +1461 -301
- package/{chunk-IXZX5CJK.js → chunk-MQRZ5QUH.js} +1 -1
- package/{chunk-3ASDTTEI.js → chunk-MRWGHF56.js} +2 -0
- package/{chunk-Q3CSL43H.js → chunk-N4XRDM26.js} +1 -1
- package/{chunk-D34RI6NI.js → chunk-NNWHHCVP.js} +75 -1
- package/{chunk-CAENRKNJ.js → chunk-OR2HNLVO.js} +126 -88
- package/chunk-OW765XBU.js +10 -0
- package/{chunk-VMWR7VNI.js → chunk-PRMMCFIN.js} +13 -9
- package/{chunk-JZPBVBIY.js → chunk-QTZD6HBK.js} +18 -8
- package/chunk-RCFIB45Q.js +28 -0
- package/{chunk-7S54ZGF6.js → chunk-RJKIB55Y.js} +256 -12
- package/chunk-RPRRIFXV.js +231 -0
- package/chunk-RQFO3CAF.js +300 -0
- package/chunk-RY57GLGW.js +188 -0
- package/{chunk-YHGHADBQ.js → chunk-SCUETSRP.js} +4 -4
- package/{chunk-TA6EA2A3.js → chunk-TFK3HUNQ.js} +182 -20
- package/{chunk-LAXMH7JY.js → chunk-UM4H3URE.js} +18 -15
- package/{chunk-6YABCOFU.js → chunk-UNHKVD2N.js} +1 -1
- package/{chunk-G5GVZAXF.js → chunk-UNOTBWZZ.js} +15 -19
- package/{chunk-GE6IWA5N.js → chunk-UNZDCI3O.js} +126 -1
- package/chunk-URMS4XY2.js +10 -0
- package/{chunk-SFWZUTCI.js → chunk-VBUQYOX7.js} +2 -2
- package/{chunk-FXFGNOT2.js → chunk-VFVCYIRQ.js} +1 -1
- package/chunk-VIDPVFP3.js +20 -0
- package/{chunk-5RDLGLAP.js → chunk-WJSW43QZ.js} +4 -7
- package/{chunk-CF7S2RYZ.js → chunk-WLH5BAKX.js} +6 -6
- package/{chunk-VVEH6XUE.js → chunk-X2DAEZ3X.js} +1 -1
- package/{chunk-2IJAKBK2.js → chunk-X664KVEV.js} +426 -246
- package/{chunk-3FCNXC2J.js → chunk-XRO5VGQ6.js} +3735 -1394
- package/chunk-Y5GCAMGP.js +9 -0
- package/{chunk-O3JR45Q2.js → chunk-YBMI5JAH.js} +44 -44
- package/{chunk-V42OE5HT.js → chunk-YDTYDA5W.js} +3 -3
- package/chunk-YYLHWIW6.js +48 -0
- package/{chunk-AOS5IN2I.js → chunk-ZHYK3N56.js} +1 -1
- package/{chunk-PJ2DDQQM.js → chunk-ZURFOV5J.js} +2 -2
- package/{chunk-3UGKATZQ.js → chunk-ZWS6DUHX.js} +26 -435
- package/chunk-ZZ2MH7LE.js +84 -0
- package/{cliExecutor-BBUVQU4L.js → cliExecutor-DW3PHGEL.js} +2 -2
- package/{clipboardy-BVE3LVEH.js → clipboardy-MMBYVRLF.js} +166 -372
- package/{codingSkills-V35TRR4Y.js → codingSkills-DY5MINPG.js} +5 -4
- package/{createAgentAutomationAction-WLRNE7C4.js → createAgentAutomationAction-H6ZRPXBR.js} +41 -31
- package/createDialogAction-UJ6LFJYM.js +61 -0
- package/{createPageAction-7YROVZ3W.js → createPageAction-KVPT3IRK.js} +57 -47
- package/{db-6DPSJ6WT.js → db-3H3JECGY.js} +45 -5
- package/{dbSlice-BBL3PEVW.js → dbSlice-UI2VCBLG.js} +13 -12
- package/{deleteFile-RJTEPOT4.js → deleteFile-XQXPBFFB.js} +7 -6
- package/dialogCommands-6ASXJP3H.js +82 -0
- package/{dialogSlice-N4HPG6HM.js → dialogSlice-B7KCGHMY.js} +37 -29
- package/{docCreateCommands-GRA5BHSA.js → docCreateCommands-S4E4MKVC.js} +42 -56
- package/{docDeleteCommands-ONIJM5MD.js → docDeleteCommands-M7XLKWRM.js} +44 -58
- package/{docReadCommands-H55VQ2US.js → docReadCommands-LSCMW2FR.js} +42 -56
- package/{docStore-B5AHDNW5.js → docStore-ZYWZWIRB.js} +40 -30
- package/{docUpdateCommands-ZQIQVGC2.js → docUpdateCommands-OMRBAFOB.js} +45 -59
- package/{fetchMessages-VPPQDDZ4.js → fetchMessages-7QRCCRYK.js} +3 -3
- package/{getPricing-QO5TYNCK.js → getPricing-L2ENXWHV.js} +7 -6
- package/{handleSendMessageAction-IN5XX5U7.js → handleSendMessageAction-Y2XKODRT.js} +39 -31
- package/index.js +74 -74
- package/{lib-FYYBQIXS.js → lib-2ZTNRXR4.js} +432 -183
- package/{localDialogRead-3DBXVYXS.js → localDialogRead-SLMPV5SK.js} +2 -2
- package/{localRuntimeAuthority-NDUA2D7Y.js → localRuntimeAuthority-S77B5QVB.js} +10 -4
- package/{localRuntimeDb-GKYRBWLQ.js → localRuntimeDb-N3H3HQ7G.js} +1 -1
- package/{machineCommands-H3UMKE76.js → machineCommands-62RUZVSW.js} +95 -85
- package/{machineInfo-M6KB6HZN.js → machineInfo-66ZFUMLE.js} +1 -1
- package/machineWsRunDispatch-L3HD3FSF.js +129 -0
- package/{models-WDUTTYFS.js → models-OX2S5C6Q.js} +2 -2
- package/{offlineMarxistsAgentCommand-E6LUG63A.js → offlineMarxistsAgentCommand-GEH6SNNA.js} +1 -1
- package/package.json +1 -4
- package/{read-64OQDO3I.js → read-2VHEHCAN.js} +8 -7
- package/{readDocTool-MXM3T6PE.js → readDocTool-CSWD6NPC.js} +1 -2
- package/{readlineWorkspace-XVJZDCSC.js → readlineWorkspace-3MOJWFM7.js} +3358 -3409
- package/{removeDialogAgentAction-NEKVAMSH.js → removeDialogAgentAction-2T7BPM3T.js} +19 -17
- package/{runAgentClientLoop-H7U53QB6.js → runAgentClientLoop-Y5UW544I.js} +73 -64
- package/{runtimeDoctorCommands-WI2YZUSJ.js → runtimeDoctorCommands-KHGQKT3B.js} +6 -6
- package/{setDialogExtraReferencesAction-WTOHQDIV.js → setDialogExtraReferencesAction-GPT37HTW.js} +15 -14
- package/{setPrimaryDialogAgentAction-LDJOYC4F.js → setPrimaryDialogAgentAction-3746P7IW.js} +19 -17
- package/{settingSlice-4M37TN7V.js → settingSlice-FIFOQ6OR.js} +16 -14
- package/{skillDiscovery-5U6RYAHN.js → skillDiscovery-KLLKXPUO.js} +4 -4
- package/{slateUtils-2M7MUTWX.js → slateUtils-VO2FU36K.js} +1 -1
- package/{spaceCommands-7VVKJBDV.js → spaceCommands-NKSBD5G3.js} +45 -241
- package/{spaceSlice-T6YK6D34.js → spaceSlice-L44CI2QR.js} +39 -61
- package/{streamAgentChatTurn-RQ63QFQ7.js → streamAgentChatTurn-7DU4Z2VJ.js} +1262 -150
- package/{switchDialogAgentAction-XVWGKR2Z.js → switchDialogAgentAction-MQTUTQHL.js} +14 -13
- package/syncMapping-RK2MANUX.js +43 -0
- package/{tableCommands-RJZ3V4TF.js → tableCommands-64FZBAI3.js} +9 -8
- package/{toolApiClient-ARGFDJAG.js → toolApiClient-B2MFXMEG.js} +3 -3
- package/tools-2JI52WJP.js +99 -0
- package/{tuiSummaryLlmCaller-SRZ4QQUP.js → tuiSummaryLlmCaller-EAWQ3IZX.js} +25 -21
- package/{updateCommands-AK2RDOFR.js → updateCommands-MNDUIKN7.js} +2 -2
- package/{updateDialogTitleAction-BBDSWHNG.js → updateDialogTitleAction-HW33OIJI.js} +49 -38
- package/agentRecordCommands-JFZRQJQ4.js +0 -103
- package/agentRunCommand-NOX5FLKO.js +0 -121
- package/chunk-AYMOSAHE.js +0 -3158
- package/chunk-D2BPX6DQ.js +0 -1707
- package/chunk-DCDL3GC4.js +0 -171
- package/chunk-F3MP7CP6.js +0 -73
- package/chunk-WZSRQNQG.js +0 -2587
- package/createDialogAction-Y6YV64QB.js +0 -52
- package/dialogCommands-XLO5CAHZ.js +0 -95
- package/machineWsRunDispatch-HONRUK3R.js +0 -119
- package/tools-KYZX3BGO.js +0 -90
- package/{chunk-Z5MXSEOJ.js → chunk-RQSOAMPJ.js} +2 -2
- package/{chunk-JDSUTNYY.js → chunk-SAQQLJZ5.js} +3 -3
|
@@ -4,166 +4,194 @@ import {
|
|
|
4
4
|
refreshAntigravityOAuthToken,
|
|
5
5
|
refreshOpenAiCodexToken,
|
|
6
6
|
xaiRefresh
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
ackRunRecord,
|
|
10
|
-
checkStaleRun,
|
|
11
|
-
claimRunRecord,
|
|
12
|
-
commitRunRecordClaim,
|
|
13
|
-
finalizeRunRecord,
|
|
14
|
-
findRunRecord,
|
|
15
|
-
gcRunRecords,
|
|
16
|
-
queryRunRecords,
|
|
17
|
-
releaseRunRecordAck,
|
|
18
|
-
spawnLocalBackgroundRun,
|
|
19
|
-
terminateRunProcess
|
|
20
|
-
} from "./chunk-7KNERA53.js";
|
|
21
|
-
import {
|
|
22
|
-
CliProviderQuotaError,
|
|
23
|
-
executeCli
|
|
24
|
-
} from "./chunk-JDSUTNYY.js";
|
|
25
|
-
import {
|
|
26
|
-
getDefaultCliLocalRuntimeDb
|
|
27
|
-
} from "./chunk-Q3CSL43H.js";
|
|
7
|
+
} from "./chunk-VBUQYOX7.js";
|
|
28
8
|
import {
|
|
29
9
|
buildLocalAgentLookupKeys
|
|
30
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-X2DAEZ3X.js";
|
|
31
11
|
import {
|
|
32
12
|
LOCAL_CODEX_AGENT_ID,
|
|
33
13
|
LOCAL_CODEX_AGENT_KEY,
|
|
34
14
|
NOLO_DEFAULT_AGENT_ID,
|
|
35
15
|
NOLO_DEFAULT_AGENT_KEY
|
|
36
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EKLRRZIN.js";
|
|
17
|
+
import {
|
|
18
|
+
inferCaptureIntent
|
|
19
|
+
} from "./chunk-RPRRIFXV.js";
|
|
20
|
+
import {
|
|
21
|
+
inlineImageUrlsForCustomProvider,
|
|
22
|
+
prepareTools
|
|
23
|
+
} from "./chunk-LUIHOUZC.js";
|
|
24
|
+
import {
|
|
25
|
+
getServerProviderSecret
|
|
26
|
+
} from "./chunk-HS7MLR74.js";
|
|
27
|
+
import {
|
|
28
|
+
getAntigravityUserAgent,
|
|
29
|
+
isAntigravityOAuthAgent,
|
|
30
|
+
readAntigravityProjectId,
|
|
31
|
+
resolveAntigravityCloudCodeBaseUrl
|
|
32
|
+
} from "./chunk-SCUETSRP.js";
|
|
37
33
|
import {
|
|
38
|
-
|
|
34
|
+
readXPostFunc,
|
|
35
|
+
readXPostFunctionSchema,
|
|
36
|
+
readXhsProfileFunc,
|
|
37
|
+
readXhsProfileFunctionSchema,
|
|
38
|
+
rememberMemoryFunctionSchema,
|
|
39
|
+
resolveAgentRequiredPackIds,
|
|
40
|
+
setTodoListFunc
|
|
41
|
+
} from "./chunk-MDIAECHA.js";
|
|
42
|
+
import {
|
|
43
|
+
createDrainExhaustedResponse,
|
|
44
|
+
isCoreDrainingBody,
|
|
45
|
+
normalizeNonNegativeMs,
|
|
46
|
+
parseRetryAfterHeaderMs
|
|
47
|
+
} from "./chunk-RQSOAMPJ.js";
|
|
48
|
+
import {
|
|
49
|
+
getDefaultCliLocalRuntimeDb
|
|
50
|
+
} from "./chunk-N4XRDM26.js";
|
|
51
|
+
import {
|
|
52
|
+
applyTokenUsageToDayStats,
|
|
53
|
+
prepareTokenUsageData,
|
|
54
|
+
runKeyed
|
|
55
|
+
} from "./chunk-DDVIBKIB.js";
|
|
56
|
+
import {
|
|
57
|
+
BUILTIN_TITLE_LLM_CONFIG
|
|
58
|
+
} from "./chunk-RCFIB45Q.js";
|
|
59
|
+
import {
|
|
60
|
+
fetchServerSyncedCredential
|
|
61
|
+
} from "./chunk-66CWPJK2.js";
|
|
62
|
+
import {
|
|
63
|
+
require_date_fns
|
|
64
|
+
} from "./chunk-M76ECQRD.js";
|
|
65
|
+
import {
|
|
66
|
+
aggregateResponsesStream,
|
|
39
67
|
buildLoadSkillExecutor,
|
|
68
|
+
buildLocalDialogWritePlan,
|
|
40
69
|
buildLocalWorkspaceOpenAiTools,
|
|
41
70
|
buildLocalWorkspaceToolset,
|
|
42
71
|
buildNoloWorkspaceCliToolExecutors,
|
|
72
|
+
codexStreamFailureStatus,
|
|
43
73
|
createHybridRecordStore,
|
|
44
74
|
createLocalWorkspaceToolExecutors,
|
|
45
|
-
dialogMessageRecordToAgentRuntimeMessage,
|
|
46
75
|
executeLocalToolWithPolicy,
|
|
47
76
|
executeOpenAiCompatibleChatCompletion,
|
|
48
77
|
filterRetainedLedgerRecords,
|
|
49
78
|
isAgentCoolingDown,
|
|
50
79
|
isLineRangeCovered,
|
|
80
|
+
localDialogMessageRecordToRuntimeMessage,
|
|
51
81
|
parseSseDataLineJson,
|
|
52
82
|
parseSseDataLineObject,
|
|
53
83
|
parseSyncServersEnv,
|
|
54
|
-
readOpenAiCompatibleSseCompletion,
|
|
55
84
|
resolveAgentNextAvailableAt,
|
|
56
85
|
resolveOpenAiCompatibleProviderConfig
|
|
57
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-64OVNZXE.js";
|
|
58
87
|
import {
|
|
59
88
|
buildPlatformChatCompletionRequest,
|
|
60
89
|
canUsePlatformChatProvider,
|
|
61
90
|
hasDirectOpenAiCompatibleProvider,
|
|
62
91
|
parsePlatformChatCompletionData,
|
|
63
92
|
parsePlatformChatCompletionResponse,
|
|
93
|
+
readPlatformChatSseCompletion,
|
|
64
94
|
readSseDataValues,
|
|
65
95
|
resolvePlatformChatProviderConfig,
|
|
66
|
-
shouldUsePlatformChatProvider
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
buildCliPrompt
|
|
70
|
-
} from "./chunk-ATNTHIZI.js";
|
|
96
|
+
shouldUsePlatformChatProvider,
|
|
97
|
+
streamSseDataValues
|
|
98
|
+
} from "./chunk-RJKIB55Y.js";
|
|
71
99
|
import {
|
|
72
100
|
resolveAgentRuntimeConfigFromRecord
|
|
73
101
|
} from "./chunk-OIQPORYI.js";
|
|
74
102
|
import {
|
|
75
|
-
inlineImageUrlsForCustomProvider,
|
|
76
|
-
prepareTools
|
|
77
|
-
} from "./chunk-XDHHF73Q.js";
|
|
78
|
-
import {
|
|
79
|
-
inferCaptureIntent,
|
|
80
103
|
resolveHistoricalToolContentCap,
|
|
81
104
|
summarizeToolArguments
|
|
82
|
-
} from "./chunk-
|
|
83
|
-
import {
|
|
84
|
-
getAntigravityUserAgent,
|
|
85
|
-
isAntigravityOAuthAgent,
|
|
86
|
-
readAntigravityProjectId,
|
|
87
|
-
resolveAntigravityCloudCodeBaseUrl
|
|
88
|
-
} from "./chunk-YHGHADBQ.js";
|
|
105
|
+
} from "./chunk-BFPSVRCQ.js";
|
|
89
106
|
import {
|
|
90
107
|
convertMessagesToResponsesInput,
|
|
91
108
|
toResponsesTools
|
|
92
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-NNWHHCVP.js";
|
|
93
110
|
import {
|
|
94
111
|
resolvePlatformAuthToken
|
|
95
|
-
} from "./chunk-
|
|
96
|
-
import {
|
|
97
|
-
buildDialogFallbackTitleFromUserInput,
|
|
98
|
-
normalizeDialogTitle
|
|
99
|
-
} from "./chunk-2MBTWINN.js";
|
|
100
|
-
import {
|
|
101
|
-
readXPostFunc,
|
|
102
|
-
readXPostFunctionSchema,
|
|
103
|
-
readXhsProfileFunc,
|
|
104
|
-
readXhsProfileFunctionSchema,
|
|
105
|
-
rememberMemoryFunctionSchema,
|
|
106
|
-
setTodoListFunc
|
|
107
|
-
} from "./chunk-MITD7CON.js";
|
|
108
|
-
import {
|
|
109
|
-
createDrainExhaustedResponse,
|
|
110
|
-
isCoreDrainingBody,
|
|
111
|
-
normalizeNonNegativeMs,
|
|
112
|
-
parseRetryAfterHeaderMs
|
|
113
|
-
} from "./chunk-Z5MXSEOJ.js";
|
|
114
|
-
import {
|
|
115
|
-
TASK_PREVIEW_MAX,
|
|
116
|
-
formatListRunsCard,
|
|
117
|
-
formatNotFoundRunCard,
|
|
118
|
-
formatStartRunCard,
|
|
119
|
-
formatStatusRunCard,
|
|
120
|
-
formatStopRunCard,
|
|
121
|
-
isAgentNameFallback,
|
|
122
|
-
isAgentRunTerminalStatus,
|
|
123
|
-
resolveRunLabel,
|
|
124
|
-
shortRunId
|
|
125
|
-
} from "./chunk-KXKQO4Q6.js";
|
|
112
|
+
} from "./chunk-7YYHKBJP.js";
|
|
126
113
|
import {
|
|
127
114
|
buildNoloWorkspaceOpenAiTools,
|
|
128
115
|
parseNoloWorkspaceToolArguments,
|
|
129
|
-
resolveAgentRequiredPackIds,
|
|
130
116
|
resolveRuntimeToolSurfaceForAgent
|
|
131
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-ADLYMQB6.js";
|
|
132
118
|
import {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
119
|
+
buildDialogFallbackTitleFromUserInput,
|
|
120
|
+
normalizeDialogTitle
|
|
121
|
+
} from "./chunk-2MBTWINN.js";
|
|
122
|
+
import {
|
|
123
|
+
applyBuiltinAgentRuntimeOverride,
|
|
124
|
+
resolveBuiltinPlatformAgentConfig
|
|
125
|
+
} from "./chunk-GJXRIOLS.js";
|
|
138
126
|
import {
|
|
139
|
-
BUILTIN_TITLE_LLM_CONFIG,
|
|
140
127
|
clipCompactText
|
|
141
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-DKMOY3QI.js";
|
|
129
|
+
import {
|
|
130
|
+
isAdaptiveThinkingModelId
|
|
131
|
+
} from "./chunk-DFUPZE6V.js";
|
|
142
132
|
import {
|
|
143
133
|
createFileCredentialBroker,
|
|
144
|
-
fetchServerSyncedCredential,
|
|
145
134
|
resolveCurrentRunRuntimeToolPolicy,
|
|
146
135
|
resolveLocalWorkspaceExecutorOptionsFromPolicy,
|
|
147
136
|
resolveRequestedRuntimeToolNames
|
|
148
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-RQFO3CAF.js";
|
|
149
138
|
import {
|
|
150
139
|
createOAuthTokenStore,
|
|
151
140
|
isTokenExpired,
|
|
152
141
|
readOAuthCredential,
|
|
153
142
|
resolveFreshAccessToken
|
|
154
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-QTZD6HBK.js";
|
|
155
144
|
import {
|
|
156
|
-
|
|
157
|
-
|
|
145
|
+
FORCED_TOOLS,
|
|
146
|
+
addDefaultLightWebToolsForConfiguredAgents,
|
|
147
|
+
addDefaultSystemCapabilityTools,
|
|
148
|
+
appendEnabledPackPromptPatches,
|
|
149
|
+
applyDisabledTools,
|
|
150
|
+
applySystemBuiltinSkillFilter,
|
|
151
|
+
expandEnabledPacks,
|
|
152
|
+
resolveEffectiveEnabledPacks
|
|
153
|
+
} from "./chunk-WLH5BAKX.js";
|
|
158
154
|
import {
|
|
159
|
-
|
|
160
|
-
} from "./chunk-
|
|
155
|
+
canonicalizeToolNames
|
|
156
|
+
} from "./chunk-ZZ2MH7LE.js";
|
|
161
157
|
import {
|
|
162
158
|
compactWhitespace
|
|
163
159
|
} from "./chunk-DWLEOOGR.js";
|
|
164
160
|
import {
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
ackRunRecord,
|
|
162
|
+
checkStaleRun,
|
|
163
|
+
claimRunRecord,
|
|
164
|
+
commitRunRecordClaim,
|
|
165
|
+
finalizeRunRecord,
|
|
166
|
+
findRunRecord,
|
|
167
|
+
gcRunRecords,
|
|
168
|
+
queryRunRecords,
|
|
169
|
+
releaseRunRecordAck,
|
|
170
|
+
spawnLocalBackgroundRun,
|
|
171
|
+
terminateRunProcess
|
|
172
|
+
} from "./chunk-7KNERA53.js";
|
|
173
|
+
import {
|
|
174
|
+
TASK_PREVIEW_MAX,
|
|
175
|
+
formatListRunsCard,
|
|
176
|
+
formatNotFoundRunCard,
|
|
177
|
+
formatStartRunCard,
|
|
178
|
+
formatStatusRunCard,
|
|
179
|
+
formatStopRunCard,
|
|
180
|
+
isAgentNameFallback,
|
|
181
|
+
isAgentRunTerminalStatus,
|
|
182
|
+
resolveRunLabel,
|
|
183
|
+
shortRunId
|
|
184
|
+
} from "./chunk-KXKQO4Q6.js";
|
|
185
|
+
import {
|
|
186
|
+
CliProviderQuotaError,
|
|
187
|
+
executeCli
|
|
188
|
+
} from "./chunk-SAQQLJZ5.js";
|
|
189
|
+
import {
|
|
190
|
+
buildCliPrompt
|
|
191
|
+
} from "./chunk-ATNTHIZI.js";
|
|
192
|
+
import {
|
|
193
|
+
toErrorMessage
|
|
194
|
+
} from "./chunk-HNMXYYJR.js";
|
|
167
195
|
import {
|
|
168
196
|
isCompiledBinary,
|
|
169
197
|
parseUserIdFromAuthToken
|
|
@@ -171,12 +199,24 @@ import {
|
|
|
171
199
|
import {
|
|
172
200
|
DEFAULT_NOLO_SERVER_URL
|
|
173
201
|
} from "./chunk-OLZBQWZU.js";
|
|
202
|
+
import {
|
|
203
|
+
createTokenKey,
|
|
204
|
+
createTokenStatsKey,
|
|
205
|
+
createUserKey,
|
|
206
|
+
dialogMessageRange
|
|
207
|
+
} from "./chunk-KMSZPTM6.js";
|
|
208
|
+
import {
|
|
209
|
+
asTrimmedNonEmptyStringArray
|
|
210
|
+
} from "./chunk-I42VC5KR.js";
|
|
174
211
|
import {
|
|
175
212
|
asTrimmedLowercaseString
|
|
176
213
|
} from "./chunk-QSJ3HFEF.js";
|
|
177
214
|
import {
|
|
178
215
|
isSystemBuiltinTrustedAgentKey
|
|
179
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-IR6W62Q6.js";
|
|
217
|
+
import {
|
|
218
|
+
isRecord
|
|
219
|
+
} from "./chunk-KUG52IAP.js";
|
|
180
220
|
import {
|
|
181
221
|
NOLO_CLUSTER_SERVERS
|
|
182
222
|
} from "./chunk-LCBAMY2M.js";
|
|
@@ -186,31 +226,6 @@ import {
|
|
|
186
226
|
import {
|
|
187
227
|
normalizeServerOrigin
|
|
188
228
|
} from "./chunk-CF7PE763.js";
|
|
189
|
-
import {
|
|
190
|
-
createTokenKey,
|
|
191
|
-
createTokenStatsKey,
|
|
192
|
-
createUserKey,
|
|
193
|
-
dialogMessageRange
|
|
194
|
-
} from "./chunk-WHLVPK32.js";
|
|
195
|
-
import {
|
|
196
|
-
isRecord
|
|
197
|
-
} from "./chunk-KUG52IAP.js";
|
|
198
|
-
import {
|
|
199
|
-
canonicalizeToolNames
|
|
200
|
-
} from "./chunk-3AUWC6EM.js";
|
|
201
|
-
import {
|
|
202
|
-
FORCED_TOOLS,
|
|
203
|
-
addDefaultLightWebToolsForConfiguredAgents,
|
|
204
|
-
addDefaultSystemCapabilityTools,
|
|
205
|
-
appendEnabledPackPromptPatches,
|
|
206
|
-
applyDisabledTools,
|
|
207
|
-
applySystemBuiltinSkillFilter,
|
|
208
|
-
expandEnabledPacks,
|
|
209
|
-
resolveEffectiveEnabledPacks
|
|
210
|
-
} from "./chunk-CF7S2RYZ.js";
|
|
211
|
-
import {
|
|
212
|
-
asTrimmedNonEmptyStringArray
|
|
213
|
-
} from "./chunk-I42VC5KR.js";
|
|
214
229
|
import {
|
|
215
230
|
asOptionalTrimmedString
|
|
216
231
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -806,6 +821,18 @@ var STRINGS = {
|
|
|
806
821
|
zh: "\u2713 \u5DF2\u5206\u53C9\u5BF9\u8BDD {0} \u2192 {1}\uFF0C\u8017\u65F6 {2}\uFF08\u65E0\u9700\u538B\u7F29\uFF09\u3002"
|
|
807
822
|
},
|
|
808
823
|
agentCurrent: { en: "Current agent: {0} ({1})", zh: "\u5F53\u524D agent\uFF1A{0}\uFF08{1}\uFF09" },
|
|
824
|
+
agentPinnedUnaudited: {
|
|
825
|
+
en: "No audit record for it \u2014 an older build wrote it; see agent-selection.log.",
|
|
826
|
+
zh: "\u8FD9\u6761\u8BB0\u5F55\u6CA1\u6709\u5BA1\u8BA1\u8BB0\u5F55\uFF0C\u662F\u65E7\u7248\u672C\u5199\u7684\uFF1B\u8BE6\u89C1 agent-selection.log\u3002"
|
|
827
|
+
},
|
|
828
|
+
agentPinnedAuditRotated: {
|
|
829
|
+
en: "The audit log has no entry for it \u2014 it aged out, or another session wrote it.",
|
|
830
|
+
zh: "\u5BA1\u8BA1\u65E5\u5FD7\u91CC\u6CA1\u6709\u5B83\u7684\u8BB0\u5F55\u2014\u2014\u53EF\u80FD\u5DF2\u88AB\u8F6E\u8F6C\uFF0C\u6216\u662F\u522B\u7684\u4F1A\u8BDD\u5199\u7684\u3002"
|
|
831
|
+
},
|
|
832
|
+
agentPinnedFromProfile: {
|
|
833
|
+
en: 'Agent "{0}" restored from {1} (saved selection). /switch nolo to go back to the default.',
|
|
834
|
+
zh: "agent\u201C{0}\u201D\u6765\u81EA {1} \u91CC\u4FDD\u5B58\u7684\u9009\u62E9\u3002/switch nolo \u53EF\u5207\u56DE\u9ED8\u8BA4\u6863\u3002"
|
|
835
|
+
},
|
|
809
836
|
agentUnknown: {
|
|
810
837
|
en: `I don't know agent "{0}" yet.
|
|
811
838
|
Use /switch, /switch list, /switch minimax-m3, or a full agent key.`,
|
|
@@ -1046,9 +1073,13 @@ var SUBTASK_REMOVED_GIT_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
1046
1073
|
"gitCreateBranch",
|
|
1047
1074
|
"commitWorkspace"
|
|
1048
1075
|
]);
|
|
1076
|
+
var INTERACTION_REQUIRED_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
1077
|
+
"ask_user"
|
|
1078
|
+
]);
|
|
1049
1079
|
var SUBTASK_REMOVED_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
1050
1080
|
...ORCHESTRATION_TOOL_NAMES,
|
|
1051
|
-
...SUBTASK_REMOVED_GIT_TOOL_NAMES
|
|
1081
|
+
...SUBTASK_REMOVED_GIT_TOOL_NAMES,
|
|
1082
|
+
...INTERACTION_REQUIRED_TOOL_NAMES
|
|
1052
1083
|
]);
|
|
1053
1084
|
function isSubtaskRun(env) {
|
|
1054
1085
|
if (!env) return false;
|
|
@@ -1545,23 +1576,6 @@ function assertWithinLocalToolBudget(args) {
|
|
|
1545
1576
|
);
|
|
1546
1577
|
}
|
|
1547
1578
|
|
|
1548
|
-
// packages/cli/client/localDialogRecords.ts
|
|
1549
|
-
var localDialogMessageRecordToRuntimeMessage = dialogMessageRecordToAgentRuntimeMessage;
|
|
1550
|
-
function buildLocalDialogWritePlan(args) {
|
|
1551
|
-
return buildAgentRuntimeDialogWritePlan({
|
|
1552
|
-
input: args.input,
|
|
1553
|
-
userId: args.userId,
|
|
1554
|
-
now: args.now,
|
|
1555
|
-
createId: args.createId,
|
|
1556
|
-
existingDialog: args.existingDialog,
|
|
1557
|
-
runtimeHost: "cli",
|
|
1558
|
-
runtimeMetadata: {
|
|
1559
|
-
...args.cwd ? { worktreePath: args.cwd } : {}
|
|
1560
|
-
},
|
|
1561
|
-
...args.titleOverride ? { titleOverride: args.titleOverride } : {}
|
|
1562
|
-
});
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
1579
|
// packages/cli/client/cliLocalAgentRecordReader.ts
|
|
1566
1580
|
function resolveBuiltinLocalCliAgentConfig(agentRef, userId) {
|
|
1567
1581
|
const normalized = agentRef.trim();
|
|
@@ -1573,7 +1587,7 @@ function resolveBuiltinLocalCliAgentConfig(agentRef, userId) {
|
|
|
1573
1587
|
apiSource: "cli",
|
|
1574
1588
|
provider: "cli",
|
|
1575
1589
|
cliProvider: "codex",
|
|
1576
|
-
toolNames: ["readFile", "
|
|
1590
|
+
toolNames: ["readFile", "execShell", "fetchWebpage", "exa_search"],
|
|
1577
1591
|
rawRecord: {
|
|
1578
1592
|
dbKey: LOCAL_CODEX_AGENT_KEY,
|
|
1579
1593
|
id: LOCAL_CODEX_AGENT_ID,
|
|
@@ -1592,7 +1606,10 @@ async function readAgentFromStore(args) {
|
|
|
1592
1606
|
for (const key of buildLocalAgentLookupKeys(args)) {
|
|
1593
1607
|
const record = await args.store.read(key);
|
|
1594
1608
|
if (!record || typeof record !== "object") continue;
|
|
1595
|
-
return
|
|
1609
|
+
return applyBuiltinAgentRuntimeOverride(
|
|
1610
|
+
args.agentRef,
|
|
1611
|
+
resolveAgentRuntimeConfigFromRecord(key, record)
|
|
1612
|
+
);
|
|
1596
1613
|
}
|
|
1597
1614
|
return resolveBuiltinPlatformAgentConfig(args.agentRef);
|
|
1598
1615
|
}
|
|
@@ -2256,6 +2273,8 @@ var nodeFs = {
|
|
|
2256
2273
|
function resolveNoloHome(env, homedir) {
|
|
2257
2274
|
const custom = env?.NOLO_HOME;
|
|
2258
2275
|
if (custom && custom.trim()) return custom.trim();
|
|
2276
|
+
const ambient = process.env.NOLO_HOME?.trim();
|
|
2277
|
+
if (ambient) return ambient;
|
|
2259
2278
|
return join(homedir(), ".nolo");
|
|
2260
2279
|
}
|
|
2261
2280
|
function ensureDir(dir, fs) {
|
|
@@ -3242,61 +3261,90 @@ function convertOpenAiToolsToGemini(tools) {
|
|
|
3242
3261
|
if (declarations.length === 0) return void 0;
|
|
3243
3262
|
return [{ functionDeclarations: declarations }];
|
|
3244
3263
|
}
|
|
3245
|
-
function
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
}
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3264
|
+
function createGeminiAccumulatorState() {
|
|
3265
|
+
return {
|
|
3266
|
+
text: "",
|
|
3267
|
+
toolCalls: []
|
|
3268
|
+
};
|
|
3269
|
+
}
|
|
3270
|
+
function applyGeminiChunk(chunk, state, options) {
|
|
3271
|
+
if (!chunk || typeof chunk !== "object") return;
|
|
3272
|
+
const response = "response" in chunk && chunk.response && typeof chunk.response === "object" ? chunk.response : chunk;
|
|
3273
|
+
if ("usageMetadata" in response && response.usageMetadata && typeof response.usageMetadata === "object") {
|
|
3274
|
+
const meta = response.usageMetadata;
|
|
3275
|
+
const prompt = typeof meta.promptTokenCount === "number" ? meta.promptTokenCount : 0;
|
|
3276
|
+
const candidates2 = typeof meta.candidatesTokenCount === "number" ? meta.candidatesTokenCount : 0;
|
|
3277
|
+
const total = typeof meta.totalTokenCount === "number" ? meta.totalTokenCount : prompt + candidates2;
|
|
3278
|
+
state.usage = {
|
|
3279
|
+
prompt_tokens: prompt,
|
|
3280
|
+
completion_tokens: candidates2,
|
|
3281
|
+
total_tokens: total
|
|
3282
|
+
};
|
|
3283
|
+
}
|
|
3284
|
+
const candidates = Array.isArray(response.candidates) ? response.candidates : [];
|
|
3285
|
+
for (const candidate of candidates) {
|
|
3286
|
+
if (!candidate || typeof candidate !== "object") continue;
|
|
3287
|
+
const parts = Array.isArray(
|
|
3288
|
+
candidate.content?.parts
|
|
3289
|
+
) ? candidate.content.parts : [];
|
|
3290
|
+
for (const part of parts) {
|
|
3291
|
+
if (!part || typeof part !== "object") continue;
|
|
3292
|
+
const partSignature = part.thoughtSignature;
|
|
3293
|
+
const isThought = Boolean(part.thought);
|
|
3294
|
+
if ("text" in part && typeof part.text === "string") {
|
|
3295
|
+
const piece = part.text;
|
|
3296
|
+
if (!isThought) {
|
|
3297
|
+
state.text += piece;
|
|
3298
|
+
if (piece && options?.onTextDelta) {
|
|
3299
|
+
options.onTextDelta(piece);
|
|
3300
|
+
}
|
|
3301
|
+
} else {
|
|
3302
|
+
if (piece && options?.onReasoningDelta) {
|
|
3303
|
+
options.onReasoningDelta(piece);
|
|
3277
3304
|
}
|
|
3278
|
-
}
|
|
3279
|
-
if (part.thought && typeof partSignature === "string" && partSignature) {
|
|
3280
|
-
pendingThoughtSignature = partSignature;
|
|
3281
|
-
}
|
|
3282
|
-
if ("functionCall" in part && part.functionCall) {
|
|
3283
|
-
const call = part.functionCall;
|
|
3284
|
-
const name = typeof call.name === "string" ? call.name : "tool";
|
|
3285
|
-
const id = typeof call.id === "string" ? call.id : `${name}_${toolCalls.length}`;
|
|
3286
|
-
const argsObj = call.args && typeof call.args === "object" ? call.args : {};
|
|
3287
|
-
const resolvedSignature = typeof partSignature === "string" && partSignature ? partSignature : pendingThoughtSignature;
|
|
3288
|
-
pendingThoughtSignature = void 0;
|
|
3289
|
-
toolCalls.push({
|
|
3290
|
-
id,
|
|
3291
|
-
type: "function",
|
|
3292
|
-
function: { name, arguments: JSON.stringify(argsObj) },
|
|
3293
|
-
...typeof resolvedSignature === "string" && resolvedSignature ? { thought_signature: resolvedSignature } : {}
|
|
3294
|
-
});
|
|
3295
3305
|
}
|
|
3296
3306
|
}
|
|
3307
|
+
if (isThought && typeof partSignature === "string" && partSignature) {
|
|
3308
|
+
state.pendingThoughtSignature = partSignature;
|
|
3309
|
+
}
|
|
3310
|
+
if ("functionCall" in part && part.functionCall) {
|
|
3311
|
+
const call = part.functionCall;
|
|
3312
|
+
const name = typeof call.name === "string" ? call.name : "tool";
|
|
3313
|
+
const id = typeof call.id === "string" ? call.id : `${name}_${state.toolCalls.length}`;
|
|
3314
|
+
const argsObj = call.args && typeof call.args === "object" ? call.args : {};
|
|
3315
|
+
const resolvedSignature = typeof partSignature === "string" && partSignature ? partSignature : state.pendingThoughtSignature;
|
|
3316
|
+
state.pendingThoughtSignature = void 0;
|
|
3317
|
+
state.toolCalls.push({
|
|
3318
|
+
id,
|
|
3319
|
+
type: "function",
|
|
3320
|
+
function: { name, arguments: JSON.stringify(argsObj) },
|
|
3321
|
+
...typeof resolvedSignature === "string" && resolvedSignature ? { thought_signature: resolvedSignature } : {}
|
|
3322
|
+
});
|
|
3323
|
+
}
|
|
3297
3324
|
}
|
|
3298
3325
|
}
|
|
3299
|
-
|
|
3326
|
+
}
|
|
3327
|
+
function accumulateGeminiChunks(chunks, options) {
|
|
3328
|
+
const state = createGeminiAccumulatorState();
|
|
3329
|
+
for (const chunk of chunks) {
|
|
3330
|
+
applyGeminiChunk(chunk, state, options);
|
|
3331
|
+
}
|
|
3332
|
+
return {
|
|
3333
|
+
text: state.text,
|
|
3334
|
+
toolCalls: state.toolCalls,
|
|
3335
|
+
usage: state.usage
|
|
3336
|
+
};
|
|
3337
|
+
}
|
|
3338
|
+
async function accumulateGeminiStream(stream, options) {
|
|
3339
|
+
const state = createGeminiAccumulatorState();
|
|
3340
|
+
for await (const chunk of stream) {
|
|
3341
|
+
applyGeminiChunk(chunk, state, options);
|
|
3342
|
+
}
|
|
3343
|
+
return {
|
|
3344
|
+
text: state.text,
|
|
3345
|
+
toolCalls: state.toolCalls,
|
|
3346
|
+
usage: state.usage
|
|
3347
|
+
};
|
|
3300
3348
|
}
|
|
3301
3349
|
function shouldUseGeminiNativeToolRoute(provider, model, tools, isImageModel) {
|
|
3302
3350
|
return provider === "google" && !isImageModel(model) && isGemini3Model(model) && Array.isArray(tools) && tools.length > 0;
|
|
@@ -3405,9 +3453,6 @@ function buildCloudCodeAssistPayload(args) {
|
|
|
3405
3453
|
}
|
|
3406
3454
|
};
|
|
3407
3455
|
}
|
|
3408
|
-
async function readSseJsonChunks(response) {
|
|
3409
|
-
return readSseDataValues(response, parseSseDataLineJson);
|
|
3410
|
-
}
|
|
3411
3456
|
async function fetchAntigravityCloudCodeCompletion(args) {
|
|
3412
3457
|
const fetchImpl = args.fetchImpl ?? fetch;
|
|
3413
3458
|
const { url, envelope } = buildCloudCodeAssistPayload(args);
|
|
@@ -3428,8 +3473,11 @@ async function fetchAntigravityCloudCodeCompletion(args) {
|
|
|
3428
3473
|
body: { error: { message: errorText || response.statusText } }
|
|
3429
3474
|
};
|
|
3430
3475
|
}
|
|
3431
|
-
const
|
|
3432
|
-
const { text, toolCalls, usage } =
|
|
3476
|
+
const chunkStream = streamSseDataValues(response, parseSseDataLineJson);
|
|
3477
|
+
const { text, toolCalls, usage } = await accumulateGeminiStream(chunkStream, {
|
|
3478
|
+
onTextDelta: args.onTextDelta,
|
|
3479
|
+
onReasoningDelta: args.onReasoningDelta
|
|
3480
|
+
});
|
|
3433
3481
|
const message = {
|
|
3434
3482
|
role: "assistant",
|
|
3435
3483
|
content: text || null
|
|
@@ -9974,85 +10022,9 @@ function buildCodexRequestBody(args, identity = createCodexRequestIdentity()) {
|
|
|
9974
10022
|
}
|
|
9975
10023
|
return body;
|
|
9976
10024
|
}
|
|
9977
|
-
function codexStreamFailureStatus(failure) {
|
|
9978
|
-
const marker = `${failure.code ?? ""} ${failure.type ?? ""}`.toLowerCase();
|
|
9979
|
-
if (marker.includes("overload") || marker.includes("service_unavailable")) return 503;
|
|
9980
|
-
if (marker.includes("rate_limit") || marker.includes("usage_limit")) return 429;
|
|
9981
|
-
return 502;
|
|
9982
|
-
}
|
|
9983
10025
|
var RETRYABLE_CODEX_STREAM_STATUSES = /* @__PURE__ */ new Set([503]);
|
|
9984
10026
|
var CODEX_STREAM_MAX_ATTEMPTS = 3;
|
|
9985
10027
|
var CODEX_STREAM_RETRY_BASE_DELAY_MS = 500;
|
|
9986
|
-
function toStreamFailure(raw) {
|
|
9987
|
-
if (!raw || typeof raw !== "object") return void 0;
|
|
9988
|
-
const err = raw;
|
|
9989
|
-
const reason = typeof err.reason === "string" ? err.reason : void 0;
|
|
9990
|
-
const message = typeof err.message === "string" && err.message ? err.message : reason ? `Codex upstream ended incomplete: ${reason}.` : "";
|
|
9991
|
-
if (!message) return void 0;
|
|
9992
|
-
const code = typeof err.code === "string" ? err.code : reason;
|
|
9993
|
-
return {
|
|
9994
|
-
...code ? { code } : {},
|
|
9995
|
-
...typeof err.type === "string" ? { type: err.type } : {},
|
|
9996
|
-
message
|
|
9997
|
-
};
|
|
9998
|
-
}
|
|
9999
|
-
function aggregateResponsesStream(events) {
|
|
10000
|
-
let text = "";
|
|
10001
|
-
const toolCalls = [];
|
|
10002
|
-
let usage;
|
|
10003
|
-
let failure;
|
|
10004
|
-
for (const ev of events) {
|
|
10005
|
-
const type = String(ev.type ?? "");
|
|
10006
|
-
if (type === "error") {
|
|
10007
|
-
failure = failure ?? toStreamFailure(ev.error);
|
|
10008
|
-
continue;
|
|
10009
|
-
}
|
|
10010
|
-
if (type === "response.failed" || type === "response.incomplete") {
|
|
10011
|
-
const response = ev.response;
|
|
10012
|
-
failure = failure ?? toStreamFailure(response?.error) ?? toStreamFailure(response?.incomplete_details) ?? {
|
|
10013
|
-
code: type === "response.incomplete" ? "response_incomplete" : "response_failed",
|
|
10014
|
-
message: `Codex upstream ended with ${type}.`
|
|
10015
|
-
};
|
|
10016
|
-
continue;
|
|
10017
|
-
}
|
|
10018
|
-
if (type === "response.output_text.delta" && typeof ev.delta === "string") {
|
|
10019
|
-
text += ev.delta;
|
|
10020
|
-
continue;
|
|
10021
|
-
}
|
|
10022
|
-
if (type === "response.output_item.done") {
|
|
10023
|
-
const item = ev.item;
|
|
10024
|
-
if (item && item.type === "function_call") {
|
|
10025
|
-
const name = typeof item.name === "string" ? item.name : "";
|
|
10026
|
-
if (name) {
|
|
10027
|
-
toolCalls.push({
|
|
10028
|
-
id: typeof item.call_id === "string" && item.call_id ? item.call_id : `${name}_${toolCalls.length}`,
|
|
10029
|
-
type: "function",
|
|
10030
|
-
function: {
|
|
10031
|
-
name,
|
|
10032
|
-
arguments: typeof item.arguments === "string" ? item.arguments : "{}"
|
|
10033
|
-
}
|
|
10034
|
-
});
|
|
10035
|
-
}
|
|
10036
|
-
}
|
|
10037
|
-
continue;
|
|
10038
|
-
}
|
|
10039
|
-
if (type === "response.completed") {
|
|
10040
|
-
const response = ev.response;
|
|
10041
|
-
const u = response?.usage;
|
|
10042
|
-
if (u) {
|
|
10043
|
-
const prompt = typeof u.input_tokens === "number" ? u.input_tokens : 0;
|
|
10044
|
-
const completion = typeof u.output_tokens === "number" ? u.output_tokens : 0;
|
|
10045
|
-
const total = typeof u.total_tokens === "number" ? u.total_tokens : prompt + completion;
|
|
10046
|
-
usage = {
|
|
10047
|
-
prompt_tokens: prompt,
|
|
10048
|
-
completion_tokens: completion,
|
|
10049
|
-
total_tokens: total
|
|
10050
|
-
};
|
|
10051
|
-
}
|
|
10052
|
-
}
|
|
10053
|
-
}
|
|
10054
|
-
return { text, toolCalls, usage, failure };
|
|
10055
|
-
}
|
|
10056
10028
|
async function readSseEvents(response) {
|
|
10057
10029
|
return readSseDataValues(response, (line) => {
|
|
10058
10030
|
const ev = parseSseDataLineObject(line);
|
|
@@ -10296,13 +10268,10 @@ function buildOpenAiTools(args) {
|
|
|
10296
10268
|
];
|
|
10297
10269
|
}
|
|
10298
10270
|
var CLI_DEFAULT_TOOLS = ["exa_search", "fetchWebpage"];
|
|
10299
|
-
function addDefaultCliCoreTools(toolNames, env
|
|
10271
|
+
function addDefaultCliCoreTools(toolNames, env) {
|
|
10300
10272
|
const declaredOnly = env && shouldUseDeclaredOnlyLocalWorkspaceTools(env);
|
|
10301
|
-
const
|
|
10302
|
-
|
|
10303
|
-
const combined = [...toolNames, ...injected];
|
|
10304
|
-
const filtered = options?.hasUserChoice === true ? combined : combined.filter((name) => name !== "ask_user");
|
|
10305
|
-
return [...new Set(filtered)];
|
|
10273
|
+
const injected = declaredOnly ? [...FORCED_TOOLS] : [...FORCED_TOOLS, ...CLI_DEFAULT_TOOLS];
|
|
10274
|
+
return [.../* @__PURE__ */ new Set([...toolNames, ...injected])];
|
|
10306
10275
|
}
|
|
10307
10276
|
function resolveCliEffectiveEnabledPacks(args) {
|
|
10308
10277
|
return resolveEffectiveEnabledPacks({
|
|
@@ -10327,7 +10296,7 @@ function withRuntimeEnabledPacksAndPrompt(config) {
|
|
|
10327
10296
|
...prompt ? { prompt } : {}
|
|
10328
10297
|
};
|
|
10329
10298
|
}
|
|
10330
|
-
function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills
|
|
10299
|
+
function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills) {
|
|
10331
10300
|
const declaredOnly = shouldUseDeclaredOnlyLocalWorkspaceTools(env);
|
|
10332
10301
|
const expanded = addDefaultLightWebToolsForConfiguredAgents(
|
|
10333
10302
|
addDefaultCliCoreTools(
|
|
@@ -10341,8 +10310,7 @@ function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills, opt
|
|
|
10341
10310
|
resolveRequestedRuntimeToolNames({ agentConfig })
|
|
10342
10311
|
)
|
|
10343
10312
|
),
|
|
10344
|
-
env
|
|
10345
|
-
options
|
|
10313
|
+
env
|
|
10346
10314
|
),
|
|
10347
10315
|
agentConfig
|
|
10348
10316
|
);
|
|
@@ -10360,10 +10328,10 @@ function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills, opt
|
|
|
10360
10328
|
);
|
|
10361
10329
|
return filterToolNamesForRunKind(afterDisabled, isSubtaskRun(env));
|
|
10362
10330
|
}
|
|
10363
|
-
function resolveProviderOpenAiToolBundle(agentConfig, env, buildTools = buildOpenAiTools, additionalToolNames = []
|
|
10331
|
+
function resolveProviderOpenAiToolBundle(agentConfig, env, buildTools = buildOpenAiTools, additionalToolNames = []) {
|
|
10364
10332
|
const requestedToolNames = [
|
|
10365
10333
|
.../* @__PURE__ */ new Set([
|
|
10366
|
-
...resolveCliRequestedToolNames(agentConfig, env, null
|
|
10334
|
+
...resolveCliRequestedToolNames(agentConfig, env, null),
|
|
10367
10335
|
...additionalToolNames
|
|
10368
10336
|
])
|
|
10369
10337
|
];
|
|
@@ -10869,20 +10837,22 @@ async function writeDialog(args) {
|
|
|
10869
10837
|
if (titlePromise) {
|
|
10870
10838
|
const dialogKey = `dialog-${args.userId}-${plan.dialogId}`;
|
|
10871
10839
|
titlePatchPromise = titlePromise.then(async (resolvedTitle) => {
|
|
10872
|
-
if (!resolvedTitle) return;
|
|
10840
|
+
if (!resolvedTitle) return null;
|
|
10873
10841
|
try {
|
|
10874
10842
|
const existing = await args.store.read(dialogKey);
|
|
10875
|
-
if (!existing || typeof existing !== "object") return;
|
|
10876
|
-
if (existing?.titleSource === "manual") return;
|
|
10843
|
+
if (!existing || typeof existing !== "object") return null;
|
|
10844
|
+
if (existing?.titleSource === "manual") return null;
|
|
10877
10845
|
const existingTitleUpdatedAtMs = parseTitleUpdatedAtMs(existing);
|
|
10878
|
-
if (existingTitleUpdatedAtMs > nowMs) return;
|
|
10846
|
+
if (existingTitleUpdatedAtMs > nowMs) return null;
|
|
10879
10847
|
await args.store.write(dialogKey, {
|
|
10880
10848
|
...existing,
|
|
10881
10849
|
title: resolvedTitle,
|
|
10882
10850
|
titleSource: "auto",
|
|
10883
10851
|
titleUpdatedAt: new Date(nowMs).toISOString()
|
|
10884
10852
|
});
|
|
10853
|
+
return resolvedTitle;
|
|
10885
10854
|
} catch {
|
|
10855
|
+
return null;
|
|
10886
10856
|
}
|
|
10887
10857
|
});
|
|
10888
10858
|
}
|
|
@@ -11016,12 +10986,10 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11016
10986
|
deps.env
|
|
11017
10987
|
);
|
|
11018
10988
|
const agentConfig = baseAgentConfig ? withRuntimeEnabledPacksAndPrompt(baseAgentConfig) : baseAgentConfig;
|
|
11019
|
-
const hasUserChoice = Boolean(deps.requestUserChoice);
|
|
11020
10989
|
const requestedToolNames = agentConfig ? resolveCliRequestedToolNames(
|
|
11021
10990
|
agentConfig,
|
|
11022
10991
|
deps.env,
|
|
11023
|
-
systemBuiltinSkills
|
|
11024
|
-
{ hasUserChoice }
|
|
10992
|
+
systemBuiltinSkills
|
|
11025
10993
|
) : [];
|
|
11026
10994
|
activeAgentToolNames = buildLocalPolicyToolNames({
|
|
11027
10995
|
agentKey: agentConfig?.key,
|
|
@@ -11156,6 +11124,14 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11156
11124
|
const authToken = asOptionalTrimmedString(deps.env.AUTH_TOKEN);
|
|
11157
11125
|
const syncFetcher = authToken ? async (ref) => {
|
|
11158
11126
|
try {
|
|
11127
|
+
if (ref.startsWith("provider-key:")) {
|
|
11128
|
+
const presetId = ref.slice("provider-key:".length);
|
|
11129
|
+
return await getServerProviderSecret({
|
|
11130
|
+
serverOrigin: serverUrl,
|
|
11131
|
+
token: authToken,
|
|
11132
|
+
presetId
|
|
11133
|
+
});
|
|
11134
|
+
}
|
|
11159
11135
|
return await fetchServerSyncedCredential(
|
|
11160
11136
|
{ currentServer: serverUrl, authToken },
|
|
11161
11137
|
ref
|
|
@@ -11180,8 +11156,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11180
11156
|
agentConfig,
|
|
11181
11157
|
deps.env,
|
|
11182
11158
|
buildProviderOpenAiTools,
|
|
11183
|
-
additionalToolNames
|
|
11184
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11159
|
+
additionalToolNames
|
|
11185
11160
|
);
|
|
11186
11161
|
logLocalRuntimeDiagnostic("provider.selected", {
|
|
11187
11162
|
agentKey: agentConfig.key,
|
|
@@ -11216,6 +11191,9 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11216
11191
|
accessToken,
|
|
11217
11192
|
metadata: credential?.metadata ?? null,
|
|
11218
11193
|
openAiBody,
|
|
11194
|
+
signal: options?.signal,
|
|
11195
|
+
onTextDelta: options?.onTextDelta,
|
|
11196
|
+
onReasoningDelta: options?.onReasoningDelta,
|
|
11219
11197
|
fetchImpl: (url, init) => fetchWithTransientRetry(fetchImpl, url, init, {
|
|
11220
11198
|
sleep: deps.sleep,
|
|
11221
11199
|
loopbackRequest
|
|
@@ -11232,9 +11210,6 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11232
11210
|
const message = choice?.message ?? {};
|
|
11233
11211
|
const content = typeof message.content === "string" ? message.content : message.content == null ? "" : String(message.content);
|
|
11234
11212
|
const tool_calls = Array.isArray(message.tool_calls) ? message.tool_calls : void 0;
|
|
11235
|
-
if (content && options?.onTextDelta) {
|
|
11236
|
-
options.onTextDelta(content);
|
|
11237
|
-
}
|
|
11238
11213
|
logLocalRuntimeDiagnostic("provider.request.result", {
|
|
11239
11214
|
agentKey: agentConfig.key,
|
|
11240
11215
|
transport: "antigravity-cloud-code",
|
|
@@ -11268,8 +11243,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11268
11243
|
agentConfig,
|
|
11269
11244
|
deps.env,
|
|
11270
11245
|
buildProviderOpenAiTools,
|
|
11271
|
-
additionalToolNames
|
|
11272
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11246
|
+
additionalToolNames
|
|
11273
11247
|
);
|
|
11274
11248
|
logLocalRuntimeDiagnostic("provider.selected", {
|
|
11275
11249
|
agentKey: agentConfig.key,
|
|
@@ -11343,8 +11317,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11343
11317
|
agentConfig,
|
|
11344
11318
|
deps.env,
|
|
11345
11319
|
buildProviderOpenAiTools,
|
|
11346
|
-
additionalToolNames
|
|
11347
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11320
|
+
additionalToolNames
|
|
11348
11321
|
);
|
|
11349
11322
|
logLocalRuntimeDiagnostic("provider.selected", {
|
|
11350
11323
|
agentKey: agentConfig.key,
|
|
@@ -11418,8 +11391,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11418
11391
|
agentConfig,
|
|
11419
11392
|
deps.env,
|
|
11420
11393
|
buildProviderOpenAiTools,
|
|
11421
|
-
additionalToolNames
|
|
11422
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11394
|
+
additionalToolNames
|
|
11423
11395
|
);
|
|
11424
11396
|
logLocalRuntimeDiagnostic("provider.selected", {
|
|
11425
11397
|
agentKey: agentConfig.key,
|
|
@@ -11488,8 +11460,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11488
11460
|
agentConfig,
|
|
11489
11461
|
deps.env,
|
|
11490
11462
|
buildProviderOpenAiTools,
|
|
11491
|
-
additionalToolNames
|
|
11492
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11463
|
+
additionalToolNames
|
|
11493
11464
|
);
|
|
11494
11465
|
if (tools2.length > 0 && providerConfig2.apiKey && shouldUseGeminiNativeToolRoute(
|
|
11495
11466
|
agentConfig.provider ?? "",
|
|
@@ -11597,19 +11568,19 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11597
11568
|
agentConfig,
|
|
11598
11569
|
deps.env,
|
|
11599
11570
|
buildProviderOpenAiTools,
|
|
11600
|
-
additionalToolNames
|
|
11601
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11571
|
+
additionalToolNames
|
|
11602
11572
|
);
|
|
11603
11573
|
return {
|
|
11604
11574
|
model: providerConfig2.model,
|
|
11605
11575
|
complete: async (messages, options) => {
|
|
11606
11576
|
const usesResponsesApi = providerConfig2.endpoint.includes("/responses");
|
|
11607
|
-
const stream = Boolean(options?.onTextDelta)
|
|
11577
|
+
const stream = Boolean(options?.onTextDelta);
|
|
11608
11578
|
const request = buildPlatformChatCompletionRequest({
|
|
11609
11579
|
providerConfig: providerConfig2,
|
|
11610
11580
|
messages,
|
|
11611
11581
|
tools: tools2,
|
|
11612
|
-
stream
|
|
11582
|
+
stream,
|
|
11583
|
+
...options?.dialogId ? { dialogId: options.dialogId } : {}
|
|
11613
11584
|
});
|
|
11614
11585
|
logLocalRuntimeDiagnostic("provider.request.start", {
|
|
11615
11586
|
agentKey: agentConfig.key,
|
|
@@ -11663,9 +11634,11 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11663
11634
|
const contentType = res.headers.get("content-type") ?? "";
|
|
11664
11635
|
const shouldStream = Boolean(stream && options?.onTextDelta) && contentType.includes("text/event-stream");
|
|
11665
11636
|
if (shouldStream && options?.onTextDelta) {
|
|
11666
|
-
const streamed = await
|
|
11637
|
+
const streamed = await readPlatformChatSseCompletion({
|
|
11667
11638
|
response: res,
|
|
11668
|
-
|
|
11639
|
+
usesResponsesApi,
|
|
11640
|
+
onTextDelta: options.onTextDelta,
|
|
11641
|
+
onReasoningDelta: options.onReasoningDelta
|
|
11669
11642
|
});
|
|
11670
11643
|
logLocalRuntimeDiagnostic("provider.request.result", {
|
|
11671
11644
|
agentKey: agentConfig.key,
|
|
@@ -11682,6 +11655,8 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11682
11655
|
...streamed.tool_calls ? { tool_calls: streamed.tool_calls } : {},
|
|
11683
11656
|
...streamed.reasoning_content ? { reasoning_content: streamed.reasoning_content } : {},
|
|
11684
11657
|
...streamed.usage ? { usage: streamed.usage } : {},
|
|
11658
|
+
...streamed.finish_reason ? { finish_reason: streamed.finish_reason } : {},
|
|
11659
|
+
...streamed.stream_complete ? { stream_complete: streamed.stream_complete } : {},
|
|
11685
11660
|
trace: messages
|
|
11686
11661
|
};
|
|
11687
11662
|
}
|
|
@@ -11727,8 +11702,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11727
11702
|
agentConfig,
|
|
11728
11703
|
deps.env,
|
|
11729
11704
|
buildProviderOpenAiTools,
|
|
11730
|
-
additionalToolNames
|
|
11731
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11705
|
+
additionalToolNames
|
|
11732
11706
|
);
|
|
11733
11707
|
return {
|
|
11734
11708
|
model: providerConfig.model,
|