nolo-cli 0.138.0-alpha.1 → 0.140.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-JWLH2Z7S.js → _executeModel-GJGGE6JX.js} +14 -13
- package/{agentDeleteCommand-UZGJZS5J.js → agentDeleteCommand-DAM4LEEO.js} +1 -1
- package/{agentEmailCommands-2SVG6LS3.js → agentEmailCommands-BTUG55AL.js} +13 -13
- package/{agentListCommands-GADYFX2S.js → agentListCommands-T3V5EL27.js} +1 -1
- package/{agentMachineCommands-JALXFO3Y.js → agentMachineCommands-5NBFFTBT.js} +2 -2
- package/{agentRecordCommands-INRNLAFR.js → agentRecordCommands-GFA7RVTG.js} +13 -13
- package/{agentRunCommand-TKHBLWSI.js → agentRunCommand-NXT7TWBS.js} +13 -13
- package/{agentRuntimeLocal-F44W2XTL.js → agentRuntimeLocal-DKFAWMRZ.js} +1 -1
- package/{agentSlice-T53NW4SS.js → agentSlice-WQVGFRLD.js} +1 -1
- package/{appDeleteCommands-GEVEUPWJ.js → appDeleteCommands-PBCGWJZQ.js} +1 -1
- package/{appDeployCommands-FMAHPMA2.js → appDeployCommands-E7KRDPZ5.js} +1 -1
- package/{appDeployStatusCommands-7DRR4X7F.js → appDeployStatusCommands-TZ64EREZ.js} +1 -1
- package/{appGetCommands-EOULTSHM.js → appGetCommands-3M2OIBJ3.js} +1 -1
- package/{appListCommands-ARJVCFDJ.js → appListCommands-D7H6I62Y.js} +1 -1
- package/{chatQueueReduxAdapter-GSD7C24T.js → chatQueueReduxAdapter-FUXS7NRR.js} +2 -2
- package/{chunk-TNYKI3LI.js → chunk-44YE37DR.js} +5 -5
- package/chunk-6OTOA5MH.js +108 -0
- package/{chunk-ZTQANKS2.js → chunk-AA2TX625.js} +2 -2
- package/{chunk-ZWJ6WQBO.js → chunk-AR7XM7CQ.js} +1 -1
- package/{chunk-MLXQO7X4.js → chunk-C6EZXUCB.js} +3 -3
- package/{chunk-DXXCZYEZ.js → chunk-CZNXUKLA.js} +9 -9
- package/{chunk-2LFG5CGH.js → chunk-ENU52AJZ.js} +1 -1
- package/chunk-GOMR6S5Z.js +83 -0
- package/{chunk-FSEVS4U3.js → chunk-KFMLZ3B5.js} +16 -8
- package/{chunk-3SPFKUP5.js → chunk-LJVUX3LF.js} +1 -1
- package/{chunk-27YNIIBN.js → chunk-NRXXVGOQ.js} +2 -2
- package/chunk-PWOXYPE6.js +194 -0
- package/{chunk-PA2BRUNR.js → chunk-QFDNAM7T.js} +3 -3
- package/{chunk-KQW2EHWB.js → chunk-RY3FI23Y.js} +19 -78
- package/{chunk-VIOF5352.js → chunk-TJUQIJQR.js} +8 -6
- package/{chunk-J2RGIFX5.js → chunk-UOCZAVYF.js} +2 -2
- package/{chunk-IEEGKL6X.js → chunk-YBUA6LCU.js} +2068 -1700
- package/{chunk-TTMVLXU5.js → chunk-ZOOAFELH.js} +6 -108
- package/{commandRegistry-DMS5KFOK.js → commandRegistry-XMFDAEN3.js} +40 -40
- package/{contentThunks-SDVFY3MX.js → contentThunks-CDGRYZSO.js} +3 -3
- package/{createAgentAutomationAction-CD6QYRC2.js → createAgentAutomationAction-HJZH45UP.js} +3 -3
- package/{createDialogAction-MB6BOVJJ.js → createDialogAction-W2U3KOFN.js} +4 -4
- package/{createPageAction-Y2A5MARX.js → createPageAction-4VGPW4AZ.js} +3 -3
- package/{dialogCommands-G7ZTYMIA.js → dialogCommands-FBSQ4KJR.js} +2 -2
- package/{dialogSlice-5C3POHWD.js → dialogSlice-MGEPXTGX.js} +2 -2
- package/{docCreateCommands-AEZC5UXB.js → docCreateCommands-N2TPCEZ7.js} +1 -1
- package/{docDeleteCommands-DXXYWOXH.js → docDeleteCommands-FJA7Q6CI.js} +1 -1
- package/{docReadCommands-G6PL2543.js → docReadCommands-2UZB5OR7.js} +1 -1
- package/{docStore-ZX7AIY5W.js → docStore-P6JMWIVK.js} +1 -1
- package/{docUpdateCommands-TWKJOXYT.js → docUpdateCommands-BID4C3QP.js} +1 -1
- package/{handleSendMessageAction-2AF42N6F.js → handleSendMessageAction-HAVG5ANU.js} +397 -6
- package/index.js +2 -2
- package/{machineCommands-ZY5BB4O3.js → machineCommands-WDAQIYYL.js} +13 -13
- package/{machineWsRunDispatch-5XE37H4C.js → machineWsRunDispatch-Y3MHLPCI.js} +13 -13
- package/package.json +1 -1
- package/{readlineWorkspace-HDAVBAL5.js → readlineWorkspace-AGIDALGO.js} +13 -13
- package/{runAgentClientLoop-TVA5UASR.js → runAgentClientLoop-7RNZVACU.js} +12 -11
- package/{spaceCommands-G2UBKO4F.js → spaceCommands-TKFZFVCA.js} +1 -1
- package/{streamAgentChatTurn-B6H35UWR.js → streamAgentChatTurn-T3WC62NT.js} +30 -210
- package/{tools-EEAEICHM.js → tools-UHCAPZ22.js} +9 -9
- package/{updateDialogTitleAction-UPPVYQ7R.js → updateDialogTitleAction-WBIR5A4A.js} +3 -3
- package/chunk-N4G4PKQ6.js +0 -23
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
wrapTextToLines,
|
|
71
71
|
wrapTranscriptLine,
|
|
72
72
|
wrapTranscriptLineWithLayout
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-CZNXUKLA.js";
|
|
74
74
|
import "./chunk-VJVNU77E.js";
|
|
75
75
|
import "./chunk-BIDGLJQ3.js";
|
|
76
76
|
import {
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
readTimestamp,
|
|
83
83
|
setCliLocale,
|
|
84
84
|
t
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-44YE37DR.js";
|
|
86
86
|
import "./chunk-XSW2IKJM.js";
|
|
87
87
|
import "./chunk-OY5IJI2N.js";
|
|
88
88
|
import "./chunk-62IL3KQV.js";
|
|
@@ -136,18 +136,18 @@ import "./chunk-ATNTHIZI.js";
|
|
|
136
136
|
import "./chunk-JEXVIMYZ.js";
|
|
137
137
|
import {
|
|
138
138
|
prepareTools
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-UOCZAVYF.js";
|
|
140
140
|
import {
|
|
141
141
|
buildResponseGuidelines
|
|
142
142
|
} from "./chunk-EOARMOVD.js";
|
|
143
143
|
import "./chunk-HS7MLR74.js";
|
|
144
|
-
import "./chunk-
|
|
145
|
-
import "./chunk-NF64D32W.js";
|
|
144
|
+
import "./chunk-RY3FI23Y.js";
|
|
146
145
|
import "./chunk-YSC3EI23.js";
|
|
147
146
|
import "./chunk-5UTFL4QJ.js";
|
|
148
|
-
import "./chunk-3L2WKC3W.js";
|
|
149
147
|
import "./chunk-KQHGZWSV.js";
|
|
150
|
-
import "./chunk-
|
|
148
|
+
import "./chunk-GOMR6S5Z.js";
|
|
149
|
+
import "./chunk-NF64D32W.js";
|
|
150
|
+
import "./chunk-3L2WKC3W.js";
|
|
151
151
|
import {
|
|
152
152
|
clipText,
|
|
153
153
|
formatDuration,
|
|
@@ -159,12 +159,12 @@ import {
|
|
|
159
159
|
runShowsLogTail,
|
|
160
160
|
shortRunId
|
|
161
161
|
} from "./chunk-3VNWWVKB.js";
|
|
162
|
-
import "./chunk-
|
|
162
|
+
import "./chunk-NRXXVGOQ.js";
|
|
163
163
|
import "./chunk-HNRASX3X.js";
|
|
164
164
|
import "./chunk-YRRASA5Q.js";
|
|
165
165
|
import "./chunk-63W5N6P3.js";
|
|
166
166
|
import "./chunk-VF4K2QE6.js";
|
|
167
|
-
import "./chunk-
|
|
167
|
+
import "./chunk-AA2TX625.js";
|
|
168
168
|
import "./chunk-Z7IZQF56.js";
|
|
169
169
|
import "./chunk-XPRWFQQK.js";
|
|
170
170
|
import {
|
|
@@ -174,15 +174,15 @@ import {
|
|
|
174
174
|
} from "./chunk-YPREESF4.js";
|
|
175
175
|
import "./chunk-BJUDYFV5.js";
|
|
176
176
|
import "./chunk-MEYIRKDN.js";
|
|
177
|
-
import "./chunk-
|
|
177
|
+
import "./chunk-AR7XM7CQ.js";
|
|
178
178
|
import "./chunk-ZJ7UHBJS.js";
|
|
179
179
|
import {
|
|
180
180
|
extractReferenceKeysFromMessage
|
|
181
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-KFMLZ3B5.js";
|
|
182
182
|
import "./chunk-MC4XLIJ7.js";
|
|
183
183
|
import "./chunk-YYLHWIW6.js";
|
|
184
184
|
import "./chunk-6O4IK4V2.js";
|
|
185
|
-
import "./chunk-
|
|
185
|
+
import "./chunk-QFDNAM7T.js";
|
|
186
186
|
import "./chunk-D76D3RTR.js";
|
|
187
187
|
import "./chunk-5RGU3J7P.js";
|
|
188
188
|
import "./chunk-M76ECQRD.js";
|
|
@@ -209,7 +209,7 @@ import {
|
|
|
209
209
|
formatToolOverflowMarker,
|
|
210
210
|
getProcessRegistry,
|
|
211
211
|
readCommandActionGatePayload
|
|
212
|
-
} from "./chunk-
|
|
212
|
+
} from "./chunk-YBUA6LCU.js";
|
|
213
213
|
import "./chunk-VG72WLGI.js";
|
|
214
214
|
import "./chunk-ZNFJWEN4.js";
|
|
215
215
|
import "./chunk-6JPUN447.js";
|
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchAgentContexts
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LJVUX3LF.js";
|
|
4
4
|
import {
|
|
5
5
|
generateRequestBody,
|
|
6
6
|
mergeReferences,
|
|
7
7
|
performFetchRequest,
|
|
8
8
|
sanitizeOutboundBody
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZOOAFELH.js";
|
|
10
10
|
import "./chunk-EOARMOVD.js";
|
|
11
11
|
import "./chunk-HS7MLR74.js";
|
|
12
|
+
import "./chunk-6OTOA5MH.js";
|
|
12
13
|
import {
|
|
13
14
|
findToolExecutor,
|
|
14
15
|
getToolResultErrorData
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-NF64D32W.js";
|
|
16
|
+
} from "./chunk-RY3FI23Y.js";
|
|
17
17
|
import "./chunk-YSC3EI23.js";
|
|
18
18
|
import "./chunk-5UTFL4QJ.js";
|
|
19
|
-
import "./chunk-3L2WKC3W.js";
|
|
20
19
|
import "./chunk-KQHGZWSV.js";
|
|
21
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-GOMR6S5Z.js";
|
|
21
|
+
import "./chunk-NF64D32W.js";
|
|
22
|
+
import "./chunk-3L2WKC3W.js";
|
|
22
23
|
import "./chunk-3VNWWVKB.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-NRXXVGOQ.js";
|
|
24
25
|
import "./chunk-HNRASX3X.js";
|
|
25
26
|
import "./chunk-YRRASA5Q.js";
|
|
26
27
|
import "./chunk-63W5N6P3.js";
|
|
27
28
|
import "./chunk-VF4K2QE6.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-AA2TX625.js";
|
|
29
30
|
import "./chunk-Z7IZQF56.js";
|
|
30
31
|
import "./chunk-XPRWFQQK.js";
|
|
31
32
|
import "./chunk-BJUDYFV5.js";
|
|
32
33
|
import "./chunk-MEYIRKDN.js";
|
|
33
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-AR7XM7CQ.js";
|
|
34
35
|
import "./chunk-ZJ7UHBJS.js";
|
|
35
36
|
import {
|
|
36
37
|
updateTokensAction
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-KFMLZ3B5.js";
|
|
38
39
|
import "./chunk-MC4XLIJ7.js";
|
|
39
40
|
import "./chunk-YYLHWIW6.js";
|
|
40
41
|
import "./chunk-6O4IK4V2.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-QFDNAM7T.js";
|
|
42
43
|
import "./chunk-D76D3RTR.js";
|
|
43
44
|
import "./chunk-5RGU3J7P.js";
|
|
44
45
|
import "./chunk-M76ECQRD.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import "./chunk-OTGFTBLI.js";
|
|
12
12
|
import "./chunk-SV5IJK6K.js";
|
|
13
13
|
import "./chunk-KQHGZWSV.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-YBUA6LCU.js";
|
|
15
15
|
import "./chunk-VG72WLGI.js";
|
|
16
16
|
import "./chunk-ZNFJWEN4.js";
|
|
17
17
|
import "./chunk-6JPUN447.js";
|
|
@@ -5,6 +5,10 @@ import {
|
|
|
5
5
|
buildStaticUserPolicyContext,
|
|
6
6
|
resolveSpaceContextPreloadPlan
|
|
7
7
|
} from "./chunk-QJLEMM2V.js";
|
|
8
|
+
import {
|
|
9
|
+
buildForegroundTurnAdmissionFetchInit,
|
|
10
|
+
consumeAgentRunStream
|
|
11
|
+
} from "./chunk-PWOXYPE6.js";
|
|
8
12
|
import {
|
|
9
13
|
buildCliPrompt
|
|
10
14
|
} from "./chunk-ATNTHIZI.js";
|
|
@@ -15,11 +19,11 @@ import {
|
|
|
15
19
|
readStreamChunk,
|
|
16
20
|
sendOpenAICompletionsRequest,
|
|
17
21
|
updateTotalUsage
|
|
18
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TJUQIJQR.js";
|
|
19
23
|
import "./chunk-JEXVIMYZ.js";
|
|
20
24
|
import {
|
|
21
25
|
prepareTools
|
|
22
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-UOCZAVYF.js";
|
|
23
27
|
import {
|
|
24
28
|
isContextOverflowText,
|
|
25
29
|
parseApiError
|
|
@@ -33,7 +37,6 @@ import {
|
|
|
33
37
|
mergeReferences,
|
|
34
38
|
parseToolCallArguments,
|
|
35
39
|
performFetchRequest,
|
|
36
|
-
performServerProxyFetchWithRetry,
|
|
37
40
|
resolveAgentCallPlan,
|
|
38
41
|
resolveClientWire,
|
|
39
42
|
resolveReferenceAssets,
|
|
@@ -41,32 +44,35 @@ import {
|
|
|
41
44
|
sanitizeOutboundResponsesInput,
|
|
42
45
|
selectResponsesConversationState,
|
|
43
46
|
updateResponsesConversationState
|
|
44
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-ZOOAFELH.js";
|
|
45
48
|
import "./chunk-EOARMOVD.js";
|
|
46
49
|
import "./chunk-HS7MLR74.js";
|
|
47
50
|
import {
|
|
48
|
-
|
|
51
|
+
performServerProxyFetchWithRetry
|
|
52
|
+
} from "./chunk-6OTOA5MH.js";
|
|
53
|
+
import {
|
|
49
54
|
getAllToolRuns,
|
|
50
55
|
resolveAgentRecommendedSkillNames,
|
|
51
56
|
resolveAgentRequiredPackIds
|
|
52
|
-
} from "./chunk-
|
|
53
|
-
import "./chunk-NF64D32W.js";
|
|
57
|
+
} from "./chunk-RY3FI23Y.js";
|
|
54
58
|
import "./chunk-YSC3EI23.js";
|
|
55
59
|
import "./chunk-5UTFL4QJ.js";
|
|
56
|
-
import "./chunk-3L2WKC3W.js";
|
|
57
60
|
import "./chunk-KQHGZWSV.js";
|
|
58
61
|
import {
|
|
62
|
+
createSSEParser,
|
|
59
63
|
waitForAbortableDelay
|
|
60
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-GOMR6S5Z.js";
|
|
65
|
+
import "./chunk-NF64D32W.js";
|
|
66
|
+
import "./chunk-3L2WKC3W.js";
|
|
61
67
|
import "./chunk-3VNWWVKB.js";
|
|
62
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-NRXXVGOQ.js";
|
|
63
69
|
import "./chunk-HNRASX3X.js";
|
|
64
70
|
import "./chunk-YRRASA5Q.js";
|
|
65
71
|
import "./chunk-63W5N6P3.js";
|
|
66
72
|
import "./chunk-VF4K2QE6.js";
|
|
67
73
|
import {
|
|
68
74
|
getDocState
|
|
69
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-AA2TX625.js";
|
|
70
76
|
import "./chunk-Z7IZQF56.js";
|
|
71
77
|
import {
|
|
72
78
|
resolveToolBaseUrl
|
|
@@ -77,7 +83,7 @@ import {
|
|
|
77
83
|
} from "./chunk-MEYIRKDN.js";
|
|
78
84
|
import {
|
|
79
85
|
getTableState
|
|
80
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-AR7XM7CQ.js";
|
|
81
87
|
import {
|
|
82
88
|
getCurrentSpaceId,
|
|
83
89
|
getCurrentSpaceIdRaw,
|
|
@@ -102,11 +108,11 @@ import {
|
|
|
102
108
|
shouldBlockForGptPro,
|
|
103
109
|
updateTokens,
|
|
104
110
|
updateToolMessage
|
|
105
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-KFMLZ3B5.js";
|
|
106
112
|
import "./chunk-MC4XLIJ7.js";
|
|
107
113
|
import "./chunk-YYLHWIW6.js";
|
|
108
114
|
import "./chunk-6O4IK4V2.js";
|
|
109
|
-
import "./chunk-
|
|
115
|
+
import "./chunk-QFDNAM7T.js";
|
|
110
116
|
import {
|
|
111
117
|
createCliChatTurnStream,
|
|
112
118
|
getCliChatSession,
|
|
@@ -310,10 +316,10 @@ function clipUiText(value, max = DESKTOP_TOOL_UI_CONTENT_MAX_CHARS) {
|
|
|
310
316
|
\u2026[truncated for UI]`;
|
|
311
317
|
}
|
|
312
318
|
function tryParseJsonRecord(text) {
|
|
313
|
-
const
|
|
314
|
-
if (!
|
|
319
|
+
const trimmed = text.trim();
|
|
320
|
+
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return null;
|
|
315
321
|
try {
|
|
316
|
-
const parsed = JSON.parse(
|
|
322
|
+
const parsed = JSON.parse(trimmed);
|
|
317
323
|
return isRecord(parsed) ? parsed : null;
|
|
318
324
|
} catch {
|
|
319
325
|
return null;
|
|
@@ -1308,9 +1314,9 @@ var buildAgentViewMessages = (allMessages, currentAgentKey) => {
|
|
|
1308
1314
|
const rawAgentName = cloned.agentName;
|
|
1309
1315
|
const agentName = rawAgentName && String(rawAgentName).trim() ? String(rawAgentName).trim() : "\u5176\u4ED6 Agent";
|
|
1310
1316
|
if (typeof cloned.content === "string") {
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1313
|
-
cloned.content = `\u3010${agentName}\u3011 ${
|
|
1317
|
+
const trimmed = cloned.content.trim();
|
|
1318
|
+
if (trimmed) {
|
|
1319
|
+
cloned.content = `\u3010${agentName}\u3011 ${trimmed}`;
|
|
1314
1320
|
} else {
|
|
1315
1321
|
cloned.content = `\u3010${agentName}\u3011\uFF08\u4F7F\u7528\u4E86\u5DE5\u5177\u751F\u6210\u56DE\u590D\uFF09`;
|
|
1316
1322
|
}
|
|
@@ -2371,24 +2377,6 @@ async function persistMessageWithFixedId(dispatch, message) {
|
|
|
2371
2377
|
}
|
|
2372
2378
|
}
|
|
2373
2379
|
|
|
2374
|
-
// packages/ai/agent/foregroundTurnAdmissionFetch.ts
|
|
2375
|
-
var FOREGROUND_TURN_KEEPALIVE_MAX_BODY_BYTES = 60 * 1024;
|
|
2376
|
-
function getUtf8ByteLength(value) {
|
|
2377
|
-
return new TextEncoder().encode(value).byteLength;
|
|
2378
|
-
}
|
|
2379
|
-
function shouldKeepForegroundTurnAdmissionAlive(serializedBody) {
|
|
2380
|
-
return serializedBody.length > 0 && getUtf8ByteLength(serializedBody) <= FOREGROUND_TURN_KEEPALIVE_MAX_BODY_BYTES;
|
|
2381
|
-
}
|
|
2382
|
-
function buildForegroundTurnAdmissionFetchInit(args) {
|
|
2383
|
-
return {
|
|
2384
|
-
method: "POST",
|
|
2385
|
-
headers: args.headers,
|
|
2386
|
-
body: args.body,
|
|
2387
|
-
...args.signal ? { signal: args.signal } : {},
|
|
2388
|
-
...shouldKeepForegroundTurnAdmissionAlive(args.body) ? { keepalive: true } : {}
|
|
2389
|
-
};
|
|
2390
|
-
}
|
|
2391
|
-
|
|
2392
2380
|
// packages/ai/agent/serverOrigin.ts
|
|
2393
2381
|
var normalizeServerOrigin = (base) => {
|
|
2394
2382
|
try {
|
|
@@ -2486,12 +2474,12 @@ async function* runDesktopAgentRuntimeTurnStream({
|
|
|
2486
2474
|
const decoder = new TextDecoder();
|
|
2487
2475
|
let buffer = "";
|
|
2488
2476
|
const readLine = (line) => {
|
|
2489
|
-
const
|
|
2490
|
-
if (!
|
|
2477
|
+
const trimmed = line.trim();
|
|
2478
|
+
if (!trimmed || !trimmed.startsWith("data: ")) return null;
|
|
2491
2479
|
try {
|
|
2492
|
-
return JSON.parse(
|
|
2480
|
+
return JSON.parse(trimmed.slice(6));
|
|
2493
2481
|
} catch (e) {
|
|
2494
|
-
console.error("[desktop-client] Failed to parse stream line:",
|
|
2482
|
+
console.error("[desktop-client] Failed to parse stream line:", trimmed, e);
|
|
2495
2483
|
return null;
|
|
2496
2484
|
}
|
|
2497
2485
|
};
|
|
@@ -2733,174 +2721,6 @@ ${warnings.map((warning) => `- ${warning}`).join("\n")}`;
|
|
|
2733
2721
|
return `${content}${warningBlock}`;
|
|
2734
2722
|
}
|
|
2735
2723
|
|
|
2736
|
-
// packages/ai/agent/foregroundExecutionClientState.ts
|
|
2737
|
-
var stateByDialogId = /* @__PURE__ */ new Map();
|
|
2738
|
-
var MAX_TRACKED_DIALOGS = 256;
|
|
2739
|
-
function trimmed(value) {
|
|
2740
|
-
return typeof value === "string" ? value.trim() : "";
|
|
2741
|
-
}
|
|
2742
|
-
function trimCache() {
|
|
2743
|
-
while (stateByDialogId.size > MAX_TRACKED_DIALOGS) {
|
|
2744
|
-
const oldest = stateByDialogId.keys().next().value;
|
|
2745
|
-
if (!oldest) return;
|
|
2746
|
-
stateByDialogId.delete(oldest);
|
|
2747
|
-
}
|
|
2748
|
-
}
|
|
2749
|
-
function setForegroundExecutionClientState(args) {
|
|
2750
|
-
const dialogId = trimmed(args.dialogId);
|
|
2751
|
-
const executionId = trimmed(args.executionId);
|
|
2752
|
-
if (!dialogId || !executionId) return;
|
|
2753
|
-
stateByDialogId.delete(dialogId);
|
|
2754
|
-
stateByDialogId.set(dialogId, { dialogId, executionId, status: "running" });
|
|
2755
|
-
trimCache();
|
|
2756
|
-
}
|
|
2757
|
-
function clearForegroundExecutionClientState(dialogId, expectedExecutionId) {
|
|
2758
|
-
const normalizedDialogId = trimmed(dialogId);
|
|
2759
|
-
if (!normalizedDialogId) return;
|
|
2760
|
-
if (expectedExecutionId) {
|
|
2761
|
-
const current = stateByDialogId.get(normalizedDialogId);
|
|
2762
|
-
if (current && current.executionId !== expectedExecutionId) return;
|
|
2763
|
-
}
|
|
2764
|
-
stateByDialogId.delete(normalizedDialogId);
|
|
2765
|
-
}
|
|
2766
|
-
function observeForegroundExecutionPayload(payload) {
|
|
2767
|
-
if (!payload || typeof payload !== "object") return;
|
|
2768
|
-
const event = payload;
|
|
2769
|
-
const type = trimmed(event.type);
|
|
2770
|
-
const dialogId = trimmed(event.dialogId);
|
|
2771
|
-
const executionId = trimmed(event.executionId);
|
|
2772
|
-
if ((type === "dialog" || type === "foreground_turn_status") && event.status === "running" && dialogId && executionId) {
|
|
2773
|
-
setForegroundExecutionClientState({ dialogId, executionId });
|
|
2774
|
-
return;
|
|
2775
|
-
}
|
|
2776
|
-
if (type === "foreground_turn_terminal" || type === "done" || type === "cancelled" || type === "error" || type === "failed") {
|
|
2777
|
-
if (dialogId && executionId) {
|
|
2778
|
-
clearForegroundExecutionClientState(dialogId, executionId);
|
|
2779
|
-
}
|
|
2780
|
-
}
|
|
2781
|
-
}
|
|
2782
|
-
|
|
2783
|
-
// packages/ai/agent/streamTurnStreamConsumer.ts
|
|
2784
|
-
async function readAgentRunStreamChunk(reader, signal, isAborted) {
|
|
2785
|
-
if (isAborted() || signal?.aborted) {
|
|
2786
|
-
void reader.cancel().catch(() => {
|
|
2787
|
-
});
|
|
2788
|
-
throw new DOMException("The operation was aborted.", "AbortError");
|
|
2789
|
-
}
|
|
2790
|
-
if (!signal) {
|
|
2791
|
-
return reader.read();
|
|
2792
|
-
}
|
|
2793
|
-
let settled = false;
|
|
2794
|
-
return new Promise((resolve, reject) => {
|
|
2795
|
-
const finish = (cb) => {
|
|
2796
|
-
if (settled) return;
|
|
2797
|
-
settled = true;
|
|
2798
|
-
signal.removeEventListener("abort", onAbort);
|
|
2799
|
-
cb();
|
|
2800
|
-
};
|
|
2801
|
-
const onAbort = () => {
|
|
2802
|
-
void reader.cancel().catch(() => {
|
|
2803
|
-
});
|
|
2804
|
-
finish(
|
|
2805
|
-
() => reject(new DOMException("The operation was aborted.", "AbortError"))
|
|
2806
|
-
);
|
|
2807
|
-
};
|
|
2808
|
-
signal.addEventListener("abort", onAbort);
|
|
2809
|
-
reader.read().then(
|
|
2810
|
-
(result) => finish(() => resolve(result)),
|
|
2811
|
-
(err) => finish(() => reject(err))
|
|
2812
|
-
);
|
|
2813
|
-
});
|
|
2814
|
-
}
|
|
2815
|
-
async function consumeAgentRunStream(handlers) {
|
|
2816
|
-
const {
|
|
2817
|
-
reader,
|
|
2818
|
-
decoder,
|
|
2819
|
-
parseChunk,
|
|
2820
|
-
onPayload,
|
|
2821
|
-
isDoneEvent,
|
|
2822
|
-
isAborted,
|
|
2823
|
-
signal,
|
|
2824
|
-
onAbort
|
|
2825
|
-
} = handlers;
|
|
2826
|
-
let sawDone = false;
|
|
2827
|
-
let observedDialogId = "";
|
|
2828
|
-
let observedExecutionId = "";
|
|
2829
|
-
const clearObservedExecution = () => {
|
|
2830
|
-
if (!observedDialogId || !observedExecutionId) return;
|
|
2831
|
-
clearForegroundExecutionClientState(
|
|
2832
|
-
observedDialogId,
|
|
2833
|
-
observedExecutionId
|
|
2834
|
-
);
|
|
2835
|
-
};
|
|
2836
|
-
try {
|
|
2837
|
-
while (true) {
|
|
2838
|
-
let done;
|
|
2839
|
-
let value;
|
|
2840
|
-
try {
|
|
2841
|
-
({ done, value } = await readAgentRunStreamChunk(
|
|
2842
|
-
reader,
|
|
2843
|
-
signal,
|
|
2844
|
-
isAborted
|
|
2845
|
-
));
|
|
2846
|
-
} catch (error) {
|
|
2847
|
-
if (isAbortError(error) || isAborted() || signal?.aborted) {
|
|
2848
|
-
clearObservedExecution();
|
|
2849
|
-
await onAbort();
|
|
2850
|
-
return { outcome: "aborted" };
|
|
2851
|
-
}
|
|
2852
|
-
throw error;
|
|
2853
|
-
}
|
|
2854
|
-
if (isAborted() || signal?.aborted) {
|
|
2855
|
-
clearObservedExecution();
|
|
2856
|
-
await onAbort();
|
|
2857
|
-
return { outcome: "aborted" };
|
|
2858
|
-
}
|
|
2859
|
-
if (done) {
|
|
2860
|
-
clearObservedExecution();
|
|
2861
|
-
return { outcome: "streamEnded", sawDone };
|
|
2862
|
-
}
|
|
2863
|
-
const payloads = parseChunk(
|
|
2864
|
-
decoder.decode(value, { stream: true })
|
|
2865
|
-
);
|
|
2866
|
-
for (const payload of payloads) {
|
|
2867
|
-
if (isAborted() || signal?.aborted) {
|
|
2868
|
-
clearObservedExecution();
|
|
2869
|
-
await onAbort();
|
|
2870
|
-
return { outcome: "aborted" };
|
|
2871
|
-
}
|
|
2872
|
-
if (payload && typeof payload === "object") {
|
|
2873
|
-
if (payload.type === "dialog" && typeof payload.dialogId === "string") {
|
|
2874
|
-
observedDialogId = payload.dialogId.trim();
|
|
2875
|
-
observedExecutionId = typeof payload.executionId === "string" ? payload.executionId.trim() : "";
|
|
2876
|
-
}
|
|
2877
|
-
observeForegroundExecutionPayload(payload);
|
|
2878
|
-
}
|
|
2879
|
-
const directive = await onPayload(payload);
|
|
2880
|
-
if (directive?.reject !== void 0) {
|
|
2881
|
-
clearObservedExecution();
|
|
2882
|
-
return { outcome: "rejected", message: directive.reject };
|
|
2883
|
-
}
|
|
2884
|
-
if (directive?.abort) {
|
|
2885
|
-
clearObservedExecution();
|
|
2886
|
-
await onAbort();
|
|
2887
|
-
return { outcome: "aborted" };
|
|
2888
|
-
}
|
|
2889
|
-
if (isDoneEvent(payload)) {
|
|
2890
|
-
sawDone = true;
|
|
2891
|
-
}
|
|
2892
|
-
}
|
|
2893
|
-
}
|
|
2894
|
-
} catch (error) {
|
|
2895
|
-
clearObservedExecution();
|
|
2896
|
-
if (isAbortError(error) || isAborted() || signal?.aborted) {
|
|
2897
|
-
await onAbort();
|
|
2898
|
-
return { outcome: "aborted" };
|
|
2899
|
-
}
|
|
2900
|
-
throw error;
|
|
2901
|
-
}
|
|
2902
|
-
}
|
|
2903
|
-
|
|
2904
2724
|
// packages/ai/chat/wireAdapters/resolveChatWire.ts
|
|
2905
2725
|
function resolveChatWire(agentOrInput) {
|
|
2906
2726
|
if (!agentOrInput) return "completions";
|
|
@@ -8,31 +8,31 @@ import {
|
|
|
8
8
|
toolQueryFunc,
|
|
9
9
|
toolQueryFunctionSchema,
|
|
10
10
|
toolRegistry
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-NF64D32W.js";
|
|
11
|
+
} from "./chunk-RY3FI23Y.js";
|
|
13
12
|
import "./chunk-YSC3EI23.js";
|
|
14
13
|
import "./chunk-5UTFL4QJ.js";
|
|
15
|
-
import "./chunk-3L2WKC3W.js";
|
|
16
14
|
import "./chunk-KQHGZWSV.js";
|
|
17
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-GOMR6S5Z.js";
|
|
16
|
+
import "./chunk-NF64D32W.js";
|
|
17
|
+
import "./chunk-3L2WKC3W.js";
|
|
18
18
|
import "./chunk-3VNWWVKB.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-NRXXVGOQ.js";
|
|
20
20
|
import "./chunk-HNRASX3X.js";
|
|
21
21
|
import "./chunk-YRRASA5Q.js";
|
|
22
22
|
import "./chunk-63W5N6P3.js";
|
|
23
23
|
import "./chunk-VF4K2QE6.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-AA2TX625.js";
|
|
25
25
|
import "./chunk-Z7IZQF56.js";
|
|
26
26
|
import "./chunk-XPRWFQQK.js";
|
|
27
27
|
import "./chunk-BJUDYFV5.js";
|
|
28
28
|
import "./chunk-MEYIRKDN.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-AR7XM7CQ.js";
|
|
30
30
|
import "./chunk-ZJ7UHBJS.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-KFMLZ3B5.js";
|
|
32
32
|
import "./chunk-MC4XLIJ7.js";
|
|
33
33
|
import "./chunk-YYLHWIW6.js";
|
|
34
34
|
import "./chunk-6O4IK4V2.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-QFDNAM7T.js";
|
|
36
36
|
import "./chunk-D76D3RTR.js";
|
|
37
37
|
import "./chunk-5RGU3J7P.js";
|
|
38
38
|
import "./chunk-M76ECQRD.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AR7XM7CQ.js";
|
|
4
4
|
import "./chunk-ZJ7UHBJS.js";
|
|
5
5
|
import {
|
|
6
6
|
isAssistantToolStub,
|
|
7
7
|
selectAllMsgs
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KFMLZ3B5.js";
|
|
9
9
|
import {
|
|
10
10
|
BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
|
|
11
11
|
BUILTIN_TITLE_LLM_CONFIG
|
|
@@ -14,7 +14,7 @@ import "./chunk-YYLHWIW6.js";
|
|
|
14
14
|
import "./chunk-6O4IK4V2.js";
|
|
15
15
|
import {
|
|
16
16
|
runLlm
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QFDNAM7T.js";
|
|
18
18
|
import "./chunk-D76D3RTR.js";
|
|
19
19
|
import "./chunk-5RGU3J7P.js";
|
|
20
20
|
import {
|
package/chunk-N4G4PKQ6.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// packages/core/abortableDelay.ts
|
|
2
|
-
function waitForAbortableDelay(ms, signal) {
|
|
3
|
-
const delayMs = Number.isFinite(ms) && ms >= 0 ? Math.round(ms) : 0;
|
|
4
|
-
if (signal?.aborted) {
|
|
5
|
-
return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
6
|
-
}
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
const onAbort = () => {
|
|
9
|
-
clearTimeout(timeoutId);
|
|
10
|
-
signal?.removeEventListener("abort", onAbort);
|
|
11
|
-
reject(new DOMException("Aborted", "AbortError"));
|
|
12
|
-
};
|
|
13
|
-
const timeoutId = setTimeout(() => {
|
|
14
|
-
signal?.removeEventListener("abort", onAbort);
|
|
15
|
-
resolve();
|
|
16
|
-
}, delayMs);
|
|
17
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
waitForAbortableDelay
|
|
23
|
-
};
|