hypercore-cli 1.1.0 → 1.1.2
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/dist/{api-XGC7D5AW.js → api-JHHOZTL6.js} +13 -13
- package/dist/{auth-DNQWYQKT.js → auth-5QFJLW7J.js} +2 -2
- package/dist/{chunk-GOOTEPBK.js → chunk-5GDYH676.js} +1 -1
- package/dist/{chunk-XDRCBMZZ.js → chunk-5NLVGLD7.js} +1 -1
- package/dist/{chunk-MV4TTRYX.js → chunk-6XTEAFZQ.js} +53 -11
- package/dist/{chunk-AUHU7ALH.js → chunk-AQBSMYLT.js} +33 -31
- package/dist/{chunk-B6A2AKLN.js → chunk-CLKIMCXZ.js} +1 -1
- package/dist/{chunk-2LJ2DVEB.js → chunk-DN4ASQ26.js} +2 -2
- package/dist/{chunk-6OL3GA3P.js → chunk-DUWREZXK.js} +2 -2
- package/dist/{chunk-43OLRXM5.js → chunk-FCW3K6F2.js} +1 -1
- package/dist/{chunk-KRPOPWGA.js → chunk-GFORWAMW.js} +1 -1
- package/dist/{chunk-V5UHPPSY.js → chunk-I7WI3BMB.js} +26 -5
- package/dist/{chunk-GPPMJYSM.js → chunk-LBVHDGZE.js} +1 -1
- package/dist/{chunk-XOS6HPEF.js → chunk-NETIY5UB.js} +1 -1
- package/dist/{chunk-3RPFCQKJ.js → chunk-NP47L7LG.js} +2 -2
- package/dist/{chunk-CUVAUOXL.js → chunk-O6MG7TOH.js} +1 -1
- package/dist/{chunk-QTSLP47C.js → chunk-R5T3A2NQ.js} +2 -2
- package/dist/{chunk-U5SGAIMM.js → chunk-UCX4VZCT.js} +6 -6
- package/dist/{chunk-IXOIOGR5.js → chunk-Y6HMJZDJ.js} +2 -2
- package/dist/{claude-NSQ442XD.js → claude-4BX3MJSK.js} +3 -3
- package/dist/{commands-CK3WFAGI.js → commands-2X4OB5RF.js} +2 -2
- package/dist/{commands-U63OEO5J.js → commands-GLBCEVQK.js} +1 -1
- package/dist/{commands-ZE6GD3WC.js → commands-IINRNBYX.js} +3 -3
- package/dist/{config-4EW42BSF.js → config-RSNQJQPS.js} +1 -1
- package/dist/{diagnose-AFW3ZTZ4.js → diagnose-7UPLS7I4.js} +1 -1
- package/dist/{extractor-QV53W2YJ.js → extractor-D3XWOAXI.js} +4 -4
- package/dist/{history-WMSCHERZ.js → history-6I6FADAU.js} +1 -1
- package/dist/index.js +61 -64
- package/dist/{instance-registry-YSIJXSO7.js → instance-registry-J7UJ7U4Z.js} +2 -2
- package/dist/{keybindings-JAAMLH3G.js → keybindings-PDXIOV3O.js} +2 -2
- package/dist/{loader-WHNTZTLP.js → loader-GKEYT6Y7.js} +2 -2
- package/dist/{network-MM6YWPGO.js → network-JYGHQXAR.js} +8 -8
- package/dist/{openai-compat-UQWJXBEK.js → openai-compat-R7EKWG6Z.js} +3 -3
- package/dist/{prompt-QV45TXRL.js → prompt-UWHSZU4P.js} +7 -7
- package/dist/{repl-RT3AHL7M.js → repl-QHIZ2JGF.js} +32 -33
- package/dist/{server-PORT7OEG.js → server-HCNIP7ZQ.js} +12 -12
- package/dist/{session-4VUNDWLH.js → session-5EBECDUP.js} +2 -2
- package/dist/{skills-V4A35XKG.js → skills-HBQQTYO4.js} +2 -2
- package/dist/{store-Y4LU5QTO.js → store-FKUTR7GW.js} +2 -2
- package/dist/{team-HO7Z4SIM.js → team-7BBBP5YQ.js} +3 -3
- package/dist/{test-runner-ZQH5Y6OJ.js → test-runner-AUAGIBNM.js} +1 -1
- package/dist/{upgrade-7TGI3SXO.js → upgrade-MZFH7OCN.js} +1 -1
- package/dist/web/static/onboard.html +11 -0
- package/dist/web/static/onboard.js +40 -0
- package/dist/{web-Z5HSCQHW.js → web-KS3FUGJA.js} +12 -12
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadKeyBindings,
|
|
3
3
|
matchKeyBinding
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-O6MG7TOH.js";
|
|
5
5
|
import {
|
|
6
6
|
notifyIfLong,
|
|
7
7
|
setNotificationsEnabled
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
createSubAgentTool,
|
|
11
11
|
runSubAgent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-R5T3A2NQ.js";
|
|
13
13
|
import {
|
|
14
14
|
createMultiplexer,
|
|
15
15
|
createWebServerAutoPort,
|
|
@@ -43,9 +43,9 @@ import {
|
|
|
43
43
|
hasGUIClients,
|
|
44
44
|
isGitRepo,
|
|
45
45
|
registerREPLContext
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
46
|
+
} from "./chunk-AQBSMYLT.js";
|
|
47
|
+
import "./chunk-DN4ASQ26.js";
|
|
48
|
+
import "./chunk-DUWREZXK.js";
|
|
49
49
|
import {
|
|
50
50
|
deleteSession,
|
|
51
51
|
exportSession,
|
|
@@ -55,14 +55,14 @@ import {
|
|
|
55
55
|
loadSession,
|
|
56
56
|
renameSession,
|
|
57
57
|
saveSession
|
|
58
|
-
} from "./chunk-
|
|
59
|
-
import "./chunk-
|
|
58
|
+
} from "./chunk-NETIY5UB.js";
|
|
59
|
+
import "./chunk-5NLVGLD7.js";
|
|
60
60
|
import {
|
|
61
61
|
getCanonicalDashboardPort,
|
|
62
62
|
registerInstance,
|
|
63
63
|
unregisterInstance,
|
|
64
64
|
updateInstanceRuntime
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-LBVHDGZE.js";
|
|
66
66
|
import {
|
|
67
67
|
handleCheckpoint
|
|
68
68
|
} from "./chunk-RKB2JOV2.js";
|
|
@@ -71,12 +71,12 @@ import {
|
|
|
71
71
|
} from "./chunk-GH7E2OJE.js";
|
|
72
72
|
import {
|
|
73
73
|
Engine
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-6XTEAFZQ.js";
|
|
75
75
|
import {
|
|
76
76
|
closeMCPConnections,
|
|
77
77
|
createToolRegistry
|
|
78
|
-
} from "./chunk-
|
|
79
|
-
import "./chunk-
|
|
78
|
+
} from "./chunk-Y6HMJZDJ.js";
|
|
79
|
+
import "./chunk-GFORWAMW.js";
|
|
80
80
|
import "./chunk-GU2FZQ6A.js";
|
|
81
81
|
import {
|
|
82
82
|
showBanner,
|
|
@@ -104,20 +104,20 @@ import {
|
|
|
104
104
|
import {
|
|
105
105
|
createLLMClient,
|
|
106
106
|
streamCallLLM
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-FCW3K6F2.js";
|
|
108
108
|
import {
|
|
109
109
|
createOpenAIClient,
|
|
110
110
|
streamOpenAIChat
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-5GDYH676.js";
|
|
112
112
|
import {
|
|
113
113
|
hookManager
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-CLKIMCXZ.js";
|
|
115
115
|
import {
|
|
116
116
|
HYPERCORE_DIR,
|
|
117
117
|
MODEL_ALIASES,
|
|
118
118
|
MODEL_PROVIDERS,
|
|
119
119
|
loadConfig
|
|
120
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-I7WI3BMB.js";
|
|
121
121
|
import {
|
|
122
122
|
listLines
|
|
123
123
|
} from "./chunk-WHLVZCQY.js";
|
|
@@ -208,7 +208,7 @@ ${conversationText}
|
|
|
208
208
|
\u8BF7\u76F4\u63A5\u8F93\u51FA\u6458\u8981\uFF0C\u4E0D\u8981\u6DFB\u52A0\u989D\u5916\u683C\u5F0F\u6216\u524D\u7F00\u3002`;
|
|
209
209
|
let summaryText;
|
|
210
210
|
if (config.modelConfig.sdkType === "openai") {
|
|
211
|
-
const { streamOpenAIChat: streamOpenAIChat2 } = await import("./openai-compat-
|
|
211
|
+
const { streamOpenAIChat: streamOpenAIChat2 } = await import("./openai-compat-R7EKWG6Z.js");
|
|
212
212
|
const OpenAI = (await import("openai")).default;
|
|
213
213
|
const openaiClient = client;
|
|
214
214
|
const result = await streamOpenAIChat2(openaiClient, [
|
|
@@ -224,7 +224,7 @@ ${conversationText}
|
|
|
224
224
|
});
|
|
225
225
|
summaryText = result.content;
|
|
226
226
|
} else {
|
|
227
|
-
const { streamCallLLM: streamCallLLM2 } = await import("./claude-
|
|
227
|
+
const { streamCallLLM: streamCallLLM2 } = await import("./claude-4BX3MJSK.js");
|
|
228
228
|
const Anthropic = (await import("@anthropic-ai/sdk")).default;
|
|
229
229
|
const anthropicClient = client;
|
|
230
230
|
const result = await streamCallLLM2(anthropicClient, {
|
|
@@ -338,7 +338,7 @@ function createCustomHandler(promptTemplate) {
|
|
|
338
338
|
ctx.chatHistory.push({ role: "user", content: prompt });
|
|
339
339
|
try {
|
|
340
340
|
if (ctx.config.modelConfig.sdkType === "openai") {
|
|
341
|
-
const { streamOpenAIChat: streamOpenAIChat2 } = await import("./openai-compat-
|
|
341
|
+
const { streamOpenAIChat: streamOpenAIChat2 } = await import("./openai-compat-R7EKWG6Z.js");
|
|
342
342
|
const OpenAI = (await import("openai")).default;
|
|
343
343
|
const openaiClient = ctx.getClient();
|
|
344
344
|
const messages = [
|
|
@@ -359,7 +359,7 @@ function createCustomHandler(promptTemplate) {
|
|
|
359
359
|
ctx.sessionTokens.inputTokens += result.tokenUsage.inputTokens;
|
|
360
360
|
ctx.sessionTokens.outputTokens += result.tokenUsage.outputTokens;
|
|
361
361
|
} else {
|
|
362
|
-
const { streamCallLLM: streamCallLLM2 } = await import("./claude-
|
|
362
|
+
const { streamCallLLM: streamCallLLM2 } = await import("./claude-4BX3MJSK.js");
|
|
363
363
|
const Anthropic = (await import("@anthropic-ai/sdk")).default;
|
|
364
364
|
const anthropicClient = ctx.getClient();
|
|
365
365
|
const result = await streamCallLLM2(anthropicClient, {
|
|
@@ -1444,7 +1444,7 @@ ${diff.slice(0, 3e3)}
|
|
|
1444
1444
|
let commitMsg = "";
|
|
1445
1445
|
try {
|
|
1446
1446
|
if (ctx.config.modelConfig.sdkType === "openai") {
|
|
1447
|
-
const { streamOpenAIChat: streamOpenAIChat2 } = await import("./openai-compat-
|
|
1447
|
+
const { streamOpenAIChat: streamOpenAIChat2 } = await import("./openai-compat-R7EKWG6Z.js");
|
|
1448
1448
|
const OpenAI = (await import("openai")).default;
|
|
1449
1449
|
const openaiClient = ctx.getClient();
|
|
1450
1450
|
const result = await streamOpenAIChat2(openaiClient, [
|
|
@@ -1460,7 +1460,7 @@ ${diff.slice(0, 3e3)}
|
|
|
1460
1460
|
});
|
|
1461
1461
|
commitMsg = result.content.trim();
|
|
1462
1462
|
} else {
|
|
1463
|
-
const { streamCallLLM: streamCallLLM2 } = await import("./claude-
|
|
1463
|
+
const { streamCallLLM: streamCallLLM2 } = await import("./claude-4BX3MJSK.js");
|
|
1464
1464
|
const Anthropic = (await import("@anthropic-ai/sdk")).default;
|
|
1465
1465
|
const anthropicClient = ctx.getClient();
|
|
1466
1466
|
const result = await streamCallLLM2(anthropicClient, {
|
|
@@ -1578,7 +1578,7 @@ BODY:
|
|
|
1578
1578
|
let prContent = "";
|
|
1579
1579
|
try {
|
|
1580
1580
|
if (ctx.config.modelConfig.sdkType === "openai") {
|
|
1581
|
-
const { streamOpenAIChat: streamOpenAIChat2 } = await import("./openai-compat-
|
|
1581
|
+
const { streamOpenAIChat: streamOpenAIChat2 } = await import("./openai-compat-R7EKWG6Z.js");
|
|
1582
1582
|
const OpenAI = (await import("openai")).default;
|
|
1583
1583
|
const openaiClient = ctx.getClient();
|
|
1584
1584
|
const result = await streamOpenAIChat2(openaiClient, [
|
|
@@ -1594,7 +1594,7 @@ BODY:
|
|
|
1594
1594
|
});
|
|
1595
1595
|
prContent = result.content.trim();
|
|
1596
1596
|
} else {
|
|
1597
|
-
const { streamCallLLM: streamCallLLM2 } = await import("./claude-
|
|
1597
|
+
const { streamCallLLM: streamCallLLM2 } = await import("./claude-4BX3MJSK.js");
|
|
1598
1598
|
const Anthropic = (await import("@anthropic-ai/sdk")).default;
|
|
1599
1599
|
const anthropicClient = ctx.getClient();
|
|
1600
1600
|
const result = await streamCallLLM2(anthropicClient, {
|
|
@@ -2337,7 +2337,7 @@ ${planResult.output}${checkpointResult.feedback ? `
|
|
|
2337
2337
|
description: "\u5217\u51FA\u6240\u6709\u53EF\u7528\u6280\u80FD",
|
|
2338
2338
|
category: "util",
|
|
2339
2339
|
handler: async () => {
|
|
2340
|
-
const { listAvailableSkills } = await import("./skills-
|
|
2340
|
+
const { listAvailableSkills } = await import("./skills-HBQQTYO4.js");
|
|
2341
2341
|
const skills = await listAvailableSkills();
|
|
2342
2342
|
if (skills.length === 0) {
|
|
2343
2343
|
console.log(chalk3.dim("\n \u6682\u65E0\u53EF\u7528\u6280\u80FD"));
|
|
@@ -2623,7 +2623,7 @@ ${planResult.output}${checkpointResult.feedback ? `
|
|
|
2623
2623
|
description: "\u67E5\u770B\u5FEB\u6377\u952E\u7ED1\u5B9A",
|
|
2624
2624
|
category: "util",
|
|
2625
2625
|
handler: async () => {
|
|
2626
|
-
const { listKeyBindings } = await import("./keybindings-
|
|
2626
|
+
const { listKeyBindings } = await import("./keybindings-PDXIOV3O.js");
|
|
2627
2627
|
const bindings = listKeyBindings();
|
|
2628
2628
|
console.log(chalk3.bold("\n \u5FEB\u6377\u952E\u7ED1\u5B9A:\n"));
|
|
2629
2629
|
for (const b of bindings) {
|
|
@@ -2712,7 +2712,7 @@ async function startREPL(options) {
|
|
|
2712
2712
|
let memoryRoundCount = 0;
|
|
2713
2713
|
const hyperMd = await loadHyperMd();
|
|
2714
2714
|
const project = await detectProject();
|
|
2715
|
-
const { loadMemoryForSystemPrompt } = await import("./loader-
|
|
2715
|
+
const { loadMemoryForSystemPrompt } = await import("./loader-GKEYT6Y7.js");
|
|
2716
2716
|
const { memoryBlock } = await loadMemoryForSystemPrompt();
|
|
2717
2717
|
let systemPrompt = "";
|
|
2718
2718
|
if (hyperMd) {
|
|
@@ -2755,13 +2755,13 @@ Git: ${branch} (${statusStr})`;
|
|
|
2755
2755
|
if (customCmds.length > 0) {
|
|
2756
2756
|
commandRegistry.registerAll(customCmds);
|
|
2757
2757
|
}
|
|
2758
|
-
const { createTeamSlashCommands } = await import("./commands-
|
|
2758
|
+
const { createTeamSlashCommands } = await import("./commands-2X4OB5RF.js");
|
|
2759
2759
|
commandRegistry.registerAll(createTeamSlashCommands());
|
|
2760
|
-
const { createMemorySlashCommands } = await import("./commands-
|
|
2760
|
+
const { createMemorySlashCommands } = await import("./commands-IINRNBYX.js");
|
|
2761
2761
|
commandRegistry.registerAll(createMemorySlashCommands());
|
|
2762
|
-
const { createAdminSlashCommands } = await import("./commands-
|
|
2762
|
+
const { createAdminSlashCommands } = await import("./commands-GLBCEVQK.js");
|
|
2763
2763
|
commandRegistry.registerAll(createAdminSlashCommands());
|
|
2764
|
-
const { loadSkills } = await import("./skills-
|
|
2764
|
+
const { loadSkills } = await import("./skills-HBQQTYO4.js");
|
|
2765
2765
|
const skillCmds = await loadSkills();
|
|
2766
2766
|
if (skillCmds.length > 0) {
|
|
2767
2767
|
commandRegistry.registerAll(skillCmds);
|
|
@@ -2868,7 +2868,6 @@ Git: ${branch} (${statusStr})`;
|
|
|
2868
2868
|
const baseW = envW > 0 ? Math.min(reportedW, envW) : reportedW;
|
|
2869
2869
|
const termW = Math.max(24, Math.min(baseW - 4, 96));
|
|
2870
2870
|
const sepLine = chalk3.dim("\u2500".repeat(termW));
|
|
2871
|
-
process.stdout.write("\x1B[J");
|
|
2872
2871
|
process.stdout.write(sepLine + "\n");
|
|
2873
2872
|
process.stdout.write(chalk3.dim(" ? for shortcuts") + "\n");
|
|
2874
2873
|
const vimIndicator = getVimModeIndicator(vimState);
|
|
@@ -2944,7 +2943,7 @@ Git: ${branch} (${statusStr})`;
|
|
|
2944
2943
|
}
|
|
2945
2944
|
if (chatHistory.length >= 4) {
|
|
2946
2945
|
try {
|
|
2947
|
-
const { extractMemories } = await import("./extractor-
|
|
2946
|
+
const { extractMemories } = await import("./extractor-D3XWOAXI.js");
|
|
2948
2947
|
await extractMemories(chatHistory, client, config, "personal");
|
|
2949
2948
|
} catch {
|
|
2950
2949
|
}
|
|
@@ -3349,7 +3348,7 @@ Git: ${branch} (${statusStr})`;
|
|
|
3349
3348
|
_sessionRounds++;
|
|
3350
3349
|
memoryRoundCount++;
|
|
3351
3350
|
if (memoryRoundCount % 3 === 0) {
|
|
3352
|
-
const { triggerAutoExtraction } = await import("./extractor-
|
|
3351
|
+
const { triggerAutoExtraction } = await import("./extractor-D3XWOAXI.js");
|
|
3353
3352
|
triggerAutoExtraction(chatHistory, client, config, ["personal"]);
|
|
3354
3353
|
}
|
|
3355
3354
|
}
|
|
@@ -17,22 +17,22 @@ import {
|
|
|
17
17
|
sendError,
|
|
18
18
|
sendJSON,
|
|
19
19
|
setActivePort
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-AQBSMYLT.js";
|
|
21
|
+
import "./chunk-DN4ASQ26.js";
|
|
22
|
+
import "./chunk-DUWREZXK.js";
|
|
23
|
+
import "./chunk-NETIY5UB.js";
|
|
24
|
+
import "./chunk-5NLVGLD7.js";
|
|
25
|
+
import "./chunk-6XTEAFZQ.js";
|
|
26
|
+
import "./chunk-Y6HMJZDJ.js";
|
|
27
|
+
import "./chunk-GFORWAMW.js";
|
|
28
28
|
import "./chunk-GU2FZQ6A.js";
|
|
29
29
|
import "./chunk-R3GPQC7I.js";
|
|
30
30
|
import "./chunk-BE46C7JW.js";
|
|
31
31
|
import "./chunk-RNG3K465.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-FCW3K6F2.js";
|
|
33
|
+
import "./chunk-5GDYH676.js";
|
|
34
|
+
import "./chunk-CLKIMCXZ.js";
|
|
35
|
+
import "./chunk-I7WI3BMB.js";
|
|
36
36
|
import "./chunk-WHLVZCQY.js";
|
|
37
37
|
import "./chunk-TGTYKBGC.js";
|
|
38
38
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runSubAgent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-R5T3A2NQ.js";
|
|
4
4
|
import {
|
|
5
5
|
renderMarkdown
|
|
6
6
|
} from "./chunk-GH7E2OJE.js";
|
|
@@ -8,7 +8,7 @@ import "./chunk-GU2FZQ6A.js";
|
|
|
8
8
|
import "./chunk-BE46C7JW.js";
|
|
9
9
|
import {
|
|
10
10
|
HYPERCORE_DIR
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-I7WI3BMB.js";
|
|
12
12
|
|
|
13
13
|
// src/repl/skills.ts
|
|
14
14
|
import { existsSync } from "fs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createTeam
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DUWREZXK.js";
|
|
4
4
|
import {
|
|
5
5
|
clearLocalToken,
|
|
6
6
|
loadLocalToken,
|
|
7
7
|
saveLocalToken
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5NLVGLD7.js";
|
|
9
9
|
import {
|
|
10
10
|
showError,
|
|
11
11
|
showTaskList,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-R3GPQC7I.js";
|
|
15
15
|
import "./chunk-BE46C7JW.js";
|
|
16
16
|
import "./chunk-RNG3K465.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-I7WI3BMB.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/team.ts
|
|
20
20
|
import chalk from "chalk";
|
|
@@ -104,12 +104,23 @@
|
|
|
104
104
|
<button class="ob-option" data-value="minimax">🤖 MiniMax M2.5<span class="ob-tag">性价比高</span></button>
|
|
105
105
|
<button class="ob-option" data-value="deepseek">🧊 DeepSeek<span class="ob-tag">国产首选</span></button>
|
|
106
106
|
<button class="ob-option" data-value="anthropic">🧠 Anthropic Claude<span class="ob-tag">最强推理</span></button>
|
|
107
|
+
<button class="ob-option" data-value="openai-compatible">🔗 OpenAI 兼容<span class="ob-tag">自定义网关</span></button>
|
|
107
108
|
</div>
|
|
108
109
|
<div class="ob-input-group">
|
|
109
110
|
<label for="apiKeyInput">API Key</label>
|
|
110
111
|
<input type="password" id="apiKeyInput" class="ob-input" placeholder="粘贴你的 API Key…">
|
|
111
112
|
<button class="ob-toggle-pw" id="togglePw" title="显示/隐藏" aria-label="切换密码可见性" type="button">👁️</button>
|
|
112
113
|
</div>
|
|
114
|
+
<div id="compatFields" style="display:none;">
|
|
115
|
+
<div class="ob-input-group">
|
|
116
|
+
<label for="customBaseUrlInput">API Base URL</label>
|
|
117
|
+
<input type="text" id="customBaseUrlInput" class="ob-input" placeholder="例如 https://api.openai.com/v1">
|
|
118
|
+
</div>
|
|
119
|
+
<div class="ob-input-group">
|
|
120
|
+
<label for="customModelNameInput">模型名</label>
|
|
121
|
+
<input type="text" id="customModelNameInput" class="ob-input" placeholder="例如 gpt-4o / deepseek-chat">
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
113
124
|
<div class="ob-input-group">
|
|
114
125
|
<label for="tavilyKeyInput">Tavily API Key <span class="ob-optional">可选</span></label>
|
|
115
126
|
<input type="password" id="tavilyKeyInput" class="ob-input" placeholder="用于网络搜索(可跳过)">
|
|
@@ -16,6 +16,8 @@ class OnboardingWizard {
|
|
|
16
16
|
platforms: [],
|
|
17
17
|
provider: '',
|
|
18
18
|
apiKey: '',
|
|
19
|
+
customBaseUrl: '',
|
|
20
|
+
customModelName: '',
|
|
19
21
|
tavilyKey: '',
|
|
20
22
|
freeDescription: '',
|
|
21
23
|
};
|
|
@@ -28,6 +30,9 @@ class OnboardingWizard {
|
|
|
28
30
|
errorMsg: document.getElementById('errorMsg'),
|
|
29
31
|
apiKeyInput: document.getElementById('apiKeyInput'),
|
|
30
32
|
tavilyKeyInput: document.getElementById('tavilyKeyInput'),
|
|
33
|
+
customBaseUrlInput: document.getElementById('customBaseUrlInput'),
|
|
34
|
+
customModelNameInput: document.getElementById('customModelNameInput'),
|
|
35
|
+
compatFields: document.getElementById('compatFields'),
|
|
31
36
|
freeDescription: document.getElementById('freeDescription'),
|
|
32
37
|
togglePw: document.getElementById('togglePw'),
|
|
33
38
|
};
|
|
@@ -47,6 +52,9 @@ class OnboardingWizard {
|
|
|
47
52
|
group.querySelectorAll('.ob-option').forEach(b => b.classList.remove('selected'));
|
|
48
53
|
btn.classList.add('selected');
|
|
49
54
|
}
|
|
55
|
+
if (group.dataset.field === 'provider') {
|
|
56
|
+
this.syncProviderCompatFields();
|
|
57
|
+
}
|
|
50
58
|
this.clearError();
|
|
51
59
|
});
|
|
52
60
|
});
|
|
@@ -73,6 +81,25 @@ class OnboardingWizard {
|
|
|
73
81
|
this.render();
|
|
74
82
|
}
|
|
75
83
|
|
|
84
|
+
syncProviderCompatFields() {
|
|
85
|
+
if (!this.els.compatFields) return;
|
|
86
|
+
|
|
87
|
+
const providerGroup = document.querySelector('.ob-step[data-step="6"] .ob-options[data-field="provider"]');
|
|
88
|
+
const selectedBtn = providerGroup ? providerGroup.querySelector('.ob-option.selected') : null;
|
|
89
|
+
const selectedProvider = selectedBtn ? selectedBtn.dataset.value : this.answers.provider;
|
|
90
|
+
if (selectedProvider) this.answers.provider = selectedProvider;
|
|
91
|
+
|
|
92
|
+
const showCompat = selectedProvider === 'openai-compatible';
|
|
93
|
+
this.els.compatFields.style.display = showCompat ? 'block' : 'none';
|
|
94
|
+
|
|
95
|
+
if (!showCompat) {
|
|
96
|
+
this.answers.customBaseUrl = '';
|
|
97
|
+
this.answers.customModelName = '';
|
|
98
|
+
if (this.els.customBaseUrlInput) this.els.customBaseUrlInput.value = '';
|
|
99
|
+
if (this.els.customModelNameInput) this.els.customModelNameInput.value = '';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
76
103
|
render() {
|
|
77
104
|
// Progress
|
|
78
105
|
const pct = (this.currentStep / this.totalSteps) * 100;
|
|
@@ -87,6 +114,7 @@ class OnboardingWizard {
|
|
|
87
114
|
|
|
88
115
|
// Back button visibility
|
|
89
116
|
this.els.btnBack.style.visibility = this.currentStep > 1 ? 'visible' : 'hidden';
|
|
117
|
+
this.syncProviderCompatFields();
|
|
90
118
|
|
|
91
119
|
// Next button text
|
|
92
120
|
if (this.currentStep === this.totalSteps) {
|
|
@@ -158,6 +186,18 @@ class OnboardingWizard {
|
|
|
158
186
|
return false;
|
|
159
187
|
}
|
|
160
188
|
this.answers.apiKey = apiKey;
|
|
189
|
+
if (this.answers.provider === 'openai-compatible') {
|
|
190
|
+
const baseUrl = (this.els.customBaseUrlInput?.value || '').trim();
|
|
191
|
+
if (!baseUrl || !baseUrl.startsWith('http')) {
|
|
192
|
+
this.showError('OpenAI 兼容模式需要有效的 API Base URL');
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
this.answers.customBaseUrl = baseUrl;
|
|
196
|
+
this.answers.customModelName = (this.els.customModelNameInput?.value || '').trim() || 'gpt-4o';
|
|
197
|
+
} else {
|
|
198
|
+
this.answers.customBaseUrl = '';
|
|
199
|
+
this.answers.customModelName = '';
|
|
200
|
+
}
|
|
161
201
|
this.answers.tavilyKey = this.els.tavilyKeyInput.value.trim();
|
|
162
202
|
return true;
|
|
163
203
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWebServerAutoPort
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AQBSMYLT.js";
|
|
4
|
+
import "./chunk-DN4ASQ26.js";
|
|
5
|
+
import "./chunk-DUWREZXK.js";
|
|
6
|
+
import "./chunk-NETIY5UB.js";
|
|
7
|
+
import "./chunk-5NLVGLD7.js";
|
|
8
|
+
import "./chunk-6XTEAFZQ.js";
|
|
9
|
+
import "./chunk-Y6HMJZDJ.js";
|
|
10
|
+
import "./chunk-GFORWAMW.js";
|
|
11
11
|
import "./chunk-GU2FZQ6A.js";
|
|
12
12
|
import "./chunk-R3GPQC7I.js";
|
|
13
13
|
import "./chunk-BE46C7JW.js";
|
|
14
14
|
import "./chunk-RNG3K465.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-FCW3K6F2.js";
|
|
16
|
+
import "./chunk-5GDYH676.js";
|
|
17
|
+
import "./chunk-CLKIMCXZ.js";
|
|
18
|
+
import "./chunk-I7WI3BMB.js";
|
|
19
19
|
import "./chunk-WHLVZCQY.js";
|
|
20
20
|
import "./chunk-TGTYKBGC.js";
|
|
21
21
|
|