@serkanalgur/opencode-nexus 1.2.2 → 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 +18 -7
- 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,12 +34420,14 @@ var tui_default = define({
|
|
|
34419
34420
|
});
|
|
34420
34421
|
if (selected !== null && selected !== undefined) {
|
|
34421
34422
|
configManager.setModel(role, selected);
|
|
34423
|
+
persistConfig();
|
|
34424
|
+
}
|
|
34425
|
+
};
|
|
34426
|
+
const persistConfig = () => {
|
|
34427
|
+
if (configSaveScope === "project") {
|
|
34428
|
+
configManager.saveProjectConfig(process.cwd());
|
|
34429
|
+
} else {
|
|
34422
34430
|
configManager.saveGlobalConfig();
|
|
34423
|
-
context.ui.toast.show({
|
|
34424
|
-
title: "Nexus",
|
|
34425
|
-
message: `${role} → ${selected || "default"}`,
|
|
34426
|
-
variant: "success"
|
|
34427
|
-
});
|
|
34428
34431
|
}
|
|
34429
34432
|
};
|
|
34430
34433
|
const handleConfigDialog = async () => {
|
|
@@ -34439,7 +34442,7 @@ var tui_default = define({
|
|
|
34439
34442
|
configManager.updateStorageConfig({
|
|
34440
34443
|
budget: { ...config.budget, maxTotalCost: budget }
|
|
34441
34444
|
});
|
|
34442
|
-
|
|
34445
|
+
persistConfig();
|
|
34443
34446
|
context.ui.toast.show({
|
|
34444
34447
|
title: "Nexus",
|
|
34445
34448
|
message: `Budget updated: $${budget}`,
|
|
@@ -34449,13 +34452,21 @@ var tui_default = define({
|
|
|
34449
34452
|
}
|
|
34450
34453
|
};
|
|
34451
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";
|
|
34452
34463
|
for (const role of configManager.getRoles()) {
|
|
34453
34464
|
await handleModelSelect(role);
|
|
34454
34465
|
}
|
|
34455
34466
|
await handleConfigDialog();
|
|
34456
34467
|
context.ui.toast.show({
|
|
34457
34468
|
title: "Nexus",
|
|
34458
|
-
message:
|
|
34469
|
+
message: `Configuration complete! (saved to ${configSaveScope === "project" ? ".opencode/" : "~/.config/opencode/"})`,
|
|
34459
34470
|
variant: "success"
|
|
34460
34471
|
});
|
|
34461
34472
|
};
|