nolo-cli 0.48.0 → 0.49.0
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-36GKPAEZ.js → _executeModel-KE4PQSZ3.js} +19 -19
- package/{agentDeleteCommand-SBODEUPE.js → agentDeleteCommand-Z67TJG3W.js} +10 -10
- package/{agentEmailCommands-ME7BCY5S.js → agentEmailCommands-7LPIK7JE.js} +23 -23
- package/{agentListCommands-QBWPKN5D.js → agentListCommands-5J2IM3IT.js} +12 -12
- package/{agentMachineCommands-KFFUPELZ.js → agentMachineCommands-YXH6FXUQ.js} +11 -11
- package/{agentRecordCommands-4BF6JIHS.js → agentRecordCommands-GZLCDVUS.js} +22 -22
- package/{agentRunCommand-4MA7D6SV.js → agentRunCommand-WYH5Q54Q.js} +22 -22
- package/{agentRuntimeLocal-RD52NPCG.js → agentRuntimeLocal-A6EF3RUY.js} +10 -10
- package/{agentSlice-AJABGQHU.js → agentSlice-ARTDF6VD.js} +1 -1
- package/{appDeleteCommands-I42NL3LP.js → appDeleteCommands-V2B7ZCLC.js} +10 -10
- package/{appDeployCommands-CZWHXVPU.js → appDeployCommands-AXQU44RD.js} +10 -10
- package/{appDeployStatusCommands-PIQYXACM.js → appDeployStatusCommands-FWGSC2UM.js} +10 -10
- package/{appGetCommands-CI2OWLT7.js → appGetCommands-67R3RFZK.js} +10 -10
- package/{appListCommands-LWLSHPCP.js → appListCommands-TTASJPGV.js} +10 -10
- package/{authCommand-WLWOEVYI.js → authCommand-QOPOEYEK.js} +7 -7
- package/{chatQueueReduxAdapter-V37RK3A6.js → chatQueueReduxAdapter-6CAHUQ4O.js} +7 -7
- package/{chunk-Y7TGWSUN.js → chunk-56W233KG.js} +1 -1
- package/{chunk-C2WF2OY7.js → chunk-5WADL4O7.js} +1 -1
- package/{chunk-DFY6O64O.js → chunk-6SMMK7MD.js} +2 -2
- package/{chunk-4ZL2KBI7.js → chunk-757BGY6Y.js} +1 -1
- package/{chunk-XPW6JLOB.js → chunk-AVKUDHJO.js} +3 -3
- package/{chunk-VKSBVRGP.js → chunk-CVT7L2WZ.js} +1 -1
- package/{chunk-PGKZ2KGE.js → chunk-EURF2SV6.js} +11 -11
- package/{chunk-QF27IZB3.js → chunk-EXDR5D6X.js} +3 -3
- package/{chunk-AZ6DT2UD.js → chunk-GBADO3SM.js} +1 -1
- package/{chunk-XB7ACJFH.js → chunk-GDGIEGHV.js} +2 -2
- package/{chunk-PJASTA2U.js → chunk-GFD7TIZU.js} +2 -2
- package/{chunk-IVKEJD7I.js → chunk-GFUOVFQA.js} +1 -1
- package/{chunk-H5QLIP6S.js → chunk-HCMFFI2G.js} +2 -2
- package/{chunk-TZRB2I2M.js → chunk-HPZL4IBN.js} +9 -9
- package/{chunk-QTH72J3N.js → chunk-IKSFDJXB.js} +112 -19
- package/{chunk-W3RZLXMA.js → chunk-IKTHA3JH.js} +2 -2
- package/{chunk-67Q6IHM5.js → chunk-IRJVFYOH.js} +87 -45
- package/{chunk-CY5KIIPU.js → chunk-K524MUQC.js} +8 -8
- package/{chunk-OZKJBDG4.js → chunk-NN3AMBY3.js} +1 -1
- package/{chunk-BO3YFOZR.js → chunk-QDHZCAH3.js} +1 -1
- package/{chunk-POLE2QLO.js → chunk-QUCSAM43.js} +94 -27
- package/{chunk-Z7A54NFZ.js → chunk-RU5D3B22.js} +1 -1
- package/{chunk-JBL24PK6.js → chunk-SP3DPVBH.js} +2 -2
- package/{chunk-F22JQTSX.js → chunk-SW7RCUGA.js} +2 -2
- package/{chunk-3YVCM5PE.js → chunk-U5Z7LFZF.js} +1 -1
- package/{chunk-JVKFKKYN.js → chunk-UQWFIWHX.js} +1 -1
- package/{chunk-AV4Z57LV.js → chunk-VRJUIUIY.js} +2 -2
- package/{chunk-5SLTA66C.js → chunk-WKOEOQCI.js} +13 -13
- package/{chunk-VFN256RI.js → chunk-WL3UOGYO.js} +25 -0
- package/{chunk-KOZ2G3ZG.js → chunk-WX5E6HZS.js} +3 -3
- package/{createAgentAutomationAction-5OZIWOK4.js → createAgentAutomationAction-7BBF5YXN.js} +8 -8
- package/{createDialogAction-334CHPJF.js → createDialogAction-B5URPHP4.js} +9 -9
- package/{createPageAction-LXY22WTA.js → createPageAction-ISJKM5Q3.js} +8 -8
- package/{dialogCommands-4MGUHAJI.js → dialogCommands-XHH4MVA4.js} +10 -10
- package/{dialogSlice-76W7S3C4.js → dialogSlice-NRAN5X7F.js} +7 -7
- package/{docCreateCommands-346W5443.js → docCreateCommands-FUN2Z7HQ.js} +10 -10
- package/{docDeleteCommands-FKEEPUUS.js → docDeleteCommands-OZDPFXPF.js} +10 -10
- package/{docReadCommands-AACI4DVO.js → docReadCommands-FIPK7LE3.js} +10 -10
- package/{docStore-N7QTPHAX.js → docStore-LUS7SWC3.js} +9 -9
- package/{docUpdateCommands-WHWVZ2XE.js → docUpdateCommands-BZ5GKAN4.js} +10 -10
- package/{getPricing-JNOCWYDH.js → getPricing-HAU62AFM.js} +3 -3
- package/{handleSendMessageAction-EAXEX5AX.js → handleSendMessageAction-RA4OD2ZH.js} +7 -7
- package/index.js +47 -47
- package/{machineCommands-XNWLQVTN.js → machineCommands-WDAYEFBE.js} +22 -22
- package/{machineWsRunDispatch-56HWQ67L.js → machineWsRunDispatch-TPQ2FQVS.js} +22 -22
- package/{models-N4NXQ44D.js → models-4QF4BJVY.js} +2 -2
- package/package.json +1 -1
- package/{readlineWorkspace-AXTB7DJC.js → readlineWorkspace-HN44KGIF.js} +86 -33
- package/{runAgentClientLoop-PU3R3UXA.js → runAgentClientLoop-ZYUI22EA.js} +17 -17
- package/{spaceCommands-JYI3X4N2.js → spaceCommands-OJ2567D4.js} +10 -10
- package/{spaceSlice-ERZ3RGWC.js → spaceSlice-F7JCOZEF.js} +8 -8
- package/{streamAgentChatTurn-2IH4MTQC.js → streamAgentChatTurn-FNFMMGNN.js} +20 -20
- package/{tools-DJUTQEMP.js → tools-QCDR3UMD.js} +12 -12
- package/{tuiSummaryLlmCaller-U4EGD2SX.js → tuiSummaryLlmCaller-LCGT62QC.js} +5 -5
- package/{updateDialogTitleAction-OVOPGTC3.js → updateDialogTitleAction-Y3OGJWDB.js} +8 -8
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
refreshAntigravityOAuthToken,
|
|
5
5
|
refreshOpenAiCodexToken,
|
|
6
6
|
xaiRefresh
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-U5Z7LFZF.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultLoopbackRequest
|
|
10
10
|
} from "./chunk-EADNWBAZ.js";
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
import {
|
|
57
57
|
inlineImageUrlsForCustomProvider,
|
|
58
58
|
prepareTools
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-HCMFFI2G.js";
|
|
60
60
|
import {
|
|
61
61
|
getServerProviderSecret
|
|
62
62
|
} from "./chunk-HS7MLR74.js";
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
isAntigravityOAuthAgent,
|
|
66
66
|
readAntigravityProjectId,
|
|
67
67
|
resolveAntigravityCloudCodeBaseUrl
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-757BGY6Y.js";
|
|
69
69
|
import {
|
|
70
70
|
deleteMemoryFunctionSchema,
|
|
71
71
|
readXPostFunc,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
rememberMemoryFunctionSchema,
|
|
76
76
|
resolveAgentRequiredPackIds,
|
|
77
77
|
setTodoListFunc
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-WKOEOQCI.js";
|
|
79
79
|
import {
|
|
80
80
|
fetchWithTransientRetry,
|
|
81
81
|
isTransientFetchError
|
|
@@ -98,13 +98,13 @@ import {
|
|
|
98
98
|
prepareTokenUsageData,
|
|
99
99
|
resolveBuiltinPlatformAgentConfig,
|
|
100
100
|
runKeyed
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-EURF2SV6.js";
|
|
102
102
|
import {
|
|
103
103
|
BUILTIN_TITLE_LLM_CONFIG
|
|
104
104
|
} from "./chunk-EVBFYPDC.js";
|
|
105
105
|
import {
|
|
106
106
|
fetchServerSyncedCredential
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-WX5E6HZS.js";
|
|
108
108
|
import {
|
|
109
109
|
require_date_fns
|
|
110
110
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -131,6 +131,7 @@ import {
|
|
|
131
131
|
codexStreamFailureStatus,
|
|
132
132
|
createHybridRecordStore,
|
|
133
133
|
createLocalWorkspaceToolExecutors,
|
|
134
|
+
evaluateFileWritePolicy,
|
|
134
135
|
executeLocalToolWithPolicy,
|
|
135
136
|
executeOpenAiCompatibleChatCompletion,
|
|
136
137
|
filterRetainedLedgerRecords,
|
|
@@ -143,7 +144,7 @@ import {
|
|
|
143
144
|
parseSyncServersEnv,
|
|
144
145
|
resolveOpenAiCompatibleProviderConfig,
|
|
145
146
|
summarizeToolArguments
|
|
146
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-IKSFDJXB.js";
|
|
147
148
|
import {
|
|
148
149
|
buildPlatformChatCompletionRequest,
|
|
149
150
|
canUsePlatformChatProvider,
|
|
@@ -155,18 +156,18 @@ import {
|
|
|
155
156
|
resolvePlatformChatProviderConfig,
|
|
156
157
|
shouldUsePlatformChatProvider,
|
|
157
158
|
streamSseDataValues
|
|
158
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-GDGIEGHV.js";
|
|
159
160
|
import {
|
|
160
161
|
resolveAgentRuntimeConfigFromRecord,
|
|
161
162
|
resolveHistoricalToolContentCap
|
|
162
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-CVT7L2WZ.js";
|
|
163
164
|
import {
|
|
164
165
|
convertMessagesToResponsesInput,
|
|
165
166
|
toResponsesTools
|
|
166
167
|
} from "./chunk-6BYAXNH5.js";
|
|
167
168
|
import {
|
|
168
169
|
resolvePlatformAuthToken
|
|
169
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-SP3DPVBH.js";
|
|
170
171
|
import {
|
|
171
172
|
buildNoloWorkspaceOpenAiTools,
|
|
172
173
|
parseNoloWorkspaceToolArguments,
|
|
@@ -198,7 +199,7 @@ import {
|
|
|
198
199
|
} from "./chunk-FD36SCCD.js";
|
|
199
200
|
import {
|
|
200
201
|
isAdaptiveThinkingModelId
|
|
201
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-QDHZCAH3.js";
|
|
202
203
|
import {
|
|
203
204
|
compactWhitespace
|
|
204
205
|
} from "./chunk-DWLEOOGR.js";
|
|
@@ -639,6 +640,12 @@ var STRINGS = {
|
|
|
639
640
|
en: "Log tail:",
|
|
640
641
|
zh: "\u65E5\u5FD7\u5C3E\u90E8\uFF1A"
|
|
641
642
|
},
|
|
643
|
+
// Normal-mode safe projection: the raw errorMessage/logLines of a failed run
|
|
644
|
+
// stay in pro/verbose; normal mode names the failure and points at pro.
|
|
645
|
+
runDiagnosticsHidden: {
|
|
646
|
+
en: "run failed \u2014 full diagnostics in pro mode",
|
|
647
|
+
zh: "\u8FD0\u884C\u5931\u8D25\u2014\u2014\u5B8C\u6574\u8BCA\u65AD\u89C1 pro \u6A21\u5F0F"
|
|
648
|
+
},
|
|
642
649
|
runsListLabel: {
|
|
643
650
|
en: "Runs ({0})",
|
|
644
651
|
zh: "\u8FD0\u884C ({0})"
|
|
@@ -1069,6 +1076,7 @@ Use /switch, /switch list, /switch minimax-m3, or a full agent key.`,
|
|
|
1069
1076
|
en: "Press Enter to run it now. Follow any prompts below, or Ctrl+C to cancel.",
|
|
1070
1077
|
zh: "\u6309 Enter \u7ACB\u5373\u6267\u884C\uFF0C\u6309\u4E0B\u65B9\u63D0\u793A\u64CD\u4F5C\uFF0C\u6216\u6309 Ctrl+C \u53D6\u6D88\u3002"
|
|
1071
1078
|
},
|
|
1079
|
+
actionGateConfirmHint: { en: "Enter=approve, n=cancel (or type y/yes).", zh: "Enter=\u6279\u51C6\uFF0Cn=\u53D6\u6D88\uFF08\u4E5F\u53EF\u8F93\u5165 y/yes\uFF09\u3002" },
|
|
1072
1080
|
actionGateInteractiveTitle: {
|
|
1073
1081
|
en: "This command requires an interactive terminal.",
|
|
1074
1082
|
zh: "\u8BE5\u547D\u4EE4\u9700\u8981\u4EA4\u4E92\u5F0F\u7EC8\u7AEF"
|
|
@@ -7780,6 +7788,7 @@ async function streamCursorChat(messages, options) {
|
|
|
7780
7788
|
const execCtx = {
|
|
7781
7789
|
tools: buildMcpToolDefinitions(options.tools),
|
|
7782
7790
|
executeTool: options.executeTool,
|
|
7791
|
+
...options.onActionGate ? { onActionGate: options.onActionGate } : {},
|
|
7783
7792
|
...options.searchWorkspace ? { searchWorkspace: options.searchWorkspace } : {},
|
|
7784
7793
|
...options.listWorkspaceEntries ? { listWorkspaceEntries: options.listWorkspaceEntries } : {},
|
|
7785
7794
|
toolCalls,
|
|
@@ -8323,6 +8332,23 @@ function decodeMcpArgValue(value) {
|
|
|
8323
8332
|
}
|
|
8324
8333
|
}
|
|
8325
8334
|
}
|
|
8335
|
+
async function executeCursorTool(ctx, call) {
|
|
8336
|
+
if ((call.name === "writeFile" || call.name === "editFile") && ctx.onActionGate) {
|
|
8337
|
+
let path = "the requested file";
|
|
8338
|
+
try {
|
|
8339
|
+
const parsed = JSON.parse(call.arguments);
|
|
8340
|
+
if (typeof parsed.path === "string" && parsed.path.trim()) path = parsed.path.trim();
|
|
8341
|
+
} catch {
|
|
8342
|
+
}
|
|
8343
|
+
const policy = evaluateFileWritePolicy({ tool: call.name, path, sessionApproved: false });
|
|
8344
|
+
if (policy.permissionDecision !== "ask") return ctx.executeTool ? ctx.executeTool(call) : { content: "tool execution unavailable" };
|
|
8345
|
+
const gate = { ...policy.permissionRequest, kind: "confirm", toolName: call.name, toolCallId: call.id };
|
|
8346
|
+
const result = await ctx.onActionGate(gate);
|
|
8347
|
+
if (result?.metadata?.actionGateResult?.status !== "completed") return result ?? { content: `${call.name} cancelled: file write confirmation was not approved.`, metadata: { cancelled: true, actionGateResult: { gateId: gate.id, status: "cancelled" } } };
|
|
8348
|
+
ctx.onActionGate = void 0;
|
|
8349
|
+
}
|
|
8350
|
+
return ctx.executeTool ? ctx.executeTool(call) : { content: "tool execution unavailable" };
|
|
8351
|
+
}
|
|
8326
8352
|
async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
8327
8353
|
const execCase = execMsg.message?.case;
|
|
8328
8354
|
if (execCase === "requestContextArgs") {
|
|
@@ -8363,7 +8389,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
8363
8389
|
});
|
|
8364
8390
|
const startedAt = Date.now();
|
|
8365
8391
|
try {
|
|
8366
|
-
const toolResult = await ctx
|
|
8392
|
+
const toolResult = await executeCursorTool(ctx, {
|
|
8367
8393
|
id: args.toolCallId,
|
|
8368
8394
|
name: "readFile",
|
|
8369
8395
|
arguments: toolCallArgs
|
|
@@ -8433,7 +8459,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
8433
8459
|
});
|
|
8434
8460
|
const startedAt = Date.now();
|
|
8435
8461
|
try {
|
|
8436
|
-
const toolResult = await ctx
|
|
8462
|
+
const toolResult = await executeCursorTool(ctx, {
|
|
8437
8463
|
id: args.toolCallId,
|
|
8438
8464
|
name: "execShell",
|
|
8439
8465
|
arguments: toolCallArgs
|
|
@@ -8591,7 +8617,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
8591
8617
|
});
|
|
8592
8618
|
const startedAt = Date.now();
|
|
8593
8619
|
try {
|
|
8594
|
-
const toolResult = await ctx
|
|
8620
|
+
const toolResult = await executeCursorTool(ctx, {
|
|
8595
8621
|
id: args.toolCallId,
|
|
8596
8622
|
name: "writeFile",
|
|
8597
8623
|
arguments: toolCallArgs
|
|
@@ -8653,7 +8679,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
8653
8679
|
});
|
|
8654
8680
|
const startedAt = Date.now();
|
|
8655
8681
|
try {
|
|
8656
|
-
const toolResult = await ctx
|
|
8682
|
+
const toolResult = await executeCursorTool(ctx, {
|
|
8657
8683
|
id: args.toolCallId,
|
|
8658
8684
|
name: "deleteFile",
|
|
8659
8685
|
arguments: toolCallArgs
|
|
@@ -8772,7 +8798,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
|
|
|
8772
8798
|
});
|
|
8773
8799
|
const startedAt = Date.now();
|
|
8774
8800
|
try {
|
|
8775
|
-
const toolResult = await ctx
|
|
8801
|
+
const toolResult = await executeCursorTool(ctx, {
|
|
8776
8802
|
id: args.toolCallId,
|
|
8777
8803
|
name: toolName,
|
|
8778
8804
|
arguments: toolCallArgs
|
|
@@ -8881,6 +8907,7 @@ function createCursorProvider(config) {
|
|
|
8881
8907
|
...options?.onTextDelta ? { onTextDelta: options.onTextDelta } : {},
|
|
8882
8908
|
...options?.onReasoningDelta ? { onReasoningDelta: options.onReasoningDelta } : {},
|
|
8883
8909
|
...options?.onToolEvent ? { onToolEvent: options.onToolEvent } : {},
|
|
8910
|
+
...options?.onActionGate ? { onActionGate: options.onActionGate } : {},
|
|
8884
8911
|
...typeof options?.toolEventRound === "number" ? { toolEventRound: options.toolEventRound } : {}
|
|
8885
8912
|
});
|
|
8886
8913
|
}
|
|
@@ -11390,9 +11417,10 @@ async function generateLocalDialogTitle(input) {
|
|
|
11390
11417
|
const content = m.content.length > 500 ? `${m.content.slice(0, 500)}...` : m.content;
|
|
11391
11418
|
return { role: m.role, content };
|
|
11392
11419
|
});
|
|
11393
|
-
while (visibleMessages.length > 1 &&
|
|
11420
|
+
while (visibleMessages.length > 1 && transcriptLength(visibleMessages) > 4e3) {
|
|
11394
11421
|
visibleMessages.shift();
|
|
11395
11422
|
}
|
|
11423
|
+
const compactTranscript = buildTitleTranscript(visibleMessages);
|
|
11396
11424
|
if (visibleMessages.length === 0) {
|
|
11397
11425
|
return { title: fallbackTitle, source: "fallback" };
|
|
11398
11426
|
}
|
|
@@ -11408,11 +11436,11 @@ async function generateLocalDialogTitle(input) {
|
|
|
11408
11436
|
messages: [
|
|
11409
11437
|
{
|
|
11410
11438
|
role: "system",
|
|
11411
|
-
content:
|
|
11439
|
+
content: buildTitleSystemPrompt(input.existingTitle)
|
|
11412
11440
|
},
|
|
11413
11441
|
{
|
|
11414
11442
|
role: "user",
|
|
11415
|
-
content:
|
|
11443
|
+
content: compactTranscript
|
|
11416
11444
|
}
|
|
11417
11445
|
],
|
|
11418
11446
|
stream: false
|
|
@@ -11425,7 +11453,9 @@ async function generateLocalDialogTitle(input) {
|
|
|
11425
11453
|
}
|
|
11426
11454
|
const patchedBody = {
|
|
11427
11455
|
...parsedBody,
|
|
11428
|
-
reasoning_effort
|
|
11456
|
+
// response_format 与 reasoning_effort 同发会被 RunInfra 400 拒绝,
|
|
11457
|
+
// 标题路径统一走 json mode(跳过 thinking,实测 completion 个位数 tokens)。
|
|
11458
|
+
response_format: { type: "json_object" },
|
|
11429
11459
|
max_tokens: 512
|
|
11430
11460
|
};
|
|
11431
11461
|
const res = await input.fetchImpl(request.url, {
|
|
@@ -11438,7 +11468,9 @@ async function generateLocalDialogTitle(input) {
|
|
|
11438
11468
|
const data = safeParseJson(raw);
|
|
11439
11469
|
if (data) {
|
|
11440
11470
|
const parsed = input.parseResponse({ providerConfig, data });
|
|
11441
|
-
const generated = normalizeDialogTitle(
|
|
11471
|
+
const generated = normalizeDialogTitle(
|
|
11472
|
+
extractTitleFromLlmContent(parsed.content)
|
|
11473
|
+
);
|
|
11442
11474
|
if (generated) {
|
|
11443
11475
|
return { title: generated, source: "llm" };
|
|
11444
11476
|
}
|
|
@@ -11484,11 +11516,12 @@ async function generateLocalDialogTitle(input) {
|
|
|
11484
11516
|
body: JSON.stringify({
|
|
11485
11517
|
model: directConfig.model || input.agentConfig?.model || BUILTIN_TITLE_LLM_CONFIG.model,
|
|
11486
11518
|
messages: [
|
|
11487
|
-
{ role: "system", content:
|
|
11488
|
-
{ role: "user", content:
|
|
11519
|
+
{ role: "system", content: buildTitleSystemPrompt(input.existingTitle) },
|
|
11520
|
+
{ role: "user", content: compactTranscript }
|
|
11489
11521
|
],
|
|
11490
|
-
//
|
|
11491
|
-
reasoning_effort
|
|
11522
|
+
// 标题路径统一 json mode(跳过 thinking);response_format 与
|
|
11523
|
+
// reasoning_effort 同发会被 RunInfra 400 拒绝,故不发 reasoning_effort。
|
|
11524
|
+
response_format: { type: "json_object" },
|
|
11492
11525
|
max_tokens: 512,
|
|
11493
11526
|
stream: false
|
|
11494
11527
|
}),
|
|
@@ -11498,7 +11531,9 @@ async function generateLocalDialogTitle(input) {
|
|
|
11498
11531
|
const raw = await res.text().catch(() => "");
|
|
11499
11532
|
const data = safeParseJson(raw);
|
|
11500
11533
|
const rawContent = data?.choices?.[0]?.message?.content ?? "";
|
|
11501
|
-
const generated = normalizeDialogTitle(
|
|
11534
|
+
const generated = normalizeDialogTitle(
|
|
11535
|
+
extractTitleFromLlmContent(rawContent)
|
|
11536
|
+
);
|
|
11502
11537
|
if (generated) {
|
|
11503
11538
|
return { title: generated, source: "llm" };
|
|
11504
11539
|
}
|
|
@@ -11509,6 +11544,33 @@ async function generateLocalDialogTitle(input) {
|
|
|
11509
11544
|
}
|
|
11510
11545
|
return { title: fallbackTitle, source: "fallback" };
|
|
11511
11546
|
}
|
|
11547
|
+
function buildTitleTranscript(messages) {
|
|
11548
|
+
return messages.map((message) => `${message.role === "user" ? "User" : "Assistant"}: ${message.content}`).join("\n");
|
|
11549
|
+
}
|
|
11550
|
+
function transcriptLength(messages) {
|
|
11551
|
+
return buildTitleTranscript(messages).length;
|
|
11552
|
+
}
|
|
11553
|
+
function buildTitleSystemPrompt(existingTitle) {
|
|
11554
|
+
const title = existingTitle?.trim();
|
|
11555
|
+
const base = `${BUILTIN_TITLE_LLM_CONFIG.prompt}
|
|
11556
|
+
\u8F93\u51FA\u683C\u5F0F\uFF1A\u8FD4\u56DE JSON \u5BF9\u8C61 {"title": "<\u6807\u9898>"}\uFF0C\u9664\u6B64\u4E4B\u5916\u4E0D\u8981\u6709\u4EFB\u4F55\u5B57\u7B26\u3002`;
|
|
11557
|
+
return title ? `${base}
|
|
11558
|
+
\u5F53\u524D\u6807\u9898\uFF1A${title}\u3002\u5982\u679C\u5BF9\u8BDD\u4ECD\u5728\u8BA8\u8BBA\u540C\u4E00\u4E3B\u9898\uFF0C\u5FC5\u987B\u539F\u6837\u8F93\u51FA\u5F53\u524D\u6807\u9898\uFF0C\u4E0D\u8981\u6539\u5199\uFF1B\u53EA\u6709\u5F53\u5BF9\u8BDD\u660E\u786E\u8F6C\u5411\u4E86\u4E0D\u540C\u4E3B\u9898\u65F6\u624D\u751F\u6210\u65B0\u6807\u9898\u3002` : base;
|
|
11559
|
+
}
|
|
11560
|
+
function extractTitleFromLlmContent(raw) {
|
|
11561
|
+
if (raw.trim().startsWith("{")) {
|
|
11562
|
+
try {
|
|
11563
|
+
const parsed = JSON.parse(raw);
|
|
11564
|
+
if (typeof parsed?.title === "string" && parsed.title.trim()) {
|
|
11565
|
+
return parsed.title;
|
|
11566
|
+
}
|
|
11567
|
+
return "";
|
|
11568
|
+
} catch {
|
|
11569
|
+
return raw;
|
|
11570
|
+
}
|
|
11571
|
+
}
|
|
11572
|
+
return raw;
|
|
11573
|
+
}
|
|
11512
11574
|
function extractText(content) {
|
|
11513
11575
|
if (typeof content === "string") return content;
|
|
11514
11576
|
if (Array.isArray(content)) {
|
|
@@ -11580,6 +11642,7 @@ function createLocalDialogTitleGenerator(deps, ctx) {
|
|
|
11580
11642
|
return async (input) => {
|
|
11581
11643
|
const result = await generateLocalDialogTitle({
|
|
11582
11644
|
messages: input.messages,
|
|
11645
|
+
existingTitle: input.existingTitle,
|
|
11583
11646
|
env: deps.env,
|
|
11584
11647
|
fetchImpl: async (url, init) => fetchWithTransientRetry(
|
|
11585
11648
|
deps.fetchImpl ?? fetch,
|
|
@@ -11730,7 +11793,11 @@ async function writeDialog(args) {
|
|
|
11730
11793
|
if (needsTitleUpdate && args.titleGenerator) {
|
|
11731
11794
|
const rawLastUserText = extractLastUserText(args.input.messages);
|
|
11732
11795
|
const fallbackTitle = buildDialogFallbackTitleFromUserInput(rawLastUserText) || "Local agent run";
|
|
11733
|
-
titlePromise = args.titleGenerator({
|
|
11796
|
+
titlePromise = args.titleGenerator({
|
|
11797
|
+
messages: args.input.messages,
|
|
11798
|
+
fallbackTitle,
|
|
11799
|
+
existingTitle: existingTitle || void 0
|
|
11800
|
+
}).catch(() => null);
|
|
11734
11801
|
}
|
|
11735
11802
|
const plan = buildLocalDialogWritePlan({
|
|
11736
11803
|
input: args.input,
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
resolvePlatformChatCompletionsEndpoint,
|
|
4
4
|
resolvePlatformHostedCredentialProvider,
|
|
5
5
|
resolvePlatformResponsesEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VRJUIUIY.js";
|
|
7
7
|
import {
|
|
8
8
|
CLIENT_VERSION_TOO_OLD_CODE,
|
|
9
9
|
buildClientVersionGateErrorDetail,
|
|
10
10
|
evaluatePlatformHostedClientVersionGate
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WL3UOGYO.js";
|
|
12
12
|
import {
|
|
13
13
|
asTrimmedLowercaseString
|
|
14
14
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getModelConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QDHZCAH3.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlatformHostedDeepseekModel,
|
|
6
6
|
isPlatformHostedOpenAIImageModel,
|
|
7
7
|
resolvePlatformHostedRouting
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WL3UOGYO.js";
|
|
9
9
|
import {
|
|
10
10
|
asTrimmedLowercaseString
|
|
11
11
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
toCompactAgentSummary,
|
|
18
18
|
toSafeAgentSummary,
|
|
19
19
|
toUnavailableAgentSummary
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RU5D3B22.js";
|
|
21
21
|
import {
|
|
22
22
|
getUserDataItemTimestamp,
|
|
23
23
|
mergeAndDedupUserData
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
} from "./chunk-INZZJSQF.js";
|
|
44
44
|
import {
|
|
45
45
|
createDocState
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-GFD7TIZU.js";
|
|
47
47
|
import {
|
|
48
48
|
ToolApiError,
|
|
49
49
|
buildToolRequestHeaders,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
buildBuiltinObjectSkillDbKey,
|
|
71
71
|
buildBuiltinObjectSkillPageContent,
|
|
72
72
|
createDialogAction
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-AVKUDHJO.js";
|
|
74
74
|
import {
|
|
75
75
|
addCategory,
|
|
76
76
|
addContentToSpace,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
loadTableRows,
|
|
91
91
|
updateContentCategory,
|
|
92
92
|
updateContentTitle
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-6SMMK7MD.js";
|
|
94
94
|
import {
|
|
95
95
|
normalizeAppRouteId,
|
|
96
96
|
resolveDialogRuntimeAgentKey,
|
|
@@ -100,13 +100,13 @@ import {
|
|
|
100
100
|
selectMsgById,
|
|
101
101
|
uiAskChoiceFunc,
|
|
102
102
|
uiAskChoiceFunctionSchema
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-EURF2SV6.js";
|
|
104
104
|
import {
|
|
105
105
|
createAgent,
|
|
106
106
|
runLlm,
|
|
107
107
|
streamAgentChatTurn,
|
|
108
108
|
updateAgent
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-WX5E6HZS.js";
|
|
110
110
|
import {
|
|
111
111
|
getActiveDialogKey,
|
|
112
112
|
require_react,
|
|
@@ -154,7 +154,7 @@ import {
|
|
|
154
154
|
} from "./chunk-HR5XDXYM.js";
|
|
155
155
|
import {
|
|
156
156
|
DEFAULT_MODEL
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-QDHZCAH3.js";
|
|
158
158
|
import {
|
|
159
159
|
compactWhitespace
|
|
160
160
|
} from "./chunk-DWLEOOGR.js";
|
|
@@ -11830,7 +11830,7 @@ var HOSTED_EXEC_RUNTIME_TOOL_POLICY = {
|
|
|
11830
11830
|
workspace: { mode: "lease" }
|
|
11831
11831
|
};
|
|
11832
11832
|
var findModelConfig = async (modelName, provider) => {
|
|
11833
|
-
const { ALL_MODELS } = await import("./models-
|
|
11833
|
+
const { ALL_MODELS } = await import("./models-4QF4BJVY.js");
|
|
11834
11834
|
const name = toTrimmedString(modelName);
|
|
11835
11835
|
const prov = toTrimmedString(provider ?? "");
|
|
11836
11836
|
if (!name) return null;
|
|
@@ -12071,7 +12071,7 @@ var buildFormDataFromArgs = async (args) => {
|
|
|
12071
12071
|
const trimmedModel = toTrimmedString(model);
|
|
12072
12072
|
const trimmedProvider = toTrimmedString(provider);
|
|
12073
12073
|
const modelConfig = await findModelConfig(trimmedModel, trimmedProvider);
|
|
12074
|
-
const { getModelPricing } = await import("./getPricing-
|
|
12074
|
+
const { getModelPricing } = await import("./getPricing-HAU62AFM.js");
|
|
12075
12075
|
const normalizedTools = tools ?? [];
|
|
12076
12076
|
const resolvedRuntimeToolPolicy = runtimeToolPolicy ?? (normalizedTools.includes("execShell") ? HOSTED_EXEC_RUNTIME_TOOL_POLICY : void 0);
|
|
12077
12077
|
const formData = {
|
|
@@ -15385,7 +15385,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
15385
15385
|
const deletedDialogIds = [];
|
|
15386
15386
|
const deletedDialogKeys = [];
|
|
15387
15387
|
const failures = [];
|
|
15388
|
-
const { deleteDialog } = await import("./dialogSlice-
|
|
15388
|
+
const { deleteDialog } = await import("./dialogSlice-NRAN5X7F.js");
|
|
15389
15389
|
for (const target of targets) {
|
|
15390
15390
|
try {
|
|
15391
15391
|
await thunkApi.dispatch(deleteDialog(target.dbKey)).unwrap();
|
|
@@ -24957,7 +24957,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
24957
24957
|
if (!executionInput) {
|
|
24958
24958
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
24959
24959
|
}
|
|
24960
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
24960
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-QCDR3UMD.js");
|
|
24961
24961
|
const { executor } = findToolExecutor2(run.toolName);
|
|
24962
24962
|
toolRunStarted({
|
|
24963
24963
|
id: run.id,
|
|
@@ -24981,7 +24981,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
24981
24981
|
const latestState = thunkApi.getState();
|
|
24982
24982
|
const userId = latestState.auth?.currentUser?.userId;
|
|
24983
24983
|
if (userId) {
|
|
24984
|
-
const { fetchUserSpaceMemberships } = await import("./spaceSlice-
|
|
24984
|
+
const { fetchUserSpaceMemberships } = await import("./spaceSlice-F7JCOZEF.js");
|
|
24985
24985
|
await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
|
|
24986
24986
|
}
|
|
24987
24987
|
}
|
|
@@ -27464,7 +27464,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
27464
27464
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
27465
27465
|
};
|
|
27466
27466
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
27467
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
27467
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-LUS7SWC3.js");
|
|
27468
27468
|
if (getDocState().pageKey === id) {
|
|
27469
27469
|
applyExternalDocUpdate({
|
|
27470
27470
|
slateData: finalSlateData,
|
|
@@ -45,6 +45,7 @@ var PLATFORM_HOSTED_OPENAI_IMAGE_MODEL = "gpt-image-2";
|
|
|
45
45
|
var PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL = "deepseek-v4-flash";
|
|
46
46
|
var PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL = "deepseek-v4-flash-vision-exp";
|
|
47
47
|
var PLATFORM_HOSTED_DEEPSEEK_PRO_MODEL = "deepseek-v4-pro";
|
|
48
|
+
var PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_MODEL = "nemotron-3-5-lightning-30b";
|
|
48
49
|
var PLATFORM_HOSTED_KIMI_K3_MIN_CLIENT_VERSION = "0.38.0-alpha.4";
|
|
49
50
|
var PLATFORM_HOSTED_GLM_53_FLASH_MIN_CLIENT_VERSION = "0.33.0-alpha.1";
|
|
50
51
|
var PLATFORM_HOSTED_ROUTING_TABLE = {
|
|
@@ -165,6 +166,15 @@ var PLATFORM_HOSTED_ROUTING_TABLE = {
|
|
|
165
166
|
wire: "responses",
|
|
166
167
|
agentRunHosted: true
|
|
167
168
|
},
|
|
169
|
+
// Nemotron 标题 LLM 内部专用,走 chatProxy;agentRun 不分流。
|
|
170
|
+
[PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_MODEL]: {
|
|
171
|
+
endpoint: "https://api.runinfra.ai/v1/chat/completions",
|
|
172
|
+
usageProvider: "runinfra",
|
|
173
|
+
keyName: "runinfra",
|
|
174
|
+
upstreamModelId: "nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16",
|
|
175
|
+
wire: "chat.completions",
|
|
176
|
+
agentRunHosted: false
|
|
177
|
+
},
|
|
168
178
|
// DeepSeek Flash / Vision -> DeepSeek Responses API(agentRun 走专用 responses 编排)
|
|
169
179
|
[PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL]: {
|
|
170
180
|
endpoint: "https://api.deepseek.com/responses",
|
|
@@ -492,6 +502,11 @@ var PLATFORM_HOSTED_DEEPSEEK_FLASH_OFF_PEAK_PRICE = {
|
|
|
492
502
|
output: toCnyCredits(4.5)
|
|
493
503
|
// ¥4.5
|
|
494
504
|
};
|
|
505
|
+
var PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_PRICE = {
|
|
506
|
+
input: toPlatformCredits(0.05),
|
|
507
|
+
inputCacheHit: toPlatformCredits(0.01),
|
|
508
|
+
output: toPlatformCredits(0.15)
|
|
509
|
+
};
|
|
495
510
|
var PLATFORM_HOSTED_DEEPSEEK_PRO_PRICE = {
|
|
496
511
|
input: 3.36,
|
|
497
512
|
// 4.8 credits
|
|
@@ -515,6 +530,16 @@ var getPlatformHostedDeepSeekV4Price = (_model, nowMs = Date.now()) => {
|
|
|
515
530
|
var isPlatformHostedDeepSeekV4Model = (model) => model === PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL || model === PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL;
|
|
516
531
|
var isPlatformHostedDeepseekModel = (model) => model === PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL || model === PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL;
|
|
517
532
|
var platformHostedModels = [
|
|
533
|
+
{
|
|
534
|
+
name: PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_MODEL,
|
|
535
|
+
displayName: "Nemotron 3.5 Lightning 30B",
|
|
536
|
+
hasVision: false,
|
|
537
|
+
price: { ...PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_PRICE },
|
|
538
|
+
maxOutputTokens: 32768,
|
|
539
|
+
contextWindow: 262144,
|
|
540
|
+
supportsTool: true,
|
|
541
|
+
supportsReasoningEffort: true
|
|
542
|
+
},
|
|
518
543
|
{
|
|
519
544
|
name: PLATFORM_HOSTED_KIMI_K3_MODEL,
|
|
520
545
|
displayName: "Kimi K3",
|
|
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
|
|
|
304
304
|
const overrides = {};
|
|
305
305
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
306
306
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
307
|
-
const { _executeModel } = await import("./_executeModel-
|
|
307
|
+
const { _executeModel } = await import("./_executeModel-KE4PQSZ3.js");
|
|
308
308
|
return _executeModel(
|
|
309
309
|
{
|
|
310
310
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
|
|
|
325
325
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
326
326
|
*/
|
|
327
327
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
328
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
328
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-ZYUI22EA.js");
|
|
329
329
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
330
330
|
{
|
|
331
331
|
agentKey: args.agentKey,
|
|
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
|
|
|
341
341
|
* 聊天轮次流式 Agent 调用
|
|
342
342
|
*/
|
|
343
343
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
344
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
344
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-FNFMMGNN.js");
|
|
345
345
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
346
346
|
}),
|
|
347
347
|
/**
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-6SMMK7MD.js";
|
|
4
|
+
import "./chunk-EURF2SV6.js";
|
|
5
5
|
import "./chunk-EVBFYPDC.js";
|
|
6
6
|
import "./chunk-H2G6JXTR.js";
|
|
7
7
|
import "./chunk-YYLHWIW6.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-WX5E6HZS.js";
|
|
9
9
|
import "./chunk-AGGIDPCZ.js";
|
|
10
10
|
import "./chunk-SG65C33A.js";
|
|
11
11
|
import "./chunk-5RGU3J7P.js";
|
|
12
12
|
import "./chunk-M76ECQRD.js";
|
|
13
13
|
import "./chunk-MRWGHF56.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-SW7RCUGA.js";
|
|
15
15
|
import "./chunk-HR5XDXYM.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-VRJUIUIY.js";
|
|
17
17
|
import "./chunk-NQ4N4IGO.js";
|
|
18
18
|
import "./chunk-FD36SCCD.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-QDHZCAH3.js";
|
|
20
20
|
import "./chunk-DWLEOOGR.js";
|
|
21
21
|
import "./chunk-ZHXJ6M7T.js";
|
|
22
22
|
import "./chunk-HNMXYYJR.js";
|
|
23
23
|
import "./chunk-FA4SY4F5.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-56W233KG.js";
|
|
25
|
+
import "./chunk-WL3UOGYO.js";
|
|
26
26
|
import "./chunk-X7S7OFUX.js";
|
|
27
27
|
import "./chunk-Y5GCAMGP.js";
|
|
28
28
|
import "./chunk-UZ6XXCVR.js";
|