openfox 2.0.41 → 2.0.43
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/{ask-4GZ334CO.js → ask-TOBEA6KD.js} +2 -1
- package/dist/{auth-56SIRACI.js → auth-YY5PJYSC.js} +2 -1
- package/dist/{auto-config-FZFXOEEG.js → auto-config-F5Y6KAQ6.js} +2 -1
- package/dist/{backend-AGXWAU7A.js → backend-4HGUPY6W.js} +2 -1
- package/dist/{branch.api-PWFW26KC.js → branch.api-5DMEAIBI.js} +2 -1
- package/dist/{chat-handler-H4O7TLGM.js → chat-handler-233L35BD.js} +13 -4
- package/dist/chunk-5WRI5ZAA.js +31 -0
- package/dist/{chunk-X3L37IIK.js → chunk-FQ6UFNTT.js} +24 -18
- package/dist/{chunk-NX6O62MR.js → chunk-FZ5LNBZS.js} +63 -63
- package/dist/{chunk-JGNAYJJZ.js → chunk-NVQFIZJI.js} +2 -2
- package/dist/{chunk-XFMN7OFO.js → chunk-TT6LDJU5.js} +8 -8
- package/dist/{chunk-6KFKVGPK.js → chunk-ULZORR3T.js} +3 -3
- package/dist/{chunk-X6PMP7XH.js → chunk-V234MYXB.js} +12 -3
- package/dist/chunk-XY3LESVZ.js +1000 -0
- package/dist/cli/dev.js +3 -1
- package/dist/cli/index.js +3 -1
- package/dist/{client-XTPAYYRH.js → client-ZUL4AR4J.js} +2 -1
- package/dist/{client-pure-N2MOIDQ6.js → client-pure-DO3S675T.js} +2 -1
- package/dist/{compactor-RZA5VSRT.js → compactor-TJEAAZL3.js} +2 -1
- package/dist/{config-XOXIIBUY.js → config-S5CF4QU4.js} +2 -1
- package/dist/{events-KZZPCW2Q.js → events-THW3MYXE.js} +2 -1
- package/dist/{folding-ENYH4LMG.js → folding-H5C6HS7O.js} +2 -1
- package/dist/{http-client-SIPAW7IM.js → http-client-3OLSDU63.js} +2 -1
- package/dist/{inspect-proxy-UT2LFGJ5.js → inspect-proxy-BV25JERQ.js} +2 -1
- package/dist/{manager-W7N3XQ4Q.js → manager-R3EMNOPR.js} +2 -1
- package/dist/{orchestrator-IZ6VSEZT.js → orchestrator-XIGRXAEC.js} +4 -3
- package/dist/package.json +1 -1
- package/dist/{paths-X46PPOI2.js → paths-F27V3S4I.js} +2 -1
- package/dist/{permissions-Z2IIV2V7.js → permissions-QLHZUEGW.js} +3 -1
- package/dist/{processor-WQYQUIPB.js → processor-T6FX54JU.js} +12 -4
- package/dist/{profiles-Q36ELWQF.js → profiles-5J7F4BML.js} +2 -1
- package/dist/{project-creator-W6Z7KCMZ.js → project-creator-7RBHP6K6.js} +2 -1
- package/dist/{projects-2XSGA7JG.js → projects-BY227WT2.js} +2 -1
- package/dist/{protocol-BKNLAEPJ.js → protocol-CTNE3ANP.js} +2 -1
- package/dist/{provider-JLLIB72V.js → provider-JDI3LVYF.js} +67 -57
- package/dist/{provider-manager-GTWFGTCV.js → provider-manager-5UZXYOZZ.js} +2 -1
- package/dist/{pwa-76XP2DY2.js → pwa-M6QZ52ZO.js} +37 -31
- package/dist/{serve-XP3S4QDS.js → serve-LAAYCXXI.js} +6 -5
- package/dist/server/index.js +5 -4
- package/dist/{server-DKCNTFA5.js → server-GVQNOHX3.js} +5 -4
- package/dist/{service-FJ4TW5L7.js → service-YYJ5Y7CN.js} +3 -1
- package/dist/{settings-MTGCEUS7.js → settings-L2V4ZUA2.js} +2 -1
- package/dist/shared/index.js +1 -0
- package/dist/{store-OQ45KONN.js → store-SF7CDOQT.js} +2 -1
- package/dist/{tool-adapter-B7QP6NLA.js → tool-adapter-MOGEI6TP.js} +2 -1
- package/dist/{tools-X3QW7SN7.js → tools-PS5CSPGS.js} +3 -2
- package/dist/{url-utils-QWAHP54Q.js → url-utils-SAJP7AEX.js} +2 -1
- package/package.json +1 -1
package/dist/cli/dev.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runCli
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-FQ6UFNTT.js";
|
|
5
|
+
import "../chunk-XY3LESVZ.js";
|
|
5
6
|
import {
|
|
6
7
|
logger
|
|
7
8
|
} from "../chunk-K44MW7JJ.js";
|
|
9
|
+
import "../chunk-5WRI5ZAA.js";
|
|
8
10
|
|
|
9
11
|
// src/cli/dev.ts
|
|
10
12
|
import { readFileSync } from "fs";
|
package/dist/cli/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runCli
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-FQ6UFNTT.js";
|
|
5
|
+
import "../chunk-XY3LESVZ.js";
|
|
5
6
|
import {
|
|
6
7
|
logger
|
|
7
8
|
} from "../chunk-K44MW7JJ.js";
|
|
9
|
+
import "../chunk-5WRI5ZAA.js";
|
|
8
10
|
|
|
9
11
|
// src/cli/index.ts
|
|
10
12
|
var MIN_HEAP_MB = 6144;
|
|
@@ -7,7 +7,8 @@ import "./chunk-Z6W4YHJB.js";
|
|
|
7
7
|
import "./chunk-IEDE6VK4.js";
|
|
8
8
|
import "./chunk-K44MW7JJ.js";
|
|
9
9
|
import "./chunk-V4IE7HJY.js";
|
|
10
|
+
import "./chunk-5WRI5ZAA.js";
|
|
10
11
|
export {
|
|
11
12
|
createLLMClient
|
|
12
13
|
};
|
|
13
|
-
//# sourceMappingURL=client-
|
|
14
|
+
//# sourceMappingURL=client-ZUL4AR4J.js.map
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
getThinking,
|
|
8
8
|
mapFinishReason
|
|
9
9
|
} from "./chunk-Z6W4YHJB.js";
|
|
10
|
+
import "./chunk-5WRI5ZAA.js";
|
|
10
11
|
export {
|
|
11
12
|
buildModelParams,
|
|
12
13
|
buildNonStreamingCreateParams,
|
|
@@ -16,4 +17,4 @@ export {
|
|
|
16
17
|
getThinking,
|
|
17
18
|
mapFinishReason
|
|
18
19
|
};
|
|
19
|
-
//# sourceMappingURL=client-pure-
|
|
20
|
+
//# sourceMappingURL=client-pure-DO3S675T.js.map
|
|
@@ -12,9 +12,10 @@ import "./chunk-Z4FMBCJO.js";
|
|
|
12
12
|
import "./chunk-Z6W4YHJB.js";
|
|
13
13
|
import "./chunk-K44MW7JJ.js";
|
|
14
14
|
import "./chunk-V4IE7HJY.js";
|
|
15
|
+
import "./chunk-5WRI5ZAA.js";
|
|
15
16
|
export {
|
|
16
17
|
appendCompactionPrompt,
|
|
17
18
|
getCompactionTarget,
|
|
18
19
|
shouldCompact
|
|
19
20
|
};
|
|
20
|
-
//# sourceMappingURL=compactor-
|
|
21
|
+
//# sourceMappingURL=compactor-TJEAAZL3.js.map
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
updateProvider
|
|
16
16
|
} from "./chunk-EZ3BPIUV.js";
|
|
17
17
|
import "./chunk-CQGTEGKL.js";
|
|
18
|
+
import "./chunk-5WRI5ZAA.js";
|
|
18
19
|
export {
|
|
19
20
|
activateProvider,
|
|
20
21
|
addProvider,
|
|
@@ -31,4 +32,4 @@ export {
|
|
|
31
32
|
setDefaultModelSelection,
|
|
32
33
|
updateProvider
|
|
33
34
|
};
|
|
34
|
-
//# sourceMappingURL=config-
|
|
35
|
+
//# sourceMappingURL=config-S5CF4QU4.js.map
|
|
@@ -58,6 +58,7 @@ import {
|
|
|
58
58
|
} from "./chunk-EHYFYQXY.js";
|
|
59
59
|
import "./chunk-ZPIZLTWU.js";
|
|
60
60
|
import "./chunk-K44MW7JJ.js";
|
|
61
|
+
import "./chunk-5WRI5ZAA.js";
|
|
61
62
|
export {
|
|
62
63
|
EventStore,
|
|
63
64
|
buildContextMessagesFromEventHistory,
|
|
@@ -114,4 +115,4 @@ export {
|
|
|
114
115
|
isTurnEvent,
|
|
115
116
|
truncateSessionMessages
|
|
116
117
|
};
|
|
117
|
-
//# sourceMappingURL=events-
|
|
118
|
+
//# sourceMappingURL=events-THW3MYXE.js.map
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
spreadOptionalMessageFields,
|
|
25
25
|
stripOrphanedToolCalls
|
|
26
26
|
} from "./chunk-EHYFYQXY.js";
|
|
27
|
+
import "./chunk-5WRI5ZAA.js";
|
|
27
28
|
export {
|
|
28
29
|
buildContextMessagesFromEventHistory,
|
|
29
30
|
buildContextMessagesFromMessages,
|
|
@@ -50,4 +51,4 @@ export {
|
|
|
50
51
|
spreadOptionalMessageFields,
|
|
51
52
|
stripOrphanedToolCalls
|
|
52
53
|
};
|
|
53
|
-
//# sourceMappingURL=folding-
|
|
54
|
+
//# sourceMappingURL=folding-H5C6HS7O.js.map
|
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
import "./chunk-YQ3SOPBI.js";
|
|
6
6
|
import "./chunk-ZPIZLTWU.js";
|
|
7
7
|
import "./chunk-K44MW7JJ.js";
|
|
8
|
+
import "./chunk-5WRI5ZAA.js";
|
|
8
9
|
export {
|
|
9
10
|
startInspectProxy,
|
|
10
11
|
stopAllInspectProxies
|
|
11
12
|
};
|
|
12
|
-
//# sourceMappingURL=inspect-proxy-
|
|
13
|
+
//# sourceMappingURL=inspect-proxy-BV25JERQ.js.map
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
stopProcess
|
|
9
9
|
} from "./chunk-PBGOZMVY.js";
|
|
10
10
|
import "./chunk-VRGRAQDG.js";
|
|
11
|
+
import "./chunk-5WRI5ZAA.js";
|
|
11
12
|
export {
|
|
12
13
|
createProcess,
|
|
13
14
|
getProcessLogs,
|
|
@@ -17,4 +18,4 @@ export {
|
|
|
17
18
|
startProcessCommand,
|
|
18
19
|
stopProcess
|
|
19
20
|
};
|
|
20
|
-
//# sourceMappingURL=manager-
|
|
21
|
+
//# sourceMappingURL=manager-R3EMNOPR.js.map
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
injectWorkflowKickoffIfNeeded,
|
|
3
3
|
runAgentTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-ULZORR3T.js";
|
|
6
|
+
import "./chunk-TT6LDJU5.js";
|
|
7
7
|
import "./chunk-LBGHZLLH.js";
|
|
8
8
|
import "./chunk-PBGOZMVY.js";
|
|
9
9
|
import "./chunk-VRGRAQDG.js";
|
|
@@ -31,6 +31,7 @@ import "./chunk-YD6NDTKF.js";
|
|
|
31
31
|
import "./chunk-EZ3BPIUV.js";
|
|
32
32
|
import "./chunk-CQGTEGKL.js";
|
|
33
33
|
import "./chunk-V4IE7HJY.js";
|
|
34
|
+
import "./chunk-5WRI5ZAA.js";
|
|
34
35
|
export {
|
|
35
36
|
TurnMetrics,
|
|
36
37
|
createChatDoneEvent,
|
|
@@ -42,4 +43,4 @@ export {
|
|
|
42
43
|
runAgentTurn,
|
|
43
44
|
runChatTurn
|
|
44
45
|
};
|
|
45
|
-
//# sourceMappingURL=orchestrator-
|
|
46
|
+
//# sourceMappingURL=orchestrator-XIGRXAEC.js.map
|
package/dist/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getGlobalDataDir,
|
|
9
9
|
getSkillsDir
|
|
10
10
|
} from "./chunk-CQGTEGKL.js";
|
|
11
|
+
import "./chunk-5WRI5ZAA.js";
|
|
11
12
|
export {
|
|
12
13
|
ensureDataDirExists,
|
|
13
14
|
getAuthConfigPath,
|
|
@@ -18,4 +19,4 @@ export {
|
|
|
18
19
|
getGlobalDataDir,
|
|
19
20
|
getSkillsDir
|
|
20
21
|
};
|
|
21
|
-
//# sourceMappingURL=paths-
|
|
22
|
+
//# sourceMappingURL=paths-F27V3S4I.js.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "./chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
1
3
|
// src/server/utils/permissions.ts
|
|
2
4
|
import { execSync } from "child_process";
|
|
3
5
|
import { resolve } from "path";
|
|
@@ -106,4 +108,4 @@ export {
|
|
|
106
108
|
checkPermissions,
|
|
107
109
|
fixPermissions
|
|
108
110
|
};
|
|
109
|
-
//# sourceMappingURL=permissions-
|
|
111
|
+
//# sourceMappingURL=permissions-QLHZUEGW.js.map
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
buildRunChatTurnParams,
|
|
3
3
|
finalizeTurnCompletion,
|
|
4
4
|
generateSessionNameForSession
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-NVQFIZJI.js";
|
|
6
|
+
import "./chunk-TT6LDJU5.js";
|
|
7
7
|
import "./chunk-LBGHZLLH.js";
|
|
8
8
|
import "./chunk-PBGOZMVY.js";
|
|
9
9
|
import "./chunk-VRGRAQDG.js";
|
|
@@ -31,12 +31,14 @@ import "./chunk-YD6NDTKF.js";
|
|
|
31
31
|
import "./chunk-EZ3BPIUV.js";
|
|
32
32
|
import "./chunk-CQGTEGKL.js";
|
|
33
33
|
import "./chunk-V4IE7HJY.js";
|
|
34
|
+
import "./chunk-5WRI5ZAA.js";
|
|
34
35
|
|
|
35
36
|
// src/server/queue/processor.ts
|
|
36
37
|
var QueueProcessor = class {
|
|
37
38
|
deps;
|
|
38
39
|
unsubscribe = null;
|
|
39
40
|
activeAgents = /* @__PURE__ */ new Map();
|
|
41
|
+
abortedSessions = /* @__PURE__ */ new Set();
|
|
40
42
|
constructor(deps) {
|
|
41
43
|
this.deps = deps;
|
|
42
44
|
}
|
|
@@ -66,6 +68,7 @@ var QueueProcessor = class {
|
|
|
66
68
|
logger.debug("QueueProcessor stopped");
|
|
67
69
|
}
|
|
68
70
|
abortSession(sessionId) {
|
|
71
|
+
this.abortedSessions.add(sessionId);
|
|
69
72
|
const controller = this.activeAgents.get(sessionId);
|
|
70
73
|
if (controller) {
|
|
71
74
|
controller.abort();
|
|
@@ -171,7 +174,7 @@ var QueueProcessor = class {
|
|
|
171
174
|
backend: provider?.backend ?? llmClient.getBackend(),
|
|
172
175
|
model: llmClient.getModel()
|
|
173
176
|
};
|
|
174
|
-
const { runChatTurn } = await import("./orchestrator-
|
|
177
|
+
const { runChatTurn } = await import("./orchestrator-XIGRXAEC.js");
|
|
175
178
|
const runChatTurnParams = buildRunChatTurnParams({
|
|
176
179
|
sessionManager,
|
|
177
180
|
sessionId,
|
|
@@ -194,6 +197,11 @@ var QueueProcessor = class {
|
|
|
194
197
|
broadcastForSession(sessionId, createSessionRunningMessage(false));
|
|
195
198
|
return;
|
|
196
199
|
}
|
|
200
|
+
if (this.abortedSessions.has(sessionId)) {
|
|
201
|
+
this.abortedSessions.delete(sessionId);
|
|
202
|
+
finalizeTurnCompletion(sessionId, sessionManager, broadcastForSession);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
197
205
|
const hasMore = sessionManager.hasQueuedMessages(sessionId);
|
|
198
206
|
if (!hasMore) {
|
|
199
207
|
finalizeTurnCompletion(sessionId, sessionManager, broadcastForSession);
|
|
@@ -216,4 +224,4 @@ var QueueProcessor = class {
|
|
|
216
224
|
export {
|
|
217
225
|
QueueProcessor
|
|
218
226
|
};
|
|
219
|
-
//# sourceMappingURL=processor-
|
|
227
|
+
//# sourceMappingURL=processor-T6FX54JU.js.map
|
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
getModelProfile,
|
|
3
3
|
modelSupportsVision
|
|
4
4
|
} from "./chunk-V4IE7HJY.js";
|
|
5
|
+
import "./chunk-5WRI5ZAA.js";
|
|
5
6
|
export {
|
|
6
7
|
getModelProfile,
|
|
7
8
|
modelSupportsVision
|
|
8
9
|
};
|
|
9
|
-
//# sourceMappingURL=profiles-
|
|
10
|
+
//# sourceMappingURL=profiles-5J7F4BML.js.map
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-YQ3SOPBI.js";
|
|
4
4
|
import "./chunk-ZPIZLTWU.js";
|
|
5
5
|
import "./chunk-K44MW7JJ.js";
|
|
6
|
+
import "./chunk-5WRI5ZAA.js";
|
|
6
7
|
|
|
7
8
|
// src/server/utils/project-creator.ts
|
|
8
9
|
import { execSync } from "child_process";
|
|
@@ -108,4 +109,4 @@ export {
|
|
|
108
109
|
createDirectoryWithGit,
|
|
109
110
|
validateProjectName
|
|
110
111
|
};
|
|
111
|
-
//# sourceMappingURL=project-creator-
|
|
112
|
+
//# sourceMappingURL=project-creator-7RBHP6K6.js.map
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-YQ3SOPBI.js";
|
|
10
10
|
import "./chunk-ZPIZLTWU.js";
|
|
11
11
|
import "./chunk-K44MW7JJ.js";
|
|
12
|
+
import "./chunk-5WRI5ZAA.js";
|
|
12
13
|
export {
|
|
13
14
|
createProject,
|
|
14
15
|
deleteProject,
|
|
@@ -18,4 +19,4 @@ export {
|
|
|
18
19
|
toggleStar,
|
|
19
20
|
updateProject
|
|
20
21
|
};
|
|
21
|
-
//# sourceMappingURL=projects-
|
|
22
|
+
//# sourceMappingURL=projects-BY227WT2.js.map
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
storedEventToServerMessage
|
|
38
38
|
} from "./chunk-F4PMNP7S.js";
|
|
39
39
|
import "./chunk-YD6NDTKF.js";
|
|
40
|
+
import "./chunk-5WRI5ZAA.js";
|
|
40
41
|
export {
|
|
41
42
|
createChatAskUserMessage,
|
|
42
43
|
createChatDeltaMessage,
|
|
@@ -75,4 +76,4 @@ export {
|
|
|
75
76
|
serializeServerMessage,
|
|
76
77
|
storedEventToServerMessage
|
|
77
78
|
};
|
|
78
|
-
//# sourceMappingURL=protocol-
|
|
79
|
+
//# sourceMappingURL=protocol-CTNE3ANP.js.map
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Ct,
|
|
3
|
+
Gt,
|
|
4
|
+
Ht,
|
|
5
|
+
Jt,
|
|
6
|
+
Nt,
|
|
7
|
+
R,
|
|
8
|
+
Zt,
|
|
9
|
+
be
|
|
10
|
+
} from "./chunk-XY3LESVZ.js";
|
|
1
11
|
import {
|
|
2
12
|
fetchAvailableModelsFromBackend
|
|
3
13
|
} from "./chunk-SM2PK6TV.js";
|
|
@@ -21,9 +31,9 @@ import {
|
|
|
21
31
|
} from "./chunk-EZ3BPIUV.js";
|
|
22
32
|
import "./chunk-CQGTEGKL.js";
|
|
23
33
|
import "./chunk-V4IE7HJY.js";
|
|
34
|
+
import "./chunk-5WRI5ZAA.js";
|
|
24
35
|
|
|
25
36
|
// src/cli/provider.ts
|
|
26
|
-
import { select, text, password, spinner, log, outro, isCancel, cancel } from "@clack/prompts";
|
|
27
37
|
var BACKEND_OPTIONS = [
|
|
28
38
|
{ value: "vllm", label: "vLLM" },
|
|
29
39
|
{ value: "sglang", label: "SGLang" },
|
|
@@ -44,7 +54,7 @@ Provider Management Commands:
|
|
|
44
54
|
}
|
|
45
55
|
async function runProviderAdd(mode) {
|
|
46
56
|
const config = await loadGlobalConfig(mode);
|
|
47
|
-
const name = await
|
|
57
|
+
const name = await Zt({
|
|
48
58
|
message: "Provider name:",
|
|
49
59
|
placeholder: "My Local vLLM",
|
|
50
60
|
validate: (value) => {
|
|
@@ -52,11 +62,11 @@ async function runProviderAdd(mode) {
|
|
|
52
62
|
if (config.providers.some((p) => p.name === value)) return "Provider with this name already exists";
|
|
53
63
|
}
|
|
54
64
|
});
|
|
55
|
-
if (
|
|
56
|
-
|
|
65
|
+
if (Ct(name)) {
|
|
66
|
+
Nt("Cancelled");
|
|
57
67
|
return;
|
|
58
68
|
}
|
|
59
|
-
|
|
69
|
+
R.info(`URL examples:
|
|
60
70
|
vLLM/SGLang: http://localhost:8000
|
|
61
71
|
Ollama: http://localhost:11434
|
|
62
72
|
llama.cpp: http://localhost:8080
|
|
@@ -64,7 +74,7 @@ async function runProviderAdd(mode) {
|
|
|
64
74
|
Anthropic: https://api.anthropic.com
|
|
65
75
|
|
|
66
76
|
(Don't include /v1 - it's added automatically)`);
|
|
67
|
-
const url = await
|
|
77
|
+
const url = await Zt({
|
|
68
78
|
message: "API URL:",
|
|
69
79
|
placeholder: "http://localhost:8000",
|
|
70
80
|
initialValue: "http://localhost:8000",
|
|
@@ -73,20 +83,20 @@ async function runProviderAdd(mode) {
|
|
|
73
83
|
if (!value.startsWith("http")) return "Must start with http:// or https://";
|
|
74
84
|
}
|
|
75
85
|
});
|
|
76
|
-
if (
|
|
77
|
-
|
|
86
|
+
if (Ct(url)) {
|
|
87
|
+
Nt("Cancelled");
|
|
78
88
|
return;
|
|
79
89
|
}
|
|
80
|
-
const backend = await
|
|
90
|
+
const backend = await Jt({
|
|
81
91
|
message: "Backend type:",
|
|
82
92
|
options: BACKEND_OPTIONS
|
|
83
93
|
});
|
|
84
|
-
if (
|
|
85
|
-
|
|
94
|
+
if (Ct(backend)) {
|
|
95
|
+
Nt("Cancelled");
|
|
86
96
|
return;
|
|
87
97
|
}
|
|
88
98
|
let selectedModel;
|
|
89
|
-
const s =
|
|
99
|
+
const s = be();
|
|
90
100
|
s.start(`Fetching available models from ${url}...`);
|
|
91
101
|
let availableModels = [];
|
|
92
102
|
try {
|
|
@@ -96,7 +106,7 @@ async function runProviderAdd(mode) {
|
|
|
96
106
|
s.stop("\u26A0 Could not fetch models, will use auto-detect");
|
|
97
107
|
}
|
|
98
108
|
if (availableModels.length > 0) {
|
|
99
|
-
const modelChoice = await
|
|
109
|
+
const modelChoice = await Jt({
|
|
100
110
|
message: "Select model:",
|
|
101
111
|
options: availableModels.map((m) => ({
|
|
102
112
|
value: m,
|
|
@@ -104,24 +114,24 @@ async function runProviderAdd(mode) {
|
|
|
104
114
|
hint: m
|
|
105
115
|
}))
|
|
106
116
|
});
|
|
107
|
-
if (
|
|
108
|
-
|
|
117
|
+
if (Ct(modelChoice)) {
|
|
118
|
+
Nt("Cancelled");
|
|
109
119
|
return;
|
|
110
120
|
}
|
|
111
121
|
selectedModel = modelChoice;
|
|
112
122
|
} else {
|
|
113
|
-
const model = await
|
|
123
|
+
const model = await Zt({
|
|
114
124
|
message: 'Model name (or "auto" to detect):',
|
|
115
125
|
placeholder: "auto",
|
|
116
126
|
initialValue: "auto"
|
|
117
127
|
});
|
|
118
|
-
if (
|
|
119
|
-
|
|
128
|
+
if (Ct(model)) {
|
|
129
|
+
Nt("Cancelled");
|
|
120
130
|
return;
|
|
121
131
|
}
|
|
122
132
|
selectedModel = model;
|
|
123
133
|
if (selectedModel === "auto") {
|
|
124
|
-
const detectSpinner =
|
|
134
|
+
const detectSpinner = be();
|
|
125
135
|
detectSpinner.start("Detecting model...");
|
|
126
136
|
let detectedModel;
|
|
127
137
|
try {
|
|
@@ -139,7 +149,7 @@ async function runProviderAdd(mode) {
|
|
|
139
149
|
}
|
|
140
150
|
const localBackends = /* @__PURE__ */ new Set(["vllm", "sglang", "ollama", "llamacpp", "opencode-go"]);
|
|
141
151
|
const defaultIsLocal = localBackends.has(backend);
|
|
142
|
-
const isLocalChoice = await
|
|
152
|
+
const isLocalChoice = await Jt({
|
|
143
153
|
message: "Is this a local provider?",
|
|
144
154
|
options: [
|
|
145
155
|
{ value: "yes", label: "Yes" },
|
|
@@ -147,45 +157,45 @@ async function runProviderAdd(mode) {
|
|
|
147
157
|
],
|
|
148
158
|
initialValue: defaultIsLocal ? "yes" : "no"
|
|
149
159
|
});
|
|
150
|
-
if (
|
|
151
|
-
|
|
160
|
+
if (Ct(isLocalChoice)) {
|
|
161
|
+
Nt("Cancelled");
|
|
152
162
|
return;
|
|
153
163
|
}
|
|
154
164
|
const isLocal = isLocalChoice === "yes";
|
|
155
165
|
let apiKey;
|
|
156
166
|
if (backend === "openai" || backend === "anthropic") {
|
|
157
|
-
const key = await
|
|
167
|
+
const key = await Ht({
|
|
158
168
|
message: "API Key:"
|
|
159
169
|
});
|
|
160
|
-
if (
|
|
161
|
-
|
|
170
|
+
if (Ct(key)) {
|
|
171
|
+
Nt("Cancelled");
|
|
162
172
|
return;
|
|
163
173
|
}
|
|
164
174
|
apiKey = key || void 0;
|
|
165
175
|
} else {
|
|
166
|
-
const needsKey = await
|
|
176
|
+
const needsKey = await Jt({
|
|
167
177
|
message: "Does this provider require an API key?",
|
|
168
178
|
options: [
|
|
169
179
|
{ value: "no", label: "No" },
|
|
170
180
|
{ value: "yes", label: "Yes" }
|
|
171
181
|
]
|
|
172
182
|
});
|
|
173
|
-
if (
|
|
174
|
-
|
|
183
|
+
if (Ct(needsKey)) {
|
|
184
|
+
Nt("Cancelled");
|
|
175
185
|
return;
|
|
176
186
|
}
|
|
177
187
|
if (needsKey === "yes") {
|
|
178
|
-
const key = await
|
|
188
|
+
const key = await Ht({
|
|
179
189
|
message: "API Key:"
|
|
180
190
|
});
|
|
181
|
-
if (
|
|
182
|
-
|
|
191
|
+
if (Ct(key)) {
|
|
192
|
+
Nt("Cancelled");
|
|
183
193
|
return;
|
|
184
194
|
}
|
|
185
195
|
apiKey = key || void 0;
|
|
186
196
|
}
|
|
187
197
|
}
|
|
188
|
-
const testSpinner =
|
|
198
|
+
const testSpinner = be();
|
|
189
199
|
testSpinner.start(`Testing connection to ${url}...`);
|
|
190
200
|
const finalBackend = backend;
|
|
191
201
|
let finalDetectedModel = null;
|
|
@@ -196,32 +206,32 @@ async function runProviderAdd(mode) {
|
|
|
196
206
|
testSpinner.stop(`\u2713 Connected to ${finalBackend}${finalDetectedModel !== "auto" ? ` (${finalDetectedModel})` : ""}`);
|
|
197
207
|
} catch {
|
|
198
208
|
testSpinner.stop("\u26A0 Could not connect to provider");
|
|
199
|
-
const continueAnyway = await
|
|
209
|
+
const continueAnyway = await Jt({
|
|
200
210
|
message: "Provider is not reachable. Save anyway?",
|
|
201
211
|
options: [
|
|
202
212
|
{ value: "yes", label: "Yes, save anyway" },
|
|
203
213
|
{ value: "no", label: "No, cancel" }
|
|
204
214
|
]
|
|
205
215
|
});
|
|
206
|
-
if (
|
|
207
|
-
|
|
216
|
+
if (Ct(continueAnyway) || continueAnyway === "no") {
|
|
217
|
+
Nt("Cancelled");
|
|
208
218
|
return;
|
|
209
219
|
}
|
|
210
220
|
}
|
|
211
221
|
const makeActive = config.providers.length === 0 || await (async () => {
|
|
212
|
-
const choice = await
|
|
222
|
+
const choice = await Jt({
|
|
213
223
|
message: "Make this the active provider?",
|
|
214
224
|
options: [
|
|
215
225
|
{ value: "yes", label: "Yes" },
|
|
216
226
|
{ value: "no", label: "No" }
|
|
217
227
|
]
|
|
218
228
|
});
|
|
219
|
-
if (
|
|
229
|
+
if (Ct(choice)) return false;
|
|
220
230
|
return choice === "yes";
|
|
221
231
|
})();
|
|
222
232
|
const modelsWithContent = [];
|
|
223
233
|
if (availableModels.length > 0) {
|
|
224
|
-
const modelFetchSpinner =
|
|
234
|
+
const modelFetchSpinner = be();
|
|
225
235
|
modelFetchSpinner.start("Fetching model metadata...");
|
|
226
236
|
try {
|
|
227
237
|
const urlWithV1 = url.includes("/v1") ? url : `${url}/v1`;
|
|
@@ -260,7 +270,7 @@ async function runProviderAdd(mode) {
|
|
|
260
270
|
isActive: makeActive
|
|
261
271
|
});
|
|
262
272
|
if (makeActive) {
|
|
263
|
-
const { setDefaultModelSelection } = await import("./config-
|
|
273
|
+
const { setDefaultModelSelection } = await import("./config-S5CF4QU4.js");
|
|
264
274
|
newConfig = setDefaultModelSelection(
|
|
265
275
|
newConfig,
|
|
266
276
|
newConfig.providers[newConfig.providers.length - 1].id,
|
|
@@ -268,12 +278,12 @@ async function runProviderAdd(mode) {
|
|
|
268
278
|
);
|
|
269
279
|
}
|
|
270
280
|
await saveGlobalConfig(mode, newConfig);
|
|
271
|
-
|
|
281
|
+
Gt(`\u2713 Provider "${name}" added${makeActive ? " and activated" : ""}`);
|
|
272
282
|
}
|
|
273
283
|
async function runProviderList(mode) {
|
|
274
284
|
const config = await loadGlobalConfig(mode);
|
|
275
285
|
if (config.providers.length === 0) {
|
|
276
|
-
|
|
286
|
+
R.warn("No providers configured. Run `openfox provider add` to add one.");
|
|
277
287
|
return;
|
|
278
288
|
}
|
|
279
289
|
console.log("\nConfigured providers:\n");
|
|
@@ -292,15 +302,15 @@ async function runProviderList(mode) {
|
|
|
292
302
|
async function runProviderUse(mode) {
|
|
293
303
|
const config = await loadGlobalConfig(mode);
|
|
294
304
|
if (config.providers.length === 0) {
|
|
295
|
-
|
|
305
|
+
R.warn("No providers configured. Run `openfox provider add` to add one.");
|
|
296
306
|
return;
|
|
297
307
|
}
|
|
298
308
|
if (config.providers.length === 1) {
|
|
299
|
-
|
|
309
|
+
R.info("Only one provider configured, already active.");
|
|
300
310
|
return;
|
|
301
311
|
}
|
|
302
312
|
const activeProvider = getActiveProvider(config);
|
|
303
|
-
const choice = await
|
|
313
|
+
const choice = await Jt({
|
|
304
314
|
message: "Select provider to activate:",
|
|
305
315
|
options: config.providers.map((p) => ({
|
|
306
316
|
value: p.id,
|
|
@@ -309,26 +319,26 @@ async function runProviderUse(mode) {
|
|
|
309
319
|
})),
|
|
310
320
|
initialValue: activeProvider?.id
|
|
311
321
|
});
|
|
312
|
-
if (
|
|
313
|
-
|
|
322
|
+
if (Ct(choice)) {
|
|
323
|
+
Nt("Cancelled");
|
|
314
324
|
return;
|
|
315
325
|
}
|
|
316
326
|
if (choice === activeProvider?.id) {
|
|
317
|
-
|
|
327
|
+
R.info("Already the active provider.");
|
|
318
328
|
return;
|
|
319
329
|
}
|
|
320
330
|
const newConfig = activateProvider(config, choice);
|
|
321
331
|
await saveGlobalConfig(mode, newConfig);
|
|
322
332
|
const activated = newConfig.providers.find((p) => p.id === choice);
|
|
323
|
-
|
|
333
|
+
Gt(`\u2713 Now using "${activated?.name}"`);
|
|
324
334
|
}
|
|
325
335
|
async function runProviderRemove(mode) {
|
|
326
336
|
const config = await loadGlobalConfig(mode);
|
|
327
337
|
if (config.providers.length === 0) {
|
|
328
|
-
|
|
338
|
+
R.warn("No providers configured.");
|
|
329
339
|
return;
|
|
330
340
|
}
|
|
331
|
-
const choice = await
|
|
341
|
+
const choice = await Jt({
|
|
332
342
|
message: "Select provider to remove:",
|
|
333
343
|
options: config.providers.map((p) => ({
|
|
334
344
|
value: p.id,
|
|
@@ -336,27 +346,27 @@ async function runProviderRemove(mode) {
|
|
|
336
346
|
hint: p.url
|
|
337
347
|
}))
|
|
338
348
|
});
|
|
339
|
-
if (
|
|
340
|
-
|
|
349
|
+
if (Ct(choice)) {
|
|
350
|
+
Nt("Cancelled");
|
|
341
351
|
return;
|
|
342
352
|
}
|
|
343
353
|
const providerToRemove = config.providers.find((p) => p.id === choice);
|
|
344
354
|
if (providerToRemove?.isActive && config.providers.length > 1) {
|
|
345
|
-
const confirm = await
|
|
355
|
+
const confirm = await Jt({
|
|
346
356
|
message: `"${providerToRemove.name}" is the active provider. Remove it anyway?`,
|
|
347
357
|
options: [
|
|
348
358
|
{ value: "yes", label: "Yes, remove and activate next provider" },
|
|
349
359
|
{ value: "no", label: "No, cancel" }
|
|
350
360
|
]
|
|
351
361
|
});
|
|
352
|
-
if (
|
|
353
|
-
|
|
362
|
+
if (Ct(confirm) || confirm === "no") {
|
|
363
|
+
Nt("Cancelled");
|
|
354
364
|
return;
|
|
355
365
|
}
|
|
356
366
|
}
|
|
357
367
|
const newConfig = removeProvider(config, choice);
|
|
358
368
|
await saveGlobalConfig(mode, newConfig);
|
|
359
|
-
|
|
369
|
+
Gt(`\u2713 Removed "${providerToRemove?.name}"`);
|
|
360
370
|
}
|
|
361
371
|
async function runProviderCommand(mode, subcommand) {
|
|
362
372
|
switch (subcommand) {
|
|
@@ -388,4 +398,4 @@ export {
|
|
|
388
398
|
runProviderRemove,
|
|
389
399
|
runProviderUse
|
|
390
400
|
};
|
|
391
|
-
//# sourceMappingURL=provider-
|
|
401
|
+
//# sourceMappingURL=provider-JDI3LVYF.js.map
|