nolo-cli 0.12.0-alpha.6 → 0.12.0-alpha.8
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-3B6MKHQV.js → _executeModel-PKRZBH3J.js} +20 -19
- package/{action-RAXNQQKC.js → action-OTOWUMPW.js} +3 -3
- package/{addContentAction-ZHI7TVV3.js → addContentAction-JGBUVR7K.js} +2 -2
- package/{addDialogAgentAction-JWXPKXNC.js → addDialogAgentAction-V6CL2UCF.js} +1 -1
- package/{agentDeleteCommand-3R7OCLBN.js → agentDeleteCommand-OKQ5CSX2.js} +12 -11
- package/{agentEmailCommands-OENXTOPM.js → agentEmailCommands-7DORWXQH.js} +24 -23
- package/{agentListCommands-GX5YRFFK.js → agentListCommands-VTR33V4B.js} +13 -12
- package/{agentMachineCommands-5ZEL4NOJ.js → agentMachineCommands-XHFM4UQB.js} +12 -11
- package/{agentRecordCommands-EKGPNDCG.js → agentRecordCommands-XB7XBNJ7.js} +24 -23
- package/{agentRunCommand-KQYY46WS.js → agentRunCommand-XACEWDVO.js} +24 -23
- package/{agentRuntimeLocal-C2KYWS6H.js → agentRuntimeLocal-NYFVPD5P.js} +9 -8
- package/{agentSlice-N5RKI23B.js → agentSlice-NGZWIMZX.js} +2 -2
- package/{chunk-6TISG7CK.js → chunk-3GOA33JO.js} +69 -12
- package/{chunk-5HANPK6S.js → chunk-4LNEIK4O.js} +3 -3
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-2VILMENT.js → chunk-6KTC3MPK.js} +1 -1
- package/{chunk-6VDWNLHX.js → chunk-7CQLSRAC.js} +2 -2
- package/{chunk-OLKX3NZI.js → chunk-7F5C7ILS.js} +3 -3
- package/{chunk-NIU4ERVM.js → chunk-A22NOC7Y.js} +24 -22
- package/{chunk-RFRU3HAL.js → chunk-CGAYFFIB.js} +1 -1
- package/{chunk-7MYHLZ3F.js → chunk-DPFWKRHG.js} +1 -1
- package/{chunk-Y3BLUPNS.js → chunk-H5Y2H2N6.js} +1 -1
- package/{chunk-ELYHT6P6.js → chunk-HO7RHQIN.js} +2 -2
- package/{chunk-RGJFQERV.js → chunk-HYJNPPQ6.js} +4 -4
- package/{chunk-NKD3Q4RN.js → chunk-JFANOO7I.js} +2 -14
- package/{chunk-WTYKCU4W.js → chunk-JU7J7EAV.js} +37 -37
- package/{chunk-NRJFU6WZ.js → chunk-LBWFOYJJ.js} +2 -2
- package/{chunk-Y3COB2JR.js → chunk-LKVDZQGM.js} +2 -2
- package/{chunk-7HV5OHEM.js → chunk-LUKQQJFL.js} +38 -1
- package/{chunk-FF7Y6DC4.js → chunk-NS3DRNUZ.js} +39 -12
- package/{chunk-7TNQ4ZZL.js → chunk-P3J54V3I.js} +1 -1
- package/{chunk-UG3WOFU6.js → chunk-QJSTNKJY.js} +1 -1
- package/{chunk-ISZEBXEV.js → chunk-QYZ46ZC3.js} +1 -1
- package/{chunk-B2Z7OJBT.js → chunk-REQCG2PB.js} +12 -99
- package/{chunk-6LMFFG3K.js → chunk-RWO5DGXI.js} +2 -2
- package/{chunk-J6PV7OYE.js → chunk-SDYIF6SV.js} +94 -1
- package/{chunk-MRX4BSKQ.js → chunk-SKURMCJF.js} +151 -15
- package/{chunk-6ADBTFFE.js → chunk-TA7VKOHU.js} +10 -5
- package/{chunk-WO24IT3V.js → chunk-TYPHUVK5.js} +12 -0
- package/{chunk-WMU5EZLC.js → chunk-UNEZBV37.js} +27 -13
- package/{chunk-KJTP7JTN.js → chunk-UP6JMU6C.js} +1 -1
- package/{chunk-I6IVZIIO.js → chunk-UWTMBOPF.js} +15 -10
- package/{chunk-NITP2JDG.js → chunk-VKG4HXYV.js} +1 -1
- package/{chunk-3HHTVM6G.js → chunk-WVTBAALN.js} +1 -1
- package/{chunk-OSGJQTG6.js → chunk-XNV42PMD.js} +18 -18
- package/{createAgentAutomationAction-NNXHZFSA.js → createAgentAutomationAction-AHSBJKGX.js} +8 -7
- package/{createDialogAction-TQCW67HG.js → createDialogAction-RSNVGR5E.js} +9 -8
- package/{createPageAction-QUFKG6A2.js → createPageAction-47G4D5WU.js} +8 -7
- package/{dbSlice-WDP2ZZHK.js → dbSlice-J4PUZ6Y5.js} +1 -1
- package/{dialogCommands-C6ERN2I7.js → dialogCommands-MPUFCOBR.js} +13 -12
- package/{dialogSlice-DAA3CWOV.js → dialogSlice-YNEFYFSU.js} +8 -7
- package/{docCreateCommands-KMYVYGZM.js → docCreateCommands-LV6KUDP3.js} +12 -11
- package/{docDeleteCommands-DZHIJA5D.js → docDeleteCommands-Y7FOYWMY.js} +13 -12
- package/{docReadCommands-VLJFYLR2.js → docReadCommands-UCCHERCP.js} +12 -11
- package/{docStore-67RBJMFZ.js → docStore-OBBYKQVD.js} +9 -8
- package/{docUpdateCommands-GOHV5JC5.js → docUpdateCommands-FBKQBFWG.js} +12 -11
- package/{handleSendMessageAction-7PNLNSPL.js → handleSendMessageAction-U5AX6CGB.js} +8 -7
- package/index.js +36 -36
- package/{machineCommands-J7FIVAZV.js → machineCommands-EXVWHGWU.js} +23 -22
- package/{machineWsRunDispatch-RWXFY6YG.js → machineWsRunDispatch-QZXCW3SI.js} +23 -22
- package/package.json +1 -1
- package/{readlineWorkspace-EMKKVMNH.js → readlineWorkspace-QKMGLM33.js} +134 -34
- package/{removeDialogAgentAction-GTX5AN54.js → removeDialogAgentAction-XUZYQBV4.js} +3 -3
- package/{runAgentClientLoop-VTA6RAHT.js → runAgentClientLoop-5DIJHAPN.js} +17 -16
- package/{setDialogExtraReferencesAction-WFQ63KYO.js → setDialogExtraReferencesAction-PTAIFKGM.js} +1 -1
- package/{setPrimaryDialogAgentAction-P57FXTSU.js → setPrimaryDialogAgentAction-HRFTDB44.js} +3 -3
- package/{settingSlice-CK5YZGNI.js → settingSlice-VGRJUSE5.js} +2 -2
- package/{spaceCommands-HLOEZVOV.js → spaceCommands-KDZYXP5N.js} +12 -11
- package/{spaceSlice-2X2TVI2V.js → spaceSlice-EO6JQRMP.js} +8 -7
- package/{streamAgentChatTurn-GFQ4YRJF.js → streamAgentChatTurn-PLKJ3MZ6.js} +20 -19
- package/{tools-PR47LTGM.js → tools-5QNY6YKE.js} +12 -11
- package/{tuiSummaryLlmCaller-YEHSPGXZ.js → tuiSummaryLlmCaller-TQ34DAM5.js} +4 -2
- package/{updateDialogTitleAction-4GI3W4LJ.js → updateDialogTitleAction-V5AD52MZ.js} +8 -7
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
extractTextFromResponseOutput,
|
|
11
11
|
extractToolCallsFromResponseOutput,
|
|
12
12
|
hasDirectOpenAiCompatibleProvider,
|
|
13
|
+
hasImageParts,
|
|
13
14
|
resolveAgentRuntimeLocation,
|
|
14
15
|
resolvePlatformAuthToken,
|
|
15
16
|
resolvePlatformChatCompletionsEndpoint,
|
|
@@ -17,18 +18,70 @@ import {
|
|
|
17
18
|
resolveProviderTransportDecision,
|
|
18
19
|
toOpenAiCompatibleMessages,
|
|
19
20
|
toResponsesTools
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-TYPHUVK5.js";
|
|
22
|
+
import {
|
|
23
|
+
clipCompactText
|
|
24
|
+
} from "./chunk-5MMAK75Q.js";
|
|
25
|
+
import {
|
|
26
|
+
isRecord
|
|
27
|
+
} from "./chunk-KUG52IAP.js";
|
|
28
|
+
|
|
29
|
+
// packages/core/chat/providerFailureMessage.ts
|
|
30
|
+
var RAW_BODY_CLIP = 400;
|
|
31
|
+
function describeProviderFailure(args) {
|
|
32
|
+
const clipped = clipCompactText(JSON.stringify(args.body) ?? "", RAW_BODY_CLIP, "\u2026");
|
|
33
|
+
const error = isRecord(args.body) ? args.body.error : void 0;
|
|
34
|
+
const message = isRecord(error) ? error.message : void 0;
|
|
35
|
+
if (typeof message === "string" && message) return `${message} | ${clipped}`;
|
|
36
|
+
const looksLikeCompletion = isRecord(args.body) && Array.isArray(args.body.choices) && error === void 0;
|
|
37
|
+
if (looksLikeCompletion) {
|
|
38
|
+
const imageHint = args.hadImageParts ? "\uFF1B\u8BE5\u8BF7\u6C42\u5E26\u4E86\u56FE\u7247\uFF0C\u591A\u534A\u662F\u8FD9\u4E2A\u6A21\u578B\u6216\u8FD9\u6761\u7F51\u5173\u8DEF\u7531\u4E0D\u63A5\u53D7\u56FE\u7247\u8F93\u5165" : "";
|
|
39
|
+
return `\u4E0A\u6E38\u62D2\u7EDD\u4E86\u8BF7\u6C42\u4F46\u6CA1\u7ED9\u9519\u8BEF\u4FE1\u606F\uFF08\u54CD\u5E94\u4F53\u662F\u4E00\u4E2A\u7A7A\u7684 chat.completion\uFF09${imageHint} | ${clipped}`;
|
|
40
|
+
}
|
|
41
|
+
return clipped;
|
|
42
|
+
}
|
|
43
|
+
function providerHttpFailure(args) {
|
|
44
|
+
let body = args.raw;
|
|
45
|
+
try {
|
|
46
|
+
body = JSON.parse(args.raw);
|
|
47
|
+
} catch {
|
|
48
|
+
}
|
|
49
|
+
return new Error(
|
|
50
|
+
`${args.label} failed: HTTP ${args.status} ${describeProviderFailure({
|
|
51
|
+
body,
|
|
52
|
+
hadImageParts: hasImageParts(args.messages)
|
|
53
|
+
})}`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
21
56
|
|
|
22
57
|
// packages/agent-runtime/toolCallAccumulator.ts
|
|
23
|
-
function
|
|
58
|
+
function createToolCallAccumulator() {
|
|
59
|
+
return { slots: [] };
|
|
60
|
+
}
|
|
61
|
+
function resolveSlot(accumulator, deltaId, wireIndex) {
|
|
62
|
+
const { slots } = accumulator;
|
|
63
|
+
if (deltaId) {
|
|
64
|
+
const existing = slots.findIndex((slot) => slot.id === deltaId);
|
|
65
|
+
if (existing !== -1) return existing;
|
|
66
|
+
} else if (wireIndex !== void 0) {
|
|
67
|
+
const sameIndex = slots.findLastIndex((slot) => slot.wireIndex === wireIndex);
|
|
68
|
+
if (sameIndex !== -1) return sameIndex;
|
|
69
|
+
} else if (slots.length > 0) {
|
|
70
|
+
return slots.length - 1;
|
|
71
|
+
}
|
|
72
|
+
slots.push({
|
|
73
|
+
id: deltaId,
|
|
74
|
+
type: "function",
|
|
75
|
+
function: { name: "", arguments: "" },
|
|
76
|
+
wireIndex: wireIndex ?? slots.length
|
|
77
|
+
});
|
|
78
|
+
return slots.length - 1;
|
|
79
|
+
}
|
|
80
|
+
function accumulateToolCallDelta(accumulator, deltas) {
|
|
24
81
|
for (const delta of deltas) {
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
type: "function",
|
|
29
|
-
function: { name: "", arguments: "" }
|
|
30
|
-
};
|
|
31
|
-
if (typeof delta.id === "string" && delta.id) current.id = delta.id;
|
|
82
|
+
const deltaId = typeof delta.id === "string" && delta.id ? delta.id : "";
|
|
83
|
+
const wireIndex = typeof delta.index === "number" ? delta.index : void 0;
|
|
84
|
+
const current = accumulator.slots[resolveSlot(accumulator, deltaId, wireIndex)];
|
|
32
85
|
const fn = delta.function;
|
|
33
86
|
if (fn && typeof fn === "object") {
|
|
34
87
|
const functionDelta = fn;
|
|
@@ -39,11 +92,10 @@ function accumulateToolCallDelta(accumulated, deltas) {
|
|
|
39
92
|
current.function.arguments += functionDelta.arguments;
|
|
40
93
|
}
|
|
41
94
|
}
|
|
42
|
-
accumulated[index] = current;
|
|
43
95
|
}
|
|
44
96
|
}
|
|
45
|
-
function finalizeAccumulatedToolCalls(
|
|
46
|
-
return
|
|
97
|
+
function finalizeAccumulatedToolCalls(accumulator) {
|
|
98
|
+
return accumulator.slots.filter((slot) => slot.function.name).map(({ id, type, function: fn }) => ({ id, type, function: fn }));
|
|
47
99
|
}
|
|
48
100
|
|
|
49
101
|
// packages/agent-runtime/processChatCompletionDelta.ts
|
|
@@ -328,6 +380,7 @@ function parsePlatformChatCompletionResponse(args) {
|
|
|
328
380
|
model: args.providerConfig.model,
|
|
329
381
|
provider: args.providerConfig.provider,
|
|
330
382
|
...tool_calls.length > 0 ? { tool_calls } : {},
|
|
383
|
+
stream_complete: true,
|
|
331
384
|
usage: args.data?.usage,
|
|
332
385
|
trace: args.trace
|
|
333
386
|
};
|
|
@@ -341,6 +394,8 @@ function parsePlatformChatCompletionResponse(args) {
|
|
|
341
394
|
provider: args.providerConfig.provider,
|
|
342
395
|
...Array.isArray(choiceMessage?.tool_calls) ? { tool_calls: choiceMessage.tool_calls } : {},
|
|
343
396
|
...reasoning ? { reasoning_content: reasoning } : typeof choiceMessage?.reasoning_content === "string" && choiceMessage.reasoning_content ? { reasoning_content: choiceMessage.reasoning_content } : {},
|
|
397
|
+
// 非流式:完整的 200 JSON body 即证明调用走完,见 AgentRuntimeResult。
|
|
398
|
+
stream_complete: true,
|
|
344
399
|
usage: args.data?.usage,
|
|
345
400
|
trace: args.trace
|
|
346
401
|
};
|
|
@@ -370,10 +425,12 @@ function shouldUsePlatformChatProvider(env, agentConfig) {
|
|
|
370
425
|
}
|
|
371
426
|
|
|
372
427
|
export {
|
|
428
|
+
createToolCallAccumulator,
|
|
373
429
|
finalizeAccumulatedToolCalls,
|
|
374
430
|
throwIfChatCompletionStreamFailed,
|
|
375
431
|
applyChatCompletionDelta,
|
|
376
432
|
flushChatCompletionStream,
|
|
433
|
+
providerHttpFailure,
|
|
377
434
|
readSseFrames,
|
|
378
435
|
readSseDataValues,
|
|
379
436
|
resolvePlatformChatProviderConfig,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NS3DRNUZ.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SKURMCJF.js";
|
|
8
8
|
import {
|
|
9
9
|
runLocalAgentTurn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TA7VKOHU.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveLocalRuntimeEnvFromPolicy
|
|
13
13
|
} from "./chunk-PDL2AV3E.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compactWhitespace
|
|
3
|
+
} from "./chunk-DWLEOOGR.js";
|
|
4
|
+
|
|
5
|
+
// packages/core/clipCompactText.ts
|
|
6
|
+
function clipCompactText(value, max, ellipsis = "...") {
|
|
7
|
+
const compact = compactWhitespace(value);
|
|
8
|
+
if (compact.length <= max) return compact;
|
|
9
|
+
if (max <= ellipsis.length) return compact.slice(0, max);
|
|
10
|
+
return `${compact.slice(0, max - ellipsis.length)}${ellipsis}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
clipCompactText
|
|
15
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listUserRecordsFromServers,
|
|
3
3
|
readLiveDbRecordAfterTombstoneMerge
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-P3J54V3I.js";
|
|
5
5
|
import {
|
|
6
6
|
agentRecordHasConfiguredCredential
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CGAYFFIB.js";
|
|
8
8
|
import {
|
|
9
9
|
toSafeAgentSummary
|
|
10
10
|
} from "./chunk-OOIN7HSO.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XNV42PMD.js";
|
|
4
4
|
import {
|
|
5
5
|
require_date_fns
|
|
6
6
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
patch,
|
|
15
15
|
readAndWait
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VKG4HXYV.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-47G4D5WU.js");
|
|
371
371
|
return createPageAction(args, thunkApi);
|
|
372
372
|
}
|
|
373
373
|
function subscribe(listener) {
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isBuiltinNoloAgentRef,
|
|
19
19
|
t,
|
|
20
20
|
toolLabel
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NS3DRNUZ.js";
|
|
22
22
|
import {
|
|
23
23
|
CliProviderQuotaError
|
|
24
24
|
} from "./chunk-CMKUBIGW.js";
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
readDbRecord,
|
|
30
30
|
resolveAgentRecordFromHybridStore
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-CGAYFFIB.js";
|
|
32
32
|
import {
|
|
33
33
|
normalizeAgentHandle
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-QYZ46ZC3.js";
|
|
35
35
|
import {
|
|
36
36
|
NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
37
37
|
isLocalCliAgentKey
|
|
@@ -48,14 +48,14 @@ import {
|
|
|
48
48
|
formatStatusRunCard,
|
|
49
49
|
formatStopRunCard,
|
|
50
50
|
isAgentRunTerminalStatus
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-SKURMCJF.js";
|
|
52
52
|
import {
|
|
53
53
|
isGatewayHttpStatus
|
|
54
54
|
} from "./chunk-RQSOAMPJ.js";
|
|
55
55
|
import {
|
|
56
56
|
buildMemorySubjectsForAgent,
|
|
57
57
|
resolveAgentMemoryPolicy
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-LKVDZQGM.js";
|
|
59
59
|
import {
|
|
60
60
|
parseExternalSkillMarkdown,
|
|
61
61
|
parseSkillDocProtocol
|
|
@@ -64,14 +64,14 @@ import {
|
|
|
64
64
|
API_REPORTED_COST_MULTIPLIER,
|
|
65
65
|
normalizeUsage,
|
|
66
66
|
parseUiAskChoiceContent
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-XNV42PMD.js";
|
|
68
68
|
import {
|
|
69
69
|
buildSkillDiscoveryContextBlock
|
|
70
70
|
} from "./chunk-AS3ZQ3O2.js";
|
|
71
71
|
import {
|
|
72
72
|
buildPlatformChatCompletionRequest,
|
|
73
73
|
parsePlatformChatCompletionData
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-3GOA33JO.js";
|
|
75
75
|
import {
|
|
76
76
|
resolveAgentRuntimeConfigFromRecord
|
|
77
77
|
} from "./chunk-NCGFB7NN.js";
|
|
@@ -80,15 +80,17 @@ import {
|
|
|
80
80
|
LOCAL_TURN_ABORTED_CODE,
|
|
81
81
|
readActionGate,
|
|
82
82
|
readCommandActionGatePayload
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-TA7VKOHU.js";
|
|
84
84
|
import {
|
|
85
85
|
resolvePlatformChatCompletionsEndpoint
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-TYPHUVK5.js";
|
|
87
87
|
import {
|
|
88
88
|
DEFAULT_CONTEXT_WINDOW,
|
|
89
|
-
clipCompactText,
|
|
90
89
|
getModelContextWindow
|
|
91
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-JFANOO7I.js";
|
|
91
|
+
import {
|
|
92
|
+
clipCompactText
|
|
93
|
+
} from "./chunk-5MMAK75Q.js";
|
|
92
94
|
import {
|
|
93
95
|
findModelConfig
|
|
94
96
|
} from "./chunk-OGGHETUE.js";
|
|
@@ -815,14 +817,14 @@ var THEME_PALETTES = {
|
|
|
815
817
|
muted: { hex: "6E7781", ansiFallback: "\x1B[90m" }
|
|
816
818
|
},
|
|
817
819
|
dark: {
|
|
818
|
-
accent: { hex: "
|
|
819
|
-
//
|
|
820
|
-
chrome: { hex: "
|
|
821
|
-
success: { hex: "
|
|
822
|
-
warning: { hex: "
|
|
823
|
-
info: { hex: "
|
|
824
|
-
danger: { hex: "
|
|
825
|
-
muted: { hex: "
|
|
820
|
+
accent: { hex: "89B4FA", ansiFallback: "\x1B[34m" },
|
|
821
|
+
// Catppuccin Mocha Blue
|
|
822
|
+
chrome: { hex: "6C7086", ansiFallback: "\x1B[90m" },
|
|
823
|
+
success: { hex: "A6E3A1", ansiFallback: "\x1B[32m" },
|
|
824
|
+
warning: { hex: "F9E2AF", ansiFallback: "\x1B[33m" },
|
|
825
|
+
info: { hex: "89B4FA", ansiFallback: "\x1B[36m" },
|
|
826
|
+
danger: { hex: "F38BA8", ansiFallback: "\x1B[31m" },
|
|
827
|
+
muted: { hex: "A6ADC8", ansiFallback: "\x1B[90m" }
|
|
826
828
|
}
|
|
827
829
|
},
|
|
828
830
|
wave: {
|
|
@@ -974,7 +976,7 @@ function hexToSgr(hex) {
|
|
|
974
976
|
}
|
|
975
977
|
var SURFACE_HEX = {
|
|
976
978
|
trail: { light: "E4E8EC", dark: "313244" },
|
|
977
|
-
catppuccin: { light: "E8ECF0", dark: "
|
|
979
|
+
catppuccin: { light: "E8ECF0", dark: "181825" },
|
|
978
980
|
wave: { light: "E5E1D6", dark: "2A2A37" },
|
|
979
981
|
iris: { light: "E9E8F2", dark: "2A2740" },
|
|
980
982
|
rose: { light: "F2EAE4", dark: "26233A" },
|
|
@@ -3588,7 +3590,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
3588
3590
|
// packages/cli/client/agentRun.ts
|
|
3589
3591
|
import { ulid } from "ulid";
|
|
3590
3592
|
async function loadRunLocalAgentTurn() {
|
|
3591
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
3593
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-NYFVPD5P.js");
|
|
3592
3594
|
return runLocalAgentTurn;
|
|
3593
3595
|
}
|
|
3594
3596
|
async function resolveCurrentMachineId(options) {
|
|
@@ -4025,7 +4027,7 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
4025
4027
|
} : void 0;
|
|
4026
4028
|
const currentDialogId = options.continueDialogId ?? ulid();
|
|
4027
4029
|
const runChildTurn = async (input) => {
|
|
4028
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
4030
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-NYFVPD5P.js");
|
|
4029
4031
|
return runLocalAgentTurn(input);
|
|
4030
4032
|
};
|
|
4031
4033
|
const createFreshChildBaseAdapter = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readDbRecord,
|
|
3
3
|
writeAgentRecord
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CGAYFFIB.js";
|
|
5
5
|
import {
|
|
6
6
|
buildSkillSummaryMarker
|
|
7
7
|
} from "./chunk-VF4K2QE6.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-VC6OZXO5.js";
|
|
11
11
|
import {
|
|
12
12
|
createSpaceKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WVTBAALN.js";
|
|
14
14
|
import {
|
|
15
15
|
asTrimmedLowercaseString
|
|
16
16
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
patch,
|
|
12
12
|
remove,
|
|
13
13
|
write
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VKG4HXYV.js";
|
|
15
15
|
import {
|
|
16
16
|
createAgentKey,
|
|
17
17
|
toTrimmedString
|
|
@@ -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-PKRZBH3J.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-5DIJHAPN.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-PLKJ3MZ6.js");
|
|
341
341
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
342
342
|
}),
|
|
343
343
|
/**
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MODEL_LOOKUP_MAP
|
|
3
3
|
} from "./chunk-OGGHETUE.js";
|
|
4
|
-
import {
|
|
5
|
-
compactWhitespace
|
|
6
|
-
} from "./chunk-DWLEOOGR.js";
|
|
7
4
|
import {
|
|
8
5
|
ALL_MODELS
|
|
9
6
|
} from "./chunk-IKXL2HZ3.js";
|
|
10
7
|
import {
|
|
11
8
|
addContentAction
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WVTBAALN.js";
|
|
13
10
|
import {
|
|
14
11
|
upload
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VKG4HXYV.js";
|
|
16
13
|
import {
|
|
17
14
|
getRuntimeServerContext
|
|
18
15
|
} from "./chunk-TSUJOM6N.js";
|
|
@@ -2083,14 +2080,6 @@ var normalizeAssistantContentBuffer = async (contentBuffer, dialogId, messageId,
|
|
|
2083
2080
|
return updated;
|
|
2084
2081
|
};
|
|
2085
2082
|
|
|
2086
|
-
// packages/core/clipCompactText.ts
|
|
2087
|
-
function clipCompactText(value, max, ellipsis = "...") {
|
|
2088
|
-
const compact = compactWhitespace(value);
|
|
2089
|
-
if (compact.length <= max) return compact;
|
|
2090
|
-
if (max <= ellipsis.length) return compact.slice(0, max);
|
|
2091
|
-
return `${compact.slice(0, max - ellipsis.length)}${ellipsis}`;
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
2083
|
// packages/ai/context/retention.ts
|
|
2095
2084
|
var SAFE_BUFFER_RATIO = 0.95;
|
|
2096
2085
|
var CACHE_FIRST_RETENTION_STRENGTH = 0.95;
|
|
@@ -2273,7 +2262,6 @@ function planCompression(input) {
|
|
|
2273
2262
|
}
|
|
2274
2263
|
|
|
2275
2264
|
export {
|
|
2276
|
-
clipCompactText,
|
|
2277
2265
|
planContextUsage,
|
|
2278
2266
|
estimateTokenCount,
|
|
2279
2267
|
DEFAULT_CONTEXT_WINDOW,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
toTimestampMs,
|
|
11
11
|
upsert,
|
|
12
12
|
write
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VKG4HXYV.js";
|
|
14
14
|
import {
|
|
15
15
|
createUserKey,
|
|
16
16
|
createUserPreferenceKey,
|
|
@@ -763,41 +763,41 @@ var catppuccin = {
|
|
|
763
763
|
textOnPrimary: "#FFFFFF"
|
|
764
764
|
},
|
|
765
765
|
dark: {
|
|
766
|
-
//
|
|
767
|
-
primary: "#
|
|
768
|
-
primaryLight: "#
|
|
769
|
-
primaryDark: "#
|
|
770
|
-
primaryGradient: "linear-gradient(135deg, #
|
|
771
|
-
primaryGhost: "rgba(
|
|
772
|
-
primaryHover: "rgba(
|
|
773
|
-
borderAccent: "#
|
|
774
|
-
success: "#
|
|
775
|
-
warning: "#
|
|
776
|
-
info: "#
|
|
777
|
-
error: "#
|
|
778
|
-
background: "#
|
|
779
|
-
backgroundSecondary: "#
|
|
780
|
-
backgroundTertiary: "#
|
|
781
|
-
backgroundGhost: "rgba(
|
|
782
|
-
backgroundHover: "#
|
|
783
|
-
backgroundSelected: "#
|
|
784
|
-
backgroundElevated: "#
|
|
785
|
-
text: "#
|
|
786
|
-
textSecondary: "#
|
|
787
|
-
textTertiary: "#
|
|
788
|
-
textQuaternary: "#
|
|
789
|
-
textLight: "#
|
|
790
|
-
placeholder: "#
|
|
791
|
-
border: "#
|
|
792
|
-
borderHover: "#
|
|
793
|
-
borderLight: "#
|
|
794
|
-
messageBackground: "#
|
|
795
|
-
codeBackground: "#
|
|
796
|
-
shadowLight: "rgba(
|
|
797
|
-
shadowMedium: "rgba(
|
|
798
|
-
shadowHeavy: "rgba(
|
|
799
|
-
textHeading: "#
|
|
800
|
-
textOnPrimary: "#
|
|
766
|
+
// Catppuccin Mocha — 柔和夜间色调(告别高对比刺眼黑白,偏向 Ghostty Catppuccin Mocha)
|
|
767
|
+
primary: "#89B4FA",
|
|
768
|
+
primaryLight: "#B4BEFE",
|
|
769
|
+
primaryDark: "#74C7EC",
|
|
770
|
+
primaryGradient: "linear-gradient(135deg, #89B4FA, #B4BEFE)",
|
|
771
|
+
primaryGhost: "rgba(137,180,250,0.12)",
|
|
772
|
+
primaryHover: "rgba(137,180,250,0.16)",
|
|
773
|
+
borderAccent: "#89B4FA",
|
|
774
|
+
success: "#A6E3A1",
|
|
775
|
+
warning: "#F9E2AF",
|
|
776
|
+
info: "#89B4FA",
|
|
777
|
+
error: "#F38BA8",
|
|
778
|
+
background: "#1E1E2E",
|
|
779
|
+
backgroundSecondary: "#181825",
|
|
780
|
+
backgroundTertiary: "#313244",
|
|
781
|
+
backgroundGhost: "rgba(30,30,46,0.94)",
|
|
782
|
+
backgroundHover: "#313244",
|
|
783
|
+
backgroundSelected: "#45475A",
|
|
784
|
+
backgroundElevated: "#181825",
|
|
785
|
+
text: "#CDD6F4",
|
|
786
|
+
textSecondary: "#BAC2DE",
|
|
787
|
+
textTertiary: "#A6ADC8",
|
|
788
|
+
textQuaternary: "#6C7086",
|
|
789
|
+
textLight: "#45475A",
|
|
790
|
+
placeholder: "#6C7086",
|
|
791
|
+
border: "#313244",
|
|
792
|
+
borderHover: "#45475A",
|
|
793
|
+
borderLight: "#181825",
|
|
794
|
+
messageBackground: "#181825",
|
|
795
|
+
codeBackground: "#11111B",
|
|
796
|
+
shadowLight: "rgba(17,17,27,0.22)",
|
|
797
|
+
shadowMedium: "rgba(17,17,27,0.36)",
|
|
798
|
+
shadowHeavy: "rgba(17,17,27,0.52)",
|
|
799
|
+
textHeading: "#CDD6F4",
|
|
800
|
+
textOnPrimary: "#1E1E2E"
|
|
801
801
|
}
|
|
802
802
|
};
|
|
803
803
|
|
|
@@ -1594,7 +1594,7 @@ var selectTheme = createSelector(
|
|
|
1594
1594
|
surface: c.backgroundSecondary,
|
|
1595
1595
|
surfaceElevated: c.backgroundTertiary,
|
|
1596
1596
|
surfaceCanvas: c.background,
|
|
1597
|
-
surfaceSidebar:
|
|
1597
|
+
surfaceSidebar: c.background,
|
|
1598
1598
|
surfacePanel: c.backgroundSecondary,
|
|
1599
1599
|
surfaceCard: c.messageBackground,
|
|
1600
1600
|
surfaceRaised: isDark ? c.backgroundTertiary : c.backgroundSecondary,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearCliLocalRuntimePreparedAgentCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NS3DRNUZ.js";
|
|
4
4
|
import {
|
|
5
5
|
getReadableCliDb
|
|
6
6
|
} from "./chunk-W4NVOSFF.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resolveAgentRecordFromHybridStore,
|
|
13
13
|
sanitizeAgentRecordForCliOutput,
|
|
14
14
|
writeAgentRecord
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CGAYFFIB.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveCliAgentKeyInput
|
|
18
18
|
} from "./chunk-VHBWHNVT.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
prepareAndPersistMessage,
|
|
4
4
|
uiAskChoiceFunc,
|
|
5
5
|
uiAskChoiceFunctionSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XNV42PMD.js";
|
|
7
7
|
import {
|
|
8
8
|
require_date_fns
|
|
9
9
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
removeCachedEntity,
|
|
26
26
|
upsertSSREntity,
|
|
27
27
|
write
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-VKG4HXYV.js";
|
|
29
29
|
import {
|
|
30
30
|
createAgentKey,
|
|
31
31
|
createDialogKey,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isImageUrlPart
|
|
3
|
+
} from "./chunk-TYPHUVK5.js";
|
|
1
4
|
import {
|
|
2
5
|
canonicalizeToolNames
|
|
3
6
|
} from "./chunk-B4KT7RN2.js";
|
|
7
|
+
import {
|
|
8
|
+
asTrimmedLowercaseString
|
|
9
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
4
10
|
import {
|
|
5
11
|
asTrimmedString
|
|
6
12
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -232,8 +238,39 @@ var buildCurrentTimeBlock = (now = /* @__PURE__ */ new Date(), timeZone = resolv
|
|
|
232
238
|
"\u5F53\u7528\u6237\u8BF4\u201C\u4ECA\u5929\u201D\u201C\u4ECA\u65E5\u201D\u6216 today \u65F6\uFF0C\u9ED8\u8BA4\u6307\u5F53\u524D\u672C\u5730\u65E5\u671F\uFF0C\u9664\u975E\u7528\u6237\u660E\u786E\u7ED9\u51FA\u5176\u5B83\u65E5\u671F\u3002"
|
|
233
239
|
].join("\n");
|
|
234
240
|
|
|
241
|
+
// packages/core/chat/bareImageUrlShape.ts
|
|
242
|
+
function requiresBareImageUrl(args) {
|
|
243
|
+
const model = asTrimmedLowercaseString(args.model);
|
|
244
|
+
if (!model.startsWith("gpt-")) return false;
|
|
245
|
+
const provider = asTrimmedLowercaseString(args.provider);
|
|
246
|
+
if (provider === "opencode-go") return true;
|
|
247
|
+
return asTrimmedLowercaseString(args.endpoint).includes("opencode.ai/zen/go");
|
|
248
|
+
}
|
|
249
|
+
function toBareImageUrlContent(content) {
|
|
250
|
+
if (!Array.isArray(content)) return content;
|
|
251
|
+
let changed = false;
|
|
252
|
+
const parts = content.map((part) => {
|
|
253
|
+
if (!isImageUrlPart(part)) return part;
|
|
254
|
+
const imageUrl = part.image_url;
|
|
255
|
+
if (!imageUrl || typeof imageUrl !== "object") return part;
|
|
256
|
+
const url = imageUrl.url;
|
|
257
|
+
if (typeof url !== "string" || !url) return part;
|
|
258
|
+
changed = true;
|
|
259
|
+
return { ...part, image_url: url };
|
|
260
|
+
});
|
|
261
|
+
return changed ? parts : content;
|
|
262
|
+
}
|
|
263
|
+
function toBareImageUrlMessages(messages) {
|
|
264
|
+
return messages.map((message) => {
|
|
265
|
+
const content = toBareImageUrlContent(message.content);
|
|
266
|
+
return content === message.content ? message : { ...message, content };
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
|
|
235
270
|
export {
|
|
236
271
|
buildIdentityBlock,
|
|
237
272
|
buildRuntimeGuidanceBlocks,
|
|
238
|
-
buildCurrentTimeBlock
|
|
273
|
+
buildCurrentTimeBlock,
|
|
274
|
+
requiresBareImageUrl,
|
|
275
|
+
toBareImageUrlMessages
|
|
239
276
|
};
|