vibeostheog 0.24.25 → 0.24.26

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.
Files changed (2) hide show
  1. package/dist/vibeOS.js +29 -5
  2. package/package.json +1 -1
package/dist/vibeOS.js CHANGED
@@ -3489,9 +3489,30 @@ function runStartupMaintenanceOnce() {
3489
3489
  } catch {
3490
3490
  }
3491
3491
  }
3492
+ function _ensureVibeOSHomeDir() {
3493
+ try {
3494
+ if (!existsSync5(VIBEOS_HOME)) {
3495
+ mkdirSync3(VIBEOS_HOME, { recursive: true });
3496
+ return VIBEOS_HOME;
3497
+ }
3498
+ const st = statSync4(VIBEOS_HOME);
3499
+ if (!st.isDirectory()) {
3500
+ const backup = VIBEOS_HOME + ".backup." + Date.now();
3501
+ renameSync3(VIBEOS_HOME, backup);
3502
+ mkdirSync3(VIBEOS_HOME, { recursive: true });
3503
+ }
3504
+ return VIBEOS_HOME;
3505
+ } catch {
3506
+ return VIBEOS_HOME;
3507
+ }
3508
+ }
3492
3509
  function _handleStateCorruption2(path) {
3510
+ _ensureVibeOSHomeDir();
3493
3511
  const backupDir = join4(VIBEOS_HOME, ".backups");
3494
- mkdirSync3(backupDir, { recursive: true });
3512
+ try {
3513
+ mkdirSync3(backupDir, { recursive: true });
3514
+ } catch {
3515
+ }
3495
3516
  const backupPath = join4(backupDir, basename2(path) + ".corrupted." + Date.now());
3496
3517
  try {
3497
3518
  copyFileSync(path, backupPath);
@@ -4478,8 +4499,9 @@ function touchProjectBucket(state, fp2, meta = {}) {
4478
4499
  if (!bucket.sessions.includes(meta.sessionId)) {
4479
4500
  bucket.sessions.push(meta.sessionId);
4480
4501
  bucket.sessions = bucket.sessions.slice(-30);
4502
+ bucket.totalSessions = Number(bucket.totalSessions || 0) + 1;
4481
4503
  }
4482
- bucket.totalSessions = Math.max(Number(bucket.totalSessions || 0), bucket.sessions.length);
4504
+ bucket.totalSessions = Math.max(Number(bucket.totalSessions || 0), bucket.sessions.length, 1);
4483
4505
  }
4484
4506
  if (typeof meta.reportId === "string" && meta.reportId.trim()) {
4485
4507
  bucket.reports ??= [];
@@ -7763,10 +7785,10 @@ function generateReportId(type, fp2) {
7763
7785
  return `${ts}-${(fp2 || "unknown").slice(0, 6)}-${type}-${rnd}`;
7764
7786
  }
7765
7787
  var _reportDedupWindow = /* @__PURE__ */ new Map();
7766
- function _wouldBeDuplicate(type, summary) {
7788
+ function _wouldBeDuplicate(type, summary, scope) {
7767
7789
  if (typeof summary !== "string")
7768
7790
  return false;
7769
- const key = `${getVibeOSHome7()}::${type || ""}::${summary}`;
7791
+ const key = `${getVibeOSHome7()}::${type || ""}::${String(scope || "unknown")}::${summary}`;
7770
7792
  const last = _reportDedupWindow.get(key);
7771
7793
  if (last && Date.now() - last < 5 * 60 * 1e3)
7772
7794
  return true;
@@ -7849,7 +7871,8 @@ function saveReport({ type = "manual", summary = "", findings = null, metrics =
7849
7871
  const metricsSessionId = typeof metricsObject.sessionId === "string" && metricsObject.sessionId.trim() ? metricsObject.sessionId.trim() : "";
7850
7872
  const metricsProjectName = typeof metricsObject.projectName === "string" && metricsObject.projectName.trim() ? metricsObject.projectName.trim() : "";
7851
7873
  const metricsProjectFingerprint = typeof metricsObject.projectFingerprint === "string" && metricsObject.projectFingerprint.trim() ? metricsObject.projectFingerprint.trim() : "";
7852
- if (_wouldBeDuplicate(type, summary))
7874
+ const dedupScope = fingerprint || metricsProjectFingerprint || currentProjectFingerprint || currentProjectFingerprint2 || metricsProjectName || currentProjectName || currentProjectName2 || "unknown";
7875
+ if (_wouldBeDuplicate(type, summary, dedupScope))
7853
7876
  return null;
7854
7877
  if (!currentProjectFingerprint2 && metricsProjectFingerprint)
7855
7878
  currentProjectFingerprint2 = metricsProjectFingerprint;
@@ -13745,6 +13768,7 @@ ${argsJson}
13745
13768
  }
13746
13769
  pendingUiNote = `[delegation] This is a good candidate for a Task subagent \u2014 ${resolveTierIcon("brain")} brain handles orchestration, let cheaper tiers do the write/edit. Switch to ${resolveTierIcon("medium")} medium with \`trinity medium\` if you'd rather do it directly.`;
13747
13770
  enforcementBlocked = true;
13771
+ _mutateBlockedToolArgs(t, argSources, originalPath, output);
13748
13772
  if (shouldLogWarn(`${t}|enforced|${_tierWord}`))
13749
13773
  console.error(`[vibeOS] [enforcement] BLOCKED direct ${t} on high tier \u2192 delegate via Task`);
13750
13774
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeostheog",
3
- "version": "0.24.25",
3
+ "version": "0.24.26",
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",