nolo-cli 0.38.0-alpha.2 → 0.47.0-alpha.1
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-2S6HNTBF.js → _executeModel-JWAASOOT.js} +43 -45
- package/{action-KMBZ3LCZ.js → action-FLLC2SIX.js} +7 -7
- package/{addContentAction-KQ44UT2U.js → addContentAction-SVSPUUK4.js} +6 -6
- package/{addDialogAgentAction-ILSDCMYL.js → addDialogAgentAction-W3JGU4F7.js} +5 -5
- package/{agentDeleteCommand-6XYC7JVL.js → agentDeleteCommand-QL7TF5F2.js} +26 -27
- package/{agentEmailCommands-NGL5B3UC.js → agentEmailCommands-AC3XQM53.js} +57 -59
- package/{agentListCommands-R7TKN3DL.js → agentListCommands-4YMFHDU6.js} +33 -31
- package/{agentMachineCommands-AXOO4OKN.js → agentMachineCommands-MFQKYUV4.js} +25 -26
- package/{agentPullCommand-TSWAJPS2.js → agentPullCommand-M552CYSI.js} +2 -2
- package/{agentRecordCommands-GJHH5GYI.js → agentRecordCommands-QG3YBSTQ.js} +53 -55
- package/{agentRunCommand-4MEMHFT5.js → agentRunCommand-B4PGT36L.js} +56 -58
- package/{agentRunControl-7MUPSYDQ.js → agentRunControl-LHXOP4IU.js} +43 -1
- package/{agentRuntimeLocal-CPEWDR3Z.js → agentRuntimeLocal-V2UKJPNE.js} +21 -22
- package/{agentSlice-LAILHBMM.js → agentSlice-B5O3RTRP.js} +6 -6
- package/{agentSuperviseCommands-MKWW3ICX.js → agentSuperviseCommands-IMRZ56RC.js} +2 -2
- package/{appDeleteCommands-6SYOAMTR.js → appDeleteCommands-BQCRRHOM.js} +25 -26
- package/{appDeployCommands-ZNMFUV2K.js → appDeployCommands-UMJ67TUR.js} +25 -26
- package/{appDeployStatusCommands-G5FIZT64.js → appDeployStatusCommands-KASPUR4V.js} +25 -26
- package/{appGetCommands-4RIFLLZZ.js → appGetCommands-FFT2LTGF.js} +25 -26
- package/{appListCommands-DK2JJ65T.js → appListCommands-TAVWFRZZ.js} +25 -26
- package/{authCommand-B2XRHNJH.js → authCommand-OY2E2VQK.js} +12 -12
- package/{authCommands-GWABTFMR.js → authCommands-SBQVTD6V.js} +5 -5
- package/{chatQueueReduxAdapter-DQWFZYNL.js → chatQueueReduxAdapter-OVDKLHLD.js} +20 -20
- package/chunk-25J3BB35.js +6041 -0
- package/chunk-2BWU4ORW.js +2574 -0
- package/{chunk-U6QQLXWI.js → chunk-2X5S4IBZ.js} +1 -1
- package/{chunk-MJWX4JQO.js → chunk-3EEK7T3D.js} +1 -1
- package/{chunk-UNHKVD2N.js → chunk-43CXXVJD.js} +1 -1
- package/{chunk-WRP5TTM6.js → chunk-4MXGXSYN.js} +83 -3
- package/{chunk-2KO5QQFV.js → chunk-5IQX2XPA.js} +2 -2
- package/{chunk-ARFXKWJH.js → chunk-5PFBRLJN.js} +157 -51
- package/{chunk-W445DPVT.js → chunk-5QRCPERU.js} +1 -1
- package/{chunk-GKHV4UH5.js → chunk-5UOBIU5G.js} +31 -3
- package/{chunk-BMB563Y6.js → chunk-6BYAXNH5.js} +3 -3
- package/{chunk-SMPAUSX5.js → chunk-6FGXGFAH.js} +2 -2
- package/{chunk-6XIE5ZGI.js → chunk-6HIGYUBQ.js} +1 -1
- package/{chunk-NT3QRCVS.js → chunk-7US2USK7.js} +7 -7
- package/{chunk-FTM4KUOZ.js → chunk-7XTC3KRG.js} +1 -1
- package/{chunk-IMHO5LC6.js → chunk-7XZ5GXSN.js} +1 -1
- package/{chunk-E2OQ5N2F.js → chunk-AEXP2UZT.js} +341 -16
- package/{chunk-MZZZYUZS.js → chunk-AV2CELZZ.js} +37 -12
- package/{chunk-JI2TIPLP.js → chunk-AYXSUBVC.js} +1 -1
- package/{chunk-KR74XLMV.js → chunk-BIMCW2CC.js} +3 -3
- package/{chunk-GEGSCLZZ.js → chunk-C5UWCCLI.js} +3 -3
- package/{chunk-J6WH4PYZ.js → chunk-CIF4X6ZM.js} +1 -1
- package/{chunk-LZZQTQPY.js → chunk-CTXR4SRT.js} +3 -3
- package/{chunk-GZRMWK5R.js → chunk-DQLYEGP7.js} +2 -2
- package/{chunk-45NBTCS2.js → chunk-DROE55W3.js} +216 -48
- package/{chunk-GUYMR3JL.js → chunk-E2QH2AYX.js} +69 -3
- package/{chunk-B6H5XCT2.js → chunk-EMEUU5IY.js} +3 -3
- package/{chunk-X6EN3KJX.js → chunk-ENYDQKOB.js} +319 -71
- package/{chunk-RCFIB45Q.js → chunk-EVBFYPDC.js} +2 -2
- package/{chunk-PV734VZX.js → chunk-EXLOROHG.js} +1 -1
- package/{chunk-KHCLMKZZ.js → chunk-EY7V7REW.js} +280 -6
- package/{chunk-WRN7L5CS.js → chunk-FA4SY4F5.js} +1 -1
- package/{chunk-IFS5CUEH.js → chunk-FJHLA6SX.js} +1 -1
- package/{chunk-D72M3G32.js → chunk-FM6ZGNMV.js} +12 -12
- package/{chunk-T2BZICLK.js → chunk-G46DB6KG.js} +49 -6
- package/{chunk-FGLKRJDI.js → chunk-GK74OOFT.js} +2 -2
- package/{chunk-LM6IYQ3F.js → chunk-GLKOYSRU.js} +8 -1
- package/{chunk-YNAGAUJT.js → chunk-GYSVYO35.js} +61 -49
- package/{chunk-JIADXJYU.js → chunk-H2G6JXTR.js} +1 -1
- package/{chunk-MGIHZ5CJ.js → chunk-HAPCUPEO.js} +2 -2
- package/{chunk-LD6Y6RJY.js → chunk-HGDOIDQ4.js} +2 -2
- package/{chunk-IZNJDUJ4.js → chunk-I4JISVWK.js} +1 -1
- package/{chunk-N4XRDM26.js → chunk-IA3A5373.js} +2 -2
- package/{chunk-X2K2JSO4.js → chunk-IWUMSAQF.js} +5 -1
- package/{chunk-GEPHJJW4.js → chunk-L7NG2M6H.js} +1 -1
- package/{chunk-XQES6LXQ.js → chunk-LFLWZX76.js} +2 -2
- package/{chunk-IIOHYLIG.js → chunk-LGUQHYAL.js} +1 -1
- package/{chunk-4AWH4LQA.js → chunk-LYGNQHUW.js} +3 -1
- package/{db-3H3JECGY.js → chunk-M5PVFLD4.js} +11 -158
- package/{chunk-WN5AJG5I.js → chunk-MKZRKDQM.js} +1 -1
- package/{chunk-V5GA74HI.js → chunk-MZXZJVVD.js} +20 -39
- package/{chunk-EJAL5LSG.js → chunk-NC3CSWVT.js} +2 -2
- package/{chunk-6XG52ZQ6.js → chunk-NI2BS6UD.js} +22 -3
- package/{chunk-FXZBSLFK.js → chunk-NSQNNYGW.js} +20 -51
- package/{chunk-VOXNBPLB.js → chunk-OFSVXPQS.js} +651 -43
- package/{chunk-ZBB3MZR3.js → chunk-OLNC7AWK.js} +7 -4
- package/{chunk-J5NMOM35.js → chunk-OYNDYVSE.js} +1 -1
- package/{chunk-C6ELZQ7H.js → chunk-OZVGA4SY.js} +1 -1
- package/{chunk-K4KIFRIN.js → chunk-Q24S4NDF.js} +1 -1
- package/{chunk-HRSIJO5A.js → chunk-RNNAJ34U.js} +1 -1
- package/{chunk-JK7UM3LT.js → chunk-SEIOEDBB.js} +110 -49
- package/{chunk-2WKUUY2E.js → chunk-SVEUG45B.js} +5 -3
- package/{chunk-IZCHPD7T.js → chunk-TNPCQNGQ.js} +11 -6
- package/{chunk-4DMPISV6.js → chunk-URBGEE42.js} +2 -2
- package/{chunk-23KKIMD5.js → chunk-WVGEBWA6.js} +4 -4
- package/{chunk-TH7ZZKPJ.js → chunk-XIRSTDYF.js} +275 -134
- package/{chunk-64KIQZA2.js → chunk-XO3G35OV.js} +1 -1
- package/{chunk-CVXDBLYH.js → chunk-XOFZEJGM.js} +5 -5
- package/{chunk-XT73C4VH.js → chunk-Z5NW3O7V.js} +1 -1
- package/{codingSkills-H6N5EKSX.js → codingSkills-QLDAXJRA.js} +3 -4
- package/{cooldownCommands-C2SZLEEO.js → cooldownCommands-GI5NNWGL.js} +5 -3
- package/{createAgentAutomationAction-767ZITQJ.js → createAgentAutomationAction-TQ7PYONU.js} +21 -21
- package/{createDialogAction-H75NDXYH.js → createDialogAction-EOQFCM3K.js} +24 -25
- package/{createPageAction-KYJYZPLC.js → createPageAction-ZG5PH6BI.js} +22 -23
- package/db-VQSAOWAO.js +162 -0
- package/{dbSlice-PIQGICNM.js → dbSlice-XWUM4QOF.js} +5 -5
- package/deleteFile-NPZ64DFN.js +1 -1
- package/{dialogCommands-SSQLOBRU.js → dialogCommands-DCGMVLBA.js} +29 -27
- package/{dialogSlice-YJV3AVFM.js → dialogSlice-YHGPDBAZ.js} +20 -20
- package/{docCreateCommands-WYP6MQ56.js → docCreateCommands-A2LVLROP.js} +26 -28
- package/{docDeleteCommands-6YNU4LZ7.js → docDeleteCommands-ENMROKH6.js} +27 -29
- package/{docReadCommands-PFJMIPYU.js → docReadCommands-XSRUV4EM.js} +26 -28
- package/{docStore-JOODSWDW.js → docStore-WIKRGVQJ.js} +22 -22
- package/{docUpdateCommands-KAP6JSGT.js → docUpdateCommands-5B5NBORA.js} +26 -28
- package/{fetchMessages-CUEFN4GQ.js → fetchMessages-KZQVBXKY.js} +3 -3
- package/{getPricing-P3E2WRIH.js → getPricing-X3HXP6VQ.js} +3 -3
- package/{handleSendMessageAction-DGL6H4E4.js → handleSendMessageAction-WT4FDMQS.js} +21 -21
- package/index.js +70 -70
- package/levelLazyShim-GZBKODGI.js +7 -0
- package/{localDialogRead-P7CHFMIC.js → localDialogRead-NQ33HBSI.js} +2 -2
- package/{localRuntimeAuthority-S77B5QVB.js → localRuntimeAuthority-KQDAE64E.js} +4 -4
- package/{localRuntimeDb-N3H3HQ7G.js → localRuntimeDb-PF7CFKDL.js} +2 -2
- package/{machineCommands-NAFWPMLI.js → machineCommands-BFLTBAK6.js} +51 -53
- package/{machineWsRunDispatch-EWA7J37I.js → machineWsRunDispatch-VCJB5LHO.js} +51 -53
- package/{models-L7S2EKPM.js → models-7LWATQFH.js} +2 -2
- package/package.json +1 -1
- package/{read-6C2XD3YZ.js → read-DQQ75VI3.js} +2 -2
- package/{readDocTool-Y7AB365O.js → readDocTool-HCQQFAZD.js} +1 -1
- package/{readlineWorkspace-BCQVDX4V.js → readlineWorkspace-VBJLMU6V.js} +5168 -5003
- package/{removeDialogAgentAction-KG5WMJRZ.js → removeDialogAgentAction-DNONRKST.js} +7 -7
- package/{runAgentClientLoop-B3TTKXIX.js → runAgentClientLoop-4QOEJOJP.js} +41 -42
- package/{runtimeDoctorCommands-HT4O2PXL.js → runtimeDoctorCommands-JKTTN723.js} +4 -4
- package/serverStoreFactory-YMXDF4NI.js +20 -0
- package/{setDialogExtraReferencesAction-O2NLXMSM.js → setDialogExtraReferencesAction-ERHUPT3F.js} +6 -6
- package/{setPrimaryDialogAgentAction-FYYUY7PB.js → setPrimaryDialogAgentAction-6C2HYNEC.js} +7 -7
- package/{settingSlice-GPLI6E3M.js → settingSlice-YVRJFKQX.js} +6 -6
- package/{skillDiscovery-COX56OBO.js → skillDiscovery-GPUDHDTZ.js} +1 -2
- package/{spaceCommands-VHOKUADK.js → spaceCommands-FBB7XSAW.js} +24 -25
- package/{spaceSlice-ZKUZSVYD.js → spaceSlice-YMDZ4G6H.js} +21 -21
- package/{streamAgentChatTurn-PLTB7RMV.js → streamAgentChatTurn-5NBWQHY6.js} +93 -52
- package/{switchDialogAgentAction-GH5P6Q3Z.js → switchDialogAgentAction-HP57XYFP.js} +5 -5
- package/{tools-KQXDW66A.js → tools-37H5A4OG.js} +34 -35
- package/{tuiSummaryLlmCaller-SHRB4RWM.js → tuiSummaryLlmCaller-NBTWT57U.js} +25 -14
- package/{updateDialogTitleAction-OTYEQJAK.js → updateDialogTitleAction-XAGMXHW5.js} +24 -23
- package/chunk-4APLX2RT.js +0 -1514
- package/chunk-AETZ7AD6.js +0 -274
- package/chunk-OFZPJ3NT.js +0 -114
- package/chunk-P66M7LSQ.js +0 -58
- package/{chunk-6WD3OOJS.js → chunk-UV6VISQJ.js} +0 -0
- package/{tableCommands-PQUJ55AS.js → tableCommands-P2TXJ3CF.js} +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateRunReport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7XZ5GXSN.js";
|
|
4
4
|
import {
|
|
5
5
|
buildLocalRunEnv,
|
|
6
6
|
isFullstackCodingAgentRef,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveRawAgentInput,
|
|
10
10
|
resolveServerUrl,
|
|
11
11
|
writeUsage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LYGNQHUW.js";
|
|
13
13
|
import {
|
|
14
14
|
agentRunCardLabels,
|
|
15
15
|
createCliLocalRuntimeAdapter,
|
|
@@ -20,15 +20,15 @@ import {
|
|
|
20
20
|
parseAgentRunEvent,
|
|
21
21
|
t,
|
|
22
22
|
toolLabel
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-XIRSTDYF.js";
|
|
24
24
|
import {
|
|
25
25
|
getReadableCliDb
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-43CXXVJD.js";
|
|
27
27
|
import {
|
|
28
28
|
normalizeAgentHandle,
|
|
29
29
|
readDbRecord,
|
|
30
30
|
resolveAgentRecordFromHybridStore
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-DQLYEGP7.js";
|
|
32
32
|
import {
|
|
33
33
|
NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
34
34
|
isLocalCliAgentKey
|
|
@@ -39,9 +39,11 @@ import {
|
|
|
39
39
|
import {
|
|
40
40
|
createRunActivityTracker,
|
|
41
41
|
finalizeRunRecord,
|
|
42
|
+
popSingleQueueMessage,
|
|
42
43
|
readRunRecord,
|
|
44
|
+
resolveRunQueuePath,
|
|
43
45
|
spawnLocalBackgroundRun
|
|
44
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-AEXP2UZT.js";
|
|
45
47
|
import {
|
|
46
48
|
resolveMachineId
|
|
47
49
|
} from "./chunk-ESHYE7WU.js";
|
|
@@ -51,7 +53,7 @@ import {
|
|
|
51
53
|
} from "./chunk-LTRXGFMS.js";
|
|
52
54
|
import {
|
|
53
55
|
formatAgentListCard
|
|
54
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-SEIOEDBB.js";
|
|
55
57
|
import {
|
|
56
58
|
isGatewayHttpStatus
|
|
57
59
|
} from "./chunk-RQSOAMPJ.js";
|
|
@@ -70,52 +72,53 @@ import {
|
|
|
70
72
|
chooseMemoryOwners,
|
|
71
73
|
loadMemoryCandidatesFromDb,
|
|
72
74
|
resolveAgentMemoryPolicy
|
|
73
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-7US2USK7.js";
|
|
74
76
|
import {
|
|
75
77
|
API_REPORTED_COST_MULTIPLIER,
|
|
76
78
|
normalizeUsage,
|
|
77
79
|
parseUiAskChoiceContent
|
|
78
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-5PFBRLJN.js";
|
|
79
81
|
import {
|
|
80
82
|
getDefaultCliLocalRuntimeDb
|
|
81
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-IA3A5373.js";
|
|
82
84
|
import {
|
|
83
85
|
buildSkillDiscoveryContextLayer
|
|
84
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-2BWU4ORW.js";
|
|
85
87
|
import {
|
|
86
88
|
parseExternalSkillMarkdown,
|
|
87
89
|
parseSkillDocProtocol
|
|
88
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-EY7V7REW.js";
|
|
89
91
|
import {
|
|
90
92
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
91
93
|
LOCAL_TURN_ABORTED_CODE,
|
|
92
94
|
readActionGate,
|
|
93
95
|
readCommandActionGatePayload
|
|
94
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-OFSVXPQS.js";
|
|
95
97
|
import {
|
|
96
98
|
resolveAgentRuntimeConfigFromRecord
|
|
97
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-XO3G35OV.js";
|
|
98
100
|
import {
|
|
99
101
|
createThinkParserState,
|
|
100
102
|
flushThinkParser,
|
|
101
103
|
processThinkChunk
|
|
102
104
|
} from "./chunk-N7J63Q6C.js";
|
|
103
105
|
import {
|
|
106
|
+
resolveClientVersion,
|
|
104
107
|
resolvePlatformAuthToken
|
|
105
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-5UOBIU5G.js";
|
|
106
109
|
import {
|
|
107
110
|
isQuotaExhaustedError
|
|
108
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-IWUMSAQF.js";
|
|
109
112
|
import {
|
|
110
113
|
DEFAULT_CONTEXT_WINDOW,
|
|
111
114
|
getModelContextWindow
|
|
112
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-4MXGXSYN.js";
|
|
113
116
|
import {
|
|
114
117
|
clipCompactText
|
|
115
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-GK74OOFT.js";
|
|
116
119
|
import {
|
|
117
120
|
findModelConfig
|
|
118
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-OZVGA4SY.js";
|
|
119
122
|
import {
|
|
120
123
|
compactWhitespace
|
|
121
124
|
} from "./chunk-DWLEOOGR.js";
|
|
@@ -136,12 +139,17 @@ import {
|
|
|
136
139
|
import {
|
|
137
140
|
resolveAuthToken
|
|
138
141
|
} from "./chunk-A7GB5UGH.js";
|
|
142
|
+
import {
|
|
143
|
+
CLIENT_VERSION_TOO_OLD_CODE,
|
|
144
|
+
NOLO_CLIENT_VERSION_HEADER,
|
|
145
|
+
buildClientVersionUpgradeMessage
|
|
146
|
+
} from "./chunk-ENYDQKOB.js";
|
|
139
147
|
import {
|
|
140
148
|
parsePositiveFiniteNumberOrFallback
|
|
141
149
|
} from "./chunk-Y5GCAMGP.js";
|
|
142
150
|
import {
|
|
143
151
|
createMemoryKey
|
|
144
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-SVEUG45B.js";
|
|
145
153
|
import {
|
|
146
154
|
asTrimmedLowercaseString
|
|
147
155
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -149,7 +157,7 @@ import {
|
|
|
149
157
|
BUILTIN_NOLO_AGENT_KEY,
|
|
150
158
|
BUILTIN_NOLO_AGENT_NAME,
|
|
151
159
|
builtinAgentCatalogEntryById
|
|
152
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-Z5NW3O7V.js";
|
|
153
161
|
import {
|
|
154
162
|
parsePublicAgentId
|
|
155
163
|
} from "./chunk-BJIRLHJR.js";
|
|
@@ -623,11 +631,26 @@ function applyTerminalOutputToText(existing, chunk) {
|
|
|
623
631
|
}
|
|
624
632
|
return text;
|
|
625
633
|
}
|
|
634
|
+
function resolveAmbiguousWidth(explicit, env = process.env) {
|
|
635
|
+
if (explicit === "wide" || explicit === "narrow") return explicit;
|
|
636
|
+
const raw = env.NOLO_TUI_AMBIGUOUS_WIDTH;
|
|
637
|
+
if (typeof raw === "string") {
|
|
638
|
+
const trimmed = raw.trim().toLowerCase();
|
|
639
|
+
if (trimmed === "wide") return "wide";
|
|
640
|
+
if (trimmed === "narrow") return "narrow";
|
|
641
|
+
}
|
|
642
|
+
return "narrow";
|
|
643
|
+
}
|
|
626
644
|
function isAmbiguousWideSymbolCode(code) {
|
|
627
645
|
return code >= 8592 && code <= 8597 || // ←↑→↓↔↕
|
|
628
646
|
code === 8656 || code === 8658 || code === 8660 || // ⇐⇒⇔
|
|
629
647
|
code === 215 || code === 247 || code === 177 || // ×÷±
|
|
630
|
-
code === 8226 || code === 183
|
|
648
|
+
code === 8226 || code === 183 || // • ·
|
|
649
|
+
code === 176 || code === 8451 || // ° ℃
|
|
650
|
+
code >= 8208 && code <= 8213 || // ‐‑‒–—―
|
|
651
|
+
code >= 9312 && code <= 9471 || // ①②④⑤ 圈数字/括号序号
|
|
652
|
+
code === 8986 || code === 8987 || // ⌚ ⌛
|
|
653
|
+
code >= 9193 && code <= 9210;
|
|
631
654
|
}
|
|
632
655
|
function isForceWideSymbolCode(code) {
|
|
633
656
|
return code >= 9728 && code <= 10175 && !(code >= 10088 && code <= 10101) || code >= 11008 && code <= 11263 || code >= 127744 && code <= 129791 || isAmbiguousWideSymbolCode(code);
|
|
@@ -635,14 +658,18 @@ function isForceWideSymbolCode(code) {
|
|
|
635
658
|
function isCjkQuoteCode(code) {
|
|
636
659
|
return code === 8220 || code === 8221 || code === 8216 || code === 8217;
|
|
637
660
|
}
|
|
638
|
-
function scanWidthNeeds(plain, locale) {
|
|
661
|
+
function scanWidthNeeds(plain, locale, ambiguousWidth) {
|
|
639
662
|
let hasNonAscii = false;
|
|
663
|
+
const isWideMode = ambiguousWidth === "wide";
|
|
640
664
|
for (let i = 0; i < plain.length; i++) {
|
|
641
665
|
const cc = plain.charCodeAt(i);
|
|
642
|
-
if (isAmbiguousWideSymbolCode(cc)) {
|
|
666
|
+
if (isWideMode && isAmbiguousWideSymbolCode(cc)) {
|
|
643
667
|
return { hasNonAscii: true, hasCandidate: true };
|
|
644
668
|
}
|
|
645
|
-
if (cc < 8192)
|
|
669
|
+
if (cc < 8192) {
|
|
670
|
+
if (cc >= 128) hasNonAscii = true;
|
|
671
|
+
continue;
|
|
672
|
+
}
|
|
646
673
|
hasNonAscii = true;
|
|
647
674
|
let code = cc;
|
|
648
675
|
if (cc >= 55296 && cc <= 56319 && i + 1 < plain.length) {
|
|
@@ -652,7 +679,9 @@ function scanWidthNeeds(plain, locale) {
|
|
|
652
679
|
i += 1;
|
|
653
680
|
}
|
|
654
681
|
}
|
|
655
|
-
|
|
682
|
+
const isSymbolCandidate = isWideMode && isForceWideSymbolCode(code);
|
|
683
|
+
const isQuoteCandidate = locale === "zh" && isCjkQuoteCode(code);
|
|
684
|
+
if (isSymbolCandidate || isQuoteCandidate) {
|
|
656
685
|
return { hasNonAscii: true, hasCandidate: true };
|
|
657
686
|
}
|
|
658
687
|
}
|
|
@@ -660,14 +689,14 @@ function scanWidthNeeds(plain, locale) {
|
|
|
660
689
|
}
|
|
661
690
|
var displayWidthCache = /* @__PURE__ */ new Map();
|
|
662
691
|
var DISPLAY_WIDTH_CACHE_MAX = 4096;
|
|
663
|
-
function displayWidth(str) {
|
|
692
|
+
function displayWidth(str, ambiguousWidth = resolveAmbiguousWidth()) {
|
|
664
693
|
const plain = stripAnsi2(str);
|
|
665
694
|
const locale = getCliLocale();
|
|
666
|
-
const needs = scanWidthNeeds(plain, locale);
|
|
695
|
+
const needs = scanWidthNeeds(plain, locale, ambiguousWidth);
|
|
667
696
|
if (!needs.hasNonAscii) {
|
|
668
697
|
return stringWidth(plain);
|
|
669
698
|
}
|
|
670
|
-
const key = locale + "\0" + plain;
|
|
699
|
+
const key = locale + "\0" + ambiguousWidth + "\0" + plain;
|
|
671
700
|
const cached = displayWidthCache.get(key);
|
|
672
701
|
if (cached !== void 0) return cached;
|
|
673
702
|
const base = stringWidth(plain);
|
|
@@ -680,9 +709,12 @@ function displayWidth(str) {
|
|
|
680
709
|
return base;
|
|
681
710
|
}
|
|
682
711
|
let width = base;
|
|
712
|
+
const isWideMode = ambiguousWidth === "wide";
|
|
683
713
|
for (const { segment } of graphemeSegmenter.segment(plain)) {
|
|
684
714
|
const code = segment.codePointAt(0) ?? 0;
|
|
685
|
-
|
|
715
|
+
const isSymbol = isWideMode && isForceWideSymbolCode(code);
|
|
716
|
+
const isQuote = locale === "zh" && isCjkQuoteCode(code);
|
|
717
|
+
if (isSymbol || isQuote) {
|
|
686
718
|
if (stringWidth(segment) === 1) width += 1;
|
|
687
719
|
}
|
|
688
720
|
}
|
|
@@ -2377,7 +2409,7 @@ function parseMarkdownTableBlock(rows) {
|
|
|
2377
2409
|
}
|
|
2378
2410
|
function resolveTableWidth(explicit, env = process.env) {
|
|
2379
2411
|
if (typeof explicit === "number" && explicit > 0) return explicit;
|
|
2380
|
-
const override = parseInt(env.NOLO_TEST_TABLE_WIDTH, 10);
|
|
2412
|
+
const override = parseInt(env.NOLO_TEST_TABLE_WIDTH ?? "", 10);
|
|
2381
2413
|
if (!Number.isNaN(override) && override > 0) return override;
|
|
2382
2414
|
const cols = typeof process !== "undefined" && typeof process.stdout?.columns === "number" ? process.stdout.columns : 0;
|
|
2383
2415
|
if (cols > 0) return cols;
|
|
@@ -2573,7 +2605,11 @@ function renderBoxTable(table, width, style) {
|
|
|
2573
2605
|
);
|
|
2574
2606
|
}
|
|
2575
2607
|
lines.push(boxLine("\u251C", "\u253C", "\u2524", widths));
|
|
2608
|
+
const hasMultiLineRecord = bodyDisplayRows.some((rows) => rows > 1);
|
|
2576
2609
|
bodyGrids.forEach((_, rec) => {
|
|
2610
|
+
if (hasMultiLineRecord && rec > 0) {
|
|
2611
|
+
lines.push(boxLine("\u251C", "\u253C", "\u2524", widths));
|
|
2612
|
+
}
|
|
2577
2613
|
for (let r = 0; r < bodyDisplayRows[rec]; r += 1) {
|
|
2578
2614
|
lines.push(
|
|
2579
2615
|
dataRow(
|
|
@@ -4979,6 +5015,46 @@ ${options.agentName} > (no text response)
|
|
|
4979
5015
|
};
|
|
4980
5016
|
}
|
|
4981
5017
|
|
|
5018
|
+
// packages/cli/client/clientVersionTooOldFailure.ts
|
|
5019
|
+
var asVersionGateDetail = (value) => {
|
|
5020
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
5021
|
+
const candidate = value;
|
|
5022
|
+
if (typeof candidate.model !== "string" || typeof candidate.minClientVersion !== "string") {
|
|
5023
|
+
return void 0;
|
|
5024
|
+
}
|
|
5025
|
+
return candidate;
|
|
5026
|
+
};
|
|
5027
|
+
var isClientVersionTooOldFailure = (message, rawError) => {
|
|
5028
|
+
if (message.includes(CLIENT_VERSION_TOO_OLD_CODE)) return true;
|
|
5029
|
+
if (typeof rawError !== "object" || rawError === null) return false;
|
|
5030
|
+
const err = rawError;
|
|
5031
|
+
if (err.code === CLIENT_VERSION_TOO_OLD_CODE) return true;
|
|
5032
|
+
if (typeof err.detail !== "object" || err.detail === null) return false;
|
|
5033
|
+
const detail = err.detail;
|
|
5034
|
+
return detail.reason === CLIENT_VERSION_TOO_OLD_CODE || detail.code === CLIENT_VERSION_TOO_OLD_CODE;
|
|
5035
|
+
};
|
|
5036
|
+
var attachStreamFrameErrorFields = (error, payload) => {
|
|
5037
|
+
const target = error;
|
|
5038
|
+
if (payload && typeof payload === "object") {
|
|
5039
|
+
if (payload.code !== void 0) target.code = payload.code;
|
|
5040
|
+
if (payload.detail !== void 0) target.detail = payload.detail;
|
|
5041
|
+
}
|
|
5042
|
+
return target;
|
|
5043
|
+
};
|
|
5044
|
+
var describeClientVersionTooOldFailure = (message, rawError) => {
|
|
5045
|
+
const detail = typeof rawError === "object" && rawError !== null ? asVersionGateDetail(rawError.detail) : void 0;
|
|
5046
|
+
if (!detail) {
|
|
5047
|
+
return `[nolo] ${message}
|
|
5048
|
+
`;
|
|
5049
|
+
}
|
|
5050
|
+
const model = detail.model;
|
|
5051
|
+
const minClientVersion = detail.minClientVersion;
|
|
5052
|
+
const current = typeof detail.clientVersion === "string" && detail.clientVersion.trim() ? detail.clientVersion.trim() : void 0;
|
|
5053
|
+
const upgradeCommand = typeof detail.upgradeCommand === "string" && detail.upgradeCommand.trim() ? detail.upgradeCommand.trim() : "npx nolo-cli@latest";
|
|
5054
|
+
return `[nolo] Run blocked: client version too old (${CLIENT_VERSION_TOO_OLD_CODE}). ` + buildClientVersionUpgradeMessage({ model, minClientVersion, ...current ? { clientVersion: current } : {} }) + `\u672C\u6B21\u62D2\u7EDD\u53D1\u751F\u5728\u4EFB\u4F55\u4E0A\u6E38\u8C03\u7528\u4E4B\u524D\uFF0C\u672A\u4EA7\u751F\u8D39\u7528\u3002\u5347\u7EA7\u547D\u4EE4\uFF1A${upgradeCommand}\u3002
|
|
5055
|
+
`;
|
|
5056
|
+
};
|
|
5057
|
+
|
|
4982
5058
|
// packages/cli/client/agentRunStream.ts
|
|
4983
5059
|
async function readStreamingAgentRun(options, res, existingSpinner) {
|
|
4984
5060
|
const reader = res.body?.getReader();
|
|
@@ -5015,8 +5091,9 @@ async function readStreamingAgentRun(options, res, existingSpinner) {
|
|
|
5015
5091
|
dialogId = payload.dialogId;
|
|
5016
5092
|
}
|
|
5017
5093
|
if (payload?.error || payload?.type === "error") {
|
|
5018
|
-
throw
|
|
5019
|
-
String(payload.error || payload.message || "Agent stream failed")
|
|
5094
|
+
throw attachStreamFrameErrorFields(
|
|
5095
|
+
new Error(String(payload.error || payload.message || "Agent stream failed")),
|
|
5096
|
+
payload
|
|
5020
5097
|
);
|
|
5021
5098
|
}
|
|
5022
5099
|
if (payload?.type === "done") {
|
|
@@ -5093,6 +5170,11 @@ async function readStreamingAgentRun(options, res, existingSpinner) {
|
|
|
5093
5170
|
);
|
|
5094
5171
|
return { exitCode: 0, dialogId, streamInterrupted: true };
|
|
5095
5172
|
}
|
|
5173
|
+
if (isClientVersionTooOldFailure(message, error)) {
|
|
5174
|
+
options.output.write(`
|
|
5175
|
+
${describeClientVersionTooOldFailure(message, error)}`);
|
|
5176
|
+
return { exitCode: 1 };
|
|
5177
|
+
}
|
|
5096
5178
|
options.output.write(`
|
|
5097
5179
|
[nolo] Agent stream failed: ${message}
|
|
5098
5180
|
`);
|
|
@@ -5360,7 +5442,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
5360
5442
|
// packages/cli/client/agentRun.ts
|
|
5361
5443
|
import { ulid } from "ulid";
|
|
5362
5444
|
async function loadRunLocalAgentTurn() {
|
|
5363
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
5445
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-V2UKJPNE.js");
|
|
5364
5446
|
return runLocalAgentTurn;
|
|
5365
5447
|
}
|
|
5366
5448
|
async function resolveCurrentMachineId(options) {
|
|
@@ -5564,7 +5646,8 @@ function buildRejectedPayloadFailure(ctx) {
|
|
|
5564
5646
|
`;
|
|
5565
5647
|
}
|
|
5566
5648
|
function buildRateLimitFailure(ctx) {
|
|
5567
|
-
|
|
5649
|
+
const cooldownNote = ctx.cooldownUntil ? ` \u5DF2\u6807\u8BB0\u51B7\u5374\u81F3 ${ctx.cooldownUntil}\uFF0C\u5230\u671F\u524D\u6D3E\u53D1\u4F1A\u88AB\u51B7\u5374\u95E8\u63A7\u62E6\u622A\uFF08\u5230\u671F\u81EA\u52A8 probe \u6062\u590D\uFF09\u3002` : "";
|
|
5650
|
+
return `${RUN_UNAVAILABLE_PREFIX} (${ctx.where} returned HTTP ${ctx.status}, rate limited). Detail: ${ctx.message} ${NO_FALLBACK} Retry shortly, ${SERVER_FALLBACK_HINT}.${cooldownNote}
|
|
5568
5651
|
`;
|
|
5569
5652
|
}
|
|
5570
5653
|
function buildTransientFailure(ctx) {
|
|
@@ -5584,6 +5667,9 @@ var FAILURE_BUILDERS = {
|
|
|
5584
5667
|
upstream: buildUpstreamFailure
|
|
5585
5668
|
};
|
|
5586
5669
|
function describeLocalRunFailure(message, rawError) {
|
|
5670
|
+
if (isClientVersionTooOldFailure(message, rawError)) {
|
|
5671
|
+
return describeClientVersionTooOldFailure(message, rawError);
|
|
5672
|
+
}
|
|
5587
5673
|
let busyDetail;
|
|
5588
5674
|
if (rawError && typeof rawError === "object" && "detail" in rawError && typeof rawError.detail === "string" && rawError.detail.trim()) {
|
|
5589
5675
|
busyDetail = rawError.detail.trim();
|
|
@@ -5612,13 +5698,33 @@ function describeLocalRunFailure(message, rawError) {
|
|
|
5612
5698
|
return `${RUN_UNAVAILABLE_PREFIX} (${message}). ${NO_FALLBACK} Fix the local credential/config and retry, ${SERVER_FALLBACK_HINT}.
|
|
5613
5699
|
`;
|
|
5614
5700
|
}
|
|
5701
|
+
const cooldownUntil = rawError && typeof rawError === "object" ? rawError.cooldownUntil : void 0;
|
|
5615
5702
|
const ctx = {
|
|
5616
5703
|
message,
|
|
5617
5704
|
where: cls.transport === "platform" ? "server chat proxy" : "local provider",
|
|
5618
|
-
status: cls.status
|
|
5705
|
+
status: cls.status,
|
|
5706
|
+
...cooldownUntil ? { cooldownUntil } : {}
|
|
5619
5707
|
};
|
|
5620
5708
|
return FAILURE_BUILDERS[cls.kind](ctx);
|
|
5621
5709
|
}
|
|
5710
|
+
async function markStartupRateLimitCooldown(options, adapter, message) {
|
|
5711
|
+
const cls = classifyLocalRunError(message);
|
|
5712
|
+
if (cls.kind !== "rate-limit") return void 0;
|
|
5713
|
+
const recorder = adapter;
|
|
5714
|
+
if (typeof recorder?.recordStartupAvailabilityForAgent !== "function") {
|
|
5715
|
+
return void 0;
|
|
5716
|
+
}
|
|
5717
|
+
try {
|
|
5718
|
+
const effectiveNextAvailableAt = await recorder.recordStartupAvailabilityForAgent(
|
|
5719
|
+
options.agentKey,
|
|
5720
|
+
cls.status,
|
|
5721
|
+
message
|
|
5722
|
+
);
|
|
5723
|
+
return typeof effectiveNextAvailableAt === "number" ? new Date(effectiveNextAvailableAt).toISOString() : void 0;
|
|
5724
|
+
} catch {
|
|
5725
|
+
return void 0;
|
|
5726
|
+
}
|
|
5727
|
+
}
|
|
5622
5728
|
function shouldAttemptAutoLocal(options) {
|
|
5623
5729
|
if (options.localRuntimeAdapter || options.localRuntimeAdapterFactory)
|
|
5624
5730
|
return true;
|
|
@@ -5665,6 +5771,7 @@ async function runHttpAgentTurn(options, authToken) {
|
|
|
5665
5771
|
);
|
|
5666
5772
|
spinner.start();
|
|
5667
5773
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
5774
|
+
const clientVersionHeader = resolveClientVersion(options.env ?? {});
|
|
5668
5775
|
const subjectRefs = buildSubjectRefs(options);
|
|
5669
5776
|
const allowedChildAgentKeys = options.allowedChildAgentKeys?.filter(
|
|
5670
5777
|
(key) => key.trim()
|
|
@@ -5712,7 +5819,10 @@ async function runHttpAgentTurn(options, authToken) {
|
|
|
5712
5819
|
method: "POST",
|
|
5713
5820
|
headers: {
|
|
5714
5821
|
Authorization: `Bearer ${authToken}`,
|
|
5715
|
-
"Content-Type": "application/json"
|
|
5822
|
+
"Content-Type": "application/json",
|
|
5823
|
+
// 客户端版本闸门:与鉴权头同处注入。server 侧据此拒绝旧客户端选中的
|
|
5824
|
+
// 新托管模型(明确提示升级),而不是放行去连续截断 + 照常扣积分。
|
|
5825
|
+
...clientVersionHeader ? { [NOLO_CLIENT_VERSION_HEADER]: clientVersionHeader } : {}
|
|
5716
5826
|
},
|
|
5717
5827
|
body: buildRequestBody(stream),
|
|
5718
5828
|
...options.abortSignal ? { signal: options.abortSignal } : {}
|
|
@@ -5951,11 +6061,25 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
5951
6061
|
...pendingToolName ? { pendingToolName } : {}
|
|
5952
6062
|
};
|
|
5953
6063
|
}
|
|
6064
|
+
const cooldownUntil = await markStartupRateLimitCooldown(
|
|
6065
|
+
options,
|
|
6066
|
+
baseAdapter,
|
|
6067
|
+
toErrorMessage(error)
|
|
6068
|
+
);
|
|
6069
|
+
if (cooldownUntil) {
|
|
6070
|
+
error.cooldownUntil = cooldownUntil;
|
|
6071
|
+
}
|
|
5954
6072
|
if (settings.reportFailure) {
|
|
5955
6073
|
options.output.write(
|
|
5956
6074
|
`[nolo] Local agent run failed: ${toErrorMessage(error)}
|
|
5957
6075
|
`
|
|
5958
6076
|
);
|
|
6077
|
+
if (cooldownUntil) {
|
|
6078
|
+
options.output.write(
|
|
6079
|
+
`[nolo] \u5DF2\u6807\u8BB0\u51B7\u5374\u81F3 ${cooldownUntil}\uFF0C\u5230\u671F\u524D\u6D3E\u53D1\u8BE5 agent \u4F1A\u88AB\u51B7\u5374\u95E8\u63A7\u62E6\u622A\u3002
|
|
6080
|
+
`
|
|
6081
|
+
);
|
|
6082
|
+
}
|
|
5959
6083
|
}
|
|
5960
6084
|
return {
|
|
5961
6085
|
exitCode: 1,
|
|
@@ -6032,6 +6156,7 @@ async function runAgentTurn(options) {
|
|
|
6032
6156
|
}
|
|
6033
6157
|
|
|
6034
6158
|
// packages/cli/agentRunCommand.ts
|
|
6159
|
+
import * as nodeFs from "node:fs";
|
|
6035
6160
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
6036
6161
|
import { join as join2 } from "node:path";
|
|
6037
6162
|
|
|
@@ -7048,20 +7173,21 @@ async function runAgentRunCommand(args, deps) {
|
|
|
7048
7173
|
);
|
|
7049
7174
|
extraContextBlocks.push(...contextBlockScopes.map((block) => block.content));
|
|
7050
7175
|
}
|
|
7051
|
-
const
|
|
7176
|
+
const formatTurnMessage = (msg) => prependWorkflowReferencePrompt(
|
|
7177
|
+
prependSubjectDialogMarker(
|
|
7178
|
+
prependFeatureWorktreeInstruction(
|
|
7179
|
+
prependOutputFormatGuidance(msg),
|
|
7180
|
+
parsed.injectFeatureWorktreeInstruction
|
|
7181
|
+
),
|
|
7182
|
+
parsed.subjectDialogKey
|
|
7183
|
+
),
|
|
7184
|
+
workflowReference
|
|
7185
|
+
);
|
|
7186
|
+
const buildRunOptions = (targetAgentKey, turnMessage = effectiveMessage) => ({
|
|
7052
7187
|
agentName: targetAgentKey,
|
|
7053
7188
|
agentKey: targetAgentKey,
|
|
7054
7189
|
serverUrl: resolveServerUrl(env),
|
|
7055
|
-
message:
|
|
7056
|
-
prependSubjectDialogMarker(
|
|
7057
|
-
prependFeatureWorktreeInstruction(
|
|
7058
|
-
prependOutputFormatGuidance(effectiveMessage),
|
|
7059
|
-
parsed.injectFeatureWorktreeInstruction
|
|
7060
|
-
),
|
|
7061
|
-
parsed.subjectDialogKey
|
|
7062
|
-
),
|
|
7063
|
-
workflowReference
|
|
7064
|
-
),
|
|
7190
|
+
message: formatTurnMessage(turnMessage),
|
|
7065
7191
|
imageUrls: parsed.imageUrls.map(normalizeCliImageInput),
|
|
7066
7192
|
scriptDir: deps.scriptDir,
|
|
7067
7193
|
env: runEnv,
|
|
@@ -7133,6 +7259,48 @@ async function runAgentRunCommand(args, deps) {
|
|
|
7133
7259
|
output.write(`As the orchestrating agent, decide next based on task and re-dispatch (update task state with this attempt).
|
|
7134
7260
|
`);
|
|
7135
7261
|
}
|
|
7262
|
+
const queueFilePath = parsed.queueFile ?? (childRunId ? resolveRunQueuePath(childRunId, env, deps.homedir) : void 0);
|
|
7263
|
+
const queueFs = deps.fs ?? nodeFs;
|
|
7264
|
+
if (queueFilePath && queueFs.existsSync(queueFilePath) && result.dialogId && result.exitCode === 0) {
|
|
7265
|
+
const MAX_DRAIN_TURNS = 200;
|
|
7266
|
+
let drainTurns = 0;
|
|
7267
|
+
const popSingle = deps.popSingleQueueMessage ?? popSingleQueueMessage;
|
|
7268
|
+
while (drainTurns < MAX_DRAIN_TURNS && queueFs.existsSync(queueFilePath)) {
|
|
7269
|
+
const nextEntry = await popSingle(queueFilePath, deps);
|
|
7270
|
+
if (!nextEntry) {
|
|
7271
|
+
break;
|
|
7272
|
+
}
|
|
7273
|
+
drainTurns += 1;
|
|
7274
|
+
try {
|
|
7275
|
+
const turnResult = await raceWithWatchdog(
|
|
7276
|
+
runner({
|
|
7277
|
+
...buildRunOptions(effectiveAgentKey, nextEntry.text),
|
|
7278
|
+
continueDialogId: result.dialogId,
|
|
7279
|
+
...modelOverride ? { modelOverride } : {}
|
|
7280
|
+
})
|
|
7281
|
+
);
|
|
7282
|
+
clearWatchdogs();
|
|
7283
|
+
result = turnResult;
|
|
7284
|
+
if (result.exitCode !== 0) {
|
|
7285
|
+
break;
|
|
7286
|
+
}
|
|
7287
|
+
} catch (drainError) {
|
|
7288
|
+
clearWatchdogs();
|
|
7289
|
+
console.error(`[nolo] queue turn failed with exception: ${toErrorMessage(drainError)}`);
|
|
7290
|
+
result = {
|
|
7291
|
+
...result,
|
|
7292
|
+
exitCode: 1,
|
|
7293
|
+
localError: drainError
|
|
7294
|
+
};
|
|
7295
|
+
break;
|
|
7296
|
+
}
|
|
7297
|
+
}
|
|
7298
|
+
if (drainTurns >= MAX_DRAIN_TURNS) {
|
|
7299
|
+
console.error(
|
|
7300
|
+
`[nolo] Warning: queue drain loop reached defensive limit of ${MAX_DRAIN_TURNS} turns, stopping.`
|
|
7301
|
+
);
|
|
7302
|
+
}
|
|
7303
|
+
}
|
|
7136
7304
|
if (result.dialogId) {
|
|
7137
7305
|
if (parsed.background) {
|
|
7138
7306
|
output.write(`
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-YYLHWIW6.js";
|
|
4
4
|
import {
|
|
5
5
|
compareAgentSelection
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TNPCQNGQ.js";
|
|
7
7
|
import {
|
|
8
8
|
getModelAbility
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7XTC3KRG.js";
|
|
10
10
|
import {
|
|
11
11
|
isOwnedAgentKey,
|
|
12
12
|
ownedAgentKey,
|
|
@@ -157,8 +157,74 @@ function toSafeAgentSummary(record, options) {
|
|
|
157
157
|
function sortSafeAgentSummaries(agents) {
|
|
158
158
|
return [...agents].sort(compareAgentSelection);
|
|
159
159
|
}
|
|
160
|
+
var COMPACT_AGENT_SUMMARY_FIELDS = [
|
|
161
|
+
"agentKey",
|
|
162
|
+
"name",
|
|
163
|
+
"model",
|
|
164
|
+
"provider",
|
|
165
|
+
"apiSource",
|
|
166
|
+
"isFavorite",
|
|
167
|
+
"isOAuth",
|
|
168
|
+
"isOwned",
|
|
169
|
+
"isPublic",
|
|
170
|
+
"tools",
|
|
171
|
+
// 仅限流中的 agent 才会带(可用 agent 上不存在)。对"现在能不能选它"是
|
|
172
|
+
// 决策信息(CLI --show-unavailable 场景);默认列表已把这类 agent 过滤掉,
|
|
173
|
+
// 所以通常根本不占字节。
|
|
174
|
+
"nextAvailableAt"
|
|
175
|
+
];
|
|
176
|
+
function omitNullishAgentSummaryFields(summary) {
|
|
177
|
+
const result = {};
|
|
178
|
+
for (const [key, value] of Object.entries(summary)) {
|
|
179
|
+
if (value !== null && value !== void 0) {
|
|
180
|
+
result[key] = value;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return result;
|
|
184
|
+
}
|
|
185
|
+
function toCompactAgentSummary(summary) {
|
|
186
|
+
const compact = {};
|
|
187
|
+
for (const field of COMPACT_AGENT_SUMMARY_FIELDS) {
|
|
188
|
+
const value = summary[field];
|
|
189
|
+
if (value !== null && value !== void 0) {
|
|
190
|
+
compact[field] = value;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return compact;
|
|
194
|
+
}
|
|
195
|
+
var UNAVAILABLE_AGENT_SUMMARY_FIELDS = [
|
|
196
|
+
"agentKey",
|
|
197
|
+
"name",
|
|
198
|
+
"model",
|
|
199
|
+
"provider",
|
|
200
|
+
"apiSource",
|
|
201
|
+
"isFavorite",
|
|
202
|
+
"isOAuth",
|
|
203
|
+
"isOwned",
|
|
204
|
+
"nextAvailableAt",
|
|
205
|
+
"favoritedAt",
|
|
206
|
+
"updatedAt"
|
|
207
|
+
];
|
|
208
|
+
function toUnavailableAgentSummary(summary) {
|
|
209
|
+
const item = {
|
|
210
|
+
name: summary.name,
|
|
211
|
+
isFavorite: summary.isFavorite,
|
|
212
|
+
isOAuth: summary.isOAuth,
|
|
213
|
+
isOwned: summary.isOwned
|
|
214
|
+
};
|
|
215
|
+
for (const field of UNAVAILABLE_AGENT_SUMMARY_FIELDS) {
|
|
216
|
+
const value = summary[field];
|
|
217
|
+
if (value !== null && value !== void 0) {
|
|
218
|
+
item[field] = value;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return item;
|
|
222
|
+
}
|
|
160
223
|
|
|
161
224
|
export {
|
|
162
225
|
toSafeAgentSummary,
|
|
163
|
-
sortSafeAgentSummaries
|
|
226
|
+
sortSafeAgentSummaries,
|
|
227
|
+
omitNullishAgentSummaryFields,
|
|
228
|
+
toCompactAgentSummary,
|
|
229
|
+
toUnavailableAgentSummary
|
|
164
230
|
};
|
|
@@ -13,18 +13,18 @@ import {
|
|
|
13
13
|
toTimestampMs,
|
|
14
14
|
upsert,
|
|
15
15
|
write
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WVGEBWA6.js";
|
|
17
17
|
import {
|
|
18
18
|
createUserKey,
|
|
19
19
|
createUserPreferenceKey,
|
|
20
20
|
ulid
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SVEUG45B.js";
|
|
22
22
|
import {
|
|
23
23
|
asTrimmedLowercaseString
|
|
24
24
|
} from "./chunk-QSJ3HFEF.js";
|
|
25
25
|
import {
|
|
26
26
|
BUILTIN_NOLO_AGENT_KEY
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-Z5NW3O7V.js";
|
|
28
28
|
import {
|
|
29
29
|
asyncThunkCreator,
|
|
30
30
|
buildCreateSlice,
|