swarmlancer-cli 0.7.0 → 0.7.1
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/app.js +9 -18
- package/dist/config.js +2 -0
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -2,8 +2,8 @@ import { ProcessTerminal, TUI } from "@mariozechner/pi-tui";
|
|
|
2
2
|
import { getConfig, getAgents, getAgent, saveAgent, deleteAgent, createAgent, migrateLegacyAgent, } from "./config.js";
|
|
3
3
|
import { login } from "./login.js";
|
|
4
4
|
import { setActiveModel, setAgentInstructions } from "./inference.js";
|
|
5
|
-
import { resolveModel, getAvailableModels,
|
|
6
|
-
import { LoginDialogComponent } from "@mariozechner/pi-coding-agent";
|
|
5
|
+
import { resolveModel, getAvailableModels, getAuthStorage, } from "./providers.js";
|
|
6
|
+
import { LoginDialogComponent, OAuthSelectorComponent } from "@mariozechner/pi-coding-agent";
|
|
7
7
|
import { startAgent, stopAgent, sendToServer } from "./agent.js";
|
|
8
8
|
import { colors } from "./theme.js";
|
|
9
9
|
import { DashboardScreen } from "./screens/dashboard.js";
|
|
@@ -207,26 +207,17 @@ async function runSwarm() {
|
|
|
207
207
|
}
|
|
208
208
|
// ── Manage → Providers ────────────────────────────────────
|
|
209
209
|
async function runProviders() {
|
|
210
|
-
let idx = 0;
|
|
211
210
|
while (true) {
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
return { value: p.id, label: `${prefix}${p.label}${suffix}`, description: "" };
|
|
217
|
-
});
|
|
218
|
-
const result = await new Promise((resolve) => {
|
|
219
|
-
const screen = new MenuScreen(tui, "Providers", items, idx);
|
|
220
|
-
screen.onSelect = (v, i) => resolve({ value: v, index: i });
|
|
221
|
-
screen.onBack = () => resolve({ value: null, index: idx });
|
|
222
|
-
setScreen(screen);
|
|
211
|
+
// Use pi's OAuthSelectorComponent — exact same UI as pi's /login
|
|
212
|
+
const selectedProvider = await new Promise((resolve) => {
|
|
213
|
+
const selector = new OAuthSelectorComponent("login", getAuthStorage(), (providerId) => resolve(providerId), () => resolve(null));
|
|
214
|
+
setScreen(selector);
|
|
223
215
|
});
|
|
224
|
-
if (!
|
|
216
|
+
if (!selectedProvider)
|
|
225
217
|
return;
|
|
226
|
-
|
|
227
|
-
// Use pi's LoginDialogComponent for the OAuth/login flow
|
|
218
|
+
// Use pi's LoginDialogComponent for the actual login flow
|
|
228
219
|
await new Promise((resolve) => {
|
|
229
|
-
const dialog = new LoginDialogComponent(tui,
|
|
220
|
+
const dialog = new LoginDialogComponent(tui, selectedProvider, (_success, _message) => {
|
|
230
221
|
resolve();
|
|
231
222
|
});
|
|
232
223
|
setScreen(dialog);
|
package/dist/config.js
CHANGED
|
@@ -110,6 +110,7 @@ export function getAgents() {
|
|
|
110
110
|
discovery: { ...DEFAULT_DISCOVERY, ...raw.discovery },
|
|
111
111
|
limits: { ...DEFAULT_LIMITS, ...raw.limits },
|
|
112
112
|
modelPattern: raw.modelPattern,
|
|
113
|
+
active: raw.active ?? false,
|
|
113
114
|
});
|
|
114
115
|
}
|
|
115
116
|
catch { }
|
|
@@ -131,6 +132,7 @@ export function getAgent(id) {
|
|
|
131
132
|
discovery: { ...DEFAULT_DISCOVERY, ...raw.discovery },
|
|
132
133
|
limits: { ...DEFAULT_LIMITS, ...raw.limits },
|
|
133
134
|
modelPattern: raw.modelPattern,
|
|
135
|
+
active: raw.active ?? false,
|
|
134
136
|
};
|
|
135
137
|
}
|
|
136
138
|
catch {
|