nolo-cli 0.19.0 → 0.24.0-alpha.7
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-X5PCIZN6.js → _executeModel-ARCMGGMY.js} +46 -44
- package/{action-LT7BRFLK.js → action-5MNAXR5B.js} +7 -6
- package/{addContentAction-PL3KKBDH.js → addContentAction-UNSYTVTB.js} +5 -5
- package/{addDialogAgentAction-FCMSKYAF.js → addDialogAgentAction-LJGNP2AO.js} +5 -5
- package/{agentDeleteCommand-2BZDQV36.js → agentDeleteCommand-C5PIEBMZ.js} +27 -26
- package/{agentEmailCommands-2QJDGRMB.js → agentEmailCommands-QTGQ3ZAD.js} +57 -55
- package/{agentListCommands-6VEPTKBI.js → agentListCommands-LRHBS3A5.js} +30 -26
- package/{agentMachineCommands-NVVHNWYI.js → agentMachineCommands-4PXIT4BP.js} +25 -24
- package/{agentRecordCommands-4GGRDMD4.js → agentRecordCommands-ZZPTYTYR.js} +52 -50
- package/{agentRunCommand-XOLQNKBZ.js → agentRunCommand-7ZTPZNUX.js} +55 -54
- package/{agentRunControl-Y5AFH5PQ.js → agentRunControl-SNUKXN6J.js} +6 -2
- package/{agentRuntimeLocal-7WYWCGL4.js → agentRuntimeLocal-QOYY5UV2.js} +19 -18
- package/{agentSlice-EAXPGEYV.js → agentSlice-J3W3RX2I.js} +5 -5
- package/{appDeleteCommands-77KR2RJ4.js → appDeleteCommands-7NS46XDH.js} +23 -22
- package/{appDeployCommands-K7CAHGBI.js → appDeployCommands-RSRNQ67U.js} +23 -22
- package/{appDeployStatusCommands-4OEKLTBT.js → appDeployStatusCommands-EF4RSGC6.js} +23 -22
- package/{appGetCommands-VM2WDLAZ.js → appGetCommands-YA7JWYUX.js} +23 -22
- package/{appListCommands-GX6BBA6U.js → appListCommands-WM2ON6JW.js} +23 -22
- package/{authCommand-DY6UUL6O.js → authCommand-HJP7FURK.js} +12 -13
- package/{authCommands-XTBV7OFZ.js → authCommands-NYZM2B2I.js} +4 -5
- package/{chunk-MKA6QE5E.js → chunk-2IPEVBUO.js} +126 -68
- package/{chunk-OWOHNGCN.js → chunk-2MBTWINN.js} +42 -3
- package/{chunk-K6EUAOW3.js → chunk-35RYGII3.js} +1 -1
- package/{chunk-TRT4I4UD.js → chunk-4POUK2BV.js} +2 -2
- package/{chunk-LLWKHDG4.js → chunk-4ULSC37S.js} +1 -3
- package/{chunk-EDV7EBOI.js → chunk-4ZH6GUJF.js} +2151 -1500
- package/{chunk-MVQ4TBSD.js → chunk-54VHTARN.js} +1 -1
- package/{chunk-L4F3I4SR.js → chunk-5HQQ4LUU.js} +4 -6
- package/{chunk-Z4NR32XR.js → chunk-5RGU3J7P.js} +13 -0
- package/{chunk-7BUYEZ6U.js → chunk-7H3UTGPM.js} +12 -72
- package/{chunk-RQN4SEKL.js → chunk-7W6GFNJL.js} +1 -1
- package/{chunk-HEGV7BH3.js → chunk-AQZCWJOG.js} +1 -1
- package/{chunk-3ND52WIL.js → chunk-ATWUOTJP.js} +180 -24
- package/chunk-CF7S2RYZ.js +376 -0
- package/{chunk-I2ZJKTG5.js → chunk-CGVRC2TB.js} +7 -7
- package/{chunk-UAIVG4J6.js → chunk-CHSCAUZN.js} +1 -8
- package/{chunk-KFEVY3ST.js → chunk-D34RI6NI.js} +18 -8
- package/{chunk-ROWQEJRP.js → chunk-DXJS7VSG.js} +3 -2
- package/{chunk-MHSGJW4Z.js → chunk-EHOYZRTI.js} +44 -14
- package/{chunk-XRZJGPFI.js → chunk-FON47ACC.js} +4 -4
- package/{chunk-SCTYAHYK.js → chunk-H2NAWOLH.js} +217 -141
- package/{chunk-MPVYDS7I.js → chunk-H6ODMJR3.js} +3 -3
- package/{chunk-R35XMF6F.js → chunk-H73ZV2GL.js} +352 -30
- package/{chunk-4T5F7YZQ.js → chunk-I6RJGORZ.js} +1 -1
- package/{chunk-OK6YSWLH.js → chunk-IICW77GI.js} +1 -1
- package/{chunk-VDXCXCXH.js → chunk-IUDMBCXC.js} +1 -1
- package/{chunk-AHCY2S2I.js → chunk-JADNODCQ.js} +1 -1
- package/{chunk-DFCFMCY6.js → chunk-JBLY6HQP.js} +2 -2
- package/{chunk-UGUW3FHG.js → chunk-JMSCXQUG.js} +2 -2
- package/{chunk-N54HIJVJ.js → chunk-KFUCLS7Z.js} +101 -9
- package/{chunk-FQZZLA3C.js → chunk-KXKQO4Q6.js} +17 -0
- package/{chunk-3Q7WHGCB.js → chunk-L65QKSVJ.js} +1 -1
- package/{chunk-3ZX7PERL.js → chunk-LALVWNE4.js} +20 -7
- package/{chunk-PJSV3IZ5.js → chunk-M3TMVJKG.js} +1 -1
- package/{chunk-REA4JLBH.js → chunk-M5OZCOBV.js} +7 -6
- package/{chunk-JLA4FXYC.js → chunk-MALVZUYL.js} +1 -1
- package/{chunk-GFUIQ4RY.js → chunk-MXFQHRSS.js} +1 -1
- package/{chunk-LSFAWXKC.js → chunk-N7J63Q6C.js} +1 -0
- package/{chunk-6Y7A3OQQ.js → chunk-NRY4GCKJ.js} +2 -0
- package/{chunk-G5U6LDLG.js → chunk-NVHPMDSZ.js} +6 -6
- package/{chunk-23FZYPLC.js → chunk-OJFYT3ZQ.js} +842 -1060
- package/{chunk-ELT65PZW.js → chunk-OXLLFZNF.js} +1 -1
- package/{chunk-CZ6NYQTV.js → chunk-P4QWLZGU.js} +2 -2
- package/{chunk-5MIDPSSK.js → chunk-PB7G5MAM.js} +3 -3
- package/{chunk-HWW2M4SN.js → chunk-QLVWFXZQ.js} +5 -4
- package/{chunk-VYHDJEQD.js → chunk-QNLLGS37.js} +136 -78
- package/{chunk-XHG22OEX.js → chunk-ROJI6DRT.js} +2 -2
- package/{chunk-BV4VEE3W.js → chunk-ROYOKSX4.js} +243 -354
- package/{chunk-VNAEBGDK.js → chunk-RZNYL4LW.js} +123 -26
- package/{chunk-RVOUXDFU.js → chunk-S6KVFOUG.js} +6 -34
- package/{chunk-V3ED5AWK.js → chunk-S77SCVBU.js} +27 -16
- package/{chunk-UBHAWFQ6.js → chunk-S7RWIPDI.js} +42 -19
- package/{chunk-B5TOXZAK.js → chunk-SIZQB7BD.js} +1 -1
- package/{chunk-DFFIZ25G.js → chunk-SLOGKB7M.js} +4 -1
- package/{chunk-FXUSIQC2.js → chunk-SROR5TSM.js} +1 -1
- package/{chunk-PIZYJVHQ.js → chunk-TN4YHAI3.js} +4 -4
- package/{chunk-IYEXFJPC.js → chunk-TW35GDNW.js} +64 -57
- package/chunk-UZ6XXCVR.js +50 -0
- package/{chunk-DKZFOK24.js → chunk-UZH44DWK.js} +7 -288
- package/{chunk-YGW4G5W5.js → chunk-X546QUDT.js} +61 -12
- package/chunk-YYLHWIW6.js +48 -0
- package/{chunk-SWDPIPOY.js → chunk-ZGVW7MSZ.js} +1 -1
- package/{chunk-34WPV75U.js → chunk-ZUXIXYJI.js} +1 -1
- package/{chunk-VC6OZXO5.js → chunk-ZWJOGMKH.js} +2 -26
- package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
- package/{codingSkills-36KN5NQT.js → codingSkills-EN6Z6G6U.js} +4 -4
- package/{createAgentAutomationAction-GNFF524X.js → createAgentAutomationAction-MKQWN4VQ.js} +19 -18
- package/{createDialogAction-RB55KCLO.js → createDialogAction-YWIZPLFS.js} +22 -20
- package/{createPageAction-Y7343GLU.js → createPageAction-74TTEIPC.js} +20 -19
- package/{db-W3O47YGF.js → db-W5UHK4P3.js} +150 -0
- package/{dbSlice-CGSRFJN3.js → dbSlice-5BKDURDL.js} +4 -4
- package/{dialogCommands-IAZK6YHQ.js → dialogCommands-MJIP32FL.js} +24 -23
- package/{dialogSlice-UQAXF23P.js → dialogSlice-KLLVH4WI.js} +24 -18
- package/{docCreateCommands-I2EWZGCI.js → docCreateCommands-5DN472U6.js} +24 -27
- package/{docDeleteCommands-IZ45UZKG.js → docDeleteCommands-HE76LBN4.js} +25 -24
- package/{docReadCommands-R6Z4QJYU.js → docReadCommands-XVGZSCBS.js} +24 -23
- package/{docStore-5HOJ4D7D.js → docStore-SPH3D6BT.js} +20 -19
- package/{docUpdateCommands-2LRBKQPY.js → docUpdateCommands-P7IAWUAD.js} +24 -27
- package/{fetchMessages-BMGVZVSE.js → fetchMessages-W4IKHPCS.js} +2 -3
- package/{getPricing-G7DLAST6.js → getPricing-WENPBVWH.js} +3 -3
- package/{handleSendMessageAction-Q4HY35WX.js → handleSendMessageAction-ZU6WJVL7.js} +23 -20
- package/index.js +74 -74
- package/{localDialogRead-4H3QJFLW.js → localDialogRead-JXTAHW2E.js} +2 -2
- package/{machineCommands-PKBPQKTY.js → machineCommands-NI76PVHK.js} +59 -57
- package/{machineWsRunDispatch-UZAW4OXJ.js → machineWsRunDispatch-W3G6NJVQ.js} +51 -49
- package/{models-DJFSJ7SW.js → models-DB27UAE3.js} +2 -2
- package/package.json +1 -1
- package/{read-3FMPZPER.js → read-F3L3T2WJ.js} +2 -1
- package/{readDocTool-VSYHKK3V.js → readDocTool-FOHWVA4R.js} +1 -1
- package/{readlineWorkspace-Y2RDOFZG.js → readlineWorkspace-BDH4G477.js} +880 -425
- package/{removeDialogAgentAction-OAGA2G3U.js → removeDialogAgentAction-QCFGIUIH.js} +8 -7
- package/{runAgentClientLoop-NBPIKJ6J.js → runAgentClientLoop-ZPKMXCM5.js} +45 -38
- package/{setDialogExtraReferencesAction-JZEXA5SL.js → setDialogExtraReferencesAction-DK4CKERU.js} +5 -5
- package/{setPrimaryDialogAgentAction-4ZUQQKDG.js → setPrimaryDialogAgentAction-SJSO6N27.js} +8 -7
- package/{settingSlice-7MNKHZ6R.js → settingSlice-XNM5AFPU.js} +6 -5
- package/{spaceCommands-DHCZ7J5I.js → spaceCommands-3GGBJRQR.js} +25 -24
- package/{spaceSlice-ZXLLG3CR.js → spaceSlice-47Z6XLFQ.js} +21 -18
- package/{streamAgentChatTurn-L3YW6LSB.js → streamAgentChatTurn-VT5K5JSD.js} +140 -98
- package/switchDialogAgentAction-4OAC6QRN.js +61 -0
- package/{tableCommands-BEQAGE4I.js → tableCommands-HEQYT2KP.js} +1 -1
- package/{toolApiClient-QI3YBNWB.js → toolApiClient-ISM4ZQX4.js} +2 -2
- package/{tools-ECGXR5QF.js → tools-L7RCHAPT.js} +36 -33
- package/{tuiSummaryLlmCaller-OMSCNHXA.js → tuiSummaryLlmCaller-3DYOLTVN.js} +6 -6
- package/{updateCommands-XTW55TOT.js → updateCommands-HTCOBXCA.js} +2 -2
- package/{updateDialogTitleAction-HQ2EUDFT.js → updateDialogTitleAction-KMPVPQ4A.js} +28 -27
- package/chunk-DL6EPNIK.js +0 -50
- package/chunk-V5R4NZP2.js +0 -78
- package/chunk-X4Q4UZEY.js +0 -26
- package/queryRunOverlay-O4LOMMPO.js +0 -161
- package/runOverlayPresentation-ZO4VCWEU.js +0 -11
- package/types-ZSTJ7MPR.js +0 -7
- package/{chunk-X7W4TNB4.js → chunk-CMKUBIGW.js} +3 -3
- package/{runtimeDoctorCommands-E2OUORHK.js → runtimeDoctorCommands-HSU632DY.js} +3 -3
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
extractThinkContent,
|
|
4
4
|
flushThinkParser,
|
|
5
5
|
flushToolCallTextParserIntoCallback,
|
|
6
|
+
longestTagPrefixLength,
|
|
6
7
|
processContentChunkWithToolCallStripping,
|
|
7
8
|
processThinkChunk
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N7J63Q6C.js";
|
|
9
10
|
import {
|
|
10
11
|
convertMessagesToResponsesInput,
|
|
11
12
|
extractTextFromResponseOutput,
|
|
@@ -14,7 +15,7 @@ import {
|
|
|
14
15
|
shouldStripReasoningContentForOutbound,
|
|
15
16
|
toOpenAiCompatibleMessages,
|
|
16
17
|
toResponsesTools
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-D34RI6NI.js";
|
|
18
19
|
import {
|
|
19
20
|
buildProviderExecutionPlan,
|
|
20
21
|
canUsePlatformChatProvider,
|
|
@@ -23,7 +24,7 @@ import {
|
|
|
23
24
|
resolvePlatformAuthToken,
|
|
24
25
|
resolvePlatformServerUrl,
|
|
25
26
|
resolveProviderTransportDecision
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-EHOYZRTI.js";
|
|
27
28
|
import {
|
|
28
29
|
clipCompactText
|
|
29
30
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -59,6 +60,90 @@ function providerHttpFailure(args) {
|
|
|
59
60
|
);
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
// packages/agent-runtime/deepseekDsmlParser.ts
|
|
64
|
+
var DSML_OPEN = "<\uFF5C\uFF5CDSML\uFF5C\uFF5Ctool_calls>";
|
|
65
|
+
var DSML_CLOSE = "</\uFF5C\uFF5CDSML\uFF5C\uFF5Ctool_calls>";
|
|
66
|
+
var DSML_INVOKE_RE = /<||DSML||invoke\s+name="([^"]+)">([\s\S]*?)<\/||DSML||invoke>/g;
|
|
67
|
+
var DSML_PARAMETER_RE = /<||DSML||parameter\s+([^>]+)>([\s\S]*?)<\/||DSML||parameter>/g;
|
|
68
|
+
function createDsmlParserState() {
|
|
69
|
+
return { mode: "content", buffer: "" };
|
|
70
|
+
}
|
|
71
|
+
function parseAttributes(raw) {
|
|
72
|
+
return {
|
|
73
|
+
name: raw.match(/(?:^|\s)name="([^"]+)"/)?.[1],
|
|
74
|
+
stringFlag: raw.match(/(?:^|\s)string="(true|false)"/)?.[1]
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function decode(value) {
|
|
78
|
+
return value.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
79
|
+
}
|
|
80
|
+
function parseValue(value) {
|
|
81
|
+
try {
|
|
82
|
+
return JSON.parse(value);
|
|
83
|
+
} catch {
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function parseCalls(text) {
|
|
88
|
+
const calls = [];
|
|
89
|
+
for (const match of text.matchAll(DSML_INVOKE_RE)) {
|
|
90
|
+
const args = {};
|
|
91
|
+
for (const parameter of match[2].matchAll(DSML_PARAMETER_RE)) {
|
|
92
|
+
const attrs = parseAttributes(parameter[1]);
|
|
93
|
+
if (!attrs.name) continue;
|
|
94
|
+
const value = decode(parameter[2]);
|
|
95
|
+
args[attrs.name] = attrs.stringFlag === "true" ? value : attrs.stringFlag === "false" ? parseValue(value) : value;
|
|
96
|
+
}
|
|
97
|
+
const name = match[1];
|
|
98
|
+
if (name === "readFile" && args.path === void 0 && args.file !== void 0) {
|
|
99
|
+
args.path = args.file;
|
|
100
|
+
delete args.file;
|
|
101
|
+
}
|
|
102
|
+
calls.push({ name, arguments: JSON.stringify(args) });
|
|
103
|
+
}
|
|
104
|
+
return calls;
|
|
105
|
+
}
|
|
106
|
+
function pushDsmlChunk(chunk, state) {
|
|
107
|
+
state.buffer += chunk;
|
|
108
|
+
let content = "";
|
|
109
|
+
const toolCalls = [];
|
|
110
|
+
while (true) {
|
|
111
|
+
if (state.mode === "content") {
|
|
112
|
+
const index = state.buffer.indexOf(DSML_OPEN);
|
|
113
|
+
if (index < 0) {
|
|
114
|
+
const keep = longestTagPrefixLength(state.buffer, DSML_OPEN);
|
|
115
|
+
content += state.buffer.slice(0, state.buffer.length - keep);
|
|
116
|
+
state.buffer = state.buffer.slice(state.buffer.length - keep);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
content += state.buffer.slice(0, index);
|
|
120
|
+
state.buffer = state.buffer.slice(index + DSML_OPEN.length);
|
|
121
|
+
state.mode = "dsml";
|
|
122
|
+
} else {
|
|
123
|
+
const index = state.buffer.indexOf(DSML_CLOSE);
|
|
124
|
+
if (index < 0) break;
|
|
125
|
+
toolCalls.push(...parseCalls(state.buffer.slice(0, index)));
|
|
126
|
+
state.buffer = state.buffer.slice(index + DSML_CLOSE.length);
|
|
127
|
+
state.mode = "content";
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return { content, toolCalls };
|
|
131
|
+
}
|
|
132
|
+
function finishDsml(state) {
|
|
133
|
+
const result = { content: "", toolCalls: [] };
|
|
134
|
+
if (state.mode === "dsml") result.toolCalls.push(...parseCalls(state.buffer));
|
|
135
|
+
else result.content = state.buffer;
|
|
136
|
+
state.mode = "content";
|
|
137
|
+
state.buffer = "";
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
function parseDsml(text) {
|
|
141
|
+
const state = createDsmlParserState();
|
|
142
|
+
const chunk = pushDsmlChunk(text, state);
|
|
143
|
+
const tail = finishDsml(state);
|
|
144
|
+
return { content: chunk.content + tail.content, toolCalls: [...chunk.toolCalls, ...tail.toolCalls] };
|
|
145
|
+
}
|
|
146
|
+
|
|
62
147
|
// packages/agent-runtime/processChatCompletionDelta.ts
|
|
63
148
|
function extractChatCompletionStreamError(parsed) {
|
|
64
149
|
const raw = parsed?.error;
|
|
@@ -204,6 +289,9 @@ function shouldDisableThinking(providerConfig) {
|
|
|
204
289
|
function isResponsesEndpoint(endpoint) {
|
|
205
290
|
return /\/responses$/i.test(endpoint.trim());
|
|
206
291
|
}
|
|
292
|
+
function buildDsmlToolCallId(baseCount, index) {
|
|
293
|
+
return `dsml-${baseCount + index + 1}`;
|
|
294
|
+
}
|
|
207
295
|
function toResponsesRequestOptions(options) {
|
|
208
296
|
const next = { ...options };
|
|
209
297
|
const reasoningEffort = next.reasoning_effort;
|
|
@@ -266,9 +354,7 @@ function buildPlatformChatCompletionRequest(args) {
|
|
|
266
354
|
const body = {
|
|
267
355
|
model: args.providerConfig.model,
|
|
268
356
|
...usesResponsesApi ? {
|
|
269
|
-
input: convertMessagesToResponsesInput(args.messages
|
|
270
|
-
stripReasoningContent: shouldStripReasoning
|
|
271
|
-
})
|
|
357
|
+
input: convertMessagesToResponsesInput(args.messages)
|
|
272
358
|
} : {
|
|
273
359
|
messages: toOpenAiCompatibleMessages(args.messages, {
|
|
274
360
|
stripReasoningContent: shouldStripReasoning
|
|
@@ -353,13 +439,19 @@ function parsePlatformChatCompletionData(raw) {
|
|
|
353
439
|
}
|
|
354
440
|
function parsePlatformChatCompletionResponse(args) {
|
|
355
441
|
if (isResponsesEndpoint(args.providerConfig.endpoint)) {
|
|
356
|
-
const
|
|
442
|
+
const rawContent2 = extractTextFromResponseOutput(args.data);
|
|
443
|
+
const dsml = parseDsml(rawContent2);
|
|
357
444
|
const tool_calls = extractToolCallsFromResponseOutput(args.data);
|
|
445
|
+
const normalizedToolCalls = tool_calls.length > 0 ? tool_calls : dsml.toolCalls.map((call, index) => ({
|
|
446
|
+
id: buildDsmlToolCallId(tool_calls.length, index),
|
|
447
|
+
type: "function",
|
|
448
|
+
function: { name: call.name, arguments: call.arguments }
|
|
449
|
+
}));
|
|
358
450
|
return {
|
|
359
|
-
content:
|
|
451
|
+
content: dsml.content,
|
|
360
452
|
model: args.providerConfig.model,
|
|
361
453
|
provider: args.providerConfig.provider,
|
|
362
|
-
...
|
|
454
|
+
...normalizedToolCalls.length > 0 ? { tool_calls: normalizedToolCalls } : {},
|
|
363
455
|
stream_complete: true,
|
|
364
456
|
usage: args.data?.usage,
|
|
365
457
|
trace: args.trace
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
// packages/ai/tools/agent/agentRunDisplayHelpers.ts
|
|
2
|
+
function buildDelegatedTaskContent(task, input) {
|
|
3
|
+
if (input === void 0 || input === null) {
|
|
4
|
+
return task;
|
|
5
|
+
}
|
|
6
|
+
if (typeof input === "string") {
|
|
7
|
+
return `${task}
|
|
8
|
+
|
|
9
|
+
--- INPUT (text) ---
|
|
10
|
+
${input}`;
|
|
11
|
+
}
|
|
12
|
+
const jsonStr = JSON.stringify(input, null, 2);
|
|
13
|
+
return `${task}
|
|
14
|
+
|
|
15
|
+
--- INPUT (json) ---
|
|
16
|
+
${jsonStr}`;
|
|
17
|
+
}
|
|
2
18
|
function getAgentRunStatusIcon(status) {
|
|
3
19
|
switch (status) {
|
|
4
20
|
case "running":
|
|
@@ -204,6 +220,7 @@ function isAgentRunTerminalStatus(status) {
|
|
|
204
220
|
}
|
|
205
221
|
|
|
206
222
|
export {
|
|
223
|
+
buildDelegatedTaskContent,
|
|
207
224
|
getAgentRunStatusIcon,
|
|
208
225
|
shortRunId,
|
|
209
226
|
clipText,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isOAuthApiKeyRef
|
|
3
|
+
} from "./chunk-YYLHWIW6.js";
|
|
1
4
|
import {
|
|
2
5
|
getModelAbility
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4ULSC37S.js";
|
|
4
7
|
|
|
5
8
|
// packages/ai/agent/safeAgentSummary.ts
|
|
6
9
|
function parseTimestamp(val) {
|
|
@@ -103,10 +106,12 @@ function toSafeAgentSummary(record, options) {
|
|
|
103
106
|
const favStatus = resolveFavoriteStatus(record, options);
|
|
104
107
|
const isPublic = record?.isPublic === true || record?.isPublicFlag === true || record?.publicRecordExists === true;
|
|
105
108
|
const updatedAt = safeTimestamp(record?.updatedAt ?? record?.createdAt ?? record?.created);
|
|
109
|
+
const nextAvailableAt = typeof record?.nextAvailableAt === "number" && Number.isFinite(record.nextAvailableAt) ? record.nextAvailableAt : void 0;
|
|
106
110
|
const currentUserId = options?.userId;
|
|
107
111
|
const isOwnedByRecord = Boolean(currentUserId) && (typeof record?.userId === "string" && record.userId === currentUserId || typeof record?.ownerId === "string" && record.ownerId === currentUserId);
|
|
108
112
|
const isOwnedByDbKey = Boolean(currentUserId) && typeof record?.dbKey === "string" && record.dbKey.startsWith(`agent-${currentUserId}-`);
|
|
109
113
|
const isOwned = isOwnedByRecord || isOwnedByDbKey;
|
|
114
|
+
const isOAuth = isOAuthApiKeyRef(record?.apiKeyRef);
|
|
110
115
|
let agentKey;
|
|
111
116
|
if (Boolean(currentUserId) && id) {
|
|
112
117
|
if (isOwned) {
|
|
@@ -134,19 +139,27 @@ function toSafeAgentSummary(record, options) {
|
|
|
134
139
|
favoritedAt: favStatus.favoritedAt,
|
|
135
140
|
isPublic,
|
|
136
141
|
isOwned,
|
|
142
|
+
isOAuth,
|
|
143
|
+
...nextAvailableAt !== void 0 ? { nextAvailableAt } : {},
|
|
137
144
|
updatedAt
|
|
138
145
|
};
|
|
139
146
|
}
|
|
140
147
|
function sortSafeAgentSummaries(agents) {
|
|
141
148
|
return [...agents].sort((left, right) => {
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
149
|
+
const isUserConfigured = (agent) => agent.isOAuth === true || agent.isOwned === true && agent.apiSource === "custom";
|
|
150
|
+
const priority = (agent) => {
|
|
151
|
+
const favorite = agent.isFavorite === true;
|
|
152
|
+
const configured = isUserConfigured(agent);
|
|
153
|
+
if (favorite && configured) return 0;
|
|
154
|
+
if (favorite) return 1;
|
|
155
|
+
if (configured) return 2;
|
|
156
|
+
if (agent.isOwned === true) return 3;
|
|
157
|
+
return 4;
|
|
158
|
+
};
|
|
159
|
+
const priorityDiff = priority(left) - priority(right);
|
|
160
|
+
if (priorityDiff !== 0) return priorityDiff;
|
|
146
161
|
const leftFav = left.isFavorite === true;
|
|
147
162
|
const rightFav = right.isFavorite === true;
|
|
148
|
-
if (leftFav && !rightFav) return -1;
|
|
149
|
-
if (!leftFav && rightFav) return 1;
|
|
150
163
|
if (leftFav && rightFav) {
|
|
151
164
|
const leftFavAt = parseTimestamp(left.favoritedAt);
|
|
152
165
|
const rightFavAt = parseTimestamp(right.favoritedAt);
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
patch,
|
|
12
12
|
remove,
|
|
13
13
|
write
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FON47ACC.js";
|
|
15
15
|
import {
|
|
16
16
|
createAgentKey,
|
|
17
17
|
toTrimmedString
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NRY4GCKJ.js";
|
|
19
19
|
import {
|
|
20
20
|
asyncThunkCreator,
|
|
21
21
|
buildCreateSlice,
|
|
@@ -300,7 +300,7 @@ var slice = createSliceWithThunks({
|
|
|
300
300
|
const overrides = {};
|
|
301
301
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
302
302
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
303
|
-
const { _executeModel } = await import("./_executeModel-
|
|
303
|
+
const { _executeModel } = await import("./_executeModel-ARCMGGMY.js");
|
|
304
304
|
return _executeModel(
|
|
305
305
|
{
|
|
306
306
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -321,7 +321,7 @@ var slice = createSliceWithThunks({
|
|
|
321
321
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
322
322
|
*/
|
|
323
323
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
324
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
324
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-ZPKMXCM5.js");
|
|
325
325
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
326
326
|
{
|
|
327
327
|
agentKey: args.agentKey,
|
|
@@ -337,7 +337,7 @@ var slice = createSliceWithThunks({
|
|
|
337
337
|
* 聊天轮次流式 Agent 调用
|
|
338
338
|
*/
|
|
339
339
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
340
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
340
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-VT5K5JSD.js");
|
|
341
341
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
342
342
|
}),
|
|
343
343
|
/**
|
|
@@ -415,7 +415,8 @@ var slice = createSliceWithThunks({
|
|
|
415
415
|
credentialRef,
|
|
416
416
|
createRawApiKey
|
|
417
417
|
);
|
|
418
|
-
} catch {
|
|
418
|
+
} catch (error) {
|
|
419
|
+
console.error("[agent-credential-sync] push failed", error instanceof Error ? error.message : "unknown error");
|
|
419
420
|
}
|
|
420
421
|
}
|
|
421
422
|
}
|
|
@@ -2755,6 +2755,8 @@ var createTokenKey = {
|
|
|
2755
2755
|
record: (0, import_rambda.curry)(
|
|
2756
2756
|
(userId, timestamp) => createKey("token", userId, timestamp.toString())
|
|
2757
2757
|
),
|
|
2758
|
+
/** Server provider-call record: retry-stable even when the retry clock changes. */
|
|
2759
|
+
recordForStableCall: (userId, callId) => createKey("token", userId, "call", encodeURIComponent(callId)),
|
|
2758
2760
|
range: (userId, timestamp) => ({
|
|
2759
2761
|
start: createKey("token", userId, timestamp.toString()),
|
|
2760
2762
|
end: createKey("token", userId, (timestamp + 864e5).toString())
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H2NAWOLH.js";
|
|
4
4
|
import {
|
|
5
5
|
require_date_fns
|
|
6
6
|
} from "./chunk-M76ECQRD.js";
|
|
7
|
-
import {
|
|
8
|
-
toErrorMessage
|
|
9
|
-
} from "./chunk-HNMXYYJR.js";
|
|
10
7
|
import {
|
|
11
8
|
require_react
|
|
12
9
|
} from "./chunk-3ASDTTEI.js";
|
|
10
|
+
import {
|
|
11
|
+
toErrorMessage
|
|
12
|
+
} from "./chunk-HNMXYYJR.js";
|
|
13
13
|
import {
|
|
14
14
|
patch,
|
|
15
15
|
readAndWait
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FON47ACC.js";
|
|
17
17
|
import {
|
|
18
18
|
asOptionalTrimmedString
|
|
19
19
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
async function createDocState(args, thunkApi) {
|
|
370
|
-
const { createPageAction } = await import("./createPageAction-
|
|
370
|
+
const { createPageAction } = await import("./createPageAction-74TTEIPC.js");
|
|
371
371
|
return createPageAction(args, thunkApi);
|
|
372
372
|
}
|
|
373
373
|
function subscribe(listener) {
|