nolo-cli 0.8.0-alpha.24 → 0.8.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-2ZAPHFOX.js → _executeModel-IYPAOWQQ.js} +47 -49
- package/{action-QM2ONPYZ.js → action-UAHWPMZB.js} +7 -8
- package/{addContentAction-UXY3GM53.js → addContentAction-PFIP76LT.js} +6 -8
- package/{addDialogAgentAction-MUBYOG65.js → addDialogAgentAction-LWDAIDEU.js} +8 -9
- package/{agentDeleteCommand-5TFSII4Z.js → agentDeleteCommand-M6KIV6ZZ.js} +35 -26
- package/{agentEmailCommands-XMXWGUMZ.js → agentEmailCommands-JGAZ26N2.js} +59 -60
- package/{agentListCommands-OWEFQEY4.js → agentListCommands-3TQWUC4W.js} +34 -26
- package/{agentMachineCommands-DGHYBBFC.js → agentMachineCommands-EBCDKO4T.js} +35 -25
- package/{agentRecordCommands-I433EE5F.js → agentRecordCommands-ZKOLGEMX.js} +52 -53
- package/{agentRunCommand-UQSX3IGW.js → agentRunCommand-L6A3DKTB.js} +55 -58
- package/{agentRuntimeLocal-73SVOC5U.js → agentRuntimeLocal-6Q4CEFXY.js} +26 -13
- package/{agentSlice-JQCS4LR3.js → agentSlice-XRG5ODYW.js} +7 -8
- package/{authCommand-B6P2XYLN.js → authCommand-ELPMOABY.js} +13 -13
- package/{authCommands-4YKA4GTU.js → authCommands-PUQRVHHW.js} +5 -5
- package/{chunk-AFON4QUU.js → chunk-3QKO4EHV.js} +3 -3
- package/{chunk-QWM7YWVT.js → chunk-4GBNEA5B.js} +1 -1
- package/{chunk-PXZAAB4L.js → chunk-4LG74DRG.js} +4 -4
- package/{chunk-WVS3GX3B.js → chunk-5EUAXXSV.js} +2 -2
- package/{chunk-BQECZ3Q4.js → chunk-5LDYVJXY.js} +191 -40
- package/{chunk-IYMGQ3TN.js → chunk-66DXKPRS.js} +2 -2
- package/{chunk-LRKEOCWY.js → chunk-67Z375LK.js} +17 -17
- package/{chunk-FZ2G3I4B.js → chunk-6PXKSN2M.js} +2 -2
- package/{chunk-WM7P5OWZ.js → chunk-ALEDPZVP.js} +86 -52
- package/{chunk-GROGNZOA.js → chunk-DW75SYWV.js} +85 -2326
- package/{chunk-BT57QC5K.js → chunk-EEUWELOX.js} +14 -14
- package/chunk-GVQT3FIB.js +2286 -0
- package/{chunk-6QFNUK2G.js → chunk-I2HCZWJU.js} +1 -1
- package/{chunk-C4DZRHFJ.js → chunk-IG2EZS3N.js} +64 -17
- package/{chunk-Z3NEXVYE.js → chunk-IKXL2HZ3.js} +38 -1
- package/{chunk-2CVZSC5L.js → chunk-IVAOVLM7.js} +1 -1
- package/{chunk-L3KWEH3V.js → chunk-KPFGD3YA.js} +43 -12
- package/{chunk-Q7S2ORXX.js → chunk-KRMH46UV.js} +10 -10
- package/{chunk-WKQGZJVI.js → chunk-LFETMU66.js} +8 -8
- package/{chunk-AISLHYDB.js → chunk-LWYCA4ZT.js} +306 -42
- package/{chunk-SBVUZC2E.js → chunk-MMCDCZM4.js} +6 -6
- package/{chunk-YOCHZD7D.js → chunk-NCGFB7NN.js} +5 -3
- package/{chunk-LE6JAIXE.js → chunk-OOOKLEJ7.js} +6 -6
- package/{chunk-C4FTUXVF.js → chunk-QLUFR47U.js} +11 -1
- package/{chunk-P2SPC3FT.js → chunk-RB43SIIG.js} +27 -25
- package/{chunk-RQPZX6KP.js → chunk-S37OTGU7.js} +2 -2
- package/{chunk-FVVST32H.js → chunk-SCBYSC74.js} +1 -1
- package/{chunk-UBSKX3LP.js → chunk-UZZCXRHF.js} +6 -6
- package/{chunk-DS3VC4EA.js → chunk-V6ICY2YU.js} +5 -5
- package/{chunk-G7KM6BBZ.js → chunk-VNGCTQ32.js} +1 -1
- package/{chunk-BKGNXJAM.js → chunk-WKWEV6K4.js} +1 -1
- package/{chunk-WTBWWBSF.js → chunk-WO6IG6YT.js} +31 -29
- package/{chunk-JTINRTBT.js → chunk-WPHL6ALY.js} +1 -1
- package/{chunk-KTHLAJEY.js → chunk-WZF7M6GX.js} +1 -1
- package/{chunk-LTH6AVG7.js → chunk-XDXO65DS.js} +3 -3
- package/{chunk-BFDWXLFF.js → chunk-XGMCGPEA.js} +64 -5
- package/{chunk-L76QNLGU.js → chunk-XGOTQ6ZG.js} +1 -1
- package/{chunk-VBKJTOAW.js → chunk-XHQWJUW4.js} +2 -2
- package/{chunk-VUEXKW6U.js → chunk-XIZIRGXB.js} +15 -15
- package/{chunk-IPA2WQGY.js → chunk-Y7QCVJ73.js} +167 -71
- package/{chunk-3KGTFX3T.js → chunk-ZR4VHQ5D.js} +13 -1
- package/{createAgentAutomationAction-GXZNLJZK.js → createAgentAutomationAction-HZJ4LPCW.js} +22 -25
- package/{createDialogAction-KLW42ZGF.js → createDialogAction-KICYAHEQ.js} +24 -27
- package/{createPageAction-IBJHE6MH.js → createPageAction-VWBZOQPP.js} +24 -27
- package/{dbSlice-R5EJKZBW.js → dbSlice-V4H2JFNB.js} +5 -6
- package/{deleteFile-WPWVZE4B.js → deleteFile-M7UNIUOO.js} +3 -3
- package/{dialogCommands-7O5PUZRU.js → dialogCommands-UMT7AOOR.js} +30 -21
- package/{dialogSlice-GGV7PF53.js → dialogSlice-G3WPGLY5.js} +22 -25
- package/{docCreateCommands-7ZO2NQQF.js → docCreateCommands-MAZSFQQ5.js} +33 -24
- package/{docDeleteCommands-YKIXZYBR.js → docDeleteCommands-DOTLD7HA.js} +33 -25
- package/{docReadCommands-5UDONBUL.js → docReadCommands-PH255AKZ.js} +33 -24
- package/{docStore-VDWTATFH.js → docStore-K7U47JYV.js} +21 -24
- package/{docUpdateCommands-EPZIIQMY.js → docUpdateCommands-RLRID2K7.js} +33 -24
- package/fetchMessages-KTNM7QAR.js +1 -1
- package/getPricing-6TOZXPAU.js +1 -1
- package/{handleSendMessageAction-MMATC5V5.js → handleSendMessageAction-UAI2ZOGG.js} +27 -30
- package/index.js +62 -62
- package/{localDialogRead-YSKFFRTT.js → localDialogRead-2VRI24F4.js} +1 -1
- package/{machineCommands-PTHPKSIZ.js → machineCommands-FE5HOJWR.js} +57 -58
- package/{machineWsRunDispatch-M5L2NVWJ.js → machineWsRunDispatch-J56M67NJ.js} +51 -52
- package/{models-H524GH3U.js → models-LSCRJJ6P.js} +1 -2
- package/package.json +1 -1
- package/{read-5ZMY7FKP.js → read-2MIMRBZ2.js} +3 -3
- package/{readDocTool-2NXDK32S.js → readDocTool-QHVGQHUJ.js} +1 -1
- package/{readlineWorkspace-4NXMEOHP.js → readlineWorkspace-GK33VXX2.js} +114 -99
- package/{removeDialogAgentAction-KOLQ2R5W.js → removeDialogAgentAction-7GO2PRVQ.js} +12 -13
- package/{runAgentClientLoop-FGUYNGSA.js → runAgentClientLoop-EEC3BHWI.js} +44 -47
- package/{setDialogExtraReferencesAction-OMTEO7X6.js → setDialogExtraReferencesAction-ZIDAVJSZ.js} +8 -9
- package/{setPrimaryDialogAgentAction-DOCIS6V4.js → setPrimaryDialogAgentAction-LK35C2D7.js} +12 -13
- package/{settingSlice-UWZJYDOA.js → settingSlice-PRRC6IJ7.js} +6 -7
- package/{skillDiscovery-UGSQGX2U.js → skillDiscovery-ZYHSX7VD.js} +3 -3
- package/{spaceCommands-S3EB6TOS.js → spaceCommands-XE4PS24W.js} +35 -28
- package/{spaceSlice-RG2GSV7K.js → spaceSlice-OE57MB22.js} +20 -23
- package/{streamAgentChatTurn-X576C23M.js → streamAgentChatTurn-CI6VMD2Y.js} +94 -87
- package/{toolApiClient-C7P7YSE4.js → toolApiClient-QI3YBNWB.js} +2 -2
- package/{tools-HURZ2N4O.js → tools-I5VPDJHG.js} +31 -34
- package/{tuiSummaryLlmCaller-DG2LBTBX.js → tuiSummaryLlmCaller-TXLF4MEI.js} +3 -3
- package/{updateDialogTitleAction-62LVIAUZ.js → updateDialogTitleAction-BKXHTAYL.js} +27 -29
- package/chunk-5MMAK75Q.js +0 -15
- package/chunk-AZPCASRE.js +0 -36
- package/chunk-IOQIOZNI.js +0 -42
- package/chunk-UAD2WT54.js +0 -64
- package/{agentPullCommand-N6UWRTVL.js → agentPullCommand-LHFBA5EI.js} +6 -6
- package/{chunk-JK7VW2FN.js → chunk-5MIDPSSK.js} +3 -3
- package/{chunk-VC6OZXO5.js → chunk-6WWHKODG.js} +4 -4
- package/{chunk-BT37DVDA.js → chunk-7VKWMOSI.js} +9 -9
- package/{chunk-3QAF2LTL.js → chunk-DZ3XJVET.js} +3 -3
- package/{chunk-5CS33IBL.js → chunk-PDL2AV3E.js} +3 -3
- package/{chunk-5MMZUWSG.js → chunk-TOILAPLH.js} +5 -5
- package/{chunk-3HPUUWOR.js → chunk-TSKWE74T.js} +3 -3
- package/{chunk-DVRHHFEA.js → chunk-TSUJOM6N.js} +3 -3
- package/{db-6QED3ZVO.js → db-HCJ5PRB5.js} +3 -3
- package/{memoryCommands-HG4WKTU7.js → memoryCommands-HGNEENIN.js} +3 -3
- package/{offlineMarxistsAgentCommand-BCPJITJL.js → offlineMarxistsAgentCommand-5OOWZLJI.js} +3 -3
- package/{runtimeDoctorCommands-UWR5UDSM.js → runtimeDoctorCommands-4YVMXBQP.js} +5 -5
- package/{tableCommands-M3DJUETS.js → tableCommands-LV2PPHNY.js} +6 -6
- package/{understanding-ZOESBLF3.js → understanding-3CUQQ6SV.js} +3 -3
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
refreshAntigravityOAuthToken,
|
|
4
4
|
refreshOpenAiCodexToken,
|
|
5
5
|
refreshXaiOAuthToken
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TOILAPLH.js";
|
|
7
7
|
import {
|
|
8
8
|
CliProviderQuotaError,
|
|
9
9
|
executeCli
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
buildLocalAgentLookupKeys,
|
|
13
13
|
normalizeAgentHandle,
|
|
14
14
|
shouldReadAgentKeyRemotely
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SCBYSC74.js";
|
|
16
16
|
import {
|
|
17
17
|
LOCAL_CODEX_AGENT_ID,
|
|
18
18
|
LOCAL_CODEX_AGENT_KEY,
|
|
@@ -21,38 +21,42 @@ import {
|
|
|
21
21
|
} from "./chunk-VHBWHNVT.js";
|
|
22
22
|
import {
|
|
23
23
|
inferCaptureIntent
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-WZF7M6GX.js";
|
|
25
25
|
import {
|
|
26
26
|
buildCliPrompt
|
|
27
27
|
} from "./chunk-ATNTHIZI.js";
|
|
28
28
|
import {
|
|
29
29
|
prepareTools
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-5EUAXXSV.js";
|
|
31
31
|
import {
|
|
32
32
|
getAntigravityUserAgent,
|
|
33
33
|
isAntigravityOAuthAgent,
|
|
34
34
|
readAntigravityProjectId,
|
|
35
35
|
resolveAntigravityCloudCodeBaseUrl
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-4GBNEA5B.js";
|
|
37
37
|
import {
|
|
38
38
|
FORCED_TOOLS,
|
|
39
39
|
addDefaultLightWebToolsForConfiguredAgents,
|
|
40
|
+
appendEnabledPackPromptPatches,
|
|
40
41
|
applyDisabledTools,
|
|
41
42
|
expandEnabledPacks,
|
|
42
43
|
readXPostFunc,
|
|
43
44
|
readXPostFunctionSchema,
|
|
44
45
|
readXhsProfileFunc,
|
|
45
46
|
readXhsProfileFunctionSchema
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-Y7QCVJ73.js";
|
|
47
48
|
import {
|
|
48
49
|
normalizeDialogTitle
|
|
49
50
|
} from "./chunk-OWOHNGCN.js";
|
|
51
|
+
import {
|
|
52
|
+
prepareTokenUsageData
|
|
53
|
+
} from "./chunk-DW75SYWV.js";
|
|
50
54
|
import {
|
|
51
55
|
BUILTIN_TITLE_LLM_CONFIG
|
|
52
56
|
} from "./chunk-V2J635L5.js";
|
|
53
57
|
import {
|
|
54
58
|
fetchServerSyncedCredential
|
|
55
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-KRMH46UV.js";
|
|
56
60
|
import {
|
|
57
61
|
buildAgentRuntimeDialogWritePlan,
|
|
58
62
|
buildLocalWorkspaceOpenAiTools,
|
|
@@ -65,23 +69,24 @@ import {
|
|
|
65
69
|
parseSseDataLineJson,
|
|
66
70
|
readOpenAiCompatibleSseCompletion,
|
|
67
71
|
resolveOpenAiCompatibleProviderConfig
|
|
68
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-IG2EZS3N.js";
|
|
69
73
|
import {
|
|
70
74
|
buildPlatformChatCompletionRequest,
|
|
71
75
|
canUsePlatformChatProvider,
|
|
72
76
|
parsePlatformChatCompletionData,
|
|
73
77
|
parsePlatformChatCompletionResponse,
|
|
74
78
|
readSseDataValues,
|
|
79
|
+
resolveLegacyDeepSeekProxyChatFallback,
|
|
75
80
|
resolvePlatformChatProviderConfig,
|
|
76
81
|
shouldUsePlatformChatProvider
|
|
77
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-ZR4VHQ5D.js";
|
|
78
83
|
import {
|
|
79
84
|
resolveAgentRuntimeConfigFromRecord
|
|
80
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-NCGFB7NN.js";
|
|
81
86
|
import {
|
|
82
87
|
parseToolArgumentsJson,
|
|
83
88
|
summarizeToolArguments
|
|
84
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-LWYCA4ZT.js";
|
|
85
90
|
import {
|
|
86
91
|
buildLoadSkillExecutor,
|
|
87
92
|
buildNoloWorkspaceCliToolExecutors,
|
|
@@ -89,34 +94,22 @@ import {
|
|
|
89
94
|
canonicalizeToolNames,
|
|
90
95
|
parseNoloWorkspaceToolArguments,
|
|
91
96
|
resolveRuntimeToolSurfaceForAgent
|
|
92
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-6PXKSN2M.js";
|
|
93
98
|
import {
|
|
94
99
|
clipCompactText
|
|
95
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-GVQT3FIB.js";
|
|
96
101
|
import {
|
|
97
102
|
createFileCredentialBroker,
|
|
98
103
|
resolveCurrentRunRuntimeToolPolicy,
|
|
99
104
|
resolveLocalWorkspaceExecutorOptionsFromPolicy,
|
|
100
105
|
resolveRequestedRuntimeToolNames
|
|
101
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-PDL2AV3E.js";
|
|
102
107
|
import {
|
|
103
108
|
createOAuthTokenStore,
|
|
104
109
|
isTokenExpired,
|
|
105
110
|
readOAuthCredential,
|
|
106
111
|
resolveFreshAccessToken
|
|
107
112
|
} from "./chunk-JZPBVBIY.js";
|
|
108
|
-
import {
|
|
109
|
-
asRecordOrEmpty
|
|
110
|
-
} from "./chunk-KX6YBIHG.js";
|
|
111
|
-
import {
|
|
112
|
-
dialogMessageRange
|
|
113
|
-
} from "./chunk-O4BU24WZ.js";
|
|
114
|
-
import {
|
|
115
|
-
asTrimmedNonEmptyStringArray
|
|
116
|
-
} from "./chunk-I42VC5KR.js";
|
|
117
|
-
import {
|
|
118
|
-
asOptionalFiniteNumber
|
|
119
|
-
} from "./chunk-WWC7I6TA.js";
|
|
120
113
|
import {
|
|
121
114
|
checkStaleRun,
|
|
122
115
|
finalizeRunRecord,
|
|
@@ -124,6 +117,12 @@ import {
|
|
|
124
117
|
listRunRecords,
|
|
125
118
|
spawnLocalBackgroundRun
|
|
126
119
|
} from "./chunk-AMJ7LA5D.js";
|
|
120
|
+
import {
|
|
121
|
+
toErrorMessage
|
|
122
|
+
} from "./chunk-HNMXYYJR.js";
|
|
123
|
+
import {
|
|
124
|
+
getDefaultCliLocalRuntimeDb
|
|
125
|
+
} from "./chunk-H33743XH.js";
|
|
127
126
|
import {
|
|
128
127
|
isCompiledBinary,
|
|
129
128
|
parseUserIdFromAuthToken
|
|
@@ -132,11 +131,18 @@ import {
|
|
|
132
131
|
DEFAULT_NOLO_SERVER_URL
|
|
133
132
|
} from "./chunk-OLZBQWZU.js";
|
|
134
133
|
import {
|
|
135
|
-
|
|
136
|
-
} from "./chunk-
|
|
134
|
+
asRecordOrEmpty
|
|
135
|
+
} from "./chunk-KX6YBIHG.js";
|
|
137
136
|
import {
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
createTokenKey,
|
|
138
|
+
dialogMessageRange
|
|
139
|
+
} from "./chunk-O4BU24WZ.js";
|
|
140
|
+
import {
|
|
141
|
+
asTrimmedNonEmptyStringArray
|
|
142
|
+
} from "./chunk-I42VC5KR.js";
|
|
143
|
+
import {
|
|
144
|
+
asOptionalFiniteNumber
|
|
145
|
+
} from "./chunk-WWC7I6TA.js";
|
|
140
146
|
import {
|
|
141
147
|
BUILTIN_NOLO_AGENT_KEY,
|
|
142
148
|
PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
|
|
@@ -144,13 +150,13 @@ import {
|
|
|
144
150
|
PUBLIC_GLM_52_AGENT_KEY,
|
|
145
151
|
PUBLIC_KIMI_K26_IMAGE_AGENT_KEY,
|
|
146
152
|
PUBLIC_KIMI_K27_CODING_AGENT_KEY
|
|
147
|
-
} from "./chunk-
|
|
148
|
-
import {
|
|
149
|
-
asTrimmedString
|
|
150
|
-
} from "./chunk-3EUW3WEO.js";
|
|
153
|
+
} from "./chunk-XHQWJUW4.js";
|
|
151
154
|
import {
|
|
152
155
|
isRecord
|
|
153
156
|
} from "./chunk-KUG52IAP.js";
|
|
157
|
+
import {
|
|
158
|
+
asTrimmedString
|
|
159
|
+
} from "./chunk-3EUW3WEO.js";
|
|
154
160
|
import {
|
|
155
161
|
NOLO_CLUSTER_SERVERS
|
|
156
162
|
} from "./chunk-LCBAMY2M.js";
|
|
@@ -8327,9 +8333,26 @@ function resolveCliEffectiveEnabledPacks(args) {
|
|
|
8327
8333
|
}
|
|
8328
8334
|
const base = args.enabledPacks ?? [];
|
|
8329
8335
|
if (base.length === 0) {
|
|
8330
|
-
return ["code", "agent-orchestration"];
|
|
8336
|
+
return ["code", "agent-orchestration", "skills"];
|
|
8331
8337
|
}
|
|
8332
|
-
|
|
8338
|
+
const withOrchestration = base.includes("agent-orchestration") ? base : [...base, "agent-orchestration"];
|
|
8339
|
+
return withOrchestration.includes("skills") ? withOrchestration : [...withOrchestration, "skills"];
|
|
8340
|
+
}
|
|
8341
|
+
function withRuntimeEnabledPacksAndPrompt(config) {
|
|
8342
|
+
const rawRecord = config.rawRecord ?? {};
|
|
8343
|
+
const enabledPacks = config.enabledPacks ?? rawRecord.enabledPacks;
|
|
8344
|
+
const prompt = appendEnabledPackPromptPatches(
|
|
8345
|
+
config.prompt,
|
|
8346
|
+
enabledPacks
|
|
8347
|
+
);
|
|
8348
|
+
if (prompt === config.prompt && !enabledPacks?.length) {
|
|
8349
|
+
return config;
|
|
8350
|
+
}
|
|
8351
|
+
return {
|
|
8352
|
+
...config,
|
|
8353
|
+
...enabledPacks?.length ? { enabledPacks } : {},
|
|
8354
|
+
...prompt ? { prompt } : {}
|
|
8355
|
+
};
|
|
8333
8356
|
}
|
|
8334
8357
|
function resolveCliRequestedToolNames(agentConfig, env) {
|
|
8335
8358
|
const declaredOnly = shouldUseDeclaredOnlyLocalWorkspaceTools(env);
|
|
@@ -8641,6 +8664,33 @@ function createLocalDialogTitleGenerator(deps, ctx) {
|
|
|
8641
8664
|
return result.source === "llm" ? result.title : null;
|
|
8642
8665
|
};
|
|
8643
8666
|
}
|
|
8667
|
+
async function writeLocalTokenRecord(args) {
|
|
8668
|
+
const rawUsage = args.input.result.usage;
|
|
8669
|
+
if (!rawUsage || typeof rawUsage !== "object" || Object.keys(rawUsage).length === 0) {
|
|
8670
|
+
return;
|
|
8671
|
+
}
|
|
8672
|
+
const timestamp = args.now();
|
|
8673
|
+
const prepared = prepareTokenUsageData({
|
|
8674
|
+
rawUsage,
|
|
8675
|
+
agentConfig: {
|
|
8676
|
+
model: args.input.result.model || "unknown",
|
|
8677
|
+
provider: args.input.result.provider,
|
|
8678
|
+
apiSource: "cli"
|
|
8679
|
+
},
|
|
8680
|
+
userId: args.userId,
|
|
8681
|
+
agentId: args.input.agentKey,
|
|
8682
|
+
dialogId: args.dialogId,
|
|
8683
|
+
timestamp,
|
|
8684
|
+
entry_path: "cli-local"
|
|
8685
|
+
});
|
|
8686
|
+
const recordKey = createTokenKey.record(args.userId, timestamp);
|
|
8687
|
+
const tokenRecord = {
|
|
8688
|
+
id: args.createId(),
|
|
8689
|
+
type: "token",
|
|
8690
|
+
...prepared.tokenData
|
|
8691
|
+
};
|
|
8692
|
+
await args.store.write(recordKey, tokenRecord);
|
|
8693
|
+
}
|
|
8644
8694
|
async function writeDialog(args) {
|
|
8645
8695
|
let existingDialog = null;
|
|
8646
8696
|
if (args.input.continueDialogId) {
|
|
@@ -8674,6 +8724,22 @@ async function writeDialog(args) {
|
|
|
8674
8724
|
...titleOverride ? { titleOverride } : {}
|
|
8675
8725
|
});
|
|
8676
8726
|
await args.store.batch(plan.ops);
|
|
8727
|
+
try {
|
|
8728
|
+
await writeLocalTokenRecord({
|
|
8729
|
+
store: args.store,
|
|
8730
|
+
input: args.input,
|
|
8731
|
+
userId: args.userId,
|
|
8732
|
+
dialogId: plan.dialogId,
|
|
8733
|
+
now: args.now,
|
|
8734
|
+
createId: args.createId,
|
|
8735
|
+
output: args.output
|
|
8736
|
+
});
|
|
8737
|
+
} catch (error) {
|
|
8738
|
+
args.output?.write(
|
|
8739
|
+
`[nolo] Token usage record write failed (non-fatal): ${toErrorMessage(error)}
|
|
8740
|
+
`
|
|
8741
|
+
);
|
|
8742
|
+
}
|
|
8677
8743
|
const hasSubjectRefs = localTurnHasSubjectRefs(args.input);
|
|
8678
8744
|
const isLocalUser = args.userId === "local";
|
|
8679
8745
|
if (!isLocalUser) {
|
|
@@ -8707,6 +8773,42 @@ async function writeDialog(args) {
|
|
|
8707
8773
|
}
|
|
8708
8774
|
return { dialogId: plan.dialogId };
|
|
8709
8775
|
}
|
|
8776
|
+
function resolveCliDialogRecordKey(userId, dialogId) {
|
|
8777
|
+
if (dialogId.startsWith("dialog-") && !dialogId.includes("-msg-")) {
|
|
8778
|
+
return dialogId;
|
|
8779
|
+
}
|
|
8780
|
+
return `dialog-${userId}-${dialogId}`;
|
|
8781
|
+
}
|
|
8782
|
+
async function loadCliDialogSummary(args) {
|
|
8783
|
+
const dialogKey = resolveCliDialogRecordKey(args.userId, args.dialogId);
|
|
8784
|
+
const record = await args.store.read(dialogKey);
|
|
8785
|
+
if (!record || typeof record !== "object") return null;
|
|
8786
|
+
const summary = typeof record.summary === "string" ? record.summary.trim() : "";
|
|
8787
|
+
if (!summary) return null;
|
|
8788
|
+
const summarizedBeforeId = record.summarizedBeforeId;
|
|
8789
|
+
return {
|
|
8790
|
+
summary,
|
|
8791
|
+
...typeof summarizedBeforeId === "string" && summarizedBeforeId ? { summarizedBeforeId } : {}
|
|
8792
|
+
};
|
|
8793
|
+
}
|
|
8794
|
+
async function saveCliDialogSummary(args) {
|
|
8795
|
+
const dialogKey = resolveCliDialogRecordKey(args.userId, args.dialogId);
|
|
8796
|
+
const existing = await args.store.read(dialogKey) ?? {};
|
|
8797
|
+
const bareId = typeof existing.id === "string" && existing.id ? existing.id : args.dialogId.startsWith("dialog-") ? args.dialogId.slice(args.dialogId.lastIndexOf("-") + 1) : args.dialogId;
|
|
8798
|
+
const compressionCount = typeof existing.compressionCount === "number" ? existing.compressionCount + 1 : 1;
|
|
8799
|
+
await args.store.write(dialogKey, {
|
|
8800
|
+
...existing,
|
|
8801
|
+
id: bareId,
|
|
8802
|
+
dbKey: dialogKey,
|
|
8803
|
+
type: "dialog",
|
|
8804
|
+
userId: args.userId,
|
|
8805
|
+
summary: args.summary,
|
|
8806
|
+
...args.summarizedBeforeId !== void 0 ? { summarizedBeforeId: args.summarizedBeforeId } : {},
|
|
8807
|
+
compressionCount,
|
|
8808
|
+
summaryPending: false,
|
|
8809
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
8810
|
+
});
|
|
8811
|
+
}
|
|
8710
8812
|
function createCliLocalRuntimeAdapter(deps) {
|
|
8711
8813
|
const now = deps.now ?? Date.now;
|
|
8712
8814
|
const createId = deps.createId ?? createFallbackId;
|
|
@@ -8760,10 +8862,11 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
8760
8862
|
userId
|
|
8761
8863
|
});
|
|
8762
8864
|
const fallbackLocalCliAgentConfig = storedAgentConfig ? null : resolveBuiltinLocalCliAgentConfig(agentRef, userId);
|
|
8763
|
-
const
|
|
8865
|
+
const baseAgentConfig = withResolvedRuntimeToolSurface(
|
|
8764
8866
|
storedAgentConfig ?? fallbackLocalCliAgentConfig,
|
|
8765
8867
|
deps.env
|
|
8766
8868
|
);
|
|
8869
|
+
const agentConfig = baseAgentConfig ? withRuntimeEnabledPacksAndPrompt(baseAgentConfig) : baseAgentConfig;
|
|
8767
8870
|
const requestedToolNames = agentConfig ? resolveCliRequestedToolNames(agentConfig, deps.env) : [];
|
|
8768
8871
|
activeAgentToolNames = buildLocalPolicyToolNames({
|
|
8769
8872
|
agentKey: agentConfig?.key,
|
|
@@ -8800,6 +8903,18 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
8800
8903
|
dialogId,
|
|
8801
8904
|
store: await getOrCreateSharedStore(deps)
|
|
8802
8905
|
}),
|
|
8906
|
+
loadDialogSummary: async (dialogId) => loadCliDialogSummary({
|
|
8907
|
+
store: await getOrCreateSharedStore(deps),
|
|
8908
|
+
userId,
|
|
8909
|
+
dialogId
|
|
8910
|
+
}),
|
|
8911
|
+
saveDialogSummary: async (input) => saveCliDialogSummary({
|
|
8912
|
+
store: await getOrCreateSharedStore(deps),
|
|
8913
|
+
userId,
|
|
8914
|
+
dialogId: input.dialogId,
|
|
8915
|
+
summary: input.summary,
|
|
8916
|
+
summarizedBeforeId: input.summarizedBeforeId
|
|
8917
|
+
}),
|
|
8803
8918
|
saveTurn: async (input) => writeDialog({
|
|
8804
8919
|
store: await getOrCreateSharedStore(deps),
|
|
8805
8920
|
input,
|
|
@@ -9135,7 +9250,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
9135
9250
|
openAiToolNames: summarizeOpenAiToolNames(tools2),
|
|
9136
9251
|
stream
|
|
9137
9252
|
});
|
|
9138
|
-
|
|
9253
|
+
let res = await fetchWithTransientRetry(
|
|
9139
9254
|
fetchImpl,
|
|
9140
9255
|
request.url,
|
|
9141
9256
|
{
|
|
@@ -9146,8 +9261,44 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
9146
9261
|
loopbackRequest
|
|
9147
9262
|
}
|
|
9148
9263
|
);
|
|
9264
|
+
let responseProviderConfig = providerConfig2;
|
|
9265
|
+
let firstErrorRaw;
|
|
9149
9266
|
if (!res.ok) {
|
|
9150
|
-
|
|
9267
|
+
firstErrorRaw = await res.text().catch(() => "");
|
|
9268
|
+
const fallbackProviderConfig = resolveLegacyDeepSeekProxyChatFallback({
|
|
9269
|
+
providerConfig: providerConfig2,
|
|
9270
|
+
status: res.status,
|
|
9271
|
+
raw: firstErrorRaw
|
|
9272
|
+
});
|
|
9273
|
+
if (fallbackProviderConfig) {
|
|
9274
|
+
responseProviderConfig = fallbackProviderConfig;
|
|
9275
|
+
const fallbackRequest = buildPlatformChatCompletionRequest({
|
|
9276
|
+
providerConfig: fallbackProviderConfig,
|
|
9277
|
+
messages,
|
|
9278
|
+
tools: tools2,
|
|
9279
|
+
stream: false
|
|
9280
|
+
});
|
|
9281
|
+
logLocalRuntimeDiagnostic("provider.request.compatibility-fallback", {
|
|
9282
|
+
agentKey: agentConfig.key,
|
|
9283
|
+
provider: providerConfig2.provider,
|
|
9284
|
+
fromEndpoint: summarizeEndpoint(providerConfig2.endpoint) ?? null,
|
|
9285
|
+
toEndpoint: summarizeEndpoint(fallbackProviderConfig.endpoint) ?? null,
|
|
9286
|
+
reason: "legacy-proxy-responses-schema"
|
|
9287
|
+
});
|
|
9288
|
+
res = await fetchWithTransientRetry(
|
|
9289
|
+
fetchImpl,
|
|
9290
|
+
fallbackRequest.url,
|
|
9291
|
+
{ ...fallbackRequest.init },
|
|
9292
|
+
{
|
|
9293
|
+
sleep: deps.sleep,
|
|
9294
|
+
loopbackRequest
|
|
9295
|
+
}
|
|
9296
|
+
);
|
|
9297
|
+
firstErrorRaw = void 0;
|
|
9298
|
+
}
|
|
9299
|
+
}
|
|
9300
|
+
if (!res.ok) {
|
|
9301
|
+
const raw2 = firstErrorRaw ?? await res.text().catch(() => "");
|
|
9151
9302
|
const data2 = parsePlatformChatCompletionData(raw2);
|
|
9152
9303
|
const rawPreview = raw2.length > 200 ? `${raw2.slice(0, 200)}\u2026(${raw2.length}b)` : raw2;
|
|
9153
9304
|
const gatewayHeaders = [
|
|
@@ -9198,7 +9349,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
9198
9349
|
});
|
|
9199
9350
|
const data = parsePlatformChatCompletionData(raw);
|
|
9200
9351
|
return parsePlatformChatCompletionResponse({
|
|
9201
|
-
providerConfig:
|
|
9352
|
+
providerConfig: responseProviderConfig,
|
|
9202
9353
|
data,
|
|
9203
9354
|
trace: messages
|
|
9204
9355
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listUserRecordsFromServers,
|
|
3
3
|
readLiveDbRecordAfterTombstoneMerge
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WKWEV6K4.js";
|
|
5
5
|
import {
|
|
6
6
|
agentRecordHasConfiguredCredential
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MMCDCZM4.js";
|
|
8
8
|
|
|
9
9
|
// packages/cli/agentListHelpers.ts
|
|
10
10
|
function parseAgentRecordId(privateKey, explicitId) {
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5LDYVJXY.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
readPipeText,
|
|
10
|
-
spawnProcess
|
|
11
|
-
} from "./chunk-IDZTNRP2.js";
|
|
7
|
+
} from "./chunk-Y7QCVJ73.js";
|
|
12
8
|
import {
|
|
13
9
|
runLocalAgentTurn
|
|
14
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LWYCA4ZT.js";
|
|
15
11
|
import {
|
|
16
12
|
resolveLocalRuntimeEnvFromPolicy
|
|
17
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-PDL2AV3E.js";
|
|
18
14
|
import {
|
|
19
|
-
|
|
20
|
-
} from "./chunk-
|
|
15
|
+
toErrorMessage
|
|
16
|
+
} from "./chunk-HNMXYYJR.js";
|
|
21
17
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
readPipeText,
|
|
19
|
+
spawnProcess
|
|
20
|
+
} from "./chunk-IDZTNRP2.js";
|
|
24
21
|
import {
|
|
25
22
|
parseUserIdFromAuthToken
|
|
26
23
|
} from "./chunk-AVMJVOQY.js";
|
|
@@ -28,17 +25,20 @@ import {
|
|
|
28
25
|
DEFAULT_NOLO_SERVER_URL
|
|
29
26
|
} from "./chunk-OLZBQWZU.js";
|
|
30
27
|
import {
|
|
31
|
-
|
|
32
|
-
} from "./chunk-
|
|
28
|
+
asRecordOrEmpty
|
|
29
|
+
} from "./chunk-KX6YBIHG.js";
|
|
30
|
+
import {
|
|
31
|
+
asTrimmedNonEmptyStringArray
|
|
32
|
+
} from "./chunk-I42VC5KR.js";
|
|
33
|
+
import {
|
|
34
|
+
isRecord
|
|
35
|
+
} from "./chunk-KUG52IAP.js";
|
|
33
36
|
import {
|
|
34
37
|
asTrimmedString
|
|
35
38
|
} from "./chunk-3EUW3WEO.js";
|
|
36
39
|
import {
|
|
37
40
|
asOptionalPositiveFiniteNumber
|
|
38
41
|
} from "./chunk-U6VC4MU4.js";
|
|
39
|
-
import {
|
|
40
|
-
isRecord
|
|
41
|
-
} from "./chunk-KUG52IAP.js";
|
|
42
42
|
import {
|
|
43
43
|
asOptionalTrimmedString
|
|
44
44
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -889,7 +889,7 @@ function buildLoadSkillExecutor(args) {
|
|
|
889
889
|
metadata: { loadSkill: true, resolved: false }
|
|
890
890
|
};
|
|
891
891
|
}
|
|
892
|
-
const { resolveSkillByName } = await import("./skillDiscovery-
|
|
892
|
+
const { resolveSkillByName } = await import("./skillDiscovery-ZYHSX7VD.js");
|
|
893
893
|
const resolved = resolveSkillByName(args.cwd, name);
|
|
894
894
|
if (!resolved) {
|
|
895
895
|
return {
|
|
@@ -916,7 +916,7 @@ ${body}`,
|
|
|
916
916
|
};
|
|
917
917
|
}
|
|
918
918
|
async function formatUnknownSkillMessage(cwd, requestedName) {
|
|
919
|
-
const { discoverSkills } = await import("./skillDiscovery-
|
|
919
|
+
const { discoverSkills } = await import("./skillDiscovery-ZYHSX7VD.js");
|
|
920
920
|
let available = [];
|
|
921
921
|
try {
|
|
922
922
|
available = discoverSkills(cwd).map((s) => s.name);
|