@serkanalgur/opencode-nexus 1.2.6 → 1.2.7
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/index.js +6 -32
- package/dist/tui.js +6 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8559,12 +8559,12 @@ class NexusConfigManager {
|
|
|
8559
8559
|
}
|
|
8560
8560
|
saveProjectConfig(basePath) {
|
|
8561
8561
|
const projectPath = join(basePath, ".opencode", "nexus.jsonc");
|
|
8562
|
-
const config = this.
|
|
8562
|
+
const config = this.getSaveableConfig();
|
|
8563
8563
|
this.writeJsoncFile(projectPath, config);
|
|
8564
8564
|
}
|
|
8565
8565
|
saveGlobalConfig() {
|
|
8566
8566
|
const globalPath = join(homedir(), ".config", "opencode", "nexus.jsonc");
|
|
8567
|
-
const config = this.
|
|
8567
|
+
const config = this.getSaveableConfig();
|
|
8568
8568
|
this.writeJsoncFile(globalPath, config);
|
|
8569
8569
|
}
|
|
8570
8570
|
initProjectConfig(basePath) {
|
|
@@ -8582,38 +8582,12 @@ class NexusConfigManager {
|
|
|
8582
8582
|
this.saveGlobalConfig();
|
|
8583
8583
|
}
|
|
8584
8584
|
}
|
|
8585
|
-
|
|
8585
|
+
getSaveableConfig() {
|
|
8586
8586
|
const current = this.getConfig();
|
|
8587
8587
|
const result = {};
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
models[role] = current.models[role];
|
|
8592
|
-
}
|
|
8593
|
-
}
|
|
8594
|
-
if (Object.keys(models).length > 0) {
|
|
8595
|
-
result.models = models;
|
|
8596
|
-
}
|
|
8597
|
-
const budget = {};
|
|
8598
|
-
const budgetKeys = ["maxTotalCost", "maxCostPerTask", "maxCostPerAgent", "alertThreshold"];
|
|
8599
|
-
for (const key of budgetKeys) {
|
|
8600
|
-
if (current.budget[key] !== DEFAULT_CONFIG.budget[key]) {
|
|
8601
|
-
budget[key] = current.budget[key];
|
|
8602
|
-
}
|
|
8603
|
-
}
|
|
8604
|
-
if (Object.keys(budget).length > 0) {
|
|
8605
|
-
result.budget = budget;
|
|
8606
|
-
}
|
|
8607
|
-
const selfHealing = {};
|
|
8608
|
-
const shKeys = ["enabled", "maxRetries", "contextTransfer"];
|
|
8609
|
-
for (const key of shKeys) {
|
|
8610
|
-
if (current.selfHealing[key] !== DEFAULT_CONFIG.selfHealing[key]) {
|
|
8611
|
-
selfHealing[key] = current.selfHealing[key];
|
|
8612
|
-
}
|
|
8613
|
-
}
|
|
8614
|
-
if (Object.keys(selfHealing).length > 0) {
|
|
8615
|
-
result.selfHealing = selfHealing;
|
|
8616
|
-
}
|
|
8588
|
+
result.models = { ...current.models };
|
|
8589
|
+
result.budget = { ...current.budget };
|
|
8590
|
+
result.selfHealing = { ...current.selfHealing };
|
|
8617
8591
|
return result;
|
|
8618
8592
|
}
|
|
8619
8593
|
resetToDefaults() {
|
package/dist/tui.js
CHANGED
|
@@ -302,12 +302,12 @@ class NexusConfigManager {
|
|
|
302
302
|
}
|
|
303
303
|
saveProjectConfig(basePath) {
|
|
304
304
|
const projectPath = join(basePath, ".opencode", "nexus.jsonc");
|
|
305
|
-
const config = this.
|
|
305
|
+
const config = this.getSaveableConfig();
|
|
306
306
|
this.writeJsoncFile(projectPath, config);
|
|
307
307
|
}
|
|
308
308
|
saveGlobalConfig() {
|
|
309
309
|
const globalPath = join(homedir(), ".config", "opencode", "nexus.jsonc");
|
|
310
|
-
const config = this.
|
|
310
|
+
const config = this.getSaveableConfig();
|
|
311
311
|
this.writeJsoncFile(globalPath, config);
|
|
312
312
|
}
|
|
313
313
|
initProjectConfig(basePath) {
|
|
@@ -325,38 +325,12 @@ class NexusConfigManager {
|
|
|
325
325
|
this.saveGlobalConfig();
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
getSaveableConfig() {
|
|
329
329
|
const current = this.getConfig();
|
|
330
330
|
const result = {};
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
models[role] = current.models[role];
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
if (Object.keys(models).length > 0) {
|
|
338
|
-
result.models = models;
|
|
339
|
-
}
|
|
340
|
-
const budget = {};
|
|
341
|
-
const budgetKeys = ["maxTotalCost", "maxCostPerTask", "maxCostPerAgent", "alertThreshold"];
|
|
342
|
-
for (const key of budgetKeys) {
|
|
343
|
-
if (current.budget[key] !== DEFAULT_CONFIG.budget[key]) {
|
|
344
|
-
budget[key] = current.budget[key];
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
if (Object.keys(budget).length > 0) {
|
|
348
|
-
result.budget = budget;
|
|
349
|
-
}
|
|
350
|
-
const selfHealing = {};
|
|
351
|
-
const shKeys = ["enabled", "maxRetries", "contextTransfer"];
|
|
352
|
-
for (const key of shKeys) {
|
|
353
|
-
if (current.selfHealing[key] !== DEFAULT_CONFIG.selfHealing[key]) {
|
|
354
|
-
selfHealing[key] = current.selfHealing[key];
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
if (Object.keys(selfHealing).length > 0) {
|
|
358
|
-
result.selfHealing = selfHealing;
|
|
359
|
-
}
|
|
331
|
+
result.models = { ...current.models };
|
|
332
|
+
result.budget = { ...current.budget };
|
|
333
|
+
result.selfHealing = { ...current.selfHealing };
|
|
360
334
|
return result;
|
|
361
335
|
}
|
|
362
336
|
resetToDefaults() {
|