vibeostheog 0.20.4 → 0.20.6
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 +9 -0
- package/package.json +1 -1
- package/src/lib/api-client.js +4 -1
- package/src/lib/hooks/footer.js +15 -11
- package/src/lib/hooks/tool-execute.js +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 0.20.6
|
|
2
|
+
- fix: quiet delegation warnings in CLI stderr
|
|
3
|
+
- fix: keep delegation note in the chat transcript only
|
|
4
|
+
|
|
5
|
+
## 0.20.5
|
|
6
|
+
- fix: validate embedded alpha token on install
|
|
7
|
+
- fix: keep alpha token embedded for seamless onboarding
|
|
8
|
+
- fix: only show footer flash after live backend success
|
|
9
|
+
|
|
1
10
|
## 0.20.4
|
|
2
11
|
- fix: add alpha token invalidate switch
|
|
3
12
|
- fix: prefer valid api tokens over placeholder env
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibeostheog",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.6",
|
|
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",
|
package/src/lib/api-client.js
CHANGED
|
@@ -5,6 +5,8 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
import { homedir } from "node:os";
|
|
6
6
|
import { isApiConnected as isRuntimeApiConnected, markApiConnected, markApiDisconnected, resetApiConnection } from "./runtime-state.js";
|
|
7
7
|
const DEFAULT_API_URL = "https://api.vibetheog.com";
|
|
8
|
+
// Alpha-only onboarding token: intentionally embedded so fresh installs work
|
|
9
|
+
// without manual setup. This is a bootstrap credential, not a secrecy boundary.
|
|
8
10
|
const EMBEDDED_API_TOKEN = "vos_8d73804b13bb46711b9a47f036dba7b4d026fd9583d96960e663716e62815a69";
|
|
9
11
|
const API_TOKEN_RE = /^vos_[a-f0-9]{64}$/i;
|
|
10
12
|
const API_DISABLED_RE = /^(1|true|yes|on)$/i;
|
|
@@ -98,7 +100,8 @@ export class VibeOSApiClient {
|
|
|
98
100
|
fallbackStubs;
|
|
99
101
|
constructor(options = {}) {
|
|
100
102
|
this.baseUrl = options.baseUrl || process.env.VIBEOS_API_URL || DEFAULT_API_URL;
|
|
101
|
-
this.apiToken = normalizeApiToken(options.apiToken || process.env.VIBEOS_API_TOKEN || "", "")
|
|
103
|
+
this.apiToken = normalizeApiToken(options.apiToken || process.env.VIBEOS_API_TOKEN || "", "")
|
|
104
|
+
|| null;
|
|
102
105
|
this.masterKey = options.masterKey || process.env.VIBEOS_API_MASTER_KEY || null;
|
|
103
106
|
this.timeout = options.timeout || REQUEST_TIMEOUT;
|
|
104
107
|
this.fallbackMode = false;
|
package/src/lib/hooks/footer.js
CHANGED
|
@@ -8,7 +8,7 @@ import { peekBudgetFirstMode, recordBudgetFirstOutcome } from "../mode-policy.js
|
|
|
8
8
|
import { saveReport } from "../reporting.js";
|
|
9
9
|
import { currentModel, currentTier, setCurrentModel, setCurrentTier, currentProjectFingerprint, currentProjectName, _modelLocked, _blackboxEnabled, _latestBlackboxState, reconcileStateFromLedger, safeJsonParse, loadBlackboxState } from "../state.js";
|
|
10
10
|
import { loadSessionSlot } from "../selection-manager.js";
|
|
11
|
-
import { remoteCall,
|
|
11
|
+
import { remoteCall, isApiConnected } from "../api-client.js";
|
|
12
12
|
const IS_CLI_RUNTIME = Boolean(process.stdout?.isTTY || process.stderr?.isTTY || process.stdin?.isTTY);
|
|
13
13
|
const IS_TEST_RUNTIME = process.env.VIBEOS_MCP_PORT === "0" || process.env.NODE_ENV === "test" || process.env.CI === "true";
|
|
14
14
|
const FOOTER_DEBUG_STDERR = process.env.VIBEOS_DEBUG_FOOTER === "1" || (!IS_CLI_RUNTIME && !IS_TEST_RUNTIME);
|
|
@@ -45,7 +45,9 @@ async function apiAutoSelectMode(regime, stress) {
|
|
|
45
45
|
return res.mode;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
catch (e) {
|
|
48
|
+
catch (e) {
|
|
49
|
+
footerDebug("[vibeOS] apiAutoSelectMode error:", e.message);
|
|
50
|
+
}
|
|
49
51
|
const fallback = regimeToMode(regime, stress);
|
|
50
52
|
if (!_cachedAutoMode || _cachedAutoMode === "balanced")
|
|
51
53
|
_cachedAutoMode = fallback;
|
|
@@ -147,15 +149,15 @@ async function _appendFooter(input, output, directory) {
|
|
|
147
149
|
// Always prefer the live OpenCode model setting when available.
|
|
148
150
|
try {
|
|
149
151
|
const cfg = await client.config.get("model");
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
152
|
+
if (cfg) {
|
|
153
|
+
const cfgModel = String(cfg);
|
|
154
|
+
if (cfgModel !== currentModel) {
|
|
155
|
+
setCurrentModel(cfgModel);
|
|
156
|
+
setCurrentTier(classify(cfgModel));
|
|
157
|
+
footerDebug(`[vibeOS] client-detected model: ${currentModel} (tier=${currentTier})`);
|
|
157
158
|
}
|
|
158
159
|
}
|
|
160
|
+
}
|
|
159
161
|
catch { /* client.config may not be available */ }
|
|
160
162
|
try {
|
|
161
163
|
const messageID = input?.messageID ||
|
|
@@ -226,7 +228,9 @@ async function _appendFooter(input, output, directory) {
|
|
|
226
228
|
tags: ["auto", "cost"],
|
|
227
229
|
});
|
|
228
230
|
}
|
|
229
|
-
catch (e) {
|
|
231
|
+
catch (e) {
|
|
232
|
+
footerDebug("[vibeOS] auto-report:", e.message);
|
|
233
|
+
}
|
|
230
234
|
}
|
|
231
235
|
// Enforcement state tags for footer — dynamically adjusted by control vector
|
|
232
236
|
const selNowFooter = loadSelection();
|
|
@@ -253,7 +257,7 @@ async function _appendFooter(input, output, directory) {
|
|
|
253
257
|
enfSuffixFooter = ` QA:${Math.round(quality_avg)}% ${enfTagsFooter.join(" ")}`;
|
|
254
258
|
}
|
|
255
259
|
// Optimization mode resolver — keep the dopamine footer format.
|
|
256
|
-
const flashIcon =
|
|
260
|
+
const flashIcon = isApiConnected() ? "⚡" : "";
|
|
257
261
|
const resolvedMode = peekBudgetFirstMode({
|
|
258
262
|
requestedMode: optModeFooter,
|
|
259
263
|
subRegime: _latestBlackboxState?.sub_regime || classifyTurnSimple(latestUserIntent || ""),
|
|
@@ -18,6 +18,7 @@ import { SAVE_EST, WARN_ON_DIRECT, SOFT_QUOTA, FREE, MONITOR } from "../constant
|
|
|
18
18
|
const BYTES_PER_TOKEN = 4;
|
|
19
19
|
const CACHE_SAVED_PER_1M_INPUT_TOKENS = 0.10;
|
|
20
20
|
const DEBUG_INTERNALS = process.env.VIBEOS_DEBUG_INTERNALS === "1";
|
|
21
|
+
const IS_CLI_RUNTIME = Boolean(process.stdout?.isTTY || process.stderr?.isTTY || process.stdin?.isTTY);
|
|
21
22
|
function getVibeOSHome() {
|
|
22
23
|
return process.env.VIBEOS_HOME || join(process.env.HOME || "", ".claude");
|
|
23
24
|
}
|
|
@@ -451,8 +452,9 @@ export const onToolExecuteBefore = async (input, output) => {
|
|
|
451
452
|
const total = recordSaving(t, "credit<40% high-tier", _estOpus, { firstWord: _firstWord });
|
|
452
453
|
const trend = trendDisplay(readLifetimeSavings().sesTrend);
|
|
453
454
|
const msg = `⚠ [vibeOS] Credit: ${_credit}% — switching to medium saves ~$${_estOpus.toFixed(3)}/turn. Run \`trinity medium\`.`;
|
|
454
|
-
if (shouldLogWarn(`${t}|credit|${_tierWord}`))
|
|
455
|
+
if (shouldLogWarn(`${t}|credit|${_tierWord}`) && (!IS_CLI_RUNTIME || process.env.VIBEOS_DEBUG_DELEGATION === "1")) {
|
|
455
456
|
console.error(`[vibeOS] [delegation] ${msg}`);
|
|
457
|
+
}
|
|
456
458
|
pendingUiNote = msg;
|
|
457
459
|
return;
|
|
458
460
|
}
|
|
@@ -485,8 +487,9 @@ export const onToolExecuteBefore = async (input, output) => {
|
|
|
485
487
|
const total = recordSaving(t, "direct edit", _estEdit, { firstWord: _firstWord });
|
|
486
488
|
if (!compatibilityMode) {
|
|
487
489
|
const msg = `[vibeOS] ${_tierWord} tier direct ${t} — save ~$${_estEdit.toFixed(3)} by delegating to Task. Run \`trinity medium\`.`;
|
|
488
|
-
if (shouldLogWarn(`${t}|direct|${_tierWord}`))
|
|
490
|
+
if (shouldLogWarn(`${t}|direct|${_tierWord}`) && (!IS_CLI_RUNTIME || process.env.VIBEOS_DEBUG_DELEGATION === "1")) {
|
|
489
491
|
console.error(`[vibeOS] [delegation] ${msg}`);
|
|
492
|
+
}
|
|
490
493
|
pendingUiNote = msg;
|
|
491
494
|
return;
|
|
492
495
|
}
|