@serkanalgur/opencode-nexus 1.2.3 → 1.2.4
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/tui.js +19 -37
- package/package.json +1 -1
package/dist/tui.js
CHANGED
|
@@ -34389,6 +34389,7 @@ var tui_default = define({
|
|
|
34389
34389
|
id: "nexus.cli",
|
|
34390
34390
|
setup(context) {
|
|
34391
34391
|
const configManager = new NexusConfigManager;
|
|
34392
|
+
let configSaveScope = "global";
|
|
34392
34393
|
const handleModelSelect = async (role) => {
|
|
34393
34394
|
if (!configManager.getRoles().includes(role)) {
|
|
34394
34395
|
context.ui.toast.show({
|
|
@@ -34419,29 +34420,14 @@ var tui_default = define({
|
|
|
34419
34420
|
});
|
|
34420
34421
|
if (selected !== null && selected !== undefined) {
|
|
34421
34422
|
configManager.setModel(role, selected);
|
|
34422
|
-
|
|
34423
|
-
|
|
34424
|
-
|
|
34425
|
-
|
|
34426
|
-
|
|
34427
|
-
|
|
34428
|
-
|
|
34429
|
-
|
|
34430
|
-
const basePath = process.cwd();
|
|
34431
|
-
configManager.saveProjectConfig(basePath);
|
|
34432
|
-
context.ui.toast.show({
|
|
34433
|
-
title: "Nexus",
|
|
34434
|
-
message: `${role} → ${selected || "default"} (saved to .opencode/)`,
|
|
34435
|
-
variant: "success"
|
|
34436
|
-
});
|
|
34437
|
-
} else {
|
|
34438
|
-
configManager.saveGlobalConfig();
|
|
34439
|
-
context.ui.toast.show({
|
|
34440
|
-
title: "Nexus",
|
|
34441
|
-
message: `${role} → ${selected || "default"} (saved to ~/.config/opencode/)`,
|
|
34442
|
-
variant: "success"
|
|
34443
|
-
});
|
|
34444
|
-
}
|
|
34423
|
+
persistConfig();
|
|
34424
|
+
}
|
|
34425
|
+
};
|
|
34426
|
+
const persistConfig = () => {
|
|
34427
|
+
if (configSaveScope === "project") {
|
|
34428
|
+
configManager.saveProjectConfig(process.cwd());
|
|
34429
|
+
} else {
|
|
34430
|
+
configManager.saveGlobalConfig();
|
|
34445
34431
|
}
|
|
34446
34432
|
};
|
|
34447
34433
|
const handleConfigDialog = async () => {
|
|
@@ -34456,19 +34442,7 @@ var tui_default = define({
|
|
|
34456
34442
|
configManager.updateStorageConfig({
|
|
34457
34443
|
budget: { ...config.budget, maxTotalCost: budget }
|
|
34458
34444
|
});
|
|
34459
|
-
|
|
34460
|
-
title: "Save budget to where?",
|
|
34461
|
-
options: [
|
|
34462
|
-
{ title: "\uD83D\uDCC1 Project (.opencode/)", value: "project", description: "This project only" },
|
|
34463
|
-
{ title: "\uD83C\uDF0D Global (~/.config/opencode/)", value: "global", description: "All projects" }
|
|
34464
|
-
]
|
|
34465
|
-
});
|
|
34466
|
-
if (saveTarget === "project") {
|
|
34467
|
-
const basePath = process.cwd();
|
|
34468
|
-
configManager.saveProjectConfig(basePath);
|
|
34469
|
-
} else {
|
|
34470
|
-
configManager.saveGlobalConfig();
|
|
34471
|
-
}
|
|
34445
|
+
persistConfig();
|
|
34472
34446
|
context.ui.toast.show({
|
|
34473
34447
|
title: "Nexus",
|
|
34474
34448
|
message: `Budget updated: $${budget}`,
|
|
@@ -34478,13 +34452,21 @@ var tui_default = define({
|
|
|
34478
34452
|
}
|
|
34479
34453
|
};
|
|
34480
34454
|
const handleFullConfig = async () => {
|
|
34455
|
+
const scope = await context.ui.dialog.select({
|
|
34456
|
+
title: "Where to save config?",
|
|
34457
|
+
options: [
|
|
34458
|
+
{ title: "\uD83D\uDCC1 Project (.opencode/)", value: "project", description: "This project only" },
|
|
34459
|
+
{ title: "\uD83C\uDF0D Global (~/.config/opencode/)", value: "global", description: "All projects" }
|
|
34460
|
+
]
|
|
34461
|
+
});
|
|
34462
|
+
configSaveScope = scope === "project" ? "project" : "global";
|
|
34481
34463
|
for (const role of configManager.getRoles()) {
|
|
34482
34464
|
await handleModelSelect(role);
|
|
34483
34465
|
}
|
|
34484
34466
|
await handleConfigDialog();
|
|
34485
34467
|
context.ui.toast.show({
|
|
34486
34468
|
title: "Nexus",
|
|
34487
|
-
message:
|
|
34469
|
+
message: `Configuration complete! (saved to ${configSaveScope === "project" ? ".opencode/" : "~/.config/opencode/"})`,
|
|
34488
34470
|
variant: "success"
|
|
34489
34471
|
});
|
|
34490
34472
|
};
|