vibeostheog 0.24.22 → 0.24.24
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 +10 -0
- package/dist/vibeOS.js +84 -18
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 0.24.24
|
|
2
|
+
- fix: restore persisted slot lock on reload (#151)
|
|
3
|
+
- chore: v0.24.23 (#150)
|
|
4
|
+
Merge remote-tracking branch 'origin/master'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## 0.24.23
|
|
8
|
+
- fix: heal stale vibelitex reconnect state
|
|
9
|
+
|
|
10
|
+
|
|
1
11
|
## 0.24.22
|
|
2
12
|
- fix: restore bootstrap token and install regression (#149)
|
|
3
13
|
|
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");
|
|
@@ -3395,6 +3395,15 @@ var _latestBlackboxPivotMsg = null;
|
|
|
3395
3395
|
var _modelLocked = false;
|
|
3396
3396
|
var _lockedSlot = null;
|
|
3397
3397
|
var _lockedModel = null;
|
|
3398
|
+
function setModelLocked(val) {
|
|
3399
|
+
_modelLocked = !!val;
|
|
3400
|
+
}
|
|
3401
|
+
function setLockedSlot(val) {
|
|
3402
|
+
_lockedSlot = val ? String(val) : null;
|
|
3403
|
+
}
|
|
3404
|
+
function setLockedModel(val) {
|
|
3405
|
+
_lockedModel = val ? String(val) : null;
|
|
3406
|
+
}
|
|
3398
3407
|
var _patternFiredKeys = /* @__PURE__ */ new Set();
|
|
3399
3408
|
var _sessionCleanupRegistered = false;
|
|
3400
3409
|
var _sessionCacheCleaned = false;
|
|
@@ -6136,7 +6145,7 @@ function _refreshModel(directory3) {
|
|
|
6136
6145
|
console.error(`[vibeOS] auto-detected model: ${currentModel} (tier=${currentTier})`);
|
|
6137
6146
|
}
|
|
6138
6147
|
}
|
|
6139
|
-
if (!_modelLocked) {
|
|
6148
|
+
if (!(_modelLocked || sel.slot_locked === true)) {
|
|
6140
6149
|
const activeIsManual = tiersData?.trinity?.[activeSlot]?.manual === true;
|
|
6141
6150
|
const cfgModel = activeIsManual ? "" : readConfig(directory3) || readConfig(getOpenCodeHome()) || "";
|
|
6142
6151
|
if (cfgModel && cfgModel.includes("/") && cfgModel !== currentModel) {
|
|
@@ -7264,14 +7273,30 @@ function setBlackboxEnabled2(val) {
|
|
|
7264
7273
|
setBlackboxEnabled(val);
|
|
7265
7274
|
}
|
|
7266
7275
|
var DFLT_OPTIMIZATION_MODE = "budget";
|
|
7276
|
+
function recoverOptimizationModeFromSelection(sel) {
|
|
7277
|
+
const slot = String(sel?.active_slot || "").toLowerCase();
|
|
7278
|
+
if (slot === "brain")
|
|
7279
|
+
return "quality";
|
|
7280
|
+
if (slot === "medium")
|
|
7281
|
+
return "vibemax";
|
|
7282
|
+
if (slot === "cheap")
|
|
7283
|
+
return "budget";
|
|
7284
|
+
return "budget";
|
|
7285
|
+
}
|
|
7267
7286
|
function loadOptimizationMode() {
|
|
7268
7287
|
try {
|
|
7269
7288
|
const sel = loadSelection();
|
|
7270
7289
|
const persistedMode = sel.optimization_mode || null;
|
|
7271
|
-
if (persistedMode === "vibelitex"
|
|
7290
|
+
if (persistedMode === "vibelitex") {
|
|
7272
7291
|
const prevKey = `${_OC_SID}_prev_opt`;
|
|
7273
|
-
const
|
|
7292
|
+
const sessionMode = loadSessionOptMode(_OC_SID);
|
|
7293
|
+
const globalMode = loadGlobalOptMode();
|
|
7294
|
+
const recoveryMode = sel.previous_optimization_mode || loadSessionOptMode(prevKey) || (sessionMode && sessionMode !== "vibelitex" ? sessionMode : "") || (globalMode && globalMode !== "vibelitex" ? globalMode : "") || recoverOptimizationModeFromSelection(sel);
|
|
7274
7295
|
if (recoveryMode && recoveryMode !== "vibelitex") {
|
|
7296
|
+
try {
|
|
7297
|
+
writeSelection("optimization_mode", recoveryMode);
|
|
7298
|
+
} catch {
|
|
7299
|
+
}
|
|
7275
7300
|
try {
|
|
7276
7301
|
writeSelection("previous_optimization_mode", null);
|
|
7277
7302
|
} catch {
|
|
@@ -10751,7 +10776,7 @@ function syncControlSettings(cv, options = {}) {
|
|
|
10751
10776
|
const writeIf = (key, val) => {
|
|
10752
10777
|
const sel = loadSelection();
|
|
10753
10778
|
if (sel[key] !== val)
|
|
10754
|
-
|
|
10779
|
+
writeSelection(key, val);
|
|
10755
10780
|
};
|
|
10756
10781
|
if (isManualMode) {
|
|
10757
10782
|
const allEntries = [...BRANDED_MODES, ...RUNTIME_MODES];
|
|
@@ -10796,8 +10821,10 @@ function syncControlSettings(cv, options = {}) {
|
|
|
10796
10821
|
const previousOptMode2 = typeof currentSel.previous_optimization_mode === "string" ? currentSel.previous_optimization_mode : null;
|
|
10797
10822
|
const prevSessionKey2 = `${sid}_prev_opt`;
|
|
10798
10823
|
const sessionPreviousOptMode = loadSessionOptMode(prevSessionKey2);
|
|
10799
|
-
const
|
|
10800
|
-
const
|
|
10824
|
+
const liveSlot = String(currentSel.active_slot || cv.tier_bias || "").toLowerCase();
|
|
10825
|
+
const inferredRecoveryMode = liveSlot === "brain" ? "quality" : liveSlot === "medium" ? "vibemax" : "budget";
|
|
10826
|
+
const restoreMode = sessionPreviousOptMode || previousOptMode2 || inferredRecoveryMode;
|
|
10827
|
+
const canRestorePrevious = !!restoreMode && cv.optimization_mode !== "vibelitex" && (previousOptMode2 !== null || sessionPreviousOptMode !== null);
|
|
10801
10828
|
if (fallbackPinned) {
|
|
10802
10829
|
if (currentSel.optimization_mode !== "vibelitex") {
|
|
10803
10830
|
writeIf("previous_optimization_mode", currentSel.optimization_mode);
|
|
@@ -10835,7 +10862,7 @@ function syncControlSettings(cv, options = {}) {
|
|
|
10835
10862
|
const oc = safeJsonParse3(readFileSync13(OC_CONFIG, "utf-8"));
|
|
10836
10863
|
if (oc.default_agent !== cv.agent_mode) {
|
|
10837
10864
|
if (cv.agent_mode === "plan" && oc.default_agent && oc.default_agent !== "plan") {
|
|
10838
|
-
|
|
10865
|
+
writeSelection("previous_default_agent", oc.default_agent);
|
|
10839
10866
|
}
|
|
10840
10867
|
oc.default_agent = cv.agent_mode;
|
|
10841
10868
|
writeFileSync12(OC_CONFIG, JSON.stringify(oc, null, 2) + "\n");
|
|
@@ -10853,19 +10880,20 @@ function syncControlSettings(cv, options = {}) {
|
|
|
10853
10880
|
oc.default_agent = restoreAgent;
|
|
10854
10881
|
writeFileSync12(OC_CONFIG, JSON.stringify(oc, null, 2) + "\n");
|
|
10855
10882
|
if (currentSel.previous_default_agent)
|
|
10856
|
-
|
|
10883
|
+
writeSelection("previous_default_agent", null);
|
|
10857
10884
|
}
|
|
10858
10885
|
}
|
|
10859
10886
|
} catch {
|
|
10860
10887
|
}
|
|
10861
10888
|
}
|
|
10862
|
-
if (
|
|
10889
|
+
if (cv.optimization_mode && cv.optimization_mode !== "vibelitex") {
|
|
10863
10890
|
const finalSel = loadSelection();
|
|
10864
10891
|
if (finalSel.optimization_mode === "vibelitex") {
|
|
10865
|
-
const
|
|
10892
|
+
const liveSlot = String(finalSel.active_slot || currentSel.active_slot || cv.tier_bias || "").toLowerCase();
|
|
10893
|
+
const restoreCandidate = finalSel.previous_optimization_mode || loadSessionOptMode(prevSessionKey) || previousOptMode || (liveSlot === "brain" ? "quality" : liveSlot === "medium" ? "vibemax" : "budget");
|
|
10866
10894
|
if (restoreCandidate && restoreCandidate !== "vibelitex") {
|
|
10867
|
-
|
|
10868
|
-
|
|
10895
|
+
writeSelection("optimization_mode", restoreCandidate);
|
|
10896
|
+
writeSelection("previous_optimization_mode", null);
|
|
10869
10897
|
writeSessionOptMode(sid, restoreCandidate);
|
|
10870
10898
|
writeSessionOptMode(prevSessionKey, "");
|
|
10871
10899
|
}
|
|
@@ -11702,9 +11730,9 @@ async function _appendFooter(input, output, directory3) {
|
|
|
11702
11730
|
const ltTotal = ltTasks + ltCache;
|
|
11703
11731
|
const activeSlot = selNowFooter.active_slot || "brain";
|
|
11704
11732
|
const optMode = (resolvedMode || "budget").toLowerCase();
|
|
11705
|
-
const vibeBrand = resolveBrand(optModeFooter, activeSlot);
|
|
11706
11733
|
const flashIcon = isApiConnected2() ? " \u26A1" : "";
|
|
11707
|
-
const displayMode =
|
|
11734
|
+
const displayMode = resolvedMode || optModeFooter || optMode || selNowFooter?.optimization_mode || "auto";
|
|
11735
|
+
const vibeBrand = resolveBrand(displayMode, activeSlot);
|
|
11708
11736
|
const currentSubRegime = _latestBlackboxState?.sub_regime || classifyTurnSimple2(latestUserIntent || "");
|
|
11709
11737
|
const vibeLine = buildFooterLine({
|
|
11710
11738
|
activeSlot,
|
|
@@ -14539,6 +14567,27 @@ async function DelegationEnforcer({ client: client2, directory: directory3 } = {
|
|
|
14539
14567
|
} else {
|
|
14540
14568
|
console.error("[vibeOS] NO MODEL \u2014 enforcement disabled, will auto-detect on first hook");
|
|
14541
14569
|
}
|
|
14570
|
+
try {
|
|
14571
|
+
const startupSelection = loadSelection();
|
|
14572
|
+
if (startupSelection?.slot_locked === true) {
|
|
14573
|
+
const lockedSlot = ["brain", "medium", "cheap"].includes(String(startupSelection.active_slot || "").trim()) ? String(startupSelection.active_slot) : "brain";
|
|
14574
|
+
let lockedModel = currentModel || null;
|
|
14575
|
+
try {
|
|
14576
|
+
const tiers = safeJsonParse3(readFileSync17(getTiersFile(), "utf-8"));
|
|
14577
|
+
lockedModel = tiers?.trinity?.[lockedSlot]?.oc || lockedModel || null;
|
|
14578
|
+
} catch {
|
|
14579
|
+
}
|
|
14580
|
+
setModelLocked(true);
|
|
14581
|
+
setLockedSlot(lockedSlot);
|
|
14582
|
+
setLockedModel(lockedModel);
|
|
14583
|
+
console.error(`[vibeOS] startup lock restored \u2192 ${lockedSlot}${lockedModel ? ` (${lockedModel})` : ""}`);
|
|
14584
|
+
} else {
|
|
14585
|
+
setModelLocked(false);
|
|
14586
|
+
setLockedSlot(null);
|
|
14587
|
+
setLockedModel(null);
|
|
14588
|
+
}
|
|
14589
|
+
} catch {
|
|
14590
|
+
}
|
|
14542
14591
|
console.error(`[vibeOS] auto-config guard: currentModel=${currentModel ? "SET" : "NONE"}, TIERS_FILE=${getTiersFile()}, exists=${existsSync18(getTiersFile())}`);
|
|
14543
14592
|
try {
|
|
14544
14593
|
if (!existsSync18(getTiersFile())) {
|
|
@@ -14629,7 +14678,6 @@ async function DelegationEnforcer({ client: client2, directory: directory3 } = {
|
|
|
14629
14678
|
_loadOpenCodeProviders,
|
|
14630
14679
|
_modelCost: _modelCost2,
|
|
14631
14680
|
_modelTier: _modelTier2,
|
|
14632
|
-
_modelLocked,
|
|
14633
14681
|
_latestBlackboxState,
|
|
14634
14682
|
currentModel,
|
|
14635
14683
|
currentTier,
|
|
@@ -14668,7 +14716,7 @@ async function DelegationEnforcer({ client: client2, directory: directory3 } = {
|
|
|
14668
14716
|
return hookVibeHome;
|
|
14669
14717
|
},
|
|
14670
14718
|
loadSelection,
|
|
14671
|
-
writeSelection
|
|
14719
|
+
writeSelection,
|
|
14672
14720
|
loadCredit,
|
|
14673
14721
|
thinkingLevel,
|
|
14674
14722
|
readLifetimeSavings,
|
|
@@ -14728,6 +14776,24 @@ async function DelegationEnforcer({ client: client2, directory: directory3 } = {
|
|
|
14728
14776
|
},
|
|
14729
14777
|
set _blackboxEnabled(v) {
|
|
14730
14778
|
setBlackboxEnabled(v);
|
|
14779
|
+
},
|
|
14780
|
+
get _modelLocked() {
|
|
14781
|
+
return _modelLocked;
|
|
14782
|
+
},
|
|
14783
|
+
set _modelLocked(v) {
|
|
14784
|
+
setModelLocked(v);
|
|
14785
|
+
},
|
|
14786
|
+
get _lockedSlot() {
|
|
14787
|
+
return _lockedSlot;
|
|
14788
|
+
},
|
|
14789
|
+
set _lockedSlot(v) {
|
|
14790
|
+
setLockedSlot(v);
|
|
14791
|
+
},
|
|
14792
|
+
get _lockedModel() {
|
|
14793
|
+
return _lockedModel;
|
|
14794
|
+
},
|
|
14795
|
+
set _lockedModel(v) {
|
|
14796
|
+
setLockedModel(v);
|
|
14731
14797
|
}
|
|
14732
14798
|
};
|
|
14733
14799
|
const pluginHooks = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibeostheog",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.24",
|
|
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",
|