vibeostheog 0.22.26 → 0.23.1
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/README.md +15 -8
- package/package.json +1 -1
- package/src/lib/hooks/footer.js +18 -25
- package/src/lib/pricing.js +11 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# vibeOS for OpenCode
|
|
2
2
|
|
|
3
|
-
Cost-aware control plane for OpenCode Desktop.
|
|
3
|
+
Cost-aware control plane for OpenCode Desktop.
|
|
4
|
+
|
|
5
|
+
> ## v0.23.0 — Disintegration Milestone
|
|
6
|
+
> Compact footer format: `🦠 brain | Deepseek | V4 Pro | $12.57 | VibeMaX ⚡ Budget`
|
|
7
|
+
> VibeMaX is now the default optimization mode. Model display names cleaned up (V4 Pro, Sonnet, 2.5 Flash).
|
|
8
|
+
> Install: `npx vibeostheog setup --project` or `npx vibeostheog setup`
|
|
9
|
+
Keeps expensive models on strategy, routes implementation to cheaper tiers, surfaces savings in real time.
|
|
4
10
|
|
|
5
11
|
For teams, vibeOS adds practical guardrails: delegation enforcement, flow and TDD controls, pattern learning, stress-aware routing, VibeBoX decision tracking, reporting, and remote API protection for the core algorithms.
|
|
6
12
|
|
|
@@ -51,7 +57,7 @@ Benchmarked on the DeepSeek v4 family. Prices based on 700 input + 300 output to
|
|
|
51
57
|
|
|
52
58
|
**Raw Brain** — v4 Pro (no framework). Baseline for all comparisons. 100% quality at 1.00x cost.
|
|
53
59
|
|
|
54
|
-
**VibeMaX (ML-Optimized, Default)** — Intelligent cost-quality sweet spot. Routes through v4 Flash (medium) and uses a random forest classifier (29 trees, gini-split, trained on telemetry) to decide each turn. Classifies on 11 derived features: message length, code block density, urgency, complexity, repetition, question ratio, and more. Benchmarked at ~75% of Brain quality at 18% of cost.
|
|
60
|
+
**VibeMaX (ML-Optimized, v0.23 Default)** — Intelligent cost-quality sweet spot. Routes through v4 Flash (medium) and uses a random forest classifier (29 trees, gini-split, trained on telemetry) to decide each turn. Classifies on 11 derived features: message length, code block density, urgency, complexity, repetition, question ratio, and more. Benchmarked at ~75% of Brain quality at 18% of cost.
|
|
55
61
|
|
|
56
62
|
**Budget** — DeepSeek Chat. Direct routing. ~40% quality at 0.00x cost. 100% savings.
|
|
57
63
|
|
|
@@ -92,7 +98,7 @@ Benchmarked on 1000 simulated questions across 20 runs, using model accuracies f
|
|
|
92
98
|
| Feature | What it does |
|
|
93
99
|
|---------|-------------|
|
|
94
100
|
| **Delegation enforcement** | Blocks write/edit on brain tier. Routes to medium or cheap. |
|
|
95
|
-
| **Live savings footer** |
|
|
101
|
+
| **Live savings footer** | Compact format: tier icon, provider, short model name, total savings, VibeBrand + mode. |
|
|
96
102
|
| **Web dashboard** | SolidJS SPA with SSE real-time push. Model split, savings, session history, trinity controls. |
|
|
97
103
|
| **Trinity runtime** | Switch tiers mid-session. Change optimization mode. Flow/TDD/enforcement toggles. |
|
|
98
104
|
| **Flow enforcer** | Pattern-rule checks on write/edit. Extracts TODO/FIXME into append-only queue. |
|
|
@@ -147,8 +153,9 @@ To use **MagicCoder:7b** or other local models with vibeOS and OpenCode Desktop:
|
|
|
147
153
|
## Install
|
|
148
154
|
|
|
149
155
|
```bash
|
|
150
|
-
npx vibeostheog setup --project
|
|
151
|
-
npx vibeostheog setup
|
|
156
|
+
npx vibeostheog setup --project # per-project
|
|
157
|
+
npx vibeostheog setup # global ~/.config/opencode/
|
|
158
|
+
npx vibeostheog setup --help # full usage
|
|
152
159
|
```
|
|
153
160
|
|
|
154
161
|
One-command setup: deploys plugin files and registers in opencode.json. Restart OpenCode Desktop.
|
|
@@ -193,10 +200,10 @@ Local dev checkout:
|
|
|
193
200
|
## Live Footer
|
|
194
201
|
|
|
195
202
|
```
|
|
196
|
-
—
|
|
203
|
+
— 🦠 brain | Deepseek | V4 Pro | $12.57 | VibeMaX ⚡ Budget
|
|
197
204
|
```
|
|
198
205
|
|
|
199
|
-
|
|
206
|
+
Tier icon + lowercase quality (🦠 brain / ⚙ medium / ⚡ cheap), provider label, cleaned model name, total savings, VibeBrand + flash icon + mode. Persisted in ~/.claude/delegation-state.json.
|
|
200
207
|
|
|
201
208
|
## Architecture
|
|
202
209
|
|
|
@@ -237,7 +244,7 @@ Regime -> mode mapping via syncControlSettings():
|
|
|
237
244
|
|
|
238
245
|
| Regime | Mode | Enforce | Flow | TDD | Tier | Think |
|
|
239
246
|
|--------|------|---------|------|-----|------|-------|
|
|
240
|
-
| INIT / DIVERGENT / EXPLORING / REFINING |
|
|
247
|
+
| INIT / DIVERGENT / EXPLORING / REFINING | vibemax (default) | relaxed | audit | lazy | cheap | off |
|
|
241
248
|
| CONVERGING / CLOSED | quality | strict | strict | quality | brain | full |
|
|
242
249
|
| LOOPING | speed | relaxed | audit | lazy | medium | off |
|
|
243
250
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibeostheog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.1",
|
|
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/hooks/footer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { readFileSync, appendFileSync, mkdirSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { classify, _refreshModel, readConfig, resolveDisplayModelId, TRINITY_BRAIN, TRINITY_MEDIUM, TRINITY_CHEAP, shortModelName, roundUsd, formatUsd, resolveExecutionIdentity,
|
|
4
|
+
import { classify, _refreshModel, readConfig, resolveDisplayModelId, TRINITY_BRAIN, TRINITY_MEDIUM, TRINITY_CHEAP, shortModelName, roundUsd, formatUsd, resolveExecutionIdentity, modelDisplayName } from "../pricing.js";
|
|
5
5
|
import { latestUserIntent } from "./chat-transform.js";
|
|
6
6
|
import { scoreStress, resolveEnforcementMode, detectOutcomeSignal, getBlackboxTracker, syncOutcomeToApi, loadOptimizationMode, classifyTurnSimple } from "../turn-classify.js";
|
|
7
7
|
import { peekBudgetFirstMode, recordBudgetFirstOutcome } from "../mode-policy.js";
|
|
@@ -23,15 +23,15 @@ let _cachedAutoMode = null;
|
|
|
23
23
|
let _cachedAutoModeTs = 0;
|
|
24
24
|
const AUTO_CACHE_TTL = 60000;
|
|
25
25
|
const DEFAULT_REGIME_MAP = {
|
|
26
|
-
LOOPING: "
|
|
27
|
-
EXPLORING: "
|
|
28
|
-
REFINING: "
|
|
26
|
+
LOOPING: "vibemax", DIVERGENT: "vibemax",
|
|
27
|
+
EXPLORING: "vibemax", INIT: "vibemax",
|
|
28
|
+
REFINING: "vibemax",
|
|
29
29
|
CONVERGING: "quality", CLOSED: "quality",
|
|
30
30
|
};
|
|
31
31
|
function regimeToMode(regime, stress) {
|
|
32
32
|
if (stress > 1.5)
|
|
33
33
|
return "quality";
|
|
34
|
-
return DEFAULT_REGIME_MAP[regime] || "
|
|
34
|
+
return DEFAULT_REGIME_MAP[regime] || "vibemax";
|
|
35
35
|
}
|
|
36
36
|
async function apiAutoSelectMode(regime, stress) {
|
|
37
37
|
const now = Date.now();
|
|
@@ -58,6 +58,7 @@ const SAVINGS_LEDGER_FILE = join(getVibeOSHome(), "savings-ledger.jsonl");
|
|
|
58
58
|
let _prevOutputText = "";
|
|
59
59
|
let _autoReportCount = 0;
|
|
60
60
|
const textCompletePainted = new Set();
|
|
61
|
+
let _lastStrippedText = "";
|
|
61
62
|
function loadSelection() {
|
|
62
63
|
try {
|
|
63
64
|
const raw = readFileSync(join(getVibeOSHome(), "model-tiers.json"), "utf-8");
|
|
@@ -269,7 +270,6 @@ async function _appendFooter(input, output, directory) {
|
|
|
269
270
|
enfSuffixFooter = ` QA:${Math.round(quality_avg)}% ${enfTagsFooter.join(" ")}`;
|
|
270
271
|
}
|
|
271
272
|
// Optimization mode resolver — keep the dopamine footer format.
|
|
272
|
-
const flashIcon = isApiConnected() ? "⚡" : "";
|
|
273
273
|
const resolvedMode = peekBudgetFirstMode({
|
|
274
274
|
requestedMode: optModeFooter,
|
|
275
275
|
subRegime: _latestBlackboxState?.sub_regime || classifyTurnSimple(latestUserIntent || ""),
|
|
@@ -278,29 +278,21 @@ async function _appendFooter(input, output, directory) {
|
|
|
278
278
|
const stripped = text.replace(/— .+?VIBE[^—]*—\s*/g, "").trimEnd();
|
|
279
279
|
if (stripped !== text)
|
|
280
280
|
return;
|
|
281
|
+
if (stripped === _lastStrippedText)
|
|
282
|
+
return;
|
|
281
283
|
const ltTotal = ltTasks + ltCache;
|
|
284
|
+
const modeCapitalized = (mode) => mode.charAt(0).toUpperCase() + mode.slice(1);
|
|
282
285
|
const optMode = (resolvedMode || "budget").toLowerCase();
|
|
283
|
-
const
|
|
284
|
-
|
|
286
|
+
const vibeBrand = optMode === "vibemax" ? "VibeMaX" : optMode === "vibeultrax" ? "VibeUltraX" : optMode === "quality" ? "VibeQMaX" : "VibeMaX";
|
|
287
|
+
const modeLabel = modeCapitalized(optMode);
|
|
288
|
+
const qualityIcon = execution.quality === "brain" ? "🧠" : execution.quality === "medium" ? "⚙" : "⚡";
|
|
289
|
+
const flashIcon = isApiConnected() ? " ⚡" : "";
|
|
290
|
+
let vibeLine = `— ${qualityIcon} ${execution.quality} | ${execution.provider_label} | ${modelDisplayName(execution.model)}`;
|
|
285
291
|
if (ltTotal > 0) {
|
|
286
|
-
vibeLine += ` | $${formatUsd(ltTotal)}
|
|
287
|
-
}
|
|
288
|
-
if (sesRatePerHour > 0) {
|
|
289
|
-
vibeLine += ` | pace $${formatUsd(sesRatePerHour)}/hr`;
|
|
290
|
-
}
|
|
291
|
-
if (stableStreak > 0) {
|
|
292
|
-
vibeLine += ` | streak ${stableStreak}`;
|
|
293
|
-
}
|
|
294
|
-
else if (problemStreak > 0) {
|
|
295
|
-
vibeLine += ` | recovery ${problemStreak}`;
|
|
292
|
+
vibeLine += ` | $${formatUsd(ltTotal)}`;
|
|
296
293
|
}
|
|
297
|
-
if (
|
|
298
|
-
vibeLine += ` | ${
|
|
299
|
-
vibeLine += enfSuffixFooter;
|
|
300
|
-
vibeLine += ` | VIBE${flashIcon ? " ⚡" : ""}`;
|
|
301
|
-
if (_footerStress > 0.4) {
|
|
302
|
-
const stressLabel = _footerStress > 0.7 ? "high" : "elevated";
|
|
303
|
-
vibeLine += ` · ${stressLabel}`;
|
|
294
|
+
if (isApiConnected()) {
|
|
295
|
+
vibeLine += ` | ${vibeBrand}${flashIcon} ${modeLabel}`;
|
|
304
296
|
}
|
|
305
297
|
const footerText = stripped + `\n\n${vibeLine} —`;
|
|
306
298
|
if (_blackboxEnabled) {
|
|
@@ -354,6 +346,7 @@ async function _appendFooter(input, output, directory) {
|
|
|
354
346
|
obj.text = text;
|
|
355
347
|
}
|
|
356
348
|
_setFooter(output, footerText);
|
|
349
|
+
_lastStrippedText = stripped;
|
|
357
350
|
// CLI/pipe mode: stdout is already rendered, write footer to stderr
|
|
358
351
|
if (!process.stdout?.isTTY) {
|
|
359
352
|
console.error(`\n${vibeLine} —`);
|
package/src/lib/pricing.js
CHANGED
|
@@ -255,6 +255,17 @@ export function shortModelName(modelId) {
|
|
|
255
255
|
const parts = raw.split("/");
|
|
256
256
|
return parts[parts.length - 1] || raw;
|
|
257
257
|
}
|
|
258
|
+
const MODEL_DISPLAY_PREFIXES = /^(deepseek|claude|gemini|gpt|davinci|llama|qwq|qwen)-/i;
|
|
259
|
+
export function modelDisplayName(modelId) {
|
|
260
|
+
const short = shortModelName(modelId);
|
|
261
|
+
const cleaned = short.replace(MODEL_DISPLAY_PREFIXES, "");
|
|
262
|
+
if (!cleaned)
|
|
263
|
+
return short;
|
|
264
|
+
return cleaned
|
|
265
|
+
.split(/[-_]/)
|
|
266
|
+
.map(w => w.charAt(0).toUpperCase() + w.slice(1))
|
|
267
|
+
.join(" ");
|
|
268
|
+
}
|
|
258
269
|
export function trendDisplay(sesTrend) {
|
|
259
270
|
const t = sesTrend === "up" || sesTrend === "down" ? sesTrend : "stable";
|
|
260
271
|
const icon = t === "up" ? "↑" : t === "down" ? "↓" : "→";
|