nolo-cli 0.32.0 → 0.33.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/README.md +6 -12
- package/{_executeModel-LTMSIBS4.js → _executeModel-RWPVI3YV.js} +76 -67
- package/{action-HI3VRQLP.js → action-SMLG6OTB.js} +17 -15
- package/{addContentAction-NCURJ6PK.js → addContentAction-SFO244QN.js} +14 -13
- package/{addDialogAgentAction-RCY4ECF4.js → addDialogAgentAction-W44ZCEHB.js} +14 -13
- package/{agentDeleteCommand-D3MYZK6E.js → agentDeleteCommand-KU2RXQPP.js} +42 -59
- package/{agentEmailCommands-6BXS574I.js → agentEmailCommands-MPCMDENS.js} +89 -80
- package/{agentGrantCommands-E7ZZFRHK.js → agentGrantCommands-2LEZDADN.js} +2 -2
- package/{agentListCommands-SF3HEUTT.js → agentListCommands-EPD4N6FX.js} +73 -78
- package/{agentMachineCommands-YARVXRR6.js → agentMachineCommands-AF7C3YRT.js} +40 -57
- package/{agentPullCommand-ARSIDNVC.js → agentPullCommand-YH5GEBK4.js} +5 -5
- package/agentRecordCommands-EYE6MZZG.js +112 -0
- package/agentRunCommand-LL22SGTN.js +130 -0
- package/{agentRuntimeLocal-ATGJY6WC.js → agentRuntimeLocal-JX34G47Z.js} +35 -50
- package/{agentSlice-4XWW344Y.js → agentSlice-TNMFQQOV.js} +15 -13
- package/{appDeleteCommands-63JO7RXS.js → appDeleteCommands-43K5VXQB.js} +38 -55
- package/{appDeployCommands-Y7EWYUGM.js → appDeployCommands-FEEJSVDZ.js} +38 -55
- package/{appDeployStatusCommands-ZBEY3DWB.js → appDeployStatusCommands-H76CG45R.js} +38 -55
- package/{appGetCommands-QSSOSEYL.js → appGetCommands-MDZYFTYZ.js} +38 -55
- package/{appListCommands-PH3XWNDX.js → appListCommands-TUJJXPWG.js} +38 -55
- package/{authCommand-BBDHMSO6.js → authCommand-T7UK4CWS.js} +18 -18
- package/{authCommands-4UDEKRE6.js → authCommands-EAPFGNHN.js} +8 -8
- package/chatQueueReduxAdapter-LVQXC4ZY.js +180 -0
- package/chunk-2H3XIBY4.js +239 -0
- package/{chunk-TEYN42N3.js → chunk-2IVEXF7P.js} +11 -4
- package/{chunk-WTGCTVJG.js → chunk-2QTEYCR7.js} +3 -6
- package/{chunk-DOISARTV.js → chunk-2UECQ7RE.js} +1 -1
- package/{chunk-SWYMCHM7.js → chunk-37V5LNEQ.js} +69 -1
- package/{chunk-E3APEOIM.js → chunk-3GZXL6FM.js} +4 -19
- package/{chunk-O3JR45Q2.js → chunk-3VAQHAXT.js} +44 -44
- package/{chunk-O5OMJPPF.js → chunk-3WXRAHCG.js} +6 -5
- package/{chunk-LAXMH7JY.js → chunk-57QJXIB6.js} +18 -15
- package/chunk-5CS33IBL.js +301 -0
- package/{chunk-3UGKATZQ.js → chunk-5SBK2MTI.js} +8 -369
- package/chunk-6PO2SYCS.js +1800 -0
- package/{chunk-TA6EA2A3.js → chunk-6SXC35F4.js} +182 -20
- package/{chunk-MXFQHRSS.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-3GZT3L6F.js → chunk-73GINUCW.js} +326 -481
- package/{chunk-VMWR7VNI.js → chunk-7E72JMBB.js} +7 -7
- package/{chunk-4PNU7W7K.js → chunk-AAGCMVFT.js} +106 -124
- package/chunk-ADLYMQB6.js +642 -0
- package/{chunk-ZWJOGMKH.js → chunk-AETZ7AD6.js} +1 -1
- package/{chunk-UDA3ZYLW.js → chunk-AFV4FOT2.js} +70 -24
- package/{chunk-BGTUGS3T.js → chunk-AOXVOC6D.js} +4 -30
- package/{chunk-2ZRP5RUG.js → chunk-B2BSG6QQ.js} +12 -11
- package/{chunk-44HACRCK.js → chunk-BANYWEYY.js} +4 -4
- package/{chunk-TOW4E763.js → chunk-BJIRLHJR.js} +2 -0
- package/{chunk-ZJ2WITOO.js → chunk-BQXOGBFN.js} +2 -2
- package/{chunk-G5GVZAXF.js → chunk-CLP2K7U4.js} +15 -19
- package/{chunk-2K4NDPT5.js → chunk-DFUPZE6V.js} +20 -12
- package/{chunk-YHGHADBQ.js → chunk-DPMBNHOJ.js} +4 -4
- package/chunk-EGRJC4ZN.js +91 -0
- package/{chunk-K6QEHQZ3.js → chunk-EKLRRZIN.js} +1 -1
- package/{chunk-XFG3BAKN.js → chunk-FMEVI5TG.js} +65 -0
- package/{chunk-RH53LMEJ.js → chunk-FSSX3XRY.js} +2 -4
- package/{chunk-VP4WJWKW.js → chunk-GM6PU7B6.js} +431 -345
- package/{chunk-EEF23OOK.js → chunk-GMXWYXAF.js} +7 -7
- package/{chunk-SFWZUTCI.js → chunk-GTYM4HKV.js} +1 -1
- package/{chunk-MITD7CON.js → chunk-HDKRSRYU.js} +1461 -301
- package/chunk-HS7MLR74.js +38 -0
- package/{chunk-3AUWC6EM.js → chunk-HUCT7HID.js} +5 -84
- package/{chunk-PTHDLIRB.js → chunk-I6N2UVVY.js} +1 -1
- package/chunk-IDAU4UFS.js +437 -0
- package/{chunk-Q76I4SXI.js → chunk-IHEC7VBF.js} +1 -1
- package/{chunk-OWHNFZNW.js → chunk-IL545V3E.js} +4 -4
- package/{chunk-3LY4F7SV.js → chunk-INZZJSQF.js} +348 -331
- package/{chunk-CF2WZF4N.js → chunk-J6WH4PYZ.js} +0 -8
- package/{chunk-2HXKAPH7.js → chunk-JMPYDFHY.js} +6 -6
- package/{chunk-V54H24CQ.js → chunk-JTSGWTYZ.js} +3 -3
- package/{chunk-ATK5WJOA.js → chunk-JZ5AMMXU.js} +4 -4
- 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-DLWCWUNW.js → chunk-LOD75GOS.js} +336 -32
- package/{chunk-UOJRKY5J.js → chunk-M2YMQOLC.js} +44 -53
- package/chunk-M3JEW6N6.js +193 -0
- package/{chunk-XDHHF73Q.js → chunk-M4NC7NF6.js} +95 -95
- package/{chunk-3FCNXC2J.js → chunk-MPZJVZDC.js} +3735 -1394
- package/{chunk-IXZX5CJK.js → chunk-MQRZ5QUH.js} +1 -1
- package/{chunk-3ASDTTEI.js → chunk-MRWGHF56.js} +2 -0
- package/{chunk-D34RI6NI.js → chunk-NNWHHCVP.js} +75 -1
- package/{chunk-6YABCOFU.js → chunk-NUO3QFWD.js} +1 -1
- package/{chunk-GAF5X6B7.js → chunk-O6GEBMIY.js} +269 -309
- package/{chunk-CAENRKNJ.js → chunk-OR2HNLVO.js} +126 -88
- package/chunk-OW765XBU.js +10 -0
- package/chunk-PREQU5QV.js +231 -0
- package/{chunk-Q3CSL43H.js → chunk-Q5ITEGIN.js} +1 -1
- package/{chunk-7S54ZGF6.js → chunk-RAZOLMJR.js} +256 -12
- package/chunk-RCFIB45Q.js +28 -0
- package/chunk-RY57GLGW.js +188 -0
- package/{chunk-KGEVMUMI.js → chunk-TFPUAELY.js} +11 -11
- package/{chunk-ZJH3LKEW.js → chunk-UK5JGQVU.js} +94 -15
- package/chunk-URMS4XY2.js +10 -0
- package/{chunk-RXVX5LFR.js → chunk-VH2F7ZB6.js} +1 -1
- package/chunk-VIDPVFP3.js +20 -0
- package/{chunk-W367V5CH.js → chunk-WHD6BG7M.js} +400 -115
- 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-43EPBPZ2.js → chunk-XCCGU6QB.js} +2 -2
- package/chunk-Y5GCAMGP.js +9 -0
- 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-ODS2MVMU.js → chunk-ZJMME4DS.js} +19 -303
- package/{chunk-PJ2DDQQM.js → chunk-ZURFOV5J.js} +2 -2
- 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-INQT23LX.js} +40 -31
- package/createDialogAction-LDCPDI73.js +60 -0
- package/{createPageAction-7YROVZ3W.js → createPageAction-5YXOG2M4.js} +56 -47
- package/{db-6DPSJ6WT.js → db-3H3JECGY.js} +45 -5
- package/{dbSlice-BBL3PEVW.js → dbSlice-3SD5L5H2.js} +13 -12
- package/{deleteFile-RJTEPOT4.js → deleteFile-XQXPBFFB.js} +7 -6
- package/dialogCommands-CHJO47AX.js +81 -0
- package/{dialogSlice-N4HPG6HM.js → dialogSlice-DOWKOILN.js} +36 -29
- package/{docCreateCommands-GRA5BHSA.js → docCreateCommands-OVZARUFX.js} +40 -55
- package/{docDeleteCommands-ONIJM5MD.js → docDeleteCommands-E2XJ62LD.js} +42 -57
- package/{docReadCommands-H55VQ2US.js → docReadCommands-I7OSREPJ.js} +40 -55
- package/{docStore-B5AHDNW5.js → docStore-UAWSKZ2Y.js} +39 -30
- package/{docUpdateCommands-ZQIQVGC2.js → docUpdateCommands-X4Z26VJM.js} +43 -58
- package/{fetchMessages-VPPQDDZ4.js → fetchMessages-7QRCCRYK.js} +3 -3
- package/{getPricing-QO5TYNCK.js → getPricing-L2ENXWHV.js} +7 -6
- package/{handleSendMessageAction-IN5XX5U7.js → handleSendMessageAction-C3TSDWKH.js} +38 -31
- package/index.js +67 -67
- package/{lib-FYYBQIXS.js → lib-2ZTNRXR4.js} +432 -183
- package/{localDialogRead-3DBXVYXS.js → localDialogRead-SLMPV5SK.js} +2 -2
- package/{localRuntimeAuthority-NDUA2D7Y.js → localRuntimeAuthority-E3R24J4T.js} +4 -2
- package/{localRuntimeDb-GKYRBWLQ.js → localRuntimeDb-DDZCJFQZ.js} +1 -1
- package/{machineCommands-H3UMKE76.js → machineCommands-BUOIYJAD.js} +93 -84
- package/{machineWsRunDispatch-HONRUK3R.js → machineWsRunDispatch-7CRWAA6O.js} +83 -74
- 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-6G73BMEY.js} +8 -7
- package/{readDocTool-MXM3T6PE.js → readDocTool-DK4EI2GA.js} +1 -2
- package/{readlineWorkspace-XVJZDCSC.js → readlineWorkspace-ZDWEASJV.js} +265 -428
- package/{removeDialogAgentAction-NEKVAMSH.js → removeDialogAgentAction-E7H557UO.js} +19 -17
- package/{runAgentClientLoop-H7U53QB6.js → runAgentClientLoop-U7HYA3O5.js} +72 -64
- package/{runtimeDoctorCommands-WI2YZUSJ.js → runtimeDoctorCommands-KIKM6BIO.js} +5 -5
- package/{setDialogExtraReferencesAction-WTOHQDIV.js → setDialogExtraReferencesAction-RMMGBR5F.js} +15 -14
- package/{setPrimaryDialogAgentAction-LDJOYC4F.js → setPrimaryDialogAgentAction-FWBKKLVA.js} +19 -17
- package/{settingSlice-4M37TN7V.js → settingSlice-73PV4KG4.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-GEWZXGHM.js} +43 -240
- package/{spaceSlice-T6YK6D34.js → spaceSlice-B6MOVY4N.js} +38 -61
- package/{streamAgentChatTurn-RQ63QFQ7.js → streamAgentChatTurn-T527EQTT.js} +1261 -150
- package/{switchDialogAgentAction-XVWGKR2Z.js → switchDialogAgentAction-US6QNL3N.js} +14 -13
- package/syncMapping-RK2MANUX.js +43 -0
- package/{tableCommands-RJZ3V4TF.js → tableCommands-QE47K72R.js} +8 -7
- package/{toolApiClient-ARGFDJAG.js → toolApiClient-B2MFXMEG.js} +3 -3
- package/tools-XMWCVMPM.js +98 -0
- package/{tuiSummaryLlmCaller-SRZ4QQUP.js → tuiSummaryLlmCaller-NCAJSVSD.js} +24 -21
- package/{updateDialogTitleAction-BBDSWHNG.js → updateDialogTitleAction-XPJZRJEL.js} +48 -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/tools-KYZX3BGO.js +0 -90
- package/{chunk-Z5MXSEOJ.js → chunk-RQSOAMPJ.js} +2 -2
- package/{chunk-JDSUTNYY.js → chunk-SAQQLJZ5.js} +3 -3
|
@@ -4,148 +4,137 @@ 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-GTYM4HKV.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-PREQU5QV.js";
|
|
20
|
+
import {
|
|
21
|
+
inlineImageUrlsForCustomProvider,
|
|
22
|
+
prepareTools
|
|
23
|
+
} from "./chunk-M4NC7NF6.js";
|
|
24
|
+
import {
|
|
25
|
+
getServerProviderSecret
|
|
26
|
+
} from "./chunk-HS7MLR74.js";
|
|
27
|
+
import {
|
|
28
|
+
getAntigravityUserAgent,
|
|
29
|
+
isAntigravityOAuthAgent,
|
|
30
|
+
readAntigravityProjectId,
|
|
31
|
+
resolveAntigravityCloudCodeBaseUrl
|
|
32
|
+
} from "./chunk-DPMBNHOJ.js";
|
|
37
33
|
import {
|
|
38
|
-
|
|
34
|
+
readXPostFunc,
|
|
35
|
+
readXPostFunctionSchema,
|
|
36
|
+
readXhsProfileFunc,
|
|
37
|
+
readXhsProfileFunctionSchema,
|
|
38
|
+
rememberMemoryFunctionSchema,
|
|
39
|
+
resolveAgentRequiredPackIds,
|
|
40
|
+
setTodoListFunc
|
|
41
|
+
} from "./chunk-HDKRSRYU.js";
|
|
42
|
+
import {
|
|
43
|
+
createDrainExhaustedResponse,
|
|
44
|
+
isCoreDrainingBody,
|
|
45
|
+
normalizeNonNegativeMs,
|
|
46
|
+
parseRetryAfterHeaderMs
|
|
47
|
+
} from "./chunk-RQSOAMPJ.js";
|
|
48
|
+
import {
|
|
49
|
+
getDefaultCliLocalRuntimeDb
|
|
50
|
+
} from "./chunk-Q5ITEGIN.js";
|
|
51
|
+
import {
|
|
52
|
+
applyTokenUsageToDayStats,
|
|
53
|
+
prepareTokenUsageData,
|
|
54
|
+
runKeyed
|
|
55
|
+
} from "./chunk-73GINUCW.js";
|
|
56
|
+
import {
|
|
57
|
+
BUILTIN_TITLE_LLM_CONFIG
|
|
58
|
+
} from "./chunk-RCFIB45Q.js";
|
|
59
|
+
import {
|
|
60
|
+
fetchServerSyncedCredential
|
|
61
|
+
} from "./chunk-ZJMME4DS.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-LOD75GOS.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-RAZOLMJR.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-6PO2SYCS.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-AFV4FOT2.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-2H3XIBY4.js";
|
|
138
126
|
import {
|
|
139
|
-
BUILTIN_TITLE_LLM_CONFIG,
|
|
140
127
|
clipCompactText
|
|
141
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-AOXVOC6D.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-5CS33IBL.js";
|
|
149
138
|
import {
|
|
150
139
|
createOAuthTokenStore,
|
|
151
140
|
isTokenExpired,
|
|
@@ -153,17 +142,56 @@ import {
|
|
|
153
142
|
resolveFreshAccessToken
|
|
154
143
|
} from "./chunk-JZPBVBIY.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-UK5JGQVU.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";
|
|
@@ -1046,9 +1061,13 @@ var SUBTASK_REMOVED_GIT_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
1046
1061
|
"gitCreateBranch",
|
|
1047
1062
|
"commitWorkspace"
|
|
1048
1063
|
]);
|
|
1064
|
+
var INTERACTION_REQUIRED_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
1065
|
+
"ask_user"
|
|
1066
|
+
]);
|
|
1049
1067
|
var SUBTASK_REMOVED_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
1050
1068
|
...ORCHESTRATION_TOOL_NAMES,
|
|
1051
|
-
...SUBTASK_REMOVED_GIT_TOOL_NAMES
|
|
1069
|
+
...SUBTASK_REMOVED_GIT_TOOL_NAMES,
|
|
1070
|
+
...INTERACTION_REQUIRED_TOOL_NAMES
|
|
1052
1071
|
]);
|
|
1053
1072
|
function isSubtaskRun(env) {
|
|
1054
1073
|
if (!env) return false;
|
|
@@ -1545,23 +1564,6 @@ function assertWithinLocalToolBudget(args) {
|
|
|
1545
1564
|
);
|
|
1546
1565
|
}
|
|
1547
1566
|
|
|
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
1567
|
// packages/cli/client/cliLocalAgentRecordReader.ts
|
|
1566
1568
|
function resolveBuiltinLocalCliAgentConfig(agentRef, userId) {
|
|
1567
1569
|
const normalized = agentRef.trim();
|
|
@@ -1573,7 +1575,7 @@ function resolveBuiltinLocalCliAgentConfig(agentRef, userId) {
|
|
|
1573
1575
|
apiSource: "cli",
|
|
1574
1576
|
provider: "cli",
|
|
1575
1577
|
cliProvider: "codex",
|
|
1576
|
-
toolNames: ["readFile", "
|
|
1578
|
+
toolNames: ["readFile", "execShell", "fetchWebpage", "exa_search"],
|
|
1577
1579
|
rawRecord: {
|
|
1578
1580
|
dbKey: LOCAL_CODEX_AGENT_KEY,
|
|
1579
1581
|
id: LOCAL_CODEX_AGENT_ID,
|
|
@@ -1592,7 +1594,10 @@ async function readAgentFromStore(args) {
|
|
|
1592
1594
|
for (const key of buildLocalAgentLookupKeys(args)) {
|
|
1593
1595
|
const record = await args.store.read(key);
|
|
1594
1596
|
if (!record || typeof record !== "object") continue;
|
|
1595
|
-
return
|
|
1597
|
+
return applyBuiltinAgentRuntimeOverride(
|
|
1598
|
+
args.agentRef,
|
|
1599
|
+
resolveAgentRuntimeConfigFromRecord(key, record)
|
|
1600
|
+
);
|
|
1596
1601
|
}
|
|
1597
1602
|
return resolveBuiltinPlatformAgentConfig(args.agentRef);
|
|
1598
1603
|
}
|
|
@@ -3242,61 +3247,90 @@ function convertOpenAiToolsToGemini(tools) {
|
|
|
3242
3247
|
if (declarations.length === 0) return void 0;
|
|
3243
3248
|
return [{ functionDeclarations: declarations }];
|
|
3244
3249
|
}
|
|
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
|
-
|
|
3250
|
+
function createGeminiAccumulatorState() {
|
|
3251
|
+
return {
|
|
3252
|
+
text: "",
|
|
3253
|
+
toolCalls: []
|
|
3254
|
+
};
|
|
3255
|
+
}
|
|
3256
|
+
function applyGeminiChunk(chunk, state, options) {
|
|
3257
|
+
if (!chunk || typeof chunk !== "object") return;
|
|
3258
|
+
const response = "response" in chunk && chunk.response && typeof chunk.response === "object" ? chunk.response : chunk;
|
|
3259
|
+
if ("usageMetadata" in response && response.usageMetadata && typeof response.usageMetadata === "object") {
|
|
3260
|
+
const meta = response.usageMetadata;
|
|
3261
|
+
const prompt = typeof meta.promptTokenCount === "number" ? meta.promptTokenCount : 0;
|
|
3262
|
+
const candidates2 = typeof meta.candidatesTokenCount === "number" ? meta.candidatesTokenCount : 0;
|
|
3263
|
+
const total = typeof meta.totalTokenCount === "number" ? meta.totalTokenCount : prompt + candidates2;
|
|
3264
|
+
state.usage = {
|
|
3265
|
+
prompt_tokens: prompt,
|
|
3266
|
+
completion_tokens: candidates2,
|
|
3267
|
+
total_tokens: total
|
|
3268
|
+
};
|
|
3269
|
+
}
|
|
3270
|
+
const candidates = Array.isArray(response.candidates) ? response.candidates : [];
|
|
3271
|
+
for (const candidate of candidates) {
|
|
3272
|
+
if (!candidate || typeof candidate !== "object") continue;
|
|
3273
|
+
const parts = Array.isArray(
|
|
3274
|
+
candidate.content?.parts
|
|
3275
|
+
) ? candidate.content.parts : [];
|
|
3276
|
+
for (const part of parts) {
|
|
3277
|
+
if (!part || typeof part !== "object") continue;
|
|
3278
|
+
const partSignature = part.thoughtSignature;
|
|
3279
|
+
const isThought = Boolean(part.thought);
|
|
3280
|
+
if ("text" in part && typeof part.text === "string") {
|
|
3281
|
+
const piece = part.text;
|
|
3282
|
+
if (!isThought) {
|
|
3283
|
+
state.text += piece;
|
|
3284
|
+
if (piece && options?.onTextDelta) {
|
|
3285
|
+
options.onTextDelta(piece);
|
|
3286
|
+
}
|
|
3287
|
+
} else {
|
|
3288
|
+
if (piece && options?.onReasoningDelta) {
|
|
3289
|
+
options.onReasoningDelta(piece);
|
|
3277
3290
|
}
|
|
3278
3291
|
}
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
}
|
|
3295
|
-
}
|
|
3292
|
+
}
|
|
3293
|
+
if (isThought && typeof partSignature === "string" && partSignature) {
|
|
3294
|
+
state.pendingThoughtSignature = partSignature;
|
|
3295
|
+
}
|
|
3296
|
+
if ("functionCall" in part && part.functionCall) {
|
|
3297
|
+
const call = part.functionCall;
|
|
3298
|
+
const name = typeof call.name === "string" ? call.name : "tool";
|
|
3299
|
+
const id = typeof call.id === "string" ? call.id : `${name}_${state.toolCalls.length}`;
|
|
3300
|
+
const argsObj = call.args && typeof call.args === "object" ? call.args : {};
|
|
3301
|
+
const resolvedSignature = typeof partSignature === "string" && partSignature ? partSignature : state.pendingThoughtSignature;
|
|
3302
|
+
state.pendingThoughtSignature = void 0;
|
|
3303
|
+
state.toolCalls.push({
|
|
3304
|
+
id,
|
|
3305
|
+
type: "function",
|
|
3306
|
+
function: { name, arguments: JSON.stringify(argsObj) },
|
|
3307
|
+
...typeof resolvedSignature === "string" && resolvedSignature ? { thought_signature: resolvedSignature } : {}
|
|
3308
|
+
});
|
|
3296
3309
|
}
|
|
3297
3310
|
}
|
|
3298
3311
|
}
|
|
3299
|
-
|
|
3312
|
+
}
|
|
3313
|
+
function accumulateGeminiChunks(chunks, options) {
|
|
3314
|
+
const state = createGeminiAccumulatorState();
|
|
3315
|
+
for (const chunk of chunks) {
|
|
3316
|
+
applyGeminiChunk(chunk, state, options);
|
|
3317
|
+
}
|
|
3318
|
+
return {
|
|
3319
|
+
text: state.text,
|
|
3320
|
+
toolCalls: state.toolCalls,
|
|
3321
|
+
usage: state.usage
|
|
3322
|
+
};
|
|
3323
|
+
}
|
|
3324
|
+
async function accumulateGeminiStream(stream, options) {
|
|
3325
|
+
const state = createGeminiAccumulatorState();
|
|
3326
|
+
for await (const chunk of stream) {
|
|
3327
|
+
applyGeminiChunk(chunk, state, options);
|
|
3328
|
+
}
|
|
3329
|
+
return {
|
|
3330
|
+
text: state.text,
|
|
3331
|
+
toolCalls: state.toolCalls,
|
|
3332
|
+
usage: state.usage
|
|
3333
|
+
};
|
|
3300
3334
|
}
|
|
3301
3335
|
function shouldUseGeminiNativeToolRoute(provider, model, tools, isImageModel) {
|
|
3302
3336
|
return provider === "google" && !isImageModel(model) && isGemini3Model(model) && Array.isArray(tools) && tools.length > 0;
|
|
@@ -3405,9 +3439,6 @@ function buildCloudCodeAssistPayload(args) {
|
|
|
3405
3439
|
}
|
|
3406
3440
|
};
|
|
3407
3441
|
}
|
|
3408
|
-
async function readSseJsonChunks(response) {
|
|
3409
|
-
return readSseDataValues(response, parseSseDataLineJson);
|
|
3410
|
-
}
|
|
3411
3442
|
async function fetchAntigravityCloudCodeCompletion(args) {
|
|
3412
3443
|
const fetchImpl = args.fetchImpl ?? fetch;
|
|
3413
3444
|
const { url, envelope } = buildCloudCodeAssistPayload(args);
|
|
@@ -3428,8 +3459,11 @@ async function fetchAntigravityCloudCodeCompletion(args) {
|
|
|
3428
3459
|
body: { error: { message: errorText || response.statusText } }
|
|
3429
3460
|
};
|
|
3430
3461
|
}
|
|
3431
|
-
const
|
|
3432
|
-
const { text, toolCalls, usage } =
|
|
3462
|
+
const chunkStream = streamSseDataValues(response, parseSseDataLineJson);
|
|
3463
|
+
const { text, toolCalls, usage } = await accumulateGeminiStream(chunkStream, {
|
|
3464
|
+
onTextDelta: args.onTextDelta,
|
|
3465
|
+
onReasoningDelta: args.onReasoningDelta
|
|
3466
|
+
});
|
|
3433
3467
|
const message = {
|
|
3434
3468
|
role: "assistant",
|
|
3435
3469
|
content: text || null
|
|
@@ -9974,85 +10008,9 @@ function buildCodexRequestBody(args, identity = createCodexRequestIdentity()) {
|
|
|
9974
10008
|
}
|
|
9975
10009
|
return body;
|
|
9976
10010
|
}
|
|
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
10011
|
var RETRYABLE_CODEX_STREAM_STATUSES = /* @__PURE__ */ new Set([503]);
|
|
9984
10012
|
var CODEX_STREAM_MAX_ATTEMPTS = 3;
|
|
9985
10013
|
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
10014
|
async function readSseEvents(response) {
|
|
10057
10015
|
return readSseDataValues(response, (line) => {
|
|
10058
10016
|
const ev = parseSseDataLineObject(line);
|
|
@@ -10296,13 +10254,10 @@ function buildOpenAiTools(args) {
|
|
|
10296
10254
|
];
|
|
10297
10255
|
}
|
|
10298
10256
|
var CLI_DEFAULT_TOOLS = ["exa_search", "fetchWebpage"];
|
|
10299
|
-
function addDefaultCliCoreTools(toolNames, env
|
|
10257
|
+
function addDefaultCliCoreTools(toolNames, env) {
|
|
10300
10258
|
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)];
|
|
10259
|
+
const injected = declaredOnly ? [...FORCED_TOOLS] : [...FORCED_TOOLS, ...CLI_DEFAULT_TOOLS];
|
|
10260
|
+
return [.../* @__PURE__ */ new Set([...toolNames, ...injected])];
|
|
10306
10261
|
}
|
|
10307
10262
|
function resolveCliEffectiveEnabledPacks(args) {
|
|
10308
10263
|
return resolveEffectiveEnabledPacks({
|
|
@@ -10327,7 +10282,7 @@ function withRuntimeEnabledPacksAndPrompt(config) {
|
|
|
10327
10282
|
...prompt ? { prompt } : {}
|
|
10328
10283
|
};
|
|
10329
10284
|
}
|
|
10330
|
-
function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills
|
|
10285
|
+
function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills) {
|
|
10331
10286
|
const declaredOnly = shouldUseDeclaredOnlyLocalWorkspaceTools(env);
|
|
10332
10287
|
const expanded = addDefaultLightWebToolsForConfiguredAgents(
|
|
10333
10288
|
addDefaultCliCoreTools(
|
|
@@ -10341,8 +10296,7 @@ function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills, opt
|
|
|
10341
10296
|
resolveRequestedRuntimeToolNames({ agentConfig })
|
|
10342
10297
|
)
|
|
10343
10298
|
),
|
|
10344
|
-
env
|
|
10345
|
-
options
|
|
10299
|
+
env
|
|
10346
10300
|
),
|
|
10347
10301
|
agentConfig
|
|
10348
10302
|
);
|
|
@@ -10360,10 +10314,10 @@ function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills, opt
|
|
|
10360
10314
|
);
|
|
10361
10315
|
return filterToolNamesForRunKind(afterDisabled, isSubtaskRun(env));
|
|
10362
10316
|
}
|
|
10363
|
-
function resolveProviderOpenAiToolBundle(agentConfig, env, buildTools = buildOpenAiTools, additionalToolNames = []
|
|
10317
|
+
function resolveProviderOpenAiToolBundle(agentConfig, env, buildTools = buildOpenAiTools, additionalToolNames = []) {
|
|
10364
10318
|
const requestedToolNames = [
|
|
10365
10319
|
.../* @__PURE__ */ new Set([
|
|
10366
|
-
...resolveCliRequestedToolNames(agentConfig, env, null
|
|
10320
|
+
...resolveCliRequestedToolNames(agentConfig, env, null),
|
|
10367
10321
|
...additionalToolNames
|
|
10368
10322
|
])
|
|
10369
10323
|
];
|
|
@@ -10869,20 +10823,22 @@ async function writeDialog(args) {
|
|
|
10869
10823
|
if (titlePromise) {
|
|
10870
10824
|
const dialogKey = `dialog-${args.userId}-${plan.dialogId}`;
|
|
10871
10825
|
titlePatchPromise = titlePromise.then(async (resolvedTitle) => {
|
|
10872
|
-
if (!resolvedTitle) return;
|
|
10826
|
+
if (!resolvedTitle) return null;
|
|
10873
10827
|
try {
|
|
10874
10828
|
const existing = await args.store.read(dialogKey);
|
|
10875
|
-
if (!existing || typeof existing !== "object") return;
|
|
10876
|
-
if (existing?.titleSource === "manual") return;
|
|
10829
|
+
if (!existing || typeof existing !== "object") return null;
|
|
10830
|
+
if (existing?.titleSource === "manual") return null;
|
|
10877
10831
|
const existingTitleUpdatedAtMs = parseTitleUpdatedAtMs(existing);
|
|
10878
|
-
if (existingTitleUpdatedAtMs > nowMs) return;
|
|
10832
|
+
if (existingTitleUpdatedAtMs > nowMs) return null;
|
|
10879
10833
|
await args.store.write(dialogKey, {
|
|
10880
10834
|
...existing,
|
|
10881
10835
|
title: resolvedTitle,
|
|
10882
10836
|
titleSource: "auto",
|
|
10883
10837
|
titleUpdatedAt: new Date(nowMs).toISOString()
|
|
10884
10838
|
});
|
|
10839
|
+
return resolvedTitle;
|
|
10885
10840
|
} catch {
|
|
10841
|
+
return null;
|
|
10886
10842
|
}
|
|
10887
10843
|
});
|
|
10888
10844
|
}
|
|
@@ -11016,12 +10972,10 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11016
10972
|
deps.env
|
|
11017
10973
|
);
|
|
11018
10974
|
const agentConfig = baseAgentConfig ? withRuntimeEnabledPacksAndPrompt(baseAgentConfig) : baseAgentConfig;
|
|
11019
|
-
const hasUserChoice = Boolean(deps.requestUserChoice);
|
|
11020
10975
|
const requestedToolNames = agentConfig ? resolveCliRequestedToolNames(
|
|
11021
10976
|
agentConfig,
|
|
11022
10977
|
deps.env,
|
|
11023
|
-
systemBuiltinSkills
|
|
11024
|
-
{ hasUserChoice }
|
|
10978
|
+
systemBuiltinSkills
|
|
11025
10979
|
) : [];
|
|
11026
10980
|
activeAgentToolNames = buildLocalPolicyToolNames({
|
|
11027
10981
|
agentKey: agentConfig?.key,
|
|
@@ -11156,6 +11110,14 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11156
11110
|
const authToken = asOptionalTrimmedString(deps.env.AUTH_TOKEN);
|
|
11157
11111
|
const syncFetcher = authToken ? async (ref) => {
|
|
11158
11112
|
try {
|
|
11113
|
+
if (ref.startsWith("provider-key:")) {
|
|
11114
|
+
const presetId = ref.slice("provider-key:".length);
|
|
11115
|
+
return await getServerProviderSecret({
|
|
11116
|
+
serverOrigin: serverUrl,
|
|
11117
|
+
token: authToken,
|
|
11118
|
+
presetId
|
|
11119
|
+
});
|
|
11120
|
+
}
|
|
11159
11121
|
return await fetchServerSyncedCredential(
|
|
11160
11122
|
{ currentServer: serverUrl, authToken },
|
|
11161
11123
|
ref
|
|
@@ -11180,8 +11142,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11180
11142
|
agentConfig,
|
|
11181
11143
|
deps.env,
|
|
11182
11144
|
buildProviderOpenAiTools,
|
|
11183
|
-
additionalToolNames
|
|
11184
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11145
|
+
additionalToolNames
|
|
11185
11146
|
);
|
|
11186
11147
|
logLocalRuntimeDiagnostic("provider.selected", {
|
|
11187
11148
|
agentKey: agentConfig.key,
|
|
@@ -11216,6 +11177,9 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11216
11177
|
accessToken,
|
|
11217
11178
|
metadata: credential?.metadata ?? null,
|
|
11218
11179
|
openAiBody,
|
|
11180
|
+
signal: options?.signal,
|
|
11181
|
+
onTextDelta: options?.onTextDelta,
|
|
11182
|
+
onReasoningDelta: options?.onReasoningDelta,
|
|
11219
11183
|
fetchImpl: (url, init) => fetchWithTransientRetry(fetchImpl, url, init, {
|
|
11220
11184
|
sleep: deps.sleep,
|
|
11221
11185
|
loopbackRequest
|
|
@@ -11232,9 +11196,6 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11232
11196
|
const message = choice?.message ?? {};
|
|
11233
11197
|
const content = typeof message.content === "string" ? message.content : message.content == null ? "" : String(message.content);
|
|
11234
11198
|
const tool_calls = Array.isArray(message.tool_calls) ? message.tool_calls : void 0;
|
|
11235
|
-
if (content && options?.onTextDelta) {
|
|
11236
|
-
options.onTextDelta(content);
|
|
11237
|
-
}
|
|
11238
11199
|
logLocalRuntimeDiagnostic("provider.request.result", {
|
|
11239
11200
|
agentKey: agentConfig.key,
|
|
11240
11201
|
transport: "antigravity-cloud-code",
|
|
@@ -11268,8 +11229,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11268
11229
|
agentConfig,
|
|
11269
11230
|
deps.env,
|
|
11270
11231
|
buildProviderOpenAiTools,
|
|
11271
|
-
additionalToolNames
|
|
11272
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11232
|
+
additionalToolNames
|
|
11273
11233
|
);
|
|
11274
11234
|
logLocalRuntimeDiagnostic("provider.selected", {
|
|
11275
11235
|
agentKey: agentConfig.key,
|
|
@@ -11343,8 +11303,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11343
11303
|
agentConfig,
|
|
11344
11304
|
deps.env,
|
|
11345
11305
|
buildProviderOpenAiTools,
|
|
11346
|
-
additionalToolNames
|
|
11347
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11306
|
+
additionalToolNames
|
|
11348
11307
|
);
|
|
11349
11308
|
logLocalRuntimeDiagnostic("provider.selected", {
|
|
11350
11309
|
agentKey: agentConfig.key,
|
|
@@ -11418,8 +11377,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11418
11377
|
agentConfig,
|
|
11419
11378
|
deps.env,
|
|
11420
11379
|
buildProviderOpenAiTools,
|
|
11421
|
-
additionalToolNames
|
|
11422
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11380
|
+
additionalToolNames
|
|
11423
11381
|
);
|
|
11424
11382
|
logLocalRuntimeDiagnostic("provider.selected", {
|
|
11425
11383
|
agentKey: agentConfig.key,
|
|
@@ -11488,8 +11446,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11488
11446
|
agentConfig,
|
|
11489
11447
|
deps.env,
|
|
11490
11448
|
buildProviderOpenAiTools,
|
|
11491
|
-
additionalToolNames
|
|
11492
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11449
|
+
additionalToolNames
|
|
11493
11450
|
);
|
|
11494
11451
|
if (tools2.length > 0 && providerConfig2.apiKey && shouldUseGeminiNativeToolRoute(
|
|
11495
11452
|
agentConfig.provider ?? "",
|
|
@@ -11597,19 +11554,19 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11597
11554
|
agentConfig,
|
|
11598
11555
|
deps.env,
|
|
11599
11556
|
buildProviderOpenAiTools,
|
|
11600
|
-
additionalToolNames
|
|
11601
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11557
|
+
additionalToolNames
|
|
11602
11558
|
);
|
|
11603
11559
|
return {
|
|
11604
11560
|
model: providerConfig2.model,
|
|
11605
11561
|
complete: async (messages, options) => {
|
|
11606
11562
|
const usesResponsesApi = providerConfig2.endpoint.includes("/responses");
|
|
11607
|
-
const stream = Boolean(options?.onTextDelta)
|
|
11563
|
+
const stream = Boolean(options?.onTextDelta);
|
|
11608
11564
|
const request = buildPlatformChatCompletionRequest({
|
|
11609
11565
|
providerConfig: providerConfig2,
|
|
11610
11566
|
messages,
|
|
11611
11567
|
tools: tools2,
|
|
11612
|
-
stream
|
|
11568
|
+
stream,
|
|
11569
|
+
...options?.dialogId ? { dialogId: options.dialogId } : {}
|
|
11613
11570
|
});
|
|
11614
11571
|
logLocalRuntimeDiagnostic("provider.request.start", {
|
|
11615
11572
|
agentKey: agentConfig.key,
|
|
@@ -11663,9 +11620,11 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11663
11620
|
const contentType = res.headers.get("content-type") ?? "";
|
|
11664
11621
|
const shouldStream = Boolean(stream && options?.onTextDelta) && contentType.includes("text/event-stream");
|
|
11665
11622
|
if (shouldStream && options?.onTextDelta) {
|
|
11666
|
-
const streamed = await
|
|
11623
|
+
const streamed = await readPlatformChatSseCompletion({
|
|
11667
11624
|
response: res,
|
|
11668
|
-
|
|
11625
|
+
usesResponsesApi,
|
|
11626
|
+
onTextDelta: options.onTextDelta,
|
|
11627
|
+
onReasoningDelta: options.onReasoningDelta
|
|
11669
11628
|
});
|
|
11670
11629
|
logLocalRuntimeDiagnostic("provider.request.result", {
|
|
11671
11630
|
agentKey: agentConfig.key,
|
|
@@ -11682,6 +11641,8 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11682
11641
|
...streamed.tool_calls ? { tool_calls: streamed.tool_calls } : {},
|
|
11683
11642
|
...streamed.reasoning_content ? { reasoning_content: streamed.reasoning_content } : {},
|
|
11684
11643
|
...streamed.usage ? { usage: streamed.usage } : {},
|
|
11644
|
+
...streamed.finish_reason ? { finish_reason: streamed.finish_reason } : {},
|
|
11645
|
+
...streamed.stream_complete ? { stream_complete: streamed.stream_complete } : {},
|
|
11685
11646
|
trace: messages
|
|
11686
11647
|
};
|
|
11687
11648
|
}
|
|
@@ -11727,8 +11688,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
11727
11688
|
agentConfig,
|
|
11728
11689
|
deps.env,
|
|
11729
11690
|
buildProviderOpenAiTools,
|
|
11730
|
-
additionalToolNames
|
|
11731
|
-
{ hasUserChoice: Boolean(deps.requestUserChoice) }
|
|
11691
|
+
additionalToolNames
|
|
11732
11692
|
);
|
|
11733
11693
|
return {
|
|
11734
11694
|
model: providerConfig.model,
|