vibeostheog 0.24.2 → 0.24.3

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Cost-aware control plane for OpenCode Desktop.
4
4
 
5
- > ## v0.23.61 — Return
5
+ > ## v0.24.0 — Return
6
6
  > Compact footer format: `🦠 brain | Deepseek | V4 Pro | $12.57 | VibeMaX ⚡ Budget`
7
7
  > VibeMaX is now the default optimization mode. Model display names cleaned up (V4 Pro, Sonnet, 2.5 Flash).
8
8
  > Install: `npx vibeostheog setup --project` or `npx vibeostheog setup`
package/dist/vibeOS.js CHANGED
@@ -436,7 +436,7 @@ function autoSelectMode(subRegime, stressMultiplier) {
436
436
  if (regime === "LOOPING") return "speed";
437
437
  if (regime === "CONVERGING" || regime === "CLOSED") return "quality";
438
438
  if (stressMultiplier && stressMultiplier > QUALITY_STRESS_THRESHOLD) return "quality";
439
- return "vibelitex";
439
+ return "litex";
440
440
  }
441
441
  var REGIME_CONTROL, DEFAULT_CONTROL, QUALITY_STRESS_THRESHOLD;
442
442
  var init_meta_controller = __esm({
@@ -6074,9 +6074,22 @@ function classifyTurnSimple(userText) {
6074
6074
  if (/(inject|exploit|penetration|cve|attack|threat|encrypt|forensic|research|deep analysis|investigate|root cause|reverse engineer|disassemble|memory dump|core dump)/i.test(lower)) {
6075
6075
  return "FORENSIC";
6076
6076
  }
6077
- if (/^(how|what|why|when|where|who|can you|could you|tell me|explain|describe|show|list|check|is there|are there|does|do you|summarize|elaborate|clarify|inspect|trace|find|search|look|read|show me|dump)/i.test(lower)) {
6077
+ const IMPL_VERBS = "fix|write|create|build|implement|change|edit|modify|update|refactor|generate|delete|remove|migrate|deploy|commit|push";
6078
+ if (new RegExp("^(can you|could you|tell me|we should|we need to|please) (" + IMPL_VERBS + ")\\b", "i").test(lower)) {
6079
+ return "REFINING";
6080
+ }
6081
+ if (new RegExp("^I (need|want|would like) to (" + IMPL_VERBS + ")\\b", "i").test(lower)) {
6082
+ return "REFINING";
6083
+ }
6084
+ if (/^(the |there is |there are |i think |looks like |seems like |i see |why (is|are|does|did) )/.test(lower)) {
6085
+ return "EXPLORING";
6086
+ }
6087
+ if (/^(how|what|why|when|where|who|can you|could you|let me|tell me|explain|describe|show|list|check|is there|are there|does|do you|summarize|elaborate|clarify|inspect|trace|find|search|look|read|show me|dump|debug)/i.test(lower)) {
6078
6088
  return "EXPLORING";
6079
6089
  }
6090
+ if (new RegExp("\\b(" + IMPL_VERBS + ")\\b", "i").test(lower)) {
6091
+ return "REFINING";
6092
+ }
6080
6093
  if (/^(write|create|add|build|implement|fix|change|edit|modify|update|refactor|generate|make|commit|push|deploy|release|publish|install|remove|delete|rename|move|copy|transform|convert|migrate)/i.test(lower)) {
6081
6094
  return "REFINING";
6082
6095
  }
@@ -6128,6 +6141,21 @@ function isLikelyOffTopic(userText, job) {
6128
6141
  }
6129
6142
 
6130
6143
  // src/lib/turn-classify.ts
6144
+ function classifyTurnSimple2(userText) {
6145
+ return classifyTurnSimple(userText);
6146
+ }
6147
+ async function classifyTurnRemote(text) {
6148
+ try {
6149
+ const client2 = getApiClient2();
6150
+ if (!client2 || isApiFallback()) return classifyTurnSimple(text);
6151
+ const res = await client2.classifyQuery(text);
6152
+ if (res && typeof res === "object" && "sub_regime" in res) {
6153
+ return res.sub_regime;
6154
+ }
6155
+ } catch {
6156
+ }
6157
+ return classifyTurnSimple(text);
6158
+ }
6131
6159
  function getVibeOSHome5() {
6132
6160
  return process.env.VIBEOS_HOME || join7(process.env.HOME || "", ".claude");
6133
6161
  }
@@ -6190,7 +6218,9 @@ function computeControlVector2(_state, _action, _optimizationMode) {
6190
6218
  wbp_verbosity: isStrict ? "verbose" : isRelaxed ? "minimal" : "normal",
6191
6219
  agent_mode: (subRegime === "REFINING" || subRegime === "CONVERGING" || subRegime === "CLOSED") && stress <= QUALITY_STRESS_THRESHOLD2 ? "plan" : void 0,
6192
6220
  optimization_mode: mode,
6193
- directives: []
6221
+ directives: isRelaxed && (subRegime === "EXPLORING" || subRegime === "INIT" || subRegime === "AUDIT" || subRegime === "FORENSIC" || subRegime === "LOOPING") ? [
6222
+ `[speed guard] VERIFY BEFORE ACT - Speed-oriented mode "${mode}" is active and user intent is ${subRegime}. Before modifying files or executing commands, first verify the current state. When a request is ambiguous between "check and report" vs "fix", always choose CHECK FIRST. Treat "look at", "check", "investigate", "tell me about" as requests for information, not action items.`
6223
+ ] : []
6194
6224
  };
6195
6225
  }
6196
6226
  function buildControlHistoryEntry2(turn, regime, control, reward = null) {
@@ -9359,9 +9389,6 @@ function recordSaving(tool2, reason, saveEst, meta = {}) {
9359
9389
  }
9360
9390
  }
9361
9391
  const ses = s.sessions[sid];
9362
- ses.total_savings_usd = roundUsd(Number(ses.total_savings_usd || 0) + saveEst);
9363
- s.lifetime.total_savings_usd = roundUsd(Number(s.lifetime.total_savings_usd || 0) + saveEst);
9364
- s.lifetime.warn_count = (s.lifetime.warn_count || 0) + 1;
9365
9392
  if (reason && firstWord) {
9366
9393
  const now = Date.now();
9367
9394
  const warnKey = `${_OC_SID}:${firstWord}`;
@@ -9371,13 +9398,13 @@ function recordSaving(tool2, reason, saveEst, meta = {}) {
9371
9398
  const w = ses.warns[i];
9372
9399
  if (w?.key === warnKey && now - w.ts < WARN_DEDUPE_WINDOW_MS) {
9373
9400
  w.count = (w.count || 1) + 1;
9374
- w.reason = reason;
9375
- w.saveEst = (w.saveEst || 0) + saveEst;
9376
- w.est_savings_usd = (w.est_savings_usd || 0) + saveEst;
9377
9401
  deduped = true;
9378
9402
  }
9379
9403
  }
9380
9404
  if (!deduped) {
9405
+ ses.total_savings_usd = roundUsd(Number(ses.total_savings_usd || 0) + saveEst);
9406
+ s.lifetime.total_savings_usd = roundUsd(Number(s.lifetime.total_savings_usd || 0) + saveEst);
9407
+ s.lifetime.warn_count = (s.lifetime.warn_count || 0) + 1;
9381
9408
  ses.warns.push({ key: warnKey, reason, saveEst, est_savings_usd: saveEst, firstWord, ts: now, count: 1, tool: tool2 });
9382
9409
  }
9383
9410
  if (!ses.seenWarnKeys[warnKey]) {
@@ -9713,6 +9740,7 @@ function syncControlSettings(cv, options = {}) {
9713
9740
  }
9714
9741
  writeIf("enabled", true);
9715
9742
  const compatibilityMode = currentSel.onboarding_mode === "assist";
9743
+ writeIf("delegation_enforce", compatibilityMode ? cv.enforcement_mode === "strict" : cv.enforcement_mode !== "relaxed");
9716
9744
  if (compatibilityMode) {
9717
9745
  writeIf("flow_enabled", cv.flow_mode === "strict");
9718
9746
  writeIf("flow_enforce", cv.flow_mode === "strict");
@@ -10024,15 +10052,16 @@ var onSystemTransform = async (_input, output) => {
10024
10052
  if (typeof userText === "string" && userText.trim()) latestUserIntent = userText;
10025
10053
  else if (!latestUserIntent) latestUserIntent = null;
10026
10054
  if (latestUserIntent) observeUserCorrection(latestUserIntent);
10055
+ const classifiedRegime = _latestBlackboxState3?.sub_regime || (latestUserIntent ? await classifyTurnRemote(latestUserIntent) : "INIT");
10027
10056
  const optimizationSuggestion = await selectOptimizationModeRemote(
10028
- _latestBlackboxState3?.sub_regime || (latestUserIntent ? classifyTurnSimple(latestUserIntent) : "INIT"),
10057
+ classifiedRegime,
10029
10058
  latestUserIntent ? scoreStress(latestUserIntent) : 0,
10030
10059
  loadOptimizationMode()
10031
10060
  );
10032
10061
  const optimizationDecision = applyBudgetFirstMode({
10033
10062
  requestedMode: loadOptimizationMode(),
10034
10063
  suggestedMode: optimizationSuggestion,
10035
- subRegime: _latestBlackboxState3?.sub_regime || (latestUserIntent ? classifyTurnSimple(latestUserIntent) : "INIT"),
10064
+ subRegime: classifiedRegime,
10036
10065
  stress: latestUserIntent ? scoreStress(latestUserIntent) : 0,
10037
10066
  nInteractions: _latestBlackboxState3?.n_interactions ?? 0
10038
10067
  });
@@ -10046,7 +10075,7 @@ var onSystemTransform = async (_input, output) => {
10046
10075
  } else if (latestUserIntent) {
10047
10076
  const st = scoreStress(latestUserIntent);
10048
10077
  _controlVector = await apiComputeControlVector({
10049
- sub_regime: classifyTurnSimple(latestUserIntent),
10078
+ sub_regime: classifiedRegime,
10050
10079
  latest_stress_multiplier: st || void 0
10051
10080
  }, void 0, optimizationMode);
10052
10081
  }
@@ -10207,7 +10236,7 @@ var onSystemTransform = async (_input, output) => {
10207
10236
  }
10208
10237
  const calDir = getVibeOSHome9();
10209
10238
  const calFile = join14(calDir, "calibration-data.jsonl");
10210
- const regime2 = _latestBlackboxState3?.sub_regime || classifyTurnSimple(latestUserIntent || "");
10239
+ const regime2 = _latestBlackboxState3?.sub_regime || classifyTurnSimple2(latestUserIntent || "");
10211
10240
  const calRecord = JSON.stringify({
10212
10241
  ts: (/* @__PURE__ */ new Date()).toISOString(),
10213
10242
  sid: _OC_SID4,
@@ -10527,7 +10556,7 @@ async function _appendFooter(input, output, directory3) {
10527
10556
  });
10528
10557
  const resolvedMode = peekBudgetFirstMode({
10529
10558
  requestedMode: optModeFooter,
10530
- subRegime: _latestBlackboxState?.sub_regime || classifyTurnSimple(latestUserIntent || ""),
10559
+ subRegime: _latestBlackboxState?.sub_regime || classifyTurnSimple2(latestUserIntent || ""),
10531
10560
  stress: _footerStress
10532
10561
  }).mode;
10533
10562
  const stripped = text.replace(/\u2014 [^\u2014]+ \u2014\s*/g, "").trimEnd();
@@ -10564,7 +10593,7 @@ ${vibeLine}`;
10564
10593
  if (outcome) {
10565
10594
  recordBudgetFirstOutcome({
10566
10595
  outcome,
10567
- subRegime: _latestBlackboxState?.sub_regime || classifyTurnSimple(latestUserIntent || ""),
10596
+ subRegime: _latestBlackboxState?.sub_regime || classifyTurnSimple2(latestUserIntent || ""),
10568
10597
  stress: _footerStress
10569
10598
  });
10570
10599
  const tracker = getBlackboxTracker();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeostheog",
3
- "version": "0.24.2",
3
+ "version": "0.24.3",
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",