vibeostheog 0.15.23 → 0.16.0
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 +15 -0
- package/README.md +121 -232
- package/package.json +1 -1
- package/src/index.js +926 -860
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## 0.16.0
|
|
2
|
+
- feat: dopamine-style footer + natural language system directives
|
|
3
|
+
- feat: dopamine-style footer + natural language system directives
|
|
4
|
+
- feat: turn-aware compaction directive at turn 7+
|
|
5
|
+
- feat: add forensic/web-research modes + 1084-datapoint benchmark
|
|
6
|
+
- fix: flash icon only when API connected, unified [VIBE→MODE⚡] format
|
|
7
|
+
- docs: Security section + Context7 cost optimization docs
|
|
8
|
+
- docs: add Security section with API token emphasis and Context7 cost optimization docs
|
|
9
|
+
- docs: persist all benchmark data + compaction research
|
|
10
|
+
- docs: reformat README as user-facing PM doc, move internals to AGENTS.md, cleanup .gitignore
|
|
11
|
+
Merge pull request #35 from DrunkkToys/refactor/simplify-chat-transform
|
|
12
|
+
readme: center VIBE autoswitching as the core value proposition
|
|
13
|
+
Revert "fix: add system prompt cache savings tracking"
|
|
14
|
+
|
|
15
|
+
|
|
1
16
|
## 0.15.23
|
|
2
17
|
- feat: add trinity api-token command to inject VIBEOS_API_TOKEN
|
|
3
18
|
|
package/README.md
CHANGED
|
@@ -1,286 +1,175 @@
|
|
|
1
1
|
# vibeOS for OpenCode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
VIBE is a smart model router for OpenCode Desktop. It automatically selects and switches between brain, medium, and cheap model tiers based on the task at hand — expensive models handle orchestration while cost-effective models execute implementation work. No manual slot-picking needed.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The core is the VIBE autoswitcher: a decision engine that routes each request to the right tier based on context, enforcement policy, and session state. You stay in control via the `trinity` tool set, but the default workflow is zero-config.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Beyond routing, vibeOS tracks savings from tier-switching, enforces delegation policies, and provides real-time visibility through a live status footer and web dashboard.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Savings Categories
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- Tracks estimated savings from delegation warnings and enforcement events.
|
|
14
|
-
- Tracks cache savings as a separate persisted category when scratchpad cache hits are observed.
|
|
15
|
-
- Adds a live footer to assistant outputs with model split, cumulative savings, and trend arrow.
|
|
16
|
-
- Provides `trinity` runtime controls for slot switching, enforcement toggles, audits, and diagnostics.
|
|
17
|
-
- Adds per-session model locking: prevents the plugin from auto-switching models when the user changes the model in the OpenCode GUI (`trinity lock on|off`).
|
|
18
|
-
- Adds optional flow checks and TDD skeleton enforcement.
|
|
19
|
-
- Adds project guard: ensures AGENTS.md and README.md exist and stay protected in every project.
|
|
20
|
-
- Adds report and research-audit tooling.
|
|
21
|
-
- Learns recurring struggle and routine patterns per project, with `trinity patterns` inspection and `trinity patterns clear`.
|
|
22
|
-
- Stress mitigation pipeline: detects user stress signals, shows live stress gauge in footer, injects protective system prompts, and upgrades Task tier when user is stressed.
|
|
23
|
-
- vibeOS MCP server with HTTP API for extended tool capabilities (trinity, reports, session metrics, diagnostics).
|
|
24
|
-
- TUI dashboard sidebar plugin for real-time plugin status and controls.
|
|
25
|
-
- **Web dashboard** — SolidJS SPA served via standalone server (`npm run dashboard`) or embedded in the MCP server. Real-time SSE push updates at `http://127.0.0.1:3333`.
|
|
26
|
-
- Worker-to-Brain (WBP) protocol synthesizes delegated task output directly in assistant chat.
|
|
27
|
-
- **Remote API protection**: Core algorithms run on a self-hosted API server (`api.vibetheog.com`) with token-based authentication. Non-paying seats can be deactivated, immediately revoking all API tokens and falling back to local degraded mode.
|
|
28
|
-
|
|
29
|
-
## Remote API Protection
|
|
30
|
-
|
|
31
|
-
vibeOS protects its core algorithms by serving them from a self-hosted API server rather than bundling them entirely in the plugin:
|
|
32
|
-
|
|
33
|
-
| Algorithm | Endpoint | Description |
|
|
34
|
-
|---|---|---|---|
|
|
35
|
-
| Delegation enforcement | `POST /api/v1/delegate/check` | Model cost calculation, block/warn routing |
|
|
36
|
-
| Model tier routing | `POST /api/v1/route/model` | Tier classification, stress-aware routing |
|
|
37
|
-
| Stress scoring | `POST /api/v1/stress/score` | NLP stress signal detection |
|
|
38
|
-
| Blackbox engine | `POST /api/v1/blackbox/analyze` | Dialogue trajectory, loop detection, pivot/switch, outcome tracking |
|
|
39
|
-
| Blackbox calibration | `POST /api/v1/blackbox/calibrate` | Auto-tune thresholds from session outcomes |
|
|
40
|
-
| Blackbox calibration state | `GET /api/v1/blackbox/calibration` | Read calibrated weights per project |
|
|
41
|
-
| Blackbox outcome | `POST /api/v1/blackbox/outcome` | Record session satisfaction outcome |
|
|
42
|
-
| Blackbox project sessions | `GET /api/v1/blackbox/project-sessions` | List cross-session history per project |
|
|
43
|
-
| TDD skeleton gen | `POST /api/v1/tdd/skeleton` | Multi-language test generation |
|
|
44
|
-
| Pattern learner | `POST /api/v1/patterns/observe` | Friction/routine detection |
|
|
45
|
-
| Model pricing | `POST /api/v1/pricing/fetch` | Dynamic OpenRouter pricing cache |
|
|
46
|
-
| Context compression | `POST /api/v1/compress/context` | Bullet-point extraction |
|
|
47
|
-
|
|
48
|
-
### Environment Variables
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
VIBEOS_API_URL=https://api.vibetheog.com # API server URL (default: https://api.vibetheog.com)
|
|
52
|
-
VIBEOS_API_TOKEN=vos_... # Your API token (required for remote mode)
|
|
53
|
-
VIBEOS_API_ENABLED=true # Set to "false" to use local-only mode
|
|
54
|
-
CLAUDE_CREDIT_PERCENT=150 # Override credit percentage (default: 100)
|
|
55
|
-
CLAUDE_CONTEXT7_AVAILABLE=true # Set to enable context7 cost optimization
|
|
56
|
-
CLAUDE_SCRATCHPAD_MAX_AGE_SEC=86400 # Scratchpad cache lifetime in seconds
|
|
57
|
-
VIBEOS_MCP_PORT=3001 # MCP server port (default: 3001)
|
|
58
|
-
```
|
|
11
|
+
- **Delegation savings** — Estimated cost avoided by routing tasks to cheaper models.
|
|
12
|
+
- **Cache savings** — Cost avoided from scratchpad cache hits.
|
|
59
13
|
|
|
60
|
-
|
|
14
|
+
Both are summed in the live footer and persisted in \`~/.claude/delegation-state.json\` across sessions.
|
|
61
15
|
|
|
62
|
-
|
|
16
|
+
## What It Does
|
|
63
17
|
|
|
64
|
-
|
|
18
|
+
- **Smart delegation** — Blocks direct write/edit on high-tier models and routes work to cheaper subagents
|
|
19
|
+
- **Cost tracking** — Tracks estimated savings from delegation events and cache hits, displayed in a live footer
|
|
20
|
+
- **trinity commands** — Runtime controls for model switching, enforcement toggles, audits, and diagnostics
|
|
21
|
+
- **Flow enforcer** — Validates write/edit patterns against project rules; optionally extracts TODOs/FIXMEs
|
|
22
|
+
- **TDD enforcer** — Auto-creates test skeletons for changed source files; strict mode makes TODO tests fail loudly
|
|
23
|
+
- **Project guard** — Protects AGENTS.md and README.md in every project with auto-regeneration
|
|
24
|
+
- **Pattern learner** — Detects recurring friction and routine patterns per project, surfaces via `trinity patterns`
|
|
25
|
+
- **Stress mitigation** — Detects user stress signals, adjusts tier routing, and injects protective prompts
|
|
26
|
+
- **Model locking** — Prevents auto-switching when model is changed in the OpenCode GUI (`trinity lock`)
|
|
27
|
+
- **Report & audit** — `report-save`, `report-list`, `report-read`, and `research-audit` tools
|
|
28
|
+
- **Worker-to-Brain protocol** — Delegates implementation tasks to cheaper subagents, synthesizes results in-chat
|
|
29
|
+
- **Web dashboard** — Real-time status, savings, stress gauge, and controls via browser
|
|
30
|
+
- **TUI sidebar** — Plugin status and controls via OpenCode sidebar plugin
|
|
31
|
+
- **Blackbox decision engine** — Dialogue trajectory tracking with loop prevention, pivot detection, and outcome tracking
|
|
65
32
|
|
|
66
|
-
|
|
67
|
-
`POST /admin/seats` with `{ "name": "...", "email": "...", "with_token": "label" }`
|
|
33
|
+
## Install
|
|
68
34
|
|
|
69
|
-
|
|
70
|
-
`PATCH /admin/seats/:id` with `{ "status": "suspended" }`
|
|
71
|
-
This immediately revokes all API tokens for that seat. The plugin falls back to local degraded mode.
|
|
35
|
+
### npm (Recommended)
|
|
72
36
|
|
|
73
|
-
|
|
74
|
-
|
|
37
|
+
```bash
|
|
38
|
+
npm install vibeOS
|
|
39
|
+
```
|
|
75
40
|
|
|
76
|
-
|
|
41
|
+
Register in `~/.config/opencode/opencode.json`:
|
|
77
42
|
|
|
78
|
-
|
|
43
|
+
```json
|
|
44
|
+
"plugins": [
|
|
45
|
+
{ "id": "vibeOS", "path": "node_modules/vibeOS/src/index.js" }
|
|
46
|
+
]
|
|
47
|
+
```
|
|
79
48
|
|
|
80
|
-
|
|
81
|
-
- `medium`
|
|
82
|
-
- `cheap`
|
|
49
|
+
### Local Plugin File
|
|
83
50
|
|
|
84
|
-
|
|
51
|
+
Copy the plugin and lib files to `~/.config/opencode/plugins/`. See the repository for the complete file list.
|
|
85
52
|
|
|
86
|
-
|
|
53
|
+
Register in `~/.config/opencode/opencode.json`:
|
|
87
54
|
|
|
88
|
-
|
|
55
|
+
```json
|
|
56
|
+
"plugins": [
|
|
57
|
+
{ "id": "vibeOS", "path": "~/.config/opencode/plugins/vibeOS.js" }
|
|
58
|
+
]
|
|
59
|
+
```
|
|
89
60
|
|
|
90
|
-
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
61
|
+
Restart OpenCode Desktop. The plugin auto-creates its configuration on first run.
|
|
62
|
+
|
|
63
|
+
## trinity Commands
|
|
64
|
+
|
|
65
|
+
| Command | Description |
|
|
66
|
+
|---|---|
|
|
67
|
+
| `trinity status` | Show current plugin state |
|
|
68
|
+
| `trinity set brain\|medium\|cheap` | Switch model slot |
|
|
69
|
+
| `trinity brain\|medium\|cheap` | Shorthand slot switch |
|
|
70
|
+
| `trinity enable` / `trinity disable` | Toggle plugin on/off |
|
|
71
|
+
| `trinity thinking full\|brief\|off` | Set reasoning depth |
|
|
72
|
+
| `trinity enforce on\|off` | Toggle delegation enforcement |
|
|
73
|
+
| `trinity lock on\|off` | Toggle model locking |
|
|
74
|
+
| `trinity flow on\|off` | Toggle flow enforcer |
|
|
75
|
+
| `trinity flow enforce on\|off` | Toggle auto TODO extraction |
|
|
76
|
+
| `trinity tdd on\|off` | Toggle test skeleton gen |
|
|
77
|
+
| `trinity tdd strict on\|off` | Toggle strict mode |
|
|
78
|
+
| `trinity tdd quality on\|off` | Toggle quality mode |
|
|
79
|
+
| `trinity blackbox on\|off\|status\|reset` | Decision engine controls |
|
|
80
|
+
| `trinity project` | Per-project analytics |
|
|
81
|
+
| `trinity patterns` / `trinity patterns clear` | Inspect / clear patterns |
|
|
82
|
+
| `trinity guard` | Regenerate project guard files |
|
|
83
|
+
| `trinity diagnose` | Run diagnostics |
|
|
84
|
+
| `trinity rebuild` | Auto-detect available models |
|
|
85
|
+
| `trinity help` | Command reference |
|
|
99
86
|
|
|
100
87
|
## Footer Format
|
|
101
88
|
|
|
102
89
|
Typical output footer:
|
|
103
90
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
`— [🧠 deepseek-v4-flash → ⚙ deepseek-chat] | VibeTheOG: 0.01 saved → —`
|
|
109
|
-
|
|
110
|
-
Example (no savings yet, tier label only):
|
|
111
|
-
|
|
112
|
-
`— [⚙ Mid] —`
|
|
113
|
-
|
|
114
|
-
## `trinity` Tool Commands
|
|
115
|
-
|
|
116
|
-
Main commands:
|
|
117
|
-
|
|
118
|
-
- `trinity status`
|
|
119
|
-
- `trinity set brain|medium|cheap`
|
|
120
|
-
- `trinity brain|medium|cheap`
|
|
121
|
-
- `trinity enable` / `trinity disable`
|
|
122
|
-
- `trinity thinking full|brief|off`
|
|
123
|
-
- `trinity enforce` / `trinity enforce on|off`
|
|
124
|
-
- `trinity lock on|off` / `trinity lock`
|
|
125
|
-
- `trinity flow on|off` / `trinity flow enforce on|off` / `trinity flow`
|
|
126
|
-
- `trinity tdd on|off` / `trinity tdd strict on|off` / `trinity tdd quality on|off` / `trinity tdd`
|
|
127
|
-
- `trinity project`
|
|
128
|
-
- `trinity patterns`
|
|
129
|
-
- `trinity patterns clear`
|
|
130
|
-
- `trinity patterns suggest`
|
|
131
|
-
- `trinity repair-state`
|
|
132
|
-
- `trinity guard`
|
|
133
|
-
- `trinity diagnose`
|
|
134
|
-
- `trinity rebuild`
|
|
135
|
-
- `trinity help`
|
|
136
|
-
|
|
137
|
-
## Optional Enforcement Modules
|
|
138
|
-
|
|
139
|
-
- Delegation enforcement:
|
|
140
|
-
- Blocks direct `write`/`edit`/`notebookedit` on high-tier brain when enabled.
|
|
141
|
-
- Adds user-visible enforcement notes.
|
|
142
|
-
- Flow enforcer:
|
|
143
|
-
- Rule checks for write/edit patterns.
|
|
144
|
-
- Optional TODO/FIXME extraction queue when flow enforcement is enabled.
|
|
145
|
-
- TDD enforcer:
|
|
146
|
-
- Auto-creates skeleton tests for changed source files when enabled.
|
|
147
|
-
- Strict mode is ON by default: TODO tests fail loudly until implemented.
|
|
148
|
-
- Project Guard:
|
|
149
|
-
- On session init, checks if AGENTS.md and README.md exist in the project root.
|
|
150
|
-
- Auto-creates AGENTS.md with protective rules (LLM must ask before modifying code).
|
|
151
|
-
- Auto-creates README.md with tech stack auto-detection and feature stubs.
|
|
152
|
-
- Flow rules warn/flag on write/edit to these protected files.
|
|
153
|
-
- System prompt injects directive to maintain both files.
|
|
154
|
-
- `trinity guard` command regenerates both files on demand.
|
|
155
|
-
|
|
156
|
-
## Reports and Audit Tools
|
|
157
|
-
|
|
158
|
-
- `research-audit`
|
|
159
|
-
- `report-save`
|
|
160
|
-
- `report-list`
|
|
161
|
-
- `report-read`
|
|
162
|
-
|
|
163
|
-
These use `~/.claude/reports` and project memory in `~/.claude/project-states.json`.
|
|
164
|
-
|
|
165
|
-
## Pattern Learning
|
|
166
|
-
|
|
167
|
-
- Detects repeated friction signals and recurring successful routines from session behavior.
|
|
168
|
-
- Stores per-project pattern memory in `~/.claude/project-states.json`.
|
|
169
|
-
- Promotes patterns after repeated confirmation across sessions and surfaces them via `trinity patterns`.
|
|
170
|
-
|
|
171
|
-
## Blackbox Decision Engine
|
|
172
|
-
|
|
173
|
-
The blackbox tracks dialogue trajectory per-session and per-project, providing real-time decision state insights:
|
|
174
|
-
|
|
175
|
-
**Enabled by default.**
|
|
176
|
-
|
|
177
|
-
- **Resolution tracking**: Classifies each session into one of 7 sub-regimes (INIT, DIVERGENT, EXPLORING, REFINING, CONVERGING, CLOSED, LOOPING) based on entropy trends, action consistency, feature contradiction, and embedding drift.
|
|
178
|
-
- **Real feature extraction**: Derives 11 features from each user message — message length, word count, question ratio, code blocks, urgency signals, sentiment, complexity, repetition, and instruction density.
|
|
179
|
-
- **Loop prevention**: Detects when the conversation is going in circles and injects escalating system prompt interventions (gentle → suggestive → assertive → escalated) to break the loop.
|
|
180
|
-
- **PIVOT/SWITCH detection**: Recognizes when the user changes context outside the current project scope and injects scope-confirmation directives.
|
|
181
|
-
- **Outcome tracking**: Detects satisfaction signals from assistant responses (positive: "thanks/that works/perfect"; negative: "broken/still failing/wrong") and records them for calibration.
|
|
182
|
-
- **Cross-session continuity**: State persists per project fingerprint in `~/.claude/blackbox-state.json` and remotely in SQLite, allowing resolution state to carry across terminal restarts.
|
|
183
|
-
- **Online calibration**: The API server aggregates session outcomes and auto-tunes loop detection, momentum, and closure thresholds per project via `POST /api/v1/blackbox/calibrate`.
|
|
184
|
-
|
|
185
|
-
Commands:
|
|
186
|
-
- `trinity blackbox on` — Enable the decision engine
|
|
187
|
-
- `trinity blackbox off` — Disable the decision engine
|
|
188
|
-
- `trinity blackbox status` — View current resolution, sub-regime, momentum, loop state, and project history
|
|
189
|
-
- `trinity blackbox reset` — Clear the resolution tracker for the current session
|
|
91
|
+
```
|
|
92
|
+
— [model route] | VibeTheOG: <total> saved <arrow> —
|
|
93
|
+
```
|
|
190
94
|
|
|
95
|
+
The footer shows model split, cumulative savings, stress gauge, and trend arrow.
|
|
191
96
|
|
|
192
|
-
|
|
97
|
+
## Web Dashboard
|
|
193
98
|
|
|
194
|
-
|
|
99
|
+
```bash
|
|
100
|
+
npm run build:dashboard # Build the SPA
|
|
101
|
+
npm run dashboard # Start server on http://127.0.0.1:3333
|
|
102
|
+
```
|
|
195
103
|
|
|
196
|
-
|
|
104
|
+
Displays model split, savings, session history, stress gauge, trinity controls, reports, and blackbox state with SSE push updates every 1.5s.
|
|
197
105
|
|
|
198
|
-
|
|
199
|
-
|---|---|---|---|---|---|---|
|
|
200
|
-
| INIT | budget | relaxed | audit | lazy | cheap | off |
|
|
201
|
-
| EXPLORING / DIVERGENT | budget | relaxed | audit | lazy | cheap | off |
|
|
202
|
-
| REFINING | budget | relaxed | audit | lazy | cheap | off |
|
|
203
|
-
| CONVERGING / CLOSED | quality | strict | strict | quality | brain | full |
|
|
204
|
-
| LOOPING | speed | relaxed | audit | lazy | medium | off |
|
|
106
|
+
## Security
|
|
205
107
|
|
|
206
|
-
|
|
108
|
+
The API token (`VIBEOS_API_TOKEN`) acts as a **password** for your vibeOS seat. Treat it with the same care as any credential.
|
|
207
109
|
|
|
208
|
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
110
|
+
- **Token-based seat auth** — Each token is bound to a seat. Suspending a seat immediately revokes all associated tokens.
|
|
111
|
+
- **Graceful degradation** — If the token is revoked or the API is unreachable, the plugin falls back to local-only mode with bundled algorithms. No functionality is lost; only remote-optimized routing is disabled.
|
|
112
|
+
- **Never commit tokens** — `.env.production` and `PRODUCTION-CREDENTIALS.md` are gitignored. Do not share or hardcode tokens in source files.
|
|
113
|
+
- **Token rotation** — Generate a new token and update `VIBEOS_API_TOKEN` if you suspect a leak. Old tokens are invalidated immediately on seat suspension.
|
|
114
|
+
- **Local-only mode** — Without an API token, all algorithms run locally. Set `VIBEOS_API_ENABLED=false` to explicitly disable all remote calls.
|
|
211
115
|
|
|
212
|
-
##
|
|
116
|
+
## Context7 Cost Optimization
|
|
213
117
|
|
|
214
|
-
|
|
118
|
+
[context7](https://upstash.com/docs/context7) is an MCP tool that resolves library/framework documentation queries at a fraction of the cost of WebFetch (~$0.06/turn saved).
|
|
215
119
|
|
|
216
|
-
|
|
120
|
+
**Install it once:**
|
|
217
121
|
|
|
218
122
|
```bash
|
|
219
|
-
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Then register in `~/.config/opencode/opencode.json`:
|
|
223
|
-
```json
|
|
224
|
-
"plugins": [
|
|
225
|
-
{ "id": "vibeOS", "path": "node_modules/vibeOS/src/index.js" }
|
|
226
|
-
]
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### Local Plugin File
|
|
230
|
-
|
|
231
|
-
For OpenCode Desktop local plugin usage, copy these files to `~/.config/opencode/plugins/`:
|
|
232
|
-
|
|
233
|
-
```
|
|
234
|
-
cp src/index.js ~/.config/opencode/plugins/vibeOS.js
|
|
235
|
-
cp src/vibeOS-lib/flow-enforcer.js ~/.config/opencode/plugins/vibeOS-lib/flow-enforcer.js
|
|
236
|
-
cp src/vibeOS-lib/session-metrics.js ~/.config/opencode/plugins/vibeOS-lib/session-metrics.js
|
|
237
|
-
cp src/vibeOS-lib/flow-rules.json ~/.config/opencode/plugins/vibeOS-lib/flow-rules.json
|
|
238
|
-
cp src/utils/cost-formatter.js ~/.config/opencode/plugins/vibeOS-lib/cost-formatter.js
|
|
239
|
-
cp src/utils/math.js ~/.config/opencode/plugins/vibeOS-lib/math.js
|
|
240
|
-
cp src/utils/timer.js ~/.config/opencode/plugins/vibeOS-lib/timer.js
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
Then register the plugin in `~/.config/opencode/opencode.json`:
|
|
244
|
-
|
|
245
|
-
```json
|
|
246
|
-
"plugins": [
|
|
247
|
-
{ "id": "vibeOS", "path": "~/.config/opencode/plugins/vibeOS.js" }
|
|
248
|
-
]
|
|
123
|
+
claude mcp add context7 npx @upstash/context7-mcp
|
|
249
124
|
```
|
|
250
125
|
|
|
251
|
-
|
|
126
|
+
### How vibeOS uses context7
|
|
252
127
|
|
|
253
|
-
|
|
128
|
+
- **Auto-detection** — At module load, vibeOS scans `~/.claude/settings.json`, `~/.claude.json`, `opencode.json`, and `~/.config/opencode/` for a `context7` reference. No manual config needed.
|
|
129
|
+
- **System prompt injection** — When context7 is detected, a cost-policy directive is injected into every system prompt instructing the model to prefer `mcp__context7__resolve-library-id` and `mcp__context7__get-library-docs` over WebFetch/WebSearch for documentation URLs.
|
|
130
|
+
- **Urgency levels** — Controlled by the blackbox engine:
|
|
131
|
+
- `required` (strict/TDD-strict mode) — context7 is mandatory this turn.
|
|
132
|
+
- `preferred` (default) — context7 is encouraged but not forced.
|
|
133
|
+
- `optional` (relaxed mode) — context7 is a nice-to-have.
|
|
134
|
+
- **Docs nudge** — If context7 is not installed and the model uses WebFetch on a documentation URL (docs.*, readthedocs, MDN, npmjs, pypi, crates.io, pkg.go.dev, etc.), vibeOS logs a one-time install suggestion and tracks the missed savings.
|
|
135
|
+
- **Savings tracking** — Every docs URL fetched via WebFetch instead of context7 is recorded as `missed_context7_usd` in `~/.claude/delegation-state.json`. Accumulated misses appear in `trinity project` analytics with an installation suggestion when bypasses exceed 3.
|
|
254
136
|
|
|
255
|
-
|
|
137
|
+
### Force-enable detection
|
|
256
138
|
|
|
257
139
|
```bash
|
|
258
|
-
|
|
259
|
-
npm run dashboard # Start standalone server on :3333
|
|
260
|
-
npm run dev:dashboard # Vite dev server on :5173 with hot-reload
|
|
140
|
+
export CLAUDE_CONTEXT7_AVAILABLE=true
|
|
261
141
|
```
|
|
262
142
|
|
|
263
|
-
|
|
143
|
+
Use this when context7 is configured but the auto-scan misses it (unusual paths, remote configs, or runtime-loaded MCP definitions).
|
|
264
144
|
|
|
265
|
-
##
|
|
145
|
+
## Environment Variables
|
|
266
146
|
|
|
267
|
-
|
|
268
|
-
|
|
147
|
+
| Variable | Default | Description |
|
|
148
|
+
|---|---|---|
|
|
149
|
+
| `VIBEOS_API_URL` | `https://api.vibetheog.com` | API server URL |
|
|
150
|
+
| `VIBEOS_API_TOKEN` | — | **API token (password). Protect like a credential.** Required for remote mode. If compromised, rotate immediately via seat suspension. |
|
|
151
|
+
| `VIBEOS_API_ENABLED` | `true` | Set to `false` for local-only mode |
|
|
152
|
+
| `CLAUDE_CREDIT_PERCENT` | `100` | Credit percentage override |
|
|
153
|
+
| `CLAUDE_CONTEXT7_AVAILABLE` | — | Enable context7 cost optimization |
|
|
154
|
+
| `CLAUDE_SCRATCHPAD_MAX_AGE_SEC` | `86400` | Scratchpad cache lifetime |
|
|
155
|
+
| `VIBEOS_MCP_PORT` | `3001` | MCP server port |
|
|
269
156
|
|
|
270
|
-
|
|
157
|
+
Without an API token, the plugin runs in local-only mode with all algorithms bundled locally.
|
|
271
158
|
|
|
272
|
-
##
|
|
273
|
-
|
|
274
|
-
GitHub Actions workflows are in `.github/workflows/`:
|
|
159
|
+
## Runtime Model Slots
|
|
275
160
|
|
|
276
|
-
|
|
161
|
+
Tier configuration in `~/.claude/model-tiers.json`:
|
|
277
162
|
|
|
278
|
-
|
|
163
|
+
| Slot | Purpose |
|
|
164
|
+
|---|---|
|
|
165
|
+
| `brain` | High-tier model for orchestration |
|
|
166
|
+
| `medium` | Mid-tier for moderate tasks |
|
|
167
|
+
| `cheap` | Low-tier for delegation subagents |
|
|
279
168
|
|
|
280
|
-
|
|
169
|
+
Use `trinity set brain|medium|cheap` or `trinity rebuild` to configure.
|
|
281
170
|
|
|
282
171
|
## Known Limitations
|
|
283
172
|
|
|
284
|
-
- OpenCode runtime behavior can vary by version
|
|
285
|
-
- Some
|
|
286
|
-
- Savings are estimates, not billing data.
|
|
173
|
+
- OpenCode runtime behavior can vary by version.
|
|
174
|
+
- Some test suite tests may fail due to policy semantic changes rather than actual breakage.
|
|
175
|
+
- Savings displayed are estimates, not billing data.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibeostheog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
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",
|