vibeostheog 0.25.21 → 0.25.22

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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.25.22
2
+ - fix: include installer helper in package
3
+
4
+
1
5
  ## 0.25.21
2
6
  - fix: stabilize OpenCode install resolution
3
7
 
@@ -1 +1 @@
1
- window.__VIBEOS_DASHBOARD_BASE__ = "http://127.0.0.1:49879";
1
+ window.__VIBEOS_DASHBOARD_BASE__ = "http://127.0.0.1:50016";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeostheog",
3
- "version": "0.25.21",
3
+ "version": "0.25.22",
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",
@@ -60,6 +60,7 @@
60
60
  "bin/setup.js",
61
61
  ".opencode/plugins/vibeOS-tui.tsx",
62
62
  "scripts/deploy.mjs",
63
+ "scripts/lib/**/*",
63
64
  "model-tiers.sample.json",
64
65
  "README.md",
65
66
  "CHANGELOG.md",
@@ -0,0 +1,49 @@
1
+ import { existsSync } from "node:fs"
2
+ import { dirname, join, resolve } from "node:path"
3
+ import { homedir } from "node:os"
4
+
5
+ function hasOpenCodeConfig(dir) {
6
+ return existsSync(join(dir, "opencode.json")) || existsSync(join(dir, "opencode.jsonc"))
7
+ }
8
+
9
+ function collectWorkspaceOpenCodeHomes(cwd) {
10
+ const homes = []
11
+ const seen = new Set()
12
+ let dir = resolve(cwd || process.cwd())
13
+ while (true) {
14
+ for (const candidate of [dir, join(dir, "opencode"), join(dir, ".opencode")]) {
15
+ if (seen.has(candidate)) continue
16
+ if (hasOpenCodeConfig(candidate)) {
17
+ seen.add(candidate)
18
+ homes.push(candidate)
19
+ }
20
+ }
21
+ const parent = dirname(dir)
22
+ if (parent === dir) break
23
+ dir = parent
24
+ }
25
+ return homes
26
+ }
27
+
28
+ function collectHomeOpenCodeHomes(baseHome) {
29
+ const home = baseHome || homedir()
30
+ const desktopHome = process.env.VIBEOS_OPENCODE_DESKTOP_HOME
31
+ || (process.platform === "darwin" ? join(home, "Library", "Application Support", "ai.opencode.desktop") : null)
32
+ return [desktopHome, join(home, ".config", "opencode"), join(home, ".opencode")].filter(Boolean)
33
+ }
34
+
35
+ export function resolveOpenCodeHomes({ cwd = process.cwd(), home = homedir() } = {}) {
36
+ const override = process.env.VIBEOS_OPENCODE_HOME
37
+ if (override) return [override]
38
+ const workspaceHomes = collectWorkspaceOpenCodeHomes(cwd)
39
+ if (workspaceHomes.length > 0) return workspaceHomes
40
+ const homeHomes = collectHomeOpenCodeHomes(home)
41
+ const activeHomeHomes = homeHomes.filter((dir) => existsSync(dir))
42
+ if (activeHomeHomes.length > 0) return activeHomeHomes
43
+ return homeHomes
44
+ }
45
+
46
+ export function resolveOpenCodeHome(opts = {}) {
47
+ const homes = resolveOpenCodeHomes(opts)
48
+ return homes[0] || join(opts.home || homedir(), ".config", "opencode")
49
+ }