nolo-cli 0.12.0-alpha.1 → 0.12.0-alpha.11
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-MWAY74HA.js → _executeModel-4F7VZR5U.js} +24 -23
- 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-LXR5A5FV.js → agentDeleteCommand-MMRSG6AB.js} +15 -14
- package/{agentEmailCommands-DXRAP7BB.js → agentEmailCommands-VW5FKADD.js} +28 -27
- package/{agentListCommands-ZFMS5ZLY.js → agentListCommands-2PZHIQ3I.js} +16 -15
- package/{agentMachineCommands-ZJLYVV52.js → agentMachineCommands-T2R7HVRV.js} +17 -16
- package/{agentRecordCommands-DFS626TB.js → agentRecordCommands-5DLPK3IV.js} +28 -27
- package/{agentRunCommand-GWBIE2TS.js → agentRunCommand-P6EH5DN7.js} +29 -28
- package/{agentRuntimeLocal-YNZSHMZC.js → agentRuntimeLocal-QDJCBXM2.js} +12 -11
- package/{agentSlice-T2PXOEPQ.js → agentSlice-6JAJOU3X.js} +2 -2
- package/{chunk-G3B356GF.js → chunk-2BVGERJ2.js} +67 -3
- package/{chunk-WWU275LU.js → chunk-3MI5LDDU.js} +2 -2
- package/{chunk-OPZYGHUC.js → chunk-3WGLLTK4.js} +59 -1
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-ZR4VHQ5D.js → chunk-5S4SWV5G.js} +38 -26
- package/{chunk-JUN3HFMN.js → chunk-5V524MHX.js} +25 -15
- package/{chunk-5ITRDSHY.js → chunk-7HVCFCZK.js} +65 -18
- package/{chunk-JZDIW766.js → chunk-ARSC56DC.js} +1 -1
- package/{chunk-3QKO4EHV.js → chunk-AS3ZQ3O2.js} +16 -25
- package/{chunk-43UD5ZP7.js → chunk-B4KT7RN2.js} +4 -4
- package/{chunk-YTQLJYLB.js → chunk-C3BFP57W.js} +95 -2
- package/{chunk-QCA3EPYK.js → chunk-CGDQDXKZ.js} +1 -1
- package/{chunk-7MYHLZ3F.js → chunk-DPFWKRHG.js} +1 -1
- package/{chunk-LHSJMY5V.js → chunk-E2BT7DBP.js} +3 -3
- package/{chunk-AM53Q2SD.js → chunk-FSUZIGIG.js} +28 -39
- package/{chunk-4GBNEA5B.js → chunk-H5Y2H2N6.js} +1 -1
- package/{chunk-S73OEOHH.js → chunk-JFANOO7I.js} +3 -15
- package/{chunk-ZPFRLGIZ.js → chunk-JHYLX2QV.js} +70 -37
- package/{chunk-OCDEWRE2.js → chunk-JKWWVF2I.js} +1 -1
- package/{chunk-WTYKCU4W.js → chunk-JU7J7EAV.js} +37 -37
- package/{chunk-EBH7G34M.js → chunk-LIO7AK5S.js} +2 -2
- package/{chunk-6OVCRC72.js → chunk-LUKQQJFL.js} +39 -2
- package/{chunk-DRMGJFGQ.js → chunk-MG6BVV3T.js} +31 -17
- package/{chunk-RSEUHW6T.js → chunk-MQRZ5QUH.js} +1 -1
- package/{chunk-RZ735TLX.js → chunk-MZHSAPZP.js} +167 -20
- package/{chunk-OPKKB25T.js → chunk-O4FOPRCP.js} +1 -1
- package/{chunk-S3UTETIC.js → chunk-OGGHETUE.js} +19 -4
- package/{chunk-4EH7AR52.js → chunk-OPM2DE2J.js} +1 -1
- package/{chunk-UG3WOFU6.js → chunk-QJSTNKJY.js} +1 -1
- package/{chunk-DE5BA4O6.js → chunk-QUHUVG6Y.js} +2 -2
- package/{chunk-YDCZVUFP.js → chunk-RQSOAMPJ.js} +16 -0
- package/{chunk-6LMFFG3K.js → chunk-RWO5DGXI.js} +2 -2
- package/{chunk-4BTHUYMY.js → chunk-TA7VKOHU.js} +23 -9
- package/{chunk-MEVCDATU.js → chunk-TQYYGE6G.js} +3 -3
- package/{chunk-TSKWE74T.js → chunk-TYPHUVK5.js} +13 -1
- package/{chunk-RNQ5BLR2.js → chunk-VBSWHE5W.js} +1 -1
- package/{chunk-NITP2JDG.js → chunk-VKG4HXYV.js} +1 -1
- package/{chunk-3HHTVM6G.js → chunk-WVTBAALN.js} +1 -1
- package/{chunk-GPZM7QH6.js → chunk-Y5P3ZRGC.js} +4 -4
- package/{chunk-GDBCUWQ3.js → chunk-YUMYYXPI.js} +31 -167
- package/{createAgentAutomationAction-G32GKDGV.js → createAgentAutomationAction-4NY4JLOK.js} +9 -8
- package/{createDialogAction-TISANRZK.js → createDialogAction-I5WUWFJ6.js} +10 -9
- package/{createPageAction-O7KOYNV4.js → createPageAction-HFTIQ7TW.js} +9 -8
- package/{dbSlice-WDP2ZZHK.js → dbSlice-J4PUZ6Y5.js} +1 -1
- package/{dialogCommands-6JPB3YQY.js → dialogCommands-SVXRJFZS.js} +16 -15
- package/{dialogSlice-PRHHYSP5.js → dialogSlice-35LA3ZRG.js} +9 -8
- package/{docCreateCommands-75E6TZNN.js → docCreateCommands-Z7RIAYKQ.js} +15 -14
- package/{docDeleteCommands-EJHLN7LW.js → docDeleteCommands-NEYHUVZF.js} +16 -15
- package/{docReadCommands-RJYBC4FS.js → docReadCommands-I4US2SDE.js} +15 -14
- package/{docStore-H5VWKT5D.js → docStore-3CP2IO6M.js} +10 -9
- package/{docUpdateCommands-MG4CNISV.js → docUpdateCommands-UU5HQBRP.js} +15 -14
- package/{getPricing-6TOZXPAU.js → getPricing-UGDJHI7M.js} +2 -2
- package/{handleSendMessageAction-QTUGICSZ.js → handleSendMessageAction-FWTLQGOZ.js} +9 -8
- package/index.js +36 -36
- package/{machineCommands-MAV7M3TK.js → machineCommands-J5JWJQ6I.js} +28 -27
- package/{machineWsRunDispatch-ZOEGTKHC.js → machineWsRunDispatch-U476S4G2.js} +27 -26
- package/package.json +1 -1
- package/{readlineWorkspace-SWQKC7ZS.js → readlineWorkspace-AQCPSGS7.js} +260 -87
- package/{removeDialogAgentAction-GTX5AN54.js → removeDialogAgentAction-XUZYQBV4.js} +3 -3
- package/{runAgentClientLoop-P25HACXX.js → runAgentClientLoop-FP2K33ZO.js} +20 -19
- 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/{skillDiscovery-ZYHSX7VD.js → skillDiscovery-6M2BZUFN.js} +1 -1
- package/{spaceCommands-6O5EFEM5.js → spaceCommands-GN73BCOB.js} +15 -14
- package/{spaceSlice-4EXTYXS4.js → spaceSlice-WTFNKOVA.js} +11 -8
- package/{streamAgentChatTurn-Q3FJAHG2.js → streamAgentChatTurn-HBAQQVNK.js} +244 -26
- package/{tools-AHNQE4GP.js → tools-TPQYTLQZ.js} +15 -14
- package/{tuiSummaryLlmCaller-TXLF4MEI.js → tuiSummaryLlmCaller-XDC7WG4K.js} +6 -4
- package/{updateDialogTitleAction-XZDVLKVX.js → updateDialogTitleAction-AWXNPUQJ.js} +9 -8
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MODEL_LOOKUP_MAP
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
compactWhitespace
|
|
6
|
-
} from "./chunk-DWLEOOGR.js";
|
|
3
|
+
} from "./chunk-OGGHETUE.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,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isBuiltinNoloAgentRef,
|
|
19
19
|
t,
|
|
20
20
|
toolLabel
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7HVCFCZK.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-CGDQDXKZ.js";
|
|
32
32
|
import {
|
|
33
33
|
normalizeAgentHandle
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-VBSWHE5W.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-MZHSAPZP.js";
|
|
52
52
|
import {
|
|
53
53
|
isGatewayHttpStatus
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-RQSOAMPJ.js";
|
|
55
55
|
import {
|
|
56
56
|
buildMemorySubjectsForAgent,
|
|
57
57
|
resolveAgentMemoryPolicy
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-2BVGERJ2.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-FSUZIGIG.js";
|
|
68
68
|
import {
|
|
69
69
|
buildSkillDiscoveryContextBlock
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-AS3ZQ3O2.js";
|
|
71
71
|
import {
|
|
72
72
|
buildPlatformChatCompletionRequest,
|
|
73
73
|
parsePlatformChatCompletionData
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-5S4SWV5G.js";
|
|
75
75
|
import {
|
|
76
76
|
resolveAgentRuntimeConfigFromRecord
|
|
77
77
|
} from "./chunk-NCGFB7NN.js";
|
|
@@ -80,18 +80,20 @@ 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
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-OGGHETUE.js";
|
|
95
97
|
import {
|
|
96
98
|
buildMemoryOverlayLayer,
|
|
97
99
|
buildMemoryUseGuidanceLayer
|
|
@@ -151,6 +153,12 @@ var INTENT_PROVIDER = "deepseek";
|
|
|
151
153
|
var QUICK_CHAT_INTENT_TIMEOUT_MS = 4e3;
|
|
152
154
|
var SHORT_GREETING_MAX_LENGTH = 20;
|
|
153
155
|
var SHORT_GREETING_PATTERN = /^(?:hi|hello|hey|hiya|yo|sup|howdy|嗨|哈喽|哈囉|你好|您好|在吗|在嘛|喂|早上好|中午好|下午好|晚上好|拜拜|再见|谢谢|thanks|thx|ok|好的|收到|了解)[!.。,、~~]?$/iu;
|
|
156
|
+
var VALID_QUICK_CHAT_SKILLS = /* @__PURE__ */ new Set([
|
|
157
|
+
"table",
|
|
158
|
+
"doc",
|
|
159
|
+
"code",
|
|
160
|
+
"pagebuilder"
|
|
161
|
+
]);
|
|
154
162
|
function isShortGreeting(text) {
|
|
155
163
|
const trimmed = text.trim();
|
|
156
164
|
if (!trimmed) return false;
|
|
@@ -206,10 +214,11 @@ ${agentList}
|
|
|
206
214
|
- \u7528\u6237\u8981\u65B0\u5EFA/\u6574\u7406/\u5F55\u5165/\u6279\u91CF\u5904\u7406\u8868\u683C\u6570\u636E\uFF08\u5EFA\u8868\u3001\u52A0\u884C\u3001\u6539\u5217\u3001\u6309\u6761\u4EF6\u6574\u7406\u6570\u636E\uFF09\u2192 skills \u542B "table"
|
|
207
215
|
- \u7528\u6237\u8981\u5199/\u6DA6\u8272/\u6539\u5199/\u7EED\u5199/\u6392\u7248\u4E00\u7BC7\u6587\u6863\u6216\u6587\u7AE0 \u2192 skills \u542B "doc"
|
|
208
216
|
- \u7528\u6237\u8981\u5199/\u6539/\u5B9E\u73B0/\u4FEE bug/refactor/\u8865\u6D4B\u8BD5/\u5BA1\u67E5\u5E76\u4FEE\u6539\u4EE3\u7801 \u2192 skills \u542B "code"\uFF08\u4EC5\u95EE\u901A\u7528\u77E5\u8BC6\u3001\u7EAF\u95F2\u804A\u3001\u53EA\u67E5\u770B git/\u4ED3\u5E93\u72B6\u6001\u800C\u4E0D\u4FEE\u6539\u4EE3\u7801\u65F6\u4E0D\u6302 "code"\uFF09
|
|
217
|
+
- \u7528\u6237\u60F3\u8981\u4E00\u4E2A\u53EF\u4EA4\u4E92\u7684\u53EF\u89C6\u5316\u9875\u9762/\u62A5\u544A/\u770B\u677F/\u4E3B\u9875/\u6559\u7A0B/\u5BF9\u6BD4\u9875/\u8BA1\u5212\u9875\uFF08\u5982"\u505A\u4E2A\u65E5\u62A5""\u505A\u4E00\u4E2A\u4E2A\u4EBA\u4E3B\u9875""\u505A\u4E2A\u9500\u552E\u770B\u677F""\u505A\u4E2A\u65B9\u6848\u5BF9\u6BD4\u9875""\u505A\u4E2A\u5B66\u4E60\u8BA1\u5212\u9875"\uFF09\u2192 skills \u542B "pagebuilder"
|
|
209
218
|
- \u666E\u901A\u95EE\u7B54/\u7EAF\u95F2\u804A/\u5EFA\u5E94\u7528 \u2192 skills \u4E3A []
|
|
210
219
|
|
|
211
220
|
\u53EA\u8F93\u51FA JSON\uFF0C\u4E0D\u8981\u8F93\u51FA\u5176\u4ED6\u5185\u5BB9\uFF1A
|
|
212
|
-
{"confidence": <0\u52301\u4E4B\u95F4\u7684\u5C0F\u6570\uFF0C\u8868\u793A\u4F60\u5BF9\u8FD9\u4E2A\u5206\u7C7B\u5224\u65AD\u7684\u628A\u63E1\u7A0B\u5EA6>, "agentKey": "<\u4ECE\u5217\u8868\u4E2D\u9009\u62E9\u7684 agentKey>", "needsWorkspace": <true \u6216 false>, "skills": <\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5143\u7D20\u53EA\u80FD\u662F
|
|
221
|
+
{"confidence": <0\u52301\u4E4B\u95F4\u7684\u5C0F\u6570\uFF0C\u8868\u793A\u4F60\u5BF9\u8FD9\u4E2A\u5206\u7C7B\u5224\u65AD\u7684\u628A\u63E1\u7A0B\u5EA6>, "agentKey": "<\u4ECE\u5217\u8868\u4E2D\u9009\u62E9\u7684 agentKey>", "needsWorkspace": <true \u6216 false>, "skills": <\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5143\u7D20\u53EA\u80FD\u662F ${[...VALID_QUICK_CHAT_SKILLS].map((s) => `"${s}"`).join(" | ")}\uFF0C\u672A\u547D\u4E2D\u7ED9 []>}`;
|
|
213
222
|
}
|
|
214
223
|
function parseQuickChatIntentResult(content, tierAgents) {
|
|
215
224
|
try {
|
|
@@ -226,7 +235,7 @@ function parseQuickChatIntentResult(content, tierAgents) {
|
|
|
226
235
|
let skills;
|
|
227
236
|
if (Array.isArray(rawSkills)) {
|
|
228
237
|
const filtered = [...new Set(rawSkills)].filter(
|
|
229
|
-
(s) =>
|
|
238
|
+
(s) => typeof s === "string" && VALID_QUICK_CHAT_SKILLS.has(s)
|
|
230
239
|
);
|
|
231
240
|
if (filtered.length > 0) skills = filtered;
|
|
232
241
|
}
|
|
@@ -808,14 +817,14 @@ var THEME_PALETTES = {
|
|
|
808
817
|
muted: { hex: "6E7781", ansiFallback: "\x1B[90m" }
|
|
809
818
|
},
|
|
810
819
|
dark: {
|
|
811
|
-
accent: { hex: "
|
|
812
|
-
//
|
|
813
|
-
chrome: { hex: "
|
|
814
|
-
success: { hex: "
|
|
815
|
-
warning: { hex: "
|
|
816
|
-
info: { hex: "
|
|
817
|
-
danger: { hex: "
|
|
818
|
-
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" }
|
|
819
828
|
}
|
|
820
829
|
},
|
|
821
830
|
wave: {
|
|
@@ -967,7 +976,7 @@ function hexToSgr(hex) {
|
|
|
967
976
|
}
|
|
968
977
|
var SURFACE_HEX = {
|
|
969
978
|
trail: { light: "E4E8EC", dark: "313244" },
|
|
970
|
-
catppuccin: { light: "E8ECF0", dark: "
|
|
979
|
+
catppuccin: { light: "E8ECF0", dark: "181825" },
|
|
971
980
|
wave: { light: "E5E1D6", dark: "2A2A37" },
|
|
972
981
|
iris: { light: "E9E8F2", dark: "2A2740" },
|
|
973
982
|
rose: { light: "F2EAE4", dark: "26233A" },
|
|
@@ -3151,6 +3160,12 @@ ${options.agentName} > `);
|
|
|
3151
3160
|
spinner.show(activeLabel);
|
|
3152
3161
|
options.activityReporter?.(activeLabel);
|
|
3153
3162
|
}
|
|
3163
|
+
if (event.type === "tool-result" && options.onAgentRunStatus && (event.toolName === "startAgentRun" || event.toolName === "controlAgentRun")) {
|
|
3164
|
+
const snapshot = extractAgentRunStatusSnapshot(event);
|
|
3165
|
+
if (snapshot) {
|
|
3166
|
+
options.onAgentRunStatus(snapshot);
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3154
3169
|
};
|
|
3155
3170
|
return {
|
|
3156
3171
|
spinner,
|
|
@@ -3199,6 +3214,30 @@ ${options.agentName} > (no text response)
|
|
|
3199
3214
|
}
|
|
3200
3215
|
};
|
|
3201
3216
|
}
|
|
3217
|
+
function extractAgentRunStatusSnapshot(event) {
|
|
3218
|
+
if (event.type !== "tool-result") return null;
|
|
3219
|
+
const content = typeof event.content === "string" ? event.content.trim() : "";
|
|
3220
|
+
if (!content.startsWith("{")) return null;
|
|
3221
|
+
try {
|
|
3222
|
+
const parsed = JSON.parse(content);
|
|
3223
|
+
const runId = typeof parsed.runId === "string" ? parsed.runId : "";
|
|
3224
|
+
const status = typeof parsed.status === "string" ? parsed.status : "running";
|
|
3225
|
+
const agentName = typeof parsed.agentName === "string" ? parsed.agentName : typeof parsed.name === "string" ? parsed.name : void 0;
|
|
3226
|
+
const logTail = typeof parsed.logTail === "string" ? parsed.logTail : void 0;
|
|
3227
|
+
const logLines = Array.isArray(parsed.logLines) ? parsed.logLines : void 0;
|
|
3228
|
+
const errorMessage = typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
|
|
3229
|
+
return {
|
|
3230
|
+
runId,
|
|
3231
|
+
agentName,
|
|
3232
|
+
status,
|
|
3233
|
+
logTail,
|
|
3234
|
+
logLines,
|
|
3235
|
+
errorMessage
|
|
3236
|
+
};
|
|
3237
|
+
} catch {
|
|
3238
|
+
return null;
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3202
3241
|
|
|
3203
3242
|
// packages/cli/client/agentRunStream.ts
|
|
3204
3243
|
async function readStreamingAgentRun(options, res, existingSpinner) {
|
|
@@ -3581,7 +3620,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
3581
3620
|
// packages/cli/client/agentRun.ts
|
|
3582
3621
|
import { ulid } from "ulid";
|
|
3583
3622
|
async function loadRunLocalAgentTurn() {
|
|
3584
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
3623
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-QDJCBXM2.js");
|
|
3585
3624
|
return runLocalAgentTurn;
|
|
3586
3625
|
}
|
|
3587
3626
|
async function resolveCurrentMachineId(options) {
|
|
@@ -4018,7 +4057,7 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
4018
4057
|
} : void 0;
|
|
4019
4058
|
const currentDialogId = options.continueDialogId ?? ulid();
|
|
4020
4059
|
const runChildTurn = async (input) => {
|
|
4021
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
4060
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-QDJCBXM2.js");
|
|
4022
4061
|
return runLocalAgentTurn(input);
|
|
4023
4062
|
};
|
|
4024
4063
|
const createFreshChildBaseAdapter = () => {
|
|
@@ -4243,8 +4282,7 @@ function workflowRefToCandidatePath(cwd, ref) {
|
|
|
4243
4282
|
return resolve(cwd, "docs", "workflows", `${fileName}.md`);
|
|
4244
4283
|
}
|
|
4245
4284
|
var SKILL_SEARCH_DIRS = [
|
|
4246
|
-
".agents/skills"
|
|
4247
|
-
"docs/skills"
|
|
4285
|
+
".agents/skills"
|
|
4248
4286
|
];
|
|
4249
4287
|
function skillRefToCandidatePath(cwd, ref) {
|
|
4250
4288
|
const normalized = ref.trim();
|
|
@@ -4255,15 +4293,10 @@ function skillRefToCandidatePath(cwd, ref) {
|
|
|
4255
4293
|
}
|
|
4256
4294
|
const fileName = normalized.replace(/[^a-zA-Z0-9一-鿿]+/g, "-").replace(/^-+|-+$/g, "");
|
|
4257
4295
|
for (const dir of SKILL_SEARCH_DIRS) {
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
if (existsSync(flatPath)) return flatPath;
|
|
4261
|
-
} else {
|
|
4262
|
-
const skillMdPath = resolve(cwd, dir, fileName, "SKILL.md");
|
|
4263
|
-
if (existsSync(skillMdPath)) return skillMdPath;
|
|
4264
|
-
}
|
|
4296
|
+
const skillMdPath = resolve(cwd, dir, fileName, "SKILL.md");
|
|
4297
|
+
if (existsSync(skillMdPath)) return skillMdPath;
|
|
4265
4298
|
}
|
|
4266
|
-
return resolve(cwd, "
|
|
4299
|
+
return resolve(cwd, ".agents", "skills", fileName, "SKILL.md");
|
|
4267
4300
|
}
|
|
4268
4301
|
async function resolveWorkflowReference(ref, cwd = process.cwd()) {
|
|
4269
4302
|
const path = workflowRefToCandidatePath(cwd, ref);
|
|
@@ -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-7HVCFCZK.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-CGDQDXKZ.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveCliAgentKeyInput
|
|
18
18
|
} from "./chunk-VHBWHNVT.js";
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isImageUrlPart
|
|
3
|
+
} from "./chunk-TYPHUVK5.js";
|
|
1
4
|
import {
|
|
2
5
|
canonicalizeToolNames
|
|
3
|
-
} from "./chunk-
|
|
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
|
};
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyChatCompletionDelta,
|
|
3
|
-
finalizeAccumulatedToolCalls,
|
|
4
3
|
flushChatCompletionStream,
|
|
4
|
+
providerHttpFailure,
|
|
5
5
|
readSseFrames,
|
|
6
6
|
throwIfChatCompletionStreamFailed
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5S4SWV5G.js";
|
|
8
8
|
import {
|
|
9
9
|
parseToolArgumentsJson
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TA7VKOHU.js";
|
|
11
11
|
import {
|
|
12
12
|
createThinkParserState,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
createToolCallAccumulator,
|
|
14
|
+
extractThinkContent,
|
|
15
|
+
finalizeAccumulatedToolCalls
|
|
16
|
+
} from "./chunk-3WGLLTK4.js";
|
|
17
|
+
import {
|
|
18
|
+
requiresBareImageUrl,
|
|
19
|
+
toBareImageUrlMessages
|
|
20
|
+
} from "./chunk-LUKQQJFL.js";
|
|
15
21
|
import {
|
|
16
22
|
buildProviderAuthHeaders,
|
|
17
23
|
buildProviderExecutionPlan,
|
|
18
24
|
toOpenAiCompatibleMessages
|
|
19
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-TYPHUVK5.js";
|
|
20
26
|
import {
|
|
21
27
|
canonicalizeToolName,
|
|
22
28
|
createGlob,
|
|
23
29
|
resolveExecutableOnPath
|
|
24
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-B4KT7RN2.js";
|
|
25
31
|
import {
|
|
26
32
|
toErrorMessage
|
|
27
33
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -81,9 +87,14 @@ function parseSseDataLineJson(line) {
|
|
|
81
87
|
|
|
82
88
|
// packages/agent-runtime/openAiCompatibleProvider.ts
|
|
83
89
|
function buildOpenAiCompatibleChatCompletionRequest(args) {
|
|
90
|
+
const messages = toOpenAiCompatibleMessages(args.messages);
|
|
84
91
|
const body = {
|
|
85
92
|
model: args.providerConfig.model,
|
|
86
|
-
messages:
|
|
93
|
+
messages: requiresBareImageUrl({
|
|
94
|
+
endpoint: args.providerConfig.endpoint,
|
|
95
|
+
provider: args.providerConfig.provider,
|
|
96
|
+
model: args.providerConfig.model
|
|
97
|
+
}) ? toBareImageUrlMessages(messages) : messages,
|
|
87
98
|
stream: args.stream ?? false,
|
|
88
99
|
...args.providerConfig.requestOptions,
|
|
89
100
|
...args.tools && args.tools.length > 0 ? { tools: args.tools } : {},
|
|
@@ -121,6 +132,9 @@ function parseOpenAiCompatibleChatCompletionResponse(args) {
|
|
|
121
132
|
...reasoning ? { reasoning_content: reasoning } : {},
|
|
122
133
|
...typeof choiceMessage?.reasoning_content === "string" && choiceMessage.reasoning_content ? { reasoning_content: choiceMessage.reasoning_content } : {},
|
|
123
134
|
...typeof rawFinishReason === "string" && rawFinishReason.length > 0 ? { finish_reason: rawFinishReason } : {},
|
|
135
|
+
// 非流式:拿到完整的 200 JSON body 本身就证明这次调用走完了,
|
|
136
|
+
// 不必等 finish_reason(有从不发它的上游,见 AgentRuntimeResult)。
|
|
137
|
+
stream_complete: true,
|
|
124
138
|
usage: args.data?.usage,
|
|
125
139
|
trace: args.trace
|
|
126
140
|
};
|
|
@@ -137,7 +151,7 @@ async function readOpenAiCompatibleSseCompletion(args) {
|
|
|
137
151
|
content: "",
|
|
138
152
|
reasoning: "",
|
|
139
153
|
usage: void 0,
|
|
140
|
-
accumulatedToolCalls:
|
|
154
|
+
accumulatedToolCalls: createToolCallAccumulator(),
|
|
141
155
|
thinkState: createThinkParserState(),
|
|
142
156
|
onTextDelta: args.onTextDelta,
|
|
143
157
|
onReasoningDelta: args.onReasoningDelta
|
|
@@ -152,7 +166,7 @@ async function readOpenAiCompatibleSseCompletion(args) {
|
|
|
152
166
|
content: state.content,
|
|
153
167
|
...state.reasoning ? { reasoning_content: state.reasoning } : {},
|
|
154
168
|
...tool_calls.length > 0 ? { tool_calls } : {},
|
|
155
|
-
...state.usage ? { usage: state.usage } : {},
|
|
169
|
+
...state.usage ? { usage: state.usage, stream_complete: true } : {},
|
|
156
170
|
...state.finishReason ? { finish_reason: state.finishReason } : {}
|
|
157
171
|
};
|
|
158
172
|
}
|
|
@@ -183,13 +197,12 @@ async function executeOpenAiCompatibleChatCompletion(args) {
|
|
|
183
197
|
}
|
|
184
198
|
}
|
|
185
199
|
if (!res.ok) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
throw new Error(`local provider failed: HTTP ${res.status} ${JSON.stringify(data2)}`);
|
|
200
|
+
throw providerHttpFailure({
|
|
201
|
+
label: "local provider",
|
|
202
|
+
status: res.status,
|
|
203
|
+
raw: await res.text().catch(() => ""),
|
|
204
|
+
messages: args.messages
|
|
205
|
+
});
|
|
193
206
|
}
|
|
194
207
|
const contentType = res.headers.get("content-type") ?? "";
|
|
195
208
|
const isEventStream = contentType.includes("text/event-stream");
|
|
@@ -206,6 +219,7 @@ async function executeOpenAiCompatibleChatCompletion(args) {
|
|
|
206
219
|
...streamed.tool_calls ? { tool_calls: streamed.tool_calls } : {},
|
|
207
220
|
...streamed.reasoning_content ? { reasoning_content: streamed.reasoning_content } : {},
|
|
208
221
|
...streamed.usage ? { usage: streamed.usage } : {},
|
|
222
|
+
...streamed.stream_complete ? { stream_complete: true } : {},
|
|
209
223
|
...streamed.finish_reason ? { finish_reason: streamed.finish_reason } : {},
|
|
210
224
|
trace: args.messages
|
|
211
225
|
};
|