nolo-cli 0.8.0 → 0.9.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-UD44KGZ4.js +203 -0
- package/action-ZJWE3Y5S.js +28 -0
- package/addContentAction-TVDBNJM5.js +26 -0
- package/addDialogAgentAction-EKH774VT.js +68 -0
- package/agentDeleteCommand-TCPEFJTF.js +327 -0
- package/agentEmailCommands-CZ3UILZ4.js +626 -0
- package/agentListCommands-SJKO2FFB.js +223 -0
- package/agentMachineCommands-PSNABISZ.js +425 -0
- package/agentPullCommand-O2MTUAFR.js +122 -0
- package/agentRecordCommands-MH2JKFHS.js +94 -0
- package/agentRunCommand-4KH6MIZR.js +110 -0
- package/agentRunControl-K4VKNEHF.js +57 -0
- package/agentRuntimeLocal-SKHJUWSS.js +104 -0
- package/agentSlice-3WXXN4VK.js +42 -0
- package/authCommand-PXFX6JDT.js +581 -0
- package/authCommands-356AYWEK.js +35 -0
- package/chunk-2EISRLRC.js +238 -0
- package/chunk-2FTTDCD4.js +675 -0
- package/chunk-2K2ECKSG.js +222 -0
- package/chunk-2PUGVR6E.js +19 -0
- package/chunk-3ASDTTEI.js +1774 -0
- package/chunk-3EUW3WEO.js +8 -0
- package/chunk-3LY4F7SV.js +9293 -0
- package/chunk-3TZDXYSF.js +71 -0
- package/chunk-3WYQEUBI.js +34 -0
- package/chunk-4CQLVGRV.js +50 -0
- package/chunk-4IJYA27C.js +342 -0
- package/chunk-4K2KKCSD.js +577 -0
- package/chunk-4SN6J65J.js +38 -0
- package/chunk-4VNS5WPM.js +42 -0
- package/chunk-4ZDM73SD.js +34 -0
- package/chunk-5CS33IBL.js +301 -0
- package/chunk-5KLGBAAR.js +386 -0
- package/chunk-5MIDPSSK.js +206 -0
- package/chunk-5MMAK75Q.js +15 -0
- package/chunk-5PJ3VWCS.js +360 -0
- package/chunk-63SLEOLK.js +175 -0
- package/chunk-63W5N6P3.js +150 -0
- package/chunk-6GANEXVO.js +231 -0
- package/chunk-6HYVJV7B.js +102 -0
- package/chunk-6WD3OOJS.js +20 -0
- package/chunk-7OOXPE3N.js +628 -0
- package/chunk-7QRKCBOP.js +1078 -0
- package/chunk-ATNTHIZI.js +13 -0
- package/chunk-AUQ747NZ.js +902 -0
- package/chunk-AVMKZHBC.js +85 -0
- package/chunk-AZPCASRE.js +36 -0
- package/chunk-BBYVOSU2.js +792 -0
- package/chunk-C3RUNRHT.js +51 -0
- package/chunk-CF2WZF4N.js +134 -0
- package/chunk-CF7PE763.js +10 -0
- package/chunk-CKOJQDKR.js +198 -0
- package/chunk-COMXDWNM.js +807 -0
- package/chunk-CPB2YM4D.js +171 -0
- package/chunk-CWMSB67P.js +34 -0
- package/chunk-DCOA4QSN.js +105 -0
- package/chunk-DFFIZ25G.js +30 -0
- package/chunk-DWLEOOGR.js +8 -0
- package/chunk-DZ3XJVET.js +231 -0
- package/chunk-EHLHSX7R.js +1433 -0
- package/chunk-ELRRLDWI.js +478 -0
- package/chunk-EXTIQUCI.js +482 -0
- package/chunk-EYEEHCU4.js +3066 -0
- package/chunk-G3SUCT4W.js +8 -0
- package/chunk-G43KEVSC.js +1447 -0
- package/chunk-GAKEBQD6.js +30 -0
- package/chunk-GBRG75BQ.js +86 -0
- package/chunk-GG4AJPSR.js +191 -0
- package/chunk-H33743XH.js +25 -0
- package/chunk-HNMXYYJR.js +12 -0
- package/chunk-I42VC5KR.js +15 -0
- package/chunk-IDZTNRP2.js +85 -0
- package/chunk-ISNCLGUZ.js +146 -0
- package/chunk-IWX4UW2E.js +548 -0
- package/chunk-JBTJAPUF.js +35 -0
- package/chunk-JEXVIMYZ.js +55 -0
- package/chunk-JRKKFRAV.js +537 -0
- package/chunk-JZPBVBIY.js +94 -0
- package/chunk-KKY4B2Q2.js +21 -0
- package/chunk-KOCA5FCS.js +4750 -0
- package/chunk-KQHGZWSV.js +63 -0
- package/chunk-KTVVPRJS.js +138 -0
- package/chunk-KUG52IAP.js +8 -0
- package/chunk-KX6YBIHG.js +8 -0
- package/chunk-LARL2V6G.js +9017 -0
- package/chunk-LCBAMY2M.js +60 -0
- package/chunk-LM6IYQ3F.js +16 -0
- package/chunk-M76ECQRD.js +13658 -0
- package/chunk-MGOJ5R6J.js +113 -0
- package/chunk-MKMWT7SA.js +27196 -0
- package/chunk-MRC4Q34M.js +188 -0
- package/chunk-OLZBQWZU.js +6 -0
- package/chunk-OPZYGHUC.js +89 -0
- package/chunk-OWOHNGCN.js +50 -0
- package/chunk-PAKN26FP.js +239 -0
- package/chunk-PCWC3JTN.js +91 -0
- package/chunk-PG5PNA7Y.js +939 -0
- package/chunk-Q2YZULBH.js +104 -0
- package/chunk-QSJ3HFEF.js +8 -0
- package/chunk-QYXLLLGL.js +4519 -0
- package/chunk-ROWQEJRP.js +139 -0
- package/chunk-S7Z2HMCN.js +25 -0
- package/chunk-SBR32ZZS.js +1901 -0
- package/chunk-SH2CFQOH.js +3391 -0
- package/chunk-SL35K7AH.js +226 -0
- package/chunk-TILFE6LV.js +381 -0
- package/chunk-TSS3XJY4.js +2052 -0
- package/chunk-U4TRT5V4.js +246 -0
- package/chunk-U6VC4MU4.js +8 -0
- package/chunk-UAD2WT54.js +64 -0
- package/chunk-UUJDGGAK.js +421 -0
- package/chunk-VF4K2QE6.js +21 -0
- package/chunk-VHBWHNVT.js +59 -0
- package/chunk-VIDPVFP3.js +20 -0
- package/chunk-VP4WJWKW.js +8882 -0
- package/chunk-W4NVOSFF.js +37 -0
- package/chunk-WKM6FH35.js +190 -0
- package/chunk-WWC7I6TA.js +8 -0
- package/chunk-X7W4TNB4.js +1550 -0
- package/chunk-XE635NI4.js +1948 -0
- package/chunk-XKIMRZO2.js +221 -0
- package/chunk-XS466O7S.js +933 -0
- package/chunk-Y5GCAMGP.js +9 -0
- package/chunk-YBWOP46I.js +3272 -0
- package/chunk-YPRZSPF3.js +148 -0
- package/chunk-YYUCRDOK.js +69 -0
- package/chunk-Z4NR32XR.js +50 -0
- package/chunk-ZIG5LJ7X.js +24765 -0
- package/chunk-ZNFJWEN4.js +56 -0
- package/chunk-ZQ2UM4KG.js +2878 -0
- package/cliExecutor-DNE7TCC4.js +36 -0
- package/clipboardy-BVE3LVEH.js +12001 -0
- package/createAgentAutomationAction-63OIP6X5.js +866 -0
- package/createDialogAction-ZLYZDYBB.js +54 -0
- package/createPageAction-AL5FSDCK.js +171 -0
- package/db-HCJ5PRB5.js +271 -0
- package/dbSlice-PR44QPXY.js +60 -0
- package/deleteFile-4SKGPHOZ.js +41 -0
- package/dialogCommands-F6YI5742.js +63 -0
- package/dialogSlice-JSBNZRLR.js +148 -0
- package/docCreateCommands-4CTO7ERT.js +219 -0
- package/docDeleteCommands-VBWERDRG.js +180 -0
- package/docReadCommands-KNP4MFYB.js +133 -0
- package/docStore-ADP5VYY4.js +98 -0
- package/docUpdateCommands-4BCBJQHA.js +317 -0
- package/fetchMessages-U6ZHN56A.js +17 -0
- package/getPricing-3E6UNPKL.js +30 -0
- package/handleSendMessageAction-IJDQ6ARA.js +185 -0
- package/index.js +188 -112943
- package/lib-FYYBQIXS.js +19839 -0
- package/localDialogRead-Z5UTAJPU.js +26 -0
- package/localFirstLog-DHNOY2NA.js +19 -0
- package/localRuntimeAuthority-TEGCOWX4.js +471 -0
- package/localRuntimeDb-LGDF6FQP.js +12 -0
- package/machineCommands-EA3M4XTN.js +779 -0
- package/machineInfo-M6KB6HZN.js +10 -0
- package/machineWsRunDispatch-NAPKE5ZA.js +110 -0
- package/memoryCommands-O4MIPIWQ.js +476 -0
- package/models-4OPOOLFS.js +9 -0
- package/offlineMarxistsAgentCommand-BCPJITJL.js +242 -0
- package/package.json +3 -25
- package/read-RIJCIVKX.js +17 -0
- package/readDocTool-GZD2N3LO.js +16 -0
- package/readlineWorkspace-KMWT4T4S.js +5509 -0
- package/removeDialogAgentAction-GJQJNDW6.js +73 -0
- package/runAgentClientLoop-U5Q6NDTJ.js +291 -0
- package/runtimeDoctorCommands-LRHLPDRC.js +289 -0
- package/setDialogExtraReferencesAction-M7OQG54N.js +60 -0
- package/setPrimaryDialogAgentAction-46UNFJDL.js +80 -0
- package/settingSlice-FVUUH4JA.js +199 -0
- package/skillSummaryMarker-42HKSXYY.js +9 -0
- package/slateToRenderMarkdown-Y5IYN73U.js +7 -0
- package/slateUtils-2M7MUTWX.js +19 -0
- package/spaceCommands-E2CFRPZJ.js +454 -0
- package/spaceSlice-L3R6IMXE.js +147 -0
- package/streamAgentChatTurn-UBDAOQWE.js +4528 -0
- package/tableCommands-GOFP7QKA.js +1286 -0
- package/toolApiClient-QI3YBNWB.js +26 -0
- package/tools-TMJXZTCA.js +85 -0
- package/tuiSummaryLlmCaller-RV3THLZF.js +78 -0
- package/understanding-GQKNDDWM.js +271 -0
- package/updateCommands-VOSPKXFF.js +31 -0
- package/updateDialogTitleAction-ZTWRDXI2.js +188 -0
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getModelConfig
|
|
3
|
+
} from "./chunk-BBYVOSU2.js";
|
|
4
|
+
import {
|
|
5
|
+
asTrimmedLowercaseString
|
|
6
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
7
|
+
import {
|
|
8
|
+
asTrimmedString
|
|
9
|
+
} from "./chunk-3EUW3WEO.js";
|
|
10
|
+
import {
|
|
11
|
+
normalizeServerOrigin
|
|
12
|
+
} from "./chunk-CF7PE763.js";
|
|
13
|
+
import {
|
|
14
|
+
asOptionalTrimmedString
|
|
15
|
+
} from "./chunk-G3SUCT4W.js";
|
|
16
|
+
import {
|
|
17
|
+
isRecord
|
|
18
|
+
} from "./chunk-KUG52IAP.js";
|
|
19
|
+
|
|
20
|
+
// packages/agent-runtime/agentConfigOptions.ts
|
|
21
|
+
function pickAgentRuntimeInferenceOptions(agentConfig) {
|
|
22
|
+
return {
|
|
23
|
+
...agentConfig.temperature !== void 0 ? { temperature: agentConfig.temperature } : {},
|
|
24
|
+
...agentConfig.top_p !== void 0 ? { top_p: agentConfig.top_p } : {},
|
|
25
|
+
...agentConfig.frequency_penalty !== void 0 ? { frequency_penalty: agentConfig.frequency_penalty } : {},
|
|
26
|
+
...agentConfig.presence_penalty !== void 0 ? { presence_penalty: agentConfig.presence_penalty } : {},
|
|
27
|
+
...agentConfig.max_tokens !== void 0 ? { max_tokens: agentConfig.max_tokens } : {},
|
|
28
|
+
...agentConfig.reasoning_effort ? { reasoning_effort: agentConfig.reasoning_effort } : {}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// packages/agent-runtime/platformProviderEndpoints.ts
|
|
33
|
+
var OPENAI_RESPONSES_ENDPOINT = "https://api.openai.com/v1/responses";
|
|
34
|
+
var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
|
|
35
|
+
deepinfra: "https://api.deepinfra.com/v1/openai/chat/completions",
|
|
36
|
+
deepseek: "https://api.deepseek.com/chat/completions",
|
|
37
|
+
fireworks: "https://api.fireworks.ai/inference/v1/chat/completions",
|
|
38
|
+
google: "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions",
|
|
39
|
+
openai: "https://api.openai.com/v1/chat/completions",
|
|
40
|
+
openrouter: "https://openrouter.ai/api/v1/chat/completions",
|
|
41
|
+
// 千问 AI 平台 OpenAI 兼容模式
|
|
42
|
+
qwen: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
|
|
43
|
+
// Moonshot AI(月之暗面)开放平台 OpenAI 兼容模式(按量计费)
|
|
44
|
+
moonshot: "https://api.moonshot.cn/v1/chat/completions",
|
|
45
|
+
// Open-source default: nolo provider 中转 ollama cloud。
|
|
46
|
+
// 内部多后端组合路由不开源,由内部 provider 路由层接管。
|
|
47
|
+
nolo: "https://ollama.com/v1/chat/completions"
|
|
48
|
+
};
|
|
49
|
+
function isOpenAiResponsesModel(args) {
|
|
50
|
+
if (asTrimmedLowercaseString(args.provider) !== "openai") return false;
|
|
51
|
+
if (args.endpointKey === "responses") return true;
|
|
52
|
+
if (!args.model) return false;
|
|
53
|
+
try {
|
|
54
|
+
return getModelConfig("openai", args.model).endpointKey === "responses";
|
|
55
|
+
} catch {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function resolvePlatformChatCompletionsEndpoint(provider) {
|
|
60
|
+
const key = asTrimmedLowercaseString(provider);
|
|
61
|
+
if (!key) return void 0;
|
|
62
|
+
return PLATFORM_CHAT_COMPLETIONS_ENDPOINTS[key];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// packages/agent-runtime/providerResolution.ts
|
|
66
|
+
function resolvePlatformProviderEndpoint(agentConfig) {
|
|
67
|
+
const customProviderUrl = agentConfig.customProviderUrl?.trim();
|
|
68
|
+
if (customProviderUrl) return resolveChatCompletionsEndpoint(customProviderUrl);
|
|
69
|
+
const provider = asTrimmedLowercaseString(
|
|
70
|
+
agentConfig.provider ?? agentConfig.apiSource ?? "openai"
|
|
71
|
+
);
|
|
72
|
+
if (!provider) {
|
|
73
|
+
throw new Error("Platform chat provider requires agentConfig.provider.");
|
|
74
|
+
}
|
|
75
|
+
if (isOpenAiResponsesModel({
|
|
76
|
+
provider,
|
|
77
|
+
model: agentConfig.model,
|
|
78
|
+
endpointKey: agentConfig.endpointKey
|
|
79
|
+
})) {
|
|
80
|
+
return OPENAI_RESPONSES_ENDPOINT;
|
|
81
|
+
}
|
|
82
|
+
const endpoint = resolvePlatformChatCompletionsEndpoint(provider);
|
|
83
|
+
if (!endpoint) {
|
|
84
|
+
throw new Error(`Platform chat provider does not support provider "${provider}".`);
|
|
85
|
+
}
|
|
86
|
+
return endpoint;
|
|
87
|
+
}
|
|
88
|
+
async function resolveCredentialFromBroker(broker, ref) {
|
|
89
|
+
const trimmed = asTrimmedString(ref);
|
|
90
|
+
if (!trimmed) return null;
|
|
91
|
+
try {
|
|
92
|
+
if (!await broker.has(trimmed)) return null;
|
|
93
|
+
const secret = await broker.get(trimmed);
|
|
94
|
+
return asOptionalTrimmedString(secret) ?? null;
|
|
95
|
+
} catch {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function trimTrailingSlash(value) {
|
|
100
|
+
return normalizeServerOrigin(value);
|
|
101
|
+
}
|
|
102
|
+
function resolveChatCompletionsEndpoint(value) {
|
|
103
|
+
const trimmed = trimTrailingSlash(value);
|
|
104
|
+
return trimmed.endsWith("/chat/completions") ? trimmed : `${trimmed}/chat/completions`;
|
|
105
|
+
}
|
|
106
|
+
function resolveOpenAiCompatibleBaseUrl(env) {
|
|
107
|
+
return env.NOLO_LOCAL_OPENAI_BASE_URL || env.OPENAI_BASE_URL || "https://api.openai.com/v1";
|
|
108
|
+
}
|
|
109
|
+
function resolveOpenAiCompatibleApiKey(env) {
|
|
110
|
+
return env.OPENAI_API_KEY || env.NOLO_LOCAL_OPENAI_API_KEY || "";
|
|
111
|
+
}
|
|
112
|
+
function resolvePlatformServerUrl(env) {
|
|
113
|
+
return trimTrailingSlash(env.NOLO_SERVER || env.BASE_URL || "https://nolo.chat");
|
|
114
|
+
}
|
|
115
|
+
function resolvePlatformAuthToken(env) {
|
|
116
|
+
return env.AUTH_TOKEN || env.AUTH || env.BENCHMARK_AUTH_TOKEN || "";
|
|
117
|
+
}
|
|
118
|
+
function canUsePlatformChatProvider(env) {
|
|
119
|
+
return Boolean(resolvePlatformAuthToken(env));
|
|
120
|
+
}
|
|
121
|
+
function hasDirectOpenAiCompatibleProvider(env) {
|
|
122
|
+
return Boolean(
|
|
123
|
+
env.NOLO_LOCAL_OPENAI_API_KEY || env.OPENAI_API_KEY || env.NOLO_LOCAL_OPENAI_BASE_URL || env.OPENAI_BASE_URL || env.OLLAMA_BASE_URL
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
function resolveAgentProviderMode(agentConfig) {
|
|
127
|
+
if (agentConfig.apiSource === "cli" || agentConfig.provider === "cli" || agentConfig.cliProvider) {
|
|
128
|
+
return "cli";
|
|
129
|
+
}
|
|
130
|
+
if (agentConfig.apiSource === "custom" || agentConfig.customProviderUrl) {
|
|
131
|
+
return "custom";
|
|
132
|
+
}
|
|
133
|
+
return "platform";
|
|
134
|
+
}
|
|
135
|
+
function resolveAgentRuntimeLocation(args) {
|
|
136
|
+
const runtimeBinding = args.agentConfig.runtimeBinding;
|
|
137
|
+
const machineId = asTrimmedString(runtimeBinding?.machineId);
|
|
138
|
+
if (machineId) return "bound-machine";
|
|
139
|
+
if (args.runtimeKind === "server") return "server";
|
|
140
|
+
return "local-host";
|
|
141
|
+
}
|
|
142
|
+
function resolveProviderTransportDecision(args) {
|
|
143
|
+
const mode = resolveAgentProviderMode(args.agentConfig);
|
|
144
|
+
if (mode === "cli") {
|
|
145
|
+
return { mode, transport: "direct", reason: "cli-provider" };
|
|
146
|
+
}
|
|
147
|
+
if (mode === "custom") {
|
|
148
|
+
if (args.runtimeLocation === "server" && args.agentConfig.useServerProxy === true) {
|
|
149
|
+
return { mode, transport: "proxy", reason: "custom-server-proxy" };
|
|
150
|
+
}
|
|
151
|
+
return { mode, transport: "direct", reason: "custom-provider" };
|
|
152
|
+
}
|
|
153
|
+
if (args.agentConfig.apiSource === "platform" || args.agentConfig.useServerProxy === true) {
|
|
154
|
+
return { mode, transport: "proxy", reason: "platform-agent" };
|
|
155
|
+
}
|
|
156
|
+
if (args.env.NOLO_LOCAL_LLM === "platform") {
|
|
157
|
+
return { mode, transport: "proxy", reason: "forced-platform-env" };
|
|
158
|
+
}
|
|
159
|
+
if (args.env.NOLO_LOCAL_LLM === "direct") {
|
|
160
|
+
return { mode, transport: "direct", reason: "forced-direct-env" };
|
|
161
|
+
}
|
|
162
|
+
if (hasDirectOpenAiCompatibleProvider(args.env)) {
|
|
163
|
+
return { mode, transport: "direct", reason: "direct-provider-env" };
|
|
164
|
+
}
|
|
165
|
+
if (canUsePlatformChatProvider(args.env)) {
|
|
166
|
+
return { mode, transport: "proxy", reason: "platform-proxy-fallback" };
|
|
167
|
+
}
|
|
168
|
+
return { mode, transport: "direct", reason: "direct-provider-env" };
|
|
169
|
+
}
|
|
170
|
+
function resolveProviderAuthHeaderName(args) {
|
|
171
|
+
const explicitHeader = args.apiKeyHeader?.trim();
|
|
172
|
+
if (explicitHeader) return explicitHeader;
|
|
173
|
+
if (/xiaomimimo\.com/i.test(args.endpoint)) return "api-key";
|
|
174
|
+
return "Authorization";
|
|
175
|
+
}
|
|
176
|
+
function buildProviderAuthHeaders(args) {
|
|
177
|
+
if (!args.apiKey) return {};
|
|
178
|
+
const headerName = resolveProviderAuthHeaderName(args);
|
|
179
|
+
return headerName.toLowerCase() === "authorization" ? { Authorization: `Bearer ${args.apiKey}` } : { [headerName]: args.apiKey };
|
|
180
|
+
}
|
|
181
|
+
async function buildProviderExecutionPlan(args) {
|
|
182
|
+
const { agentConfig, env } = args;
|
|
183
|
+
const mode = resolveAgentProviderMode(agentConfig);
|
|
184
|
+
const runtimeLocation = resolveAgentRuntimeLocation({
|
|
185
|
+
agentConfig,
|
|
186
|
+
runtimeKind: args.runtimeKind
|
|
187
|
+
});
|
|
188
|
+
const transportDecision = resolveProviderTransportDecision({
|
|
189
|
+
agentConfig,
|
|
190
|
+
env,
|
|
191
|
+
runtimeLocation
|
|
192
|
+
});
|
|
193
|
+
const model = agentConfig.model || "gpt-4.1-mini";
|
|
194
|
+
const requestOptions = pickAgentRuntimeInferenceOptions(agentConfig);
|
|
195
|
+
if (mode === "cli") {
|
|
196
|
+
return {
|
|
197
|
+
mode,
|
|
198
|
+
transport: "direct",
|
|
199
|
+
cliProvider: agentConfig.cliProvider || agentConfig.provider || "codex",
|
|
200
|
+
model,
|
|
201
|
+
provider: agentConfig.provider || "cli",
|
|
202
|
+
requestOptions
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
if (mode === "custom") {
|
|
206
|
+
const endpoint2 = resolveChatCompletionsEndpoint(agentConfig.customProviderUrl || resolveOpenAiCompatibleBaseUrl(env));
|
|
207
|
+
let apiKey2 = "";
|
|
208
|
+
const credentialRef2 = agentConfig.credentialRef?.trim();
|
|
209
|
+
const apiKeyRef = agentConfig.apiKeyRef?.trim();
|
|
210
|
+
if (args.credentialBroker) {
|
|
211
|
+
const brokerRefs = [credentialRef2, apiKeyRef].filter(
|
|
212
|
+
(ref) => Boolean(ref)
|
|
213
|
+
);
|
|
214
|
+
for (const ref of brokerRefs) {
|
|
215
|
+
const fromBroker = await resolveCredentialFromBroker(args.credentialBroker, ref);
|
|
216
|
+
if (fromBroker) {
|
|
217
|
+
apiKey2 = fromBroker;
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (!apiKey2 && agentConfig.credentialSynced && args.syncFetcher && credentialRef2) {
|
|
223
|
+
const synced = await args.syncFetcher(credentialRef2);
|
|
224
|
+
const trimmed = asTrimmedString(synced);
|
|
225
|
+
if (trimmed) {
|
|
226
|
+
try {
|
|
227
|
+
await args.credentialBroker?.put(credentialRef2, trimmed);
|
|
228
|
+
} catch {
|
|
229
|
+
}
|
|
230
|
+
apiKey2 = trimmed;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (!apiKey2 && apiKeyRef && args.apiKeyRefResolver) {
|
|
234
|
+
const resolved = await args.apiKeyRefResolver(apiKeyRef);
|
|
235
|
+
if (resolved) {
|
|
236
|
+
apiKey2 = resolved;
|
|
237
|
+
} else if (!agentConfig.apiKey?.trim() && !agentConfig.apiKeyFromAgentKey?.trim()) {
|
|
238
|
+
const isApiKeyRef = apiKeyRef.startsWith("api-key:");
|
|
239
|
+
const hint = isApiKeyRef ? agentConfig.credentialSynced ? `Local credential for "${apiKeyRef}" not found. It is synced to your account \u2014 run this agent once on a device that has the key, or re-enter it in agent settings.` : `Local credential for "${apiKeyRef}" not found. Re-enter the API key in agent settings, or enable cross-device sync.` : `OAuth credential for "${apiKeyRef}" not found locally. Run \`nolo auth ${apiKeyRef}\` (and \`--sync-to-server\` for server-side agent runs).`;
|
|
240
|
+
throw new Error(hint);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (!apiKey2) {
|
|
244
|
+
apiKey2 = asOptionalTrimmedString(agentConfig.apiKey) ?? asOptionalTrimmedString(agentConfig.apiKeyFromAgentKey) ?? "";
|
|
245
|
+
}
|
|
246
|
+
const apiKeyHeader = resolveProviderAuthHeaderName({
|
|
247
|
+
endpoint: endpoint2,
|
|
248
|
+
apiKeyHeader: agentConfig.apiKeyHeader
|
|
249
|
+
});
|
|
250
|
+
if (transportDecision.transport === "proxy") {
|
|
251
|
+
return {
|
|
252
|
+
mode,
|
|
253
|
+
transport: "proxy",
|
|
254
|
+
model,
|
|
255
|
+
provider: agentConfig.provider || "custom",
|
|
256
|
+
endpoint: endpoint2,
|
|
257
|
+
requestOptions,
|
|
258
|
+
serverUrl: resolvePlatformServerUrl(env),
|
|
259
|
+
authToken: resolvePlatformAuthToken(env),
|
|
260
|
+
agentKey: agentConfig.key,
|
|
261
|
+
...agentConfig.apiSource ? { apiSource: agentConfig.apiSource } : {},
|
|
262
|
+
...apiKey2 ? { apiKey: apiKey2 } : {},
|
|
263
|
+
...apiKeyHeader ? { apiKeyHeader } : {}
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
mode,
|
|
268
|
+
transport: "direct",
|
|
269
|
+
model,
|
|
270
|
+
provider: agentConfig.provider || "custom",
|
|
271
|
+
endpoint: endpoint2,
|
|
272
|
+
requestOptions,
|
|
273
|
+
apiKey: apiKey2,
|
|
274
|
+
...apiKeyHeader ? { apiKeyHeader } : {}
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
const provider = agentConfig.provider || agentConfig.apiSource || "openai";
|
|
278
|
+
const endpoint = transportDecision.transport === "proxy" ? resolvePlatformProviderEndpoint(agentConfig) : resolveChatCompletionsEndpoint(resolveOpenAiCompatibleBaseUrl(env));
|
|
279
|
+
if (transportDecision.transport === "proxy") {
|
|
280
|
+
return {
|
|
281
|
+
mode,
|
|
282
|
+
transport: "proxy",
|
|
283
|
+
model,
|
|
284
|
+
provider,
|
|
285
|
+
endpoint,
|
|
286
|
+
requestOptions,
|
|
287
|
+
serverUrl: resolvePlatformServerUrl(env),
|
|
288
|
+
authToken: resolvePlatformAuthToken(env),
|
|
289
|
+
agentKey: agentConfig.key,
|
|
290
|
+
...agentConfig.apiSource ? { apiSource: agentConfig.apiSource } : {},
|
|
291
|
+
...agentConfig.apiKey?.trim() ? { apiKey: agentConfig.apiKey.trim() } : {},
|
|
292
|
+
...agentConfig.apiKeyHeader?.trim() ? { apiKeyHeader: agentConfig.apiKeyHeader.trim() } : {}
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
let apiKey = "";
|
|
296
|
+
const credentialRef = agentConfig.credentialRef?.trim();
|
|
297
|
+
if (args.credentialBroker && credentialRef) {
|
|
298
|
+
const fromBroker = await resolveCredentialFromBroker(args.credentialBroker, credentialRef);
|
|
299
|
+
if (fromBroker) {
|
|
300
|
+
apiKey = fromBroker;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (!apiKey && agentConfig.credentialSynced && args.syncFetcher && credentialRef) {
|
|
304
|
+
const synced = await args.syncFetcher(credentialRef);
|
|
305
|
+
const trimmed = asTrimmedString(synced);
|
|
306
|
+
if (trimmed) {
|
|
307
|
+
try {
|
|
308
|
+
await args.credentialBroker?.put(credentialRef, trimmed);
|
|
309
|
+
} catch {
|
|
310
|
+
}
|
|
311
|
+
apiKey = trimmed;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (!apiKey) {
|
|
315
|
+
apiKey = resolveOpenAiCompatibleApiKey(env);
|
|
316
|
+
}
|
|
317
|
+
return {
|
|
318
|
+
mode,
|
|
319
|
+
transport: "direct",
|
|
320
|
+
model,
|
|
321
|
+
provider: agentConfig.provider || "openai-compatible",
|
|
322
|
+
endpoint,
|
|
323
|
+
requestOptions,
|
|
324
|
+
apiKey
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// packages/integrations/openai/responsesHelpers.ts
|
|
329
|
+
var RESPONSES_TOP_LEVEL_SCHEMA_KEYS = ["anyOf", "oneOf", "allOf", "enum", "not"];
|
|
330
|
+
var sanitizeResponsesParameters = (parameters) => {
|
|
331
|
+
if (!isRecord(parameters)) {
|
|
332
|
+
return parameters;
|
|
333
|
+
}
|
|
334
|
+
const next = { ...parameters };
|
|
335
|
+
for (const key of RESPONSES_TOP_LEVEL_SCHEMA_KEYS) {
|
|
336
|
+
delete next[key];
|
|
337
|
+
}
|
|
338
|
+
return next;
|
|
339
|
+
};
|
|
340
|
+
var appendTextPart = (parts, text, role) => {
|
|
341
|
+
if (!text) return;
|
|
342
|
+
const last = parts.at(-1);
|
|
343
|
+
const textType = role === "assistant" ? "output_text" : "input_text";
|
|
344
|
+
if (last?.type === textType) {
|
|
345
|
+
last.text += text;
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
parts.push({ type: textType, text });
|
|
349
|
+
};
|
|
350
|
+
var normalizeMessageParts = (content, role) => {
|
|
351
|
+
if (typeof content === "string") {
|
|
352
|
+
if (!content) return [];
|
|
353
|
+
return [
|
|
354
|
+
{
|
|
355
|
+
type: role === "assistant" ? "output_text" : "input_text",
|
|
356
|
+
text: content
|
|
357
|
+
}
|
|
358
|
+
];
|
|
359
|
+
}
|
|
360
|
+
const parts = [];
|
|
361
|
+
for (const part of content ?? []) {
|
|
362
|
+
const typedPart = part;
|
|
363
|
+
if (typedPart?.type === "text" && typeof typedPart.text === "string") {
|
|
364
|
+
appendTextPart(parts, typedPart.text, role);
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
if (typedPart?.type === "image_url" && typeof typedPart.image_url?.url === "string" && typedPart.image_url.url) {
|
|
368
|
+
if (role === "assistant") continue;
|
|
369
|
+
parts.push({
|
|
370
|
+
type: "input_image",
|
|
371
|
+
image_url: typedPart.image_url.url,
|
|
372
|
+
detail: typedPart.image_url.detail
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return parts;
|
|
377
|
+
};
|
|
378
|
+
var normalizeToolOutput = (content) => {
|
|
379
|
+
if (typeof content === "string") return content;
|
|
380
|
+
return JSON.stringify(content ?? "");
|
|
381
|
+
};
|
|
382
|
+
var toResponsesTools = (tools) => {
|
|
383
|
+
if (!Array.isArray(tools) || tools.length === 0) return void 0;
|
|
384
|
+
return tools.map((tool) => {
|
|
385
|
+
const fn = tool?.function;
|
|
386
|
+
if (!fn?.name) return null;
|
|
387
|
+
return {
|
|
388
|
+
type: "function",
|
|
389
|
+
name: fn.name,
|
|
390
|
+
description: fn.description,
|
|
391
|
+
parameters: sanitizeResponsesParameters(fn.parameters),
|
|
392
|
+
strict: fn.strict
|
|
393
|
+
};
|
|
394
|
+
}).filter(Boolean);
|
|
395
|
+
};
|
|
396
|
+
var convertMessagesToResponsesInput = (messages) => {
|
|
397
|
+
const input = [];
|
|
398
|
+
for (const message of messages) {
|
|
399
|
+
if (!message?.role) continue;
|
|
400
|
+
if (message.role === "tool") {
|
|
401
|
+
if (!message.tool_call_id) continue;
|
|
402
|
+
input.push({
|
|
403
|
+
type: "function_call_output",
|
|
404
|
+
call_id: message.tool_call_id,
|
|
405
|
+
output: normalizeToolOutput(message.content)
|
|
406
|
+
});
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
const role = message.role;
|
|
410
|
+
const contentParts = normalizeMessageParts(message.content, role);
|
|
411
|
+
if (contentParts.length > 0) {
|
|
412
|
+
input.push({
|
|
413
|
+
type: "message",
|
|
414
|
+
role,
|
|
415
|
+
content: contentParts
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
if (role === "assistant" && Array.isArray(message.content)) {
|
|
419
|
+
const replayImages = message.content.map((part) => part).filter(
|
|
420
|
+
(part) => part?.type === "image_url" && typeof part.image_url?.url === "string" && Boolean(part.image_url.url)
|
|
421
|
+
).map((part) => ({
|
|
422
|
+
type: "input_image",
|
|
423
|
+
image_url: part.image_url.url,
|
|
424
|
+
detail: part.image_url.detail
|
|
425
|
+
}));
|
|
426
|
+
if (replayImages.length > 0) {
|
|
427
|
+
input.push({
|
|
428
|
+
type: "message",
|
|
429
|
+
role: "user",
|
|
430
|
+
content: replayImages
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
if (role === "assistant" && Array.isArray(message.tool_calls)) {
|
|
435
|
+
for (const toolCall of message.tool_calls) {
|
|
436
|
+
if (!toolCall?.id || !toolCall.function?.name) continue;
|
|
437
|
+
input.push({
|
|
438
|
+
type: "function_call",
|
|
439
|
+
call_id: toolCall.id,
|
|
440
|
+
name: toolCall.function.name,
|
|
441
|
+
arguments: typeof toolCall.function.arguments === "string" ? toolCall.function.arguments : JSON.stringify(toolCall.function.arguments ?? {})
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return input;
|
|
447
|
+
};
|
|
448
|
+
var extractTextFromResponseOutput = (response) => {
|
|
449
|
+
const parts = [];
|
|
450
|
+
for (const item of response?.output ?? []) {
|
|
451
|
+
if (item?.type !== "message") continue;
|
|
452
|
+
for (const content of item.content ?? []) {
|
|
453
|
+
if (content?.type === "output_text" && typeof content.text === "string") {
|
|
454
|
+
parts.push(content.text);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return parts.join("");
|
|
459
|
+
};
|
|
460
|
+
var toDataUrl = (base64Data, mimeType) => {
|
|
461
|
+
const normalizedMimeType = asOptionalTrimmedString(mimeType) ?? "image/png";
|
|
462
|
+
return `data:${normalizedMimeType};base64,${base64Data}`;
|
|
463
|
+
};
|
|
464
|
+
var extractImagePartsFromResponseOutput = (response) => {
|
|
465
|
+
const images = [];
|
|
466
|
+
for (const item of response?.output ?? []) {
|
|
467
|
+
if (item?.type === "image_generation_call") {
|
|
468
|
+
const result = asOptionalTrimmedString(item.result);
|
|
469
|
+
if (result) {
|
|
470
|
+
const outputFormat = asOptionalTrimmedString(item.output_format);
|
|
471
|
+
images.push({
|
|
472
|
+
type: "image_url",
|
|
473
|
+
image_url: {
|
|
474
|
+
url: toDataUrl(
|
|
475
|
+
result,
|
|
476
|
+
outputFormat ? `image/${outputFormat}` : void 0
|
|
477
|
+
)
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
if (item?.type !== "message") continue;
|
|
484
|
+
for (const content of item.content ?? []) {
|
|
485
|
+
const result = asOptionalTrimmedString(content?.result);
|
|
486
|
+
if (content?.type === "output_image" && result) {
|
|
487
|
+
images.push({
|
|
488
|
+
type: "image_url",
|
|
489
|
+
image_url: {
|
|
490
|
+
url: toDataUrl(
|
|
491
|
+
result,
|
|
492
|
+
content.mime_type ?? content.mimeType ?? null
|
|
493
|
+
)
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return images;
|
|
500
|
+
};
|
|
501
|
+
var extractToolCallsFromResponseOutput = (response) => {
|
|
502
|
+
const calls = [];
|
|
503
|
+
for (const item of response?.output ?? []) {
|
|
504
|
+
if (item?.type !== "function_call") continue;
|
|
505
|
+
if (!item.call_id || !item.name) continue;
|
|
506
|
+
calls.push({
|
|
507
|
+
id: item.call_id,
|
|
508
|
+
type: "function",
|
|
509
|
+
function: {
|
|
510
|
+
name: item.name,
|
|
511
|
+
arguments: typeof item.arguments === "string" ? item.arguments : JSON.stringify(item.arguments ?? {})
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
return calls;
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
export {
|
|
519
|
+
pickAgentRuntimeInferenceOptions,
|
|
520
|
+
OPENAI_RESPONSES_ENDPOINT,
|
|
521
|
+
isOpenAiResponsesModel,
|
|
522
|
+
resolvePlatformChatCompletionsEndpoint,
|
|
523
|
+
trimTrailingSlash,
|
|
524
|
+
resolvePlatformServerUrl,
|
|
525
|
+
resolvePlatformAuthToken,
|
|
526
|
+
canUsePlatformChatProvider,
|
|
527
|
+
hasDirectOpenAiCompatibleProvider,
|
|
528
|
+
resolveAgentRuntimeLocation,
|
|
529
|
+
resolveProviderTransportDecision,
|
|
530
|
+
buildProviderAuthHeaders,
|
|
531
|
+
buildProviderExecutionPlan,
|
|
532
|
+
toResponsesTools,
|
|
533
|
+
convertMessagesToResponsesInput,
|
|
534
|
+
extractTextFromResponseOutput,
|
|
535
|
+
extractImagePartsFromResponseOutput,
|
|
536
|
+
extractToolCallsFromResponseOutput
|
|
537
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// packages/agent-runtime/oauthTokenStore.ts
|
|
2
|
+
import {
|
|
3
|
+
chmodSync,
|
|
4
|
+
existsSync,
|
|
5
|
+
mkdirSync,
|
|
6
|
+
readFileSync,
|
|
7
|
+
unlinkSync,
|
|
8
|
+
writeFileSync
|
|
9
|
+
} from "node:fs";
|
|
10
|
+
import { homedir } from "node:os";
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
var DEFAULT_REFRESH_SKEW_MS = 5 * 60 * 1e3;
|
|
13
|
+
function getCredentialsDir(homeDir = homedir()) {
|
|
14
|
+
return join(homeDir, ".nolo", "credentials");
|
|
15
|
+
}
|
|
16
|
+
function getCredentialPath(provider, homeDir = homedir()) {
|
|
17
|
+
return join(getCredentialsDir(homeDir), `${provider}.json`);
|
|
18
|
+
}
|
|
19
|
+
function ensurePrivateDir(dir) {
|
|
20
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
21
|
+
try {
|
|
22
|
+
chmodSync(dir, 448);
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function writePrivateFile(path, body) {
|
|
27
|
+
writeFileSync(path, body, { encoding: "utf8", mode: 384 });
|
|
28
|
+
try {
|
|
29
|
+
chmodSync(path, 384);
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function readOAuthCredential(provider, homeDir = homedir()) {
|
|
34
|
+
const path = getCredentialPath(provider, homeDir);
|
|
35
|
+
if (!existsSync(path)) return null;
|
|
36
|
+
const raw = readFileSync(path, "utf8");
|
|
37
|
+
try {
|
|
38
|
+
const parsed = JSON.parse(raw);
|
|
39
|
+
if (!parsed?.provider || !parsed?.accessToken) return null;
|
|
40
|
+
return parsed;
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function writeOAuthCredential(provider, credential, homeDir = homedir()) {
|
|
46
|
+
const path = getCredentialPath(provider, homeDir);
|
|
47
|
+
ensurePrivateDir(getCredentialsDir(homeDir));
|
|
48
|
+
writePrivateFile(path, `${JSON.stringify(credential, null, 2)}
|
|
49
|
+
`);
|
|
50
|
+
}
|
|
51
|
+
function removeOAuthCredential(provider, homeDir = homedir()) {
|
|
52
|
+
const path = getCredentialPath(provider, homeDir);
|
|
53
|
+
if (!existsSync(path)) return;
|
|
54
|
+
unlinkSync(path);
|
|
55
|
+
}
|
|
56
|
+
function createOAuthTokenStore(homeDir = homedir()) {
|
|
57
|
+
return {
|
|
58
|
+
read(provider) {
|
|
59
|
+
return readOAuthCredential(provider, homeDir);
|
|
60
|
+
},
|
|
61
|
+
write(provider, credential) {
|
|
62
|
+
writeOAuthCredential(provider, credential, homeDir);
|
|
63
|
+
},
|
|
64
|
+
remove(provider) {
|
|
65
|
+
removeOAuthCredential(provider, homeDir);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function isTokenExpired(credential, skewMs = DEFAULT_REFRESH_SKEW_MS, now = Date.now()) {
|
|
70
|
+
if (!credential.expiresAt) return false;
|
|
71
|
+
return credential.expiresAt - now <= skewMs;
|
|
72
|
+
}
|
|
73
|
+
async function resolveFreshAccessToken(args) {
|
|
74
|
+
const store = args.store ?? createOAuthTokenStore(args.homeDir);
|
|
75
|
+
const now = args.now ?? Date.now;
|
|
76
|
+
const credential = store.read(args.provider);
|
|
77
|
+
if (!credential) return null;
|
|
78
|
+
if (!args.force && !isTokenExpired(credential, args.skewMs ?? DEFAULT_REFRESH_SKEW_MS, now())) {
|
|
79
|
+
return credential.accessToken;
|
|
80
|
+
}
|
|
81
|
+
if (!credential.refreshToken || !args.refresh) return null;
|
|
82
|
+
const refreshed = await args.refresh(credential);
|
|
83
|
+
store.write(args.provider, refreshed);
|
|
84
|
+
return refreshed.accessToken;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
getCredentialsDir,
|
|
89
|
+
readOAuthCredential,
|
|
90
|
+
writeOAuthCredential,
|
|
91
|
+
createOAuthTokenStore,
|
|
92
|
+
isTokenExpired,
|
|
93
|
+
resolveFreshAccessToken
|
|
94
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// packages/agent-runtime/staleReplayGuard.ts
|
|
2
|
+
var wrapHistoricalSummaryWithReplayGuard = (summary) => {
|
|
3
|
+
const trimmed = summary.trim();
|
|
4
|
+
if (!trimmed) return "";
|
|
5
|
+
return [
|
|
6
|
+
"\u3010\u5386\u53F2\u53C2\u8003\uFF0C\u975E\u6D3B\u6307\u4EE4\u3011\u4EE5\u4E0B\u4E3A\u51BB\u7ED3\u6458\u8981\uFF0C\u5176\u4E2D\u7684\u4EFB\u52A1/skill/ARGUMENTS \u9ED8\u8BA4\u5DF2\u8FC7\u671F\uFF0C\u4E0D\u5F97\u91CD\u65B0\u6267\u884C\u3002",
|
|
7
|
+
trimmed
|
|
8
|
+
].join("\n");
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// packages/agent-runtime/memoryUseGuidance.ts
|
|
12
|
+
var MEMORY_USE_GUIDANCE = `--- \u8BB0\u5FC6\u4F7F\u7528\u65B9\u5F0F ---
|
|
13
|
+
- \u8BB0\u5FC6\u662F\u4E2A\u6027\u5316\u589E\u5F3A\u5C42\uFF1B\u5F53\u524D\u8F93\u5165/\u5BF9\u8BDD/\u7CFB\u7EDF\u89C4\u5219/Agent prompt/skill/\u7528\u6237\u5168\u5C40\u504F\u597D\u90FD\u4F18\u5148\u4E8E\u5B83\u3002\u5F53\u524D\u8F93\u5165\u7ED9\u51FA\u65B0\u8BED\u8A00\u3001\u6280\u672F\u6808\u3001\u6570\u503C\u3001\u7EA6\u675F\u6216\u660E\u786E\u8986\u76D6\u65E7\u504F\u597D\u65F6\uFF0C\u91C7\u7528\u5F53\u524D\u8F93\u5165\uFF0C\u4E0D\u8981\u628A\u65E7\u8BB0\u5FC6\u5F53\u66F4\u9AD8\u771F\u503C\u3002
|
|
14
|
+
- \u8BB0\u5FC6\u542B\u7528\u6237\u8EAB\u4EFD/\u79F0\u547C/\u5173\u7CFB/\u957F\u671F\u504F\u597D/\u9879\u76EE\u80CC\u666F\u65F6\uFF0C\u76F8\u5173\u5904\u81EA\u7136\u4F53\u73B0\uFF08\u5F00\u573A\u79F0\u547C\u3001\u4E0A\u4E0B\u6587\u786E\u8BA4\u3001\u56DE\u7B54\u7ED3\u6784\u3001\u53D6\u820D\u6807\u51C6\uFF09\uFF0C\u4E0D\u8981\u6BCF\u53E5\u673A\u68B0\u79F0\u547C\u7528\u6237\u3002
|
|
15
|
+
- \u201C\u4E0A\u6B21/\u7EE7\u7EED/\u8FD9\u4E2A\u9879\u76EE\u201D\u7B49\u6307\u4EE3\u4F18\u5148\u6309\u5F53\u524D dialog/space/project/agent/sourceDialog \u7B49 KV \u8DEF\u5F84\u548C\u65F6\u95F4\u7EBF\u5B9A\u4F4D\uFF0C\u4E0D\u8981\u53EA\u6309\u8BED\u4E49\u76F8\u4F3C\u5EA6\u635E\u4E00\u6761\u3002
|
|
16
|
+
- \u63A8\u65AD\u578B\u8BB0\u5FC6\u53EA\u7528\u4E8E\u628A\u63E1\u8BED\u6C14\u3001\u72B6\u6001\u548C\u672A\u5B8C\u6210\u4E8B\u9879\uFF0C\u4E0D\u8981\u8BF4\u6210\u201C\u4F60\u660E\u786E\u544A\u8BC9\u8FC7\u6211\u201D\u6216\u5F53\u6210\u7528\u6237\u5DF2\u6388\u6743\u4FDD\u5B58\u7684\u4E8B\u5B9E\u3002\u51B2\u7A81\u6216\u573A\u666F\u4E0D\u660E\u65F6\u8BF4\u660E\u4F9D\u636E\u6216\u7B80\u77ED\u786E\u8BA4\uFF0C\u4E0D\u8981\u786C\u5957\u3002`;
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
wrapHistoricalSummaryWithReplayGuard,
|
|
20
|
+
MEMORY_USE_GUIDANCE
|
|
21
|
+
};
|