vibeostheog 0.19.3 → 0.19.4

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.
@@ -99,10 +99,6 @@ const plugin: TuiPlugin = async (api, _options, _meta) => {
99
99
  await poll()
100
100
  const timer = setInterval(poll, 3000)
101
101
 
102
- api.lifecycle.onDispose(() => {
103
- clearInterval(timer)
104
- })
105
-
106
102
  const doAction = async (body: Record<string, unknown>) => {
107
103
  try {
108
104
  const res = await fetch(`${getBaseUrl()}/trinity`, {
@@ -122,6 +118,99 @@ const plugin: TuiPlugin = async (api, _options, _meta) => {
122
118
  }
123
119
  }
124
120
 
121
+ const trinityCommands = [
122
+ {
123
+ title: "vibeOS: trinity",
124
+ value: "trinity",
125
+ description: "Open vibeOS controls and show the current status",
126
+ category: "vibeOS",
127
+ suggested: true,
128
+ slash: {
129
+ name: "trinity",
130
+ aliases: ["vibeos"],
131
+ },
132
+ onSelect: async () => {
133
+ await doAction({ action: "status" })
134
+ },
135
+ },
136
+ {
137
+ title: "vibeOS: trinity status",
138
+ value: "trinity status",
139
+ description: "Show the current tier, savings, and guard state",
140
+ category: "vibeOS",
141
+ slash: {
142
+ name: "trinity-status",
143
+ aliases: ["vibeos-status"],
144
+ },
145
+ onSelect: async () => {
146
+ await doAction({ action: "status" })
147
+ },
148
+ },
149
+ {
150
+ title: "vibeOS: trinity rebuild",
151
+ value: "trinity rebuild",
152
+ description: "Re-detect available models and repopulate the slots",
153
+ category: "vibeOS",
154
+ slash: {
155
+ name: "trinity-rebuild",
156
+ aliases: ["vibeos-rebuild"],
157
+ },
158
+ onSelect: async () => {
159
+ await doAction({ action: "rebuild" })
160
+ },
161
+ },
162
+ {
163
+ title: "vibeOS: trinity brain",
164
+ value: "trinity brain",
165
+ description: "Switch to the brain slot",
166
+ category: "vibeOS",
167
+ slash: {
168
+ name: "trinity-brain",
169
+ aliases: ["trinity-high"],
170
+ },
171
+ onSelect: async () => {
172
+ await doAction({ action: "set", slot: "brain" })
173
+ },
174
+ },
175
+ {
176
+ title: "vibeOS: trinity medium",
177
+ value: "trinity medium",
178
+ description: "Switch to the medium slot",
179
+ category: "vibeOS",
180
+ slash: {
181
+ name: "trinity-medium",
182
+ },
183
+ onSelect: async () => {
184
+ await doAction({ action: "set", slot: "medium" })
185
+ },
186
+ },
187
+ {
188
+ title: "vibeOS: trinity cheap",
189
+ value: "trinity cheap",
190
+ description: "Switch to the cheap slot",
191
+ category: "vibeOS",
192
+ slash: {
193
+ name: "trinity-cheap",
194
+ },
195
+ onSelect: async () => {
196
+ await doAction({ action: "set", slot: "cheap" })
197
+ },
198
+ },
199
+ ]
200
+
201
+ const unregisterTrinityCommands =
202
+ api.keymap?.registerLayer?.({ commands: trinityCommands, bindings: [] }) ??
203
+ api.command?.register?.(() => trinityCommands)
204
+
205
+ api.lifecycle.onDispose(() => {
206
+ clearInterval(timer)
207
+ if (typeof unregisterTrinityCommands === "function") {
208
+ unregisterTrinityCommands()
209
+ } else {
210
+ unregisterTrinityCommands?.dispose?.()
211
+ }
212
+ })
213
+
125
214
  const Slot = api.ui.Slot
126
215
 
127
216
  api.slots.register((props: { session_id: string }) => {
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.19.4
2
+ - feat: register trinity in OpenCode keymap
3
+ - docs: clarify install and trinity usage
4
+
5
+
1
6
  ## 0.19.3
2
7
  - fix: auto-register vibeOS plugin in opencode.json during deploy
3
8
 
package/README.md CHANGED
@@ -24,12 +24,16 @@ It also adds guardrails: delegation enforcement, flow and TDD controls, pattern
24
24
  npm install vibeostheog
25
25
  ```
26
26
 
27
- 2. Register it in `~/.config/opencode/opencode.json`:
27
+ 2. Let OpenCode load the built plugin from its plugin directory.
28
+ The package deploys `src/index.js` to `~/.config/opencode/plugins/vibeOS.js`
29
+ and can auto-register `./plugins/vibeOS.js` in `~/.config/opencode/opencode.json`.
30
+
31
+ 3. If you want to configure it manually, use:
28
32
 
29
33
  ```json
30
34
  {
31
- "plugins": [
32
- { "id": "vibeOS", "path": "node_modules/vibeostheog/src/index.js" }
35
+ "plugin": [
36
+ "./plugins/vibeOS.js"
33
37
  ]
34
38
  }
35
39
  ```
@@ -40,8 +44,8 @@ If you keep a local checkout of the plugin, point OpenCode at the built file ins
40
44
 
41
45
  ```json
42
46
  {
43
- "plugins": [
44
- { "id": "vibeOS", "path": "/absolute/path/to/theSaver-oc/src/index.js" }
47
+ "plugin": [
48
+ "/absolute/path/to/theSaver-oc/src/index.js"
45
49
  ]
46
50
  }
47
51
  ```
@@ -64,7 +68,9 @@ npm run release:patch
64
68
 
65
69
  ## Core Controls
66
70
 
67
- Use `trinity help` for the full command list. The most common controls are:
71
+ `trinity` is an OpenCode plugin command. Run it from inside OpenCode, not from a normal terminal shell. Use `trinity help` for the full command list. The bundled TUI plugin also registers `trinity` and the common slot actions in OpenCode's command palette.
72
+
73
+ The most common controls are:
68
74
 
69
75
  - `trinity status` - show current tier, enforcement, savings, stress, and lock state
70
76
  - `trinity set brain|medium|cheap` - switch the active tier
@@ -109,7 +115,7 @@ Savings are persisted in `~/.claude/delegation-state.json`.
109
115
  | Variable | Default | Purpose |
110
116
  |---|---|---|
111
117
  | `VIBEOS_API_URL` | `https://api.vibetheog.com` | Remote API server URL |
112
- | `VIBEOS_API_TOKEN` | none | Token for remote mode |
118
+ | `VIBEOS_API_TOKEN` | unset | vos_ffa6c7dacb244a03 |
113
119
  | `VIBEOS_API_ENABLED` | `true` | Set to `false` for local-only mode |
114
120
  | `CLAUDE_CREDIT_PERCENT` | `100` | Credit override |
115
121
  | `CLAUDE_CONTEXT7_AVAILABLE` | unset | Enables context7 optimization |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeostheog",
3
- "version": "0.19.3",
3
+ "version": "0.19.4",
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/index.js CHANGED
@@ -3625,7 +3625,7 @@ var MODEL_USD_PER_TURN = {
3625
3625
  "haiku": 22e-4,
3626
3626
  // ── DeepSeek (OC platform + OpenRouter) ──────────────────
3627
3627
  "deepseek/deepseek-v4-pro": 57e-5,
3628
- "deepseek/deepseek-v4-flash": 0.00013,
3628
+ "deepseek/deepseek-v4-flash": 182e-6,
3629
3629
  "deepseek/deepseek-chat": 182e-6,
3630
3630
  "deepseek-chat": 182e-6,
3631
3631
  "deepseek/deepseek-v3": 182e-6,