vibeostheog 0.24.22 → 0.24.23
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/CHANGELOG.md +4 -0
- package/dist/vibeOS.js +35 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/vibeOS.js
CHANGED
|
@@ -2452,7 +2452,7 @@ function loadSelection() {
|
|
|
2452
2452
|
return DFLT_SEL;
|
|
2453
2453
|
}
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2455
|
+
function writeSelection(key, value) {
|
|
2456
2456
|
const TIERS_FILE3 = join3(getVibeOSHome2(), "model-tiers.json");
|
|
2457
2457
|
try {
|
|
2458
2458
|
return withFileLock(TIERS_FILE3, () => {
|
|
@@ -2519,7 +2519,7 @@ function loadGlobalOptMode() {
|
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
2521
|
function saveGlobalOptMode(mode) {
|
|
2522
|
-
return
|
|
2522
|
+
return writeSelection("optimization_mode", mode);
|
|
2523
2523
|
}
|
|
2524
2524
|
function writeSessionOptMode2(sid, mode) {
|
|
2525
2525
|
const BLACKBOX_FILE = join3(getVibeOSHome2(), "blackbox-state.json");
|
|
@@ -7264,14 +7264,30 @@ function setBlackboxEnabled2(val) {
|
|
|
7264
7264
|
setBlackboxEnabled(val);
|
|
7265
7265
|
}
|
|
7266
7266
|
var DFLT_OPTIMIZATION_MODE = "budget";
|
|
7267
|
+
function recoverOptimizationModeFromSelection(sel) {
|
|
7268
|
+
const slot = String(sel?.active_slot || "").toLowerCase();
|
|
7269
|
+
if (slot === "brain")
|
|
7270
|
+
return "quality";
|
|
7271
|
+
if (slot === "medium")
|
|
7272
|
+
return "vibemax";
|
|
7273
|
+
if (slot === "cheap")
|
|
7274
|
+
return "budget";
|
|
7275
|
+
return "budget";
|
|
7276
|
+
}
|
|
7267
7277
|
function loadOptimizationMode() {
|
|
7268
7278
|
try {
|
|
7269
7279
|
const sel = loadSelection();
|
|
7270
7280
|
const persistedMode = sel.optimization_mode || null;
|
|
7271
|
-
if (persistedMode === "vibelitex"
|
|
7281
|
+
if (persistedMode === "vibelitex") {
|
|
7272
7282
|
const prevKey = `${_OC_SID}_prev_opt`;
|
|
7273
|
-
const
|
|
7283
|
+
const sessionMode = loadSessionOptMode(_OC_SID);
|
|
7284
|
+
const globalMode = loadGlobalOptMode();
|
|
7285
|
+
const recoveryMode = sel.previous_optimization_mode || loadSessionOptMode(prevKey) || (sessionMode && sessionMode !== "vibelitex" ? sessionMode : "") || (globalMode && globalMode !== "vibelitex" ? globalMode : "") || recoverOptimizationModeFromSelection(sel);
|
|
7274
7286
|
if (recoveryMode && recoveryMode !== "vibelitex") {
|
|
7287
|
+
try {
|
|
7288
|
+
writeSelection("optimization_mode", recoveryMode);
|
|
7289
|
+
} catch {
|
|
7290
|
+
}
|
|
7275
7291
|
try {
|
|
7276
7292
|
writeSelection("previous_optimization_mode", null);
|
|
7277
7293
|
} catch {
|
|
@@ -10751,7 +10767,7 @@ function syncControlSettings(cv, options = {}) {
|
|
|
10751
10767
|
const writeIf = (key, val) => {
|
|
10752
10768
|
const sel = loadSelection();
|
|
10753
10769
|
if (sel[key] !== val)
|
|
10754
|
-
|
|
10770
|
+
writeSelection(key, val);
|
|
10755
10771
|
};
|
|
10756
10772
|
if (isManualMode) {
|
|
10757
10773
|
const allEntries = [...BRANDED_MODES, ...RUNTIME_MODES];
|
|
@@ -10796,8 +10812,10 @@ function syncControlSettings(cv, options = {}) {
|
|
|
10796
10812
|
const previousOptMode2 = typeof currentSel.previous_optimization_mode === "string" ? currentSel.previous_optimization_mode : null;
|
|
10797
10813
|
const prevSessionKey2 = `${sid}_prev_opt`;
|
|
10798
10814
|
const sessionPreviousOptMode = loadSessionOptMode(prevSessionKey2);
|
|
10799
|
-
const
|
|
10800
|
-
const
|
|
10815
|
+
const liveSlot = String(currentSel.active_slot || cv.tier_bias || "").toLowerCase();
|
|
10816
|
+
const inferredRecoveryMode = liveSlot === "brain" ? "quality" : liveSlot === "medium" ? "vibemax" : "budget";
|
|
10817
|
+
const restoreMode = sessionPreviousOptMode || previousOptMode2 || inferredRecoveryMode;
|
|
10818
|
+
const canRestorePrevious = !!restoreMode && cv.optimization_mode !== "vibelitex" && (previousOptMode2 !== null || sessionPreviousOptMode !== null);
|
|
10801
10819
|
if (fallbackPinned) {
|
|
10802
10820
|
if (currentSel.optimization_mode !== "vibelitex") {
|
|
10803
10821
|
writeIf("previous_optimization_mode", currentSel.optimization_mode);
|
|
@@ -10835,7 +10853,7 @@ function syncControlSettings(cv, options = {}) {
|
|
|
10835
10853
|
const oc = safeJsonParse3(readFileSync13(OC_CONFIG, "utf-8"));
|
|
10836
10854
|
if (oc.default_agent !== cv.agent_mode) {
|
|
10837
10855
|
if (cv.agent_mode === "plan" && oc.default_agent && oc.default_agent !== "plan") {
|
|
10838
|
-
|
|
10856
|
+
writeSelection("previous_default_agent", oc.default_agent);
|
|
10839
10857
|
}
|
|
10840
10858
|
oc.default_agent = cv.agent_mode;
|
|
10841
10859
|
writeFileSync12(OC_CONFIG, JSON.stringify(oc, null, 2) + "\n");
|
|
@@ -10853,19 +10871,20 @@ function syncControlSettings(cv, options = {}) {
|
|
|
10853
10871
|
oc.default_agent = restoreAgent;
|
|
10854
10872
|
writeFileSync12(OC_CONFIG, JSON.stringify(oc, null, 2) + "\n");
|
|
10855
10873
|
if (currentSel.previous_default_agent)
|
|
10856
|
-
|
|
10874
|
+
writeSelection("previous_default_agent", null);
|
|
10857
10875
|
}
|
|
10858
10876
|
}
|
|
10859
10877
|
} catch {
|
|
10860
10878
|
}
|
|
10861
10879
|
}
|
|
10862
|
-
if (
|
|
10880
|
+
if (cv.optimization_mode && cv.optimization_mode !== "vibelitex") {
|
|
10863
10881
|
const finalSel = loadSelection();
|
|
10864
10882
|
if (finalSel.optimization_mode === "vibelitex") {
|
|
10865
|
-
const
|
|
10883
|
+
const liveSlot = String(finalSel.active_slot || currentSel.active_slot || cv.tier_bias || "").toLowerCase();
|
|
10884
|
+
const restoreCandidate = finalSel.previous_optimization_mode || loadSessionOptMode(prevSessionKey) || previousOptMode || (liveSlot === "brain" ? "quality" : liveSlot === "medium" ? "vibemax" : "budget");
|
|
10866
10885
|
if (restoreCandidate && restoreCandidate !== "vibelitex") {
|
|
10867
|
-
|
|
10868
|
-
|
|
10886
|
+
writeSelection("optimization_mode", restoreCandidate);
|
|
10887
|
+
writeSelection("previous_optimization_mode", null);
|
|
10869
10888
|
writeSessionOptMode(sid, restoreCandidate);
|
|
10870
10889
|
writeSessionOptMode(prevSessionKey, "");
|
|
10871
10890
|
}
|
|
@@ -11702,9 +11721,9 @@ async function _appendFooter(input, output, directory3) {
|
|
|
11702
11721
|
const ltTotal = ltTasks + ltCache;
|
|
11703
11722
|
const activeSlot = selNowFooter.active_slot || "brain";
|
|
11704
11723
|
const optMode = (resolvedMode || "budget").toLowerCase();
|
|
11705
|
-
const vibeBrand = resolveBrand(optModeFooter, activeSlot);
|
|
11706
11724
|
const flashIcon = isApiConnected2() ? " \u26A1" : "";
|
|
11707
|
-
const displayMode =
|
|
11725
|
+
const displayMode = resolvedMode || optModeFooter || optMode || selNowFooter?.optimization_mode || "auto";
|
|
11726
|
+
const vibeBrand = resolveBrand(displayMode, activeSlot);
|
|
11708
11727
|
const currentSubRegime = _latestBlackboxState?.sub_regime || classifyTurnSimple2(latestUserIntent || "");
|
|
11709
11728
|
const vibeLine = buildFooterLine({
|
|
11710
11729
|
activeSlot,
|
|
@@ -14668,7 +14687,7 @@ async function DelegationEnforcer({ client: client2, directory: directory3 } = {
|
|
|
14668
14687
|
return hookVibeHome;
|
|
14669
14688
|
},
|
|
14670
14689
|
loadSelection,
|
|
14671
|
-
writeSelection
|
|
14690
|
+
writeSelection,
|
|
14672
14691
|
loadCredit,
|
|
14673
14692
|
thinkingLevel,
|
|
14674
14693
|
readLifetimeSavings,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibeostheog",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.23",
|
|
4
4
|
"description": "Cost-aware delegation enforcer for OpenCode. Tracks model usage, routes Task subagents to cheaper tiers, surfaces cumulative savings in chat. Includes research audit, reporting framework, project memory, progressive scratchpad decadence, and trinity CLI for brain/medium/cheap slot switching.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"release": "node scripts/release.mjs",
|